index.js 808 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246
  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 { requestLog } = __webpack_require__(916);
  48. const {
  49. restEndpointMethods
  50. } = __webpack_require__(842);
  51. const Core = __webpack_require__(529);
  52. const CORE_PLUGINS = [
  53. __webpack_require__(190),
  54. __webpack_require__(19), // deprecated: remove in v17
  55. requestLog,
  56. __webpack_require__(148),
  57. restEndpointMethods,
  58. __webpack_require__(430),
  59. __webpack_require__(850) // deprecated: remove in v17
  60. ];
  61. const OctokitRest = Core.plugin(CORE_PLUGINS);
  62. function DeprecatedOctokit(options) {
  63. const warn =
  64. options && options.log && options.log.warn
  65. ? options.log.warn
  66. : console.warn;
  67. warn(
  68. '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
  69. );
  70. return new OctokitRest(options);
  71. }
  72. const Octokit = Object.assign(DeprecatedOctokit, {
  73. Octokit: OctokitRest
  74. });
  75. Object.keys(OctokitRest).forEach(key => {
  76. /* istanbul ignore else */
  77. if (OctokitRest.hasOwnProperty(key)) {
  78. Octokit[key] = OctokitRest[key];
  79. }
  80. });
  81. module.exports = Octokit;
  82. /***/ }),
  83. /***/ 1:
  84. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  85. "use strict";
  86. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  87. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  88. return new (P || (P = Promise))(function (resolve, reject) {
  89. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  90. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  91. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  92. step((generator = generator.apply(thisArg, _arguments || [])).next());
  93. });
  94. };
  95. Object.defineProperty(exports, "__esModule", { value: true });
  96. const childProcess = __webpack_require__(129);
  97. const path = __webpack_require__(622);
  98. const util_1 = __webpack_require__(669);
  99. const ioUtil = __webpack_require__(672);
  100. const exec = util_1.promisify(childProcess.exec);
  101. /**
  102. * Copies a file or folder.
  103. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  104. *
  105. * @param source source path
  106. * @param dest destination path
  107. * @param options optional. See CopyOptions.
  108. */
  109. function cp(source, dest, options = {}) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const { force, recursive } = readCopyOptions(options);
  112. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  113. // Dest is an existing file, but not forcing
  114. if (destStat && destStat.isFile() && !force) {
  115. return;
  116. }
  117. // If dest is an existing directory, should copy inside.
  118. const newDest = destStat && destStat.isDirectory()
  119. ? path.join(dest, path.basename(source))
  120. : dest;
  121. if (!(yield ioUtil.exists(source))) {
  122. throw new Error(`no such file or directory: ${source}`);
  123. }
  124. const sourceStat = yield ioUtil.stat(source);
  125. if (sourceStat.isDirectory()) {
  126. if (!recursive) {
  127. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  128. }
  129. else {
  130. yield cpDirRecursive(source, newDest, 0, force);
  131. }
  132. }
  133. else {
  134. if (path.relative(source, newDest) === '') {
  135. // a file cannot be copied to itself
  136. throw new Error(`'${newDest}' and '${source}' are the same file`);
  137. }
  138. yield copyFile(source, newDest, force);
  139. }
  140. });
  141. }
  142. exports.cp = cp;
  143. /**
  144. * Moves a path.
  145. *
  146. * @param source source path
  147. * @param dest destination path
  148. * @param options optional. See MoveOptions.
  149. */
  150. function mv(source, dest, options = {}) {
  151. return __awaiter(this, void 0, void 0, function* () {
  152. if (yield ioUtil.exists(dest)) {
  153. let destExists = true;
  154. if (yield ioUtil.isDirectory(dest)) {
  155. // If dest is directory copy src into dest
  156. dest = path.join(dest, path.basename(source));
  157. destExists = yield ioUtil.exists(dest);
  158. }
  159. if (destExists) {
  160. if (options.force == null || options.force) {
  161. yield rmRF(dest);
  162. }
  163. else {
  164. throw new Error('Destination already exists');
  165. }
  166. }
  167. }
  168. yield mkdirP(path.dirname(dest));
  169. yield ioUtil.rename(source, dest);
  170. });
  171. }
  172. exports.mv = mv;
  173. /**
  174. * Remove a path recursively with force
  175. *
  176. * @param inputPath path to remove
  177. */
  178. function rmRF(inputPath) {
  179. return __awaiter(this, void 0, void 0, function* () {
  180. if (ioUtil.IS_WINDOWS) {
  181. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  182. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  183. try {
  184. if (yield ioUtil.isDirectory(inputPath, true)) {
  185. yield exec(`rd /s /q "${inputPath}"`);
  186. }
  187. else {
  188. yield exec(`del /f /a "${inputPath}"`);
  189. }
  190. }
  191. catch (err) {
  192. // if you try to delete a file that doesn't exist, desired result is achieved
  193. // other errors are valid
  194. if (err.code !== 'ENOENT')
  195. throw err;
  196. }
  197. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  198. try {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. catch (err) {
  202. // if you try to delete a file that doesn't exist, desired result is achieved
  203. // other errors are valid
  204. if (err.code !== 'ENOENT')
  205. throw err;
  206. }
  207. }
  208. else {
  209. let isDir = false;
  210. try {
  211. isDir = yield ioUtil.isDirectory(inputPath);
  212. }
  213. catch (err) {
  214. // if you try to delete a file that doesn't exist, desired result is achieved
  215. // other errors are valid
  216. if (err.code !== 'ENOENT')
  217. throw err;
  218. return;
  219. }
  220. if (isDir) {
  221. yield exec(`rm -rf "${inputPath}"`);
  222. }
  223. else {
  224. yield ioUtil.unlink(inputPath);
  225. }
  226. }
  227. });
  228. }
  229. exports.rmRF = rmRF;
  230. /**
  231. * Make a directory. Creates the full path with folders in between
  232. * Will throw if it fails
  233. *
  234. * @param fsPath path to create
  235. * @returns Promise<void>
  236. */
  237. function mkdirP(fsPath) {
  238. return __awaiter(this, void 0, void 0, function* () {
  239. yield ioUtil.mkdirP(fsPath);
  240. });
  241. }
  242. exports.mkdirP = mkdirP;
  243. /**
  244. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  245. * If you check and the tool does not exist, it will throw.
  246. *
  247. * @param tool name of the tool
  248. * @param check whether to check if tool exists
  249. * @returns Promise<string> path to tool
  250. */
  251. function which(tool, check) {
  252. return __awaiter(this, void 0, void 0, function* () {
  253. if (!tool) {
  254. throw new Error("parameter 'tool' is required");
  255. }
  256. // recursive when check=true
  257. if (check) {
  258. const result = yield which(tool, false);
  259. if (!result) {
  260. if (ioUtil.IS_WINDOWS) {
  261. 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.`);
  262. }
  263. else {
  264. 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.`);
  265. }
  266. }
  267. }
  268. try {
  269. // build the list of extensions to try
  270. const extensions = [];
  271. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  272. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  273. if (extension) {
  274. extensions.push(extension);
  275. }
  276. }
  277. }
  278. // if it's rooted, return it if exists. otherwise return empty.
  279. if (ioUtil.isRooted(tool)) {
  280. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  281. if (filePath) {
  282. return filePath;
  283. }
  284. return '';
  285. }
  286. // if any path separators, return empty
  287. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  288. return '';
  289. }
  290. // build the list of directories
  291. //
  292. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  293. // it feels like we should not do this. Checking the current directory seems like more of a use
  294. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  295. // across platforms.
  296. const directories = [];
  297. if (process.env.PATH) {
  298. for (const p of process.env.PATH.split(path.delimiter)) {
  299. if (p) {
  300. directories.push(p);
  301. }
  302. }
  303. }
  304. // return the first match
  305. for (const directory of directories) {
  306. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  307. if (filePath) {
  308. return filePath;
  309. }
  310. }
  311. return '';
  312. }
  313. catch (err) {
  314. throw new Error(`which failed with message ${err.message}`);
  315. }
  316. });
  317. }
  318. exports.which = which;
  319. function readCopyOptions(options) {
  320. const force = options.force == null ? true : options.force;
  321. const recursive = Boolean(options.recursive);
  322. return { force, recursive };
  323. }
  324. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. // Ensure there is not a run away recursive copy
  327. if (currentDepth >= 255)
  328. return;
  329. currentDepth++;
  330. yield mkdirP(destDir);
  331. const files = yield ioUtil.readdir(sourceDir);
  332. for (const fileName of files) {
  333. const srcFile = `${sourceDir}/${fileName}`;
  334. const destFile = `${destDir}/${fileName}`;
  335. const srcFileStat = yield ioUtil.lstat(srcFile);
  336. if (srcFileStat.isDirectory()) {
  337. // Recurse
  338. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  339. }
  340. else {
  341. yield copyFile(srcFile, destFile, force);
  342. }
  343. }
  344. // Change the mode for the newly created directory
  345. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  346. });
  347. }
  348. // Buffered file copy
  349. function copyFile(srcFile, destFile, force) {
  350. return __awaiter(this, void 0, void 0, function* () {
  351. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  352. // unlink/re-link it
  353. try {
  354. yield ioUtil.lstat(destFile);
  355. yield ioUtil.unlink(destFile);
  356. }
  357. catch (e) {
  358. // Try to override file permission
  359. if (e.code === 'EPERM') {
  360. yield ioUtil.chmod(destFile, '0666');
  361. yield ioUtil.unlink(destFile);
  362. }
  363. // other errors = it doesn't exist, no work to do
  364. }
  365. // Copy over symlink
  366. const symlinkFull = yield ioUtil.readlink(srcFile);
  367. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  368. }
  369. else if (!(yield ioUtil.exists(destFile)) || force) {
  370. yield ioUtil.copyFile(srcFile, destFile);
  371. }
  372. });
  373. }
  374. //# sourceMappingURL=io.js.map
  375. /***/ }),
  376. /***/ 2:
  377. /***/ (function(module, __unusedexports, __webpack_require__) {
  378. "use strict";
  379. const os = __webpack_require__(87);
  380. const macosRelease = __webpack_require__(118);
  381. const winRelease = __webpack_require__(49);
  382. const osName = (platform, release) => {
  383. if (!platform && release) {
  384. throw new Error('You can\'t specify a `release` without specifying `platform`');
  385. }
  386. platform = platform || os.platform();
  387. let id;
  388. if (platform === 'darwin') {
  389. if (!release && os.platform() === 'darwin') {
  390. release = os.release();
  391. }
  392. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  393. id = release ? macosRelease(release).name : '';
  394. return prefix + (id ? ' ' + id : '');
  395. }
  396. if (platform === 'linux') {
  397. if (!release && os.platform() === 'linux') {
  398. release = os.release();
  399. }
  400. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  401. return 'Linux' + (id ? ' ' + id : '');
  402. }
  403. if (platform === 'win32') {
  404. if (!release && os.platform() === 'win32') {
  405. release = os.release();
  406. }
  407. id = release ? winRelease(release) : '';
  408. return 'Windows' + (id ? ' ' + id : '');
  409. }
  410. return platform;
  411. };
  412. module.exports = osName;
  413. /***/ }),
  414. /***/ 3:
  415. /***/ (function(module, __unusedexports, __webpack_require__) {
  416. var once = __webpack_require__(969);
  417. var noop = function() {};
  418. var isRequest = function(stream) {
  419. return stream.setHeader && typeof stream.abort === 'function';
  420. };
  421. var isChildProcess = function(stream) {
  422. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  423. };
  424. var eos = function(stream, opts, callback) {
  425. if (typeof opts === 'function') return eos(stream, null, opts);
  426. if (!opts) opts = {};
  427. callback = once(callback || noop);
  428. var ws = stream._writableState;
  429. var rs = stream._readableState;
  430. var readable = opts.readable || (opts.readable !== false && stream.readable);
  431. var writable = opts.writable || (opts.writable !== false && stream.writable);
  432. var cancelled = false;
  433. var onlegacyfinish = function() {
  434. if (!stream.writable) onfinish();
  435. };
  436. var onfinish = function() {
  437. writable = false;
  438. if (!readable) callback.call(stream);
  439. };
  440. var onend = function() {
  441. readable = false;
  442. if (!writable) callback.call(stream);
  443. };
  444. var onexit = function(exitCode) {
  445. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  446. };
  447. var onerror = function(err) {
  448. callback.call(stream, err);
  449. };
  450. var onclose = function() {
  451. process.nextTick(onclosenexttick);
  452. };
  453. var onclosenexttick = function() {
  454. if (cancelled) return;
  455. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  456. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  457. };
  458. var onrequest = function() {
  459. stream.req.on('finish', onfinish);
  460. };
  461. if (isRequest(stream)) {
  462. stream.on('complete', onfinish);
  463. stream.on('abort', onclose);
  464. if (stream.req) onrequest();
  465. else stream.on('request', onrequest);
  466. } else if (writable && !ws) { // legacy streams
  467. stream.on('end', onlegacyfinish);
  468. stream.on('close', onlegacyfinish);
  469. }
  470. if (isChildProcess(stream)) stream.on('exit', onexit);
  471. stream.on('end', onend);
  472. stream.on('finish', onfinish);
  473. if (opts.error !== false) stream.on('error', onerror);
  474. stream.on('close', onclose);
  475. return function() {
  476. cancelled = true;
  477. stream.removeListener('complete', onfinish);
  478. stream.removeListener('abort', onclose);
  479. stream.removeListener('request', onrequest);
  480. if (stream.req) stream.req.removeListener('finish', onfinish);
  481. stream.removeListener('end', onlegacyfinish);
  482. stream.removeListener('close', onlegacyfinish);
  483. stream.removeListener('finish', onfinish);
  484. stream.removeListener('exit', onexit);
  485. stream.removeListener('end', onend);
  486. stream.removeListener('error', onerror);
  487. stream.removeListener('close', onclose);
  488. };
  489. };
  490. module.exports = eos;
  491. /***/ }),
  492. /***/ 9:
  493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  494. "use strict";
  495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  497. return new (P || (P = Promise))(function (resolve, reject) {
  498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  502. });
  503. };
  504. Object.defineProperty(exports, "__esModule", { value: true });
  505. const os = __webpack_require__(87);
  506. const events = __webpack_require__(614);
  507. const child = __webpack_require__(129);
  508. /* eslint-disable @typescript-eslint/unbound-method */
  509. const IS_WINDOWS = process.platform === 'win32';
  510. /*
  511. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  512. */
  513. class ToolRunner extends events.EventEmitter {
  514. constructor(toolPath, args, options) {
  515. super();
  516. if (!toolPath) {
  517. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  518. }
  519. this.toolPath = toolPath;
  520. this.args = args || [];
  521. this.options = options || {};
  522. }
  523. _debug(message) {
  524. if (this.options.listeners && this.options.listeners.debug) {
  525. this.options.listeners.debug(message);
  526. }
  527. }
  528. _getCommandString(options, noPrefix) {
  529. const toolPath = this._getSpawnFileName();
  530. const args = this._getSpawnArgs(options);
  531. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  532. if (IS_WINDOWS) {
  533. // Windows + cmd file
  534. if (this._isCmdFile()) {
  535. cmd += toolPath;
  536. for (const a of args) {
  537. cmd += ` ${a}`;
  538. }
  539. }
  540. // Windows + verbatim
  541. else if (options.windowsVerbatimArguments) {
  542. cmd += `"${toolPath}"`;
  543. for (const a of args) {
  544. cmd += ` ${a}`;
  545. }
  546. }
  547. // Windows (regular)
  548. else {
  549. cmd += this._windowsQuoteCmdArg(toolPath);
  550. for (const a of args) {
  551. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  552. }
  553. }
  554. }
  555. else {
  556. // OSX/Linux - this can likely be improved with some form of quoting.
  557. // creating processes on Unix is fundamentally different than Windows.
  558. // on Unix, execvp() takes an arg array.
  559. cmd += toolPath;
  560. for (const a of args) {
  561. cmd += ` ${a}`;
  562. }
  563. }
  564. return cmd;
  565. }
  566. _processLineBuffer(data, strBuffer, onLine) {
  567. try {
  568. let s = strBuffer + data.toString();
  569. let n = s.indexOf(os.EOL);
  570. while (n > -1) {
  571. const line = s.substring(0, n);
  572. onLine(line);
  573. // the rest of the string ...
  574. s = s.substring(n + os.EOL.length);
  575. n = s.indexOf(os.EOL);
  576. }
  577. strBuffer = s;
  578. }
  579. catch (err) {
  580. // streaming lines to console is best effort. Don't fail a build.
  581. this._debug(`error processing line. Failed with error ${err}`);
  582. }
  583. }
  584. _getSpawnFileName() {
  585. if (IS_WINDOWS) {
  586. if (this._isCmdFile()) {
  587. return process.env['COMSPEC'] || 'cmd.exe';
  588. }
  589. }
  590. return this.toolPath;
  591. }
  592. _getSpawnArgs(options) {
  593. if (IS_WINDOWS) {
  594. if (this._isCmdFile()) {
  595. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  596. for (const a of this.args) {
  597. argline += ' ';
  598. argline += options.windowsVerbatimArguments
  599. ? a
  600. : this._windowsQuoteCmdArg(a);
  601. }
  602. argline += '"';
  603. return [argline];
  604. }
  605. }
  606. return this.args;
  607. }
  608. _endsWith(str, end) {
  609. return str.endsWith(end);
  610. }
  611. _isCmdFile() {
  612. const upperToolPath = this.toolPath.toUpperCase();
  613. return (this._endsWith(upperToolPath, '.CMD') ||
  614. this._endsWith(upperToolPath, '.BAT'));
  615. }
  616. _windowsQuoteCmdArg(arg) {
  617. // for .exe, apply the normal quoting rules that libuv applies
  618. if (!this._isCmdFile()) {
  619. return this._uvQuoteCmdArg(arg);
  620. }
  621. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  622. // the libuv rules are generic and are not designed specifically for cmd.exe
  623. // command line parser.
  624. //
  625. // for a detailed description of the cmd.exe command line parser, refer to
  626. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  627. // need quotes for empty arg
  628. if (!arg) {
  629. return '""';
  630. }
  631. // determine whether the arg needs to be quoted
  632. const cmdSpecialChars = [
  633. ' ',
  634. '\t',
  635. '&',
  636. '(',
  637. ')',
  638. '[',
  639. ']',
  640. '{',
  641. '}',
  642. '^',
  643. '=',
  644. ';',
  645. '!',
  646. "'",
  647. '+',
  648. ',',
  649. '`',
  650. '~',
  651. '|',
  652. '<',
  653. '>',
  654. '"'
  655. ];
  656. let needsQuotes = false;
  657. for (const char of arg) {
  658. if (cmdSpecialChars.some(x => x === char)) {
  659. needsQuotes = true;
  660. break;
  661. }
  662. }
  663. // short-circuit if quotes not needed
  664. if (!needsQuotes) {
  665. return arg;
  666. }
  667. // the following quoting rules are very similar to the rules that by libuv applies.
  668. //
  669. // 1) wrap the string in quotes
  670. //
  671. // 2) double-up quotes - i.e. " => ""
  672. //
  673. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  674. // doesn't work well with a cmd.exe command line.
  675. //
  676. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  677. // for example, the command line:
  678. // foo.exe "myarg:""my val"""
  679. // is parsed by a .NET console app into an arg array:
  680. // [ "myarg:\"my val\"" ]
  681. // which is the same end result when applying libuv quoting rules. although the actual
  682. // command line from libuv quoting rules would look like:
  683. // foo.exe "myarg:\"my val\""
  684. //
  685. // 3) double-up slashes that precede a quote,
  686. // e.g. hello \world => "hello \world"
  687. // hello\"world => "hello\\""world"
  688. // hello\\"world => "hello\\\\""world"
  689. // hello world\ => "hello world\\"
  690. //
  691. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  692. // the reasons for including this as a .cmd quoting rule are:
  693. //
  694. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  695. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  696. //
  697. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  698. // haven't heard any complaints about that aspect.
  699. //
  700. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  701. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  702. // by using %%.
  703. //
  704. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  705. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  706. //
  707. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  708. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  709. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  710. // to an external program.
  711. //
  712. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  713. // % can be escaped within a .cmd file.
  714. let reverse = '"';
  715. let quoteHit = true;
  716. for (let i = arg.length; i > 0; i--) {
  717. // walk the string in reverse
  718. reverse += arg[i - 1];
  719. if (quoteHit && arg[i - 1] === '\\') {
  720. reverse += '\\'; // double the slash
  721. }
  722. else if (arg[i - 1] === '"') {
  723. quoteHit = true;
  724. reverse += '"'; // double the quote
  725. }
  726. else {
  727. quoteHit = false;
  728. }
  729. }
  730. reverse += '"';
  731. return reverse
  732. .split('')
  733. .reverse()
  734. .join('');
  735. }
  736. _uvQuoteCmdArg(arg) {
  737. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  738. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  739. // is used.
  740. //
  741. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  742. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  743. // pasting copyright notice from Node within this function:
  744. //
  745. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  746. //
  747. // Permission is hereby granted, free of charge, to any person obtaining a copy
  748. // of this software and associated documentation files (the "Software"), to
  749. // deal in the Software without restriction, including without limitation the
  750. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  751. // sell copies of the Software, and to permit persons to whom the Software is
  752. // furnished to do so, subject to the following conditions:
  753. //
  754. // The above copyright notice and this permission notice shall be included in
  755. // all copies or substantial portions of the Software.
  756. //
  757. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  758. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  759. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  760. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  761. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  762. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  763. // IN THE SOFTWARE.
  764. if (!arg) {
  765. // Need double quotation for empty argument
  766. return '""';
  767. }
  768. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  769. // No quotation needed
  770. return arg;
  771. }
  772. if (!arg.includes('"') && !arg.includes('\\')) {
  773. // No embedded double quotes or backslashes, so I can just wrap
  774. // quote marks around the whole thing.
  775. return `"${arg}"`;
  776. }
  777. // Expected input/output:
  778. // input : hello"world
  779. // output: "hello\"world"
  780. // input : hello""world
  781. // output: "hello\"\"world"
  782. // input : hello\world
  783. // output: hello\world
  784. // input : hello\\world
  785. // output: hello\\world
  786. // input : hello\"world
  787. // output: "hello\\\"world"
  788. // input : hello\\"world
  789. // output: "hello\\\\\"world"
  790. // input : hello world\
  791. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  792. // but it appears the comment is wrong, it should be "hello world\\"
  793. let reverse = '"';
  794. let quoteHit = true;
  795. for (let i = arg.length; i > 0; i--) {
  796. // walk the string in reverse
  797. reverse += arg[i - 1];
  798. if (quoteHit && arg[i - 1] === '\\') {
  799. reverse += '\\';
  800. }
  801. else if (arg[i - 1] === '"') {
  802. quoteHit = true;
  803. reverse += '\\';
  804. }
  805. else {
  806. quoteHit = false;
  807. }
  808. }
  809. reverse += '"';
  810. return reverse
  811. .split('')
  812. .reverse()
  813. .join('');
  814. }
  815. _cloneExecOptions(options) {
  816. options = options || {};
  817. const result = {
  818. cwd: options.cwd || process.cwd(),
  819. env: options.env || process.env,
  820. silent: options.silent || false,
  821. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  822. failOnStdErr: options.failOnStdErr || false,
  823. ignoreReturnCode: options.ignoreReturnCode || false,
  824. delay: options.delay || 10000
  825. };
  826. result.outStream = options.outStream || process.stdout;
  827. result.errStream = options.errStream || process.stderr;
  828. return result;
  829. }
  830. _getSpawnOptions(options, toolPath) {
  831. options = options || {};
  832. const result = {};
  833. result.cwd = options.cwd;
  834. result.env = options.env;
  835. result['windowsVerbatimArguments'] =
  836. options.windowsVerbatimArguments || this._isCmdFile();
  837. if (options.windowsVerbatimArguments) {
  838. result.argv0 = `"${toolPath}"`;
  839. }
  840. return result;
  841. }
  842. /**
  843. * Exec a tool.
  844. * Output will be streamed to the live console.
  845. * Returns promise with return code
  846. *
  847. * @param tool path to tool to exec
  848. * @param options optional exec options. See ExecOptions
  849. * @returns number
  850. */
  851. exec() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return new Promise((resolve, reject) => {
  854. this._debug(`exec tool: ${this.toolPath}`);
  855. this._debug('arguments:');
  856. for (const arg of this.args) {
  857. this._debug(` ${arg}`);
  858. }
  859. const optionsNonNull = this._cloneExecOptions(this.options);
  860. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  861. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  862. }
  863. const state = new ExecState(optionsNonNull, this.toolPath);
  864. state.on('debug', (message) => {
  865. this._debug(message);
  866. });
  867. const fileName = this._getSpawnFileName();
  868. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  869. const stdbuffer = '';
  870. if (cp.stdout) {
  871. cp.stdout.on('data', (data) => {
  872. if (this.options.listeners && this.options.listeners.stdout) {
  873. this.options.listeners.stdout(data);
  874. }
  875. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  876. optionsNonNull.outStream.write(data);
  877. }
  878. this._processLineBuffer(data, stdbuffer, (line) => {
  879. if (this.options.listeners && this.options.listeners.stdline) {
  880. this.options.listeners.stdline(line);
  881. }
  882. });
  883. });
  884. }
  885. const errbuffer = '';
  886. if (cp.stderr) {
  887. cp.stderr.on('data', (data) => {
  888. state.processStderr = true;
  889. if (this.options.listeners && this.options.listeners.stderr) {
  890. this.options.listeners.stderr(data);
  891. }
  892. if (!optionsNonNull.silent &&
  893. optionsNonNull.errStream &&
  894. optionsNonNull.outStream) {
  895. const s = optionsNonNull.failOnStdErr
  896. ? optionsNonNull.errStream
  897. : optionsNonNull.outStream;
  898. s.write(data);
  899. }
  900. this._processLineBuffer(data, errbuffer, (line) => {
  901. if (this.options.listeners && this.options.listeners.errline) {
  902. this.options.listeners.errline(line);
  903. }
  904. });
  905. });
  906. }
  907. cp.on('error', (err) => {
  908. state.processError = err.message;
  909. state.processExited = true;
  910. state.processClosed = true;
  911. state.CheckComplete();
  912. });
  913. cp.on('exit', (code) => {
  914. state.processExitCode = code;
  915. state.processExited = true;
  916. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  917. state.CheckComplete();
  918. });
  919. cp.on('close', (code) => {
  920. state.processExitCode = code;
  921. state.processExited = true;
  922. state.processClosed = true;
  923. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  924. state.CheckComplete();
  925. });
  926. state.on('done', (error, exitCode) => {
  927. if (stdbuffer.length > 0) {
  928. this.emit('stdline', stdbuffer);
  929. }
  930. if (errbuffer.length > 0) {
  931. this.emit('errline', errbuffer);
  932. }
  933. cp.removeAllListeners();
  934. if (error) {
  935. reject(error);
  936. }
  937. else {
  938. resolve(exitCode);
  939. }
  940. });
  941. });
  942. });
  943. }
  944. }
  945. exports.ToolRunner = ToolRunner;
  946. /**
  947. * Convert an arg string to an array of args. Handles escaping
  948. *
  949. * @param argString string of arguments
  950. * @returns string[] array of arguments
  951. */
  952. function argStringToArray(argString) {
  953. const args = [];
  954. let inQuotes = false;
  955. let escaped = false;
  956. let arg = '';
  957. function append(c) {
  958. // we only escape double quotes.
  959. if (escaped && c !== '"') {
  960. arg += '\\';
  961. }
  962. arg += c;
  963. escaped = false;
  964. }
  965. for (let i = 0; i < argString.length; i++) {
  966. const c = argString.charAt(i);
  967. if (c === '"') {
  968. if (!escaped) {
  969. inQuotes = !inQuotes;
  970. }
  971. else {
  972. append(c);
  973. }
  974. continue;
  975. }
  976. if (c === '\\' && escaped) {
  977. append(c);
  978. continue;
  979. }
  980. if (c === '\\' && inQuotes) {
  981. escaped = true;
  982. continue;
  983. }
  984. if (c === ' ' && !inQuotes) {
  985. if (arg.length > 0) {
  986. args.push(arg);
  987. arg = '';
  988. }
  989. continue;
  990. }
  991. append(c);
  992. }
  993. if (arg.length > 0) {
  994. args.push(arg.trim());
  995. }
  996. return args;
  997. }
  998. exports.argStringToArray = argStringToArray;
  999. class ExecState extends events.EventEmitter {
  1000. constructor(options, toolPath) {
  1001. super();
  1002. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1003. this.processError = '';
  1004. this.processExitCode = 0;
  1005. this.processExited = false; // tracks whether the process has exited
  1006. this.processStderr = false; // tracks whether stderr was written to
  1007. this.delay = 10000; // 10 seconds
  1008. this.done = false;
  1009. this.timeout = null;
  1010. if (!toolPath) {
  1011. throw new Error('toolPath must not be empty');
  1012. }
  1013. this.options = options;
  1014. this.toolPath = toolPath;
  1015. if (options.delay) {
  1016. this.delay = options.delay;
  1017. }
  1018. }
  1019. CheckComplete() {
  1020. if (this.done) {
  1021. return;
  1022. }
  1023. if (this.processClosed) {
  1024. this._setResult();
  1025. }
  1026. else if (this.processExited) {
  1027. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1028. }
  1029. }
  1030. _debug(message) {
  1031. this.emit('debug', message);
  1032. }
  1033. _setResult() {
  1034. // determine whether there is an error
  1035. let error;
  1036. if (this.processExited) {
  1037. if (this.processError) {
  1038. 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}`);
  1039. }
  1040. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1041. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1042. }
  1043. else if (this.processStderr && this.options.failOnStdErr) {
  1044. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1045. }
  1046. }
  1047. // clear the timeout
  1048. if (this.timeout) {
  1049. clearTimeout(this.timeout);
  1050. this.timeout = null;
  1051. }
  1052. this.done = true;
  1053. this.emit('done', error, this.processExitCode);
  1054. }
  1055. static HandleTimeout(state) {
  1056. if (state.done) {
  1057. return;
  1058. }
  1059. if (!state.processClosed && state.processExited) {
  1060. const message = `The STDIO streams did not close within ${state.delay /
  1061. 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.`;
  1062. state._debug(message);
  1063. }
  1064. state._setResult();
  1065. }
  1066. }
  1067. //# sourceMappingURL=toolrunner.js.map
  1068. /***/ }),
  1069. /***/ 11:
  1070. /***/ (function(module) {
  1071. // Returns a wrapper function that returns a wrapped callback
  1072. // The wrapper function should do some stuff, and return a
  1073. // presumably different callback function.
  1074. // This makes sure that own properties are retained, so that
  1075. // decorations and such are not lost along the way.
  1076. module.exports = wrappy
  1077. function wrappy (fn, cb) {
  1078. if (fn && cb) return wrappy(fn)(cb)
  1079. if (typeof fn !== 'function')
  1080. throw new TypeError('need wrapper function')
  1081. Object.keys(fn).forEach(function (k) {
  1082. wrapper[k] = fn[k]
  1083. })
  1084. return wrapper
  1085. function wrapper() {
  1086. var args = new Array(arguments.length)
  1087. for (var i = 0; i < args.length; i++) {
  1088. args[i] = arguments[i]
  1089. }
  1090. var ret = fn.apply(this, args)
  1091. var cb = args[args.length-1]
  1092. if (typeof ret === 'function' && ret !== cb) {
  1093. Object.keys(cb).forEach(function (k) {
  1094. ret[k] = cb[k]
  1095. })
  1096. }
  1097. return ret
  1098. }
  1099. }
  1100. /***/ }),
  1101. /***/ 16:
  1102. /***/ (function(module) {
  1103. module.exports = require("tls");
  1104. /***/ }),
  1105. /***/ 18:
  1106. /***/ (function() {
  1107. eval("require")("encoding");
  1108. /***/ }),
  1109. /***/ 19:
  1110. /***/ (function(module, __unusedexports, __webpack_require__) {
  1111. module.exports = authenticationPlugin;
  1112. const { Deprecation } = __webpack_require__(692);
  1113. const once = __webpack_require__(969);
  1114. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1115. const authenticate = __webpack_require__(674);
  1116. const beforeRequest = __webpack_require__(471);
  1117. const requestError = __webpack_require__(349);
  1118. function authenticationPlugin(octokit, options) {
  1119. if (options.auth) {
  1120. octokit.authenticate = () => {
  1121. deprecateAuthenticate(
  1122. octokit.log,
  1123. new Deprecation(
  1124. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1125. )
  1126. );
  1127. };
  1128. return;
  1129. }
  1130. const state = {
  1131. octokit,
  1132. auth: false
  1133. };
  1134. octokit.authenticate = authenticate.bind(null, state);
  1135. octokit.hook.before("request", beforeRequest.bind(null, state));
  1136. octokit.hook.error("request", requestError.bind(null, state));
  1137. }
  1138. /***/ }),
  1139. /***/ 20:
  1140. /***/ (function(module, __unusedexports, __webpack_require__) {
  1141. "use strict";
  1142. const cp = __webpack_require__(129);
  1143. const parse = __webpack_require__(568);
  1144. const enoent = __webpack_require__(881);
  1145. function spawn(command, args, options) {
  1146. // Parse the arguments
  1147. const parsed = parse(command, args, options);
  1148. // Spawn the child process
  1149. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1150. // Hook into child process "exit" event to emit an error if the command
  1151. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1152. enoent.hookChildProcess(spawned, parsed);
  1153. return spawned;
  1154. }
  1155. function spawnSync(command, args, options) {
  1156. // Parse the arguments
  1157. const parsed = parse(command, args, options);
  1158. // Spawn the child process
  1159. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1160. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1161. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1162. return result;
  1163. }
  1164. module.exports = spawn;
  1165. module.exports.spawn = spawn;
  1166. module.exports.sync = spawnSync;
  1167. module.exports._parse = parse;
  1168. module.exports._enoent = enoent;
  1169. /***/ }),
  1170. /***/ 34:
  1171. /***/ (function(module) {
  1172. module.exports = require("https");
  1173. /***/ }),
  1174. /***/ 39:
  1175. /***/ (function(module) {
  1176. "use strict";
  1177. module.exports = opts => {
  1178. opts = opts || {};
  1179. const env = opts.env || process.env;
  1180. const platform = opts.platform || process.platform;
  1181. if (platform !== 'win32') {
  1182. return 'PATH';
  1183. }
  1184. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1185. };
  1186. /***/ }),
  1187. /***/ 47:
  1188. /***/ (function(module, __unusedexports, __webpack_require__) {
  1189. module.exports = factory;
  1190. const Octokit = __webpack_require__(402);
  1191. const registerPlugin = __webpack_require__(855);
  1192. function factory(plugins) {
  1193. const Api = Octokit.bind(null, plugins || []);
  1194. Api.plugin = registerPlugin.bind(null, plugins || []);
  1195. return Api;
  1196. }
  1197. /***/ }),
  1198. /***/ 49:
  1199. /***/ (function(module, __unusedexports, __webpack_require__) {
  1200. "use strict";
  1201. const os = __webpack_require__(87);
  1202. const execa = __webpack_require__(955);
  1203. // Reference: https://www.gaijin.at/en/lstwinver.php
  1204. const names = new Map([
  1205. ['10.0', '10'],
  1206. ['6.3', '8.1'],
  1207. ['6.2', '8'],
  1208. ['6.1', '7'],
  1209. ['6.0', 'Vista'],
  1210. ['5.2', 'Server 2003'],
  1211. ['5.1', 'XP'],
  1212. ['5.0', '2000'],
  1213. ['4.9', 'ME'],
  1214. ['4.1', '98'],
  1215. ['4.0', '95']
  1216. ]);
  1217. const windowsRelease = release => {
  1218. const version = /\d+\.\d/.exec(release || os.release());
  1219. if (release && !version) {
  1220. throw new Error('`release` argument doesn\'t match `n.n`');
  1221. }
  1222. const ver = (version || [])[0];
  1223. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
  1224. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1225. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1226. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
  1227. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
  1228. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1229. let stdout;
  1230. try {
  1231. stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
  1232. } catch (_) {
  1233. stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1234. }
  1235. const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
  1236. if (year) {
  1237. return `Server ${year}`;
  1238. }
  1239. }
  1240. return names.get(ver);
  1241. };
  1242. module.exports = windowsRelease;
  1243. /***/ }),
  1244. /***/ 81:
  1245. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1246. "use strict";
  1247. var __importStar = (this && this.__importStar) || function (mod) {
  1248. if (mod && mod.__esModule) return mod;
  1249. var result = {};
  1250. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1251. result["default"] = mod;
  1252. return result;
  1253. };
  1254. Object.defineProperty(exports, "__esModule", { value: true });
  1255. const assert = __importStar(__webpack_require__(357));
  1256. const url_1 = __webpack_require__(835);
  1257. function getFetchUrl(settings) {
  1258. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1259. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1260. const serviceUrl = getServerUrl();
  1261. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1262. const encodedName = encodeURIComponent(settings.repositoryName);
  1263. if (settings.sshKey) {
  1264. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1265. }
  1266. // "origin" is SCHEME://HOSTNAME[:PORT]
  1267. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1268. }
  1269. exports.getFetchUrl = getFetchUrl;
  1270. function getServerUrl() {
  1271. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  1272. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  1273. process.env['GITHUB_URL'] ||
  1274. 'https://github.com');
  1275. }
  1276. exports.getServerUrl = getServerUrl;
  1277. /***/ }),
  1278. /***/ 87:
  1279. /***/ (function(module) {
  1280. module.exports = require("os");
  1281. /***/ }),
  1282. /***/ 118:
  1283. /***/ (function(module, __unusedexports, __webpack_require__) {
  1284. "use strict";
  1285. const os = __webpack_require__(87);
  1286. const nameMap = new Map([
  1287. [19, 'Catalina'],
  1288. [18, 'Mojave'],
  1289. [17, 'High Sierra'],
  1290. [16, 'Sierra'],
  1291. [15, 'El Capitan'],
  1292. [14, 'Yosemite'],
  1293. [13, 'Mavericks'],
  1294. [12, 'Mountain Lion'],
  1295. [11, 'Lion'],
  1296. [10, 'Snow Leopard'],
  1297. [9, 'Leopard'],
  1298. [8, 'Tiger'],
  1299. [7, 'Panther'],
  1300. [6, 'Jaguar'],
  1301. [5, 'Puma']
  1302. ]);
  1303. const macosRelease = release => {
  1304. release = Number((release || os.release()).split('.')[0]);
  1305. return {
  1306. name: nameMap.get(release),
  1307. version: '10.' + (release - 4)
  1308. };
  1309. };
  1310. module.exports = macosRelease;
  1311. // TODO: remove this in the next major version
  1312. module.exports.default = macosRelease;
  1313. /***/ }),
  1314. /***/ 126:
  1315. /***/ (function(module) {
  1316. /**
  1317. * lodash (Custom Build) <https://lodash.com/>
  1318. * Build: `lodash modularize exports="npm" -o ./`
  1319. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1320. * Released under MIT license <https://lodash.com/license>
  1321. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1322. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1323. */
  1324. /** Used as the size to enable large array optimizations. */
  1325. var LARGE_ARRAY_SIZE = 200;
  1326. /** Used to stand-in for `undefined` hash values. */
  1327. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1328. /** Used as references for various `Number` constants. */
  1329. var INFINITY = 1 / 0;
  1330. /** `Object#toString` result references. */
  1331. var funcTag = '[object Function]',
  1332. genTag = '[object GeneratorFunction]';
  1333. /**
  1334. * Used to match `RegExp`
  1335. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1336. */
  1337. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1338. /** Used to detect host constructors (Safari). */
  1339. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1340. /** Detect free variable `global` from Node.js. */
  1341. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1342. /** Detect free variable `self`. */
  1343. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1344. /** Used as a reference to the global object. */
  1345. var root = freeGlobal || freeSelf || Function('return this')();
  1346. /**
  1347. * A specialized version of `_.includes` for arrays without support for
  1348. * specifying an index to search from.
  1349. *
  1350. * @private
  1351. * @param {Array} [array] The array to inspect.
  1352. * @param {*} target The value to search for.
  1353. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1354. */
  1355. function arrayIncludes(array, value) {
  1356. var length = array ? array.length : 0;
  1357. return !!length && baseIndexOf(array, value, 0) > -1;
  1358. }
  1359. /**
  1360. * This function is like `arrayIncludes` except that it accepts a comparator.
  1361. *
  1362. * @private
  1363. * @param {Array} [array] The array to inspect.
  1364. * @param {*} target The value to search for.
  1365. * @param {Function} comparator The comparator invoked per element.
  1366. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1367. */
  1368. function arrayIncludesWith(array, value, comparator) {
  1369. var index = -1,
  1370. length = array ? array.length : 0;
  1371. while (++index < length) {
  1372. if (comparator(value, array[index])) {
  1373. return true;
  1374. }
  1375. }
  1376. return false;
  1377. }
  1378. /**
  1379. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1380. * support for iteratee shorthands.
  1381. *
  1382. * @private
  1383. * @param {Array} array The array to inspect.
  1384. * @param {Function} predicate The function invoked per iteration.
  1385. * @param {number} fromIndex The index to search from.
  1386. * @param {boolean} [fromRight] Specify iterating from right to left.
  1387. * @returns {number} Returns the index of the matched value, else `-1`.
  1388. */
  1389. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1390. var length = array.length,
  1391. index = fromIndex + (fromRight ? 1 : -1);
  1392. while ((fromRight ? index-- : ++index < length)) {
  1393. if (predicate(array[index], index, array)) {
  1394. return index;
  1395. }
  1396. }
  1397. return -1;
  1398. }
  1399. /**
  1400. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1401. *
  1402. * @private
  1403. * @param {Array} array The array to inspect.
  1404. * @param {*} value The value to search for.
  1405. * @param {number} fromIndex The index to search from.
  1406. * @returns {number} Returns the index of the matched value, else `-1`.
  1407. */
  1408. function baseIndexOf(array, value, fromIndex) {
  1409. if (value !== value) {
  1410. return baseFindIndex(array, baseIsNaN, fromIndex);
  1411. }
  1412. var index = fromIndex - 1,
  1413. length = array.length;
  1414. while (++index < length) {
  1415. if (array[index] === value) {
  1416. return index;
  1417. }
  1418. }
  1419. return -1;
  1420. }
  1421. /**
  1422. * The base implementation of `_.isNaN` without support for number objects.
  1423. *
  1424. * @private
  1425. * @param {*} value The value to check.
  1426. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1427. */
  1428. function baseIsNaN(value) {
  1429. return value !== value;
  1430. }
  1431. /**
  1432. * Checks if a cache value for `key` exists.
  1433. *
  1434. * @private
  1435. * @param {Object} cache The cache to query.
  1436. * @param {string} key The key of the entry to check.
  1437. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1438. */
  1439. function cacheHas(cache, key) {
  1440. return cache.has(key);
  1441. }
  1442. /**
  1443. * Gets the value at `key` of `object`.
  1444. *
  1445. * @private
  1446. * @param {Object} [object] The object to query.
  1447. * @param {string} key The key of the property to get.
  1448. * @returns {*} Returns the property value.
  1449. */
  1450. function getValue(object, key) {
  1451. return object == null ? undefined : object[key];
  1452. }
  1453. /**
  1454. * Checks if `value` is a host object in IE < 9.
  1455. *
  1456. * @private
  1457. * @param {*} value The value to check.
  1458. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1459. */
  1460. function isHostObject(value) {
  1461. // Many host objects are `Object` objects that can coerce to strings
  1462. // despite having improperly defined `toString` methods.
  1463. var result = false;
  1464. if (value != null && typeof value.toString != 'function') {
  1465. try {
  1466. result = !!(value + '');
  1467. } catch (e) {}
  1468. }
  1469. return result;
  1470. }
  1471. /**
  1472. * Converts `set` to an array of its values.
  1473. *
  1474. * @private
  1475. * @param {Object} set The set to convert.
  1476. * @returns {Array} Returns the values.
  1477. */
  1478. function setToArray(set) {
  1479. var index = -1,
  1480. result = Array(set.size);
  1481. set.forEach(function(value) {
  1482. result[++index] = value;
  1483. });
  1484. return result;
  1485. }
  1486. /** Used for built-in method references. */
  1487. var arrayProto = Array.prototype,
  1488. funcProto = Function.prototype,
  1489. objectProto = Object.prototype;
  1490. /** Used to detect overreaching core-js shims. */
  1491. var coreJsData = root['__core-js_shared__'];
  1492. /** Used to detect methods masquerading as native. */
  1493. var maskSrcKey = (function() {
  1494. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1495. return uid ? ('Symbol(src)_1.' + uid) : '';
  1496. }());
  1497. /** Used to resolve the decompiled source of functions. */
  1498. var funcToString = funcProto.toString;
  1499. /** Used to check objects for own properties. */
  1500. var hasOwnProperty = objectProto.hasOwnProperty;
  1501. /**
  1502. * Used to resolve the
  1503. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1504. * of values.
  1505. */
  1506. var objectToString = objectProto.toString;
  1507. /** Used to detect if a method is native. */
  1508. var reIsNative = RegExp('^' +
  1509. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1510. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1511. );
  1512. /** Built-in value references. */
  1513. var splice = arrayProto.splice;
  1514. /* Built-in method references that are verified to be native. */
  1515. var Map = getNative(root, 'Map'),
  1516. Set = getNative(root, 'Set'),
  1517. nativeCreate = getNative(Object, 'create');
  1518. /**
  1519. * Creates a hash object.
  1520. *
  1521. * @private
  1522. * @constructor
  1523. * @param {Array} [entries] The key-value pairs to cache.
  1524. */
  1525. function Hash(entries) {
  1526. var index = -1,
  1527. length = entries ? entries.length : 0;
  1528. this.clear();
  1529. while (++index < length) {
  1530. var entry = entries[index];
  1531. this.set(entry[0], entry[1]);
  1532. }
  1533. }
  1534. /**
  1535. * Removes all key-value entries from the hash.
  1536. *
  1537. * @private
  1538. * @name clear
  1539. * @memberOf Hash
  1540. */
  1541. function hashClear() {
  1542. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1543. }
  1544. /**
  1545. * Removes `key` and its value from the hash.
  1546. *
  1547. * @private
  1548. * @name delete
  1549. * @memberOf Hash
  1550. * @param {Object} hash The hash to modify.
  1551. * @param {string} key The key of the value to remove.
  1552. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1553. */
  1554. function hashDelete(key) {
  1555. return this.has(key) && delete this.__data__[key];
  1556. }
  1557. /**
  1558. * Gets the hash value for `key`.
  1559. *
  1560. * @private
  1561. * @name get
  1562. * @memberOf Hash
  1563. * @param {string} key The key of the value to get.
  1564. * @returns {*} Returns the entry value.
  1565. */
  1566. function hashGet(key) {
  1567. var data = this.__data__;
  1568. if (nativeCreate) {
  1569. var result = data[key];
  1570. return result === HASH_UNDEFINED ? undefined : result;
  1571. }
  1572. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1573. }
  1574. /**
  1575. * Checks if a hash value for `key` exists.
  1576. *
  1577. * @private
  1578. * @name has
  1579. * @memberOf Hash
  1580. * @param {string} key The key of the entry to check.
  1581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1582. */
  1583. function hashHas(key) {
  1584. var data = this.__data__;
  1585. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1586. }
  1587. /**
  1588. * Sets the hash `key` to `value`.
  1589. *
  1590. * @private
  1591. * @name set
  1592. * @memberOf Hash
  1593. * @param {string} key The key of the value to set.
  1594. * @param {*} value The value to set.
  1595. * @returns {Object} Returns the hash instance.
  1596. */
  1597. function hashSet(key, value) {
  1598. var data = this.__data__;
  1599. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1600. return this;
  1601. }
  1602. // Add methods to `Hash`.
  1603. Hash.prototype.clear = hashClear;
  1604. Hash.prototype['delete'] = hashDelete;
  1605. Hash.prototype.get = hashGet;
  1606. Hash.prototype.has = hashHas;
  1607. Hash.prototype.set = hashSet;
  1608. /**
  1609. * Creates an list cache object.
  1610. *
  1611. * @private
  1612. * @constructor
  1613. * @param {Array} [entries] The key-value pairs to cache.
  1614. */
  1615. function ListCache(entries) {
  1616. var index = -1,
  1617. length = entries ? entries.length : 0;
  1618. this.clear();
  1619. while (++index < length) {
  1620. var entry = entries[index];
  1621. this.set(entry[0], entry[1]);
  1622. }
  1623. }
  1624. /**
  1625. * Removes all key-value entries from the list cache.
  1626. *
  1627. * @private
  1628. * @name clear
  1629. * @memberOf ListCache
  1630. */
  1631. function listCacheClear() {
  1632. this.__data__ = [];
  1633. }
  1634. /**
  1635. * Removes `key` and its value from the list cache.
  1636. *
  1637. * @private
  1638. * @name delete
  1639. * @memberOf ListCache
  1640. * @param {string} key The key of the value to remove.
  1641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1642. */
  1643. function listCacheDelete(key) {
  1644. var data = this.__data__,
  1645. index = assocIndexOf(data, key);
  1646. if (index < 0) {
  1647. return false;
  1648. }
  1649. var lastIndex = data.length - 1;
  1650. if (index == lastIndex) {
  1651. data.pop();
  1652. } else {
  1653. splice.call(data, index, 1);
  1654. }
  1655. return true;
  1656. }
  1657. /**
  1658. * Gets the list cache value for `key`.
  1659. *
  1660. * @private
  1661. * @name get
  1662. * @memberOf ListCache
  1663. * @param {string} key The key of the value to get.
  1664. * @returns {*} Returns the entry value.
  1665. */
  1666. function listCacheGet(key) {
  1667. var data = this.__data__,
  1668. index = assocIndexOf(data, key);
  1669. return index < 0 ? undefined : data[index][1];
  1670. }
  1671. /**
  1672. * Checks if a list cache value for `key` exists.
  1673. *
  1674. * @private
  1675. * @name has
  1676. * @memberOf ListCache
  1677. * @param {string} key The key of the entry to check.
  1678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1679. */
  1680. function listCacheHas(key) {
  1681. return assocIndexOf(this.__data__, key) > -1;
  1682. }
  1683. /**
  1684. * Sets the list cache `key` to `value`.
  1685. *
  1686. * @private
  1687. * @name set
  1688. * @memberOf ListCache
  1689. * @param {string} key The key of the value to set.
  1690. * @param {*} value The value to set.
  1691. * @returns {Object} Returns the list cache instance.
  1692. */
  1693. function listCacheSet(key, value) {
  1694. var data = this.__data__,
  1695. index = assocIndexOf(data, key);
  1696. if (index < 0) {
  1697. data.push([key, value]);
  1698. } else {
  1699. data[index][1] = value;
  1700. }
  1701. return this;
  1702. }
  1703. // Add methods to `ListCache`.
  1704. ListCache.prototype.clear = listCacheClear;
  1705. ListCache.prototype['delete'] = listCacheDelete;
  1706. ListCache.prototype.get = listCacheGet;
  1707. ListCache.prototype.has = listCacheHas;
  1708. ListCache.prototype.set = listCacheSet;
  1709. /**
  1710. * Creates a map cache object to store key-value pairs.
  1711. *
  1712. * @private
  1713. * @constructor
  1714. * @param {Array} [entries] The key-value pairs to cache.
  1715. */
  1716. function MapCache(entries) {
  1717. var index = -1,
  1718. length = entries ? entries.length : 0;
  1719. this.clear();
  1720. while (++index < length) {
  1721. var entry = entries[index];
  1722. this.set(entry[0], entry[1]);
  1723. }
  1724. }
  1725. /**
  1726. * Removes all key-value entries from the map.
  1727. *
  1728. * @private
  1729. * @name clear
  1730. * @memberOf MapCache
  1731. */
  1732. function mapCacheClear() {
  1733. this.__data__ = {
  1734. 'hash': new Hash,
  1735. 'map': new (Map || ListCache),
  1736. 'string': new Hash
  1737. };
  1738. }
  1739. /**
  1740. * Removes `key` and its value from the map.
  1741. *
  1742. * @private
  1743. * @name delete
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the value to remove.
  1746. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1747. */
  1748. function mapCacheDelete(key) {
  1749. return getMapData(this, key)['delete'](key);
  1750. }
  1751. /**
  1752. * Gets the map value for `key`.
  1753. *
  1754. * @private
  1755. * @name get
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to get.
  1758. * @returns {*} Returns the entry value.
  1759. */
  1760. function mapCacheGet(key) {
  1761. return getMapData(this, key).get(key);
  1762. }
  1763. /**
  1764. * Checks if a map value for `key` exists.
  1765. *
  1766. * @private
  1767. * @name has
  1768. * @memberOf MapCache
  1769. * @param {string} key The key of the entry to check.
  1770. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1771. */
  1772. function mapCacheHas(key) {
  1773. return getMapData(this, key).has(key);
  1774. }
  1775. /**
  1776. * Sets the map `key` to `value`.
  1777. *
  1778. * @private
  1779. * @name set
  1780. * @memberOf MapCache
  1781. * @param {string} key The key of the value to set.
  1782. * @param {*} value The value to set.
  1783. * @returns {Object} Returns the map cache instance.
  1784. */
  1785. function mapCacheSet(key, value) {
  1786. getMapData(this, key).set(key, value);
  1787. return this;
  1788. }
  1789. // Add methods to `MapCache`.
  1790. MapCache.prototype.clear = mapCacheClear;
  1791. MapCache.prototype['delete'] = mapCacheDelete;
  1792. MapCache.prototype.get = mapCacheGet;
  1793. MapCache.prototype.has = mapCacheHas;
  1794. MapCache.prototype.set = mapCacheSet;
  1795. /**
  1796. *
  1797. * Creates an array cache object to store unique values.
  1798. *
  1799. * @private
  1800. * @constructor
  1801. * @param {Array} [values] The values to cache.
  1802. */
  1803. function SetCache(values) {
  1804. var index = -1,
  1805. length = values ? values.length : 0;
  1806. this.__data__ = new MapCache;
  1807. while (++index < length) {
  1808. this.add(values[index]);
  1809. }
  1810. }
  1811. /**
  1812. * Adds `value` to the array cache.
  1813. *
  1814. * @private
  1815. * @name add
  1816. * @memberOf SetCache
  1817. * @alias push
  1818. * @param {*} value The value to cache.
  1819. * @returns {Object} Returns the cache instance.
  1820. */
  1821. function setCacheAdd(value) {
  1822. this.__data__.set(value, HASH_UNDEFINED);
  1823. return this;
  1824. }
  1825. /**
  1826. * Checks if `value` is in the array cache.
  1827. *
  1828. * @private
  1829. * @name has
  1830. * @memberOf SetCache
  1831. * @param {*} value The value to search for.
  1832. * @returns {number} Returns `true` if `value` is found, else `false`.
  1833. */
  1834. function setCacheHas(value) {
  1835. return this.__data__.has(value);
  1836. }
  1837. // Add methods to `SetCache`.
  1838. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1839. SetCache.prototype.has = setCacheHas;
  1840. /**
  1841. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1842. *
  1843. * @private
  1844. * @param {Array} array The array to inspect.
  1845. * @param {*} key The key to search for.
  1846. * @returns {number} Returns the index of the matched value, else `-1`.
  1847. */
  1848. function assocIndexOf(array, key) {
  1849. var length = array.length;
  1850. while (length--) {
  1851. if (eq(array[length][0], key)) {
  1852. return length;
  1853. }
  1854. }
  1855. return -1;
  1856. }
  1857. /**
  1858. * The base implementation of `_.isNative` without bad shim checks.
  1859. *
  1860. * @private
  1861. * @param {*} value The value to check.
  1862. * @returns {boolean} Returns `true` if `value` is a native function,
  1863. * else `false`.
  1864. */
  1865. function baseIsNative(value) {
  1866. if (!isObject(value) || isMasked(value)) {
  1867. return false;
  1868. }
  1869. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1870. return pattern.test(toSource(value));
  1871. }
  1872. /**
  1873. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {Function} [iteratee] The iteratee invoked per element.
  1878. * @param {Function} [comparator] The comparator invoked per element.
  1879. * @returns {Array} Returns the new duplicate free array.
  1880. */
  1881. function baseUniq(array, iteratee, comparator) {
  1882. var index = -1,
  1883. includes = arrayIncludes,
  1884. length = array.length,
  1885. isCommon = true,
  1886. result = [],
  1887. seen = result;
  1888. if (comparator) {
  1889. isCommon = false;
  1890. includes = arrayIncludesWith;
  1891. }
  1892. else if (length >= LARGE_ARRAY_SIZE) {
  1893. var set = iteratee ? null : createSet(array);
  1894. if (set) {
  1895. return setToArray(set);
  1896. }
  1897. isCommon = false;
  1898. includes = cacheHas;
  1899. seen = new SetCache;
  1900. }
  1901. else {
  1902. seen = iteratee ? [] : result;
  1903. }
  1904. outer:
  1905. while (++index < length) {
  1906. var value = array[index],
  1907. computed = iteratee ? iteratee(value) : value;
  1908. value = (comparator || value !== 0) ? value : 0;
  1909. if (isCommon && computed === computed) {
  1910. var seenIndex = seen.length;
  1911. while (seenIndex--) {
  1912. if (seen[seenIndex] === computed) {
  1913. continue outer;
  1914. }
  1915. }
  1916. if (iteratee) {
  1917. seen.push(computed);
  1918. }
  1919. result.push(value);
  1920. }
  1921. else if (!includes(seen, computed, comparator)) {
  1922. if (seen !== result) {
  1923. seen.push(computed);
  1924. }
  1925. result.push(value);
  1926. }
  1927. }
  1928. return result;
  1929. }
  1930. /**
  1931. * Creates a set object of `values`.
  1932. *
  1933. * @private
  1934. * @param {Array} values The values to add to the set.
  1935. * @returns {Object} Returns the new set.
  1936. */
  1937. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1938. return new Set(values);
  1939. };
  1940. /**
  1941. * Gets the data for `map`.
  1942. *
  1943. * @private
  1944. * @param {Object} map The map to query.
  1945. * @param {string} key The reference key.
  1946. * @returns {*} Returns the map data.
  1947. */
  1948. function getMapData(map, key) {
  1949. var data = map.__data__;
  1950. return isKeyable(key)
  1951. ? data[typeof key == 'string' ? 'string' : 'hash']
  1952. : data.map;
  1953. }
  1954. /**
  1955. * Gets the native function at `key` of `object`.
  1956. *
  1957. * @private
  1958. * @param {Object} object The object to query.
  1959. * @param {string} key The key of the method to get.
  1960. * @returns {*} Returns the function if it's native, else `undefined`.
  1961. */
  1962. function getNative(object, key) {
  1963. var value = getValue(object, key);
  1964. return baseIsNative(value) ? value : undefined;
  1965. }
  1966. /**
  1967. * Checks if `value` is suitable for use as unique object key.
  1968. *
  1969. * @private
  1970. * @param {*} value The value to check.
  1971. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1972. */
  1973. function isKeyable(value) {
  1974. var type = typeof value;
  1975. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1976. ? (value !== '__proto__')
  1977. : (value === null);
  1978. }
  1979. /**
  1980. * Checks if `func` has its source masked.
  1981. *
  1982. * @private
  1983. * @param {Function} func The function to check.
  1984. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1985. */
  1986. function isMasked(func) {
  1987. return !!maskSrcKey && (maskSrcKey in func);
  1988. }
  1989. /**
  1990. * Converts `func` to its source code.
  1991. *
  1992. * @private
  1993. * @param {Function} func The function to process.
  1994. * @returns {string} Returns the source code.
  1995. */
  1996. function toSource(func) {
  1997. if (func != null) {
  1998. try {
  1999. return funcToString.call(func);
  2000. } catch (e) {}
  2001. try {
  2002. return (func + '');
  2003. } catch (e) {}
  2004. }
  2005. return '';
  2006. }
  2007. /**
  2008. * Creates a duplicate-free version of an array, using
  2009. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2010. * for equality comparisons, in which only the first occurrence of each
  2011. * element is kept.
  2012. *
  2013. * @static
  2014. * @memberOf _
  2015. * @since 0.1.0
  2016. * @category Array
  2017. * @param {Array} array The array to inspect.
  2018. * @returns {Array} Returns the new duplicate free array.
  2019. * @example
  2020. *
  2021. * _.uniq([2, 1, 2]);
  2022. * // => [2, 1]
  2023. */
  2024. function uniq(array) {
  2025. return (array && array.length)
  2026. ? baseUniq(array)
  2027. : [];
  2028. }
  2029. /**
  2030. * Performs a
  2031. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2032. * comparison between two values to determine if they are equivalent.
  2033. *
  2034. * @static
  2035. * @memberOf _
  2036. * @since 4.0.0
  2037. * @category Lang
  2038. * @param {*} value The value to compare.
  2039. * @param {*} other The other value to compare.
  2040. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2041. * @example
  2042. *
  2043. * var object = { 'a': 1 };
  2044. * var other = { 'a': 1 };
  2045. *
  2046. * _.eq(object, object);
  2047. * // => true
  2048. *
  2049. * _.eq(object, other);
  2050. * // => false
  2051. *
  2052. * _.eq('a', 'a');
  2053. * // => true
  2054. *
  2055. * _.eq('a', Object('a'));
  2056. * // => false
  2057. *
  2058. * _.eq(NaN, NaN);
  2059. * // => true
  2060. */
  2061. function eq(value, other) {
  2062. return value === other || (value !== value && other !== other);
  2063. }
  2064. /**
  2065. * Checks if `value` is classified as a `Function` object.
  2066. *
  2067. * @static
  2068. * @memberOf _
  2069. * @since 0.1.0
  2070. * @category Lang
  2071. * @param {*} value The value to check.
  2072. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2073. * @example
  2074. *
  2075. * _.isFunction(_);
  2076. * // => true
  2077. *
  2078. * _.isFunction(/abc/);
  2079. * // => false
  2080. */
  2081. function isFunction(value) {
  2082. // The use of `Object#toString` avoids issues with the `typeof` operator
  2083. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2084. var tag = isObject(value) ? objectToString.call(value) : '';
  2085. return tag == funcTag || tag == genTag;
  2086. }
  2087. /**
  2088. * Checks if `value` is the
  2089. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2090. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2091. *
  2092. * @static
  2093. * @memberOf _
  2094. * @since 0.1.0
  2095. * @category Lang
  2096. * @param {*} value The value to check.
  2097. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2098. * @example
  2099. *
  2100. * _.isObject({});
  2101. * // => true
  2102. *
  2103. * _.isObject([1, 2, 3]);
  2104. * // => true
  2105. *
  2106. * _.isObject(_.noop);
  2107. * // => true
  2108. *
  2109. * _.isObject(null);
  2110. * // => false
  2111. */
  2112. function isObject(value) {
  2113. var type = typeof value;
  2114. return !!value && (type == 'object' || type == 'function');
  2115. }
  2116. /**
  2117. * This method returns `undefined`.
  2118. *
  2119. * @static
  2120. * @memberOf _
  2121. * @since 2.3.0
  2122. * @category Util
  2123. * @example
  2124. *
  2125. * _.times(2, _.noop);
  2126. * // => [undefined, undefined]
  2127. */
  2128. function noop() {
  2129. // No operation performed.
  2130. }
  2131. module.exports = uniq;
  2132. /***/ }),
  2133. /***/ 129:
  2134. /***/ (function(module) {
  2135. module.exports = require("child_process");
  2136. /***/ }),
  2137. /***/ 139:
  2138. /***/ (function(module, __unusedexports, __webpack_require__) {
  2139. // Unique ID creation requires a high quality random # generator. In node.js
  2140. // this is pretty straight-forward - we use the crypto API.
  2141. var crypto = __webpack_require__(417);
  2142. module.exports = function nodeRNG() {
  2143. return crypto.randomBytes(16);
  2144. };
  2145. /***/ }),
  2146. /***/ 141:
  2147. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2148. "use strict";
  2149. var net = __webpack_require__(631);
  2150. var tls = __webpack_require__(16);
  2151. var http = __webpack_require__(605);
  2152. var https = __webpack_require__(34);
  2153. var events = __webpack_require__(614);
  2154. var assert = __webpack_require__(357);
  2155. var util = __webpack_require__(669);
  2156. exports.httpOverHttp = httpOverHttp;
  2157. exports.httpsOverHttp = httpsOverHttp;
  2158. exports.httpOverHttps = httpOverHttps;
  2159. exports.httpsOverHttps = httpsOverHttps;
  2160. function httpOverHttp(options) {
  2161. var agent = new TunnelingAgent(options);
  2162. agent.request = http.request;
  2163. return agent;
  2164. }
  2165. function httpsOverHttp(options) {
  2166. var agent = new TunnelingAgent(options);
  2167. agent.request = http.request;
  2168. agent.createSocket = createSecureSocket;
  2169. return agent;
  2170. }
  2171. function httpOverHttps(options) {
  2172. var agent = new TunnelingAgent(options);
  2173. agent.request = https.request;
  2174. return agent;
  2175. }
  2176. function httpsOverHttps(options) {
  2177. var agent = new TunnelingAgent(options);
  2178. agent.request = https.request;
  2179. agent.createSocket = createSecureSocket;
  2180. return agent;
  2181. }
  2182. function TunnelingAgent(options) {
  2183. var self = this;
  2184. self.options = options || {};
  2185. self.proxyOptions = self.options.proxy || {};
  2186. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2187. self.requests = [];
  2188. self.sockets = [];
  2189. self.on('free', function onFree(socket, host, port, localAddress) {
  2190. var options = toOptions(host, port, localAddress);
  2191. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2192. var pending = self.requests[i];
  2193. if (pending.host === options.host && pending.port === options.port) {
  2194. // Detect the request to connect same origin server,
  2195. // reuse the connection.
  2196. self.requests.splice(i, 1);
  2197. pending.request.onSocket(socket);
  2198. return;
  2199. }
  2200. }
  2201. socket.destroy();
  2202. self.removeSocket(socket);
  2203. });
  2204. }
  2205. util.inherits(TunnelingAgent, events.EventEmitter);
  2206. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2207. var self = this;
  2208. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2209. if (self.sockets.length >= this.maxSockets) {
  2210. // We are over limit so we'll add it to the queue.
  2211. self.requests.push(options);
  2212. return;
  2213. }
  2214. // If we are under maxSockets create a new one.
  2215. self.createSocket(options, function(socket) {
  2216. socket.on('free', onFree);
  2217. socket.on('close', onCloseOrRemove);
  2218. socket.on('agentRemove', onCloseOrRemove);
  2219. req.onSocket(socket);
  2220. function onFree() {
  2221. self.emit('free', socket, options);
  2222. }
  2223. function onCloseOrRemove(err) {
  2224. self.removeSocket(socket);
  2225. socket.removeListener('free', onFree);
  2226. socket.removeListener('close', onCloseOrRemove);
  2227. socket.removeListener('agentRemove', onCloseOrRemove);
  2228. }
  2229. });
  2230. };
  2231. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2232. var self = this;
  2233. var placeholder = {};
  2234. self.sockets.push(placeholder);
  2235. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2236. method: 'CONNECT',
  2237. path: options.host + ':' + options.port,
  2238. agent: false
  2239. });
  2240. if (connectOptions.proxyAuth) {
  2241. connectOptions.headers = connectOptions.headers || {};
  2242. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2243. new Buffer(connectOptions.proxyAuth).toString('base64');
  2244. }
  2245. debug('making CONNECT request');
  2246. var connectReq = self.request(connectOptions);
  2247. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2248. connectReq.once('response', onResponse); // for v0.6
  2249. connectReq.once('upgrade', onUpgrade); // for v0.6
  2250. connectReq.once('connect', onConnect); // for v0.7 or later
  2251. connectReq.once('error', onError);
  2252. connectReq.end();
  2253. function onResponse(res) {
  2254. // Very hacky. This is necessary to avoid http-parser leaks.
  2255. res.upgrade = true;
  2256. }
  2257. function onUpgrade(res, socket, head) {
  2258. // Hacky.
  2259. process.nextTick(function() {
  2260. onConnect(res, socket, head);
  2261. });
  2262. }
  2263. function onConnect(res, socket, head) {
  2264. connectReq.removeAllListeners();
  2265. socket.removeAllListeners();
  2266. if (res.statusCode === 200) {
  2267. assert.equal(head.length, 0);
  2268. debug('tunneling connection has established');
  2269. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2270. cb(socket);
  2271. } else {
  2272. debug('tunneling socket could not be established, statusCode=%d',
  2273. res.statusCode);
  2274. var error = new Error('tunneling socket could not be established, ' +
  2275. 'statusCode=' + res.statusCode);
  2276. error.code = 'ECONNRESET';
  2277. options.request.emit('error', error);
  2278. self.removeSocket(placeholder);
  2279. }
  2280. }
  2281. function onError(cause) {
  2282. connectReq.removeAllListeners();
  2283. debug('tunneling socket could not be established, cause=%s\n',
  2284. cause.message, cause.stack);
  2285. var error = new Error('tunneling socket could not be established, ' +
  2286. 'cause=' + cause.message);
  2287. error.code = 'ECONNRESET';
  2288. options.request.emit('error', error);
  2289. self.removeSocket(placeholder);
  2290. }
  2291. };
  2292. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2293. var pos = this.sockets.indexOf(socket)
  2294. if (pos === -1) {
  2295. return;
  2296. }
  2297. this.sockets.splice(pos, 1);
  2298. var pending = this.requests.shift();
  2299. if (pending) {
  2300. // If we have pending requests and a socket gets closed a new one
  2301. // needs to be created to take over in the pool for the one that closed.
  2302. this.createSocket(pending, function(socket) {
  2303. pending.request.onSocket(socket);
  2304. });
  2305. }
  2306. };
  2307. function createSecureSocket(options, cb) {
  2308. var self = this;
  2309. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2310. var hostHeader = options.request.getHeader('host');
  2311. var tlsOptions = mergeOptions({}, self.options, {
  2312. socket: socket,
  2313. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2314. });
  2315. // 0 is dummy port for v0.6
  2316. var secureSocket = tls.connect(0, tlsOptions);
  2317. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2318. cb(secureSocket);
  2319. });
  2320. }
  2321. function toOptions(host, port, localAddress) {
  2322. if (typeof host === 'string') { // since v0.10
  2323. return {
  2324. host: host,
  2325. port: port,
  2326. localAddress: localAddress
  2327. };
  2328. }
  2329. return host; // for v0.11 or later
  2330. }
  2331. function mergeOptions(target) {
  2332. for (var i = 1, len = arguments.length; i < len; ++i) {
  2333. var overrides = arguments[i];
  2334. if (typeof overrides === 'object') {
  2335. var keys = Object.keys(overrides);
  2336. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2337. var k = keys[j];
  2338. if (overrides[k] !== undefined) {
  2339. target[k] = overrides[k];
  2340. }
  2341. }
  2342. }
  2343. }
  2344. return target;
  2345. }
  2346. var debug;
  2347. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2348. debug = function() {
  2349. var args = Array.prototype.slice.call(arguments);
  2350. if (typeof args[0] === 'string') {
  2351. args[0] = 'TUNNEL: ' + args[0];
  2352. } else {
  2353. args.unshift('TUNNEL:');
  2354. }
  2355. console.error.apply(console, args);
  2356. }
  2357. } else {
  2358. debug = function() {};
  2359. }
  2360. exports.debug = debug; // for test
  2361. /***/ }),
  2362. /***/ 143:
  2363. /***/ (function(module, __unusedexports, __webpack_require__) {
  2364. module.exports = withAuthorizationPrefix;
  2365. const atob = __webpack_require__(368);
  2366. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2367. function withAuthorizationPrefix(authorization) {
  2368. if (/^(basic|bearer|token) /i.test(authorization)) {
  2369. return authorization;
  2370. }
  2371. try {
  2372. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2373. return `basic ${authorization}`;
  2374. }
  2375. } catch (error) {}
  2376. if (authorization.split(/\./).length === 3) {
  2377. return `bearer ${authorization}`;
  2378. }
  2379. return `token ${authorization}`;
  2380. }
  2381. /***/ }),
  2382. /***/ 145:
  2383. /***/ (function(module, __unusedexports, __webpack_require__) {
  2384. "use strict";
  2385. const pump = __webpack_require__(453);
  2386. const bufferStream = __webpack_require__(966);
  2387. class MaxBufferError extends Error {
  2388. constructor() {
  2389. super('maxBuffer exceeded');
  2390. this.name = 'MaxBufferError';
  2391. }
  2392. }
  2393. function getStream(inputStream, options) {
  2394. if (!inputStream) {
  2395. return Promise.reject(new Error('Expected a stream'));
  2396. }
  2397. options = Object.assign({maxBuffer: Infinity}, options);
  2398. const {maxBuffer} = options;
  2399. let stream;
  2400. return new Promise((resolve, reject) => {
  2401. const rejectPromise = error => {
  2402. if (error) { // A null check
  2403. error.bufferedData = stream.getBufferedValue();
  2404. }
  2405. reject(error);
  2406. };
  2407. stream = pump(inputStream, bufferStream(options), error => {
  2408. if (error) {
  2409. rejectPromise(error);
  2410. return;
  2411. }
  2412. resolve();
  2413. });
  2414. stream.on('data', () => {
  2415. if (stream.getBufferedLength() > maxBuffer) {
  2416. rejectPromise(new MaxBufferError());
  2417. }
  2418. });
  2419. }).then(() => stream.getBufferedValue());
  2420. }
  2421. module.exports = getStream;
  2422. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2423. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2424. module.exports.MaxBufferError = MaxBufferError;
  2425. /***/ }),
  2426. /***/ 148:
  2427. /***/ (function(module, __unusedexports, __webpack_require__) {
  2428. module.exports = paginatePlugin;
  2429. const { paginateRest } = __webpack_require__(299);
  2430. function paginatePlugin(octokit) {
  2431. Object.assign(octokit, paginateRest(octokit));
  2432. }
  2433. /***/ }),
  2434. /***/ 153:
  2435. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2436. "use strict";
  2437. var __importStar = (this && this.__importStar) || function (mod) {
  2438. if (mod && mod.__esModule) return mod;
  2439. var result = {};
  2440. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2441. result["default"] = mod;
  2442. return result;
  2443. };
  2444. Object.defineProperty(exports, "__esModule", { value: true });
  2445. const coreCommand = __importStar(__webpack_require__(431));
  2446. /**
  2447. * Indicates whether the POST action is running
  2448. */
  2449. exports.IsPost = !!process.env['STATE_isPost'];
  2450. /**
  2451. * The repository path for the POST action. The value is empty during the MAIN action.
  2452. */
  2453. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2454. /**
  2455. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2456. */
  2457. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2458. /**
  2459. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2460. */
  2461. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2462. /**
  2463. * Save the repository path so the POST action can retrieve the value.
  2464. */
  2465. function setRepositoryPath(repositoryPath) {
  2466. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2467. }
  2468. exports.setRepositoryPath = setRepositoryPath;
  2469. /**
  2470. * Save the SSH key path so the POST action can retrieve the value.
  2471. */
  2472. function setSshKeyPath(sshKeyPath) {
  2473. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2474. }
  2475. exports.setSshKeyPath = setSshKeyPath;
  2476. /**
  2477. * Save the SSH known hosts path so the POST action can retrieve the value.
  2478. */
  2479. function setSshKnownHostsPath(sshKnownHostsPath) {
  2480. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2481. }
  2482. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2483. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2484. // This is necessary since we don't have a separate entry point.
  2485. if (!exports.IsPost) {
  2486. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2487. }
  2488. /***/ }),
  2489. /***/ 168:
  2490. /***/ (function(module) {
  2491. "use strict";
  2492. const alias = ['stdin', 'stdout', 'stderr'];
  2493. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2494. module.exports = opts => {
  2495. if (!opts) {
  2496. return null;
  2497. }
  2498. if (opts.stdio && hasAlias(opts)) {
  2499. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2500. }
  2501. if (typeof opts.stdio === 'string') {
  2502. return opts.stdio;
  2503. }
  2504. const stdio = opts.stdio || [];
  2505. if (!Array.isArray(stdio)) {
  2506. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2507. }
  2508. const result = [];
  2509. const len = Math.max(stdio.length, alias.length);
  2510. for (let i = 0; i < len; i++) {
  2511. let value = null;
  2512. if (stdio[i] !== undefined) {
  2513. value = stdio[i];
  2514. } else if (opts[alias[i]] !== undefined) {
  2515. value = opts[alias[i]];
  2516. }
  2517. result[i] = value;
  2518. }
  2519. return result;
  2520. };
  2521. /***/ }),
  2522. /***/ 179:
  2523. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2524. "use strict";
  2525. var net = __webpack_require__(631);
  2526. var tls = __webpack_require__(16);
  2527. var http = __webpack_require__(605);
  2528. var https = __webpack_require__(34);
  2529. var events = __webpack_require__(614);
  2530. var assert = __webpack_require__(357);
  2531. var util = __webpack_require__(669);
  2532. exports.httpOverHttp = httpOverHttp;
  2533. exports.httpsOverHttp = httpsOverHttp;
  2534. exports.httpOverHttps = httpOverHttps;
  2535. exports.httpsOverHttps = httpsOverHttps;
  2536. function httpOverHttp(options) {
  2537. var agent = new TunnelingAgent(options);
  2538. agent.request = http.request;
  2539. return agent;
  2540. }
  2541. function httpsOverHttp(options) {
  2542. var agent = new TunnelingAgent(options);
  2543. agent.request = http.request;
  2544. agent.createSocket = createSecureSocket;
  2545. agent.defaultPort = 443;
  2546. return agent;
  2547. }
  2548. function httpOverHttps(options) {
  2549. var agent = new TunnelingAgent(options);
  2550. agent.request = https.request;
  2551. return agent;
  2552. }
  2553. function httpsOverHttps(options) {
  2554. var agent = new TunnelingAgent(options);
  2555. agent.request = https.request;
  2556. agent.createSocket = createSecureSocket;
  2557. agent.defaultPort = 443;
  2558. return agent;
  2559. }
  2560. function TunnelingAgent(options) {
  2561. var self = this;
  2562. self.options = options || {};
  2563. self.proxyOptions = self.options.proxy || {};
  2564. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2565. self.requests = [];
  2566. self.sockets = [];
  2567. self.on('free', function onFree(socket, host, port, localAddress) {
  2568. var options = toOptions(host, port, localAddress);
  2569. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2570. var pending = self.requests[i];
  2571. if (pending.host === options.host && pending.port === options.port) {
  2572. // Detect the request to connect same origin server,
  2573. // reuse the connection.
  2574. self.requests.splice(i, 1);
  2575. pending.request.onSocket(socket);
  2576. return;
  2577. }
  2578. }
  2579. socket.destroy();
  2580. self.removeSocket(socket);
  2581. });
  2582. }
  2583. util.inherits(TunnelingAgent, events.EventEmitter);
  2584. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2585. var self = this;
  2586. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2587. if (self.sockets.length >= this.maxSockets) {
  2588. // We are over limit so we'll add it to the queue.
  2589. self.requests.push(options);
  2590. return;
  2591. }
  2592. // If we are under maxSockets create a new one.
  2593. self.createSocket(options, function(socket) {
  2594. socket.on('free', onFree);
  2595. socket.on('close', onCloseOrRemove);
  2596. socket.on('agentRemove', onCloseOrRemove);
  2597. req.onSocket(socket);
  2598. function onFree() {
  2599. self.emit('free', socket, options);
  2600. }
  2601. function onCloseOrRemove(err) {
  2602. self.removeSocket(socket);
  2603. socket.removeListener('free', onFree);
  2604. socket.removeListener('close', onCloseOrRemove);
  2605. socket.removeListener('agentRemove', onCloseOrRemove);
  2606. }
  2607. });
  2608. };
  2609. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2610. var self = this;
  2611. var placeholder = {};
  2612. self.sockets.push(placeholder);
  2613. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2614. method: 'CONNECT',
  2615. path: options.host + ':' + options.port,
  2616. agent: false,
  2617. headers: {
  2618. host: options.host + ':' + options.port
  2619. }
  2620. });
  2621. if (options.localAddress) {
  2622. connectOptions.localAddress = options.localAddress;
  2623. }
  2624. if (connectOptions.proxyAuth) {
  2625. connectOptions.headers = connectOptions.headers || {};
  2626. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2627. new Buffer(connectOptions.proxyAuth).toString('base64');
  2628. }
  2629. debug('making CONNECT request');
  2630. var connectReq = self.request(connectOptions);
  2631. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2632. connectReq.once('response', onResponse); // for v0.6
  2633. connectReq.once('upgrade', onUpgrade); // for v0.6
  2634. connectReq.once('connect', onConnect); // for v0.7 or later
  2635. connectReq.once('error', onError);
  2636. connectReq.end();
  2637. function onResponse(res) {
  2638. // Very hacky. This is necessary to avoid http-parser leaks.
  2639. res.upgrade = true;
  2640. }
  2641. function onUpgrade(res, socket, head) {
  2642. // Hacky.
  2643. process.nextTick(function() {
  2644. onConnect(res, socket, head);
  2645. });
  2646. }
  2647. function onConnect(res, socket, head) {
  2648. connectReq.removeAllListeners();
  2649. socket.removeAllListeners();
  2650. if (res.statusCode !== 200) {
  2651. debug('tunneling socket could not be established, statusCode=%d',
  2652. res.statusCode);
  2653. socket.destroy();
  2654. var error = new Error('tunneling socket could not be established, ' +
  2655. 'statusCode=' + res.statusCode);
  2656. error.code = 'ECONNRESET';
  2657. options.request.emit('error', error);
  2658. self.removeSocket(placeholder);
  2659. return;
  2660. }
  2661. if (head.length > 0) {
  2662. debug('got illegal response body from proxy');
  2663. socket.destroy();
  2664. var error = new Error('got illegal response body from proxy');
  2665. error.code = 'ECONNRESET';
  2666. options.request.emit('error', error);
  2667. self.removeSocket(placeholder);
  2668. return;
  2669. }
  2670. debug('tunneling connection has established');
  2671. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2672. return cb(socket);
  2673. }
  2674. function onError(cause) {
  2675. connectReq.removeAllListeners();
  2676. debug('tunneling socket could not be established, cause=%s\n',
  2677. cause.message, cause.stack);
  2678. var error = new Error('tunneling socket could not be established, ' +
  2679. 'cause=' + cause.message);
  2680. error.code = 'ECONNRESET';
  2681. options.request.emit('error', error);
  2682. self.removeSocket(placeholder);
  2683. }
  2684. };
  2685. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2686. var pos = this.sockets.indexOf(socket)
  2687. if (pos === -1) {
  2688. return;
  2689. }
  2690. this.sockets.splice(pos, 1);
  2691. var pending = this.requests.shift();
  2692. if (pending) {
  2693. // If we have pending requests and a socket gets closed a new one
  2694. // needs to be created to take over in the pool for the one that closed.
  2695. this.createSocket(pending, function(socket) {
  2696. pending.request.onSocket(socket);
  2697. });
  2698. }
  2699. };
  2700. function createSecureSocket(options, cb) {
  2701. var self = this;
  2702. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2703. var hostHeader = options.request.getHeader('host');
  2704. var tlsOptions = mergeOptions({}, self.options, {
  2705. socket: socket,
  2706. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2707. });
  2708. // 0 is dummy port for v0.6
  2709. var secureSocket = tls.connect(0, tlsOptions);
  2710. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2711. cb(secureSocket);
  2712. });
  2713. }
  2714. function toOptions(host, port, localAddress) {
  2715. if (typeof host === 'string') { // since v0.10
  2716. return {
  2717. host: host,
  2718. port: port,
  2719. localAddress: localAddress
  2720. };
  2721. }
  2722. return host; // for v0.11 or later
  2723. }
  2724. function mergeOptions(target) {
  2725. for (var i = 1, len = arguments.length; i < len; ++i) {
  2726. var overrides = arguments[i];
  2727. if (typeof overrides === 'object') {
  2728. var keys = Object.keys(overrides);
  2729. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2730. var k = keys[j];
  2731. if (overrides[k] !== undefined) {
  2732. target[k] = overrides[k];
  2733. }
  2734. }
  2735. }
  2736. }
  2737. return target;
  2738. }
  2739. var debug;
  2740. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2741. debug = function() {
  2742. var args = Array.prototype.slice.call(arguments);
  2743. if (typeof args[0] === 'string') {
  2744. args[0] = 'TUNNEL: ' + args[0];
  2745. } else {
  2746. args.unshift('TUNNEL:');
  2747. }
  2748. console.error.apply(console, args);
  2749. }
  2750. } else {
  2751. debug = function() {};
  2752. }
  2753. exports.debug = debug; // for test
  2754. /***/ }),
  2755. /***/ 190:
  2756. /***/ (function(module, __unusedexports, __webpack_require__) {
  2757. module.exports = authenticationPlugin;
  2758. const { createTokenAuth } = __webpack_require__(813);
  2759. const { Deprecation } = __webpack_require__(692);
  2760. const once = __webpack_require__(969);
  2761. const beforeRequest = __webpack_require__(863);
  2762. const requestError = __webpack_require__(991);
  2763. const validate = __webpack_require__(954);
  2764. const withAuthorizationPrefix = __webpack_require__(143);
  2765. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2766. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2767. function authenticationPlugin(octokit, options) {
  2768. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2769. if (options.authStrategy) {
  2770. const auth = options.authStrategy(options.auth);
  2771. octokit.hook.wrap("request", auth.hook);
  2772. octokit.auth = auth;
  2773. return;
  2774. }
  2775. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2776. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2777. if (!options.auth) {
  2778. octokit.auth = () =>
  2779. Promise.resolve({
  2780. type: "unauthenticated"
  2781. });
  2782. return;
  2783. }
  2784. const isBasicAuthString =
  2785. typeof options.auth === "string" &&
  2786. /^basic/.test(withAuthorizationPrefix(options.auth));
  2787. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2788. if (typeof options.auth === "string" && !isBasicAuthString) {
  2789. const auth = createTokenAuth(options.auth);
  2790. octokit.hook.wrap("request", auth.hook);
  2791. octokit.auth = auth;
  2792. return;
  2793. }
  2794. // Otherwise log a deprecation message
  2795. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2796. ? [
  2797. deprecateAuthBasic,
  2798. '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)'
  2799. ]
  2800. : [
  2801. deprecateAuthObject,
  2802. '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)'
  2803. ];
  2804. deprecationMethod(
  2805. octokit.log,
  2806. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2807. );
  2808. octokit.auth = () =>
  2809. Promise.resolve({
  2810. type: "deprecated",
  2811. message: deprecationMessapge
  2812. });
  2813. validate(options.auth);
  2814. const state = {
  2815. octokit,
  2816. auth: options.auth
  2817. };
  2818. octokit.hook.before("request", beforeRequest.bind(null, state));
  2819. octokit.hook.error("request", requestError.bind(null, state));
  2820. }
  2821. /***/ }),
  2822. /***/ 197:
  2823. /***/ (function(module, __unusedexports, __webpack_require__) {
  2824. module.exports = isexe
  2825. isexe.sync = sync
  2826. var fs = __webpack_require__(747)
  2827. function isexe (path, options, cb) {
  2828. fs.stat(path, function (er, stat) {
  2829. cb(er, er ? false : checkStat(stat, options))
  2830. })
  2831. }
  2832. function sync (path, options) {
  2833. return checkStat(fs.statSync(path), options)
  2834. }
  2835. function checkStat (stat, options) {
  2836. return stat.isFile() && checkMode(stat, options)
  2837. }
  2838. function checkMode (stat, options) {
  2839. var mod = stat.mode
  2840. var uid = stat.uid
  2841. var gid = stat.gid
  2842. var myUid = options.uid !== undefined ?
  2843. options.uid : process.getuid && process.getuid()
  2844. var myGid = options.gid !== undefined ?
  2845. options.gid : process.getgid && process.getgid()
  2846. var u = parseInt('100', 8)
  2847. var g = parseInt('010', 8)
  2848. var o = parseInt('001', 8)
  2849. var ug = u | g
  2850. var ret = (mod & o) ||
  2851. (mod & g) && gid === myGid ||
  2852. (mod & u) && uid === myUid ||
  2853. (mod & ug) && myUid === 0
  2854. return ret
  2855. }
  2856. /***/ }),
  2857. /***/ 198:
  2858. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2859. "use strict";
  2860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2861. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2862. return new (P || (P = Promise))(function (resolve, reject) {
  2863. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2864. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2865. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2866. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2867. });
  2868. };
  2869. var __importStar = (this && this.__importStar) || function (mod) {
  2870. if (mod && mod.__esModule) return mod;
  2871. var result = {};
  2872. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2873. result["default"] = mod;
  2874. return result;
  2875. };
  2876. Object.defineProperty(exports, "__esModule", { value: true });
  2877. const core = __importStar(__webpack_require__(470));
  2878. const coreCommand = __importStar(__webpack_require__(431));
  2879. const gitSourceProvider = __importStar(__webpack_require__(293));
  2880. const inputHelper = __importStar(__webpack_require__(821));
  2881. const path = __importStar(__webpack_require__(622));
  2882. const stateHelper = __importStar(__webpack_require__(153));
  2883. function run() {
  2884. return __awaiter(this, void 0, void 0, function* () {
  2885. try {
  2886. const sourceSettings = inputHelper.getInputs();
  2887. try {
  2888. // Register problem matcher
  2889. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2890. // Get sources
  2891. yield gitSourceProvider.getSource(sourceSettings);
  2892. }
  2893. finally {
  2894. // Unregister problem matcher
  2895. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2896. }
  2897. }
  2898. catch (error) {
  2899. core.setFailed(error.message);
  2900. }
  2901. });
  2902. }
  2903. function cleanup() {
  2904. return __awaiter(this, void 0, void 0, function* () {
  2905. try {
  2906. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2907. }
  2908. catch (error) {
  2909. core.warning(error.message);
  2910. }
  2911. });
  2912. }
  2913. // Main
  2914. if (!stateHelper.IsPost) {
  2915. run();
  2916. }
  2917. // Post
  2918. else {
  2919. cleanup();
  2920. }
  2921. /***/ }),
  2922. /***/ 211:
  2923. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2924. "use strict";
  2925. Object.defineProperty(exports, '__esModule', { value: true });
  2926. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2927. var osName = _interopDefault(__webpack_require__(2));
  2928. function getUserAgent() {
  2929. try {
  2930. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2931. } catch (error) {
  2932. if (/wmic os get Caption/.test(error.message)) {
  2933. return "Windows <version undetectable>";
  2934. }
  2935. return "<environment undetectable>";
  2936. }
  2937. }
  2938. exports.getUserAgent = getUserAgent;
  2939. //# sourceMappingURL=index.js.map
  2940. /***/ }),
  2941. /***/ 215:
  2942. /***/ (function(module) {
  2943. module.exports = {"name":"@octokit/rest","version":"16.43.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/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"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":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","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":"^17.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: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.43.1.tgz","_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_from":"@octokit/rest@16.43.1"};
  2944. /***/ }),
  2945. /***/ 227:
  2946. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2947. "use strict";
  2948. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2949. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2950. return new (P || (P = Promise))(function (resolve, reject) {
  2951. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2952. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2953. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2954. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2955. });
  2956. };
  2957. var __importStar = (this && this.__importStar) || function (mod) {
  2958. if (mod && mod.__esModule) return mod;
  2959. var result = {};
  2960. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2961. result["default"] = mod;
  2962. return result;
  2963. };
  2964. Object.defineProperty(exports, "__esModule", { value: true });
  2965. const url_1 = __webpack_require__(835);
  2966. const core = __importStar(__webpack_require__(470));
  2967. const github = __importStar(__webpack_require__(469));
  2968. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2969. function getCheckoutInfo(git, ref, commit) {
  2970. return __awaiter(this, void 0, void 0, function* () {
  2971. if (!git) {
  2972. throw new Error('Arg git cannot be empty');
  2973. }
  2974. if (!ref && !commit) {
  2975. throw new Error('Args ref and commit cannot both be empty');
  2976. }
  2977. const result = {};
  2978. const upperRef = (ref || '').toUpperCase();
  2979. // SHA only
  2980. if (!ref) {
  2981. result.ref = commit;
  2982. }
  2983. // refs/heads/
  2984. else if (upperRef.startsWith('REFS/HEADS/')) {
  2985. const branch = ref.substring('refs/heads/'.length);
  2986. result.ref = branch;
  2987. result.startPoint = `refs/remotes/origin/${branch}`;
  2988. }
  2989. // refs/pull/
  2990. else if (upperRef.startsWith('REFS/PULL/')) {
  2991. const branch = ref.substring('refs/pull/'.length);
  2992. result.ref = `refs/remotes/pull/${branch}`;
  2993. }
  2994. // refs/tags/
  2995. else if (upperRef.startsWith('REFS/')) {
  2996. result.ref = ref;
  2997. }
  2998. // Unqualified ref, check for a matching branch or tag
  2999. else {
  3000. if (yield git.branchExists(true, `origin/${ref}`)) {
  3001. result.ref = ref;
  3002. result.startPoint = `refs/remotes/origin/${ref}`;
  3003. }
  3004. else if (yield git.tagExists(`${ref}`)) {
  3005. result.ref = `refs/tags/${ref}`;
  3006. }
  3007. else {
  3008. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3009. }
  3010. }
  3011. return result;
  3012. });
  3013. }
  3014. exports.getCheckoutInfo = getCheckoutInfo;
  3015. function getRefSpecForAllHistory(ref, commit) {
  3016. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3017. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3018. const branch = ref.substring('refs/pull/'.length);
  3019. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3020. }
  3021. return result;
  3022. }
  3023. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3024. function getRefSpec(ref, commit) {
  3025. if (!ref && !commit) {
  3026. throw new Error('Args ref and commit cannot both be empty');
  3027. }
  3028. const upperRef = (ref || '').toUpperCase();
  3029. // SHA
  3030. if (commit) {
  3031. // refs/heads
  3032. if (upperRef.startsWith('REFS/HEADS/')) {
  3033. const branch = ref.substring('refs/heads/'.length);
  3034. return [`+${commit}:refs/remotes/origin/${branch}`];
  3035. }
  3036. // refs/pull/
  3037. else if (upperRef.startsWith('REFS/PULL/')) {
  3038. const branch = ref.substring('refs/pull/'.length);
  3039. return [`+${commit}:refs/remotes/pull/${branch}`];
  3040. }
  3041. // refs/tags/
  3042. else if (upperRef.startsWith('REFS/TAGS/')) {
  3043. return [`+${commit}:${ref}`];
  3044. }
  3045. // Otherwise no destination ref
  3046. else {
  3047. return [commit];
  3048. }
  3049. }
  3050. // Unqualified ref, check for a matching branch or tag
  3051. else if (!upperRef.startsWith('REFS/')) {
  3052. return [
  3053. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3054. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3055. ];
  3056. }
  3057. // refs/heads/
  3058. else if (upperRef.startsWith('REFS/HEADS/')) {
  3059. const branch = ref.substring('refs/heads/'.length);
  3060. return [`+${ref}:refs/remotes/origin/${branch}`];
  3061. }
  3062. // refs/pull/
  3063. else if (upperRef.startsWith('REFS/PULL/')) {
  3064. const branch = ref.substring('refs/pull/'.length);
  3065. return [`+${ref}:refs/remotes/pull/${branch}`];
  3066. }
  3067. // refs/tags/
  3068. else {
  3069. return [`+${ref}:${ref}`];
  3070. }
  3071. }
  3072. exports.getRefSpec = getRefSpec;
  3073. /**
  3074. * Tests whether the initial fetch created the ref at the expected commit
  3075. */
  3076. function testRef(git, ref, commit) {
  3077. return __awaiter(this, void 0, void 0, function* () {
  3078. if (!git) {
  3079. throw new Error('Arg git cannot be empty');
  3080. }
  3081. if (!ref && !commit) {
  3082. throw new Error('Args ref and commit cannot both be empty');
  3083. }
  3084. // No SHA? Nothing to test
  3085. if (!commit) {
  3086. return true;
  3087. }
  3088. // SHA only?
  3089. else if (!ref) {
  3090. return yield git.shaExists(commit);
  3091. }
  3092. const upperRef = ref.toUpperCase();
  3093. // refs/heads/
  3094. if (upperRef.startsWith('REFS/HEADS/')) {
  3095. const branch = ref.substring('refs/heads/'.length);
  3096. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3097. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3098. }
  3099. // refs/pull/
  3100. else if (upperRef.startsWith('REFS/PULL/')) {
  3101. // Assume matches because fetched using the commit
  3102. return true;
  3103. }
  3104. // refs/tags/
  3105. else if (upperRef.startsWith('REFS/TAGS/')) {
  3106. const tagName = ref.substring('refs/tags/'.length);
  3107. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3108. }
  3109. // Unexpected
  3110. else {
  3111. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3112. return true;
  3113. }
  3114. });
  3115. }
  3116. exports.testRef = testRef;
  3117. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3118. return __awaiter(this, void 0, void 0, function* () {
  3119. try {
  3120. // GHES?
  3121. if (isGhes()) {
  3122. return;
  3123. }
  3124. // Auth token?
  3125. if (!token) {
  3126. return;
  3127. }
  3128. // Public PR synchronize, for workflow repo?
  3129. if (fromPayload('repository.private') !== false ||
  3130. github.context.eventName !== 'pull_request' ||
  3131. fromPayload('action') !== 'synchronize' ||
  3132. repositoryOwner !== github.context.repo.owner ||
  3133. repositoryName !== github.context.repo.repo ||
  3134. ref !== github.context.ref ||
  3135. !ref.startsWith('refs/pull/') ||
  3136. commit !== github.context.sha) {
  3137. return;
  3138. }
  3139. // Head SHA
  3140. const expectedHeadSha = fromPayload('after');
  3141. if (!expectedHeadSha) {
  3142. core.debug('Unable to determine head sha');
  3143. return;
  3144. }
  3145. // Base SHA
  3146. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3147. if (!expectedBaseSha) {
  3148. core.debug('Unable to determine base sha');
  3149. return;
  3150. }
  3151. // Expected message?
  3152. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3153. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3154. return;
  3155. }
  3156. // Extract details from message
  3157. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3158. if (!match) {
  3159. core.debug('Unexpected message format');
  3160. return;
  3161. }
  3162. // Post telemetry
  3163. const actualHeadSha = match[1];
  3164. if (actualHeadSha !== expectedHeadSha) {
  3165. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3166. const octokit = new github.GitHub(token, {
  3167. userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
  3168. });
  3169. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3170. }
  3171. }
  3172. catch (err) {
  3173. core.debug(`Error when validating commit info: ${err.stack}`);
  3174. }
  3175. });
  3176. }
  3177. exports.checkCommitInfo = checkCommitInfo;
  3178. function fromPayload(path) {
  3179. return select(github.context.payload, path);
  3180. }
  3181. function select(obj, path) {
  3182. if (!obj) {
  3183. return undefined;
  3184. }
  3185. const i = path.indexOf('.');
  3186. if (i < 0) {
  3187. return obj[path];
  3188. }
  3189. const key = path.substr(0, i);
  3190. return select(obj[key], path.substr(i + 1));
  3191. }
  3192. function isGhes() {
  3193. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3194. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3195. }
  3196. /***/ }),
  3197. /***/ 260:
  3198. /***/ (function(module, __unusedexports, __webpack_require__) {
  3199. // Note: since nyc uses this module to output coverage, any lines
  3200. // that are in the direct sync flow of nyc's outputCoverage are
  3201. // ignored, since we can never get coverage for them.
  3202. var assert = __webpack_require__(357)
  3203. var signals = __webpack_require__(654)
  3204. var EE = __webpack_require__(614)
  3205. /* istanbul ignore if */
  3206. if (typeof EE !== 'function') {
  3207. EE = EE.EventEmitter
  3208. }
  3209. var emitter
  3210. if (process.__signal_exit_emitter__) {
  3211. emitter = process.__signal_exit_emitter__
  3212. } else {
  3213. emitter = process.__signal_exit_emitter__ = new EE()
  3214. emitter.count = 0
  3215. emitter.emitted = {}
  3216. }
  3217. // Because this emitter is a global, we have to check to see if a
  3218. // previous version of this library failed to enable infinite listeners.
  3219. // I know what you're about to say. But literally everything about
  3220. // signal-exit is a compromise with evil. Get used to it.
  3221. if (!emitter.infinite) {
  3222. emitter.setMaxListeners(Infinity)
  3223. emitter.infinite = true
  3224. }
  3225. module.exports = function (cb, opts) {
  3226. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3227. if (loaded === false) {
  3228. load()
  3229. }
  3230. var ev = 'exit'
  3231. if (opts && opts.alwaysLast) {
  3232. ev = 'afterexit'
  3233. }
  3234. var remove = function () {
  3235. emitter.removeListener(ev, cb)
  3236. if (emitter.listeners('exit').length === 0 &&
  3237. emitter.listeners('afterexit').length === 0) {
  3238. unload()
  3239. }
  3240. }
  3241. emitter.on(ev, cb)
  3242. return remove
  3243. }
  3244. module.exports.unload = unload
  3245. function unload () {
  3246. if (!loaded) {
  3247. return
  3248. }
  3249. loaded = false
  3250. signals.forEach(function (sig) {
  3251. try {
  3252. process.removeListener(sig, sigListeners[sig])
  3253. } catch (er) {}
  3254. })
  3255. process.emit = originalProcessEmit
  3256. process.reallyExit = originalProcessReallyExit
  3257. emitter.count -= 1
  3258. }
  3259. function emit (event, code, signal) {
  3260. if (emitter.emitted[event]) {
  3261. return
  3262. }
  3263. emitter.emitted[event] = true
  3264. emitter.emit(event, code, signal)
  3265. }
  3266. // { <signal>: <listener fn>, ... }
  3267. var sigListeners = {}
  3268. signals.forEach(function (sig) {
  3269. sigListeners[sig] = function listener () {
  3270. // If there are no other listeners, an exit is coming!
  3271. // Simplest way: remove us and then re-send the signal.
  3272. // We know that this will kill the process, so we can
  3273. // safely emit now.
  3274. var listeners = process.listeners(sig)
  3275. if (listeners.length === emitter.count) {
  3276. unload()
  3277. emit('exit', null, sig)
  3278. /* istanbul ignore next */
  3279. emit('afterexit', null, sig)
  3280. /* istanbul ignore next */
  3281. process.kill(process.pid, sig)
  3282. }
  3283. }
  3284. })
  3285. module.exports.signals = function () {
  3286. return signals
  3287. }
  3288. module.exports.load = load
  3289. var loaded = false
  3290. function load () {
  3291. if (loaded) {
  3292. return
  3293. }
  3294. loaded = true
  3295. // This is the number of onSignalExit's that are in play.
  3296. // It's important so that we can count the correct number of
  3297. // listeners on signals, and don't wait for the other one to
  3298. // handle it instead of us.
  3299. emitter.count += 1
  3300. signals = signals.filter(function (sig) {
  3301. try {
  3302. process.on(sig, sigListeners[sig])
  3303. return true
  3304. } catch (er) {
  3305. return false
  3306. }
  3307. })
  3308. process.emit = processEmit
  3309. process.reallyExit = processReallyExit
  3310. }
  3311. var originalProcessReallyExit = process.reallyExit
  3312. function processReallyExit (code) {
  3313. process.exitCode = code || 0
  3314. emit('exit', process.exitCode, null)
  3315. /* istanbul ignore next */
  3316. emit('afterexit', process.exitCode, null)
  3317. /* istanbul ignore next */
  3318. originalProcessReallyExit.call(process, process.exitCode)
  3319. }
  3320. var originalProcessEmit = process.emit
  3321. function processEmit (ev, arg) {
  3322. if (ev === 'exit') {
  3323. if (arg !== undefined) {
  3324. process.exitCode = arg
  3325. }
  3326. var ret = originalProcessEmit.apply(this, arguments)
  3327. emit('exit', process.exitCode, null)
  3328. /* istanbul ignore next */
  3329. emit('afterexit', process.exitCode, null)
  3330. return ret
  3331. } else {
  3332. return originalProcessEmit.apply(this, arguments)
  3333. }
  3334. }
  3335. /***/ }),
  3336. /***/ 262:
  3337. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3338. "use strict";
  3339. Object.defineProperty(exports, "__esModule", { value: true });
  3340. const fs_1 = __webpack_require__(747);
  3341. const os_1 = __webpack_require__(87);
  3342. class Context {
  3343. /**
  3344. * Hydrate the context from the environment
  3345. */
  3346. constructor() {
  3347. this.payload = {};
  3348. if (process.env.GITHUB_EVENT_PATH) {
  3349. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3350. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3351. }
  3352. else {
  3353. const path = process.env.GITHUB_EVENT_PATH;
  3354. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3355. }
  3356. }
  3357. this.eventName = process.env.GITHUB_EVENT_NAME;
  3358. this.sha = process.env.GITHUB_SHA;
  3359. this.ref = process.env.GITHUB_REF;
  3360. this.workflow = process.env.GITHUB_WORKFLOW;
  3361. this.action = process.env.GITHUB_ACTION;
  3362. this.actor = process.env.GITHUB_ACTOR;
  3363. }
  3364. get issue() {
  3365. const payload = this.payload;
  3366. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3367. }
  3368. get repo() {
  3369. if (process.env.GITHUB_REPOSITORY) {
  3370. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3371. return { owner, repo };
  3372. }
  3373. if (this.payload.repository) {
  3374. return {
  3375. owner: this.payload.repository.owner.login,
  3376. repo: this.payload.repository.name
  3377. };
  3378. }
  3379. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3380. }
  3381. }
  3382. exports.Context = Context;
  3383. //# sourceMappingURL=context.js.map
  3384. /***/ }),
  3385. /***/ 265:
  3386. /***/ (function(module, __unusedexports, __webpack_require__) {
  3387. module.exports = getPage
  3388. const deprecate = __webpack_require__(370)
  3389. const getPageLinks = __webpack_require__(577)
  3390. const HttpError = __webpack_require__(297)
  3391. function getPage (octokit, link, which, headers) {
  3392. 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.`)
  3393. const url = getPageLinks(link)[which]
  3394. if (!url) {
  3395. const urlError = new HttpError(`No ${which} page found`, 404)
  3396. return Promise.reject(urlError)
  3397. }
  3398. const requestOptions = {
  3399. url,
  3400. headers: applyAcceptHeader(link, headers)
  3401. }
  3402. const promise = octokit.request(requestOptions)
  3403. return promise
  3404. }
  3405. function applyAcceptHeader (res, headers) {
  3406. const previous = res.headers && res.headers['x-github-media-type']
  3407. if (!previous || (headers && headers.accept)) {
  3408. return headers
  3409. }
  3410. headers = headers || {}
  3411. headers.accept = 'application/vnd.' + previous
  3412. .replace('; param=', '.')
  3413. .replace('; format=', '+')
  3414. return headers
  3415. }
  3416. /***/ }),
  3417. /***/ 280:
  3418. /***/ (function(module, exports) {
  3419. exports = module.exports = SemVer
  3420. var debug
  3421. /* istanbul ignore next */
  3422. if (typeof process === 'object' &&
  3423. process.env &&
  3424. process.env.NODE_DEBUG &&
  3425. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3426. debug = function () {
  3427. var args = Array.prototype.slice.call(arguments, 0)
  3428. args.unshift('SEMVER')
  3429. console.log.apply(console, args)
  3430. }
  3431. } else {
  3432. debug = function () {}
  3433. }
  3434. // Note: this is the semver.org version of the spec that it implements
  3435. // Not necessarily the package version of this code.
  3436. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3437. var MAX_LENGTH = 256
  3438. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3439. /* istanbul ignore next */ 9007199254740991
  3440. // Max safe segment length for coercion.
  3441. var MAX_SAFE_COMPONENT_LENGTH = 16
  3442. // The actual regexps go on exports.re
  3443. var re = exports.re = []
  3444. var src = exports.src = []
  3445. var R = 0
  3446. // The following Regular Expressions can be used for tokenizing,
  3447. // validating, and parsing SemVer version strings.
  3448. // ## Numeric Identifier
  3449. // A single `0`, or a non-zero digit followed by zero or more digits.
  3450. var NUMERICIDENTIFIER = R++
  3451. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3452. var NUMERICIDENTIFIERLOOSE = R++
  3453. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3454. // ## Non-numeric Identifier
  3455. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3456. // more letters, digits, or hyphens.
  3457. var NONNUMERICIDENTIFIER = R++
  3458. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3459. // ## Main Version
  3460. // Three dot-separated numeric identifiers.
  3461. var MAINVERSION = R++
  3462. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3463. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3464. '(' + src[NUMERICIDENTIFIER] + ')'
  3465. var MAINVERSIONLOOSE = R++
  3466. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3467. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3468. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3469. // ## Pre-release Version Identifier
  3470. // A numeric identifier, or a non-numeric identifier.
  3471. var PRERELEASEIDENTIFIER = R++
  3472. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3473. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3474. var PRERELEASEIDENTIFIERLOOSE = R++
  3475. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3476. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3477. // ## Pre-release Version
  3478. // Hyphen, followed by one or more dot-separated pre-release version
  3479. // identifiers.
  3480. var PRERELEASE = R++
  3481. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3482. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3483. var PRERELEASELOOSE = R++
  3484. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3485. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3486. // ## Build Metadata Identifier
  3487. // Any combination of digits, letters, or hyphens.
  3488. var BUILDIDENTIFIER = R++
  3489. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3490. // ## Build Metadata
  3491. // Plus sign, followed by one or more period-separated build metadata
  3492. // identifiers.
  3493. var BUILD = R++
  3494. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3495. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3496. // ## Full Version String
  3497. // A main version, followed optionally by a pre-release version and
  3498. // build metadata.
  3499. // Note that the only major, minor, patch, and pre-release sections of
  3500. // the version string are capturing groups. The build metadata is not a
  3501. // capturing group, because it should not ever be used in version
  3502. // comparison.
  3503. var FULL = R++
  3504. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3505. src[PRERELEASE] + '?' +
  3506. src[BUILD] + '?'
  3507. src[FULL] = '^' + FULLPLAIN + '$'
  3508. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3509. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3510. // common in the npm registry.
  3511. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3512. src[PRERELEASELOOSE] + '?' +
  3513. src[BUILD] + '?'
  3514. var LOOSE = R++
  3515. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3516. var GTLT = R++
  3517. src[GTLT] = '((?:<|>)?=?)'
  3518. // Something like "2.*" or "1.2.x".
  3519. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3520. // Only the first item is strictly required.
  3521. var XRANGEIDENTIFIERLOOSE = R++
  3522. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3523. var XRANGEIDENTIFIER = R++
  3524. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3525. var XRANGEPLAIN = R++
  3526. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3527. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3528. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3529. '(?:' + src[PRERELEASE] + ')?' +
  3530. src[BUILD] + '?' +
  3531. ')?)?'
  3532. var XRANGEPLAINLOOSE = R++
  3533. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3534. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3535. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3536. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3537. src[BUILD] + '?' +
  3538. ')?)?'
  3539. var XRANGE = R++
  3540. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3541. var XRANGELOOSE = R++
  3542. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3543. // Coercion.
  3544. // Extract anything that could conceivably be a part of a valid semver
  3545. var COERCE = R++
  3546. src[COERCE] = '(?:^|[^\\d])' +
  3547. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3548. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3549. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3550. '(?:$|[^\\d])'
  3551. // Tilde ranges.
  3552. // Meaning is "reasonably at or greater than"
  3553. var LONETILDE = R++
  3554. src[LONETILDE] = '(?:~>?)'
  3555. var TILDETRIM = R++
  3556. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3557. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3558. var tildeTrimReplace = '$1~'
  3559. var TILDE = R++
  3560. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3561. var TILDELOOSE = R++
  3562. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3563. // Caret ranges.
  3564. // Meaning is "at least and backwards compatible with"
  3565. var LONECARET = R++
  3566. src[LONECARET] = '(?:\\^)'
  3567. var CARETTRIM = R++
  3568. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3569. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3570. var caretTrimReplace = '$1^'
  3571. var CARET = R++
  3572. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3573. var CARETLOOSE = R++
  3574. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3575. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3576. var COMPARATORLOOSE = R++
  3577. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3578. var COMPARATOR = R++
  3579. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3580. // An expression to strip any whitespace between the gtlt and the thing
  3581. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3582. var COMPARATORTRIM = R++
  3583. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3584. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3585. // this one has to use the /g flag
  3586. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3587. var comparatorTrimReplace = '$1$2$3'
  3588. // Something like `1.2.3 - 1.2.4`
  3589. // Note that these all use the loose form, because they'll be
  3590. // checked against either the strict or loose comparator form
  3591. // later.
  3592. var HYPHENRANGE = R++
  3593. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3594. '\\s+-\\s+' +
  3595. '(' + src[XRANGEPLAIN] + ')' +
  3596. '\\s*$'
  3597. var HYPHENRANGELOOSE = R++
  3598. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3599. '\\s+-\\s+' +
  3600. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3601. '\\s*$'
  3602. // Star ranges basically just allow anything at all.
  3603. var STAR = R++
  3604. src[STAR] = '(<|>)?=?\\s*\\*'
  3605. // Compile to actual regexp objects.
  3606. // All are flag-free, unless they were created above with a flag.
  3607. for (var i = 0; i < R; i++) {
  3608. debug(i, src[i])
  3609. if (!re[i]) {
  3610. re[i] = new RegExp(src[i])
  3611. }
  3612. }
  3613. exports.parse = parse
  3614. function parse (version, options) {
  3615. if (!options || typeof options !== 'object') {
  3616. options = {
  3617. loose: !!options,
  3618. includePrerelease: false
  3619. }
  3620. }
  3621. if (version instanceof SemVer) {
  3622. return version
  3623. }
  3624. if (typeof version !== 'string') {
  3625. return null
  3626. }
  3627. if (version.length > MAX_LENGTH) {
  3628. return null
  3629. }
  3630. var r = options.loose ? re[LOOSE] : re[FULL]
  3631. if (!r.test(version)) {
  3632. return null
  3633. }
  3634. try {
  3635. return new SemVer(version, options)
  3636. } catch (er) {
  3637. return null
  3638. }
  3639. }
  3640. exports.valid = valid
  3641. function valid (version, options) {
  3642. var v = parse(version, options)
  3643. return v ? v.version : null
  3644. }
  3645. exports.clean = clean
  3646. function clean (version, options) {
  3647. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3648. return s ? s.version : null
  3649. }
  3650. exports.SemVer = SemVer
  3651. function SemVer (version, options) {
  3652. if (!options || typeof options !== 'object') {
  3653. options = {
  3654. loose: !!options,
  3655. includePrerelease: false
  3656. }
  3657. }
  3658. if (version instanceof SemVer) {
  3659. if (version.loose === options.loose) {
  3660. return version
  3661. } else {
  3662. version = version.version
  3663. }
  3664. } else if (typeof version !== 'string') {
  3665. throw new TypeError('Invalid Version: ' + version)
  3666. }
  3667. if (version.length > MAX_LENGTH) {
  3668. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3669. }
  3670. if (!(this instanceof SemVer)) {
  3671. return new SemVer(version, options)
  3672. }
  3673. debug('SemVer', version, options)
  3674. this.options = options
  3675. this.loose = !!options.loose
  3676. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3677. if (!m) {
  3678. throw new TypeError('Invalid Version: ' + version)
  3679. }
  3680. this.raw = version
  3681. // these are actually numbers
  3682. this.major = +m[1]
  3683. this.minor = +m[2]
  3684. this.patch = +m[3]
  3685. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3686. throw new TypeError('Invalid major version')
  3687. }
  3688. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3689. throw new TypeError('Invalid minor version')
  3690. }
  3691. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3692. throw new TypeError('Invalid patch version')
  3693. }
  3694. // numberify any prerelease numeric ids
  3695. if (!m[4]) {
  3696. this.prerelease = []
  3697. } else {
  3698. this.prerelease = m[4].split('.').map(function (id) {
  3699. if (/^[0-9]+$/.test(id)) {
  3700. var num = +id
  3701. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3702. return num
  3703. }
  3704. }
  3705. return id
  3706. })
  3707. }
  3708. this.build = m[5] ? m[5].split('.') : []
  3709. this.format()
  3710. }
  3711. SemVer.prototype.format = function () {
  3712. this.version = this.major + '.' + this.minor + '.' + this.patch
  3713. if (this.prerelease.length) {
  3714. this.version += '-' + this.prerelease.join('.')
  3715. }
  3716. return this.version
  3717. }
  3718. SemVer.prototype.toString = function () {
  3719. return this.version
  3720. }
  3721. SemVer.prototype.compare = function (other) {
  3722. debug('SemVer.compare', this.version, this.options, other)
  3723. if (!(other instanceof SemVer)) {
  3724. other = new SemVer(other, this.options)
  3725. }
  3726. return this.compareMain(other) || this.comparePre(other)
  3727. }
  3728. SemVer.prototype.compareMain = function (other) {
  3729. if (!(other instanceof SemVer)) {
  3730. other = new SemVer(other, this.options)
  3731. }
  3732. return compareIdentifiers(this.major, other.major) ||
  3733. compareIdentifiers(this.minor, other.minor) ||
  3734. compareIdentifiers(this.patch, other.patch)
  3735. }
  3736. SemVer.prototype.comparePre = function (other) {
  3737. if (!(other instanceof SemVer)) {
  3738. other = new SemVer(other, this.options)
  3739. }
  3740. // NOT having a prerelease is > having one
  3741. if (this.prerelease.length && !other.prerelease.length) {
  3742. return -1
  3743. } else if (!this.prerelease.length && other.prerelease.length) {
  3744. return 1
  3745. } else if (!this.prerelease.length && !other.prerelease.length) {
  3746. return 0
  3747. }
  3748. var i = 0
  3749. do {
  3750. var a = this.prerelease[i]
  3751. var b = other.prerelease[i]
  3752. debug('prerelease compare', i, a, b)
  3753. if (a === undefined && b === undefined) {
  3754. return 0
  3755. } else if (b === undefined) {
  3756. return 1
  3757. } else if (a === undefined) {
  3758. return -1
  3759. } else if (a === b) {
  3760. continue
  3761. } else {
  3762. return compareIdentifiers(a, b)
  3763. }
  3764. } while (++i)
  3765. }
  3766. // preminor will bump the version up to the next minor release, and immediately
  3767. // down to pre-release. premajor and prepatch work the same way.
  3768. SemVer.prototype.inc = function (release, identifier) {
  3769. switch (release) {
  3770. case 'premajor':
  3771. this.prerelease.length = 0
  3772. this.patch = 0
  3773. this.minor = 0
  3774. this.major++
  3775. this.inc('pre', identifier)
  3776. break
  3777. case 'preminor':
  3778. this.prerelease.length = 0
  3779. this.patch = 0
  3780. this.minor++
  3781. this.inc('pre', identifier)
  3782. break
  3783. case 'prepatch':
  3784. // If this is already a prerelease, it will bump to the next version
  3785. // drop any prereleases that might already exist, since they are not
  3786. // relevant at this point.
  3787. this.prerelease.length = 0
  3788. this.inc('patch', identifier)
  3789. this.inc('pre', identifier)
  3790. break
  3791. // If the input is a non-prerelease version, this acts the same as
  3792. // prepatch.
  3793. case 'prerelease':
  3794. if (this.prerelease.length === 0) {
  3795. this.inc('patch', identifier)
  3796. }
  3797. this.inc('pre', identifier)
  3798. break
  3799. case 'major':
  3800. // If this is a pre-major version, bump up to the same major version.
  3801. // Otherwise increment major.
  3802. // 1.0.0-5 bumps to 1.0.0
  3803. // 1.1.0 bumps to 2.0.0
  3804. if (this.minor !== 0 ||
  3805. this.patch !== 0 ||
  3806. this.prerelease.length === 0) {
  3807. this.major++
  3808. }
  3809. this.minor = 0
  3810. this.patch = 0
  3811. this.prerelease = []
  3812. break
  3813. case 'minor':
  3814. // If this is a pre-minor version, bump up to the same minor version.
  3815. // Otherwise increment minor.
  3816. // 1.2.0-5 bumps to 1.2.0
  3817. // 1.2.1 bumps to 1.3.0
  3818. if (this.patch !== 0 || this.prerelease.length === 0) {
  3819. this.minor++
  3820. }
  3821. this.patch = 0
  3822. this.prerelease = []
  3823. break
  3824. case 'patch':
  3825. // If this is not a pre-release version, it will increment the patch.
  3826. // If it is a pre-release it will bump up to the same patch version.
  3827. // 1.2.0-5 patches to 1.2.0
  3828. // 1.2.0 patches to 1.2.1
  3829. if (this.prerelease.length === 0) {
  3830. this.patch++
  3831. }
  3832. this.prerelease = []
  3833. break
  3834. // This probably shouldn't be used publicly.
  3835. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3836. case 'pre':
  3837. if (this.prerelease.length === 0) {
  3838. this.prerelease = [0]
  3839. } else {
  3840. var i = this.prerelease.length
  3841. while (--i >= 0) {
  3842. if (typeof this.prerelease[i] === 'number') {
  3843. this.prerelease[i]++
  3844. i = -2
  3845. }
  3846. }
  3847. if (i === -1) {
  3848. // didn't increment anything
  3849. this.prerelease.push(0)
  3850. }
  3851. }
  3852. if (identifier) {
  3853. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3854. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3855. if (this.prerelease[0] === identifier) {
  3856. if (isNaN(this.prerelease[1])) {
  3857. this.prerelease = [identifier, 0]
  3858. }
  3859. } else {
  3860. this.prerelease = [identifier, 0]
  3861. }
  3862. }
  3863. break
  3864. default:
  3865. throw new Error('invalid increment argument: ' + release)
  3866. }
  3867. this.format()
  3868. this.raw = this.version
  3869. return this
  3870. }
  3871. exports.inc = inc
  3872. function inc (version, release, loose, identifier) {
  3873. if (typeof (loose) === 'string') {
  3874. identifier = loose
  3875. loose = undefined
  3876. }
  3877. try {
  3878. return new SemVer(version, loose).inc(release, identifier).version
  3879. } catch (er) {
  3880. return null
  3881. }
  3882. }
  3883. exports.diff = diff
  3884. function diff (version1, version2) {
  3885. if (eq(version1, version2)) {
  3886. return null
  3887. } else {
  3888. var v1 = parse(version1)
  3889. var v2 = parse(version2)
  3890. var prefix = ''
  3891. if (v1.prerelease.length || v2.prerelease.length) {
  3892. prefix = 'pre'
  3893. var defaultResult = 'prerelease'
  3894. }
  3895. for (var key in v1) {
  3896. if (key === 'major' || key === 'minor' || key === 'patch') {
  3897. if (v1[key] !== v2[key]) {
  3898. return prefix + key
  3899. }
  3900. }
  3901. }
  3902. return defaultResult // may be undefined
  3903. }
  3904. }
  3905. exports.compareIdentifiers = compareIdentifiers
  3906. var numeric = /^[0-9]+$/
  3907. function compareIdentifiers (a, b) {
  3908. var anum = numeric.test(a)
  3909. var bnum = numeric.test(b)
  3910. if (anum && bnum) {
  3911. a = +a
  3912. b = +b
  3913. }
  3914. return a === b ? 0
  3915. : (anum && !bnum) ? -1
  3916. : (bnum && !anum) ? 1
  3917. : a < b ? -1
  3918. : 1
  3919. }
  3920. exports.rcompareIdentifiers = rcompareIdentifiers
  3921. function rcompareIdentifiers (a, b) {
  3922. return compareIdentifiers(b, a)
  3923. }
  3924. exports.major = major
  3925. function major (a, loose) {
  3926. return new SemVer(a, loose).major
  3927. }
  3928. exports.minor = minor
  3929. function minor (a, loose) {
  3930. return new SemVer(a, loose).minor
  3931. }
  3932. exports.patch = patch
  3933. function patch (a, loose) {
  3934. return new SemVer(a, loose).patch
  3935. }
  3936. exports.compare = compare
  3937. function compare (a, b, loose) {
  3938. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3939. }
  3940. exports.compareLoose = compareLoose
  3941. function compareLoose (a, b) {
  3942. return compare(a, b, true)
  3943. }
  3944. exports.rcompare = rcompare
  3945. function rcompare (a, b, loose) {
  3946. return compare(b, a, loose)
  3947. }
  3948. exports.sort = sort
  3949. function sort (list, loose) {
  3950. return list.sort(function (a, b) {
  3951. return exports.compare(a, b, loose)
  3952. })
  3953. }
  3954. exports.rsort = rsort
  3955. function rsort (list, loose) {
  3956. return list.sort(function (a, b) {
  3957. return exports.rcompare(a, b, loose)
  3958. })
  3959. }
  3960. exports.gt = gt
  3961. function gt (a, b, loose) {
  3962. return compare(a, b, loose) > 0
  3963. }
  3964. exports.lt = lt
  3965. function lt (a, b, loose) {
  3966. return compare(a, b, loose) < 0
  3967. }
  3968. exports.eq = eq
  3969. function eq (a, b, loose) {
  3970. return compare(a, b, loose) === 0
  3971. }
  3972. exports.neq = neq
  3973. function neq (a, b, loose) {
  3974. return compare(a, b, loose) !== 0
  3975. }
  3976. exports.gte = gte
  3977. function gte (a, b, loose) {
  3978. return compare(a, b, loose) >= 0
  3979. }
  3980. exports.lte = lte
  3981. function lte (a, b, loose) {
  3982. return compare(a, b, loose) <= 0
  3983. }
  3984. exports.cmp = cmp
  3985. function cmp (a, op, b, loose) {
  3986. switch (op) {
  3987. case '===':
  3988. if (typeof a === 'object')
  3989. a = a.version
  3990. if (typeof b === 'object')
  3991. b = b.version
  3992. return a === b
  3993. case '!==':
  3994. if (typeof a === 'object')
  3995. a = a.version
  3996. if (typeof b === 'object')
  3997. b = b.version
  3998. return a !== b
  3999. case '':
  4000. case '=':
  4001. case '==':
  4002. return eq(a, b, loose)
  4003. case '!=':
  4004. return neq(a, b, loose)
  4005. case '>':
  4006. return gt(a, b, loose)
  4007. case '>=':
  4008. return gte(a, b, loose)
  4009. case '<':
  4010. return lt(a, b, loose)
  4011. case '<=':
  4012. return lte(a, b, loose)
  4013. default:
  4014. throw new TypeError('Invalid operator: ' + op)
  4015. }
  4016. }
  4017. exports.Comparator = Comparator
  4018. function Comparator (comp, options) {
  4019. if (!options || typeof options !== 'object') {
  4020. options = {
  4021. loose: !!options,
  4022. includePrerelease: false
  4023. }
  4024. }
  4025. if (comp instanceof Comparator) {
  4026. if (comp.loose === !!options.loose) {
  4027. return comp
  4028. } else {
  4029. comp = comp.value
  4030. }
  4031. }
  4032. if (!(this instanceof Comparator)) {
  4033. return new Comparator(comp, options)
  4034. }
  4035. debug('comparator', comp, options)
  4036. this.options = options
  4037. this.loose = !!options.loose
  4038. this.parse(comp)
  4039. if (this.semver === ANY) {
  4040. this.value = ''
  4041. } else {
  4042. this.value = this.operator + this.semver.version
  4043. }
  4044. debug('comp', this)
  4045. }
  4046. var ANY = {}
  4047. Comparator.prototype.parse = function (comp) {
  4048. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4049. var m = comp.match(r)
  4050. if (!m) {
  4051. throw new TypeError('Invalid comparator: ' + comp)
  4052. }
  4053. this.operator = m[1]
  4054. if (this.operator === '=') {
  4055. this.operator = ''
  4056. }
  4057. // if it literally is just '>' or '' then allow anything.
  4058. if (!m[2]) {
  4059. this.semver = ANY
  4060. } else {
  4061. this.semver = new SemVer(m[2], this.options.loose)
  4062. }
  4063. }
  4064. Comparator.prototype.toString = function () {
  4065. return this.value
  4066. }
  4067. Comparator.prototype.test = function (version) {
  4068. debug('Comparator.test', version, this.options.loose)
  4069. if (this.semver === ANY) {
  4070. return true
  4071. }
  4072. if (typeof version === 'string') {
  4073. version = new SemVer(version, this.options)
  4074. }
  4075. return cmp(version, this.operator, this.semver, this.options)
  4076. }
  4077. Comparator.prototype.intersects = function (comp, options) {
  4078. if (!(comp instanceof Comparator)) {
  4079. throw new TypeError('a Comparator is required')
  4080. }
  4081. if (!options || typeof options !== 'object') {
  4082. options = {
  4083. loose: !!options,
  4084. includePrerelease: false
  4085. }
  4086. }
  4087. var rangeTmp
  4088. if (this.operator === '') {
  4089. rangeTmp = new Range(comp.value, options)
  4090. return satisfies(this.value, rangeTmp, options)
  4091. } else if (comp.operator === '') {
  4092. rangeTmp = new Range(this.value, options)
  4093. return satisfies(comp.semver, rangeTmp, options)
  4094. }
  4095. var sameDirectionIncreasing =
  4096. (this.operator === '>=' || this.operator === '>') &&
  4097. (comp.operator === '>=' || comp.operator === '>')
  4098. var sameDirectionDecreasing =
  4099. (this.operator === '<=' || this.operator === '<') &&
  4100. (comp.operator === '<=' || comp.operator === '<')
  4101. var sameSemVer = this.semver.version === comp.semver.version
  4102. var differentDirectionsInclusive =
  4103. (this.operator === '>=' || this.operator === '<=') &&
  4104. (comp.operator === '>=' || comp.operator === '<=')
  4105. var oppositeDirectionsLessThan =
  4106. cmp(this.semver, '<', comp.semver, options) &&
  4107. ((this.operator === '>=' || this.operator === '>') &&
  4108. (comp.operator === '<=' || comp.operator === '<'))
  4109. var oppositeDirectionsGreaterThan =
  4110. cmp(this.semver, '>', comp.semver, options) &&
  4111. ((this.operator === '<=' || this.operator === '<') &&
  4112. (comp.operator === '>=' || comp.operator === '>'))
  4113. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4114. (sameSemVer && differentDirectionsInclusive) ||
  4115. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4116. }
  4117. exports.Range = Range
  4118. function Range (range, options) {
  4119. if (!options || typeof options !== 'object') {
  4120. options = {
  4121. loose: !!options,
  4122. includePrerelease: false
  4123. }
  4124. }
  4125. if (range instanceof Range) {
  4126. if (range.loose === !!options.loose &&
  4127. range.includePrerelease === !!options.includePrerelease) {
  4128. return range
  4129. } else {
  4130. return new Range(range.raw, options)
  4131. }
  4132. }
  4133. if (range instanceof Comparator) {
  4134. return new Range(range.value, options)
  4135. }
  4136. if (!(this instanceof Range)) {
  4137. return new Range(range, options)
  4138. }
  4139. this.options = options
  4140. this.loose = !!options.loose
  4141. this.includePrerelease = !!options.includePrerelease
  4142. // First, split based on boolean or ||
  4143. this.raw = range
  4144. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4145. return this.parseRange(range.trim())
  4146. }, this).filter(function (c) {
  4147. // throw out any that are not relevant for whatever reason
  4148. return c.length
  4149. })
  4150. if (!this.set.length) {
  4151. throw new TypeError('Invalid SemVer Range: ' + range)
  4152. }
  4153. this.format()
  4154. }
  4155. Range.prototype.format = function () {
  4156. this.range = this.set.map(function (comps) {
  4157. return comps.join(' ').trim()
  4158. }).join('||').trim()
  4159. return this.range
  4160. }
  4161. Range.prototype.toString = function () {
  4162. return this.range
  4163. }
  4164. Range.prototype.parseRange = function (range) {
  4165. var loose = this.options.loose
  4166. range = range.trim()
  4167. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4168. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4169. range = range.replace(hr, hyphenReplace)
  4170. debug('hyphen replace', range)
  4171. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4172. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4173. debug('comparator trim', range, re[COMPARATORTRIM])
  4174. // `~ 1.2.3` => `~1.2.3`
  4175. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4176. // `^ 1.2.3` => `^1.2.3`
  4177. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4178. // normalize spaces
  4179. range = range.split(/\s+/).join(' ')
  4180. // At this point, the range is completely trimmed and
  4181. // ready to be split into comparators.
  4182. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4183. var set = range.split(' ').map(function (comp) {
  4184. return parseComparator(comp, this.options)
  4185. }, this).join(' ').split(/\s+/)
  4186. if (this.options.loose) {
  4187. // in loose mode, throw out any that are not valid comparators
  4188. set = set.filter(function (comp) {
  4189. return !!comp.match(compRe)
  4190. })
  4191. }
  4192. set = set.map(function (comp) {
  4193. return new Comparator(comp, this.options)
  4194. }, this)
  4195. return set
  4196. }
  4197. Range.prototype.intersects = function (range, options) {
  4198. if (!(range instanceof Range)) {
  4199. throw new TypeError('a Range is required')
  4200. }
  4201. return this.set.some(function (thisComparators) {
  4202. return thisComparators.every(function (thisComparator) {
  4203. return range.set.some(function (rangeComparators) {
  4204. return rangeComparators.every(function (rangeComparator) {
  4205. return thisComparator.intersects(rangeComparator, options)
  4206. })
  4207. })
  4208. })
  4209. })
  4210. }
  4211. // Mostly just for testing and legacy API reasons
  4212. exports.toComparators = toComparators
  4213. function toComparators (range, options) {
  4214. return new Range(range, options).set.map(function (comp) {
  4215. return comp.map(function (c) {
  4216. return c.value
  4217. }).join(' ').trim().split(' ')
  4218. })
  4219. }
  4220. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4221. // already replaced the hyphen ranges
  4222. // turn into a set of JUST comparators.
  4223. function parseComparator (comp, options) {
  4224. debug('comp', comp, options)
  4225. comp = replaceCarets(comp, options)
  4226. debug('caret', comp)
  4227. comp = replaceTildes(comp, options)
  4228. debug('tildes', comp)
  4229. comp = replaceXRanges(comp, options)
  4230. debug('xrange', comp)
  4231. comp = replaceStars(comp, options)
  4232. debug('stars', comp)
  4233. return comp
  4234. }
  4235. function isX (id) {
  4236. return !id || id.toLowerCase() === 'x' || id === '*'
  4237. }
  4238. // ~, ~> --> * (any, kinda silly)
  4239. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4240. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4241. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4242. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4243. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4244. function replaceTildes (comp, options) {
  4245. return comp.trim().split(/\s+/).map(function (comp) {
  4246. return replaceTilde(comp, options)
  4247. }).join(' ')
  4248. }
  4249. function replaceTilde (comp, options) {
  4250. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4251. return comp.replace(r, function (_, M, m, p, pr) {
  4252. debug('tilde', comp, _, M, m, p, pr)
  4253. var ret
  4254. if (isX(M)) {
  4255. ret = ''
  4256. } else if (isX(m)) {
  4257. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4258. } else if (isX(p)) {
  4259. // ~1.2 == >=1.2.0 <1.3.0
  4260. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4261. } else if (pr) {
  4262. debug('replaceTilde pr', pr)
  4263. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4264. ' <' + M + '.' + (+m + 1) + '.0'
  4265. } else {
  4266. // ~1.2.3 == >=1.2.3 <1.3.0
  4267. ret = '>=' + M + '.' + m + '.' + p +
  4268. ' <' + M + '.' + (+m + 1) + '.0'
  4269. }
  4270. debug('tilde return', ret)
  4271. return ret
  4272. })
  4273. }
  4274. // ^ --> * (any, kinda silly)
  4275. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4276. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4277. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4278. // ^1.2.3 --> >=1.2.3 <2.0.0
  4279. // ^1.2.0 --> >=1.2.0 <2.0.0
  4280. function replaceCarets (comp, options) {
  4281. return comp.trim().split(/\s+/).map(function (comp) {
  4282. return replaceCaret(comp, options)
  4283. }).join(' ')
  4284. }
  4285. function replaceCaret (comp, options) {
  4286. debug('caret', comp, options)
  4287. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4288. return comp.replace(r, function (_, M, m, p, pr) {
  4289. debug('caret', comp, _, M, m, p, pr)
  4290. var ret
  4291. if (isX(M)) {
  4292. ret = ''
  4293. } else if (isX(m)) {
  4294. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4295. } else if (isX(p)) {
  4296. if (M === '0') {
  4297. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4298. } else {
  4299. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4300. }
  4301. } else if (pr) {
  4302. debug('replaceCaret pr', pr)
  4303. if (M === '0') {
  4304. if (m === '0') {
  4305. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4306. ' <' + M + '.' + m + '.' + (+p + 1)
  4307. } else {
  4308. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4309. ' <' + M + '.' + (+m + 1) + '.0'
  4310. }
  4311. } else {
  4312. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4313. ' <' + (+M + 1) + '.0.0'
  4314. }
  4315. } else {
  4316. debug('no pr')
  4317. if (M === '0') {
  4318. if (m === '0') {
  4319. ret = '>=' + M + '.' + m + '.' + p +
  4320. ' <' + M + '.' + m + '.' + (+p + 1)
  4321. } else {
  4322. ret = '>=' + M + '.' + m + '.' + p +
  4323. ' <' + M + '.' + (+m + 1) + '.0'
  4324. }
  4325. } else {
  4326. ret = '>=' + M + '.' + m + '.' + p +
  4327. ' <' + (+M + 1) + '.0.0'
  4328. }
  4329. }
  4330. debug('caret return', ret)
  4331. return ret
  4332. })
  4333. }
  4334. function replaceXRanges (comp, options) {
  4335. debug('replaceXRanges', comp, options)
  4336. return comp.split(/\s+/).map(function (comp) {
  4337. return replaceXRange(comp, options)
  4338. }).join(' ')
  4339. }
  4340. function replaceXRange (comp, options) {
  4341. comp = comp.trim()
  4342. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4343. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4344. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4345. var xM = isX(M)
  4346. var xm = xM || isX(m)
  4347. var xp = xm || isX(p)
  4348. var anyX = xp
  4349. if (gtlt === '=' && anyX) {
  4350. gtlt = ''
  4351. }
  4352. if (xM) {
  4353. if (gtlt === '>' || gtlt === '<') {
  4354. // nothing is allowed
  4355. ret = '<0.0.0'
  4356. } else {
  4357. // nothing is forbidden
  4358. ret = '*'
  4359. }
  4360. } else if (gtlt && anyX) {
  4361. // we know patch is an x, because we have any x at all.
  4362. // replace X with 0
  4363. if (xm) {
  4364. m = 0
  4365. }
  4366. p = 0
  4367. if (gtlt === '>') {
  4368. // >1 => >=2.0.0
  4369. // >1.2 => >=1.3.0
  4370. // >1.2.3 => >= 1.2.4
  4371. gtlt = '>='
  4372. if (xm) {
  4373. M = +M + 1
  4374. m = 0
  4375. p = 0
  4376. } else {
  4377. m = +m + 1
  4378. p = 0
  4379. }
  4380. } else if (gtlt === '<=') {
  4381. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4382. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4383. gtlt = '<'
  4384. if (xm) {
  4385. M = +M + 1
  4386. } else {
  4387. m = +m + 1
  4388. }
  4389. }
  4390. ret = gtlt + M + '.' + m + '.' + p
  4391. } else if (xm) {
  4392. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4393. } else if (xp) {
  4394. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4395. }
  4396. debug('xRange return', ret)
  4397. return ret
  4398. })
  4399. }
  4400. // Because * is AND-ed with everything else in the comparator,
  4401. // and '' means "any version", just remove the *s entirely.
  4402. function replaceStars (comp, options) {
  4403. debug('replaceStars', comp, options)
  4404. // Looseness is ignored here. star is always as loose as it gets!
  4405. return comp.trim().replace(re[STAR], '')
  4406. }
  4407. // This function is passed to string.replace(re[HYPHENRANGE])
  4408. // M, m, patch, prerelease, build
  4409. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4410. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4411. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4412. function hyphenReplace ($0,
  4413. from, fM, fm, fp, fpr, fb,
  4414. to, tM, tm, tp, tpr, tb) {
  4415. if (isX(fM)) {
  4416. from = ''
  4417. } else if (isX(fm)) {
  4418. from = '>=' + fM + '.0.0'
  4419. } else if (isX(fp)) {
  4420. from = '>=' + fM + '.' + fm + '.0'
  4421. } else {
  4422. from = '>=' + from
  4423. }
  4424. if (isX(tM)) {
  4425. to = ''
  4426. } else if (isX(tm)) {
  4427. to = '<' + (+tM + 1) + '.0.0'
  4428. } else if (isX(tp)) {
  4429. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4430. } else if (tpr) {
  4431. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4432. } else {
  4433. to = '<=' + to
  4434. }
  4435. return (from + ' ' + to).trim()
  4436. }
  4437. // if ANY of the sets match ALL of its comparators, then pass
  4438. Range.prototype.test = function (version) {
  4439. if (!version) {
  4440. return false
  4441. }
  4442. if (typeof version === 'string') {
  4443. version = new SemVer(version, this.options)
  4444. }
  4445. for (var i = 0; i < this.set.length; i++) {
  4446. if (testSet(this.set[i], version, this.options)) {
  4447. return true
  4448. }
  4449. }
  4450. return false
  4451. }
  4452. function testSet (set, version, options) {
  4453. for (var i = 0; i < set.length; i++) {
  4454. if (!set[i].test(version)) {
  4455. return false
  4456. }
  4457. }
  4458. if (version.prerelease.length && !options.includePrerelease) {
  4459. // Find the set of versions that are allowed to have prereleases
  4460. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4461. // That should allow `1.2.3-pr.2` to pass.
  4462. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4463. // even though it's within the range set by the comparators.
  4464. for (i = 0; i < set.length; i++) {
  4465. debug(set[i].semver)
  4466. if (set[i].semver === ANY) {
  4467. continue
  4468. }
  4469. if (set[i].semver.prerelease.length > 0) {
  4470. var allowed = set[i].semver
  4471. if (allowed.major === version.major &&
  4472. allowed.minor === version.minor &&
  4473. allowed.patch === version.patch) {
  4474. return true
  4475. }
  4476. }
  4477. }
  4478. // Version has a -pre, but it's not one of the ones we like.
  4479. return false
  4480. }
  4481. return true
  4482. }
  4483. exports.satisfies = satisfies
  4484. function satisfies (version, range, options) {
  4485. try {
  4486. range = new Range(range, options)
  4487. } catch (er) {
  4488. return false
  4489. }
  4490. return range.test(version)
  4491. }
  4492. exports.maxSatisfying = maxSatisfying
  4493. function maxSatisfying (versions, range, options) {
  4494. var max = null
  4495. var maxSV = null
  4496. try {
  4497. var rangeObj = new Range(range, options)
  4498. } catch (er) {
  4499. return null
  4500. }
  4501. versions.forEach(function (v) {
  4502. if (rangeObj.test(v)) {
  4503. // satisfies(v, range, options)
  4504. if (!max || maxSV.compare(v) === -1) {
  4505. // compare(max, v, true)
  4506. max = v
  4507. maxSV = new SemVer(max, options)
  4508. }
  4509. }
  4510. })
  4511. return max
  4512. }
  4513. exports.minSatisfying = minSatisfying
  4514. function minSatisfying (versions, range, options) {
  4515. var min = null
  4516. var minSV = null
  4517. try {
  4518. var rangeObj = new Range(range, options)
  4519. } catch (er) {
  4520. return null
  4521. }
  4522. versions.forEach(function (v) {
  4523. if (rangeObj.test(v)) {
  4524. // satisfies(v, range, options)
  4525. if (!min || minSV.compare(v) === 1) {
  4526. // compare(min, v, true)
  4527. min = v
  4528. minSV = new SemVer(min, options)
  4529. }
  4530. }
  4531. })
  4532. return min
  4533. }
  4534. exports.minVersion = minVersion
  4535. function minVersion (range, loose) {
  4536. range = new Range(range, loose)
  4537. var minver = new SemVer('0.0.0')
  4538. if (range.test(minver)) {
  4539. return minver
  4540. }
  4541. minver = new SemVer('0.0.0-0')
  4542. if (range.test(minver)) {
  4543. return minver
  4544. }
  4545. minver = null
  4546. for (var i = 0; i < range.set.length; ++i) {
  4547. var comparators = range.set[i]
  4548. comparators.forEach(function (comparator) {
  4549. // Clone to avoid manipulating the comparator's semver object.
  4550. var compver = new SemVer(comparator.semver.version)
  4551. switch (comparator.operator) {
  4552. case '>':
  4553. if (compver.prerelease.length === 0) {
  4554. compver.patch++
  4555. } else {
  4556. compver.prerelease.push(0)
  4557. }
  4558. compver.raw = compver.format()
  4559. /* fallthrough */
  4560. case '':
  4561. case '>=':
  4562. if (!minver || gt(minver, compver)) {
  4563. minver = compver
  4564. }
  4565. break
  4566. case '<':
  4567. case '<=':
  4568. /* Ignore maximum versions */
  4569. break
  4570. /* istanbul ignore next */
  4571. default:
  4572. throw new Error('Unexpected operation: ' + comparator.operator)
  4573. }
  4574. })
  4575. }
  4576. if (minver && range.test(minver)) {
  4577. return minver
  4578. }
  4579. return null
  4580. }
  4581. exports.validRange = validRange
  4582. function validRange (range, options) {
  4583. try {
  4584. // Return '*' instead of '' so that truthiness works.
  4585. // This will throw if it's invalid anyway
  4586. return new Range(range, options).range || '*'
  4587. } catch (er) {
  4588. return null
  4589. }
  4590. }
  4591. // Determine if version is less than all the versions possible in the range
  4592. exports.ltr = ltr
  4593. function ltr (version, range, options) {
  4594. return outside(version, range, '<', options)
  4595. }
  4596. // Determine if version is greater than all the versions possible in the range.
  4597. exports.gtr = gtr
  4598. function gtr (version, range, options) {
  4599. return outside(version, range, '>', options)
  4600. }
  4601. exports.outside = outside
  4602. function outside (version, range, hilo, options) {
  4603. version = new SemVer(version, options)
  4604. range = new Range(range, options)
  4605. var gtfn, ltefn, ltfn, comp, ecomp
  4606. switch (hilo) {
  4607. case '>':
  4608. gtfn = gt
  4609. ltefn = lte
  4610. ltfn = lt
  4611. comp = '>'
  4612. ecomp = '>='
  4613. break
  4614. case '<':
  4615. gtfn = lt
  4616. ltefn = gte
  4617. ltfn = gt
  4618. comp = '<'
  4619. ecomp = '<='
  4620. break
  4621. default:
  4622. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4623. }
  4624. // If it satisifes the range it is not outside
  4625. if (satisfies(version, range, options)) {
  4626. return false
  4627. }
  4628. // From now on, variable terms are as if we're in "gtr" mode.
  4629. // but note that everything is flipped for the "ltr" function.
  4630. for (var i = 0; i < range.set.length; ++i) {
  4631. var comparators = range.set[i]
  4632. var high = null
  4633. var low = null
  4634. comparators.forEach(function (comparator) {
  4635. if (comparator.semver === ANY) {
  4636. comparator = new Comparator('>=0.0.0')
  4637. }
  4638. high = high || comparator
  4639. low = low || comparator
  4640. if (gtfn(comparator.semver, high.semver, options)) {
  4641. high = comparator
  4642. } else if (ltfn(comparator.semver, low.semver, options)) {
  4643. low = comparator
  4644. }
  4645. })
  4646. // If the edge version comparator has a operator then our version
  4647. // isn't outside it
  4648. if (high.operator === comp || high.operator === ecomp) {
  4649. return false
  4650. }
  4651. // If the lowest version comparator has an operator and our version
  4652. // is less than it then it isn't higher than the range
  4653. if ((!low.operator || low.operator === comp) &&
  4654. ltefn(version, low.semver)) {
  4655. return false
  4656. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4657. return false
  4658. }
  4659. }
  4660. return true
  4661. }
  4662. exports.prerelease = prerelease
  4663. function prerelease (version, options) {
  4664. var parsed = parse(version, options)
  4665. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4666. }
  4667. exports.intersects = intersects
  4668. function intersects (r1, r2, options) {
  4669. r1 = new Range(r1, options)
  4670. r2 = new Range(r2, options)
  4671. return r1.intersects(r2)
  4672. }
  4673. exports.coerce = coerce
  4674. function coerce (version) {
  4675. if (version instanceof SemVer) {
  4676. return version
  4677. }
  4678. if (typeof version !== 'string') {
  4679. return null
  4680. }
  4681. var match = version.match(re[COERCE])
  4682. if (match == null) {
  4683. return null
  4684. }
  4685. return parse(match[1] +
  4686. '.' + (match[2] || '0') +
  4687. '.' + (match[3] || '0'))
  4688. }
  4689. /***/ }),
  4690. /***/ 287:
  4691. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4692. "use strict";
  4693. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4694. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4695. return new (P || (P = Promise))(function (resolve, reject) {
  4696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4698. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4700. });
  4701. };
  4702. var __importStar = (this && this.__importStar) || function (mod) {
  4703. if (mod && mod.__esModule) return mod;
  4704. var result = {};
  4705. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4706. result["default"] = mod;
  4707. return result;
  4708. };
  4709. var __importDefault = (this && this.__importDefault) || function (mod) {
  4710. return (mod && mod.__esModule) ? mod : { "default": mod };
  4711. };
  4712. Object.defineProperty(exports, "__esModule", { value: true });
  4713. const assert = __importStar(__webpack_require__(357));
  4714. const core = __importStar(__webpack_require__(470));
  4715. const exec = __importStar(__webpack_require__(986));
  4716. const fs = __importStar(__webpack_require__(747));
  4717. const io = __importStar(__webpack_require__(1));
  4718. const os = __importStar(__webpack_require__(87));
  4719. const path = __importStar(__webpack_require__(622));
  4720. const regexpHelper = __importStar(__webpack_require__(528));
  4721. const stateHelper = __importStar(__webpack_require__(153));
  4722. const urlHelper = __importStar(__webpack_require__(81));
  4723. const v4_1 = __importDefault(__webpack_require__(826));
  4724. const IS_WINDOWS = process.platform === 'win32';
  4725. const SSH_COMMAND_KEY = 'core.sshCommand';
  4726. function createAuthHelper(git, settings) {
  4727. return new GitAuthHelper(git, settings);
  4728. }
  4729. exports.createAuthHelper = createAuthHelper;
  4730. class GitAuthHelper {
  4731. constructor(gitCommandManager, gitSourceSettings) {
  4732. this.sshCommand = '';
  4733. this.sshKeyPath = '';
  4734. this.sshKnownHostsPath = '';
  4735. this.temporaryHomePath = '';
  4736. this.git = gitCommandManager;
  4737. this.settings = gitSourceSettings || {};
  4738. // Token auth header
  4739. const serverUrl = urlHelper.getServerUrl();
  4740. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4741. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4742. core.setSecret(basicCredential);
  4743. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4744. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4745. // Instead of SSH URL
  4746. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4747. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4748. }
  4749. configureAuth() {
  4750. return __awaiter(this, void 0, void 0, function* () {
  4751. // Remove possible previous values
  4752. yield this.removeAuth();
  4753. // Configure new values
  4754. yield this.configureSsh();
  4755. yield this.configureToken();
  4756. });
  4757. }
  4758. configureGlobalAuth() {
  4759. return __awaiter(this, void 0, void 0, function* () {
  4760. // Create a temp home directory
  4761. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4762. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4763. const uniqueId = v4_1.default();
  4764. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4765. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4766. // Copy the global git config
  4767. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4768. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4769. let configExists = false;
  4770. try {
  4771. yield fs.promises.stat(gitConfigPath);
  4772. configExists = true;
  4773. }
  4774. catch (err) {
  4775. if (err.code !== 'ENOENT') {
  4776. throw err;
  4777. }
  4778. }
  4779. if (configExists) {
  4780. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4781. yield io.cp(gitConfigPath, newGitConfigPath);
  4782. }
  4783. else {
  4784. yield fs.promises.writeFile(newGitConfigPath, '');
  4785. }
  4786. try {
  4787. // Override HOME
  4788. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4789. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4790. // Configure the token
  4791. yield this.configureToken(newGitConfigPath, true);
  4792. // Configure HTTPS instead of SSH
  4793. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4794. if (!this.settings.sshKey) {
  4795. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4796. }
  4797. }
  4798. catch (err) {
  4799. // Unset in case somehow written to the real global config
  4800. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4801. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4802. throw err;
  4803. }
  4804. });
  4805. }
  4806. configureSubmoduleAuth() {
  4807. return __awaiter(this, void 0, void 0, function* () {
  4808. // Remove possible previous HTTPS instead of SSH
  4809. yield this.removeGitConfig(this.insteadOfKey, true);
  4810. if (this.settings.persistCredentials) {
  4811. // Configure a placeholder value. This approach avoids the credential being captured
  4812. // by process creation audit events, which are commonly logged. For more information,
  4813. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4814. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4815. // Replace the placeholder
  4816. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4817. for (const configPath of configPaths) {
  4818. core.debug(`Replacing token placeholder in '${configPath}'`);
  4819. this.replaceTokenPlaceholder(configPath);
  4820. }
  4821. if (this.settings.sshKey) {
  4822. // Configure core.sshCommand
  4823. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4824. }
  4825. else {
  4826. // Configure HTTPS instead of SSH
  4827. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4828. }
  4829. }
  4830. });
  4831. }
  4832. removeAuth() {
  4833. return __awaiter(this, void 0, void 0, function* () {
  4834. yield this.removeSsh();
  4835. yield this.removeToken();
  4836. });
  4837. }
  4838. removeGlobalAuth() {
  4839. return __awaiter(this, void 0, void 0, function* () {
  4840. core.debug(`Unsetting HOME override`);
  4841. this.git.removeEnvironmentVariable('HOME');
  4842. yield io.rmRF(this.temporaryHomePath);
  4843. });
  4844. }
  4845. configureSsh() {
  4846. return __awaiter(this, void 0, void 0, function* () {
  4847. if (!this.settings.sshKey) {
  4848. return;
  4849. }
  4850. // Write key
  4851. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4852. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4853. const uniqueId = v4_1.default();
  4854. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4855. stateHelper.setSshKeyPath(this.sshKeyPath);
  4856. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4857. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4858. // Remove inherited permissions on Windows
  4859. if (IS_WINDOWS) {
  4860. const icacls = yield io.which('icacls.exe');
  4861. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4862. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4863. }
  4864. // Write known hosts
  4865. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4866. let userKnownHosts = '';
  4867. try {
  4868. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4869. }
  4870. catch (err) {
  4871. if (err.code !== 'ENOENT') {
  4872. throw err;
  4873. }
  4874. }
  4875. let knownHosts = '';
  4876. if (userKnownHosts) {
  4877. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4878. }
  4879. if (this.settings.sshKnownHosts) {
  4880. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4881. }
  4882. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4883. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4884. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4885. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4886. // Configure GIT_SSH_COMMAND
  4887. const sshPath = yield io.which('ssh', true);
  4888. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4889. if (this.settings.sshStrict) {
  4890. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4891. }
  4892. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4893. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4894. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4895. // Configure core.sshCommand
  4896. if (this.settings.persistCredentials) {
  4897. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4898. }
  4899. });
  4900. }
  4901. configureToken(configPath, globalConfig) {
  4902. return __awaiter(this, void 0, void 0, function* () {
  4903. // Validate args
  4904. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4905. // Default config path
  4906. if (!configPath && !globalConfig) {
  4907. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4908. }
  4909. // Configure a placeholder value. This approach avoids the credential being captured
  4910. // by process creation audit events, which are commonly logged. For more information,
  4911. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4912. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4913. // Replace the placeholder
  4914. yield this.replaceTokenPlaceholder(configPath || '');
  4915. });
  4916. }
  4917. replaceTokenPlaceholder(configPath) {
  4918. return __awaiter(this, void 0, void 0, function* () {
  4919. assert.ok(configPath, 'configPath is not defined');
  4920. let content = (yield fs.promises.readFile(configPath)).toString();
  4921. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4922. if (placeholderIndex < 0 ||
  4923. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4924. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4925. }
  4926. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4927. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4928. yield fs.promises.writeFile(configPath, content);
  4929. });
  4930. }
  4931. removeSsh() {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. // SSH key
  4934. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4935. if (keyPath) {
  4936. try {
  4937. yield io.rmRF(keyPath);
  4938. }
  4939. catch (err) {
  4940. core.debug(err.message);
  4941. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4942. }
  4943. }
  4944. // SSH known hosts
  4945. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4946. if (knownHostsPath) {
  4947. try {
  4948. yield io.rmRF(knownHostsPath);
  4949. }
  4950. catch (_a) {
  4951. // Intentionally empty
  4952. }
  4953. }
  4954. // SSH command
  4955. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4956. });
  4957. }
  4958. removeToken() {
  4959. return __awaiter(this, void 0, void 0, function* () {
  4960. // HTTP extra header
  4961. yield this.removeGitConfig(this.tokenConfigKey);
  4962. });
  4963. }
  4964. removeGitConfig(configKey, submoduleOnly = false) {
  4965. return __awaiter(this, void 0, void 0, function* () {
  4966. if (!submoduleOnly) {
  4967. if ((yield this.git.configExists(configKey)) &&
  4968. !(yield this.git.tryConfigUnset(configKey))) {
  4969. // Load the config contents
  4970. core.warning(`Failed to remove '${configKey}' from the git config`);
  4971. }
  4972. }
  4973. const pattern = regexpHelper.escape(configKey);
  4974. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4975. });
  4976. }
  4977. }
  4978. /***/ }),
  4979. /***/ 289:
  4980. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4981. "use strict";
  4982. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4983. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4984. return new (P || (P = Promise))(function (resolve, reject) {
  4985. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4986. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4987. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4988. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4989. });
  4990. };
  4991. var __importStar = (this && this.__importStar) || function (mod) {
  4992. if (mod && mod.__esModule) return mod;
  4993. var result = {};
  4994. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4995. result["default"] = mod;
  4996. return result;
  4997. };
  4998. Object.defineProperty(exports, "__esModule", { value: true });
  4999. const core = __importStar(__webpack_require__(470));
  5000. const exec = __importStar(__webpack_require__(986));
  5001. const fshelper = __importStar(__webpack_require__(618));
  5002. const io = __importStar(__webpack_require__(1));
  5003. const path = __importStar(__webpack_require__(622));
  5004. const refHelper = __importStar(__webpack_require__(227));
  5005. const regexpHelper = __importStar(__webpack_require__(528));
  5006. const retryHelper = __importStar(__webpack_require__(587));
  5007. const git_version_1 = __webpack_require__(559);
  5008. // Auth header not supported before 2.9
  5009. // Wire protocol v2 not supported before 2.18
  5010. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5011. function createCommandManager(workingDirectory, lfs) {
  5012. return __awaiter(this, void 0, void 0, function* () {
  5013. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5014. });
  5015. }
  5016. exports.createCommandManager = createCommandManager;
  5017. class GitCommandManager {
  5018. // Private constructor; use createCommandManager()
  5019. constructor() {
  5020. this.gitEnv = {
  5021. GIT_TERMINAL_PROMPT: '0',
  5022. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5023. };
  5024. this.gitPath = '';
  5025. this.lfs = false;
  5026. this.workingDirectory = '';
  5027. }
  5028. branchDelete(remote, branch) {
  5029. return __awaiter(this, void 0, void 0, function* () {
  5030. const args = ['branch', '--delete', '--force'];
  5031. if (remote) {
  5032. args.push('--remote');
  5033. }
  5034. args.push(branch);
  5035. yield this.execGit(args);
  5036. });
  5037. }
  5038. branchExists(remote, pattern) {
  5039. return __awaiter(this, void 0, void 0, function* () {
  5040. const args = ['branch', '--list'];
  5041. if (remote) {
  5042. args.push('--remote');
  5043. }
  5044. args.push(pattern);
  5045. const output = yield this.execGit(args);
  5046. return !!output.stdout.trim();
  5047. });
  5048. }
  5049. branchList(remote) {
  5050. return __awaiter(this, void 0, void 0, function* () {
  5051. const result = [];
  5052. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5053. // "branch --list" is more difficult when in a detached HEAD state.
  5054. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5055. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5056. const args = ['rev-parse', '--symbolic-full-name'];
  5057. if (remote) {
  5058. args.push('--remotes=origin');
  5059. }
  5060. else {
  5061. args.push('--branches');
  5062. }
  5063. const output = yield this.execGit(args);
  5064. for (let branch of output.stdout.trim().split('\n')) {
  5065. branch = branch.trim();
  5066. if (branch) {
  5067. if (branch.startsWith('refs/heads/')) {
  5068. branch = branch.substr('refs/heads/'.length);
  5069. }
  5070. else if (branch.startsWith('refs/remotes/')) {
  5071. branch = branch.substr('refs/remotes/'.length);
  5072. }
  5073. result.push(branch);
  5074. }
  5075. }
  5076. return result;
  5077. });
  5078. }
  5079. checkout(ref, startPoint) {
  5080. return __awaiter(this, void 0, void 0, function* () {
  5081. const args = ['checkout', '--progress', '--force'];
  5082. if (startPoint) {
  5083. args.push('-B', ref, startPoint);
  5084. }
  5085. else {
  5086. args.push(ref);
  5087. }
  5088. yield this.execGit(args);
  5089. });
  5090. }
  5091. checkoutDetach() {
  5092. return __awaiter(this, void 0, void 0, function* () {
  5093. const args = ['checkout', '--detach'];
  5094. yield this.execGit(args);
  5095. });
  5096. }
  5097. config(configKey, configValue, globalConfig) {
  5098. return __awaiter(this, void 0, void 0, function* () {
  5099. yield this.execGit([
  5100. 'config',
  5101. globalConfig ? '--global' : '--local',
  5102. configKey,
  5103. configValue
  5104. ]);
  5105. });
  5106. }
  5107. configExists(configKey, globalConfig) {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. const pattern = regexpHelper.escape(configKey);
  5110. const output = yield this.execGit([
  5111. 'config',
  5112. globalConfig ? '--global' : '--local',
  5113. '--name-only',
  5114. '--get-regexp',
  5115. pattern
  5116. ], true);
  5117. return output.exitCode === 0;
  5118. });
  5119. }
  5120. fetch(refSpec, fetchDepth) {
  5121. return __awaiter(this, void 0, void 0, function* () {
  5122. const args = ['-c', 'protocol.version=2', 'fetch'];
  5123. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5124. args.push('--no-tags');
  5125. }
  5126. args.push('--prune', '--progress', '--no-recurse-submodules');
  5127. if (fetchDepth && fetchDepth > 0) {
  5128. args.push(`--depth=${fetchDepth}`);
  5129. }
  5130. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5131. args.push('--unshallow');
  5132. }
  5133. args.push('origin');
  5134. for (const arg of refSpec) {
  5135. args.push(arg);
  5136. }
  5137. const that = this;
  5138. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5139. yield that.execGit(args);
  5140. }));
  5141. });
  5142. }
  5143. getWorkingDirectory() {
  5144. return this.workingDirectory;
  5145. }
  5146. init() {
  5147. return __awaiter(this, void 0, void 0, function* () {
  5148. yield this.execGit(['init', this.workingDirectory]);
  5149. });
  5150. }
  5151. isDetached() {
  5152. return __awaiter(this, void 0, void 0, function* () {
  5153. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5154. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5155. return !output.stdout.trim().startsWith('refs/heads/');
  5156. });
  5157. }
  5158. lfsFetch(ref) {
  5159. return __awaiter(this, void 0, void 0, function* () {
  5160. const args = ['lfs', 'fetch', 'origin', ref];
  5161. const that = this;
  5162. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5163. yield that.execGit(args);
  5164. }));
  5165. });
  5166. }
  5167. lfsInstall() {
  5168. return __awaiter(this, void 0, void 0, function* () {
  5169. yield this.execGit(['lfs', 'install', '--local']);
  5170. });
  5171. }
  5172. log1() {
  5173. return __awaiter(this, void 0, void 0, function* () {
  5174. const output = yield this.execGit(['log', '-1']);
  5175. return output.stdout;
  5176. });
  5177. }
  5178. remoteAdd(remoteName, remoteUrl) {
  5179. return __awaiter(this, void 0, void 0, function* () {
  5180. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5181. });
  5182. }
  5183. removeEnvironmentVariable(name) {
  5184. delete this.gitEnv[name];
  5185. }
  5186. /**
  5187. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5188. * For an annotated tag, the tag SHA is returned.
  5189. * @param {string} ref For example: 'refs/heads/master' or '/refs/tags/v1'
  5190. * @returns {Promise<string>}
  5191. */
  5192. revParse(ref) {
  5193. return __awaiter(this, void 0, void 0, function* () {
  5194. const output = yield this.execGit(['rev-parse', ref]);
  5195. return output.stdout.trim();
  5196. });
  5197. }
  5198. setEnvironmentVariable(name, value) {
  5199. this.gitEnv[name] = value;
  5200. }
  5201. shaExists(sha) {
  5202. return __awaiter(this, void 0, void 0, function* () {
  5203. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5204. const output = yield this.execGit(args, true);
  5205. return output.exitCode === 0;
  5206. });
  5207. }
  5208. submoduleForeach(command, recursive) {
  5209. return __awaiter(this, void 0, void 0, function* () {
  5210. const args = ['submodule', 'foreach'];
  5211. if (recursive) {
  5212. args.push('--recursive');
  5213. }
  5214. args.push(command);
  5215. const output = yield this.execGit(args);
  5216. return output.stdout;
  5217. });
  5218. }
  5219. submoduleSync(recursive) {
  5220. return __awaiter(this, void 0, void 0, function* () {
  5221. const args = ['submodule', 'sync'];
  5222. if (recursive) {
  5223. args.push('--recursive');
  5224. }
  5225. yield this.execGit(args);
  5226. });
  5227. }
  5228. submoduleUpdate(fetchDepth, recursive) {
  5229. return __awaiter(this, void 0, void 0, function* () {
  5230. const args = ['-c', 'protocol.version=2'];
  5231. args.push('submodule', 'update', '--init', '--force');
  5232. if (fetchDepth > 0) {
  5233. args.push(`--depth=${fetchDepth}`);
  5234. }
  5235. if (recursive) {
  5236. args.push('--recursive');
  5237. }
  5238. yield this.execGit(args);
  5239. });
  5240. }
  5241. tagExists(pattern) {
  5242. return __awaiter(this, void 0, void 0, function* () {
  5243. const output = yield this.execGit(['tag', '--list', pattern]);
  5244. return !!output.stdout.trim();
  5245. });
  5246. }
  5247. tryClean() {
  5248. return __awaiter(this, void 0, void 0, function* () {
  5249. const output = yield this.execGit(['clean', '-ffdx'], true);
  5250. return output.exitCode === 0;
  5251. });
  5252. }
  5253. tryConfigUnset(configKey, globalConfig) {
  5254. return __awaiter(this, void 0, void 0, function* () {
  5255. const output = yield this.execGit([
  5256. 'config',
  5257. globalConfig ? '--global' : '--local',
  5258. '--unset-all',
  5259. configKey
  5260. ], true);
  5261. return output.exitCode === 0;
  5262. });
  5263. }
  5264. tryDisableAutomaticGarbageCollection() {
  5265. return __awaiter(this, void 0, void 0, function* () {
  5266. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5267. return output.exitCode === 0;
  5268. });
  5269. }
  5270. tryGetFetchUrl() {
  5271. return __awaiter(this, void 0, void 0, function* () {
  5272. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5273. if (output.exitCode !== 0) {
  5274. return '';
  5275. }
  5276. const stdout = output.stdout.trim();
  5277. if (stdout.includes('\n')) {
  5278. return '';
  5279. }
  5280. return stdout;
  5281. });
  5282. }
  5283. tryReset() {
  5284. return __awaiter(this, void 0, void 0, function* () {
  5285. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5286. return output.exitCode === 0;
  5287. });
  5288. }
  5289. static createCommandManager(workingDirectory, lfs) {
  5290. return __awaiter(this, void 0, void 0, function* () {
  5291. const result = new GitCommandManager();
  5292. yield result.initializeCommandManager(workingDirectory, lfs);
  5293. return result;
  5294. });
  5295. }
  5296. execGit(args, allowAllExitCodes = false) {
  5297. return __awaiter(this, void 0, void 0, function* () {
  5298. fshelper.directoryExistsSync(this.workingDirectory, true);
  5299. const result = new GitOutput();
  5300. const env = {};
  5301. for (const key of Object.keys(process.env)) {
  5302. env[key] = process.env[key];
  5303. }
  5304. for (const key of Object.keys(this.gitEnv)) {
  5305. env[key] = this.gitEnv[key];
  5306. }
  5307. const stdout = [];
  5308. const options = {
  5309. cwd: this.workingDirectory,
  5310. env,
  5311. ignoreReturnCode: allowAllExitCodes,
  5312. listeners: {
  5313. stdout: (data) => {
  5314. stdout.push(data.toString());
  5315. }
  5316. }
  5317. };
  5318. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5319. result.stdout = stdout.join('');
  5320. return result;
  5321. });
  5322. }
  5323. initializeCommandManager(workingDirectory, lfs) {
  5324. return __awaiter(this, void 0, void 0, function* () {
  5325. this.workingDirectory = workingDirectory;
  5326. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5327. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5328. this.lfs = lfs;
  5329. if (!this.lfs) {
  5330. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5331. }
  5332. this.gitPath = yield io.which('git', true);
  5333. // Git version
  5334. core.debug('Getting git version');
  5335. let gitVersion = new git_version_1.GitVersion();
  5336. let gitOutput = yield this.execGit(['version']);
  5337. let stdout = gitOutput.stdout.trim();
  5338. if (!stdout.includes('\n')) {
  5339. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5340. if (match) {
  5341. gitVersion = new git_version_1.GitVersion(match[0]);
  5342. }
  5343. }
  5344. if (!gitVersion.isValid()) {
  5345. throw new Error('Unable to determine git version');
  5346. }
  5347. // Minimum git version
  5348. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5349. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5350. }
  5351. if (this.lfs) {
  5352. // Git-lfs version
  5353. core.debug('Getting git-lfs version');
  5354. let gitLfsVersion = new git_version_1.GitVersion();
  5355. const gitLfsPath = yield io.which('git-lfs', true);
  5356. gitOutput = yield this.execGit(['lfs', 'version']);
  5357. stdout = gitOutput.stdout.trim();
  5358. if (!stdout.includes('\n')) {
  5359. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5360. if (match) {
  5361. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5362. }
  5363. }
  5364. if (!gitLfsVersion.isValid()) {
  5365. throw new Error('Unable to determine git-lfs version');
  5366. }
  5367. // Minimum git-lfs version
  5368. // Note:
  5369. // - Auth header not supported before 2.1
  5370. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5371. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5372. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5373. }
  5374. }
  5375. // Set the user agent
  5376. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5377. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5378. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5379. });
  5380. }
  5381. }
  5382. class GitOutput {
  5383. constructor() {
  5384. this.stdout = '';
  5385. this.exitCode = 0;
  5386. }
  5387. }
  5388. /***/ }),
  5389. /***/ 293:
  5390. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5391. "use strict";
  5392. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5393. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5394. return new (P || (P = Promise))(function (resolve, reject) {
  5395. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5396. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5397. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5398. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5399. });
  5400. };
  5401. var __importStar = (this && this.__importStar) || function (mod) {
  5402. if (mod && mod.__esModule) return mod;
  5403. var result = {};
  5404. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5405. result["default"] = mod;
  5406. return result;
  5407. };
  5408. Object.defineProperty(exports, "__esModule", { value: true });
  5409. const core = __importStar(__webpack_require__(470));
  5410. const fsHelper = __importStar(__webpack_require__(618));
  5411. const gitAuthHelper = __importStar(__webpack_require__(287));
  5412. const gitCommandManager = __importStar(__webpack_require__(289));
  5413. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5414. const githubApiHelper = __importStar(__webpack_require__(464));
  5415. const io = __importStar(__webpack_require__(1));
  5416. const path = __importStar(__webpack_require__(622));
  5417. const refHelper = __importStar(__webpack_require__(227));
  5418. const stateHelper = __importStar(__webpack_require__(153));
  5419. const urlHelper = __importStar(__webpack_require__(81));
  5420. function getSource(settings) {
  5421. return __awaiter(this, void 0, void 0, function* () {
  5422. // Repository URL
  5423. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5424. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5425. // Determine the default branch
  5426. if (!settings.ref && !settings.commit) {
  5427. core.startGroup('Determining the default branch');
  5428. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5429. core.endGroup();
  5430. }
  5431. // Remove conflicting file path
  5432. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5433. yield io.rmRF(settings.repositoryPath);
  5434. }
  5435. // Create directory
  5436. let isExisting = true;
  5437. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5438. isExisting = false;
  5439. yield io.mkdirP(settings.repositoryPath);
  5440. }
  5441. // Git command manager
  5442. core.startGroup('Getting Git version info');
  5443. const git = yield getGitCommandManager(settings);
  5444. core.endGroup();
  5445. // Prepare existing directory, otherwise recreate
  5446. if (isExisting) {
  5447. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5448. }
  5449. if (!git) {
  5450. // Downloading using REST API
  5451. core.info(`The repository will be downloaded using the GitHub REST API`);
  5452. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5453. if (settings.submodules) {
  5454. throw new Error(`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5455. }
  5456. else if (settings.sshKey) {
  5457. throw new Error(`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5458. }
  5459. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5460. return;
  5461. }
  5462. // Save state for POST action
  5463. stateHelper.setRepositoryPath(settings.repositoryPath);
  5464. // Initialize the repository
  5465. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5466. core.startGroup('Initializing the repository');
  5467. yield git.init();
  5468. yield git.remoteAdd('origin', repositoryUrl);
  5469. core.endGroup();
  5470. }
  5471. // Disable automatic garbage collection
  5472. core.startGroup('Disabling automatic garbage collection');
  5473. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5474. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5475. }
  5476. core.endGroup();
  5477. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5478. try {
  5479. // Configure auth
  5480. core.startGroup('Setting up auth');
  5481. yield authHelper.configureAuth();
  5482. core.endGroup();
  5483. // LFS install
  5484. if (settings.lfs) {
  5485. yield git.lfsInstall();
  5486. }
  5487. // Fetch
  5488. core.startGroup('Fetching the repository');
  5489. if (settings.fetchDepth <= 0) {
  5490. // Fetch all branches and tags
  5491. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5492. yield git.fetch(refSpec);
  5493. // When all history is fetched, the ref we're interested in may have moved to a different
  5494. // commit (push or force push). If so, fetch again with a targeted refspec.
  5495. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5496. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5497. yield git.fetch(refSpec);
  5498. }
  5499. }
  5500. else {
  5501. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5502. yield git.fetch(refSpec, settings.fetchDepth);
  5503. }
  5504. core.endGroup();
  5505. // Checkout info
  5506. core.startGroup('Determining the checkout info');
  5507. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5508. core.endGroup();
  5509. // LFS fetch
  5510. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5511. // Explicit lfs fetch will fetch lfs objects in parallel.
  5512. if (settings.lfs) {
  5513. core.startGroup('Fetching LFS objects');
  5514. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5515. core.endGroup();
  5516. }
  5517. // Checkout
  5518. core.startGroup('Checking out the ref');
  5519. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5520. core.endGroup();
  5521. // Submodules
  5522. if (settings.submodules) {
  5523. try {
  5524. // Temporarily override global config
  5525. core.startGroup('Setting up auth for fetching submodules');
  5526. yield authHelper.configureGlobalAuth();
  5527. core.endGroup();
  5528. // Checkout submodules
  5529. core.startGroup('Fetching submodules');
  5530. yield git.submoduleSync(settings.nestedSubmodules);
  5531. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5532. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5533. core.endGroup();
  5534. // Persist credentials
  5535. if (settings.persistCredentials) {
  5536. core.startGroup('Persisting credentials for submodules');
  5537. yield authHelper.configureSubmoduleAuth();
  5538. core.endGroup();
  5539. }
  5540. }
  5541. finally {
  5542. // Remove temporary global config override
  5543. yield authHelper.removeGlobalAuth();
  5544. }
  5545. }
  5546. // Dump some info about the checked out commit
  5547. const commitInfo = yield git.log1();
  5548. // Check for incorrect pull request merge commit
  5549. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5550. }
  5551. finally {
  5552. // Remove auth
  5553. if (!settings.persistCredentials) {
  5554. core.startGroup('Removing auth');
  5555. yield authHelper.removeAuth();
  5556. core.endGroup();
  5557. }
  5558. }
  5559. });
  5560. }
  5561. exports.getSource = getSource;
  5562. function cleanup(repositoryPath) {
  5563. return __awaiter(this, void 0, void 0, function* () {
  5564. // Repo exists?
  5565. if (!repositoryPath ||
  5566. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5567. return;
  5568. }
  5569. let git;
  5570. try {
  5571. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5572. }
  5573. catch (_a) {
  5574. return;
  5575. }
  5576. // Remove auth
  5577. const authHelper = gitAuthHelper.createAuthHelper(git);
  5578. yield authHelper.removeAuth();
  5579. });
  5580. }
  5581. exports.cleanup = cleanup;
  5582. function getGitCommandManager(settings) {
  5583. return __awaiter(this, void 0, void 0, function* () {
  5584. core.info(`Working directory is '${settings.repositoryPath}'`);
  5585. try {
  5586. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5587. }
  5588. catch (err) {
  5589. // Git is required for LFS
  5590. if (settings.lfs) {
  5591. throw err;
  5592. }
  5593. // Otherwise fallback to REST API
  5594. return undefined;
  5595. }
  5596. });
  5597. }
  5598. /***/ }),
  5599. /***/ 294:
  5600. /***/ (function(module, __unusedexports, __webpack_require__) {
  5601. module.exports = parseOptions;
  5602. const { Deprecation } = __webpack_require__(692);
  5603. const { getUserAgent } = __webpack_require__(796);
  5604. const once = __webpack_require__(969);
  5605. const pkg = __webpack_require__(215);
  5606. const deprecateOptionsTimeout = once((log, deprecation) =>
  5607. log.warn(deprecation)
  5608. );
  5609. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5610. const deprecateOptionsHeaders = once((log, deprecation) =>
  5611. log.warn(deprecation)
  5612. );
  5613. function parseOptions(options, log, hook) {
  5614. if (options.headers) {
  5615. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5616. newObj[key.toLowerCase()] = options.headers[key];
  5617. return newObj;
  5618. }, {});
  5619. }
  5620. const clientDefaults = {
  5621. headers: options.headers || {},
  5622. request: options.request || {},
  5623. mediaType: {
  5624. previews: [],
  5625. format: ""
  5626. }
  5627. };
  5628. if (options.baseUrl) {
  5629. clientDefaults.baseUrl = options.baseUrl;
  5630. }
  5631. if (options.userAgent) {
  5632. clientDefaults.headers["user-agent"] = options.userAgent;
  5633. }
  5634. if (options.previews) {
  5635. clientDefaults.mediaType.previews = options.previews;
  5636. }
  5637. if (options.timeZone) {
  5638. clientDefaults.headers["time-zone"] = options.timeZone;
  5639. }
  5640. if (options.timeout) {
  5641. deprecateOptionsTimeout(
  5642. log,
  5643. new Deprecation(
  5644. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5645. )
  5646. );
  5647. clientDefaults.request.timeout = options.timeout;
  5648. }
  5649. if (options.agent) {
  5650. deprecateOptionsAgent(
  5651. log,
  5652. new Deprecation(
  5653. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5654. )
  5655. );
  5656. clientDefaults.request.agent = options.agent;
  5657. }
  5658. if (options.headers) {
  5659. deprecateOptionsHeaders(
  5660. log,
  5661. new Deprecation(
  5662. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5663. )
  5664. );
  5665. }
  5666. const userAgentOption = clientDefaults.headers["user-agent"];
  5667. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5668. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5669. .filter(Boolean)
  5670. .join(" ");
  5671. clientDefaults.request.hook = hook.bind(null, "request");
  5672. return clientDefaults;
  5673. }
  5674. /***/ }),
  5675. /***/ 297:
  5676. /***/ (function(module) {
  5677. module.exports = class HttpError extends Error {
  5678. constructor (message, code, headers) {
  5679. super(message)
  5680. // Maintains proper stack trace (only available on V8)
  5681. /* istanbul ignore next */
  5682. if (Error.captureStackTrace) {
  5683. Error.captureStackTrace(this, this.constructor)
  5684. }
  5685. this.name = 'HttpError'
  5686. this.code = code
  5687. this.headers = headers
  5688. }
  5689. }
  5690. /***/ }),
  5691. /***/ 299:
  5692. /***/ (function(__unusedmodule, exports) {
  5693. "use strict";
  5694. Object.defineProperty(exports, '__esModule', { value: true });
  5695. const VERSION = "1.1.2";
  5696. /**
  5697. * Some “list” response that can be paginated have a different response structure
  5698. *
  5699. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5700. * /installation/repositories also has `repository_selection`), as well as a key with
  5701. * the list of the items which name varies from endpoint to endpoint:
  5702. *
  5703. * - https://developer.github.com/v3/search/#example (key `items`)
  5704. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5705. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5706. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5707. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5708. *
  5709. * Octokit normalizes these responses so that paginated results are always returned following
  5710. * the same structure. One challenge is that if the list response has only one page, no Link
  5711. * header is provided, so this header alone is not sufficient to check wether a response is
  5712. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5713. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5714. * property because it also exists in the response of Get the combined status for a specific ref.
  5715. */
  5716. const REGEX = [/^\/search\//, /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)([^/]|$)/, /^\/installation\/repositories([^/]|$)/, /^\/user\/installations([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/secrets([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/workflows(\/[^/]+\/runs)?([^/]|$)/, /^\/repos\/[^/]+\/[^/]+\/actions\/runs(\/[^/]+\/(artifacts|jobs))?([^/]|$)/];
  5717. function normalizePaginatedListResponse(octokit, url, response) {
  5718. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5719. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5720. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5721. // to retrieve the same information.
  5722. const incompleteResults = response.data.incomplete_results;
  5723. const repositorySelection = response.data.repository_selection;
  5724. const totalCount = response.data.total_count;
  5725. delete response.data.incomplete_results;
  5726. delete response.data.repository_selection;
  5727. delete response.data.total_count;
  5728. const namespaceKey = Object.keys(response.data)[0];
  5729. const data = response.data[namespaceKey];
  5730. response.data = data;
  5731. if (typeof incompleteResults !== "undefined") {
  5732. response.data.incomplete_results = incompleteResults;
  5733. }
  5734. if (typeof repositorySelection !== "undefined") {
  5735. response.data.repository_selection = repositorySelection;
  5736. }
  5737. response.data.total_count = totalCount;
  5738. Object.defineProperty(response.data, namespaceKey, {
  5739. get() {
  5740. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5741. return Array.from(data);
  5742. }
  5743. });
  5744. }
  5745. function iterator(octokit, route, parameters) {
  5746. const options = octokit.request.endpoint(route, parameters);
  5747. const method = options.method;
  5748. const headers = options.headers;
  5749. let url = options.url;
  5750. return {
  5751. [Symbol.asyncIterator]: () => ({
  5752. next() {
  5753. if (!url) {
  5754. return Promise.resolve({
  5755. done: true
  5756. });
  5757. }
  5758. return octokit.request({
  5759. method,
  5760. url,
  5761. headers
  5762. }).then(response => {
  5763. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5764. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5765. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5766. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5767. return {
  5768. value: response
  5769. };
  5770. });
  5771. }
  5772. })
  5773. };
  5774. }
  5775. function paginate(octokit, route, parameters, mapFn) {
  5776. if (typeof parameters === "function") {
  5777. mapFn = parameters;
  5778. parameters = undefined;
  5779. }
  5780. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5781. }
  5782. function gather(octokit, results, iterator, mapFn) {
  5783. return iterator.next().then(result => {
  5784. if (result.done) {
  5785. return results;
  5786. }
  5787. let earlyExit = false;
  5788. function done() {
  5789. earlyExit = true;
  5790. }
  5791. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5792. if (earlyExit) {
  5793. return results;
  5794. }
  5795. return gather(octokit, results, iterator, mapFn);
  5796. });
  5797. }
  5798. /**
  5799. * @param octokit Octokit instance
  5800. * @param options Options passed to Octokit constructor
  5801. */
  5802. function paginateRest(octokit) {
  5803. return {
  5804. paginate: Object.assign(paginate.bind(null, octokit), {
  5805. iterator: iterator.bind(null, octokit)
  5806. })
  5807. };
  5808. }
  5809. paginateRest.VERSION = VERSION;
  5810. exports.paginateRest = paginateRest;
  5811. //# sourceMappingURL=index.js.map
  5812. /***/ }),
  5813. /***/ 323:
  5814. /***/ (function(module) {
  5815. "use strict";
  5816. var isStream = module.exports = function (stream) {
  5817. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5818. };
  5819. isStream.writable = function (stream) {
  5820. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5821. };
  5822. isStream.readable = function (stream) {
  5823. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5824. };
  5825. isStream.duplex = function (stream) {
  5826. return isStream.writable(stream) && isStream.readable(stream);
  5827. };
  5828. isStream.transform = function (stream) {
  5829. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5830. };
  5831. /***/ }),
  5832. /***/ 335:
  5833. /***/ (function(module, __unusedexports, __webpack_require__) {
  5834. module.exports = __webpack_require__(179);
  5835. /***/ }),
  5836. /***/ 336:
  5837. /***/ (function(module, __unusedexports, __webpack_require__) {
  5838. module.exports = hasLastPage
  5839. const deprecate = __webpack_require__(370)
  5840. const getPageLinks = __webpack_require__(577)
  5841. function hasLastPage (link) {
  5842. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5843. return getPageLinks(link).last
  5844. }
  5845. /***/ }),
  5846. /***/ 348:
  5847. /***/ (function(module, __unusedexports, __webpack_require__) {
  5848. "use strict";
  5849. module.exports = validate;
  5850. const { RequestError } = __webpack_require__(497);
  5851. const get = __webpack_require__(854);
  5852. const set = __webpack_require__(883);
  5853. function validate(octokit, options) {
  5854. if (!options.request.validate) {
  5855. return;
  5856. }
  5857. const { validate: params } = options.request;
  5858. Object.keys(params).forEach(parameterName => {
  5859. const parameter = get(params, parameterName);
  5860. const expectedType = parameter.type;
  5861. let parentParameterName;
  5862. let parentValue;
  5863. let parentParamIsPresent = true;
  5864. let parentParameterIsArray = false;
  5865. if (/\./.test(parameterName)) {
  5866. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5867. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5868. if (parentParameterIsArray) {
  5869. parentParameterName = parentParameterName.slice(0, -2);
  5870. }
  5871. parentValue = get(options, parentParameterName);
  5872. parentParamIsPresent =
  5873. parentParameterName === "headers" ||
  5874. (typeof parentValue === "object" && parentValue !== null);
  5875. }
  5876. const values = parentParameterIsArray
  5877. ? (get(options, parentParameterName) || []).map(
  5878. value => value[parameterName.split(/\./).pop()]
  5879. )
  5880. : [get(options, parameterName)];
  5881. values.forEach((value, i) => {
  5882. const valueIsPresent = typeof value !== "undefined";
  5883. const valueIsNull = value === null;
  5884. const currentParameterName = parentParameterIsArray
  5885. ? parameterName.replace(/\[\]/, `[${i}]`)
  5886. : parameterName;
  5887. if (!parameter.required && !valueIsPresent) {
  5888. return;
  5889. }
  5890. // if the parent parameter is of type object but allows null
  5891. // then the child parameters can be ignored
  5892. if (!parentParamIsPresent) {
  5893. return;
  5894. }
  5895. if (parameter.allowNull && valueIsNull) {
  5896. return;
  5897. }
  5898. if (!parameter.allowNull && valueIsNull) {
  5899. throw new RequestError(
  5900. `'${currentParameterName}' cannot be null`,
  5901. 400,
  5902. {
  5903. request: options
  5904. }
  5905. );
  5906. }
  5907. if (parameter.required && !valueIsPresent) {
  5908. throw new RequestError(
  5909. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5910. value
  5911. )}`,
  5912. 400,
  5913. {
  5914. request: options
  5915. }
  5916. );
  5917. }
  5918. // parse to integer before checking for enum
  5919. // so that string "1" will match enum with number 1
  5920. if (expectedType === "integer") {
  5921. const unparsedValue = value;
  5922. value = parseInt(value, 10);
  5923. if (isNaN(value)) {
  5924. throw new RequestError(
  5925. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5926. unparsedValue
  5927. )} is NaN`,
  5928. 400,
  5929. {
  5930. request: options
  5931. }
  5932. );
  5933. }
  5934. }
  5935. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5936. throw new RequestError(
  5937. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5938. value
  5939. )}`,
  5940. 400,
  5941. {
  5942. request: options
  5943. }
  5944. );
  5945. }
  5946. if (parameter.validation) {
  5947. const regex = new RegExp(parameter.validation);
  5948. if (!regex.test(value)) {
  5949. throw new RequestError(
  5950. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5951. value
  5952. )}`,
  5953. 400,
  5954. {
  5955. request: options
  5956. }
  5957. );
  5958. }
  5959. }
  5960. if (expectedType === "object" && typeof value === "string") {
  5961. try {
  5962. value = JSON.parse(value);
  5963. } catch (exception) {
  5964. throw new RequestError(
  5965. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5966. value
  5967. )}`,
  5968. 400,
  5969. {
  5970. request: options
  5971. }
  5972. );
  5973. }
  5974. }
  5975. set(options, parameter.mapTo || currentParameterName, value);
  5976. });
  5977. });
  5978. return options;
  5979. }
  5980. /***/ }),
  5981. /***/ 349:
  5982. /***/ (function(module, __unusedexports, __webpack_require__) {
  5983. module.exports = authenticationRequestError;
  5984. const { RequestError } = __webpack_require__(497);
  5985. function authenticationRequestError(state, error, options) {
  5986. /* istanbul ignore next */
  5987. if (!error.headers) throw error;
  5988. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5989. // handle "2FA required" error only
  5990. if (error.status !== 401 || !otpRequired) {
  5991. throw error;
  5992. }
  5993. if (
  5994. error.status === 401 &&
  5995. otpRequired &&
  5996. error.request &&
  5997. error.request.headers["x-github-otp"]
  5998. ) {
  5999. throw new RequestError(
  6000. "Invalid one-time password for two-factor authentication",
  6001. 401,
  6002. {
  6003. headers: error.headers,
  6004. request: options
  6005. }
  6006. );
  6007. }
  6008. if (typeof state.auth.on2fa !== "function") {
  6009. throw new RequestError(
  6010. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6011. 401,
  6012. {
  6013. headers: error.headers,
  6014. request: options
  6015. }
  6016. );
  6017. }
  6018. return Promise.resolve()
  6019. .then(() => {
  6020. return state.auth.on2fa();
  6021. })
  6022. .then(oneTimePassword => {
  6023. const newOptions = Object.assign(options, {
  6024. headers: Object.assign(
  6025. { "x-github-otp": oneTimePassword },
  6026. options.headers
  6027. )
  6028. });
  6029. return state.octokit.request(newOptions);
  6030. });
  6031. }
  6032. /***/ }),
  6033. /***/ 357:
  6034. /***/ (function(module) {
  6035. module.exports = require("assert");
  6036. /***/ }),
  6037. /***/ 363:
  6038. /***/ (function(module) {
  6039. module.exports = register
  6040. function register (state, name, method, options) {
  6041. if (typeof method !== 'function') {
  6042. throw new Error('method for before hook must be a function')
  6043. }
  6044. if (!options) {
  6045. options = {}
  6046. }
  6047. if (Array.isArray(name)) {
  6048. return name.reverse().reduce(function (callback, name) {
  6049. return register.bind(null, state, name, callback, options)
  6050. }, method)()
  6051. }
  6052. return Promise.resolve()
  6053. .then(function () {
  6054. if (!state.registry[name]) {
  6055. return method(options)
  6056. }
  6057. return (state.registry[name]).reduce(function (method, registered) {
  6058. return registered.hook.bind(null, method, options)
  6059. }, method)()
  6060. })
  6061. }
  6062. /***/ }),
  6063. /***/ 368:
  6064. /***/ (function(module) {
  6065. module.exports = function atob(str) {
  6066. return Buffer.from(str, 'base64').toString('binary')
  6067. }
  6068. /***/ }),
  6069. /***/ 370:
  6070. /***/ (function(module) {
  6071. module.exports = deprecate
  6072. const loggedMessages = {}
  6073. function deprecate (message) {
  6074. if (loggedMessages[message]) {
  6075. return
  6076. }
  6077. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6078. loggedMessages[message] = 1
  6079. }
  6080. /***/ }),
  6081. /***/ 385:
  6082. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6083. "use strict";
  6084. Object.defineProperty(exports, '__esModule', { value: true });
  6085. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6086. var isPlainObject = _interopDefault(__webpack_require__(696));
  6087. var universalUserAgent = __webpack_require__(562);
  6088. function lowercaseKeys(object) {
  6089. if (!object) {
  6090. return {};
  6091. }
  6092. return Object.keys(object).reduce((newObj, key) => {
  6093. newObj[key.toLowerCase()] = object[key];
  6094. return newObj;
  6095. }, {});
  6096. }
  6097. function mergeDeep(defaults, options) {
  6098. const result = Object.assign({}, defaults);
  6099. Object.keys(options).forEach(key => {
  6100. if (isPlainObject(options[key])) {
  6101. if (!(key in defaults)) Object.assign(result, {
  6102. [key]: options[key]
  6103. });else result[key] = mergeDeep(defaults[key], options[key]);
  6104. } else {
  6105. Object.assign(result, {
  6106. [key]: options[key]
  6107. });
  6108. }
  6109. });
  6110. return result;
  6111. }
  6112. function merge(defaults, route, options) {
  6113. if (typeof route === "string") {
  6114. let [method, url] = route.split(" ");
  6115. options = Object.assign(url ? {
  6116. method,
  6117. url
  6118. } : {
  6119. url: method
  6120. }, options);
  6121. } else {
  6122. options = Object.assign({}, route);
  6123. } // lowercase header names before merging with defaults to avoid duplicates
  6124. options.headers = lowercaseKeys(options.headers);
  6125. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6126. if (defaults && defaults.mediaType.previews.length) {
  6127. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6128. }
  6129. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6130. return mergedOptions;
  6131. }
  6132. function addQueryParameters(url, parameters) {
  6133. const separator = /\?/.test(url) ? "&" : "?";
  6134. const names = Object.keys(parameters);
  6135. if (names.length === 0) {
  6136. return url;
  6137. }
  6138. return url + separator + names.map(name => {
  6139. if (name === "q") {
  6140. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6141. }
  6142. return `${name}=${encodeURIComponent(parameters[name])}`;
  6143. }).join("&");
  6144. }
  6145. const urlVariableRegex = /\{[^}]+\}/g;
  6146. function removeNonChars(variableName) {
  6147. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6148. }
  6149. function extractUrlVariableNames(url) {
  6150. const matches = url.match(urlVariableRegex);
  6151. if (!matches) {
  6152. return [];
  6153. }
  6154. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6155. }
  6156. function omit(object, keysToOmit) {
  6157. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6158. obj[key] = object[key];
  6159. return obj;
  6160. }, {});
  6161. }
  6162. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6163. // TODO: create separate package.
  6164. //
  6165. // Copyright (c) 2012-2014, Bram Stein
  6166. // All rights reserved.
  6167. // Redistribution and use in source and binary forms, with or without
  6168. // modification, are permitted provided that the following conditions
  6169. // are met:
  6170. // 1. Redistributions of source code must retain the above copyright
  6171. // notice, this list of conditions and the following disclaimer.
  6172. // 2. Redistributions in binary form must reproduce the above copyright
  6173. // notice, this list of conditions and the following disclaimer in the
  6174. // documentation and/or other materials provided with the distribution.
  6175. // 3. The name of the author may not be used to endorse or promote products
  6176. // derived from this software without specific prior written permission.
  6177. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6178. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6179. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6180. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6181. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6182. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6183. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6184. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6185. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6186. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6187. /* istanbul ignore file */
  6188. function encodeReserved(str) {
  6189. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6190. if (!/%[0-9A-Fa-f]/.test(part)) {
  6191. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6192. }
  6193. return part;
  6194. }).join("");
  6195. }
  6196. function encodeUnreserved(str) {
  6197. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6198. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6199. });
  6200. }
  6201. function encodeValue(operator, value, key) {
  6202. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6203. if (key) {
  6204. return encodeUnreserved(key) + "=" + value;
  6205. } else {
  6206. return value;
  6207. }
  6208. }
  6209. function isDefined(value) {
  6210. return value !== undefined && value !== null;
  6211. }
  6212. function isKeyOperator(operator) {
  6213. return operator === ";" || operator === "&" || operator === "?";
  6214. }
  6215. function getValues(context, operator, key, modifier) {
  6216. var value = context[key],
  6217. result = [];
  6218. if (isDefined(value) && value !== "") {
  6219. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6220. value = value.toString();
  6221. if (modifier && modifier !== "*") {
  6222. value = value.substring(0, parseInt(modifier, 10));
  6223. }
  6224. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6225. } else {
  6226. if (modifier === "*") {
  6227. if (Array.isArray(value)) {
  6228. value.filter(isDefined).forEach(function (value) {
  6229. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6230. });
  6231. } else {
  6232. Object.keys(value).forEach(function (k) {
  6233. if (isDefined(value[k])) {
  6234. result.push(encodeValue(operator, value[k], k));
  6235. }
  6236. });
  6237. }
  6238. } else {
  6239. const tmp = [];
  6240. if (Array.isArray(value)) {
  6241. value.filter(isDefined).forEach(function (value) {
  6242. tmp.push(encodeValue(operator, value));
  6243. });
  6244. } else {
  6245. Object.keys(value).forEach(function (k) {
  6246. if (isDefined(value[k])) {
  6247. tmp.push(encodeUnreserved(k));
  6248. tmp.push(encodeValue(operator, value[k].toString()));
  6249. }
  6250. });
  6251. }
  6252. if (isKeyOperator(operator)) {
  6253. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6254. } else if (tmp.length !== 0) {
  6255. result.push(tmp.join(","));
  6256. }
  6257. }
  6258. }
  6259. } else {
  6260. if (operator === ";") {
  6261. if (isDefined(value)) {
  6262. result.push(encodeUnreserved(key));
  6263. }
  6264. } else if (value === "" && (operator === "&" || operator === "?")) {
  6265. result.push(encodeUnreserved(key) + "=");
  6266. } else if (value === "") {
  6267. result.push("");
  6268. }
  6269. }
  6270. return result;
  6271. }
  6272. function parseUrl(template) {
  6273. return {
  6274. expand: expand.bind(null, template)
  6275. };
  6276. }
  6277. function expand(template, context) {
  6278. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6279. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6280. if (expression) {
  6281. let operator = "";
  6282. const values = [];
  6283. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6284. operator = expression.charAt(0);
  6285. expression = expression.substr(1);
  6286. }
  6287. expression.split(/,/g).forEach(function (variable) {
  6288. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6289. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6290. });
  6291. if (operator && operator !== "+") {
  6292. var separator = ",";
  6293. if (operator === "?") {
  6294. separator = "&";
  6295. } else if (operator !== "#") {
  6296. separator = operator;
  6297. }
  6298. return (values.length !== 0 ? operator : "") + values.join(separator);
  6299. } else {
  6300. return values.join(",");
  6301. }
  6302. } else {
  6303. return encodeReserved(literal);
  6304. }
  6305. });
  6306. }
  6307. function parse(options) {
  6308. // https://fetch.spec.whatwg.org/#methods
  6309. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6310. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6311. let headers = Object.assign({}, options.headers);
  6312. let body;
  6313. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6314. const urlVariableNames = extractUrlVariableNames(url);
  6315. url = parseUrl(url).expand(parameters);
  6316. if (!/^http/.test(url)) {
  6317. url = options.baseUrl + url;
  6318. }
  6319. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6320. const remainingParameters = omit(parameters, omittedParameters);
  6321. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6322. if (!isBinaryRequset) {
  6323. if (options.mediaType.format) {
  6324. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6325. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6326. }
  6327. if (options.mediaType.previews.length) {
  6328. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6329. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6330. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6331. return `application/vnd.github.${preview}-preview${format}`;
  6332. }).join(",");
  6333. }
  6334. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6335. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6336. if (["GET", "HEAD"].includes(method)) {
  6337. url = addQueryParameters(url, remainingParameters);
  6338. } else {
  6339. if ("data" in remainingParameters) {
  6340. body = remainingParameters.data;
  6341. } else {
  6342. if (Object.keys(remainingParameters).length) {
  6343. body = remainingParameters;
  6344. } else {
  6345. headers["content-length"] = 0;
  6346. }
  6347. }
  6348. } // default content-type for JSON if body is set
  6349. if (!headers["content-type"] && typeof body !== "undefined") {
  6350. headers["content-type"] = "application/json; charset=utf-8";
  6351. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6352. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6353. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6354. body = "";
  6355. } // Only return body/request keys if present
  6356. return Object.assign({
  6357. method,
  6358. url,
  6359. headers
  6360. }, typeof body !== "undefined" ? {
  6361. body
  6362. } : null, options.request ? {
  6363. request: options.request
  6364. } : null);
  6365. }
  6366. function endpointWithDefaults(defaults, route, options) {
  6367. return parse(merge(defaults, route, options));
  6368. }
  6369. function withDefaults(oldDefaults, newDefaults) {
  6370. const DEFAULTS = merge(oldDefaults, newDefaults);
  6371. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6372. return Object.assign(endpoint, {
  6373. DEFAULTS,
  6374. defaults: withDefaults.bind(null, DEFAULTS),
  6375. merge: merge.bind(null, DEFAULTS),
  6376. parse
  6377. });
  6378. }
  6379. const VERSION = "6.0.1";
  6380. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6381. // So we use RequestParameters and add method as additional required property.
  6382. const DEFAULTS = {
  6383. method: "GET",
  6384. baseUrl: "https://api.github.com",
  6385. headers: {
  6386. accept: "application/vnd.github.v3+json",
  6387. "user-agent": userAgent
  6388. },
  6389. mediaType: {
  6390. format: "",
  6391. previews: []
  6392. }
  6393. };
  6394. const endpoint = withDefaults(null, DEFAULTS);
  6395. exports.endpoint = endpoint;
  6396. //# sourceMappingURL=index.js.map
  6397. /***/ }),
  6398. /***/ 389:
  6399. /***/ (function(module, __unusedexports, __webpack_require__) {
  6400. "use strict";
  6401. const fs = __webpack_require__(747);
  6402. const shebangCommand = __webpack_require__(866);
  6403. function readShebang(command) {
  6404. // Read the first 150 bytes from the file
  6405. const size = 150;
  6406. let buffer;
  6407. if (Buffer.alloc) {
  6408. // Node.js v4.5+ / v5.10+
  6409. buffer = Buffer.alloc(size);
  6410. } else {
  6411. // Old Node.js API
  6412. buffer = new Buffer(size);
  6413. buffer.fill(0); // zero-fill
  6414. }
  6415. let fd;
  6416. try {
  6417. fd = fs.openSync(command, 'r');
  6418. fs.readSync(fd, buffer, 0, size, 0);
  6419. fs.closeSync(fd);
  6420. } catch (e) { /* Empty */ }
  6421. // Attempt to extract shebang (null is returned if not a shebang)
  6422. return shebangCommand(buffer.toString());
  6423. }
  6424. module.exports = readShebang;
  6425. /***/ }),
  6426. /***/ 402:
  6427. /***/ (function(module, __unusedexports, __webpack_require__) {
  6428. module.exports = Octokit;
  6429. const { request } = __webpack_require__(753);
  6430. const Hook = __webpack_require__(523);
  6431. const parseClientOptions = __webpack_require__(294);
  6432. function Octokit(plugins, options) {
  6433. options = options || {};
  6434. const hook = new Hook.Collection();
  6435. const log = Object.assign(
  6436. {
  6437. debug: () => {},
  6438. info: () => {},
  6439. warn: console.warn,
  6440. error: console.error
  6441. },
  6442. options && options.log
  6443. );
  6444. const api = {
  6445. hook,
  6446. log,
  6447. request: request.defaults(parseClientOptions(options, log, hook))
  6448. };
  6449. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6450. return api;
  6451. }
  6452. /***/ }),
  6453. /***/ 413:
  6454. /***/ (function(module) {
  6455. module.exports = require("stream");
  6456. /***/ }),
  6457. /***/ 417:
  6458. /***/ (function(module) {
  6459. module.exports = require("crypto");
  6460. /***/ }),
  6461. /***/ 427:
  6462. /***/ (function(module, __unusedexports, __webpack_require__) {
  6463. "use strict";
  6464. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6465. // In that case, fall back to a deprecated internal.
  6466. const util = __webpack_require__(669);
  6467. let uv;
  6468. if (typeof util.getSystemErrorName === 'function') {
  6469. module.exports = util.getSystemErrorName;
  6470. } else {
  6471. try {
  6472. uv = process.binding('uv');
  6473. if (typeof uv.errname !== 'function') {
  6474. throw new TypeError('uv.errname is not a function');
  6475. }
  6476. } catch (err) {
  6477. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6478. uv = null;
  6479. }
  6480. module.exports = code => errname(uv, code);
  6481. }
  6482. // Used for testing the fallback behavior
  6483. module.exports.__test__ = errname;
  6484. function errname(uv, code) {
  6485. if (uv) {
  6486. return uv.errname(code);
  6487. }
  6488. if (!(code < 0)) {
  6489. throw new Error('err >= 0');
  6490. }
  6491. return `Unknown system error ${code}`;
  6492. }
  6493. /***/ }),
  6494. /***/ 430:
  6495. /***/ (function(module, __unusedexports, __webpack_require__) {
  6496. module.exports = octokitValidate;
  6497. const validate = __webpack_require__(348);
  6498. function octokitValidate(octokit) {
  6499. octokit.hook.before("request", validate.bind(null, octokit));
  6500. }
  6501. /***/ }),
  6502. /***/ 431:
  6503. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6504. "use strict";
  6505. Object.defineProperty(exports, "__esModule", { value: true });
  6506. const os = __webpack_require__(87);
  6507. /**
  6508. * Commands
  6509. *
  6510. * Command Format:
  6511. * ##[name key=value;key=value]message
  6512. *
  6513. * Examples:
  6514. * ##[warning]This is the user warning message
  6515. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6516. */
  6517. function issueCommand(command, properties, message) {
  6518. const cmd = new Command(command, properties, message);
  6519. process.stdout.write(cmd.toString() + os.EOL);
  6520. }
  6521. exports.issueCommand = issueCommand;
  6522. function issue(name, message = '') {
  6523. issueCommand(name, {}, message);
  6524. }
  6525. exports.issue = issue;
  6526. const CMD_STRING = '::';
  6527. class Command {
  6528. constructor(command, properties, message) {
  6529. if (!command) {
  6530. command = 'missing.command';
  6531. }
  6532. this.command = command;
  6533. this.properties = properties;
  6534. this.message = message;
  6535. }
  6536. toString() {
  6537. let cmdStr = CMD_STRING + this.command;
  6538. if (this.properties && Object.keys(this.properties).length > 0) {
  6539. cmdStr += ' ';
  6540. for (const key in this.properties) {
  6541. if (this.properties.hasOwnProperty(key)) {
  6542. const val = this.properties[key];
  6543. if (val) {
  6544. // safely append the val - avoid blowing up when attempting to
  6545. // call .replace() if message is not a string for some reason
  6546. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6547. }
  6548. }
  6549. }
  6550. }
  6551. cmdStr += CMD_STRING;
  6552. // safely append the message - avoid blowing up when attempting to
  6553. // call .replace() if message is not a string for some reason
  6554. const message = `${this.message || ''}`;
  6555. cmdStr += escapeData(message);
  6556. return cmdStr;
  6557. }
  6558. }
  6559. function escapeData(s) {
  6560. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6561. }
  6562. function escape(s) {
  6563. return s
  6564. .replace(/\r/g, '%0D')
  6565. .replace(/\n/g, '%0A')
  6566. .replace(/]/g, '%5D')
  6567. .replace(/;/g, '%3B');
  6568. }
  6569. //# sourceMappingURL=command.js.map
  6570. /***/ }),
  6571. /***/ 438:
  6572. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6573. "use strict";
  6574. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6575. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6576. return new (P || (P = Promise))(function (resolve, reject) {
  6577. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6578. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6579. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6580. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6581. });
  6582. };
  6583. var __importStar = (this && this.__importStar) || function (mod) {
  6584. if (mod && mod.__esModule) return mod;
  6585. var result = {};
  6586. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6587. result["default"] = mod;
  6588. return result;
  6589. };
  6590. Object.defineProperty(exports, "__esModule", { value: true });
  6591. const assert = __importStar(__webpack_require__(357));
  6592. const core = __importStar(__webpack_require__(470));
  6593. const fs = __importStar(__webpack_require__(747));
  6594. const fsHelper = __importStar(__webpack_require__(618));
  6595. const io = __importStar(__webpack_require__(1));
  6596. const path = __importStar(__webpack_require__(622));
  6597. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6598. return __awaiter(this, void 0, void 0, function* () {
  6599. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6600. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6601. // Indicates whether to delete the directory contents
  6602. let remove = false;
  6603. // Check whether using git or REST API
  6604. if (!git) {
  6605. remove = true;
  6606. }
  6607. // Fetch URL does not match
  6608. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6609. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6610. remove = true;
  6611. }
  6612. else {
  6613. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6614. const lockPaths = [
  6615. path.join(repositoryPath, '.git', 'index.lock'),
  6616. path.join(repositoryPath, '.git', 'shallow.lock')
  6617. ];
  6618. for (const lockPath of lockPaths) {
  6619. try {
  6620. yield io.rmRF(lockPath);
  6621. }
  6622. catch (error) {
  6623. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6624. }
  6625. }
  6626. try {
  6627. core.startGroup('Removing previously created refs, to avoid conflicts');
  6628. // Checkout detached HEAD
  6629. if (!(yield git.isDetached())) {
  6630. yield git.checkoutDetach();
  6631. }
  6632. // Remove all refs/heads/*
  6633. let branches = yield git.branchList(false);
  6634. for (const branch of branches) {
  6635. yield git.branchDelete(false, branch);
  6636. }
  6637. // Remove any conflicting refs/remotes/origin/*
  6638. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6639. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6640. if (ref) {
  6641. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6642. if (ref.startsWith('refs/heads/')) {
  6643. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6644. const upperName1Slash = `${upperName1}/`;
  6645. branches = yield git.branchList(true);
  6646. for (const branch of branches) {
  6647. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6648. const upperName2Slash = `${upperName2}/`;
  6649. if (upperName1.startsWith(upperName2Slash) ||
  6650. upperName2.startsWith(upperName1Slash)) {
  6651. yield git.branchDelete(true, branch);
  6652. }
  6653. }
  6654. }
  6655. }
  6656. core.endGroup();
  6657. // Clean
  6658. if (clean) {
  6659. core.startGroup('Cleaning the repository');
  6660. if (!(yield git.tryClean())) {
  6661. 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}'.`);
  6662. remove = true;
  6663. }
  6664. else if (!(yield git.tryReset())) {
  6665. remove = true;
  6666. }
  6667. core.endGroup();
  6668. if (remove) {
  6669. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6670. }
  6671. }
  6672. }
  6673. catch (error) {
  6674. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6675. remove = true;
  6676. }
  6677. }
  6678. if (remove) {
  6679. // Delete the contents of the directory. Don't delete the directory itself
  6680. // since it might be the current working directory.
  6681. core.info(`Deleting the contents of '${repositoryPath}'`);
  6682. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6683. yield io.rmRF(path.join(repositoryPath, file));
  6684. }
  6685. }
  6686. });
  6687. }
  6688. exports.prepareExistingDirectory = prepareExistingDirectory;
  6689. /***/ }),
  6690. /***/ 453:
  6691. /***/ (function(module, __unusedexports, __webpack_require__) {
  6692. var once = __webpack_require__(969)
  6693. var eos = __webpack_require__(3)
  6694. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6695. var noop = function () {}
  6696. var ancient = /^v?\.0/.test(process.version)
  6697. var isFn = function (fn) {
  6698. return typeof fn === 'function'
  6699. }
  6700. var isFS = function (stream) {
  6701. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6702. if (!fs) return false // browser
  6703. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6704. }
  6705. var isRequest = function (stream) {
  6706. return stream.setHeader && isFn(stream.abort)
  6707. }
  6708. var destroyer = function (stream, reading, writing, callback) {
  6709. callback = once(callback)
  6710. var closed = false
  6711. stream.on('close', function () {
  6712. closed = true
  6713. })
  6714. eos(stream, {readable: reading, writable: writing}, function (err) {
  6715. if (err) return callback(err)
  6716. closed = true
  6717. callback()
  6718. })
  6719. var destroyed = false
  6720. return function (err) {
  6721. if (closed) return
  6722. if (destroyed) return
  6723. destroyed = true
  6724. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6725. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6726. if (isFn(stream.destroy)) return stream.destroy()
  6727. callback(err || new Error('stream was destroyed'))
  6728. }
  6729. }
  6730. var call = function (fn) {
  6731. fn()
  6732. }
  6733. var pipe = function (from, to) {
  6734. return from.pipe(to)
  6735. }
  6736. var pump = function () {
  6737. var streams = Array.prototype.slice.call(arguments)
  6738. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6739. if (Array.isArray(streams[0])) streams = streams[0]
  6740. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6741. var error
  6742. var destroys = streams.map(function (stream, i) {
  6743. var reading = i < streams.length - 1
  6744. var writing = i > 0
  6745. return destroyer(stream, reading, writing, function (err) {
  6746. if (!error) error = err
  6747. if (err) destroys.forEach(call)
  6748. if (reading) return
  6749. destroys.forEach(call)
  6750. callback(error)
  6751. })
  6752. })
  6753. return streams.reduce(pipe)
  6754. }
  6755. module.exports = pump
  6756. /***/ }),
  6757. /***/ 454:
  6758. /***/ (function(module, exports, __webpack_require__) {
  6759. "use strict";
  6760. Object.defineProperty(exports, '__esModule', { value: true });
  6761. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6762. var Stream = _interopDefault(__webpack_require__(413));
  6763. var http = _interopDefault(__webpack_require__(605));
  6764. var Url = _interopDefault(__webpack_require__(835));
  6765. var https = _interopDefault(__webpack_require__(34));
  6766. var zlib = _interopDefault(__webpack_require__(761));
  6767. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6768. // fix for "Readable" isn't a named export issue
  6769. const Readable = Stream.Readable;
  6770. const BUFFER = Symbol('buffer');
  6771. const TYPE = Symbol('type');
  6772. class Blob {
  6773. constructor() {
  6774. this[TYPE] = '';
  6775. const blobParts = arguments[0];
  6776. const options = arguments[1];
  6777. const buffers = [];
  6778. let size = 0;
  6779. if (blobParts) {
  6780. const a = blobParts;
  6781. const length = Number(a.length);
  6782. for (let i = 0; i < length; i++) {
  6783. const element = a[i];
  6784. let buffer;
  6785. if (element instanceof Buffer) {
  6786. buffer = element;
  6787. } else if (ArrayBuffer.isView(element)) {
  6788. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6789. } else if (element instanceof ArrayBuffer) {
  6790. buffer = Buffer.from(element);
  6791. } else if (element instanceof Blob) {
  6792. buffer = element[BUFFER];
  6793. } else {
  6794. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6795. }
  6796. size += buffer.length;
  6797. buffers.push(buffer);
  6798. }
  6799. }
  6800. this[BUFFER] = Buffer.concat(buffers);
  6801. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6802. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6803. this[TYPE] = type;
  6804. }
  6805. }
  6806. get size() {
  6807. return this[BUFFER].length;
  6808. }
  6809. get type() {
  6810. return this[TYPE];
  6811. }
  6812. text() {
  6813. return Promise.resolve(this[BUFFER].toString());
  6814. }
  6815. arrayBuffer() {
  6816. const buf = this[BUFFER];
  6817. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6818. return Promise.resolve(ab);
  6819. }
  6820. stream() {
  6821. const readable = new Readable();
  6822. readable._read = function () {};
  6823. readable.push(this[BUFFER]);
  6824. readable.push(null);
  6825. return readable;
  6826. }
  6827. toString() {
  6828. return '[object Blob]';
  6829. }
  6830. slice() {
  6831. const size = this.size;
  6832. const start = arguments[0];
  6833. const end = arguments[1];
  6834. let relativeStart, relativeEnd;
  6835. if (start === undefined) {
  6836. relativeStart = 0;
  6837. } else if (start < 0) {
  6838. relativeStart = Math.max(size + start, 0);
  6839. } else {
  6840. relativeStart = Math.min(start, size);
  6841. }
  6842. if (end === undefined) {
  6843. relativeEnd = size;
  6844. } else if (end < 0) {
  6845. relativeEnd = Math.max(size + end, 0);
  6846. } else {
  6847. relativeEnd = Math.min(end, size);
  6848. }
  6849. const span = Math.max(relativeEnd - relativeStart, 0);
  6850. const buffer = this[BUFFER];
  6851. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6852. const blob = new Blob([], { type: arguments[2] });
  6853. blob[BUFFER] = slicedBuffer;
  6854. return blob;
  6855. }
  6856. }
  6857. Object.defineProperties(Blob.prototype, {
  6858. size: { enumerable: true },
  6859. type: { enumerable: true },
  6860. slice: { enumerable: true }
  6861. });
  6862. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6863. value: 'Blob',
  6864. writable: false,
  6865. enumerable: false,
  6866. configurable: true
  6867. });
  6868. /**
  6869. * fetch-error.js
  6870. *
  6871. * FetchError interface for operational errors
  6872. */
  6873. /**
  6874. * Create FetchError instance
  6875. *
  6876. * @param String message Error message for human
  6877. * @param String type Error type for machine
  6878. * @param String systemError For Node.js system error
  6879. * @return FetchError
  6880. */
  6881. function FetchError(message, type, systemError) {
  6882. Error.call(this, message);
  6883. this.message = message;
  6884. this.type = type;
  6885. // when err.type is `system`, err.code contains system error code
  6886. if (systemError) {
  6887. this.code = this.errno = systemError.code;
  6888. }
  6889. // hide custom error implementation details from end-users
  6890. Error.captureStackTrace(this, this.constructor);
  6891. }
  6892. FetchError.prototype = Object.create(Error.prototype);
  6893. FetchError.prototype.constructor = FetchError;
  6894. FetchError.prototype.name = 'FetchError';
  6895. let convert;
  6896. try {
  6897. convert = __webpack_require__(18).convert;
  6898. } catch (e) {}
  6899. const INTERNALS = Symbol('Body internals');
  6900. // fix an issue where "PassThrough" isn't a named export for node <10
  6901. const PassThrough = Stream.PassThrough;
  6902. /**
  6903. * Body mixin
  6904. *
  6905. * Ref: https://fetch.spec.whatwg.org/#body
  6906. *
  6907. * @param Stream body Readable stream
  6908. * @param Object opts Response options
  6909. * @return Void
  6910. */
  6911. function Body(body) {
  6912. var _this = this;
  6913. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6914. _ref$size = _ref.size;
  6915. let size = _ref$size === undefined ? 0 : _ref$size;
  6916. var _ref$timeout = _ref.timeout;
  6917. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6918. if (body == null) {
  6919. // body is undefined or null
  6920. body = null;
  6921. } else if (isURLSearchParams(body)) {
  6922. // body is a URLSearchParams
  6923. body = Buffer.from(body.toString());
  6924. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6925. // body is ArrayBuffer
  6926. body = Buffer.from(body);
  6927. } else if (ArrayBuffer.isView(body)) {
  6928. // body is ArrayBufferView
  6929. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6930. } else if (body instanceof Stream) ; else {
  6931. // none of the above
  6932. // coerce to string then buffer
  6933. body = Buffer.from(String(body));
  6934. }
  6935. this[INTERNALS] = {
  6936. body,
  6937. disturbed: false,
  6938. error: null
  6939. };
  6940. this.size = size;
  6941. this.timeout = timeout;
  6942. if (body instanceof Stream) {
  6943. body.on('error', function (err) {
  6944. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6945. _this[INTERNALS].error = error;
  6946. });
  6947. }
  6948. }
  6949. Body.prototype = {
  6950. get body() {
  6951. return this[INTERNALS].body;
  6952. },
  6953. get bodyUsed() {
  6954. return this[INTERNALS].disturbed;
  6955. },
  6956. /**
  6957. * Decode response as ArrayBuffer
  6958. *
  6959. * @return Promise
  6960. */
  6961. arrayBuffer() {
  6962. return consumeBody.call(this).then(function (buf) {
  6963. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6964. });
  6965. },
  6966. /**
  6967. * Return raw response as Blob
  6968. *
  6969. * @return Promise
  6970. */
  6971. blob() {
  6972. let ct = this.headers && this.headers.get('content-type') || '';
  6973. return consumeBody.call(this).then(function (buf) {
  6974. return Object.assign(
  6975. // Prevent copying
  6976. new Blob([], {
  6977. type: ct.toLowerCase()
  6978. }), {
  6979. [BUFFER]: buf
  6980. });
  6981. });
  6982. },
  6983. /**
  6984. * Decode response as json
  6985. *
  6986. * @return Promise
  6987. */
  6988. json() {
  6989. var _this2 = this;
  6990. return consumeBody.call(this).then(function (buffer) {
  6991. try {
  6992. return JSON.parse(buffer.toString());
  6993. } catch (err) {
  6994. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6995. }
  6996. });
  6997. },
  6998. /**
  6999. * Decode response as text
  7000. *
  7001. * @return Promise
  7002. */
  7003. text() {
  7004. return consumeBody.call(this).then(function (buffer) {
  7005. return buffer.toString();
  7006. });
  7007. },
  7008. /**
  7009. * Decode response as buffer (non-spec api)
  7010. *
  7011. * @return Promise
  7012. */
  7013. buffer() {
  7014. return consumeBody.call(this);
  7015. },
  7016. /**
  7017. * Decode response as text, while automatically detecting the encoding and
  7018. * trying to decode to UTF-8 (non-spec api)
  7019. *
  7020. * @return Promise
  7021. */
  7022. textConverted() {
  7023. var _this3 = this;
  7024. return consumeBody.call(this).then(function (buffer) {
  7025. return convertBody(buffer, _this3.headers);
  7026. });
  7027. }
  7028. };
  7029. // In browsers, all properties are enumerable.
  7030. Object.defineProperties(Body.prototype, {
  7031. body: { enumerable: true },
  7032. bodyUsed: { enumerable: true },
  7033. arrayBuffer: { enumerable: true },
  7034. blob: { enumerable: true },
  7035. json: { enumerable: true },
  7036. text: { enumerable: true }
  7037. });
  7038. Body.mixIn = function (proto) {
  7039. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7040. // istanbul ignore else: future proof
  7041. if (!(name in proto)) {
  7042. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7043. Object.defineProperty(proto, name, desc);
  7044. }
  7045. }
  7046. };
  7047. /**
  7048. * Consume and convert an entire Body to a Buffer.
  7049. *
  7050. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7051. *
  7052. * @return Promise
  7053. */
  7054. function consumeBody() {
  7055. var _this4 = this;
  7056. if (this[INTERNALS].disturbed) {
  7057. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7058. }
  7059. this[INTERNALS].disturbed = true;
  7060. if (this[INTERNALS].error) {
  7061. return Body.Promise.reject(this[INTERNALS].error);
  7062. }
  7063. let body = this.body;
  7064. // body is null
  7065. if (body === null) {
  7066. return Body.Promise.resolve(Buffer.alloc(0));
  7067. }
  7068. // body is blob
  7069. if (isBlob(body)) {
  7070. body = body.stream();
  7071. }
  7072. // body is buffer
  7073. if (Buffer.isBuffer(body)) {
  7074. return Body.Promise.resolve(body);
  7075. }
  7076. // istanbul ignore if: should never happen
  7077. if (!(body instanceof Stream)) {
  7078. return Body.Promise.resolve(Buffer.alloc(0));
  7079. }
  7080. // body is stream
  7081. // get ready to actually consume the body
  7082. let accum = [];
  7083. let accumBytes = 0;
  7084. let abort = false;
  7085. return new Body.Promise(function (resolve, reject) {
  7086. let resTimeout;
  7087. // allow timeout on slow response body
  7088. if (_this4.timeout) {
  7089. resTimeout = setTimeout(function () {
  7090. abort = true;
  7091. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7092. }, _this4.timeout);
  7093. }
  7094. // handle stream errors
  7095. body.on('error', function (err) {
  7096. if (err.name === 'AbortError') {
  7097. // if the request was aborted, reject with this Error
  7098. abort = true;
  7099. reject(err);
  7100. } else {
  7101. // other errors, such as incorrect content-encoding
  7102. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7103. }
  7104. });
  7105. body.on('data', function (chunk) {
  7106. if (abort || chunk === null) {
  7107. return;
  7108. }
  7109. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7110. abort = true;
  7111. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7112. return;
  7113. }
  7114. accumBytes += chunk.length;
  7115. accum.push(chunk);
  7116. });
  7117. body.on('end', function () {
  7118. if (abort) {
  7119. return;
  7120. }
  7121. clearTimeout(resTimeout);
  7122. try {
  7123. resolve(Buffer.concat(accum, accumBytes));
  7124. } catch (err) {
  7125. // handle streams that have accumulated too much data (issue #414)
  7126. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7127. }
  7128. });
  7129. });
  7130. }
  7131. /**
  7132. * Detect buffer encoding and convert to target encoding
  7133. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7134. *
  7135. * @param Buffer buffer Incoming buffer
  7136. * @param String encoding Target encoding
  7137. * @return String
  7138. */
  7139. function convertBody(buffer, headers) {
  7140. if (typeof convert !== 'function') {
  7141. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7142. }
  7143. const ct = headers.get('content-type');
  7144. let charset = 'utf-8';
  7145. let res, str;
  7146. // header
  7147. if (ct) {
  7148. res = /charset=([^;]*)/i.exec(ct);
  7149. }
  7150. // no charset in content type, peek at response body for at most 1024 bytes
  7151. str = buffer.slice(0, 1024).toString();
  7152. // html5
  7153. if (!res && str) {
  7154. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7155. }
  7156. // html4
  7157. if (!res && str) {
  7158. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7159. if (res) {
  7160. res = /charset=(.*)/i.exec(res.pop());
  7161. }
  7162. }
  7163. // xml
  7164. if (!res && str) {
  7165. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7166. }
  7167. // found charset
  7168. if (res) {
  7169. charset = res.pop();
  7170. // prevent decode issues when sites use incorrect encoding
  7171. // ref: https://hsivonen.fi/encoding-menu/
  7172. if (charset === 'gb2312' || charset === 'gbk') {
  7173. charset = 'gb18030';
  7174. }
  7175. }
  7176. // turn raw buffers into a single utf-8 buffer
  7177. return convert(buffer, 'UTF-8', charset).toString();
  7178. }
  7179. /**
  7180. * Detect a URLSearchParams object
  7181. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7182. *
  7183. * @param Object obj Object to detect by type or brand
  7184. * @return String
  7185. */
  7186. function isURLSearchParams(obj) {
  7187. // Duck-typing as a necessary condition.
  7188. 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') {
  7189. return false;
  7190. }
  7191. // Brand-checking and more duck-typing as optional condition.
  7192. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7193. }
  7194. /**
  7195. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7196. * @param {*} obj
  7197. * @return {boolean}
  7198. */
  7199. function isBlob(obj) {
  7200. 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]);
  7201. }
  7202. /**
  7203. * Clone body given Res/Req instance
  7204. *
  7205. * @param Mixed instance Response or Request instance
  7206. * @return Mixed
  7207. */
  7208. function clone(instance) {
  7209. let p1, p2;
  7210. let body = instance.body;
  7211. // don't allow cloning a used body
  7212. if (instance.bodyUsed) {
  7213. throw new Error('cannot clone body after it is used');
  7214. }
  7215. // check that body is a stream and not form-data object
  7216. // note: we can't clone the form-data object without having it as a dependency
  7217. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7218. // tee instance body
  7219. p1 = new PassThrough();
  7220. p2 = new PassThrough();
  7221. body.pipe(p1);
  7222. body.pipe(p2);
  7223. // set instance body to teed body and return the other teed body
  7224. instance[INTERNALS].body = p1;
  7225. body = p2;
  7226. }
  7227. return body;
  7228. }
  7229. /**
  7230. * Performs the operation "extract a `Content-Type` value from |object|" as
  7231. * specified in the specification:
  7232. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7233. *
  7234. * This function assumes that instance.body is present.
  7235. *
  7236. * @param Mixed instance Any options.body input
  7237. */
  7238. function extractContentType(body) {
  7239. if (body === null) {
  7240. // body is null
  7241. return null;
  7242. } else if (typeof body === 'string') {
  7243. // body is string
  7244. return 'text/plain;charset=UTF-8';
  7245. } else if (isURLSearchParams(body)) {
  7246. // body is a URLSearchParams
  7247. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7248. } else if (isBlob(body)) {
  7249. // body is blob
  7250. return body.type || null;
  7251. } else if (Buffer.isBuffer(body)) {
  7252. // body is buffer
  7253. return null;
  7254. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7255. // body is ArrayBuffer
  7256. return null;
  7257. } else if (ArrayBuffer.isView(body)) {
  7258. // body is ArrayBufferView
  7259. return null;
  7260. } else if (typeof body.getBoundary === 'function') {
  7261. // detect form data input from form-data module
  7262. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7263. } else if (body instanceof Stream) {
  7264. // body is stream
  7265. // can't really do much about this
  7266. return null;
  7267. } else {
  7268. // Body constructor defaults other things to string
  7269. return 'text/plain;charset=UTF-8';
  7270. }
  7271. }
  7272. /**
  7273. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7274. * For us, we have to explicitly get it with a function.
  7275. *
  7276. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7277. *
  7278. * @param Body instance Instance of Body
  7279. * @return Number? Number of bytes, or null if not possible
  7280. */
  7281. function getTotalBytes(instance) {
  7282. const body = instance.body;
  7283. if (body === null) {
  7284. // body is null
  7285. return 0;
  7286. } else if (isBlob(body)) {
  7287. return body.size;
  7288. } else if (Buffer.isBuffer(body)) {
  7289. // body is buffer
  7290. return body.length;
  7291. } else if (body && typeof body.getLengthSync === 'function') {
  7292. // detect form data input from form-data module
  7293. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7294. body.hasKnownLength && body.hasKnownLength()) {
  7295. // 2.x
  7296. return body.getLengthSync();
  7297. }
  7298. return null;
  7299. } else {
  7300. // body is stream
  7301. return null;
  7302. }
  7303. }
  7304. /**
  7305. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7306. *
  7307. * @param Body instance Instance of Body
  7308. * @return Void
  7309. */
  7310. function writeToStream(dest, instance) {
  7311. const body = instance.body;
  7312. if (body === null) {
  7313. // body is null
  7314. dest.end();
  7315. } else if (isBlob(body)) {
  7316. body.stream().pipe(dest);
  7317. } else if (Buffer.isBuffer(body)) {
  7318. // body is buffer
  7319. dest.write(body);
  7320. dest.end();
  7321. } else {
  7322. // body is stream
  7323. body.pipe(dest);
  7324. }
  7325. }
  7326. // expose Promise
  7327. Body.Promise = global.Promise;
  7328. /**
  7329. * headers.js
  7330. *
  7331. * Headers class offers convenient helpers
  7332. */
  7333. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7334. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7335. function validateName(name) {
  7336. name = `${name}`;
  7337. if (invalidTokenRegex.test(name) || name === '') {
  7338. throw new TypeError(`${name} is not a legal HTTP header name`);
  7339. }
  7340. }
  7341. function validateValue(value) {
  7342. value = `${value}`;
  7343. if (invalidHeaderCharRegex.test(value)) {
  7344. throw new TypeError(`${value} is not a legal HTTP header value`);
  7345. }
  7346. }
  7347. /**
  7348. * Find the key in the map object given a header name.
  7349. *
  7350. * Returns undefined if not found.
  7351. *
  7352. * @param String name Header name
  7353. * @return String|Undefined
  7354. */
  7355. function find(map, name) {
  7356. name = name.toLowerCase();
  7357. for (const key in map) {
  7358. if (key.toLowerCase() === name) {
  7359. return key;
  7360. }
  7361. }
  7362. return undefined;
  7363. }
  7364. const MAP = Symbol('map');
  7365. class Headers {
  7366. /**
  7367. * Headers class
  7368. *
  7369. * @param Object headers Response headers
  7370. * @return Void
  7371. */
  7372. constructor() {
  7373. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7374. this[MAP] = Object.create(null);
  7375. if (init instanceof Headers) {
  7376. const rawHeaders = init.raw();
  7377. const headerNames = Object.keys(rawHeaders);
  7378. for (const headerName of headerNames) {
  7379. for (const value of rawHeaders[headerName]) {
  7380. this.append(headerName, value);
  7381. }
  7382. }
  7383. return;
  7384. }
  7385. // We don't worry about converting prop to ByteString here as append()
  7386. // will handle it.
  7387. if (init == null) ; else if (typeof init === 'object') {
  7388. const method = init[Symbol.iterator];
  7389. if (method != null) {
  7390. if (typeof method !== 'function') {
  7391. throw new TypeError('Header pairs must be iterable');
  7392. }
  7393. // sequence<sequence<ByteString>>
  7394. // Note: per spec we have to first exhaust the lists then process them
  7395. const pairs = [];
  7396. for (const pair of init) {
  7397. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7398. throw new TypeError('Each header pair must be iterable');
  7399. }
  7400. pairs.push(Array.from(pair));
  7401. }
  7402. for (const pair of pairs) {
  7403. if (pair.length !== 2) {
  7404. throw new TypeError('Each header pair must be a name/value tuple');
  7405. }
  7406. this.append(pair[0], pair[1]);
  7407. }
  7408. } else {
  7409. // record<ByteString, ByteString>
  7410. for (const key of Object.keys(init)) {
  7411. const value = init[key];
  7412. this.append(key, value);
  7413. }
  7414. }
  7415. } else {
  7416. throw new TypeError('Provided initializer must be an object');
  7417. }
  7418. }
  7419. /**
  7420. * Return combined header value given name
  7421. *
  7422. * @param String name Header name
  7423. * @return Mixed
  7424. */
  7425. get(name) {
  7426. name = `${name}`;
  7427. validateName(name);
  7428. const key = find(this[MAP], name);
  7429. if (key === undefined) {
  7430. return null;
  7431. }
  7432. return this[MAP][key].join(', ');
  7433. }
  7434. /**
  7435. * Iterate over all headers
  7436. *
  7437. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7438. * @param Boolean thisArg `this` context for callback function
  7439. * @return Void
  7440. */
  7441. forEach(callback) {
  7442. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7443. let pairs = getHeaders(this);
  7444. let i = 0;
  7445. while (i < pairs.length) {
  7446. var _pairs$i = pairs[i];
  7447. const name = _pairs$i[0],
  7448. value = _pairs$i[1];
  7449. callback.call(thisArg, value, name, this);
  7450. pairs = getHeaders(this);
  7451. i++;
  7452. }
  7453. }
  7454. /**
  7455. * Overwrite header values given name
  7456. *
  7457. * @param String name Header name
  7458. * @param String value Header value
  7459. * @return Void
  7460. */
  7461. set(name, value) {
  7462. name = `${name}`;
  7463. value = `${value}`;
  7464. validateName(name);
  7465. validateValue(value);
  7466. const key = find(this[MAP], name);
  7467. this[MAP][key !== undefined ? key : name] = [value];
  7468. }
  7469. /**
  7470. * Append a value onto existing header
  7471. *
  7472. * @param String name Header name
  7473. * @param String value Header value
  7474. * @return Void
  7475. */
  7476. append(name, value) {
  7477. name = `${name}`;
  7478. value = `${value}`;
  7479. validateName(name);
  7480. validateValue(value);
  7481. const key = find(this[MAP], name);
  7482. if (key !== undefined) {
  7483. this[MAP][key].push(value);
  7484. } else {
  7485. this[MAP][name] = [value];
  7486. }
  7487. }
  7488. /**
  7489. * Check for header name existence
  7490. *
  7491. * @param String name Header name
  7492. * @return Boolean
  7493. */
  7494. has(name) {
  7495. name = `${name}`;
  7496. validateName(name);
  7497. return find(this[MAP], name) !== undefined;
  7498. }
  7499. /**
  7500. * Delete all header values given name
  7501. *
  7502. * @param String name Header name
  7503. * @return Void
  7504. */
  7505. delete(name) {
  7506. name = `${name}`;
  7507. validateName(name);
  7508. const key = find(this[MAP], name);
  7509. if (key !== undefined) {
  7510. delete this[MAP][key];
  7511. }
  7512. }
  7513. /**
  7514. * Return raw headers (non-spec api)
  7515. *
  7516. * @return Object
  7517. */
  7518. raw() {
  7519. return this[MAP];
  7520. }
  7521. /**
  7522. * Get an iterator on keys.
  7523. *
  7524. * @return Iterator
  7525. */
  7526. keys() {
  7527. return createHeadersIterator(this, 'key');
  7528. }
  7529. /**
  7530. * Get an iterator on values.
  7531. *
  7532. * @return Iterator
  7533. */
  7534. values() {
  7535. return createHeadersIterator(this, 'value');
  7536. }
  7537. /**
  7538. * Get an iterator on entries.
  7539. *
  7540. * This is the default iterator of the Headers object.
  7541. *
  7542. * @return Iterator
  7543. */
  7544. [Symbol.iterator]() {
  7545. return createHeadersIterator(this, 'key+value');
  7546. }
  7547. }
  7548. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7549. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7550. value: 'Headers',
  7551. writable: false,
  7552. enumerable: false,
  7553. configurable: true
  7554. });
  7555. Object.defineProperties(Headers.prototype, {
  7556. get: { enumerable: true },
  7557. forEach: { enumerable: true },
  7558. set: { enumerable: true },
  7559. append: { enumerable: true },
  7560. has: { enumerable: true },
  7561. delete: { enumerable: true },
  7562. keys: { enumerable: true },
  7563. values: { enumerable: true },
  7564. entries: { enumerable: true }
  7565. });
  7566. function getHeaders(headers) {
  7567. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7568. const keys = Object.keys(headers[MAP]).sort();
  7569. return keys.map(kind === 'key' ? function (k) {
  7570. return k.toLowerCase();
  7571. } : kind === 'value' ? function (k) {
  7572. return headers[MAP][k].join(', ');
  7573. } : function (k) {
  7574. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7575. });
  7576. }
  7577. const INTERNAL = Symbol('internal');
  7578. function createHeadersIterator(target, kind) {
  7579. const iterator = Object.create(HeadersIteratorPrototype);
  7580. iterator[INTERNAL] = {
  7581. target,
  7582. kind,
  7583. index: 0
  7584. };
  7585. return iterator;
  7586. }
  7587. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7588. next() {
  7589. // istanbul ignore if
  7590. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7591. throw new TypeError('Value of `this` is not a HeadersIterator');
  7592. }
  7593. var _INTERNAL = this[INTERNAL];
  7594. const target = _INTERNAL.target,
  7595. kind = _INTERNAL.kind,
  7596. index = _INTERNAL.index;
  7597. const values = getHeaders(target, kind);
  7598. const len = values.length;
  7599. if (index >= len) {
  7600. return {
  7601. value: undefined,
  7602. done: true
  7603. };
  7604. }
  7605. this[INTERNAL].index = index + 1;
  7606. return {
  7607. value: values[index],
  7608. done: false
  7609. };
  7610. }
  7611. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7612. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7613. value: 'HeadersIterator',
  7614. writable: false,
  7615. enumerable: false,
  7616. configurable: true
  7617. });
  7618. /**
  7619. * Export the Headers object in a form that Node.js can consume.
  7620. *
  7621. * @param Headers headers
  7622. * @return Object
  7623. */
  7624. function exportNodeCompatibleHeaders(headers) {
  7625. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7626. // http.request() only supports string as Host header. This hack makes
  7627. // specifying custom Host header possible.
  7628. const hostHeaderKey = find(headers[MAP], 'Host');
  7629. if (hostHeaderKey !== undefined) {
  7630. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7631. }
  7632. return obj;
  7633. }
  7634. /**
  7635. * Create a Headers object from an object of headers, ignoring those that do
  7636. * not conform to HTTP grammar productions.
  7637. *
  7638. * @param Object obj Object of headers
  7639. * @return Headers
  7640. */
  7641. function createHeadersLenient(obj) {
  7642. const headers = new Headers();
  7643. for (const name of Object.keys(obj)) {
  7644. if (invalidTokenRegex.test(name)) {
  7645. continue;
  7646. }
  7647. if (Array.isArray(obj[name])) {
  7648. for (const val of obj[name]) {
  7649. if (invalidHeaderCharRegex.test(val)) {
  7650. continue;
  7651. }
  7652. if (headers[MAP][name] === undefined) {
  7653. headers[MAP][name] = [val];
  7654. } else {
  7655. headers[MAP][name].push(val);
  7656. }
  7657. }
  7658. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7659. headers[MAP][name] = [obj[name]];
  7660. }
  7661. }
  7662. return headers;
  7663. }
  7664. const INTERNALS$1 = Symbol('Response internals');
  7665. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7666. const STATUS_CODES = http.STATUS_CODES;
  7667. /**
  7668. * Response class
  7669. *
  7670. * @param Stream body Readable stream
  7671. * @param Object opts Response options
  7672. * @return Void
  7673. */
  7674. class Response {
  7675. constructor() {
  7676. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7677. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7678. Body.call(this, body, opts);
  7679. const status = opts.status || 200;
  7680. const headers = new Headers(opts.headers);
  7681. if (body != null && !headers.has('Content-Type')) {
  7682. const contentType = extractContentType(body);
  7683. if (contentType) {
  7684. headers.append('Content-Type', contentType);
  7685. }
  7686. }
  7687. this[INTERNALS$1] = {
  7688. url: opts.url,
  7689. status,
  7690. statusText: opts.statusText || STATUS_CODES[status],
  7691. headers,
  7692. counter: opts.counter
  7693. };
  7694. }
  7695. get url() {
  7696. return this[INTERNALS$1].url || '';
  7697. }
  7698. get status() {
  7699. return this[INTERNALS$1].status;
  7700. }
  7701. /**
  7702. * Convenience property representing if the request ended normally
  7703. */
  7704. get ok() {
  7705. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7706. }
  7707. get redirected() {
  7708. return this[INTERNALS$1].counter > 0;
  7709. }
  7710. get statusText() {
  7711. return this[INTERNALS$1].statusText;
  7712. }
  7713. get headers() {
  7714. return this[INTERNALS$1].headers;
  7715. }
  7716. /**
  7717. * Clone this response
  7718. *
  7719. * @return Response
  7720. */
  7721. clone() {
  7722. return new Response(clone(this), {
  7723. url: this.url,
  7724. status: this.status,
  7725. statusText: this.statusText,
  7726. headers: this.headers,
  7727. ok: this.ok,
  7728. redirected: this.redirected
  7729. });
  7730. }
  7731. }
  7732. Body.mixIn(Response.prototype);
  7733. Object.defineProperties(Response.prototype, {
  7734. url: { enumerable: true },
  7735. status: { enumerable: true },
  7736. ok: { enumerable: true },
  7737. redirected: { enumerable: true },
  7738. statusText: { enumerable: true },
  7739. headers: { enumerable: true },
  7740. clone: { enumerable: true }
  7741. });
  7742. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7743. value: 'Response',
  7744. writable: false,
  7745. enumerable: false,
  7746. configurable: true
  7747. });
  7748. const INTERNALS$2 = Symbol('Request internals');
  7749. // fix an issue where "format", "parse" aren't a named export for node <10
  7750. const parse_url = Url.parse;
  7751. const format_url = Url.format;
  7752. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7753. /**
  7754. * Check if a value is an instance of Request.
  7755. *
  7756. * @param Mixed input
  7757. * @return Boolean
  7758. */
  7759. function isRequest(input) {
  7760. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7761. }
  7762. function isAbortSignal(signal) {
  7763. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7764. return !!(proto && proto.constructor.name === 'AbortSignal');
  7765. }
  7766. /**
  7767. * Request class
  7768. *
  7769. * @param Mixed input Url or Request instance
  7770. * @param Object init Custom options
  7771. * @return Void
  7772. */
  7773. class Request {
  7774. constructor(input) {
  7775. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7776. let parsedURL;
  7777. // normalize input
  7778. if (!isRequest(input)) {
  7779. if (input && input.href) {
  7780. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7781. // will fall into this branch also (since their `toString()` will return
  7782. // `href` property anyway)
  7783. parsedURL = parse_url(input.href);
  7784. } else {
  7785. // coerce input to a string before attempting to parse
  7786. parsedURL = parse_url(`${input}`);
  7787. }
  7788. input = {};
  7789. } else {
  7790. parsedURL = parse_url(input.url);
  7791. }
  7792. let method = init.method || input.method || 'GET';
  7793. method = method.toUpperCase();
  7794. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7795. throw new TypeError('Request with GET/HEAD method cannot have body');
  7796. }
  7797. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7798. Body.call(this, inputBody, {
  7799. timeout: init.timeout || input.timeout || 0,
  7800. size: init.size || input.size || 0
  7801. });
  7802. const headers = new Headers(init.headers || input.headers || {});
  7803. if (inputBody != null && !headers.has('Content-Type')) {
  7804. const contentType = extractContentType(inputBody);
  7805. if (contentType) {
  7806. headers.append('Content-Type', contentType);
  7807. }
  7808. }
  7809. let signal = isRequest(input) ? input.signal : null;
  7810. if ('signal' in init) signal = init.signal;
  7811. if (signal != null && !isAbortSignal(signal)) {
  7812. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7813. }
  7814. this[INTERNALS$2] = {
  7815. method,
  7816. redirect: init.redirect || input.redirect || 'follow',
  7817. headers,
  7818. parsedURL,
  7819. signal
  7820. };
  7821. // node-fetch-only options
  7822. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7823. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7824. this.counter = init.counter || input.counter || 0;
  7825. this.agent = init.agent || input.agent;
  7826. }
  7827. get method() {
  7828. return this[INTERNALS$2].method;
  7829. }
  7830. get url() {
  7831. return format_url(this[INTERNALS$2].parsedURL);
  7832. }
  7833. get headers() {
  7834. return this[INTERNALS$2].headers;
  7835. }
  7836. get redirect() {
  7837. return this[INTERNALS$2].redirect;
  7838. }
  7839. get signal() {
  7840. return this[INTERNALS$2].signal;
  7841. }
  7842. /**
  7843. * Clone this request
  7844. *
  7845. * @return Request
  7846. */
  7847. clone() {
  7848. return new Request(this);
  7849. }
  7850. }
  7851. Body.mixIn(Request.prototype);
  7852. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7853. value: 'Request',
  7854. writable: false,
  7855. enumerable: false,
  7856. configurable: true
  7857. });
  7858. Object.defineProperties(Request.prototype, {
  7859. method: { enumerable: true },
  7860. url: { enumerable: true },
  7861. headers: { enumerable: true },
  7862. redirect: { enumerable: true },
  7863. clone: { enumerable: true },
  7864. signal: { enumerable: true }
  7865. });
  7866. /**
  7867. * Convert a Request to Node.js http request options.
  7868. *
  7869. * @param Request A Request instance
  7870. * @return Object The options object to be passed to http.request
  7871. */
  7872. function getNodeRequestOptions(request) {
  7873. const parsedURL = request[INTERNALS$2].parsedURL;
  7874. const headers = new Headers(request[INTERNALS$2].headers);
  7875. // fetch step 1.3
  7876. if (!headers.has('Accept')) {
  7877. headers.set('Accept', '*/*');
  7878. }
  7879. // Basic fetch
  7880. if (!parsedURL.protocol || !parsedURL.hostname) {
  7881. throw new TypeError('Only absolute URLs are supported');
  7882. }
  7883. if (!/^https?:$/.test(parsedURL.protocol)) {
  7884. throw new TypeError('Only HTTP(S) protocols are supported');
  7885. }
  7886. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7887. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7888. }
  7889. // HTTP-network-or-cache fetch steps 2.4-2.7
  7890. let contentLengthValue = null;
  7891. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7892. contentLengthValue = '0';
  7893. }
  7894. if (request.body != null) {
  7895. const totalBytes = getTotalBytes(request);
  7896. if (typeof totalBytes === 'number') {
  7897. contentLengthValue = String(totalBytes);
  7898. }
  7899. }
  7900. if (contentLengthValue) {
  7901. headers.set('Content-Length', contentLengthValue);
  7902. }
  7903. // HTTP-network-or-cache fetch step 2.11
  7904. if (!headers.has('User-Agent')) {
  7905. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7906. }
  7907. // HTTP-network-or-cache fetch step 2.15
  7908. if (request.compress && !headers.has('Accept-Encoding')) {
  7909. headers.set('Accept-Encoding', 'gzip,deflate');
  7910. }
  7911. let agent = request.agent;
  7912. if (typeof agent === 'function') {
  7913. agent = agent(parsedURL);
  7914. }
  7915. if (!headers.has('Connection') && !agent) {
  7916. headers.set('Connection', 'close');
  7917. }
  7918. // HTTP-network fetch step 4.2
  7919. // chunked encoding is handled by Node.js
  7920. return Object.assign({}, parsedURL, {
  7921. method: request.method,
  7922. headers: exportNodeCompatibleHeaders(headers),
  7923. agent
  7924. });
  7925. }
  7926. /**
  7927. * abort-error.js
  7928. *
  7929. * AbortError interface for cancelled requests
  7930. */
  7931. /**
  7932. * Create AbortError instance
  7933. *
  7934. * @param String message Error message for human
  7935. * @return AbortError
  7936. */
  7937. function AbortError(message) {
  7938. Error.call(this, message);
  7939. this.type = 'aborted';
  7940. this.message = message;
  7941. // hide custom error implementation details from end-users
  7942. Error.captureStackTrace(this, this.constructor);
  7943. }
  7944. AbortError.prototype = Object.create(Error.prototype);
  7945. AbortError.prototype.constructor = AbortError;
  7946. AbortError.prototype.name = 'AbortError';
  7947. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7948. const PassThrough$1 = Stream.PassThrough;
  7949. const resolve_url = Url.resolve;
  7950. /**
  7951. * Fetch function
  7952. *
  7953. * @param Mixed url Absolute url or Request instance
  7954. * @param Object opts Fetch options
  7955. * @return Promise
  7956. */
  7957. function fetch(url, opts) {
  7958. // allow custom promise
  7959. if (!fetch.Promise) {
  7960. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7961. }
  7962. Body.Promise = fetch.Promise;
  7963. // wrap http.request into fetch
  7964. return new fetch.Promise(function (resolve, reject) {
  7965. // build request object
  7966. const request = new Request(url, opts);
  7967. const options = getNodeRequestOptions(request);
  7968. const send = (options.protocol === 'https:' ? https : http).request;
  7969. const signal = request.signal;
  7970. let response = null;
  7971. const abort = function abort() {
  7972. let error = new AbortError('The user aborted a request.');
  7973. reject(error);
  7974. if (request.body && request.body instanceof Stream.Readable) {
  7975. request.body.destroy(error);
  7976. }
  7977. if (!response || !response.body) return;
  7978. response.body.emit('error', error);
  7979. };
  7980. if (signal && signal.aborted) {
  7981. abort();
  7982. return;
  7983. }
  7984. const abortAndFinalize = function abortAndFinalize() {
  7985. abort();
  7986. finalize();
  7987. };
  7988. // send request
  7989. const req = send(options);
  7990. let reqTimeout;
  7991. if (signal) {
  7992. signal.addEventListener('abort', abortAndFinalize);
  7993. }
  7994. function finalize() {
  7995. req.abort();
  7996. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7997. clearTimeout(reqTimeout);
  7998. }
  7999. if (request.timeout) {
  8000. req.once('socket', function (socket) {
  8001. reqTimeout = setTimeout(function () {
  8002. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8003. finalize();
  8004. }, request.timeout);
  8005. });
  8006. }
  8007. req.on('error', function (err) {
  8008. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8009. finalize();
  8010. });
  8011. req.on('response', function (res) {
  8012. clearTimeout(reqTimeout);
  8013. const headers = createHeadersLenient(res.headers);
  8014. // HTTP fetch step 5
  8015. if (fetch.isRedirect(res.statusCode)) {
  8016. // HTTP fetch step 5.2
  8017. const location = headers.get('Location');
  8018. // HTTP fetch step 5.3
  8019. const locationURL = location === null ? null : resolve_url(request.url, location);
  8020. // HTTP fetch step 5.5
  8021. switch (request.redirect) {
  8022. case 'error':
  8023. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8024. finalize();
  8025. return;
  8026. case 'manual':
  8027. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8028. if (locationURL !== null) {
  8029. // handle corrupted header
  8030. try {
  8031. headers.set('Location', locationURL);
  8032. } catch (err) {
  8033. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8034. reject(err);
  8035. }
  8036. }
  8037. break;
  8038. case 'follow':
  8039. // HTTP-redirect fetch step 2
  8040. if (locationURL === null) {
  8041. break;
  8042. }
  8043. // HTTP-redirect fetch step 5
  8044. if (request.counter >= request.follow) {
  8045. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8046. finalize();
  8047. return;
  8048. }
  8049. // HTTP-redirect fetch step 6 (counter increment)
  8050. // Create a new Request object.
  8051. const requestOpts = {
  8052. headers: new Headers(request.headers),
  8053. follow: request.follow,
  8054. counter: request.counter + 1,
  8055. agent: request.agent,
  8056. compress: request.compress,
  8057. method: request.method,
  8058. body: request.body,
  8059. signal: request.signal,
  8060. timeout: request.timeout
  8061. };
  8062. // HTTP-redirect fetch step 9
  8063. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8064. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8065. finalize();
  8066. return;
  8067. }
  8068. // HTTP-redirect fetch step 11
  8069. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8070. requestOpts.method = 'GET';
  8071. requestOpts.body = undefined;
  8072. requestOpts.headers.delete('content-length');
  8073. }
  8074. // HTTP-redirect fetch step 15
  8075. resolve(fetch(new Request(locationURL, requestOpts)));
  8076. finalize();
  8077. return;
  8078. }
  8079. }
  8080. // prepare response
  8081. res.once('end', function () {
  8082. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8083. });
  8084. let body = res.pipe(new PassThrough$1());
  8085. const response_options = {
  8086. url: request.url,
  8087. status: res.statusCode,
  8088. statusText: res.statusMessage,
  8089. headers: headers,
  8090. size: request.size,
  8091. timeout: request.timeout,
  8092. counter: request.counter
  8093. };
  8094. // HTTP-network fetch step 12.1.1.3
  8095. const codings = headers.get('Content-Encoding');
  8096. // HTTP-network fetch step 12.1.1.4: handle content codings
  8097. // in following scenarios we ignore compression support
  8098. // 1. compression support is disabled
  8099. // 2. HEAD request
  8100. // 3. no Content-Encoding header
  8101. // 4. no content response (204)
  8102. // 5. content not modified response (304)
  8103. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8104. response = new Response(body, response_options);
  8105. resolve(response);
  8106. return;
  8107. }
  8108. // For Node v6+
  8109. // Be less strict when decoding compressed responses, since sometimes
  8110. // servers send slightly invalid responses that are still accepted
  8111. // by common browsers.
  8112. // Always using Z_SYNC_FLUSH is what cURL does.
  8113. const zlibOptions = {
  8114. flush: zlib.Z_SYNC_FLUSH,
  8115. finishFlush: zlib.Z_SYNC_FLUSH
  8116. };
  8117. // for gzip
  8118. if (codings == 'gzip' || codings == 'x-gzip') {
  8119. body = body.pipe(zlib.createGunzip(zlibOptions));
  8120. response = new Response(body, response_options);
  8121. resolve(response);
  8122. return;
  8123. }
  8124. // for deflate
  8125. if (codings == 'deflate' || codings == 'x-deflate') {
  8126. // handle the infamous raw deflate response from old servers
  8127. // a hack for old IIS and Apache servers
  8128. const raw = res.pipe(new PassThrough$1());
  8129. raw.once('data', function (chunk) {
  8130. // see http://stackoverflow.com/questions/37519828
  8131. if ((chunk[0] & 0x0F) === 0x08) {
  8132. body = body.pipe(zlib.createInflate());
  8133. } else {
  8134. body = body.pipe(zlib.createInflateRaw());
  8135. }
  8136. response = new Response(body, response_options);
  8137. resolve(response);
  8138. });
  8139. return;
  8140. }
  8141. // for br
  8142. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8143. body = body.pipe(zlib.createBrotliDecompress());
  8144. response = new Response(body, response_options);
  8145. resolve(response);
  8146. return;
  8147. }
  8148. // otherwise, use response as-is
  8149. response = new Response(body, response_options);
  8150. resolve(response);
  8151. });
  8152. writeToStream(req, request);
  8153. });
  8154. }
  8155. /**
  8156. * Redirect code matching
  8157. *
  8158. * @param Number code Status code
  8159. * @return Boolean
  8160. */
  8161. fetch.isRedirect = function (code) {
  8162. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8163. };
  8164. // expose Promise
  8165. fetch.Promise = global.Promise;
  8166. module.exports = exports = fetch;
  8167. Object.defineProperty(exports, "__esModule", { value: true });
  8168. exports.default = exports;
  8169. exports.Headers = Headers;
  8170. exports.Request = Request;
  8171. exports.Response = Response;
  8172. exports.FetchError = FetchError;
  8173. /***/ }),
  8174. /***/ 462:
  8175. /***/ (function(module) {
  8176. "use strict";
  8177. // See http://www.robvanderwoude.com/escapechars.php
  8178. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8179. function escapeCommand(arg) {
  8180. // Escape meta chars
  8181. arg = arg.replace(metaCharsRegExp, '^$1');
  8182. return arg;
  8183. }
  8184. function escapeArgument(arg, doubleEscapeMetaChars) {
  8185. // Convert to string
  8186. arg = `${arg}`;
  8187. // Algorithm below is based on https://qntm.org/cmd
  8188. // Sequence of backslashes followed by a double quote:
  8189. // double up all the backslashes and escape the double quote
  8190. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8191. // Sequence of backslashes followed by the end of the string
  8192. // (which will become a double quote later):
  8193. // double up all the backslashes
  8194. arg = arg.replace(/(\\*)$/, '$1$1');
  8195. // All other backslashes occur literally
  8196. // Quote the whole thing:
  8197. arg = `"${arg}"`;
  8198. // Escape meta chars
  8199. arg = arg.replace(metaCharsRegExp, '^$1');
  8200. // Double escape meta chars if necessary
  8201. if (doubleEscapeMetaChars) {
  8202. arg = arg.replace(metaCharsRegExp, '^$1');
  8203. }
  8204. return arg;
  8205. }
  8206. module.exports.command = escapeCommand;
  8207. module.exports.argument = escapeArgument;
  8208. /***/ }),
  8209. /***/ 463:
  8210. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8211. "use strict";
  8212. Object.defineProperty(exports, '__esModule', { value: true });
  8213. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8214. var deprecation = __webpack_require__(692);
  8215. var once = _interopDefault(__webpack_require__(969));
  8216. const logOnce = once(deprecation => console.warn(deprecation));
  8217. /**
  8218. * Error with extra properties to help with debugging
  8219. */
  8220. class RequestError extends Error {
  8221. constructor(message, statusCode, options) {
  8222. super(message); // Maintains proper stack trace (only available on V8)
  8223. /* istanbul ignore next */
  8224. if (Error.captureStackTrace) {
  8225. Error.captureStackTrace(this, this.constructor);
  8226. }
  8227. this.name = "HttpError";
  8228. this.status = statusCode;
  8229. Object.defineProperty(this, "code", {
  8230. get() {
  8231. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8232. return statusCode;
  8233. }
  8234. });
  8235. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8236. const requestCopy = Object.assign({}, options.request);
  8237. if (options.request.headers.authorization) {
  8238. requestCopy.headers = Object.assign({}, options.request.headers, {
  8239. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8240. });
  8241. }
  8242. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8243. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8244. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8245. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8246. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8247. this.request = requestCopy;
  8248. }
  8249. }
  8250. exports.RequestError = RequestError;
  8251. //# sourceMappingURL=index.js.map
  8252. /***/ }),
  8253. /***/ 464:
  8254. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8255. "use strict";
  8256. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8257. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8258. return new (P || (P = Promise))(function (resolve, reject) {
  8259. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8260. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8261. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8262. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8263. });
  8264. };
  8265. var __importStar = (this && this.__importStar) || function (mod) {
  8266. if (mod && mod.__esModule) return mod;
  8267. var result = {};
  8268. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8269. result["default"] = mod;
  8270. return result;
  8271. };
  8272. var __importDefault = (this && this.__importDefault) || function (mod) {
  8273. return (mod && mod.__esModule) ? mod : { "default": mod };
  8274. };
  8275. Object.defineProperty(exports, "__esModule", { value: true });
  8276. const assert = __importStar(__webpack_require__(357));
  8277. const core = __importStar(__webpack_require__(470));
  8278. const fs = __importStar(__webpack_require__(747));
  8279. const github = __importStar(__webpack_require__(469));
  8280. const io = __importStar(__webpack_require__(1));
  8281. const path = __importStar(__webpack_require__(622));
  8282. const retryHelper = __importStar(__webpack_require__(587));
  8283. const toolCache = __importStar(__webpack_require__(533));
  8284. const v4_1 = __importDefault(__webpack_require__(826));
  8285. const IS_WINDOWS = process.platform === 'win32';
  8286. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8287. return __awaiter(this, void 0, void 0, function* () {
  8288. // Download the archive
  8289. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8290. core.info('Downloading the archive');
  8291. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8292. }));
  8293. // Write archive to disk
  8294. core.info('Writing archive to disk');
  8295. const uniqueId = v4_1.default();
  8296. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8297. yield fs.promises.writeFile(archivePath, archiveData);
  8298. archiveData = Buffer.from(''); // Free memory
  8299. // Extract archive
  8300. core.info('Extracting the archive');
  8301. const extractPath = path.join(repositoryPath, uniqueId);
  8302. yield io.mkdirP(extractPath);
  8303. if (IS_WINDOWS) {
  8304. yield toolCache.extractZip(archivePath, extractPath);
  8305. }
  8306. else {
  8307. yield toolCache.extractTar(archivePath, extractPath);
  8308. }
  8309. io.rmRF(archivePath);
  8310. // Determine the path of the repository content. The archive contains
  8311. // a top-level folder and the repository content is inside.
  8312. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8313. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8314. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8315. core.info(`Resolved version ${archiveVersion}`);
  8316. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8317. // Move the files
  8318. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8319. const sourcePath = path.join(tempRepositoryPath, fileName);
  8320. const targetPath = path.join(repositoryPath, fileName);
  8321. if (IS_WINDOWS) {
  8322. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8323. }
  8324. else {
  8325. yield io.mv(sourcePath, targetPath);
  8326. }
  8327. }
  8328. io.rmRF(extractPath);
  8329. });
  8330. }
  8331. exports.downloadRepository = downloadRepository;
  8332. /**
  8333. * Looks up the default branch name
  8334. */
  8335. function getDefaultBranch(authToken, owner, repo) {
  8336. return __awaiter(this, void 0, void 0, function* () {
  8337. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8338. core.info('Retrieving the default branch name');
  8339. const octokit = new github.GitHub(authToken);
  8340. const response = yield octokit.repos.get({ owner, repo });
  8341. if (response.status != 200) {
  8342. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8343. }
  8344. // Print the default branch
  8345. let result = response.data.default_branch;
  8346. core.info(`Default branch '${result}'`);
  8347. assert.ok(result, 'default_branch cannot be empty');
  8348. // Prefix with 'refs/heads'
  8349. if (!result.startsWith('refs/')) {
  8350. result = `refs/heads/${result}`;
  8351. }
  8352. return result;
  8353. }));
  8354. });
  8355. }
  8356. exports.getDefaultBranch = getDefaultBranch;
  8357. function downloadArchive(authToken, owner, repo, ref, commit) {
  8358. return __awaiter(this, void 0, void 0, function* () {
  8359. const octokit = new github.GitHub(authToken);
  8360. const params = {
  8361. owner: owner,
  8362. repo: repo,
  8363. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8364. ref: commit || ref
  8365. };
  8366. const response = yield octokit.repos.getArchiveLink(params);
  8367. if (response.status != 200) {
  8368. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8369. }
  8370. return Buffer.from(response.data); // response.data is ArrayBuffer
  8371. });
  8372. }
  8373. /***/ }),
  8374. /***/ 469:
  8375. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8376. "use strict";
  8377. var __importStar = (this && this.__importStar) || function (mod) {
  8378. if (mod && mod.__esModule) return mod;
  8379. var result = {};
  8380. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8381. result["default"] = mod;
  8382. return result;
  8383. };
  8384. Object.defineProperty(exports, "__esModule", { value: true });
  8385. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8386. const graphql_1 = __webpack_require__(898);
  8387. const rest_1 = __webpack_require__(0);
  8388. const Context = __importStar(__webpack_require__(262));
  8389. const httpClient = __importStar(__webpack_require__(539));
  8390. // We need this in order to extend Octokit
  8391. rest_1.Octokit.prototype = new rest_1.Octokit();
  8392. exports.context = new Context.Context();
  8393. class GitHub extends rest_1.Octokit {
  8394. constructor(token, opts) {
  8395. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8396. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8397. }
  8398. /**
  8399. * Disambiguates the constructor overload parameters
  8400. */
  8401. static disambiguate(token, opts) {
  8402. return [
  8403. typeof token === 'string' ? token : '',
  8404. typeof token === 'object' ? token : opts || {}
  8405. ];
  8406. }
  8407. static getOctokitOptions(args) {
  8408. const token = args[0];
  8409. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8410. // Base URL - GHES or Dotcom
  8411. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8412. // Auth
  8413. const auth = GitHub.getAuthString(token, options);
  8414. if (auth) {
  8415. options.auth = auth;
  8416. }
  8417. // Proxy
  8418. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8419. if (agent) {
  8420. // Shallow clone - don't mutate the object provided by the caller
  8421. options.request = options.request ? Object.assign({}, options.request) : {};
  8422. // Set the agent
  8423. options.request.agent = agent;
  8424. }
  8425. return options;
  8426. }
  8427. static getGraphQL(args) {
  8428. const defaults = {};
  8429. defaults.baseUrl = this.getGraphQLBaseUrl();
  8430. const token = args[0];
  8431. const options = args[1];
  8432. // Authorization
  8433. const auth = this.getAuthString(token, options);
  8434. if (auth) {
  8435. defaults.headers = {
  8436. authorization: auth
  8437. };
  8438. }
  8439. // Proxy
  8440. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8441. if (agent) {
  8442. defaults.request = { agent };
  8443. }
  8444. return graphql_1.graphql.defaults(defaults);
  8445. }
  8446. static getAuthString(token, options) {
  8447. // Validate args
  8448. if (!token && !options.auth) {
  8449. throw new Error('Parameter token or opts.auth is required');
  8450. }
  8451. else if (token && options.auth) {
  8452. throw new Error('Parameters token and opts.auth may not both be specified');
  8453. }
  8454. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8455. }
  8456. static getProxyAgent(destinationUrl, options) {
  8457. var _a;
  8458. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8459. if (httpClient.getProxyUrl(destinationUrl)) {
  8460. const hc = new httpClient.HttpClient();
  8461. return hc.getAgent(destinationUrl);
  8462. }
  8463. }
  8464. return undefined;
  8465. }
  8466. static getApiBaseUrl() {
  8467. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8468. }
  8469. static getGraphQLBaseUrl() {
  8470. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8471. // Shouldn't be a trailing slash, but remove if so
  8472. if (url.endsWith('/')) {
  8473. url = url.substr(0, url.length - 1);
  8474. }
  8475. // Remove trailing "/graphql"
  8476. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8477. url = url.substr(0, url.length - '/graphql'.length);
  8478. }
  8479. return url;
  8480. }
  8481. }
  8482. exports.GitHub = GitHub;
  8483. //# sourceMappingURL=github.js.map
  8484. /***/ }),
  8485. /***/ 470:
  8486. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8487. "use strict";
  8488. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8489. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8490. return new (P || (P = Promise))(function (resolve, reject) {
  8491. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8492. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8493. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8494. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8495. });
  8496. };
  8497. Object.defineProperty(exports, "__esModule", { value: true });
  8498. const command_1 = __webpack_require__(431);
  8499. const os = __webpack_require__(87);
  8500. const path = __webpack_require__(622);
  8501. /**
  8502. * The code to exit an action
  8503. */
  8504. var ExitCode;
  8505. (function (ExitCode) {
  8506. /**
  8507. * A code indicating that the action was successful
  8508. */
  8509. ExitCode[ExitCode["Success"] = 0] = "Success";
  8510. /**
  8511. * A code indicating that the action was a failure
  8512. */
  8513. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8514. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8515. //-----------------------------------------------------------------------
  8516. // Variables
  8517. //-----------------------------------------------------------------------
  8518. /**
  8519. * Sets env variable for this action and future actions in the job
  8520. * @param name the name of the variable to set
  8521. * @param val the value of the variable
  8522. */
  8523. function exportVariable(name, val) {
  8524. process.env[name] = val;
  8525. command_1.issueCommand('set-env', { name }, val);
  8526. }
  8527. exports.exportVariable = exportVariable;
  8528. /**
  8529. * Registers a secret which will get masked from logs
  8530. * @param secret value of the secret
  8531. */
  8532. function setSecret(secret) {
  8533. command_1.issueCommand('add-mask', {}, secret);
  8534. }
  8535. exports.setSecret = setSecret;
  8536. /**
  8537. * Prepends inputPath to the PATH (for this action and future actions)
  8538. * @param inputPath
  8539. */
  8540. function addPath(inputPath) {
  8541. command_1.issueCommand('add-path', {}, inputPath);
  8542. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8543. }
  8544. exports.addPath = addPath;
  8545. /**
  8546. * Gets the value of an input. The value is also trimmed.
  8547. *
  8548. * @param name name of the input to get
  8549. * @param options optional. See InputOptions.
  8550. * @returns string
  8551. */
  8552. function getInput(name, options) {
  8553. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8554. if (options && options.required && !val) {
  8555. throw new Error(`Input required and not supplied: ${name}`);
  8556. }
  8557. return val.trim();
  8558. }
  8559. exports.getInput = getInput;
  8560. /**
  8561. * Sets the value of an output.
  8562. *
  8563. * @param name name of the output to set
  8564. * @param value value to store
  8565. */
  8566. function setOutput(name, value) {
  8567. command_1.issueCommand('set-output', { name }, value);
  8568. }
  8569. exports.setOutput = setOutput;
  8570. //-----------------------------------------------------------------------
  8571. // Results
  8572. //-----------------------------------------------------------------------
  8573. /**
  8574. * Sets the action status to failed.
  8575. * When the action exits it will be with an exit code of 1
  8576. * @param message add error issue message
  8577. */
  8578. function setFailed(message) {
  8579. process.exitCode = ExitCode.Failure;
  8580. error(message);
  8581. }
  8582. exports.setFailed = setFailed;
  8583. //-----------------------------------------------------------------------
  8584. // Logging Commands
  8585. //-----------------------------------------------------------------------
  8586. /**
  8587. * Writes debug message to user log
  8588. * @param message debug message
  8589. */
  8590. function debug(message) {
  8591. command_1.issueCommand('debug', {}, message);
  8592. }
  8593. exports.debug = debug;
  8594. /**
  8595. * Adds an error issue
  8596. * @param message error issue message
  8597. */
  8598. function error(message) {
  8599. command_1.issue('error', message);
  8600. }
  8601. exports.error = error;
  8602. /**
  8603. * Adds an warning issue
  8604. * @param message warning issue message
  8605. */
  8606. function warning(message) {
  8607. command_1.issue('warning', message);
  8608. }
  8609. exports.warning = warning;
  8610. /**
  8611. * Writes info to log with console.log.
  8612. * @param message info message
  8613. */
  8614. function info(message) {
  8615. process.stdout.write(message + os.EOL);
  8616. }
  8617. exports.info = info;
  8618. /**
  8619. * Begin an output group.
  8620. *
  8621. * Output until the next `groupEnd` will be foldable in this group
  8622. *
  8623. * @param name The name of the output group
  8624. */
  8625. function startGroup(name) {
  8626. command_1.issue('group', name);
  8627. }
  8628. exports.startGroup = startGroup;
  8629. /**
  8630. * End an output group.
  8631. */
  8632. function endGroup() {
  8633. command_1.issue('endgroup');
  8634. }
  8635. exports.endGroup = endGroup;
  8636. /**
  8637. * Wrap an asynchronous function call in a group.
  8638. *
  8639. * Returns the same type as the function itself.
  8640. *
  8641. * @param name The name of the group
  8642. * @param fn The function to wrap in the group
  8643. */
  8644. function group(name, fn) {
  8645. return __awaiter(this, void 0, void 0, function* () {
  8646. startGroup(name);
  8647. let result;
  8648. try {
  8649. result = yield fn();
  8650. }
  8651. finally {
  8652. endGroup();
  8653. }
  8654. return result;
  8655. });
  8656. }
  8657. exports.group = group;
  8658. //# sourceMappingURL=core.js.map
  8659. /***/ }),
  8660. /***/ 471:
  8661. /***/ (function(module, __unusedexports, __webpack_require__) {
  8662. module.exports = authenticationBeforeRequest;
  8663. const btoa = __webpack_require__(675);
  8664. const uniq = __webpack_require__(126);
  8665. function authenticationBeforeRequest(state, options) {
  8666. if (!state.auth.type) {
  8667. return;
  8668. }
  8669. if (state.auth.type === "basic") {
  8670. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8671. options.headers.authorization = `Basic ${hash}`;
  8672. return;
  8673. }
  8674. if (state.auth.type === "token") {
  8675. options.headers.authorization = `token ${state.auth.token}`;
  8676. return;
  8677. }
  8678. if (state.auth.type === "app") {
  8679. options.headers.authorization = `Bearer ${state.auth.token}`;
  8680. const acceptHeaders = options.headers.accept
  8681. .split(",")
  8682. .concat("application/vnd.github.machine-man-preview+json");
  8683. options.headers.accept = uniq(acceptHeaders)
  8684. .filter(Boolean)
  8685. .join(",");
  8686. return;
  8687. }
  8688. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8689. if (state.auth.token) {
  8690. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8691. return;
  8692. }
  8693. const key = encodeURIComponent(state.auth.key);
  8694. const secret = encodeURIComponent(state.auth.secret);
  8695. options.url += `client_id=${key}&client_secret=${secret}`;
  8696. }
  8697. /***/ }),
  8698. /***/ 489:
  8699. /***/ (function(module, __unusedexports, __webpack_require__) {
  8700. "use strict";
  8701. const path = __webpack_require__(622);
  8702. const which = __webpack_require__(814);
  8703. const pathKey = __webpack_require__(39)();
  8704. function resolveCommandAttempt(parsed, withoutPathExt) {
  8705. const cwd = process.cwd();
  8706. const hasCustomCwd = parsed.options.cwd != null;
  8707. // If a custom `cwd` was specified, we need to change the process cwd
  8708. // because `which` will do stat calls but does not support a custom cwd
  8709. if (hasCustomCwd) {
  8710. try {
  8711. process.chdir(parsed.options.cwd);
  8712. } catch (err) {
  8713. /* Empty */
  8714. }
  8715. }
  8716. let resolved;
  8717. try {
  8718. resolved = which.sync(parsed.command, {
  8719. path: (parsed.options.env || process.env)[pathKey],
  8720. pathExt: withoutPathExt ? path.delimiter : undefined,
  8721. });
  8722. } catch (e) {
  8723. /* Empty */
  8724. } finally {
  8725. process.chdir(cwd);
  8726. }
  8727. // If we successfully resolved, ensure that an absolute path is returned
  8728. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8729. if (resolved) {
  8730. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8731. }
  8732. return resolved;
  8733. }
  8734. function resolveCommand(parsed) {
  8735. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8736. }
  8737. module.exports = resolveCommand;
  8738. /***/ }),
  8739. /***/ 497:
  8740. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8741. "use strict";
  8742. Object.defineProperty(exports, '__esModule', { value: true });
  8743. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8744. var deprecation = __webpack_require__(692);
  8745. var once = _interopDefault(__webpack_require__(969));
  8746. const logOnce = once(deprecation => console.warn(deprecation));
  8747. /**
  8748. * Error with extra properties to help with debugging
  8749. */
  8750. class RequestError extends Error {
  8751. constructor(message, statusCode, options) {
  8752. super(message); // Maintains proper stack trace (only available on V8)
  8753. /* istanbul ignore next */
  8754. if (Error.captureStackTrace) {
  8755. Error.captureStackTrace(this, this.constructor);
  8756. }
  8757. this.name = "HttpError";
  8758. this.status = statusCode;
  8759. Object.defineProperty(this, "code", {
  8760. get() {
  8761. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8762. return statusCode;
  8763. }
  8764. });
  8765. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8766. const requestCopy = Object.assign({}, options.request);
  8767. if (options.request.headers.authorization) {
  8768. requestCopy.headers = Object.assign({}, options.request.headers, {
  8769. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8770. });
  8771. }
  8772. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8773. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8774. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8775. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8776. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8777. this.request = requestCopy;
  8778. }
  8779. }
  8780. exports.RequestError = RequestError;
  8781. //# sourceMappingURL=index.js.map
  8782. /***/ }),
  8783. /***/ 510:
  8784. /***/ (function(module) {
  8785. module.exports = addHook
  8786. function addHook (state, kind, name, hook) {
  8787. var orig = hook
  8788. if (!state.registry[name]) {
  8789. state.registry[name] = []
  8790. }
  8791. if (kind === 'before') {
  8792. hook = function (method, options) {
  8793. return Promise.resolve()
  8794. .then(orig.bind(null, options))
  8795. .then(method.bind(null, options))
  8796. }
  8797. }
  8798. if (kind === 'after') {
  8799. hook = function (method, options) {
  8800. var result
  8801. return Promise.resolve()
  8802. .then(method.bind(null, options))
  8803. .then(function (result_) {
  8804. result = result_
  8805. return orig(result, options)
  8806. })
  8807. .then(function () {
  8808. return result
  8809. })
  8810. }
  8811. }
  8812. if (kind === 'error') {
  8813. hook = function (method, options) {
  8814. return Promise.resolve()
  8815. .then(method.bind(null, options))
  8816. .catch(function (error) {
  8817. return orig(error, options)
  8818. })
  8819. }
  8820. }
  8821. state.registry[name].push({
  8822. hook: hook,
  8823. orig: orig
  8824. })
  8825. }
  8826. /***/ }),
  8827. /***/ 523:
  8828. /***/ (function(module, __unusedexports, __webpack_require__) {
  8829. var register = __webpack_require__(363)
  8830. var addHook = __webpack_require__(510)
  8831. var removeHook = __webpack_require__(763)
  8832. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8833. var bind = Function.bind
  8834. var bindable = bind.bind(bind)
  8835. function bindApi (hook, state, name) {
  8836. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8837. hook.api = { remove: removeHookRef }
  8838. hook.remove = removeHookRef
  8839. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8840. var args = name ? [state, kind, name] : [state, kind]
  8841. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8842. })
  8843. }
  8844. function HookSingular () {
  8845. var singularHookName = 'h'
  8846. var singularHookState = {
  8847. registry: {}
  8848. }
  8849. var singularHook = register.bind(null, singularHookState, singularHookName)
  8850. bindApi(singularHook, singularHookState, singularHookName)
  8851. return singularHook
  8852. }
  8853. function HookCollection () {
  8854. var state = {
  8855. registry: {}
  8856. }
  8857. var hook = register.bind(null, state)
  8858. bindApi(hook, state)
  8859. return hook
  8860. }
  8861. var collectionHookDeprecationMessageDisplayed = false
  8862. function Hook () {
  8863. if (!collectionHookDeprecationMessageDisplayed) {
  8864. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8865. collectionHookDeprecationMessageDisplayed = true
  8866. }
  8867. return HookCollection()
  8868. }
  8869. Hook.Singular = HookSingular.bind()
  8870. Hook.Collection = HookCollection.bind()
  8871. module.exports = Hook
  8872. // expose constructors as a named property for TypeScript
  8873. module.exports.Hook = Hook
  8874. module.exports.Singular = Hook.Singular
  8875. module.exports.Collection = Hook.Collection
  8876. /***/ }),
  8877. /***/ 528:
  8878. /***/ (function(__unusedmodule, exports) {
  8879. "use strict";
  8880. Object.defineProperty(exports, "__esModule", { value: true });
  8881. function escape(value) {
  8882. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8883. return `\\${x}`;
  8884. });
  8885. }
  8886. exports.escape = escape;
  8887. /***/ }),
  8888. /***/ 529:
  8889. /***/ (function(module, __unusedexports, __webpack_require__) {
  8890. const factory = __webpack_require__(47);
  8891. module.exports = factory();
  8892. /***/ }),
  8893. /***/ 533:
  8894. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8895. "use strict";
  8896. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8897. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8898. return new (P || (P = Promise))(function (resolve, reject) {
  8899. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8900. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8901. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8902. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8903. });
  8904. };
  8905. Object.defineProperty(exports, "__esModule", { value: true });
  8906. const core = __webpack_require__(470);
  8907. const io = __webpack_require__(1);
  8908. const fs = __webpack_require__(747);
  8909. const os = __webpack_require__(87);
  8910. const path = __webpack_require__(622);
  8911. const httpm = __webpack_require__(874);
  8912. const semver = __webpack_require__(656);
  8913. const uuidV4 = __webpack_require__(826);
  8914. const exec_1 = __webpack_require__(986);
  8915. const assert_1 = __webpack_require__(357);
  8916. class HTTPError extends Error {
  8917. constructor(httpStatusCode) {
  8918. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8919. this.httpStatusCode = httpStatusCode;
  8920. Object.setPrototypeOf(this, new.target.prototype);
  8921. }
  8922. }
  8923. exports.HTTPError = HTTPError;
  8924. const IS_WINDOWS = process.platform === 'win32';
  8925. const userAgent = 'actions/tool-cache';
  8926. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8927. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8928. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8929. // If directories not found, place them in common temp locations
  8930. if (!tempDirectory || !cacheRoot) {
  8931. let baseLocation;
  8932. if (IS_WINDOWS) {
  8933. // On windows use the USERPROFILE env variable
  8934. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8935. }
  8936. else {
  8937. if (process.platform === 'darwin') {
  8938. baseLocation = '/Users';
  8939. }
  8940. else {
  8941. baseLocation = '/home';
  8942. }
  8943. }
  8944. if (!tempDirectory) {
  8945. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8946. }
  8947. if (!cacheRoot) {
  8948. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8949. }
  8950. }
  8951. /**
  8952. * Download a tool from an url and stream it into a file
  8953. *
  8954. * @param url url of tool to download
  8955. * @returns path to downloaded tool
  8956. */
  8957. function downloadTool(url) {
  8958. return __awaiter(this, void 0, void 0, function* () {
  8959. // Wrap in a promise so that we can resolve from within stream callbacks
  8960. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8961. try {
  8962. const http = new httpm.HttpClient(userAgent, [], {
  8963. allowRetries: true,
  8964. maxRetries: 3
  8965. });
  8966. const destPath = path.join(tempDirectory, uuidV4());
  8967. yield io.mkdirP(tempDirectory);
  8968. core.debug(`Downloading ${url}`);
  8969. core.debug(`Downloading ${destPath}`);
  8970. if (fs.existsSync(destPath)) {
  8971. throw new Error(`Destination file path ${destPath} already exists`);
  8972. }
  8973. const response = yield http.get(url);
  8974. if (response.message.statusCode !== 200) {
  8975. const err = new HTTPError(response.message.statusCode);
  8976. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8977. throw err;
  8978. }
  8979. const file = fs.createWriteStream(destPath);
  8980. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8981. try {
  8982. const stream = response.message.pipe(file);
  8983. stream.on('close', () => {
  8984. core.debug('download complete');
  8985. resolve(destPath);
  8986. });
  8987. }
  8988. catch (err) {
  8989. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8990. reject(err);
  8991. }
  8992. }));
  8993. file.on('error', err => {
  8994. file.end();
  8995. reject(err);
  8996. });
  8997. }
  8998. catch (err) {
  8999. reject(err);
  9000. }
  9001. }));
  9002. });
  9003. }
  9004. exports.downloadTool = downloadTool;
  9005. /**
  9006. * Extract a .7z file
  9007. *
  9008. * @param file path to the .7z file
  9009. * @param dest destination directory. Optional.
  9010. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9011. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9012. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9013. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9014. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9015. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9016. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9017. * to 7zr.exe can be pass to this function.
  9018. * @returns path to the destination directory
  9019. */
  9020. function extract7z(file, dest, _7zPath) {
  9021. return __awaiter(this, void 0, void 0, function* () {
  9022. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9023. assert_1.ok(file, 'parameter "file" is required');
  9024. dest = dest || (yield _createExtractFolder(dest));
  9025. const originalCwd = process.cwd();
  9026. process.chdir(dest);
  9027. if (_7zPath) {
  9028. try {
  9029. const args = [
  9030. 'x',
  9031. '-bb1',
  9032. '-bd',
  9033. '-sccUTF-8',
  9034. file
  9035. ];
  9036. const options = {
  9037. silent: true
  9038. };
  9039. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9040. }
  9041. finally {
  9042. process.chdir(originalCwd);
  9043. }
  9044. }
  9045. else {
  9046. const escapedScript = path
  9047. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9048. .replace(/'/g, "''")
  9049. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9050. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9051. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9052. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9053. const args = [
  9054. '-NoLogo',
  9055. '-Sta',
  9056. '-NoProfile',
  9057. '-NonInteractive',
  9058. '-ExecutionPolicy',
  9059. 'Unrestricted',
  9060. '-Command',
  9061. command
  9062. ];
  9063. const options = {
  9064. silent: true
  9065. };
  9066. try {
  9067. const powershellPath = yield io.which('powershell', true);
  9068. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9069. }
  9070. finally {
  9071. process.chdir(originalCwd);
  9072. }
  9073. }
  9074. return dest;
  9075. });
  9076. }
  9077. exports.extract7z = extract7z;
  9078. /**
  9079. * Extract a tar
  9080. *
  9081. * @param file path to the tar
  9082. * @param dest destination directory. Optional.
  9083. * @param flags flags for the tar. Optional.
  9084. * @returns path to the destination directory
  9085. */
  9086. function extractTar(file, dest, flags = 'xz') {
  9087. return __awaiter(this, void 0, void 0, function* () {
  9088. if (!file) {
  9089. throw new Error("parameter 'file' is required");
  9090. }
  9091. dest = dest || (yield _createExtractFolder(dest));
  9092. const tarPath = yield io.which('tar', true);
  9093. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9094. return dest;
  9095. });
  9096. }
  9097. exports.extractTar = extractTar;
  9098. /**
  9099. * Extract a zip
  9100. *
  9101. * @param file path to the zip
  9102. * @param dest destination directory. Optional.
  9103. * @returns path to the destination directory
  9104. */
  9105. function extractZip(file, dest) {
  9106. return __awaiter(this, void 0, void 0, function* () {
  9107. if (!file) {
  9108. throw new Error("parameter 'file' is required");
  9109. }
  9110. dest = dest || (yield _createExtractFolder(dest));
  9111. if (IS_WINDOWS) {
  9112. yield extractZipWin(file, dest);
  9113. }
  9114. else {
  9115. yield extractZipNix(file, dest);
  9116. }
  9117. return dest;
  9118. });
  9119. }
  9120. exports.extractZip = extractZip;
  9121. function extractZipWin(file, dest) {
  9122. return __awaiter(this, void 0, void 0, function* () {
  9123. // build the powershell command
  9124. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9125. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9126. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9127. // run powershell
  9128. const powershellPath = yield io.which('powershell');
  9129. const args = [
  9130. '-NoLogo',
  9131. '-Sta',
  9132. '-NoProfile',
  9133. '-NonInteractive',
  9134. '-ExecutionPolicy',
  9135. 'Unrestricted',
  9136. '-Command',
  9137. command
  9138. ];
  9139. yield exec_1.exec(`"${powershellPath}"`, args);
  9140. });
  9141. }
  9142. function extractZipNix(file, dest) {
  9143. return __awaiter(this, void 0, void 0, function* () {
  9144. const unzipPath = yield io.which('unzip');
  9145. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9146. });
  9147. }
  9148. /**
  9149. * Caches a directory and installs it into the tool cacheDir
  9150. *
  9151. * @param sourceDir the directory to cache into tools
  9152. * @param tool tool name
  9153. * @param version version of the tool. semver format
  9154. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9155. */
  9156. function cacheDir(sourceDir, tool, version, arch) {
  9157. return __awaiter(this, void 0, void 0, function* () {
  9158. version = semver.clean(version) || version;
  9159. arch = arch || os.arch();
  9160. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9161. core.debug(`source dir: ${sourceDir}`);
  9162. if (!fs.statSync(sourceDir).isDirectory()) {
  9163. throw new Error('sourceDir is not a directory');
  9164. }
  9165. // Create the tool dir
  9166. const destPath = yield _createToolPath(tool, version, arch);
  9167. // copy each child item. do not move. move can fail on Windows
  9168. // due to anti-virus software having an open handle on a file.
  9169. for (const itemName of fs.readdirSync(sourceDir)) {
  9170. const s = path.join(sourceDir, itemName);
  9171. yield io.cp(s, destPath, { recursive: true });
  9172. }
  9173. // write .complete
  9174. _completeToolPath(tool, version, arch);
  9175. return destPath;
  9176. });
  9177. }
  9178. exports.cacheDir = cacheDir;
  9179. /**
  9180. * Caches a downloaded file (GUID) and installs it
  9181. * into the tool cache with a given targetName
  9182. *
  9183. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9184. * @param targetFile the name of the file name in the tools directory
  9185. * @param tool tool name
  9186. * @param version version of the tool. semver format
  9187. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9188. */
  9189. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9190. return __awaiter(this, void 0, void 0, function* () {
  9191. version = semver.clean(version) || version;
  9192. arch = arch || os.arch();
  9193. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9194. core.debug(`source file: ${sourceFile}`);
  9195. if (!fs.statSync(sourceFile).isFile()) {
  9196. throw new Error('sourceFile is not a file');
  9197. }
  9198. // create the tool dir
  9199. const destFolder = yield _createToolPath(tool, version, arch);
  9200. // copy instead of move. move can fail on Windows due to
  9201. // anti-virus software having an open handle on a file.
  9202. const destPath = path.join(destFolder, targetFile);
  9203. core.debug(`destination file ${destPath}`);
  9204. yield io.cp(sourceFile, destPath);
  9205. // write .complete
  9206. _completeToolPath(tool, version, arch);
  9207. return destFolder;
  9208. });
  9209. }
  9210. exports.cacheFile = cacheFile;
  9211. /**
  9212. * Finds the path to a tool version in the local installed tool cache
  9213. *
  9214. * @param toolName name of the tool
  9215. * @param versionSpec version of the tool
  9216. * @param arch optional arch. defaults to arch of computer
  9217. */
  9218. function find(toolName, versionSpec, arch) {
  9219. if (!toolName) {
  9220. throw new Error('toolName parameter is required');
  9221. }
  9222. if (!versionSpec) {
  9223. throw new Error('versionSpec parameter is required');
  9224. }
  9225. arch = arch || os.arch();
  9226. // attempt to resolve an explicit version
  9227. if (!_isExplicitVersion(versionSpec)) {
  9228. const localVersions = findAllVersions(toolName, arch);
  9229. const match = _evaluateVersions(localVersions, versionSpec);
  9230. versionSpec = match;
  9231. }
  9232. // check for the explicit version in the cache
  9233. let toolPath = '';
  9234. if (versionSpec) {
  9235. versionSpec = semver.clean(versionSpec) || '';
  9236. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9237. core.debug(`checking cache: ${cachePath}`);
  9238. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9239. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9240. toolPath = cachePath;
  9241. }
  9242. else {
  9243. core.debug('not found');
  9244. }
  9245. }
  9246. return toolPath;
  9247. }
  9248. exports.find = find;
  9249. /**
  9250. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9251. *
  9252. * @param toolName name of the tool
  9253. * @param arch optional arch. defaults to arch of computer
  9254. */
  9255. function findAllVersions(toolName, arch) {
  9256. const versions = [];
  9257. arch = arch || os.arch();
  9258. const toolPath = path.join(cacheRoot, toolName);
  9259. if (fs.existsSync(toolPath)) {
  9260. const children = fs.readdirSync(toolPath);
  9261. for (const child of children) {
  9262. if (_isExplicitVersion(child)) {
  9263. const fullPath = path.join(toolPath, child, arch || '');
  9264. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9265. versions.push(child);
  9266. }
  9267. }
  9268. }
  9269. }
  9270. return versions;
  9271. }
  9272. exports.findAllVersions = findAllVersions;
  9273. function _createExtractFolder(dest) {
  9274. return __awaiter(this, void 0, void 0, function* () {
  9275. if (!dest) {
  9276. // create a temp dir
  9277. dest = path.join(tempDirectory, uuidV4());
  9278. }
  9279. yield io.mkdirP(dest);
  9280. return dest;
  9281. });
  9282. }
  9283. function _createToolPath(tool, version, arch) {
  9284. return __awaiter(this, void 0, void 0, function* () {
  9285. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9286. core.debug(`destination ${folderPath}`);
  9287. const markerPath = `${folderPath}.complete`;
  9288. yield io.rmRF(folderPath);
  9289. yield io.rmRF(markerPath);
  9290. yield io.mkdirP(folderPath);
  9291. return folderPath;
  9292. });
  9293. }
  9294. function _completeToolPath(tool, version, arch) {
  9295. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9296. const markerPath = `${folderPath}.complete`;
  9297. fs.writeFileSync(markerPath, '');
  9298. core.debug('finished caching tool');
  9299. }
  9300. function _isExplicitVersion(versionSpec) {
  9301. const c = semver.clean(versionSpec) || '';
  9302. core.debug(`isExplicit: ${c}`);
  9303. const valid = semver.valid(c) != null;
  9304. core.debug(`explicit? ${valid}`);
  9305. return valid;
  9306. }
  9307. function _evaluateVersions(versions, versionSpec) {
  9308. let version = '';
  9309. core.debug(`evaluating ${versions.length} versions`);
  9310. versions = versions.sort((a, b) => {
  9311. if (semver.gt(a, b)) {
  9312. return 1;
  9313. }
  9314. return -1;
  9315. });
  9316. for (let i = versions.length - 1; i >= 0; i--) {
  9317. const potential = versions[i];
  9318. const satisfied = semver.satisfies(potential, versionSpec);
  9319. if (satisfied) {
  9320. version = potential;
  9321. break;
  9322. }
  9323. }
  9324. if (version) {
  9325. core.debug(`matched: ${version}`);
  9326. }
  9327. else {
  9328. core.debug('match not found');
  9329. }
  9330. return version;
  9331. }
  9332. //# sourceMappingURL=tool-cache.js.map
  9333. /***/ }),
  9334. /***/ 536:
  9335. /***/ (function(module, __unusedexports, __webpack_require__) {
  9336. module.exports = hasFirstPage
  9337. const deprecate = __webpack_require__(370)
  9338. const getPageLinks = __webpack_require__(577)
  9339. function hasFirstPage (link) {
  9340. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9341. return getPageLinks(link).first
  9342. }
  9343. /***/ }),
  9344. /***/ 539:
  9345. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9346. "use strict";
  9347. Object.defineProperty(exports, "__esModule", { value: true });
  9348. const url = __webpack_require__(835);
  9349. const http = __webpack_require__(605);
  9350. const https = __webpack_require__(34);
  9351. const pm = __webpack_require__(950);
  9352. let tunnel;
  9353. var HttpCodes;
  9354. (function (HttpCodes) {
  9355. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9356. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9357. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9358. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9359. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9360. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9361. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9362. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9363. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9364. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9365. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9366. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9367. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9368. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9369. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9370. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9371. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9372. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9373. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9374. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9375. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9376. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9377. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9378. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9379. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9380. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9381. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9382. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9383. var Headers;
  9384. (function (Headers) {
  9385. Headers["Accept"] = "accept";
  9386. Headers["ContentType"] = "content-type";
  9387. })(Headers = exports.Headers || (exports.Headers = {}));
  9388. var MediaTypes;
  9389. (function (MediaTypes) {
  9390. MediaTypes["ApplicationJson"] = "application/json";
  9391. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9392. /**
  9393. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9394. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9395. */
  9396. function getProxyUrl(serverUrl) {
  9397. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9398. return proxyUrl ? proxyUrl.href : '';
  9399. }
  9400. exports.getProxyUrl = getProxyUrl;
  9401. const HttpRedirectCodes = [
  9402. HttpCodes.MovedPermanently,
  9403. HttpCodes.ResourceMoved,
  9404. HttpCodes.SeeOther,
  9405. HttpCodes.TemporaryRedirect,
  9406. HttpCodes.PermanentRedirect
  9407. ];
  9408. const HttpResponseRetryCodes = [
  9409. HttpCodes.BadGateway,
  9410. HttpCodes.ServiceUnavailable,
  9411. HttpCodes.GatewayTimeout
  9412. ];
  9413. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9414. const ExponentialBackoffCeiling = 10;
  9415. const ExponentialBackoffTimeSlice = 5;
  9416. class HttpClientResponse {
  9417. constructor(message) {
  9418. this.message = message;
  9419. }
  9420. readBody() {
  9421. return new Promise(async (resolve, reject) => {
  9422. let output = Buffer.alloc(0);
  9423. this.message.on('data', (chunk) => {
  9424. output = Buffer.concat([output, chunk]);
  9425. });
  9426. this.message.on('end', () => {
  9427. resolve(output.toString());
  9428. });
  9429. });
  9430. }
  9431. }
  9432. exports.HttpClientResponse = HttpClientResponse;
  9433. function isHttps(requestUrl) {
  9434. let parsedUrl = url.parse(requestUrl);
  9435. return parsedUrl.protocol === 'https:';
  9436. }
  9437. exports.isHttps = isHttps;
  9438. class HttpClient {
  9439. constructor(userAgent, handlers, requestOptions) {
  9440. this._ignoreSslError = false;
  9441. this._allowRedirects = true;
  9442. this._allowRedirectDowngrade = false;
  9443. this._maxRedirects = 50;
  9444. this._allowRetries = false;
  9445. this._maxRetries = 1;
  9446. this._keepAlive = false;
  9447. this._disposed = false;
  9448. this.userAgent = userAgent;
  9449. this.handlers = handlers || [];
  9450. this.requestOptions = requestOptions;
  9451. if (requestOptions) {
  9452. if (requestOptions.ignoreSslError != null) {
  9453. this._ignoreSslError = requestOptions.ignoreSslError;
  9454. }
  9455. this._socketTimeout = requestOptions.socketTimeout;
  9456. if (requestOptions.allowRedirects != null) {
  9457. this._allowRedirects = requestOptions.allowRedirects;
  9458. }
  9459. if (requestOptions.allowRedirectDowngrade != null) {
  9460. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9461. }
  9462. if (requestOptions.maxRedirects != null) {
  9463. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9464. }
  9465. if (requestOptions.keepAlive != null) {
  9466. this._keepAlive = requestOptions.keepAlive;
  9467. }
  9468. if (requestOptions.allowRetries != null) {
  9469. this._allowRetries = requestOptions.allowRetries;
  9470. }
  9471. if (requestOptions.maxRetries != null) {
  9472. this._maxRetries = requestOptions.maxRetries;
  9473. }
  9474. }
  9475. }
  9476. options(requestUrl, additionalHeaders) {
  9477. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9478. }
  9479. get(requestUrl, additionalHeaders) {
  9480. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9481. }
  9482. del(requestUrl, additionalHeaders) {
  9483. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9484. }
  9485. post(requestUrl, data, additionalHeaders) {
  9486. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9487. }
  9488. patch(requestUrl, data, additionalHeaders) {
  9489. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9490. }
  9491. put(requestUrl, data, additionalHeaders) {
  9492. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9493. }
  9494. head(requestUrl, additionalHeaders) {
  9495. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9496. }
  9497. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9498. return this.request(verb, requestUrl, stream, additionalHeaders);
  9499. }
  9500. /**
  9501. * Gets a typed object from an endpoint
  9502. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9503. */
  9504. async getJson(requestUrl, additionalHeaders = {}) {
  9505. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9506. let res = await this.get(requestUrl, additionalHeaders);
  9507. return this._processResponse(res, this.requestOptions);
  9508. }
  9509. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9510. let data = JSON.stringify(obj, null, 2);
  9511. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9512. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9513. let res = await this.post(requestUrl, data, additionalHeaders);
  9514. return this._processResponse(res, this.requestOptions);
  9515. }
  9516. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9517. let data = JSON.stringify(obj, null, 2);
  9518. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9519. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9520. let res = await this.put(requestUrl, data, additionalHeaders);
  9521. return this._processResponse(res, this.requestOptions);
  9522. }
  9523. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9524. let data = JSON.stringify(obj, null, 2);
  9525. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9526. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9527. let res = await this.patch(requestUrl, data, additionalHeaders);
  9528. return this._processResponse(res, this.requestOptions);
  9529. }
  9530. /**
  9531. * Makes a raw http request.
  9532. * All other methods such as get, post, patch, and request ultimately call this.
  9533. * Prefer get, del, post and patch
  9534. */
  9535. async request(verb, requestUrl, data, headers) {
  9536. if (this._disposed) {
  9537. throw new Error('Client has already been disposed.');
  9538. }
  9539. let parsedUrl = url.parse(requestUrl);
  9540. let info = this._prepareRequest(verb, parsedUrl, headers);
  9541. // Only perform retries on reads since writes may not be idempotent.
  9542. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9543. ? this._maxRetries + 1
  9544. : 1;
  9545. let numTries = 0;
  9546. let response;
  9547. while (numTries < maxTries) {
  9548. response = await this.requestRaw(info, data);
  9549. // Check if it's an authentication challenge
  9550. if (response &&
  9551. response.message &&
  9552. response.message.statusCode === HttpCodes.Unauthorized) {
  9553. let authenticationHandler;
  9554. for (let i = 0; i < this.handlers.length; i++) {
  9555. if (this.handlers[i].canHandleAuthentication(response)) {
  9556. authenticationHandler = this.handlers[i];
  9557. break;
  9558. }
  9559. }
  9560. if (authenticationHandler) {
  9561. return authenticationHandler.handleAuthentication(this, info, data);
  9562. }
  9563. else {
  9564. // We have received an unauthorized response but have no handlers to handle it.
  9565. // Let the response return to the caller.
  9566. return response;
  9567. }
  9568. }
  9569. let redirectsRemaining = this._maxRedirects;
  9570. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9571. this._allowRedirects &&
  9572. redirectsRemaining > 0) {
  9573. const redirectUrl = response.message.headers['location'];
  9574. if (!redirectUrl) {
  9575. // if there's no location to redirect to, we won't
  9576. break;
  9577. }
  9578. let parsedRedirectUrl = url.parse(redirectUrl);
  9579. if (parsedUrl.protocol == 'https:' &&
  9580. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9581. !this._allowRedirectDowngrade) {
  9582. 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.');
  9583. }
  9584. // we need to finish reading the response before reassigning response
  9585. // which will leak the open socket.
  9586. await response.readBody();
  9587. // strip authorization header if redirected to a different hostname
  9588. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9589. for (let header in headers) {
  9590. // header names are case insensitive
  9591. if (header.toLowerCase() === 'authorization') {
  9592. delete headers[header];
  9593. }
  9594. }
  9595. }
  9596. // let's make the request with the new redirectUrl
  9597. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9598. response = await this.requestRaw(info, data);
  9599. redirectsRemaining--;
  9600. }
  9601. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9602. // If not a retry code, return immediately instead of retrying
  9603. return response;
  9604. }
  9605. numTries += 1;
  9606. if (numTries < maxTries) {
  9607. await response.readBody();
  9608. await this._performExponentialBackoff(numTries);
  9609. }
  9610. }
  9611. return response;
  9612. }
  9613. /**
  9614. * Needs to be called if keepAlive is set to true in request options.
  9615. */
  9616. dispose() {
  9617. if (this._agent) {
  9618. this._agent.destroy();
  9619. }
  9620. this._disposed = true;
  9621. }
  9622. /**
  9623. * Raw request.
  9624. * @param info
  9625. * @param data
  9626. */
  9627. requestRaw(info, data) {
  9628. return new Promise((resolve, reject) => {
  9629. let callbackForResult = function (err, res) {
  9630. if (err) {
  9631. reject(err);
  9632. }
  9633. resolve(res);
  9634. };
  9635. this.requestRawWithCallback(info, data, callbackForResult);
  9636. });
  9637. }
  9638. /**
  9639. * Raw request with callback.
  9640. * @param info
  9641. * @param data
  9642. * @param onResult
  9643. */
  9644. requestRawWithCallback(info, data, onResult) {
  9645. let socket;
  9646. if (typeof data === 'string') {
  9647. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9648. }
  9649. let callbackCalled = false;
  9650. let handleResult = (err, res) => {
  9651. if (!callbackCalled) {
  9652. callbackCalled = true;
  9653. onResult(err, res);
  9654. }
  9655. };
  9656. let req = info.httpModule.request(info.options, (msg) => {
  9657. let res = new HttpClientResponse(msg);
  9658. handleResult(null, res);
  9659. });
  9660. req.on('socket', sock => {
  9661. socket = sock;
  9662. });
  9663. // If we ever get disconnected, we want the socket to timeout eventually
  9664. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9665. if (socket) {
  9666. socket.end();
  9667. }
  9668. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9669. });
  9670. req.on('error', function (err) {
  9671. // err has statusCode property
  9672. // res should have headers
  9673. handleResult(err, null);
  9674. });
  9675. if (data && typeof data === 'string') {
  9676. req.write(data, 'utf8');
  9677. }
  9678. if (data && typeof data !== 'string') {
  9679. data.on('close', function () {
  9680. req.end();
  9681. });
  9682. data.pipe(req);
  9683. }
  9684. else {
  9685. req.end();
  9686. }
  9687. }
  9688. /**
  9689. * Gets an http agent. This function is useful when you need an http agent that handles
  9690. * routing through a proxy server - depending upon the url and proxy environment variables.
  9691. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9692. */
  9693. getAgent(serverUrl) {
  9694. let parsedUrl = url.parse(serverUrl);
  9695. return this._getAgent(parsedUrl);
  9696. }
  9697. _prepareRequest(method, requestUrl, headers) {
  9698. const info = {};
  9699. info.parsedUrl = requestUrl;
  9700. const usingSsl = info.parsedUrl.protocol === 'https:';
  9701. info.httpModule = usingSsl ? https : http;
  9702. const defaultPort = usingSsl ? 443 : 80;
  9703. info.options = {};
  9704. info.options.host = info.parsedUrl.hostname;
  9705. info.options.port = info.parsedUrl.port
  9706. ? parseInt(info.parsedUrl.port)
  9707. : defaultPort;
  9708. info.options.path =
  9709. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9710. info.options.method = method;
  9711. info.options.headers = this._mergeHeaders(headers);
  9712. if (this.userAgent != null) {
  9713. info.options.headers['user-agent'] = this.userAgent;
  9714. }
  9715. info.options.agent = this._getAgent(info.parsedUrl);
  9716. // gives handlers an opportunity to participate
  9717. if (this.handlers) {
  9718. this.handlers.forEach(handler => {
  9719. handler.prepareRequest(info.options);
  9720. });
  9721. }
  9722. return info;
  9723. }
  9724. _mergeHeaders(headers) {
  9725. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9726. if (this.requestOptions && this.requestOptions.headers) {
  9727. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9728. }
  9729. return lowercaseKeys(headers || {});
  9730. }
  9731. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9732. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9733. let clientHeader;
  9734. if (this.requestOptions && this.requestOptions.headers) {
  9735. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9736. }
  9737. return additionalHeaders[header] || clientHeader || _default;
  9738. }
  9739. _getAgent(parsedUrl) {
  9740. let agent;
  9741. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9742. let useProxy = proxyUrl && proxyUrl.hostname;
  9743. if (this._keepAlive && useProxy) {
  9744. agent = this._proxyAgent;
  9745. }
  9746. if (this._keepAlive && !useProxy) {
  9747. agent = this._agent;
  9748. }
  9749. // if agent is already assigned use that agent.
  9750. if (!!agent) {
  9751. return agent;
  9752. }
  9753. const usingSsl = parsedUrl.protocol === 'https:';
  9754. let maxSockets = 100;
  9755. if (!!this.requestOptions) {
  9756. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9757. }
  9758. if (useProxy) {
  9759. // If using proxy, need tunnel
  9760. if (!tunnel) {
  9761. tunnel = __webpack_require__(335);
  9762. }
  9763. const agentOptions = {
  9764. maxSockets: maxSockets,
  9765. keepAlive: this._keepAlive,
  9766. proxy: {
  9767. proxyAuth: proxyUrl.auth,
  9768. host: proxyUrl.hostname,
  9769. port: proxyUrl.port
  9770. }
  9771. };
  9772. let tunnelAgent;
  9773. const overHttps = proxyUrl.protocol === 'https:';
  9774. if (usingSsl) {
  9775. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9776. }
  9777. else {
  9778. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9779. }
  9780. agent = tunnelAgent(agentOptions);
  9781. this._proxyAgent = agent;
  9782. }
  9783. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9784. if (this._keepAlive && !agent) {
  9785. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9786. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9787. this._agent = agent;
  9788. }
  9789. // if not using private agent and tunnel agent isn't setup then use global agent
  9790. if (!agent) {
  9791. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9792. }
  9793. if (usingSsl && this._ignoreSslError) {
  9794. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9795. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9796. // we have to cast it to any and change it directly
  9797. agent.options = Object.assign(agent.options || {}, {
  9798. rejectUnauthorized: false
  9799. });
  9800. }
  9801. return agent;
  9802. }
  9803. _performExponentialBackoff(retryNumber) {
  9804. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9805. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9806. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9807. }
  9808. static dateTimeDeserializer(key, value) {
  9809. if (typeof value === 'string') {
  9810. let a = new Date(value);
  9811. if (!isNaN(a.valueOf())) {
  9812. return a;
  9813. }
  9814. }
  9815. return value;
  9816. }
  9817. async _processResponse(res, options) {
  9818. return new Promise(async (resolve, reject) => {
  9819. const statusCode = res.message.statusCode;
  9820. const response = {
  9821. statusCode: statusCode,
  9822. result: null,
  9823. headers: {}
  9824. };
  9825. // not found leads to null obj returned
  9826. if (statusCode == HttpCodes.NotFound) {
  9827. resolve(response);
  9828. }
  9829. let obj;
  9830. let contents;
  9831. // get the result from the body
  9832. try {
  9833. contents = await res.readBody();
  9834. if (contents && contents.length > 0) {
  9835. if (options && options.deserializeDates) {
  9836. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9837. }
  9838. else {
  9839. obj = JSON.parse(contents);
  9840. }
  9841. response.result = obj;
  9842. }
  9843. response.headers = res.message.headers;
  9844. }
  9845. catch (err) {
  9846. // Invalid resource (contents not json); leaving result obj null
  9847. }
  9848. // note that 3xx redirects are handled by the http layer.
  9849. if (statusCode > 299) {
  9850. let msg;
  9851. // if exception/error in body, attempt to get better error
  9852. if (obj && obj.message) {
  9853. msg = obj.message;
  9854. }
  9855. else if (contents && contents.length > 0) {
  9856. // it may be the case that the exception is in the body message as string
  9857. msg = contents;
  9858. }
  9859. else {
  9860. msg = 'Failed request: (' + statusCode + ')';
  9861. }
  9862. let err = new Error(msg);
  9863. // attach statusCode and body obj (if available) to the error object
  9864. err['statusCode'] = statusCode;
  9865. if (response.result) {
  9866. err['result'] = response.result;
  9867. }
  9868. reject(err);
  9869. }
  9870. else {
  9871. resolve(response);
  9872. }
  9873. });
  9874. }
  9875. }
  9876. exports.HttpClient = HttpClient;
  9877. /***/ }),
  9878. /***/ 550:
  9879. /***/ (function(module, __unusedexports, __webpack_require__) {
  9880. module.exports = getNextPage
  9881. const getPage = __webpack_require__(265)
  9882. function getNextPage (octokit, link, headers) {
  9883. return getPage(octokit, link, 'next', headers)
  9884. }
  9885. /***/ }),
  9886. /***/ 558:
  9887. /***/ (function(module, __unusedexports, __webpack_require__) {
  9888. module.exports = hasPreviousPage
  9889. const deprecate = __webpack_require__(370)
  9890. const getPageLinks = __webpack_require__(577)
  9891. function hasPreviousPage (link) {
  9892. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9893. return getPageLinks(link).prev
  9894. }
  9895. /***/ }),
  9896. /***/ 559:
  9897. /***/ (function(__unusedmodule, exports) {
  9898. "use strict";
  9899. Object.defineProperty(exports, "__esModule", { value: true });
  9900. class GitVersion {
  9901. /**
  9902. * Used for comparing the version of git and git-lfs against the minimum required version
  9903. * @param version the version string, e.g. 1.2 or 1.2.3
  9904. */
  9905. constructor(version) {
  9906. this.major = NaN;
  9907. this.minor = NaN;
  9908. this.patch = NaN;
  9909. if (version) {
  9910. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9911. if (match) {
  9912. this.major = Number(match[1]);
  9913. this.minor = Number(match[2]);
  9914. if (match[4]) {
  9915. this.patch = Number(match[4]);
  9916. }
  9917. }
  9918. }
  9919. }
  9920. /**
  9921. * Compares the instance against a minimum required version
  9922. * @param minimum Minimum version
  9923. */
  9924. checkMinimum(minimum) {
  9925. if (!minimum.isValid()) {
  9926. throw new Error('Arg minimum is not a valid version');
  9927. }
  9928. // Major is insufficient
  9929. if (this.major < minimum.major) {
  9930. return false;
  9931. }
  9932. // Major is equal
  9933. if (this.major === minimum.major) {
  9934. // Minor is insufficient
  9935. if (this.minor < minimum.minor) {
  9936. return false;
  9937. }
  9938. // Minor is equal
  9939. if (this.minor === minimum.minor) {
  9940. // Patch is insufficient
  9941. if (this.patch && this.patch < (minimum.patch || 0)) {
  9942. return false;
  9943. }
  9944. }
  9945. }
  9946. return true;
  9947. }
  9948. /**
  9949. * Indicates whether the instance was constructed from a valid version string
  9950. */
  9951. isValid() {
  9952. return !isNaN(this.major);
  9953. }
  9954. /**
  9955. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9956. */
  9957. toString() {
  9958. let result = '';
  9959. if (this.isValid()) {
  9960. result = `${this.major}.${this.minor}`;
  9961. if (!isNaN(this.patch)) {
  9962. result += `.${this.patch}`;
  9963. }
  9964. }
  9965. return result;
  9966. }
  9967. }
  9968. exports.GitVersion = GitVersion;
  9969. /***/ }),
  9970. /***/ 562:
  9971. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9972. "use strict";
  9973. Object.defineProperty(exports, '__esModule', { value: true });
  9974. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9975. var osName = _interopDefault(__webpack_require__(2));
  9976. function getUserAgent() {
  9977. try {
  9978. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  9979. } catch (error) {
  9980. if (/wmic os get Caption/.test(error.message)) {
  9981. return "Windows <version undetectable>";
  9982. }
  9983. return "<environment undetectable>";
  9984. }
  9985. }
  9986. exports.getUserAgent = getUserAgent;
  9987. //# sourceMappingURL=index.js.map
  9988. /***/ }),
  9989. /***/ 563:
  9990. /***/ (function(module, __unusedexports, __webpack_require__) {
  9991. module.exports = getPreviousPage
  9992. const getPage = __webpack_require__(265)
  9993. function getPreviousPage (octokit, link, headers) {
  9994. return getPage(octokit, link, 'prev', headers)
  9995. }
  9996. /***/ }),
  9997. /***/ 568:
  9998. /***/ (function(module, __unusedexports, __webpack_require__) {
  9999. "use strict";
  10000. const path = __webpack_require__(622);
  10001. const niceTry = __webpack_require__(948);
  10002. const resolveCommand = __webpack_require__(489);
  10003. const escape = __webpack_require__(462);
  10004. const readShebang = __webpack_require__(389);
  10005. const semver = __webpack_require__(280);
  10006. const isWin = process.platform === 'win32';
  10007. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10008. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10009. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10010. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10011. function detectShebang(parsed) {
  10012. parsed.file = resolveCommand(parsed);
  10013. const shebang = parsed.file && readShebang(parsed.file);
  10014. if (shebang) {
  10015. parsed.args.unshift(parsed.file);
  10016. parsed.command = shebang;
  10017. return resolveCommand(parsed);
  10018. }
  10019. return parsed.file;
  10020. }
  10021. function parseNonShell(parsed) {
  10022. if (!isWin) {
  10023. return parsed;
  10024. }
  10025. // Detect & add support for shebangs
  10026. const commandFile = detectShebang(parsed);
  10027. // We don't need a shell if the command filename is an executable
  10028. const needsShell = !isExecutableRegExp.test(commandFile);
  10029. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10030. // Note that `forceShell` is an hidden option used only in tests
  10031. if (parsed.options.forceShell || needsShell) {
  10032. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10033. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10034. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10035. // we need to double escape them
  10036. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10037. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10038. // This is necessary otherwise it will always fail with ENOENT in those cases
  10039. parsed.command = path.normalize(parsed.command);
  10040. // Escape command & arguments
  10041. parsed.command = escape.command(parsed.command);
  10042. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10043. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10044. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10045. parsed.command = process.env.comspec || 'cmd.exe';
  10046. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10047. }
  10048. return parsed;
  10049. }
  10050. function parseShell(parsed) {
  10051. // If node supports the shell option, there's no need to mimic its behavior
  10052. if (supportsShellOption) {
  10053. return parsed;
  10054. }
  10055. // Mimic node shell option
  10056. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10057. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10058. if (isWin) {
  10059. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10060. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10061. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10062. } else {
  10063. if (typeof parsed.options.shell === 'string') {
  10064. parsed.command = parsed.options.shell;
  10065. } else if (process.platform === 'android') {
  10066. parsed.command = '/system/bin/sh';
  10067. } else {
  10068. parsed.command = '/bin/sh';
  10069. }
  10070. parsed.args = ['-c', shellCommand];
  10071. }
  10072. return parsed;
  10073. }
  10074. function parse(command, args, options) {
  10075. // Normalize arguments, similar to nodejs
  10076. if (args && !Array.isArray(args)) {
  10077. options = args;
  10078. args = null;
  10079. }
  10080. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10081. options = Object.assign({}, options); // Clone object to avoid changing the original
  10082. // Build our parsed object
  10083. const parsed = {
  10084. command,
  10085. args,
  10086. options,
  10087. file: undefined,
  10088. original: {
  10089. command,
  10090. args,
  10091. },
  10092. };
  10093. // Delegate further parsing to shell or non-shell
  10094. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10095. }
  10096. module.exports = parse;
  10097. /***/ }),
  10098. /***/ 577:
  10099. /***/ (function(module) {
  10100. module.exports = getPageLinks
  10101. function getPageLinks (link) {
  10102. link = link.link || link.headers.link || ''
  10103. const links = {}
  10104. // link format:
  10105. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10106. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10107. links[type] = uri
  10108. })
  10109. return links
  10110. }
  10111. /***/ }),
  10112. /***/ 587:
  10113. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10114. "use strict";
  10115. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10116. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10117. return new (P || (P = Promise))(function (resolve, reject) {
  10118. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10119. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10120. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10121. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10122. });
  10123. };
  10124. var __importStar = (this && this.__importStar) || function (mod) {
  10125. if (mod && mod.__esModule) return mod;
  10126. var result = {};
  10127. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10128. result["default"] = mod;
  10129. return result;
  10130. };
  10131. Object.defineProperty(exports, "__esModule", { value: true });
  10132. const core = __importStar(__webpack_require__(470));
  10133. const defaultMaxAttempts = 3;
  10134. const defaultMinSeconds = 10;
  10135. const defaultMaxSeconds = 20;
  10136. class RetryHelper {
  10137. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10138. this.maxAttempts = maxAttempts;
  10139. this.minSeconds = Math.floor(minSeconds);
  10140. this.maxSeconds = Math.floor(maxSeconds);
  10141. if (this.minSeconds > this.maxSeconds) {
  10142. throw new Error('min seconds should be less than or equal to max seconds');
  10143. }
  10144. }
  10145. execute(action) {
  10146. return __awaiter(this, void 0, void 0, function* () {
  10147. let attempt = 1;
  10148. while (attempt < this.maxAttempts) {
  10149. // Try
  10150. try {
  10151. return yield action();
  10152. }
  10153. catch (err) {
  10154. core.info(err.message);
  10155. }
  10156. // Sleep
  10157. const seconds = this.getSleepAmount();
  10158. core.info(`Waiting ${seconds} seconds before trying again`);
  10159. yield this.sleep(seconds);
  10160. attempt++;
  10161. }
  10162. // Last attempt
  10163. return yield action();
  10164. });
  10165. }
  10166. getSleepAmount() {
  10167. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10168. this.minSeconds);
  10169. }
  10170. sleep(seconds) {
  10171. return __awaiter(this, void 0, void 0, function* () {
  10172. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10173. });
  10174. }
  10175. }
  10176. exports.RetryHelper = RetryHelper;
  10177. function execute(action) {
  10178. return __awaiter(this, void 0, void 0, function* () {
  10179. const retryHelper = new RetryHelper();
  10180. return yield retryHelper.execute(action);
  10181. });
  10182. }
  10183. exports.execute = execute;
  10184. /***/ }),
  10185. /***/ 605:
  10186. /***/ (function(module) {
  10187. module.exports = require("http");
  10188. /***/ }),
  10189. /***/ 614:
  10190. /***/ (function(module) {
  10191. module.exports = require("events");
  10192. /***/ }),
  10193. /***/ 618:
  10194. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10195. "use strict";
  10196. var __importStar = (this && this.__importStar) || function (mod) {
  10197. if (mod && mod.__esModule) return mod;
  10198. var result = {};
  10199. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10200. result["default"] = mod;
  10201. return result;
  10202. };
  10203. Object.defineProperty(exports, "__esModule", { value: true });
  10204. const fs = __importStar(__webpack_require__(747));
  10205. function directoryExistsSync(path, required) {
  10206. if (!path) {
  10207. throw new Error("Arg 'path' must not be empty");
  10208. }
  10209. let stats;
  10210. try {
  10211. stats = fs.statSync(path);
  10212. }
  10213. catch (error) {
  10214. if (error.code === 'ENOENT') {
  10215. if (!required) {
  10216. return false;
  10217. }
  10218. throw new Error(`Directory '${path}' does not exist`);
  10219. }
  10220. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10221. }
  10222. if (stats.isDirectory()) {
  10223. return true;
  10224. }
  10225. else if (!required) {
  10226. return false;
  10227. }
  10228. throw new Error(`Directory '${path}' does not exist`);
  10229. }
  10230. exports.directoryExistsSync = directoryExistsSync;
  10231. function existsSync(path) {
  10232. if (!path) {
  10233. throw new Error("Arg 'path' must not be empty");
  10234. }
  10235. try {
  10236. fs.statSync(path);
  10237. }
  10238. catch (error) {
  10239. if (error.code === 'ENOENT') {
  10240. return false;
  10241. }
  10242. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10243. }
  10244. return true;
  10245. }
  10246. exports.existsSync = existsSync;
  10247. function fileExistsSync(path) {
  10248. if (!path) {
  10249. throw new Error("Arg 'path' must not be empty");
  10250. }
  10251. let stats;
  10252. try {
  10253. stats = fs.statSync(path);
  10254. }
  10255. catch (error) {
  10256. if (error.code === 'ENOENT') {
  10257. return false;
  10258. }
  10259. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10260. }
  10261. if (!stats.isDirectory()) {
  10262. return true;
  10263. }
  10264. return false;
  10265. }
  10266. exports.fileExistsSync = fileExistsSync;
  10267. /***/ }),
  10268. /***/ 621:
  10269. /***/ (function(module, __unusedexports, __webpack_require__) {
  10270. "use strict";
  10271. const path = __webpack_require__(622);
  10272. const pathKey = __webpack_require__(39);
  10273. module.exports = opts => {
  10274. opts = Object.assign({
  10275. cwd: process.cwd(),
  10276. path: process.env[pathKey()]
  10277. }, opts);
  10278. let prev;
  10279. let pth = path.resolve(opts.cwd);
  10280. const ret = [];
  10281. while (prev !== pth) {
  10282. ret.push(path.join(pth, 'node_modules/.bin'));
  10283. prev = pth;
  10284. pth = path.resolve(pth, '..');
  10285. }
  10286. // ensure the running `node` binary is used
  10287. ret.push(path.dirname(process.execPath));
  10288. return ret.concat(opts.path).join(path.delimiter);
  10289. };
  10290. module.exports.env = opts => {
  10291. opts = Object.assign({
  10292. env: process.env
  10293. }, opts);
  10294. const env = Object.assign({}, opts.env);
  10295. const path = pathKey({env});
  10296. opts.path = env[path];
  10297. env[path] = module.exports(opts);
  10298. return env;
  10299. };
  10300. /***/ }),
  10301. /***/ 622:
  10302. /***/ (function(module) {
  10303. module.exports = require("path");
  10304. /***/ }),
  10305. /***/ 631:
  10306. /***/ (function(module) {
  10307. module.exports = require("net");
  10308. /***/ }),
  10309. /***/ 649:
  10310. /***/ (function(module, __unusedexports, __webpack_require__) {
  10311. module.exports = getLastPage
  10312. const getPage = __webpack_require__(265)
  10313. function getLastPage (octokit, link, headers) {
  10314. return getPage(octokit, link, 'last', headers)
  10315. }
  10316. /***/ }),
  10317. /***/ 654:
  10318. /***/ (function(module) {
  10319. // This is not the set of all possible signals.
  10320. //
  10321. // It IS, however, the set of all signals that trigger
  10322. // an exit on either Linux or BSD systems. Linux is a
  10323. // superset of the signal names supported on BSD, and
  10324. // the unknown signals just fail to register, so we can
  10325. // catch that easily enough.
  10326. //
  10327. // Don't bother with SIGKILL. It's uncatchable, which
  10328. // means that we can't fire any callbacks anyway.
  10329. //
  10330. // If a user does happen to register a handler on a non-
  10331. // fatal signal like SIGWINCH or something, and then
  10332. // exit, it'll end up firing `process.emit('exit')`, so
  10333. // the handler will be fired anyway.
  10334. //
  10335. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10336. // artificially, inherently leave the process in a
  10337. // state from which it is not safe to try and enter JS
  10338. // listeners.
  10339. module.exports = [
  10340. 'SIGABRT',
  10341. 'SIGALRM',
  10342. 'SIGHUP',
  10343. 'SIGINT',
  10344. 'SIGTERM'
  10345. ]
  10346. if (process.platform !== 'win32') {
  10347. module.exports.push(
  10348. 'SIGVTALRM',
  10349. 'SIGXCPU',
  10350. 'SIGXFSZ',
  10351. 'SIGUSR2',
  10352. 'SIGTRAP',
  10353. 'SIGSYS',
  10354. 'SIGQUIT',
  10355. 'SIGIOT'
  10356. // should detect profiler and enable/disable accordingly.
  10357. // see #21
  10358. // 'SIGPROF'
  10359. )
  10360. }
  10361. if (process.platform === 'linux') {
  10362. module.exports.push(
  10363. 'SIGIO',
  10364. 'SIGPOLL',
  10365. 'SIGPWR',
  10366. 'SIGSTKFLT',
  10367. 'SIGUNUSED'
  10368. )
  10369. }
  10370. /***/ }),
  10371. /***/ 656:
  10372. /***/ (function(module, exports) {
  10373. exports = module.exports = SemVer
  10374. var debug
  10375. /* istanbul ignore next */
  10376. if (typeof process === 'object' &&
  10377. process.env &&
  10378. process.env.NODE_DEBUG &&
  10379. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10380. debug = function () {
  10381. var args = Array.prototype.slice.call(arguments, 0)
  10382. args.unshift('SEMVER')
  10383. console.log.apply(console, args)
  10384. }
  10385. } else {
  10386. debug = function () {}
  10387. }
  10388. // Note: this is the semver.org version of the spec that it implements
  10389. // Not necessarily the package version of this code.
  10390. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10391. var MAX_LENGTH = 256
  10392. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10393. /* istanbul ignore next */ 9007199254740991
  10394. // Max safe segment length for coercion.
  10395. var MAX_SAFE_COMPONENT_LENGTH = 16
  10396. // The actual regexps go on exports.re
  10397. var re = exports.re = []
  10398. var src = exports.src = []
  10399. var t = exports.tokens = {}
  10400. var R = 0
  10401. function tok (n) {
  10402. t[n] = R++
  10403. }
  10404. // The following Regular Expressions can be used for tokenizing,
  10405. // validating, and parsing SemVer version strings.
  10406. // ## Numeric Identifier
  10407. // A single `0`, or a non-zero digit followed by zero or more digits.
  10408. tok('NUMERICIDENTIFIER')
  10409. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10410. tok('NUMERICIDENTIFIERLOOSE')
  10411. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10412. // ## Non-numeric Identifier
  10413. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10414. // more letters, digits, or hyphens.
  10415. tok('NONNUMERICIDENTIFIER')
  10416. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10417. // ## Main Version
  10418. // Three dot-separated numeric identifiers.
  10419. tok('MAINVERSION')
  10420. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10421. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10422. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10423. tok('MAINVERSIONLOOSE')
  10424. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10425. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10426. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10427. // ## Pre-release Version Identifier
  10428. // A numeric identifier, or a non-numeric identifier.
  10429. tok('PRERELEASEIDENTIFIER')
  10430. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10431. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10432. tok('PRERELEASEIDENTIFIERLOOSE')
  10433. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10434. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10435. // ## Pre-release Version
  10436. // Hyphen, followed by one or more dot-separated pre-release version
  10437. // identifiers.
  10438. tok('PRERELEASE')
  10439. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10440. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10441. tok('PRERELEASELOOSE')
  10442. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10443. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10444. // ## Build Metadata Identifier
  10445. // Any combination of digits, letters, or hyphens.
  10446. tok('BUILDIDENTIFIER')
  10447. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10448. // ## Build Metadata
  10449. // Plus sign, followed by one or more period-separated build metadata
  10450. // identifiers.
  10451. tok('BUILD')
  10452. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10453. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10454. // ## Full Version String
  10455. // A main version, followed optionally by a pre-release version and
  10456. // build metadata.
  10457. // Note that the only major, minor, patch, and pre-release sections of
  10458. // the version string are capturing groups. The build metadata is not a
  10459. // capturing group, because it should not ever be used in version
  10460. // comparison.
  10461. tok('FULL')
  10462. tok('FULLPLAIN')
  10463. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10464. src[t.PRERELEASE] + '?' +
  10465. src[t.BUILD] + '?'
  10466. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10467. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10468. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10469. // common in the npm registry.
  10470. tok('LOOSEPLAIN')
  10471. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10472. src[t.PRERELEASELOOSE] + '?' +
  10473. src[t.BUILD] + '?'
  10474. tok('LOOSE')
  10475. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10476. tok('GTLT')
  10477. src[t.GTLT] = '((?:<|>)?=?)'
  10478. // Something like "2.*" or "1.2.x".
  10479. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10480. // Only the first item is strictly required.
  10481. tok('XRANGEIDENTIFIERLOOSE')
  10482. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10483. tok('XRANGEIDENTIFIER')
  10484. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10485. tok('XRANGEPLAIN')
  10486. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10487. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10488. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10489. '(?:' + src[t.PRERELEASE] + ')?' +
  10490. src[t.BUILD] + '?' +
  10491. ')?)?'
  10492. tok('XRANGEPLAINLOOSE')
  10493. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10494. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10495. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10496. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10497. src[t.BUILD] + '?' +
  10498. ')?)?'
  10499. tok('XRANGE')
  10500. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10501. tok('XRANGELOOSE')
  10502. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10503. // Coercion.
  10504. // Extract anything that could conceivably be a part of a valid semver
  10505. tok('COERCE')
  10506. src[t.COERCE] = '(^|[^\\d])' +
  10507. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10508. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10509. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10510. '(?:$|[^\\d])'
  10511. tok('COERCERTL')
  10512. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10513. // Tilde ranges.
  10514. // Meaning is "reasonably at or greater than"
  10515. tok('LONETILDE')
  10516. src[t.LONETILDE] = '(?:~>?)'
  10517. tok('TILDETRIM')
  10518. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10519. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10520. var tildeTrimReplace = '$1~'
  10521. tok('TILDE')
  10522. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10523. tok('TILDELOOSE')
  10524. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10525. // Caret ranges.
  10526. // Meaning is "at least and backwards compatible with"
  10527. tok('LONECARET')
  10528. src[t.LONECARET] = '(?:\\^)'
  10529. tok('CARETTRIM')
  10530. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10531. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10532. var caretTrimReplace = '$1^'
  10533. tok('CARET')
  10534. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10535. tok('CARETLOOSE')
  10536. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10537. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10538. tok('COMPARATORLOOSE')
  10539. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10540. tok('COMPARATOR')
  10541. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10542. // An expression to strip any whitespace between the gtlt and the thing
  10543. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10544. tok('COMPARATORTRIM')
  10545. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10546. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10547. // this one has to use the /g flag
  10548. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10549. var comparatorTrimReplace = '$1$2$3'
  10550. // Something like `1.2.3 - 1.2.4`
  10551. // Note that these all use the loose form, because they'll be
  10552. // checked against either the strict or loose comparator form
  10553. // later.
  10554. tok('HYPHENRANGE')
  10555. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10556. '\\s+-\\s+' +
  10557. '(' + src[t.XRANGEPLAIN] + ')' +
  10558. '\\s*$'
  10559. tok('HYPHENRANGELOOSE')
  10560. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10561. '\\s+-\\s+' +
  10562. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10563. '\\s*$'
  10564. // Star ranges basically just allow anything at all.
  10565. tok('STAR')
  10566. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10567. // Compile to actual regexp objects.
  10568. // All are flag-free, unless they were created above with a flag.
  10569. for (var i = 0; i < R; i++) {
  10570. debug(i, src[i])
  10571. if (!re[i]) {
  10572. re[i] = new RegExp(src[i])
  10573. }
  10574. }
  10575. exports.parse = parse
  10576. function parse (version, options) {
  10577. if (!options || typeof options !== 'object') {
  10578. options = {
  10579. loose: !!options,
  10580. includePrerelease: false
  10581. }
  10582. }
  10583. if (version instanceof SemVer) {
  10584. return version
  10585. }
  10586. if (typeof version !== 'string') {
  10587. return null
  10588. }
  10589. if (version.length > MAX_LENGTH) {
  10590. return null
  10591. }
  10592. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10593. if (!r.test(version)) {
  10594. return null
  10595. }
  10596. try {
  10597. return new SemVer(version, options)
  10598. } catch (er) {
  10599. return null
  10600. }
  10601. }
  10602. exports.valid = valid
  10603. function valid (version, options) {
  10604. var v = parse(version, options)
  10605. return v ? v.version : null
  10606. }
  10607. exports.clean = clean
  10608. function clean (version, options) {
  10609. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10610. return s ? s.version : null
  10611. }
  10612. exports.SemVer = SemVer
  10613. function SemVer (version, options) {
  10614. if (!options || typeof options !== 'object') {
  10615. options = {
  10616. loose: !!options,
  10617. includePrerelease: false
  10618. }
  10619. }
  10620. if (version instanceof SemVer) {
  10621. if (version.loose === options.loose) {
  10622. return version
  10623. } else {
  10624. version = version.version
  10625. }
  10626. } else if (typeof version !== 'string') {
  10627. throw new TypeError('Invalid Version: ' + version)
  10628. }
  10629. if (version.length > MAX_LENGTH) {
  10630. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10631. }
  10632. if (!(this instanceof SemVer)) {
  10633. return new SemVer(version, options)
  10634. }
  10635. debug('SemVer', version, options)
  10636. this.options = options
  10637. this.loose = !!options.loose
  10638. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10639. if (!m) {
  10640. throw new TypeError('Invalid Version: ' + version)
  10641. }
  10642. this.raw = version
  10643. // these are actually numbers
  10644. this.major = +m[1]
  10645. this.minor = +m[2]
  10646. this.patch = +m[3]
  10647. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10648. throw new TypeError('Invalid major version')
  10649. }
  10650. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10651. throw new TypeError('Invalid minor version')
  10652. }
  10653. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10654. throw new TypeError('Invalid patch version')
  10655. }
  10656. // numberify any prerelease numeric ids
  10657. if (!m[4]) {
  10658. this.prerelease = []
  10659. } else {
  10660. this.prerelease = m[4].split('.').map(function (id) {
  10661. if (/^[0-9]+$/.test(id)) {
  10662. var num = +id
  10663. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10664. return num
  10665. }
  10666. }
  10667. return id
  10668. })
  10669. }
  10670. this.build = m[5] ? m[5].split('.') : []
  10671. this.format()
  10672. }
  10673. SemVer.prototype.format = function () {
  10674. this.version = this.major + '.' + this.minor + '.' + this.patch
  10675. if (this.prerelease.length) {
  10676. this.version += '-' + this.prerelease.join('.')
  10677. }
  10678. return this.version
  10679. }
  10680. SemVer.prototype.toString = function () {
  10681. return this.version
  10682. }
  10683. SemVer.prototype.compare = function (other) {
  10684. debug('SemVer.compare', this.version, this.options, other)
  10685. if (!(other instanceof SemVer)) {
  10686. other = new SemVer(other, this.options)
  10687. }
  10688. return this.compareMain(other) || this.comparePre(other)
  10689. }
  10690. SemVer.prototype.compareMain = function (other) {
  10691. if (!(other instanceof SemVer)) {
  10692. other = new SemVer(other, this.options)
  10693. }
  10694. return compareIdentifiers(this.major, other.major) ||
  10695. compareIdentifiers(this.minor, other.minor) ||
  10696. compareIdentifiers(this.patch, other.patch)
  10697. }
  10698. SemVer.prototype.comparePre = function (other) {
  10699. if (!(other instanceof SemVer)) {
  10700. other = new SemVer(other, this.options)
  10701. }
  10702. // NOT having a prerelease is > having one
  10703. if (this.prerelease.length && !other.prerelease.length) {
  10704. return -1
  10705. } else if (!this.prerelease.length && other.prerelease.length) {
  10706. return 1
  10707. } else if (!this.prerelease.length && !other.prerelease.length) {
  10708. return 0
  10709. }
  10710. var i = 0
  10711. do {
  10712. var a = this.prerelease[i]
  10713. var b = other.prerelease[i]
  10714. debug('prerelease compare', i, a, b)
  10715. if (a === undefined && b === undefined) {
  10716. return 0
  10717. } else if (b === undefined) {
  10718. return 1
  10719. } else if (a === undefined) {
  10720. return -1
  10721. } else if (a === b) {
  10722. continue
  10723. } else {
  10724. return compareIdentifiers(a, b)
  10725. }
  10726. } while (++i)
  10727. }
  10728. SemVer.prototype.compareBuild = function (other) {
  10729. if (!(other instanceof SemVer)) {
  10730. other = new SemVer(other, this.options)
  10731. }
  10732. var i = 0
  10733. do {
  10734. var a = this.build[i]
  10735. var b = other.build[i]
  10736. debug('prerelease compare', i, a, b)
  10737. if (a === undefined && b === undefined) {
  10738. return 0
  10739. } else if (b === undefined) {
  10740. return 1
  10741. } else if (a === undefined) {
  10742. return -1
  10743. } else if (a === b) {
  10744. continue
  10745. } else {
  10746. return compareIdentifiers(a, b)
  10747. }
  10748. } while (++i)
  10749. }
  10750. // preminor will bump the version up to the next minor release, and immediately
  10751. // down to pre-release. premajor and prepatch work the same way.
  10752. SemVer.prototype.inc = function (release, identifier) {
  10753. switch (release) {
  10754. case 'premajor':
  10755. this.prerelease.length = 0
  10756. this.patch = 0
  10757. this.minor = 0
  10758. this.major++
  10759. this.inc('pre', identifier)
  10760. break
  10761. case 'preminor':
  10762. this.prerelease.length = 0
  10763. this.patch = 0
  10764. this.minor++
  10765. this.inc('pre', identifier)
  10766. break
  10767. case 'prepatch':
  10768. // If this is already a prerelease, it will bump to the next version
  10769. // drop any prereleases that might already exist, since they are not
  10770. // relevant at this point.
  10771. this.prerelease.length = 0
  10772. this.inc('patch', identifier)
  10773. this.inc('pre', identifier)
  10774. break
  10775. // If the input is a non-prerelease version, this acts the same as
  10776. // prepatch.
  10777. case 'prerelease':
  10778. if (this.prerelease.length === 0) {
  10779. this.inc('patch', identifier)
  10780. }
  10781. this.inc('pre', identifier)
  10782. break
  10783. case 'major':
  10784. // If this is a pre-major version, bump up to the same major version.
  10785. // Otherwise increment major.
  10786. // 1.0.0-5 bumps to 1.0.0
  10787. // 1.1.0 bumps to 2.0.0
  10788. if (this.minor !== 0 ||
  10789. this.patch !== 0 ||
  10790. this.prerelease.length === 0) {
  10791. this.major++
  10792. }
  10793. this.minor = 0
  10794. this.patch = 0
  10795. this.prerelease = []
  10796. break
  10797. case 'minor':
  10798. // If this is a pre-minor version, bump up to the same minor version.
  10799. // Otherwise increment minor.
  10800. // 1.2.0-5 bumps to 1.2.0
  10801. // 1.2.1 bumps to 1.3.0
  10802. if (this.patch !== 0 || this.prerelease.length === 0) {
  10803. this.minor++
  10804. }
  10805. this.patch = 0
  10806. this.prerelease = []
  10807. break
  10808. case 'patch':
  10809. // If this is not a pre-release version, it will increment the patch.
  10810. // If it is a pre-release it will bump up to the same patch version.
  10811. // 1.2.0-5 patches to 1.2.0
  10812. // 1.2.0 patches to 1.2.1
  10813. if (this.prerelease.length === 0) {
  10814. this.patch++
  10815. }
  10816. this.prerelease = []
  10817. break
  10818. // This probably shouldn't be used publicly.
  10819. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10820. case 'pre':
  10821. if (this.prerelease.length === 0) {
  10822. this.prerelease = [0]
  10823. } else {
  10824. var i = this.prerelease.length
  10825. while (--i >= 0) {
  10826. if (typeof this.prerelease[i] === 'number') {
  10827. this.prerelease[i]++
  10828. i = -2
  10829. }
  10830. }
  10831. if (i === -1) {
  10832. // didn't increment anything
  10833. this.prerelease.push(0)
  10834. }
  10835. }
  10836. if (identifier) {
  10837. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10838. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10839. if (this.prerelease[0] === identifier) {
  10840. if (isNaN(this.prerelease[1])) {
  10841. this.prerelease = [identifier, 0]
  10842. }
  10843. } else {
  10844. this.prerelease = [identifier, 0]
  10845. }
  10846. }
  10847. break
  10848. default:
  10849. throw new Error('invalid increment argument: ' + release)
  10850. }
  10851. this.format()
  10852. this.raw = this.version
  10853. return this
  10854. }
  10855. exports.inc = inc
  10856. function inc (version, release, loose, identifier) {
  10857. if (typeof (loose) === 'string') {
  10858. identifier = loose
  10859. loose = undefined
  10860. }
  10861. try {
  10862. return new SemVer(version, loose).inc(release, identifier).version
  10863. } catch (er) {
  10864. return null
  10865. }
  10866. }
  10867. exports.diff = diff
  10868. function diff (version1, version2) {
  10869. if (eq(version1, version2)) {
  10870. return null
  10871. } else {
  10872. var v1 = parse(version1)
  10873. var v2 = parse(version2)
  10874. var prefix = ''
  10875. if (v1.prerelease.length || v2.prerelease.length) {
  10876. prefix = 'pre'
  10877. var defaultResult = 'prerelease'
  10878. }
  10879. for (var key in v1) {
  10880. if (key === 'major' || key === 'minor' || key === 'patch') {
  10881. if (v1[key] !== v2[key]) {
  10882. return prefix + key
  10883. }
  10884. }
  10885. }
  10886. return defaultResult // may be undefined
  10887. }
  10888. }
  10889. exports.compareIdentifiers = compareIdentifiers
  10890. var numeric = /^[0-9]+$/
  10891. function compareIdentifiers (a, b) {
  10892. var anum = numeric.test(a)
  10893. var bnum = numeric.test(b)
  10894. if (anum && bnum) {
  10895. a = +a
  10896. b = +b
  10897. }
  10898. return a === b ? 0
  10899. : (anum && !bnum) ? -1
  10900. : (bnum && !anum) ? 1
  10901. : a < b ? -1
  10902. : 1
  10903. }
  10904. exports.rcompareIdentifiers = rcompareIdentifiers
  10905. function rcompareIdentifiers (a, b) {
  10906. return compareIdentifiers(b, a)
  10907. }
  10908. exports.major = major
  10909. function major (a, loose) {
  10910. return new SemVer(a, loose).major
  10911. }
  10912. exports.minor = minor
  10913. function minor (a, loose) {
  10914. return new SemVer(a, loose).minor
  10915. }
  10916. exports.patch = patch
  10917. function patch (a, loose) {
  10918. return new SemVer(a, loose).patch
  10919. }
  10920. exports.compare = compare
  10921. function compare (a, b, loose) {
  10922. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10923. }
  10924. exports.compareLoose = compareLoose
  10925. function compareLoose (a, b) {
  10926. return compare(a, b, true)
  10927. }
  10928. exports.compareBuild = compareBuild
  10929. function compareBuild (a, b, loose) {
  10930. var versionA = new SemVer(a, loose)
  10931. var versionB = new SemVer(b, loose)
  10932. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10933. }
  10934. exports.rcompare = rcompare
  10935. function rcompare (a, b, loose) {
  10936. return compare(b, a, loose)
  10937. }
  10938. exports.sort = sort
  10939. function sort (list, loose) {
  10940. return list.sort(function (a, b) {
  10941. return exports.compareBuild(a, b, loose)
  10942. })
  10943. }
  10944. exports.rsort = rsort
  10945. function rsort (list, loose) {
  10946. return list.sort(function (a, b) {
  10947. return exports.compareBuild(b, a, loose)
  10948. })
  10949. }
  10950. exports.gt = gt
  10951. function gt (a, b, loose) {
  10952. return compare(a, b, loose) > 0
  10953. }
  10954. exports.lt = lt
  10955. function lt (a, b, loose) {
  10956. return compare(a, b, loose) < 0
  10957. }
  10958. exports.eq = eq
  10959. function eq (a, b, loose) {
  10960. return compare(a, b, loose) === 0
  10961. }
  10962. exports.neq = neq
  10963. function neq (a, b, loose) {
  10964. return compare(a, b, loose) !== 0
  10965. }
  10966. exports.gte = gte
  10967. function gte (a, b, loose) {
  10968. return compare(a, b, loose) >= 0
  10969. }
  10970. exports.lte = lte
  10971. function lte (a, b, loose) {
  10972. return compare(a, b, loose) <= 0
  10973. }
  10974. exports.cmp = cmp
  10975. function cmp (a, op, b, loose) {
  10976. switch (op) {
  10977. case '===':
  10978. if (typeof a === 'object')
  10979. a = a.version
  10980. if (typeof b === 'object')
  10981. b = b.version
  10982. return a === b
  10983. case '!==':
  10984. if (typeof a === 'object')
  10985. a = a.version
  10986. if (typeof b === 'object')
  10987. b = b.version
  10988. return a !== b
  10989. case '':
  10990. case '=':
  10991. case '==':
  10992. return eq(a, b, loose)
  10993. case '!=':
  10994. return neq(a, b, loose)
  10995. case '>':
  10996. return gt(a, b, loose)
  10997. case '>=':
  10998. return gte(a, b, loose)
  10999. case '<':
  11000. return lt(a, b, loose)
  11001. case '<=':
  11002. return lte(a, b, loose)
  11003. default:
  11004. throw new TypeError('Invalid operator: ' + op)
  11005. }
  11006. }
  11007. exports.Comparator = Comparator
  11008. function Comparator (comp, options) {
  11009. if (!options || typeof options !== 'object') {
  11010. options = {
  11011. loose: !!options,
  11012. includePrerelease: false
  11013. }
  11014. }
  11015. if (comp instanceof Comparator) {
  11016. if (comp.loose === !!options.loose) {
  11017. return comp
  11018. } else {
  11019. comp = comp.value
  11020. }
  11021. }
  11022. if (!(this instanceof Comparator)) {
  11023. return new Comparator(comp, options)
  11024. }
  11025. debug('comparator', comp, options)
  11026. this.options = options
  11027. this.loose = !!options.loose
  11028. this.parse(comp)
  11029. if (this.semver === ANY) {
  11030. this.value = ''
  11031. } else {
  11032. this.value = this.operator + this.semver.version
  11033. }
  11034. debug('comp', this)
  11035. }
  11036. var ANY = {}
  11037. Comparator.prototype.parse = function (comp) {
  11038. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11039. var m = comp.match(r)
  11040. if (!m) {
  11041. throw new TypeError('Invalid comparator: ' + comp)
  11042. }
  11043. this.operator = m[1] !== undefined ? m[1] : ''
  11044. if (this.operator === '=') {
  11045. this.operator = ''
  11046. }
  11047. // if it literally is just '>' or '' then allow anything.
  11048. if (!m[2]) {
  11049. this.semver = ANY
  11050. } else {
  11051. this.semver = new SemVer(m[2], this.options.loose)
  11052. }
  11053. }
  11054. Comparator.prototype.toString = function () {
  11055. return this.value
  11056. }
  11057. Comparator.prototype.test = function (version) {
  11058. debug('Comparator.test', version, this.options.loose)
  11059. if (this.semver === ANY || version === ANY) {
  11060. return true
  11061. }
  11062. if (typeof version === 'string') {
  11063. try {
  11064. version = new SemVer(version, this.options)
  11065. } catch (er) {
  11066. return false
  11067. }
  11068. }
  11069. return cmp(version, this.operator, this.semver, this.options)
  11070. }
  11071. Comparator.prototype.intersects = function (comp, options) {
  11072. if (!(comp instanceof Comparator)) {
  11073. throw new TypeError('a Comparator is required')
  11074. }
  11075. if (!options || typeof options !== 'object') {
  11076. options = {
  11077. loose: !!options,
  11078. includePrerelease: false
  11079. }
  11080. }
  11081. var rangeTmp
  11082. if (this.operator === '') {
  11083. if (this.value === '') {
  11084. return true
  11085. }
  11086. rangeTmp = new Range(comp.value, options)
  11087. return satisfies(this.value, rangeTmp, options)
  11088. } else if (comp.operator === '') {
  11089. if (comp.value === '') {
  11090. return true
  11091. }
  11092. rangeTmp = new Range(this.value, options)
  11093. return satisfies(comp.semver, rangeTmp, options)
  11094. }
  11095. var sameDirectionIncreasing =
  11096. (this.operator === '>=' || this.operator === '>') &&
  11097. (comp.operator === '>=' || comp.operator === '>')
  11098. var sameDirectionDecreasing =
  11099. (this.operator === '<=' || this.operator === '<') &&
  11100. (comp.operator === '<=' || comp.operator === '<')
  11101. var sameSemVer = this.semver.version === comp.semver.version
  11102. var differentDirectionsInclusive =
  11103. (this.operator === '>=' || this.operator === '<=') &&
  11104. (comp.operator === '>=' || comp.operator === '<=')
  11105. var oppositeDirectionsLessThan =
  11106. cmp(this.semver, '<', comp.semver, options) &&
  11107. ((this.operator === '>=' || this.operator === '>') &&
  11108. (comp.operator === '<=' || comp.operator === '<'))
  11109. var oppositeDirectionsGreaterThan =
  11110. cmp(this.semver, '>', comp.semver, options) &&
  11111. ((this.operator === '<=' || this.operator === '<') &&
  11112. (comp.operator === '>=' || comp.operator === '>'))
  11113. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11114. (sameSemVer && differentDirectionsInclusive) ||
  11115. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11116. }
  11117. exports.Range = Range
  11118. function Range (range, options) {
  11119. if (!options || typeof options !== 'object') {
  11120. options = {
  11121. loose: !!options,
  11122. includePrerelease: false
  11123. }
  11124. }
  11125. if (range instanceof Range) {
  11126. if (range.loose === !!options.loose &&
  11127. range.includePrerelease === !!options.includePrerelease) {
  11128. return range
  11129. } else {
  11130. return new Range(range.raw, options)
  11131. }
  11132. }
  11133. if (range instanceof Comparator) {
  11134. return new Range(range.value, options)
  11135. }
  11136. if (!(this instanceof Range)) {
  11137. return new Range(range, options)
  11138. }
  11139. this.options = options
  11140. this.loose = !!options.loose
  11141. this.includePrerelease = !!options.includePrerelease
  11142. // First, split based on boolean or ||
  11143. this.raw = range
  11144. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11145. return this.parseRange(range.trim())
  11146. }, this).filter(function (c) {
  11147. // throw out any that are not relevant for whatever reason
  11148. return c.length
  11149. })
  11150. if (!this.set.length) {
  11151. throw new TypeError('Invalid SemVer Range: ' + range)
  11152. }
  11153. this.format()
  11154. }
  11155. Range.prototype.format = function () {
  11156. this.range = this.set.map(function (comps) {
  11157. return comps.join(' ').trim()
  11158. }).join('||').trim()
  11159. return this.range
  11160. }
  11161. Range.prototype.toString = function () {
  11162. return this.range
  11163. }
  11164. Range.prototype.parseRange = function (range) {
  11165. var loose = this.options.loose
  11166. range = range.trim()
  11167. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11168. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11169. range = range.replace(hr, hyphenReplace)
  11170. debug('hyphen replace', range)
  11171. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11172. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11173. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11174. // `~ 1.2.3` => `~1.2.3`
  11175. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11176. // `^ 1.2.3` => `^1.2.3`
  11177. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11178. // normalize spaces
  11179. range = range.split(/\s+/).join(' ')
  11180. // At this point, the range is completely trimmed and
  11181. // ready to be split into comparators.
  11182. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11183. var set = range.split(' ').map(function (comp) {
  11184. return parseComparator(comp, this.options)
  11185. }, this).join(' ').split(/\s+/)
  11186. if (this.options.loose) {
  11187. // in loose mode, throw out any that are not valid comparators
  11188. set = set.filter(function (comp) {
  11189. return !!comp.match(compRe)
  11190. })
  11191. }
  11192. set = set.map(function (comp) {
  11193. return new Comparator(comp, this.options)
  11194. }, this)
  11195. return set
  11196. }
  11197. Range.prototype.intersects = function (range, options) {
  11198. if (!(range instanceof Range)) {
  11199. throw new TypeError('a Range is required')
  11200. }
  11201. return this.set.some(function (thisComparators) {
  11202. return (
  11203. isSatisfiable(thisComparators, options) &&
  11204. range.set.some(function (rangeComparators) {
  11205. return (
  11206. isSatisfiable(rangeComparators, options) &&
  11207. thisComparators.every(function (thisComparator) {
  11208. return rangeComparators.every(function (rangeComparator) {
  11209. return thisComparator.intersects(rangeComparator, options)
  11210. })
  11211. })
  11212. )
  11213. })
  11214. )
  11215. })
  11216. }
  11217. // take a set of comparators and determine whether there
  11218. // exists a version which can satisfy it
  11219. function isSatisfiable (comparators, options) {
  11220. var result = true
  11221. var remainingComparators = comparators.slice()
  11222. var testComparator = remainingComparators.pop()
  11223. while (result && remainingComparators.length) {
  11224. result = remainingComparators.every(function (otherComparator) {
  11225. return testComparator.intersects(otherComparator, options)
  11226. })
  11227. testComparator = remainingComparators.pop()
  11228. }
  11229. return result
  11230. }
  11231. // Mostly just for testing and legacy API reasons
  11232. exports.toComparators = toComparators
  11233. function toComparators (range, options) {
  11234. return new Range(range, options).set.map(function (comp) {
  11235. return comp.map(function (c) {
  11236. return c.value
  11237. }).join(' ').trim().split(' ')
  11238. })
  11239. }
  11240. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11241. // already replaced the hyphen ranges
  11242. // turn into a set of JUST comparators.
  11243. function parseComparator (comp, options) {
  11244. debug('comp', comp, options)
  11245. comp = replaceCarets(comp, options)
  11246. debug('caret', comp)
  11247. comp = replaceTildes(comp, options)
  11248. debug('tildes', comp)
  11249. comp = replaceXRanges(comp, options)
  11250. debug('xrange', comp)
  11251. comp = replaceStars(comp, options)
  11252. debug('stars', comp)
  11253. return comp
  11254. }
  11255. function isX (id) {
  11256. return !id || id.toLowerCase() === 'x' || id === '*'
  11257. }
  11258. // ~, ~> --> * (any, kinda silly)
  11259. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11260. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11261. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11262. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11263. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11264. function replaceTildes (comp, options) {
  11265. return comp.trim().split(/\s+/).map(function (comp) {
  11266. return replaceTilde(comp, options)
  11267. }).join(' ')
  11268. }
  11269. function replaceTilde (comp, options) {
  11270. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11271. return comp.replace(r, function (_, M, m, p, pr) {
  11272. debug('tilde', comp, _, M, m, p, pr)
  11273. var ret
  11274. if (isX(M)) {
  11275. ret = ''
  11276. } else if (isX(m)) {
  11277. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11278. } else if (isX(p)) {
  11279. // ~1.2 == >=1.2.0 <1.3.0
  11280. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11281. } else if (pr) {
  11282. debug('replaceTilde pr', pr)
  11283. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11284. ' <' + M + '.' + (+m + 1) + '.0'
  11285. } else {
  11286. // ~1.2.3 == >=1.2.3 <1.3.0
  11287. ret = '>=' + M + '.' + m + '.' + p +
  11288. ' <' + M + '.' + (+m + 1) + '.0'
  11289. }
  11290. debug('tilde return', ret)
  11291. return ret
  11292. })
  11293. }
  11294. // ^ --> * (any, kinda silly)
  11295. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11296. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11297. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11298. // ^1.2.3 --> >=1.2.3 <2.0.0
  11299. // ^1.2.0 --> >=1.2.0 <2.0.0
  11300. function replaceCarets (comp, options) {
  11301. return comp.trim().split(/\s+/).map(function (comp) {
  11302. return replaceCaret(comp, options)
  11303. }).join(' ')
  11304. }
  11305. function replaceCaret (comp, options) {
  11306. debug('caret', comp, options)
  11307. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11308. return comp.replace(r, function (_, M, m, p, pr) {
  11309. debug('caret', comp, _, M, m, p, pr)
  11310. var ret
  11311. if (isX(M)) {
  11312. ret = ''
  11313. } else if (isX(m)) {
  11314. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11315. } else if (isX(p)) {
  11316. if (M === '0') {
  11317. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11318. } else {
  11319. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11320. }
  11321. } else if (pr) {
  11322. debug('replaceCaret pr', pr)
  11323. if (M === '0') {
  11324. if (m === '0') {
  11325. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11326. ' <' + M + '.' + m + '.' + (+p + 1)
  11327. } else {
  11328. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11329. ' <' + M + '.' + (+m + 1) + '.0'
  11330. }
  11331. } else {
  11332. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11333. ' <' + (+M + 1) + '.0.0'
  11334. }
  11335. } else {
  11336. debug('no pr')
  11337. if (M === '0') {
  11338. if (m === '0') {
  11339. ret = '>=' + M + '.' + m + '.' + p +
  11340. ' <' + M + '.' + m + '.' + (+p + 1)
  11341. } else {
  11342. ret = '>=' + M + '.' + m + '.' + p +
  11343. ' <' + M + '.' + (+m + 1) + '.0'
  11344. }
  11345. } else {
  11346. ret = '>=' + M + '.' + m + '.' + p +
  11347. ' <' + (+M + 1) + '.0.0'
  11348. }
  11349. }
  11350. debug('caret return', ret)
  11351. return ret
  11352. })
  11353. }
  11354. function replaceXRanges (comp, options) {
  11355. debug('replaceXRanges', comp, options)
  11356. return comp.split(/\s+/).map(function (comp) {
  11357. return replaceXRange(comp, options)
  11358. }).join(' ')
  11359. }
  11360. function replaceXRange (comp, options) {
  11361. comp = comp.trim()
  11362. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11363. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11364. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11365. var xM = isX(M)
  11366. var xm = xM || isX(m)
  11367. var xp = xm || isX(p)
  11368. var anyX = xp
  11369. if (gtlt === '=' && anyX) {
  11370. gtlt = ''
  11371. }
  11372. // if we're including prereleases in the match, then we need
  11373. // to fix this to -0, the lowest possible prerelease value
  11374. pr = options.includePrerelease ? '-0' : ''
  11375. if (xM) {
  11376. if (gtlt === '>' || gtlt === '<') {
  11377. // nothing is allowed
  11378. ret = '<0.0.0-0'
  11379. } else {
  11380. // nothing is forbidden
  11381. ret = '*'
  11382. }
  11383. } else if (gtlt && anyX) {
  11384. // we know patch is an x, because we have any x at all.
  11385. // replace X with 0
  11386. if (xm) {
  11387. m = 0
  11388. }
  11389. p = 0
  11390. if (gtlt === '>') {
  11391. // >1 => >=2.0.0
  11392. // >1.2 => >=1.3.0
  11393. // >1.2.3 => >= 1.2.4
  11394. gtlt = '>='
  11395. if (xm) {
  11396. M = +M + 1
  11397. m = 0
  11398. p = 0
  11399. } else {
  11400. m = +m + 1
  11401. p = 0
  11402. }
  11403. } else if (gtlt === '<=') {
  11404. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11405. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11406. gtlt = '<'
  11407. if (xm) {
  11408. M = +M + 1
  11409. } else {
  11410. m = +m + 1
  11411. }
  11412. }
  11413. ret = gtlt + M + '.' + m + '.' + p + pr
  11414. } else if (xm) {
  11415. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11416. } else if (xp) {
  11417. ret = '>=' + M + '.' + m + '.0' + pr +
  11418. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11419. }
  11420. debug('xRange return', ret)
  11421. return ret
  11422. })
  11423. }
  11424. // Because * is AND-ed with everything else in the comparator,
  11425. // and '' means "any version", just remove the *s entirely.
  11426. function replaceStars (comp, options) {
  11427. debug('replaceStars', comp, options)
  11428. // Looseness is ignored here. star is always as loose as it gets!
  11429. return comp.trim().replace(re[t.STAR], '')
  11430. }
  11431. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11432. // M, m, patch, prerelease, build
  11433. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11434. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11435. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11436. function hyphenReplace ($0,
  11437. from, fM, fm, fp, fpr, fb,
  11438. to, tM, tm, tp, tpr, tb) {
  11439. if (isX(fM)) {
  11440. from = ''
  11441. } else if (isX(fm)) {
  11442. from = '>=' + fM + '.0.0'
  11443. } else if (isX(fp)) {
  11444. from = '>=' + fM + '.' + fm + '.0'
  11445. } else {
  11446. from = '>=' + from
  11447. }
  11448. if (isX(tM)) {
  11449. to = ''
  11450. } else if (isX(tm)) {
  11451. to = '<' + (+tM + 1) + '.0.0'
  11452. } else if (isX(tp)) {
  11453. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11454. } else if (tpr) {
  11455. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11456. } else {
  11457. to = '<=' + to
  11458. }
  11459. return (from + ' ' + to).trim()
  11460. }
  11461. // if ANY of the sets match ALL of its comparators, then pass
  11462. Range.prototype.test = function (version) {
  11463. if (!version) {
  11464. return false
  11465. }
  11466. if (typeof version === 'string') {
  11467. try {
  11468. version = new SemVer(version, this.options)
  11469. } catch (er) {
  11470. return false
  11471. }
  11472. }
  11473. for (var i = 0; i < this.set.length; i++) {
  11474. if (testSet(this.set[i], version, this.options)) {
  11475. return true
  11476. }
  11477. }
  11478. return false
  11479. }
  11480. function testSet (set, version, options) {
  11481. for (var i = 0; i < set.length; i++) {
  11482. if (!set[i].test(version)) {
  11483. return false
  11484. }
  11485. }
  11486. if (version.prerelease.length && !options.includePrerelease) {
  11487. // Find the set of versions that are allowed to have prereleases
  11488. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11489. // That should allow `1.2.3-pr.2` to pass.
  11490. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11491. // even though it's within the range set by the comparators.
  11492. for (i = 0; i < set.length; i++) {
  11493. debug(set[i].semver)
  11494. if (set[i].semver === ANY) {
  11495. continue
  11496. }
  11497. if (set[i].semver.prerelease.length > 0) {
  11498. var allowed = set[i].semver
  11499. if (allowed.major === version.major &&
  11500. allowed.minor === version.minor &&
  11501. allowed.patch === version.patch) {
  11502. return true
  11503. }
  11504. }
  11505. }
  11506. // Version has a -pre, but it's not one of the ones we like.
  11507. return false
  11508. }
  11509. return true
  11510. }
  11511. exports.satisfies = satisfies
  11512. function satisfies (version, range, options) {
  11513. try {
  11514. range = new Range(range, options)
  11515. } catch (er) {
  11516. return false
  11517. }
  11518. return range.test(version)
  11519. }
  11520. exports.maxSatisfying = maxSatisfying
  11521. function maxSatisfying (versions, range, options) {
  11522. var max = null
  11523. var maxSV = null
  11524. try {
  11525. var rangeObj = new Range(range, options)
  11526. } catch (er) {
  11527. return null
  11528. }
  11529. versions.forEach(function (v) {
  11530. if (rangeObj.test(v)) {
  11531. // satisfies(v, range, options)
  11532. if (!max || maxSV.compare(v) === -1) {
  11533. // compare(max, v, true)
  11534. max = v
  11535. maxSV = new SemVer(max, options)
  11536. }
  11537. }
  11538. })
  11539. return max
  11540. }
  11541. exports.minSatisfying = minSatisfying
  11542. function minSatisfying (versions, range, options) {
  11543. var min = null
  11544. var minSV = null
  11545. try {
  11546. var rangeObj = new Range(range, options)
  11547. } catch (er) {
  11548. return null
  11549. }
  11550. versions.forEach(function (v) {
  11551. if (rangeObj.test(v)) {
  11552. // satisfies(v, range, options)
  11553. if (!min || minSV.compare(v) === 1) {
  11554. // compare(min, v, true)
  11555. min = v
  11556. minSV = new SemVer(min, options)
  11557. }
  11558. }
  11559. })
  11560. return min
  11561. }
  11562. exports.minVersion = minVersion
  11563. function minVersion (range, loose) {
  11564. range = new Range(range, loose)
  11565. var minver = new SemVer('0.0.0')
  11566. if (range.test(minver)) {
  11567. return minver
  11568. }
  11569. minver = new SemVer('0.0.0-0')
  11570. if (range.test(minver)) {
  11571. return minver
  11572. }
  11573. minver = null
  11574. for (var i = 0; i < range.set.length; ++i) {
  11575. var comparators = range.set[i]
  11576. comparators.forEach(function (comparator) {
  11577. // Clone to avoid manipulating the comparator's semver object.
  11578. var compver = new SemVer(comparator.semver.version)
  11579. switch (comparator.operator) {
  11580. case '>':
  11581. if (compver.prerelease.length === 0) {
  11582. compver.patch++
  11583. } else {
  11584. compver.prerelease.push(0)
  11585. }
  11586. compver.raw = compver.format()
  11587. /* fallthrough */
  11588. case '':
  11589. case '>=':
  11590. if (!minver || gt(minver, compver)) {
  11591. minver = compver
  11592. }
  11593. break
  11594. case '<':
  11595. case '<=':
  11596. /* Ignore maximum versions */
  11597. break
  11598. /* istanbul ignore next */
  11599. default:
  11600. throw new Error('Unexpected operation: ' + comparator.operator)
  11601. }
  11602. })
  11603. }
  11604. if (minver && range.test(minver)) {
  11605. return minver
  11606. }
  11607. return null
  11608. }
  11609. exports.validRange = validRange
  11610. function validRange (range, options) {
  11611. try {
  11612. // Return '*' instead of '' so that truthiness works.
  11613. // This will throw if it's invalid anyway
  11614. return new Range(range, options).range || '*'
  11615. } catch (er) {
  11616. return null
  11617. }
  11618. }
  11619. // Determine if version is less than all the versions possible in the range
  11620. exports.ltr = ltr
  11621. function ltr (version, range, options) {
  11622. return outside(version, range, '<', options)
  11623. }
  11624. // Determine if version is greater than all the versions possible in the range.
  11625. exports.gtr = gtr
  11626. function gtr (version, range, options) {
  11627. return outside(version, range, '>', options)
  11628. }
  11629. exports.outside = outside
  11630. function outside (version, range, hilo, options) {
  11631. version = new SemVer(version, options)
  11632. range = new Range(range, options)
  11633. var gtfn, ltefn, ltfn, comp, ecomp
  11634. switch (hilo) {
  11635. case '>':
  11636. gtfn = gt
  11637. ltefn = lte
  11638. ltfn = lt
  11639. comp = '>'
  11640. ecomp = '>='
  11641. break
  11642. case '<':
  11643. gtfn = lt
  11644. ltefn = gte
  11645. ltfn = gt
  11646. comp = '<'
  11647. ecomp = '<='
  11648. break
  11649. default:
  11650. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11651. }
  11652. // If it satisifes the range it is not outside
  11653. if (satisfies(version, range, options)) {
  11654. return false
  11655. }
  11656. // From now on, variable terms are as if we're in "gtr" mode.
  11657. // but note that everything is flipped for the "ltr" function.
  11658. for (var i = 0; i < range.set.length; ++i) {
  11659. var comparators = range.set[i]
  11660. var high = null
  11661. var low = null
  11662. comparators.forEach(function (comparator) {
  11663. if (comparator.semver === ANY) {
  11664. comparator = new Comparator('>=0.0.0')
  11665. }
  11666. high = high || comparator
  11667. low = low || comparator
  11668. if (gtfn(comparator.semver, high.semver, options)) {
  11669. high = comparator
  11670. } else if (ltfn(comparator.semver, low.semver, options)) {
  11671. low = comparator
  11672. }
  11673. })
  11674. // If the edge version comparator has a operator then our version
  11675. // isn't outside it
  11676. if (high.operator === comp || high.operator === ecomp) {
  11677. return false
  11678. }
  11679. // If the lowest version comparator has an operator and our version
  11680. // is less than it then it isn't higher than the range
  11681. if ((!low.operator || low.operator === comp) &&
  11682. ltefn(version, low.semver)) {
  11683. return false
  11684. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11685. return false
  11686. }
  11687. }
  11688. return true
  11689. }
  11690. exports.prerelease = prerelease
  11691. function prerelease (version, options) {
  11692. var parsed = parse(version, options)
  11693. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11694. }
  11695. exports.intersects = intersects
  11696. function intersects (r1, r2, options) {
  11697. r1 = new Range(r1, options)
  11698. r2 = new Range(r2, options)
  11699. return r1.intersects(r2)
  11700. }
  11701. exports.coerce = coerce
  11702. function coerce (version, options) {
  11703. if (version instanceof SemVer) {
  11704. return version
  11705. }
  11706. if (typeof version === 'number') {
  11707. version = String(version)
  11708. }
  11709. if (typeof version !== 'string') {
  11710. return null
  11711. }
  11712. options = options || {}
  11713. var match = null
  11714. if (!options.rtl) {
  11715. match = version.match(re[t.COERCE])
  11716. } else {
  11717. // Find the right-most coercible string that does not share
  11718. // a terminus with a more left-ward coercible string.
  11719. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11720. //
  11721. // Walk through the string checking with a /g regexp
  11722. // Manually set the index so as to pick up overlapping matches.
  11723. // Stop when we get a match that ends at the string end, since no
  11724. // coercible string can be more right-ward without the same terminus.
  11725. var next
  11726. while ((next = re[t.COERCERTL].exec(version)) &&
  11727. (!match || match.index + match[0].length !== version.length)
  11728. ) {
  11729. if (!match ||
  11730. next.index + next[0].length !== match.index + match[0].length) {
  11731. match = next
  11732. }
  11733. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11734. }
  11735. // leave it in a clean state
  11736. re[t.COERCERTL].lastIndex = -1
  11737. }
  11738. if (match === null) {
  11739. return null
  11740. }
  11741. return parse(match[2] +
  11742. '.' + (match[3] || '0') +
  11743. '.' + (match[4] || '0'), options)
  11744. }
  11745. /***/ }),
  11746. /***/ 669:
  11747. /***/ (function(module) {
  11748. module.exports = require("util");
  11749. /***/ }),
  11750. /***/ 672:
  11751. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11752. "use strict";
  11753. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11754. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11755. return new (P || (P = Promise))(function (resolve, reject) {
  11756. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11757. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11758. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11759. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11760. });
  11761. };
  11762. var _a;
  11763. Object.defineProperty(exports, "__esModule", { value: true });
  11764. const assert_1 = __webpack_require__(357);
  11765. const fs = __webpack_require__(747);
  11766. const path = __webpack_require__(622);
  11767. _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;
  11768. exports.IS_WINDOWS = process.platform === 'win32';
  11769. function exists(fsPath) {
  11770. return __awaiter(this, void 0, void 0, function* () {
  11771. try {
  11772. yield exports.stat(fsPath);
  11773. }
  11774. catch (err) {
  11775. if (err.code === 'ENOENT') {
  11776. return false;
  11777. }
  11778. throw err;
  11779. }
  11780. return true;
  11781. });
  11782. }
  11783. exports.exists = exists;
  11784. function isDirectory(fsPath, useStat = false) {
  11785. return __awaiter(this, void 0, void 0, function* () {
  11786. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11787. return stats.isDirectory();
  11788. });
  11789. }
  11790. exports.isDirectory = isDirectory;
  11791. /**
  11792. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11793. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11794. */
  11795. function isRooted(p) {
  11796. p = normalizeSeparators(p);
  11797. if (!p) {
  11798. throw new Error('isRooted() parameter "p" cannot be empty');
  11799. }
  11800. if (exports.IS_WINDOWS) {
  11801. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11802. ); // e.g. C: or C:\hello
  11803. }
  11804. return p.startsWith('/');
  11805. }
  11806. exports.isRooted = isRooted;
  11807. /**
  11808. * Recursively create a directory at `fsPath`.
  11809. *
  11810. * This implementation is optimistic, meaning it attempts to create the full
  11811. * path first, and backs up the path stack from there.
  11812. *
  11813. * @param fsPath The path to create
  11814. * @param maxDepth The maximum recursion depth
  11815. * @param depth The current recursion depth
  11816. */
  11817. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11818. return __awaiter(this, void 0, void 0, function* () {
  11819. assert_1.ok(fsPath, 'a path argument must be provided');
  11820. fsPath = path.resolve(fsPath);
  11821. if (depth >= maxDepth)
  11822. return exports.mkdir(fsPath);
  11823. try {
  11824. yield exports.mkdir(fsPath);
  11825. return;
  11826. }
  11827. catch (err) {
  11828. switch (err.code) {
  11829. case 'ENOENT': {
  11830. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11831. yield exports.mkdir(fsPath);
  11832. return;
  11833. }
  11834. default: {
  11835. let stats;
  11836. try {
  11837. stats = yield exports.stat(fsPath);
  11838. }
  11839. catch (err2) {
  11840. throw err;
  11841. }
  11842. if (!stats.isDirectory())
  11843. throw err;
  11844. }
  11845. }
  11846. }
  11847. });
  11848. }
  11849. exports.mkdirP = mkdirP;
  11850. /**
  11851. * Best effort attempt to determine whether a file exists and is executable.
  11852. * @param filePath file path to check
  11853. * @param extensions additional file extensions to try
  11854. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11855. */
  11856. function tryGetExecutablePath(filePath, extensions) {
  11857. return __awaiter(this, void 0, void 0, function* () {
  11858. let stats = undefined;
  11859. try {
  11860. // test file exists
  11861. stats = yield exports.stat(filePath);
  11862. }
  11863. catch (err) {
  11864. if (err.code !== 'ENOENT') {
  11865. // eslint-disable-next-line no-console
  11866. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11867. }
  11868. }
  11869. if (stats && stats.isFile()) {
  11870. if (exports.IS_WINDOWS) {
  11871. // on Windows, test for valid extension
  11872. const upperExt = path.extname(filePath).toUpperCase();
  11873. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11874. return filePath;
  11875. }
  11876. }
  11877. else {
  11878. if (isUnixExecutable(stats)) {
  11879. return filePath;
  11880. }
  11881. }
  11882. }
  11883. // try each extension
  11884. const originalFilePath = filePath;
  11885. for (const extension of extensions) {
  11886. filePath = originalFilePath + extension;
  11887. stats = undefined;
  11888. try {
  11889. stats = yield exports.stat(filePath);
  11890. }
  11891. catch (err) {
  11892. if (err.code !== 'ENOENT') {
  11893. // eslint-disable-next-line no-console
  11894. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11895. }
  11896. }
  11897. if (stats && stats.isFile()) {
  11898. if (exports.IS_WINDOWS) {
  11899. // preserve the case of the actual file (since an extension was appended)
  11900. try {
  11901. const directory = path.dirname(filePath);
  11902. const upperName = path.basename(filePath).toUpperCase();
  11903. for (const actualName of yield exports.readdir(directory)) {
  11904. if (upperName === actualName.toUpperCase()) {
  11905. filePath = path.join(directory, actualName);
  11906. break;
  11907. }
  11908. }
  11909. }
  11910. catch (err) {
  11911. // eslint-disable-next-line no-console
  11912. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11913. }
  11914. return filePath;
  11915. }
  11916. else {
  11917. if (isUnixExecutable(stats)) {
  11918. return filePath;
  11919. }
  11920. }
  11921. }
  11922. }
  11923. return '';
  11924. });
  11925. }
  11926. exports.tryGetExecutablePath = tryGetExecutablePath;
  11927. function normalizeSeparators(p) {
  11928. p = p || '';
  11929. if (exports.IS_WINDOWS) {
  11930. // convert slashes on Windows
  11931. p = p.replace(/\//g, '\\');
  11932. // remove redundant slashes
  11933. return p.replace(/\\\\+/g, '\\');
  11934. }
  11935. // remove redundant slashes
  11936. return p.replace(/\/\/+/g, '/');
  11937. }
  11938. // on Mac/Linux, test the execute bit
  11939. // R W X R W X R W X
  11940. // 256 128 64 32 16 8 4 2 1
  11941. function isUnixExecutable(stats) {
  11942. return ((stats.mode & 1) > 0 ||
  11943. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11944. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11945. }
  11946. //# sourceMappingURL=io-util.js.map
  11947. /***/ }),
  11948. /***/ 674:
  11949. /***/ (function(module, __unusedexports, __webpack_require__) {
  11950. module.exports = authenticate;
  11951. const { Deprecation } = __webpack_require__(692);
  11952. const once = __webpack_require__(969);
  11953. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11954. function authenticate(state, options) {
  11955. deprecateAuthenticate(
  11956. state.octokit.log,
  11957. new Deprecation(
  11958. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11959. )
  11960. );
  11961. if (!options) {
  11962. state.auth = false;
  11963. return;
  11964. }
  11965. switch (options.type) {
  11966. case "basic":
  11967. if (!options.username || !options.password) {
  11968. throw new Error(
  11969. "Basic authentication requires both a username and password to be set"
  11970. );
  11971. }
  11972. break;
  11973. case "oauth":
  11974. if (!options.token && !(options.key && options.secret)) {
  11975. throw new Error(
  11976. "OAuth2 authentication requires a token or key & secret to be set"
  11977. );
  11978. }
  11979. break;
  11980. case "token":
  11981. case "app":
  11982. if (!options.token) {
  11983. throw new Error("Token authentication requires a token to be set");
  11984. }
  11985. break;
  11986. default:
  11987. throw new Error(
  11988. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11989. );
  11990. }
  11991. state.auth = options;
  11992. }
  11993. /***/ }),
  11994. /***/ 675:
  11995. /***/ (function(module) {
  11996. module.exports = function btoa(str) {
  11997. return new Buffer(str).toString('base64')
  11998. }
  11999. /***/ }),
  12000. /***/ 692:
  12001. /***/ (function(__unusedmodule, exports) {
  12002. "use strict";
  12003. Object.defineProperty(exports, '__esModule', { value: true });
  12004. class Deprecation extends Error {
  12005. constructor(message) {
  12006. super(message); // Maintains proper stack trace (only available on V8)
  12007. /* istanbul ignore next */
  12008. if (Error.captureStackTrace) {
  12009. Error.captureStackTrace(this, this.constructor);
  12010. }
  12011. this.name = 'Deprecation';
  12012. }
  12013. }
  12014. exports.Deprecation = Deprecation;
  12015. /***/ }),
  12016. /***/ 696:
  12017. /***/ (function(module) {
  12018. "use strict";
  12019. /*!
  12020. * isobject <https://github.com/jonschlinkert/isobject>
  12021. *
  12022. * Copyright (c) 2014-2017, Jon Schlinkert.
  12023. * Released under the MIT License.
  12024. */
  12025. function isObject(val) {
  12026. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12027. }
  12028. /*!
  12029. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12030. *
  12031. * Copyright (c) 2014-2017, Jon Schlinkert.
  12032. * Released under the MIT License.
  12033. */
  12034. function isObjectObject(o) {
  12035. return isObject(o) === true
  12036. && Object.prototype.toString.call(o) === '[object Object]';
  12037. }
  12038. function isPlainObject(o) {
  12039. var ctor,prot;
  12040. if (isObjectObject(o) === false) return false;
  12041. // If has modified constructor
  12042. ctor = o.constructor;
  12043. if (typeof ctor !== 'function') return false;
  12044. // If has modified prototype
  12045. prot = ctor.prototype;
  12046. if (isObjectObject(prot) === false) return false;
  12047. // If constructor does not have an Object-specific method
  12048. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12049. return false;
  12050. }
  12051. // Most likely a plain Object
  12052. return true;
  12053. }
  12054. module.exports = isPlainObject;
  12055. /***/ }),
  12056. /***/ 697:
  12057. /***/ (function(module) {
  12058. "use strict";
  12059. module.exports = (promise, onFinally) => {
  12060. onFinally = onFinally || (() => {});
  12061. return promise.then(
  12062. val => new Promise(resolve => {
  12063. resolve(onFinally());
  12064. }).then(() => val),
  12065. err => new Promise(resolve => {
  12066. resolve(onFinally());
  12067. }).then(() => {
  12068. throw err;
  12069. })
  12070. );
  12071. };
  12072. /***/ }),
  12073. /***/ 722:
  12074. /***/ (function(module) {
  12075. /**
  12076. * Convert array of 16 byte values to UUID string format of the form:
  12077. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12078. */
  12079. var byteToHex = [];
  12080. for (var i = 0; i < 256; ++i) {
  12081. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12082. }
  12083. function bytesToUuid(buf, offset) {
  12084. var i = offset || 0;
  12085. var bth = byteToHex;
  12086. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12087. return ([bth[buf[i++]], bth[buf[i++]],
  12088. bth[buf[i++]], bth[buf[i++]], '-',
  12089. bth[buf[i++]], bth[buf[i++]], '-',
  12090. bth[buf[i++]], bth[buf[i++]], '-',
  12091. bth[buf[i++]], bth[buf[i++]], '-',
  12092. bth[buf[i++]], bth[buf[i++]],
  12093. bth[buf[i++]], bth[buf[i++]],
  12094. bth[buf[i++]], bth[buf[i++]]]).join('');
  12095. }
  12096. module.exports = bytesToUuid;
  12097. /***/ }),
  12098. /***/ 742:
  12099. /***/ (function(module, __unusedexports, __webpack_require__) {
  12100. var fs = __webpack_require__(747)
  12101. var core
  12102. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12103. core = __webpack_require__(818)
  12104. } else {
  12105. core = __webpack_require__(197)
  12106. }
  12107. module.exports = isexe
  12108. isexe.sync = sync
  12109. function isexe (path, options, cb) {
  12110. if (typeof options === 'function') {
  12111. cb = options
  12112. options = {}
  12113. }
  12114. if (!cb) {
  12115. if (typeof Promise !== 'function') {
  12116. throw new TypeError('callback not provided')
  12117. }
  12118. return new Promise(function (resolve, reject) {
  12119. isexe(path, options || {}, function (er, is) {
  12120. if (er) {
  12121. reject(er)
  12122. } else {
  12123. resolve(is)
  12124. }
  12125. })
  12126. })
  12127. }
  12128. core(path, options || {}, function (er, is) {
  12129. // ignore EACCES because that just means we aren't allowed to run it
  12130. if (er) {
  12131. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12132. er = null
  12133. is = false
  12134. }
  12135. }
  12136. cb(er, is)
  12137. })
  12138. }
  12139. function sync (path, options) {
  12140. // my kingdom for a filtered catch
  12141. try {
  12142. return core.sync(path, options || {})
  12143. } catch (er) {
  12144. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12145. return false
  12146. } else {
  12147. throw er
  12148. }
  12149. }
  12150. }
  12151. /***/ }),
  12152. /***/ 747:
  12153. /***/ (function(module) {
  12154. module.exports = require("fs");
  12155. /***/ }),
  12156. /***/ 753:
  12157. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12158. "use strict";
  12159. Object.defineProperty(exports, '__esModule', { value: true });
  12160. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12161. var endpoint = __webpack_require__(385);
  12162. var universalUserAgent = __webpack_require__(211);
  12163. var isPlainObject = _interopDefault(__webpack_require__(696));
  12164. var nodeFetch = _interopDefault(__webpack_require__(454));
  12165. var requestError = __webpack_require__(463);
  12166. const VERSION = "5.4.2";
  12167. function getBufferResponse(response) {
  12168. return response.arrayBuffer();
  12169. }
  12170. function fetchWrapper(requestOptions) {
  12171. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12172. requestOptions.body = JSON.stringify(requestOptions.body);
  12173. }
  12174. let headers = {};
  12175. let status;
  12176. let url;
  12177. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12178. return fetch(requestOptions.url, Object.assign({
  12179. method: requestOptions.method,
  12180. body: requestOptions.body,
  12181. headers: requestOptions.headers,
  12182. redirect: requestOptions.redirect
  12183. }, requestOptions.request)).then(response => {
  12184. url = response.url;
  12185. status = response.status;
  12186. for (const keyAndValue of response.headers) {
  12187. headers[keyAndValue[0]] = keyAndValue[1];
  12188. }
  12189. if (status === 204 || status === 205) {
  12190. return;
  12191. } // GitHub API returns 200 for HEAD requests
  12192. if (requestOptions.method === "HEAD") {
  12193. if (status < 400) {
  12194. return;
  12195. }
  12196. throw new requestError.RequestError(response.statusText, status, {
  12197. headers,
  12198. request: requestOptions
  12199. });
  12200. }
  12201. if (status === 304) {
  12202. throw new requestError.RequestError("Not modified", status, {
  12203. headers,
  12204. request: requestOptions
  12205. });
  12206. }
  12207. if (status >= 400) {
  12208. return response.text().then(message => {
  12209. const error = new requestError.RequestError(message, status, {
  12210. headers,
  12211. request: requestOptions
  12212. });
  12213. try {
  12214. let responseBody = JSON.parse(error.message);
  12215. Object.assign(error, responseBody);
  12216. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12217. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12218. } catch (e) {// ignore, see octokit/rest.js#684
  12219. }
  12220. throw error;
  12221. });
  12222. }
  12223. const contentType = response.headers.get("content-type");
  12224. if (/application\/json/.test(contentType)) {
  12225. return response.json();
  12226. }
  12227. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12228. return response.text();
  12229. }
  12230. return getBufferResponse(response);
  12231. }).then(data => {
  12232. return {
  12233. status,
  12234. url,
  12235. headers,
  12236. data
  12237. };
  12238. }).catch(error => {
  12239. if (error instanceof requestError.RequestError) {
  12240. throw error;
  12241. }
  12242. throw new requestError.RequestError(error.message, 500, {
  12243. headers,
  12244. request: requestOptions
  12245. });
  12246. });
  12247. }
  12248. function withDefaults(oldEndpoint, newDefaults) {
  12249. const endpoint = oldEndpoint.defaults(newDefaults);
  12250. const newApi = function (route, parameters) {
  12251. const endpointOptions = endpoint.merge(route, parameters);
  12252. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12253. return fetchWrapper(endpoint.parse(endpointOptions));
  12254. }
  12255. const request = (route, parameters) => {
  12256. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12257. };
  12258. Object.assign(request, {
  12259. endpoint,
  12260. defaults: withDefaults.bind(null, endpoint)
  12261. });
  12262. return endpointOptions.request.hook(request, endpointOptions);
  12263. };
  12264. return Object.assign(newApi, {
  12265. endpoint,
  12266. defaults: withDefaults.bind(null, endpoint)
  12267. });
  12268. }
  12269. const request = withDefaults(endpoint.endpoint, {
  12270. headers: {
  12271. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12272. }
  12273. });
  12274. exports.request = request;
  12275. //# sourceMappingURL=index.js.map
  12276. /***/ }),
  12277. /***/ 761:
  12278. /***/ (function(module) {
  12279. module.exports = require("zlib");
  12280. /***/ }),
  12281. /***/ 763:
  12282. /***/ (function(module) {
  12283. module.exports = removeHook
  12284. function removeHook (state, name, method) {
  12285. if (!state.registry[name]) {
  12286. return
  12287. }
  12288. var index = state.registry[name]
  12289. .map(function (registered) { return registered.orig })
  12290. .indexOf(method)
  12291. if (index === -1) {
  12292. return
  12293. }
  12294. state.registry[name].splice(index, 1)
  12295. }
  12296. /***/ }),
  12297. /***/ 768:
  12298. /***/ (function(module) {
  12299. "use strict";
  12300. module.exports = function (x) {
  12301. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12302. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12303. if (x[x.length - 1] === lf) {
  12304. x = x.slice(0, x.length - 1);
  12305. }
  12306. if (x[x.length - 1] === cr) {
  12307. x = x.slice(0, x.length - 1);
  12308. }
  12309. return x;
  12310. };
  12311. /***/ }),
  12312. /***/ 777:
  12313. /***/ (function(module, __unusedexports, __webpack_require__) {
  12314. module.exports = getFirstPage
  12315. const getPage = __webpack_require__(265)
  12316. function getFirstPage (octokit, link, headers) {
  12317. return getPage(octokit, link, 'first', headers)
  12318. }
  12319. /***/ }),
  12320. /***/ 796:
  12321. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12322. "use strict";
  12323. Object.defineProperty(exports, '__esModule', { value: true });
  12324. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12325. var osName = _interopDefault(__webpack_require__(2));
  12326. function getUserAgent() {
  12327. try {
  12328. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12329. } catch (error) {
  12330. if (/wmic os get Caption/.test(error.message)) {
  12331. return "Windows <version undetectable>";
  12332. }
  12333. throw error;
  12334. }
  12335. }
  12336. exports.getUserAgent = getUserAgent;
  12337. //# sourceMappingURL=index.js.map
  12338. /***/ }),
  12339. /***/ 813:
  12340. /***/ (function(__unusedmodule, exports) {
  12341. "use strict";
  12342. Object.defineProperty(exports, '__esModule', { value: true });
  12343. async function auth(token) {
  12344. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12345. return {
  12346. type: "token",
  12347. token: token,
  12348. tokenType
  12349. };
  12350. }
  12351. /**
  12352. * Prefix token for usage in the Authorization header
  12353. *
  12354. * @param token OAuth token or JSON Web Token
  12355. */
  12356. function withAuthorizationPrefix(token) {
  12357. if (token.split(/\./).length === 3) {
  12358. return `bearer ${token}`;
  12359. }
  12360. return `token ${token}`;
  12361. }
  12362. async function hook(token, request, route, parameters) {
  12363. const endpoint = request.endpoint.merge(route, parameters);
  12364. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12365. return request(endpoint);
  12366. }
  12367. const createTokenAuth = function createTokenAuth(token) {
  12368. if (!token) {
  12369. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12370. }
  12371. if (typeof token !== "string") {
  12372. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12373. }
  12374. token = token.replace(/^(token|bearer) +/i, "");
  12375. return Object.assign(auth.bind(null, token), {
  12376. hook: hook.bind(null, token)
  12377. });
  12378. };
  12379. exports.createTokenAuth = createTokenAuth;
  12380. //# sourceMappingURL=index.js.map
  12381. /***/ }),
  12382. /***/ 814:
  12383. /***/ (function(module, __unusedexports, __webpack_require__) {
  12384. module.exports = which
  12385. which.sync = whichSync
  12386. var isWindows = process.platform === 'win32' ||
  12387. process.env.OSTYPE === 'cygwin' ||
  12388. process.env.OSTYPE === 'msys'
  12389. var path = __webpack_require__(622)
  12390. var COLON = isWindows ? ';' : ':'
  12391. var isexe = __webpack_require__(742)
  12392. function getNotFoundError (cmd) {
  12393. var er = new Error('not found: ' + cmd)
  12394. er.code = 'ENOENT'
  12395. return er
  12396. }
  12397. function getPathInfo (cmd, opt) {
  12398. var colon = opt.colon || COLON
  12399. var pathEnv = opt.path || process.env.PATH || ''
  12400. var pathExt = ['']
  12401. pathEnv = pathEnv.split(colon)
  12402. var pathExtExe = ''
  12403. if (isWindows) {
  12404. pathEnv.unshift(process.cwd())
  12405. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12406. pathExt = pathExtExe.split(colon)
  12407. // Always test the cmd itself first. isexe will check to make sure
  12408. // it's found in the pathExt set.
  12409. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12410. pathExt.unshift('')
  12411. }
  12412. // If it has a slash, then we don't bother searching the pathenv.
  12413. // just check the file itself, and that's it.
  12414. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12415. pathEnv = ['']
  12416. return {
  12417. env: pathEnv,
  12418. ext: pathExt,
  12419. extExe: pathExtExe
  12420. }
  12421. }
  12422. function which (cmd, opt, cb) {
  12423. if (typeof opt === 'function') {
  12424. cb = opt
  12425. opt = {}
  12426. }
  12427. var info = getPathInfo(cmd, opt)
  12428. var pathEnv = info.env
  12429. var pathExt = info.ext
  12430. var pathExtExe = info.extExe
  12431. var found = []
  12432. ;(function F (i, l) {
  12433. if (i === l) {
  12434. if (opt.all && found.length)
  12435. return cb(null, found)
  12436. else
  12437. return cb(getNotFoundError(cmd))
  12438. }
  12439. var pathPart = pathEnv[i]
  12440. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12441. pathPart = pathPart.slice(1, -1)
  12442. var p = path.join(pathPart, cmd)
  12443. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12444. p = cmd.slice(0, 2) + p
  12445. }
  12446. ;(function E (ii, ll) {
  12447. if (ii === ll) return F(i + 1, l)
  12448. var ext = pathExt[ii]
  12449. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12450. if (!er && is) {
  12451. if (opt.all)
  12452. found.push(p + ext)
  12453. else
  12454. return cb(null, p + ext)
  12455. }
  12456. return E(ii + 1, ll)
  12457. })
  12458. })(0, pathExt.length)
  12459. })(0, pathEnv.length)
  12460. }
  12461. function whichSync (cmd, opt) {
  12462. opt = opt || {}
  12463. var info = getPathInfo(cmd, opt)
  12464. var pathEnv = info.env
  12465. var pathExt = info.ext
  12466. var pathExtExe = info.extExe
  12467. var found = []
  12468. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12469. var pathPart = pathEnv[i]
  12470. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12471. pathPart = pathPart.slice(1, -1)
  12472. var p = path.join(pathPart, cmd)
  12473. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12474. p = cmd.slice(0, 2) + p
  12475. }
  12476. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12477. var cur = p + pathExt[j]
  12478. var is
  12479. try {
  12480. is = isexe.sync(cur, { pathExt: pathExtExe })
  12481. if (is) {
  12482. if (opt.all)
  12483. found.push(cur)
  12484. else
  12485. return cur
  12486. }
  12487. } catch (ex) {}
  12488. }
  12489. }
  12490. if (opt.all && found.length)
  12491. return found
  12492. if (opt.nothrow)
  12493. return null
  12494. throw getNotFoundError(cmd)
  12495. }
  12496. /***/ }),
  12497. /***/ 816:
  12498. /***/ (function(module) {
  12499. "use strict";
  12500. module.exports = /^#!.*/;
  12501. /***/ }),
  12502. /***/ 818:
  12503. /***/ (function(module, __unusedexports, __webpack_require__) {
  12504. module.exports = isexe
  12505. isexe.sync = sync
  12506. var fs = __webpack_require__(747)
  12507. function checkPathExt (path, options) {
  12508. var pathext = options.pathExt !== undefined ?
  12509. options.pathExt : process.env.PATHEXT
  12510. if (!pathext) {
  12511. return true
  12512. }
  12513. pathext = pathext.split(';')
  12514. if (pathext.indexOf('') !== -1) {
  12515. return true
  12516. }
  12517. for (var i = 0; i < pathext.length; i++) {
  12518. var p = pathext[i].toLowerCase()
  12519. if (p && path.substr(-p.length).toLowerCase() === p) {
  12520. return true
  12521. }
  12522. }
  12523. return false
  12524. }
  12525. function checkStat (stat, path, options) {
  12526. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12527. return false
  12528. }
  12529. return checkPathExt(path, options)
  12530. }
  12531. function isexe (path, options, cb) {
  12532. fs.stat(path, function (er, stat) {
  12533. cb(er, er ? false : checkStat(stat, path, options))
  12534. })
  12535. }
  12536. function sync (path, options) {
  12537. return checkStat(fs.statSync(path), path, options)
  12538. }
  12539. /***/ }),
  12540. /***/ 821:
  12541. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12542. "use strict";
  12543. var __importStar = (this && this.__importStar) || function (mod) {
  12544. if (mod && mod.__esModule) return mod;
  12545. var result = {};
  12546. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12547. result["default"] = mod;
  12548. return result;
  12549. };
  12550. Object.defineProperty(exports, "__esModule", { value: true });
  12551. const core = __importStar(__webpack_require__(470));
  12552. const fsHelper = __importStar(__webpack_require__(618));
  12553. const github = __importStar(__webpack_require__(469));
  12554. const path = __importStar(__webpack_require__(622));
  12555. function getInputs() {
  12556. const result = {};
  12557. // GitHub workspace
  12558. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12559. if (!githubWorkspacePath) {
  12560. throw new Error('GITHUB_WORKSPACE not defined');
  12561. }
  12562. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12563. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12564. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12565. // Qualified repository
  12566. const qualifiedRepository = core.getInput('repository') ||
  12567. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12568. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12569. const splitRepository = qualifiedRepository.split('/');
  12570. if (splitRepository.length !== 2 ||
  12571. !splitRepository[0] ||
  12572. !splitRepository[1]) {
  12573. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12574. }
  12575. result.repositoryOwner = splitRepository[0];
  12576. result.repositoryName = splitRepository[1];
  12577. // Repository path
  12578. result.repositoryPath = core.getInput('path') || '.';
  12579. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12580. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12581. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12582. }
  12583. // Workflow repository?
  12584. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12585. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12586. // Source branch, source version
  12587. result.ref = core.getInput('ref');
  12588. if (!result.ref) {
  12589. if (isWorkflowRepository) {
  12590. result.ref = github.context.ref;
  12591. result.commit = github.context.sha;
  12592. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12593. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12594. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12595. result.ref = `refs/heads/${result.ref}`;
  12596. }
  12597. }
  12598. }
  12599. // SHA?
  12600. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12601. result.commit = result.ref;
  12602. result.ref = '';
  12603. }
  12604. core.debug(`ref = '${result.ref}'`);
  12605. core.debug(`commit = '${result.commit}'`);
  12606. // Clean
  12607. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12608. core.debug(`clean = ${result.clean}`);
  12609. // Fetch depth
  12610. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12611. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12612. result.fetchDepth = 0;
  12613. }
  12614. core.debug(`fetch depth = ${result.fetchDepth}`);
  12615. // LFS
  12616. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12617. core.debug(`lfs = ${result.lfs}`);
  12618. // Submodules
  12619. result.submodules = false;
  12620. result.nestedSubmodules = false;
  12621. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12622. if (submodulesString == 'RECURSIVE') {
  12623. result.submodules = true;
  12624. result.nestedSubmodules = true;
  12625. }
  12626. else if (submodulesString == 'TRUE') {
  12627. result.submodules = true;
  12628. }
  12629. core.debug(`submodules = ${result.submodules}`);
  12630. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12631. // Auth token
  12632. result.authToken = core.getInput('token', { required: true });
  12633. // SSH
  12634. result.sshKey = core.getInput('ssh-key');
  12635. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12636. result.sshStrict =
  12637. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12638. // Persist credentials
  12639. result.persistCredentials =
  12640. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12641. return result;
  12642. }
  12643. exports.getInputs = getInputs;
  12644. /***/ }),
  12645. /***/ 826:
  12646. /***/ (function(module, __unusedexports, __webpack_require__) {
  12647. var rng = __webpack_require__(139);
  12648. var bytesToUuid = __webpack_require__(722);
  12649. function v4(options, buf, offset) {
  12650. var i = buf && offset || 0;
  12651. if (typeof(options) == 'string') {
  12652. buf = options === 'binary' ? new Array(16) : null;
  12653. options = null;
  12654. }
  12655. options = options || {};
  12656. var rnds = options.random || (options.rng || rng)();
  12657. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12658. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12659. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12660. // Copy bytes to buffer, if provided
  12661. if (buf) {
  12662. for (var ii = 0; ii < 16; ++ii) {
  12663. buf[i + ii] = rnds[ii];
  12664. }
  12665. }
  12666. return buf || bytesToUuid(rnds);
  12667. }
  12668. module.exports = v4;
  12669. /***/ }),
  12670. /***/ 835:
  12671. /***/ (function(module) {
  12672. module.exports = require("url");
  12673. /***/ }),
  12674. /***/ 842:
  12675. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12676. "use strict";
  12677. Object.defineProperty(exports, '__esModule', { value: true });
  12678. var deprecation = __webpack_require__(692);
  12679. var endpointsByScope = {
  12680. actions: {
  12681. cancelWorkflowRun: {
  12682. method: "POST",
  12683. params: {
  12684. owner: {
  12685. required: true,
  12686. type: "string"
  12687. },
  12688. repo: {
  12689. required: true,
  12690. type: "string"
  12691. },
  12692. run_id: {
  12693. required: true,
  12694. type: "integer"
  12695. }
  12696. },
  12697. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12698. },
  12699. createOrUpdateSecretForRepo: {
  12700. method: "PUT",
  12701. params: {
  12702. encrypted_value: {
  12703. type: "string"
  12704. },
  12705. key_id: {
  12706. type: "string"
  12707. },
  12708. name: {
  12709. required: true,
  12710. type: "string"
  12711. },
  12712. owner: {
  12713. required: true,
  12714. type: "string"
  12715. },
  12716. repo: {
  12717. required: true,
  12718. type: "string"
  12719. }
  12720. },
  12721. url: "/repos/:owner/:repo/actions/secrets/:name"
  12722. },
  12723. createRegistrationToken: {
  12724. method: "POST",
  12725. params: {
  12726. owner: {
  12727. required: true,
  12728. type: "string"
  12729. },
  12730. repo: {
  12731. required: true,
  12732. type: "string"
  12733. }
  12734. },
  12735. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12736. },
  12737. createRemoveToken: {
  12738. method: "POST",
  12739. params: {
  12740. owner: {
  12741. required: true,
  12742. type: "string"
  12743. },
  12744. repo: {
  12745. required: true,
  12746. type: "string"
  12747. }
  12748. },
  12749. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12750. },
  12751. deleteArtifact: {
  12752. method: "DELETE",
  12753. params: {
  12754. artifact_id: {
  12755. required: true,
  12756. type: "integer"
  12757. },
  12758. owner: {
  12759. required: true,
  12760. type: "string"
  12761. },
  12762. repo: {
  12763. required: true,
  12764. type: "string"
  12765. }
  12766. },
  12767. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12768. },
  12769. deleteSecretFromRepo: {
  12770. method: "DELETE",
  12771. params: {
  12772. name: {
  12773. required: true,
  12774. type: "string"
  12775. },
  12776. owner: {
  12777. required: true,
  12778. type: "string"
  12779. },
  12780. repo: {
  12781. required: true,
  12782. type: "string"
  12783. }
  12784. },
  12785. url: "/repos/:owner/:repo/actions/secrets/:name"
  12786. },
  12787. downloadArtifact: {
  12788. method: "GET",
  12789. params: {
  12790. archive_format: {
  12791. required: true,
  12792. type: "string"
  12793. },
  12794. artifact_id: {
  12795. required: true,
  12796. type: "integer"
  12797. },
  12798. owner: {
  12799. required: true,
  12800. type: "string"
  12801. },
  12802. repo: {
  12803. required: true,
  12804. type: "string"
  12805. }
  12806. },
  12807. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12808. },
  12809. getArtifact: {
  12810. method: "GET",
  12811. params: {
  12812. artifact_id: {
  12813. required: true,
  12814. type: "integer"
  12815. },
  12816. owner: {
  12817. required: true,
  12818. type: "string"
  12819. },
  12820. repo: {
  12821. required: true,
  12822. type: "string"
  12823. }
  12824. },
  12825. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12826. },
  12827. getPublicKey: {
  12828. method: "GET",
  12829. params: {
  12830. owner: {
  12831. required: true,
  12832. type: "string"
  12833. },
  12834. repo: {
  12835. required: true,
  12836. type: "string"
  12837. }
  12838. },
  12839. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12840. },
  12841. getSecret: {
  12842. method: "GET",
  12843. params: {
  12844. name: {
  12845. required: true,
  12846. type: "string"
  12847. },
  12848. owner: {
  12849. required: true,
  12850. type: "string"
  12851. },
  12852. page: {
  12853. type: "integer"
  12854. },
  12855. per_page: {
  12856. type: "integer"
  12857. },
  12858. repo: {
  12859. required: true,
  12860. type: "string"
  12861. }
  12862. },
  12863. url: "/repos/:owner/:repo/actions/secrets/:name"
  12864. },
  12865. getSelfHostedRunner: {
  12866. method: "GET",
  12867. params: {
  12868. owner: {
  12869. required: true,
  12870. type: "string"
  12871. },
  12872. repo: {
  12873. required: true,
  12874. type: "string"
  12875. },
  12876. runner_id: {
  12877. required: true,
  12878. type: "integer"
  12879. }
  12880. },
  12881. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12882. },
  12883. getWorkflow: {
  12884. method: "GET",
  12885. params: {
  12886. owner: {
  12887. required: true,
  12888. type: "string"
  12889. },
  12890. repo: {
  12891. required: true,
  12892. type: "string"
  12893. },
  12894. workflow_id: {
  12895. required: true,
  12896. type: "integer"
  12897. }
  12898. },
  12899. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12900. },
  12901. getWorkflowJob: {
  12902. method: "GET",
  12903. params: {
  12904. job_id: {
  12905. required: true,
  12906. type: "integer"
  12907. },
  12908. owner: {
  12909. required: true,
  12910. type: "string"
  12911. },
  12912. repo: {
  12913. required: true,
  12914. type: "string"
  12915. }
  12916. },
  12917. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12918. },
  12919. getWorkflowRun: {
  12920. method: "GET",
  12921. params: {
  12922. owner: {
  12923. required: true,
  12924. type: "string"
  12925. },
  12926. repo: {
  12927. required: true,
  12928. type: "string"
  12929. },
  12930. run_id: {
  12931. required: true,
  12932. type: "integer"
  12933. }
  12934. },
  12935. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12936. },
  12937. listDownloadsForSelfHostedRunnerApplication: {
  12938. method: "GET",
  12939. params: {
  12940. owner: {
  12941. required: true,
  12942. type: "string"
  12943. },
  12944. repo: {
  12945. required: true,
  12946. type: "string"
  12947. }
  12948. },
  12949. url: "/repos/:owner/:repo/actions/runners/downloads"
  12950. },
  12951. listJobsForWorkflowRun: {
  12952. method: "GET",
  12953. params: {
  12954. owner: {
  12955. required: true,
  12956. type: "string"
  12957. },
  12958. page: {
  12959. type: "integer"
  12960. },
  12961. per_page: {
  12962. type: "integer"
  12963. },
  12964. repo: {
  12965. required: true,
  12966. type: "string"
  12967. },
  12968. run_id: {
  12969. required: true,
  12970. type: "integer"
  12971. }
  12972. },
  12973. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  12974. },
  12975. listRepoWorkflowRuns: {
  12976. method: "GET",
  12977. params: {
  12978. actor: {
  12979. type: "string"
  12980. },
  12981. branch: {
  12982. type: "string"
  12983. },
  12984. event: {
  12985. type: "string"
  12986. },
  12987. owner: {
  12988. required: true,
  12989. type: "string"
  12990. },
  12991. page: {
  12992. type: "integer"
  12993. },
  12994. per_page: {
  12995. type: "integer"
  12996. },
  12997. repo: {
  12998. required: true,
  12999. type: "string"
  13000. },
  13001. status: {
  13002. enum: ["completed", "status", "conclusion"],
  13003. type: "string"
  13004. }
  13005. },
  13006. url: "/repos/:owner/:repo/actions/runs"
  13007. },
  13008. listRepoWorkflows: {
  13009. method: "GET",
  13010. params: {
  13011. owner: {
  13012. required: true,
  13013. type: "string"
  13014. },
  13015. page: {
  13016. type: "integer"
  13017. },
  13018. per_page: {
  13019. type: "integer"
  13020. },
  13021. repo: {
  13022. required: true,
  13023. type: "string"
  13024. }
  13025. },
  13026. url: "/repos/:owner/:repo/actions/workflows"
  13027. },
  13028. listSecretsForRepo: {
  13029. method: "GET",
  13030. params: {
  13031. owner: {
  13032. required: true,
  13033. type: "string"
  13034. },
  13035. page: {
  13036. type: "integer"
  13037. },
  13038. per_page: {
  13039. type: "integer"
  13040. },
  13041. repo: {
  13042. required: true,
  13043. type: "string"
  13044. }
  13045. },
  13046. url: "/repos/:owner/:repo/actions/secrets"
  13047. },
  13048. listSelfHostedRunnersForRepo: {
  13049. method: "GET",
  13050. params: {
  13051. owner: {
  13052. required: true,
  13053. type: "string"
  13054. },
  13055. page: {
  13056. type: "integer"
  13057. },
  13058. per_page: {
  13059. type: "integer"
  13060. },
  13061. repo: {
  13062. required: true,
  13063. type: "string"
  13064. }
  13065. },
  13066. url: "/repos/:owner/:repo/actions/runners"
  13067. },
  13068. listWorkflowJobLogs: {
  13069. method: "GET",
  13070. params: {
  13071. job_id: {
  13072. required: true,
  13073. type: "integer"
  13074. },
  13075. owner: {
  13076. required: true,
  13077. type: "string"
  13078. },
  13079. page: {
  13080. type: "integer"
  13081. },
  13082. per_page: {
  13083. type: "integer"
  13084. },
  13085. repo: {
  13086. required: true,
  13087. type: "string"
  13088. }
  13089. },
  13090. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13091. },
  13092. listWorkflowRunArtifacts: {
  13093. method: "GET",
  13094. params: {
  13095. owner: {
  13096. required: true,
  13097. type: "string"
  13098. },
  13099. page: {
  13100. type: "integer"
  13101. },
  13102. per_page: {
  13103. type: "integer"
  13104. },
  13105. repo: {
  13106. required: true,
  13107. type: "string"
  13108. },
  13109. run_id: {
  13110. required: true,
  13111. type: "integer"
  13112. }
  13113. },
  13114. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13115. },
  13116. listWorkflowRunLogs: {
  13117. method: "GET",
  13118. params: {
  13119. owner: {
  13120. required: true,
  13121. type: "string"
  13122. },
  13123. page: {
  13124. type: "integer"
  13125. },
  13126. per_page: {
  13127. type: "integer"
  13128. },
  13129. repo: {
  13130. required: true,
  13131. type: "string"
  13132. },
  13133. run_id: {
  13134. required: true,
  13135. type: "integer"
  13136. }
  13137. },
  13138. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13139. },
  13140. listWorkflowRuns: {
  13141. method: "GET",
  13142. params: {
  13143. actor: {
  13144. type: "string"
  13145. },
  13146. branch: {
  13147. type: "string"
  13148. },
  13149. event: {
  13150. type: "string"
  13151. },
  13152. owner: {
  13153. required: true,
  13154. type: "string"
  13155. },
  13156. page: {
  13157. type: "integer"
  13158. },
  13159. per_page: {
  13160. type: "integer"
  13161. },
  13162. repo: {
  13163. required: true,
  13164. type: "string"
  13165. },
  13166. status: {
  13167. enum: ["completed", "status", "conclusion"],
  13168. type: "string"
  13169. },
  13170. workflow_id: {
  13171. required: true,
  13172. type: "integer"
  13173. }
  13174. },
  13175. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13176. },
  13177. reRunWorkflow: {
  13178. method: "POST",
  13179. params: {
  13180. owner: {
  13181. required: true,
  13182. type: "string"
  13183. },
  13184. repo: {
  13185. required: true,
  13186. type: "string"
  13187. },
  13188. run_id: {
  13189. required: true,
  13190. type: "integer"
  13191. }
  13192. },
  13193. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13194. },
  13195. removeSelfHostedRunner: {
  13196. method: "DELETE",
  13197. params: {
  13198. owner: {
  13199. required: true,
  13200. type: "string"
  13201. },
  13202. repo: {
  13203. required: true,
  13204. type: "string"
  13205. },
  13206. runner_id: {
  13207. required: true,
  13208. type: "integer"
  13209. }
  13210. },
  13211. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13212. }
  13213. },
  13214. activity: {
  13215. checkStarringRepo: {
  13216. method: "GET",
  13217. params: {
  13218. owner: {
  13219. required: true,
  13220. type: "string"
  13221. },
  13222. repo: {
  13223. required: true,
  13224. type: "string"
  13225. }
  13226. },
  13227. url: "/user/starred/:owner/:repo"
  13228. },
  13229. deleteRepoSubscription: {
  13230. method: "DELETE",
  13231. params: {
  13232. owner: {
  13233. required: true,
  13234. type: "string"
  13235. },
  13236. repo: {
  13237. required: true,
  13238. type: "string"
  13239. }
  13240. },
  13241. url: "/repos/:owner/:repo/subscription"
  13242. },
  13243. deleteThreadSubscription: {
  13244. method: "DELETE",
  13245. params: {
  13246. thread_id: {
  13247. required: true,
  13248. type: "integer"
  13249. }
  13250. },
  13251. url: "/notifications/threads/:thread_id/subscription"
  13252. },
  13253. getRepoSubscription: {
  13254. method: "GET",
  13255. params: {
  13256. owner: {
  13257. required: true,
  13258. type: "string"
  13259. },
  13260. repo: {
  13261. required: true,
  13262. type: "string"
  13263. }
  13264. },
  13265. url: "/repos/:owner/:repo/subscription"
  13266. },
  13267. getThread: {
  13268. method: "GET",
  13269. params: {
  13270. thread_id: {
  13271. required: true,
  13272. type: "integer"
  13273. }
  13274. },
  13275. url: "/notifications/threads/:thread_id"
  13276. },
  13277. getThreadSubscription: {
  13278. method: "GET",
  13279. params: {
  13280. thread_id: {
  13281. required: true,
  13282. type: "integer"
  13283. }
  13284. },
  13285. url: "/notifications/threads/:thread_id/subscription"
  13286. },
  13287. listEventsForOrg: {
  13288. method: "GET",
  13289. params: {
  13290. org: {
  13291. required: true,
  13292. type: "string"
  13293. },
  13294. page: {
  13295. type: "integer"
  13296. },
  13297. per_page: {
  13298. type: "integer"
  13299. },
  13300. username: {
  13301. required: true,
  13302. type: "string"
  13303. }
  13304. },
  13305. url: "/users/:username/events/orgs/:org"
  13306. },
  13307. listEventsForUser: {
  13308. method: "GET",
  13309. params: {
  13310. page: {
  13311. type: "integer"
  13312. },
  13313. per_page: {
  13314. type: "integer"
  13315. },
  13316. username: {
  13317. required: true,
  13318. type: "string"
  13319. }
  13320. },
  13321. url: "/users/:username/events"
  13322. },
  13323. listFeeds: {
  13324. method: "GET",
  13325. params: {},
  13326. url: "/feeds"
  13327. },
  13328. listNotifications: {
  13329. method: "GET",
  13330. params: {
  13331. all: {
  13332. type: "boolean"
  13333. },
  13334. before: {
  13335. type: "string"
  13336. },
  13337. page: {
  13338. type: "integer"
  13339. },
  13340. participating: {
  13341. type: "boolean"
  13342. },
  13343. per_page: {
  13344. type: "integer"
  13345. },
  13346. since: {
  13347. type: "string"
  13348. }
  13349. },
  13350. url: "/notifications"
  13351. },
  13352. listNotificationsForRepo: {
  13353. method: "GET",
  13354. params: {
  13355. all: {
  13356. type: "boolean"
  13357. },
  13358. before: {
  13359. type: "string"
  13360. },
  13361. owner: {
  13362. required: true,
  13363. type: "string"
  13364. },
  13365. page: {
  13366. type: "integer"
  13367. },
  13368. participating: {
  13369. type: "boolean"
  13370. },
  13371. per_page: {
  13372. type: "integer"
  13373. },
  13374. repo: {
  13375. required: true,
  13376. type: "string"
  13377. },
  13378. since: {
  13379. type: "string"
  13380. }
  13381. },
  13382. url: "/repos/:owner/:repo/notifications"
  13383. },
  13384. listPublicEvents: {
  13385. method: "GET",
  13386. params: {
  13387. page: {
  13388. type: "integer"
  13389. },
  13390. per_page: {
  13391. type: "integer"
  13392. }
  13393. },
  13394. url: "/events"
  13395. },
  13396. listPublicEventsForOrg: {
  13397. method: "GET",
  13398. params: {
  13399. org: {
  13400. required: true,
  13401. type: "string"
  13402. },
  13403. page: {
  13404. type: "integer"
  13405. },
  13406. per_page: {
  13407. type: "integer"
  13408. }
  13409. },
  13410. url: "/orgs/:org/events"
  13411. },
  13412. listPublicEventsForRepoNetwork: {
  13413. method: "GET",
  13414. params: {
  13415. owner: {
  13416. required: true,
  13417. type: "string"
  13418. },
  13419. page: {
  13420. type: "integer"
  13421. },
  13422. per_page: {
  13423. type: "integer"
  13424. },
  13425. repo: {
  13426. required: true,
  13427. type: "string"
  13428. }
  13429. },
  13430. url: "/networks/:owner/:repo/events"
  13431. },
  13432. listPublicEventsForUser: {
  13433. method: "GET",
  13434. params: {
  13435. page: {
  13436. type: "integer"
  13437. },
  13438. per_page: {
  13439. type: "integer"
  13440. },
  13441. username: {
  13442. required: true,
  13443. type: "string"
  13444. }
  13445. },
  13446. url: "/users/:username/events/public"
  13447. },
  13448. listReceivedEventsForUser: {
  13449. method: "GET",
  13450. params: {
  13451. page: {
  13452. type: "integer"
  13453. },
  13454. per_page: {
  13455. type: "integer"
  13456. },
  13457. username: {
  13458. required: true,
  13459. type: "string"
  13460. }
  13461. },
  13462. url: "/users/:username/received_events"
  13463. },
  13464. listReceivedPublicEventsForUser: {
  13465. method: "GET",
  13466. params: {
  13467. page: {
  13468. type: "integer"
  13469. },
  13470. per_page: {
  13471. type: "integer"
  13472. },
  13473. username: {
  13474. required: true,
  13475. type: "string"
  13476. }
  13477. },
  13478. url: "/users/:username/received_events/public"
  13479. },
  13480. listRepoEvents: {
  13481. method: "GET",
  13482. params: {
  13483. owner: {
  13484. required: true,
  13485. type: "string"
  13486. },
  13487. page: {
  13488. type: "integer"
  13489. },
  13490. per_page: {
  13491. type: "integer"
  13492. },
  13493. repo: {
  13494. required: true,
  13495. type: "string"
  13496. }
  13497. },
  13498. url: "/repos/:owner/:repo/events"
  13499. },
  13500. listReposStarredByAuthenticatedUser: {
  13501. method: "GET",
  13502. params: {
  13503. direction: {
  13504. enum: ["asc", "desc"],
  13505. type: "string"
  13506. },
  13507. page: {
  13508. type: "integer"
  13509. },
  13510. per_page: {
  13511. type: "integer"
  13512. },
  13513. sort: {
  13514. enum: ["created", "updated"],
  13515. type: "string"
  13516. }
  13517. },
  13518. url: "/user/starred"
  13519. },
  13520. listReposStarredByUser: {
  13521. method: "GET",
  13522. params: {
  13523. direction: {
  13524. enum: ["asc", "desc"],
  13525. type: "string"
  13526. },
  13527. page: {
  13528. type: "integer"
  13529. },
  13530. per_page: {
  13531. type: "integer"
  13532. },
  13533. sort: {
  13534. enum: ["created", "updated"],
  13535. type: "string"
  13536. },
  13537. username: {
  13538. required: true,
  13539. type: "string"
  13540. }
  13541. },
  13542. url: "/users/:username/starred"
  13543. },
  13544. listReposWatchedByUser: {
  13545. method: "GET",
  13546. params: {
  13547. page: {
  13548. type: "integer"
  13549. },
  13550. per_page: {
  13551. type: "integer"
  13552. },
  13553. username: {
  13554. required: true,
  13555. type: "string"
  13556. }
  13557. },
  13558. url: "/users/:username/subscriptions"
  13559. },
  13560. listStargazersForRepo: {
  13561. method: "GET",
  13562. params: {
  13563. owner: {
  13564. required: true,
  13565. type: "string"
  13566. },
  13567. page: {
  13568. type: "integer"
  13569. },
  13570. per_page: {
  13571. type: "integer"
  13572. },
  13573. repo: {
  13574. required: true,
  13575. type: "string"
  13576. }
  13577. },
  13578. url: "/repos/:owner/:repo/stargazers"
  13579. },
  13580. listWatchedReposForAuthenticatedUser: {
  13581. method: "GET",
  13582. params: {
  13583. page: {
  13584. type: "integer"
  13585. },
  13586. per_page: {
  13587. type: "integer"
  13588. }
  13589. },
  13590. url: "/user/subscriptions"
  13591. },
  13592. listWatchersForRepo: {
  13593. method: "GET",
  13594. params: {
  13595. owner: {
  13596. required: true,
  13597. type: "string"
  13598. },
  13599. page: {
  13600. type: "integer"
  13601. },
  13602. per_page: {
  13603. type: "integer"
  13604. },
  13605. repo: {
  13606. required: true,
  13607. type: "string"
  13608. }
  13609. },
  13610. url: "/repos/:owner/:repo/subscribers"
  13611. },
  13612. markAsRead: {
  13613. method: "PUT",
  13614. params: {
  13615. last_read_at: {
  13616. type: "string"
  13617. }
  13618. },
  13619. url: "/notifications"
  13620. },
  13621. markNotificationsAsReadForRepo: {
  13622. method: "PUT",
  13623. params: {
  13624. last_read_at: {
  13625. type: "string"
  13626. },
  13627. owner: {
  13628. required: true,
  13629. type: "string"
  13630. },
  13631. repo: {
  13632. required: true,
  13633. type: "string"
  13634. }
  13635. },
  13636. url: "/repos/:owner/:repo/notifications"
  13637. },
  13638. markThreadAsRead: {
  13639. method: "PATCH",
  13640. params: {
  13641. thread_id: {
  13642. required: true,
  13643. type: "integer"
  13644. }
  13645. },
  13646. url: "/notifications/threads/:thread_id"
  13647. },
  13648. setRepoSubscription: {
  13649. method: "PUT",
  13650. params: {
  13651. ignored: {
  13652. type: "boolean"
  13653. },
  13654. owner: {
  13655. required: true,
  13656. type: "string"
  13657. },
  13658. repo: {
  13659. required: true,
  13660. type: "string"
  13661. },
  13662. subscribed: {
  13663. type: "boolean"
  13664. }
  13665. },
  13666. url: "/repos/:owner/:repo/subscription"
  13667. },
  13668. setThreadSubscription: {
  13669. method: "PUT",
  13670. params: {
  13671. ignored: {
  13672. type: "boolean"
  13673. },
  13674. thread_id: {
  13675. required: true,
  13676. type: "integer"
  13677. }
  13678. },
  13679. url: "/notifications/threads/:thread_id/subscription"
  13680. },
  13681. starRepo: {
  13682. method: "PUT",
  13683. params: {
  13684. owner: {
  13685. required: true,
  13686. type: "string"
  13687. },
  13688. repo: {
  13689. required: true,
  13690. type: "string"
  13691. }
  13692. },
  13693. url: "/user/starred/:owner/:repo"
  13694. },
  13695. unstarRepo: {
  13696. method: "DELETE",
  13697. params: {
  13698. owner: {
  13699. required: true,
  13700. type: "string"
  13701. },
  13702. repo: {
  13703. required: true,
  13704. type: "string"
  13705. }
  13706. },
  13707. url: "/user/starred/:owner/:repo"
  13708. }
  13709. },
  13710. apps: {
  13711. addRepoToInstallation: {
  13712. headers: {
  13713. accept: "application/vnd.github.machine-man-preview+json"
  13714. },
  13715. method: "PUT",
  13716. params: {
  13717. installation_id: {
  13718. required: true,
  13719. type: "integer"
  13720. },
  13721. repository_id: {
  13722. required: true,
  13723. type: "integer"
  13724. }
  13725. },
  13726. url: "/user/installations/:installation_id/repositories/:repository_id"
  13727. },
  13728. checkAccountIsAssociatedWithAny: {
  13729. method: "GET",
  13730. params: {
  13731. account_id: {
  13732. required: true,
  13733. type: "integer"
  13734. }
  13735. },
  13736. url: "/marketplace_listing/accounts/:account_id"
  13737. },
  13738. checkAccountIsAssociatedWithAnyStubbed: {
  13739. method: "GET",
  13740. params: {
  13741. account_id: {
  13742. required: true,
  13743. type: "integer"
  13744. }
  13745. },
  13746. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13747. },
  13748. checkAuthorization: {
  13749. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13750. method: "GET",
  13751. params: {
  13752. access_token: {
  13753. required: true,
  13754. type: "string"
  13755. },
  13756. client_id: {
  13757. required: true,
  13758. type: "string"
  13759. }
  13760. },
  13761. url: "/applications/:client_id/tokens/:access_token"
  13762. },
  13763. checkToken: {
  13764. headers: {
  13765. accept: "application/vnd.github.doctor-strange-preview+json"
  13766. },
  13767. method: "POST",
  13768. params: {
  13769. access_token: {
  13770. type: "string"
  13771. },
  13772. client_id: {
  13773. required: true,
  13774. type: "string"
  13775. }
  13776. },
  13777. url: "/applications/:client_id/token"
  13778. },
  13779. createContentAttachment: {
  13780. headers: {
  13781. accept: "application/vnd.github.corsair-preview+json"
  13782. },
  13783. method: "POST",
  13784. params: {
  13785. body: {
  13786. required: true,
  13787. type: "string"
  13788. },
  13789. content_reference_id: {
  13790. required: true,
  13791. type: "integer"
  13792. },
  13793. title: {
  13794. required: true,
  13795. type: "string"
  13796. }
  13797. },
  13798. url: "/content_references/:content_reference_id/attachments"
  13799. },
  13800. createFromManifest: {
  13801. headers: {
  13802. accept: "application/vnd.github.fury-preview+json"
  13803. },
  13804. method: "POST",
  13805. params: {
  13806. code: {
  13807. required: true,
  13808. type: "string"
  13809. }
  13810. },
  13811. url: "/app-manifests/:code/conversions"
  13812. },
  13813. createInstallationToken: {
  13814. headers: {
  13815. accept: "application/vnd.github.machine-man-preview+json"
  13816. },
  13817. method: "POST",
  13818. params: {
  13819. installation_id: {
  13820. required: true,
  13821. type: "integer"
  13822. },
  13823. permissions: {
  13824. type: "object"
  13825. },
  13826. repository_ids: {
  13827. type: "integer[]"
  13828. }
  13829. },
  13830. url: "/app/installations/:installation_id/access_tokens"
  13831. },
  13832. deleteAuthorization: {
  13833. headers: {
  13834. accept: "application/vnd.github.doctor-strange-preview+json"
  13835. },
  13836. method: "DELETE",
  13837. params: {
  13838. access_token: {
  13839. type: "string"
  13840. },
  13841. client_id: {
  13842. required: true,
  13843. type: "string"
  13844. }
  13845. },
  13846. url: "/applications/:client_id/grant"
  13847. },
  13848. deleteInstallation: {
  13849. headers: {
  13850. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13851. },
  13852. method: "DELETE",
  13853. params: {
  13854. installation_id: {
  13855. required: true,
  13856. type: "integer"
  13857. }
  13858. },
  13859. url: "/app/installations/:installation_id"
  13860. },
  13861. deleteToken: {
  13862. headers: {
  13863. accept: "application/vnd.github.doctor-strange-preview+json"
  13864. },
  13865. method: "DELETE",
  13866. params: {
  13867. access_token: {
  13868. type: "string"
  13869. },
  13870. client_id: {
  13871. required: true,
  13872. type: "string"
  13873. }
  13874. },
  13875. url: "/applications/:client_id/token"
  13876. },
  13877. findOrgInstallation: {
  13878. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13879. headers: {
  13880. accept: "application/vnd.github.machine-man-preview+json"
  13881. },
  13882. method: "GET",
  13883. params: {
  13884. org: {
  13885. required: true,
  13886. type: "string"
  13887. }
  13888. },
  13889. url: "/orgs/:org/installation"
  13890. },
  13891. findRepoInstallation: {
  13892. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13893. headers: {
  13894. accept: "application/vnd.github.machine-man-preview+json"
  13895. },
  13896. method: "GET",
  13897. params: {
  13898. owner: {
  13899. required: true,
  13900. type: "string"
  13901. },
  13902. repo: {
  13903. required: true,
  13904. type: "string"
  13905. }
  13906. },
  13907. url: "/repos/:owner/:repo/installation"
  13908. },
  13909. findUserInstallation: {
  13910. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13911. headers: {
  13912. accept: "application/vnd.github.machine-man-preview+json"
  13913. },
  13914. method: "GET",
  13915. params: {
  13916. username: {
  13917. required: true,
  13918. type: "string"
  13919. }
  13920. },
  13921. url: "/users/:username/installation"
  13922. },
  13923. getAuthenticated: {
  13924. headers: {
  13925. accept: "application/vnd.github.machine-man-preview+json"
  13926. },
  13927. method: "GET",
  13928. params: {},
  13929. url: "/app"
  13930. },
  13931. getBySlug: {
  13932. headers: {
  13933. accept: "application/vnd.github.machine-man-preview+json"
  13934. },
  13935. method: "GET",
  13936. params: {
  13937. app_slug: {
  13938. required: true,
  13939. type: "string"
  13940. }
  13941. },
  13942. url: "/apps/:app_slug"
  13943. },
  13944. getInstallation: {
  13945. headers: {
  13946. accept: "application/vnd.github.machine-man-preview+json"
  13947. },
  13948. method: "GET",
  13949. params: {
  13950. installation_id: {
  13951. required: true,
  13952. type: "integer"
  13953. }
  13954. },
  13955. url: "/app/installations/:installation_id"
  13956. },
  13957. getOrgInstallation: {
  13958. headers: {
  13959. accept: "application/vnd.github.machine-man-preview+json"
  13960. },
  13961. method: "GET",
  13962. params: {
  13963. org: {
  13964. required: true,
  13965. type: "string"
  13966. }
  13967. },
  13968. url: "/orgs/:org/installation"
  13969. },
  13970. getRepoInstallation: {
  13971. headers: {
  13972. accept: "application/vnd.github.machine-man-preview+json"
  13973. },
  13974. method: "GET",
  13975. params: {
  13976. owner: {
  13977. required: true,
  13978. type: "string"
  13979. },
  13980. repo: {
  13981. required: true,
  13982. type: "string"
  13983. }
  13984. },
  13985. url: "/repos/:owner/:repo/installation"
  13986. },
  13987. getUserInstallation: {
  13988. headers: {
  13989. accept: "application/vnd.github.machine-man-preview+json"
  13990. },
  13991. method: "GET",
  13992. params: {
  13993. username: {
  13994. required: true,
  13995. type: "string"
  13996. }
  13997. },
  13998. url: "/users/:username/installation"
  13999. },
  14000. listAccountsUserOrOrgOnPlan: {
  14001. method: "GET",
  14002. params: {
  14003. direction: {
  14004. enum: ["asc", "desc"],
  14005. type: "string"
  14006. },
  14007. page: {
  14008. type: "integer"
  14009. },
  14010. per_page: {
  14011. type: "integer"
  14012. },
  14013. plan_id: {
  14014. required: true,
  14015. type: "integer"
  14016. },
  14017. sort: {
  14018. enum: ["created", "updated"],
  14019. type: "string"
  14020. }
  14021. },
  14022. url: "/marketplace_listing/plans/:plan_id/accounts"
  14023. },
  14024. listAccountsUserOrOrgOnPlanStubbed: {
  14025. method: "GET",
  14026. params: {
  14027. direction: {
  14028. enum: ["asc", "desc"],
  14029. type: "string"
  14030. },
  14031. page: {
  14032. type: "integer"
  14033. },
  14034. per_page: {
  14035. type: "integer"
  14036. },
  14037. plan_id: {
  14038. required: true,
  14039. type: "integer"
  14040. },
  14041. sort: {
  14042. enum: ["created", "updated"],
  14043. type: "string"
  14044. }
  14045. },
  14046. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14047. },
  14048. listInstallationReposForAuthenticatedUser: {
  14049. headers: {
  14050. accept: "application/vnd.github.machine-man-preview+json"
  14051. },
  14052. method: "GET",
  14053. params: {
  14054. installation_id: {
  14055. required: true,
  14056. type: "integer"
  14057. },
  14058. page: {
  14059. type: "integer"
  14060. },
  14061. per_page: {
  14062. type: "integer"
  14063. }
  14064. },
  14065. url: "/user/installations/:installation_id/repositories"
  14066. },
  14067. listInstallations: {
  14068. headers: {
  14069. accept: "application/vnd.github.machine-man-preview+json"
  14070. },
  14071. method: "GET",
  14072. params: {
  14073. page: {
  14074. type: "integer"
  14075. },
  14076. per_page: {
  14077. type: "integer"
  14078. }
  14079. },
  14080. url: "/app/installations"
  14081. },
  14082. listInstallationsForAuthenticatedUser: {
  14083. headers: {
  14084. accept: "application/vnd.github.machine-man-preview+json"
  14085. },
  14086. method: "GET",
  14087. params: {
  14088. page: {
  14089. type: "integer"
  14090. },
  14091. per_page: {
  14092. type: "integer"
  14093. }
  14094. },
  14095. url: "/user/installations"
  14096. },
  14097. listMarketplacePurchasesForAuthenticatedUser: {
  14098. method: "GET",
  14099. params: {
  14100. page: {
  14101. type: "integer"
  14102. },
  14103. per_page: {
  14104. type: "integer"
  14105. }
  14106. },
  14107. url: "/user/marketplace_purchases"
  14108. },
  14109. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14110. method: "GET",
  14111. params: {
  14112. page: {
  14113. type: "integer"
  14114. },
  14115. per_page: {
  14116. type: "integer"
  14117. }
  14118. },
  14119. url: "/user/marketplace_purchases/stubbed"
  14120. },
  14121. listPlans: {
  14122. method: "GET",
  14123. params: {
  14124. page: {
  14125. type: "integer"
  14126. },
  14127. per_page: {
  14128. type: "integer"
  14129. }
  14130. },
  14131. url: "/marketplace_listing/plans"
  14132. },
  14133. listPlansStubbed: {
  14134. method: "GET",
  14135. params: {
  14136. page: {
  14137. type: "integer"
  14138. },
  14139. per_page: {
  14140. type: "integer"
  14141. }
  14142. },
  14143. url: "/marketplace_listing/stubbed/plans"
  14144. },
  14145. listRepos: {
  14146. headers: {
  14147. accept: "application/vnd.github.machine-man-preview+json"
  14148. },
  14149. method: "GET",
  14150. params: {
  14151. page: {
  14152. type: "integer"
  14153. },
  14154. per_page: {
  14155. type: "integer"
  14156. }
  14157. },
  14158. url: "/installation/repositories"
  14159. },
  14160. removeRepoFromInstallation: {
  14161. headers: {
  14162. accept: "application/vnd.github.machine-man-preview+json"
  14163. },
  14164. method: "DELETE",
  14165. params: {
  14166. installation_id: {
  14167. required: true,
  14168. type: "integer"
  14169. },
  14170. repository_id: {
  14171. required: true,
  14172. type: "integer"
  14173. }
  14174. },
  14175. url: "/user/installations/:installation_id/repositories/:repository_id"
  14176. },
  14177. resetAuthorization: {
  14178. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14179. method: "POST",
  14180. params: {
  14181. access_token: {
  14182. required: true,
  14183. type: "string"
  14184. },
  14185. client_id: {
  14186. required: true,
  14187. type: "string"
  14188. }
  14189. },
  14190. url: "/applications/:client_id/tokens/:access_token"
  14191. },
  14192. resetToken: {
  14193. headers: {
  14194. accept: "application/vnd.github.doctor-strange-preview+json"
  14195. },
  14196. method: "PATCH",
  14197. params: {
  14198. access_token: {
  14199. type: "string"
  14200. },
  14201. client_id: {
  14202. required: true,
  14203. type: "string"
  14204. }
  14205. },
  14206. url: "/applications/:client_id/token"
  14207. },
  14208. revokeAuthorizationForApplication: {
  14209. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14210. method: "DELETE",
  14211. params: {
  14212. access_token: {
  14213. required: true,
  14214. type: "string"
  14215. },
  14216. client_id: {
  14217. required: true,
  14218. type: "string"
  14219. }
  14220. },
  14221. url: "/applications/:client_id/tokens/:access_token"
  14222. },
  14223. revokeGrantForApplication: {
  14224. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14225. method: "DELETE",
  14226. params: {
  14227. access_token: {
  14228. required: true,
  14229. type: "string"
  14230. },
  14231. client_id: {
  14232. required: true,
  14233. type: "string"
  14234. }
  14235. },
  14236. url: "/applications/:client_id/grants/:access_token"
  14237. },
  14238. revokeInstallationToken: {
  14239. headers: {
  14240. accept: "application/vnd.github.gambit-preview+json"
  14241. },
  14242. method: "DELETE",
  14243. params: {},
  14244. url: "/installation/token"
  14245. }
  14246. },
  14247. checks: {
  14248. create: {
  14249. headers: {
  14250. accept: "application/vnd.github.antiope-preview+json"
  14251. },
  14252. method: "POST",
  14253. params: {
  14254. actions: {
  14255. type: "object[]"
  14256. },
  14257. "actions[].description": {
  14258. required: true,
  14259. type: "string"
  14260. },
  14261. "actions[].identifier": {
  14262. required: true,
  14263. type: "string"
  14264. },
  14265. "actions[].label": {
  14266. required: true,
  14267. type: "string"
  14268. },
  14269. completed_at: {
  14270. type: "string"
  14271. },
  14272. conclusion: {
  14273. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14274. type: "string"
  14275. },
  14276. details_url: {
  14277. type: "string"
  14278. },
  14279. external_id: {
  14280. type: "string"
  14281. },
  14282. head_sha: {
  14283. required: true,
  14284. type: "string"
  14285. },
  14286. name: {
  14287. required: true,
  14288. type: "string"
  14289. },
  14290. output: {
  14291. type: "object"
  14292. },
  14293. "output.annotations": {
  14294. type: "object[]"
  14295. },
  14296. "output.annotations[].annotation_level": {
  14297. enum: ["notice", "warning", "failure"],
  14298. required: true,
  14299. type: "string"
  14300. },
  14301. "output.annotations[].end_column": {
  14302. type: "integer"
  14303. },
  14304. "output.annotations[].end_line": {
  14305. required: true,
  14306. type: "integer"
  14307. },
  14308. "output.annotations[].message": {
  14309. required: true,
  14310. type: "string"
  14311. },
  14312. "output.annotations[].path": {
  14313. required: true,
  14314. type: "string"
  14315. },
  14316. "output.annotations[].raw_details": {
  14317. type: "string"
  14318. },
  14319. "output.annotations[].start_column": {
  14320. type: "integer"
  14321. },
  14322. "output.annotations[].start_line": {
  14323. required: true,
  14324. type: "integer"
  14325. },
  14326. "output.annotations[].title": {
  14327. type: "string"
  14328. },
  14329. "output.images": {
  14330. type: "object[]"
  14331. },
  14332. "output.images[].alt": {
  14333. required: true,
  14334. type: "string"
  14335. },
  14336. "output.images[].caption": {
  14337. type: "string"
  14338. },
  14339. "output.images[].image_url": {
  14340. required: true,
  14341. type: "string"
  14342. },
  14343. "output.summary": {
  14344. required: true,
  14345. type: "string"
  14346. },
  14347. "output.text": {
  14348. type: "string"
  14349. },
  14350. "output.title": {
  14351. required: true,
  14352. type: "string"
  14353. },
  14354. owner: {
  14355. required: true,
  14356. type: "string"
  14357. },
  14358. repo: {
  14359. required: true,
  14360. type: "string"
  14361. },
  14362. started_at: {
  14363. type: "string"
  14364. },
  14365. status: {
  14366. enum: ["queued", "in_progress", "completed"],
  14367. type: "string"
  14368. }
  14369. },
  14370. url: "/repos/:owner/:repo/check-runs"
  14371. },
  14372. createSuite: {
  14373. headers: {
  14374. accept: "application/vnd.github.antiope-preview+json"
  14375. },
  14376. method: "POST",
  14377. params: {
  14378. head_sha: {
  14379. required: true,
  14380. type: "string"
  14381. },
  14382. owner: {
  14383. required: true,
  14384. type: "string"
  14385. },
  14386. repo: {
  14387. required: true,
  14388. type: "string"
  14389. }
  14390. },
  14391. url: "/repos/:owner/:repo/check-suites"
  14392. },
  14393. get: {
  14394. headers: {
  14395. accept: "application/vnd.github.antiope-preview+json"
  14396. },
  14397. method: "GET",
  14398. params: {
  14399. check_run_id: {
  14400. required: true,
  14401. type: "integer"
  14402. },
  14403. owner: {
  14404. required: true,
  14405. type: "string"
  14406. },
  14407. repo: {
  14408. required: true,
  14409. type: "string"
  14410. }
  14411. },
  14412. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14413. },
  14414. getSuite: {
  14415. headers: {
  14416. accept: "application/vnd.github.antiope-preview+json"
  14417. },
  14418. method: "GET",
  14419. params: {
  14420. check_suite_id: {
  14421. required: true,
  14422. type: "integer"
  14423. },
  14424. owner: {
  14425. required: true,
  14426. type: "string"
  14427. },
  14428. repo: {
  14429. required: true,
  14430. type: "string"
  14431. }
  14432. },
  14433. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14434. },
  14435. listAnnotations: {
  14436. headers: {
  14437. accept: "application/vnd.github.antiope-preview+json"
  14438. },
  14439. method: "GET",
  14440. params: {
  14441. check_run_id: {
  14442. required: true,
  14443. type: "integer"
  14444. },
  14445. owner: {
  14446. required: true,
  14447. type: "string"
  14448. },
  14449. page: {
  14450. type: "integer"
  14451. },
  14452. per_page: {
  14453. type: "integer"
  14454. },
  14455. repo: {
  14456. required: true,
  14457. type: "string"
  14458. }
  14459. },
  14460. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14461. },
  14462. listForRef: {
  14463. headers: {
  14464. accept: "application/vnd.github.antiope-preview+json"
  14465. },
  14466. method: "GET",
  14467. params: {
  14468. check_name: {
  14469. type: "string"
  14470. },
  14471. filter: {
  14472. enum: ["latest", "all"],
  14473. type: "string"
  14474. },
  14475. owner: {
  14476. required: true,
  14477. type: "string"
  14478. },
  14479. page: {
  14480. type: "integer"
  14481. },
  14482. per_page: {
  14483. type: "integer"
  14484. },
  14485. ref: {
  14486. required: true,
  14487. type: "string"
  14488. },
  14489. repo: {
  14490. required: true,
  14491. type: "string"
  14492. },
  14493. status: {
  14494. enum: ["queued", "in_progress", "completed"],
  14495. type: "string"
  14496. }
  14497. },
  14498. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14499. },
  14500. listForSuite: {
  14501. headers: {
  14502. accept: "application/vnd.github.antiope-preview+json"
  14503. },
  14504. method: "GET",
  14505. params: {
  14506. check_name: {
  14507. type: "string"
  14508. },
  14509. check_suite_id: {
  14510. required: true,
  14511. type: "integer"
  14512. },
  14513. filter: {
  14514. enum: ["latest", "all"],
  14515. type: "string"
  14516. },
  14517. owner: {
  14518. required: true,
  14519. type: "string"
  14520. },
  14521. page: {
  14522. type: "integer"
  14523. },
  14524. per_page: {
  14525. type: "integer"
  14526. },
  14527. repo: {
  14528. required: true,
  14529. type: "string"
  14530. },
  14531. status: {
  14532. enum: ["queued", "in_progress", "completed"],
  14533. type: "string"
  14534. }
  14535. },
  14536. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14537. },
  14538. listSuitesForRef: {
  14539. headers: {
  14540. accept: "application/vnd.github.antiope-preview+json"
  14541. },
  14542. method: "GET",
  14543. params: {
  14544. app_id: {
  14545. type: "integer"
  14546. },
  14547. check_name: {
  14548. type: "string"
  14549. },
  14550. owner: {
  14551. required: true,
  14552. type: "string"
  14553. },
  14554. page: {
  14555. type: "integer"
  14556. },
  14557. per_page: {
  14558. type: "integer"
  14559. },
  14560. ref: {
  14561. required: true,
  14562. type: "string"
  14563. },
  14564. repo: {
  14565. required: true,
  14566. type: "string"
  14567. }
  14568. },
  14569. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14570. },
  14571. rerequestSuite: {
  14572. headers: {
  14573. accept: "application/vnd.github.antiope-preview+json"
  14574. },
  14575. method: "POST",
  14576. params: {
  14577. check_suite_id: {
  14578. required: true,
  14579. type: "integer"
  14580. },
  14581. owner: {
  14582. required: true,
  14583. type: "string"
  14584. },
  14585. repo: {
  14586. required: true,
  14587. type: "string"
  14588. }
  14589. },
  14590. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14591. },
  14592. setSuitesPreferences: {
  14593. headers: {
  14594. accept: "application/vnd.github.antiope-preview+json"
  14595. },
  14596. method: "PATCH",
  14597. params: {
  14598. auto_trigger_checks: {
  14599. type: "object[]"
  14600. },
  14601. "auto_trigger_checks[].app_id": {
  14602. required: true,
  14603. type: "integer"
  14604. },
  14605. "auto_trigger_checks[].setting": {
  14606. required: true,
  14607. type: "boolean"
  14608. },
  14609. owner: {
  14610. required: true,
  14611. type: "string"
  14612. },
  14613. repo: {
  14614. required: true,
  14615. type: "string"
  14616. }
  14617. },
  14618. url: "/repos/:owner/:repo/check-suites/preferences"
  14619. },
  14620. update: {
  14621. headers: {
  14622. accept: "application/vnd.github.antiope-preview+json"
  14623. },
  14624. method: "PATCH",
  14625. params: {
  14626. actions: {
  14627. type: "object[]"
  14628. },
  14629. "actions[].description": {
  14630. required: true,
  14631. type: "string"
  14632. },
  14633. "actions[].identifier": {
  14634. required: true,
  14635. type: "string"
  14636. },
  14637. "actions[].label": {
  14638. required: true,
  14639. type: "string"
  14640. },
  14641. check_run_id: {
  14642. required: true,
  14643. type: "integer"
  14644. },
  14645. completed_at: {
  14646. type: "string"
  14647. },
  14648. conclusion: {
  14649. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14650. type: "string"
  14651. },
  14652. details_url: {
  14653. type: "string"
  14654. },
  14655. external_id: {
  14656. type: "string"
  14657. },
  14658. name: {
  14659. type: "string"
  14660. },
  14661. output: {
  14662. type: "object"
  14663. },
  14664. "output.annotations": {
  14665. type: "object[]"
  14666. },
  14667. "output.annotations[].annotation_level": {
  14668. enum: ["notice", "warning", "failure"],
  14669. required: true,
  14670. type: "string"
  14671. },
  14672. "output.annotations[].end_column": {
  14673. type: "integer"
  14674. },
  14675. "output.annotations[].end_line": {
  14676. required: true,
  14677. type: "integer"
  14678. },
  14679. "output.annotations[].message": {
  14680. required: true,
  14681. type: "string"
  14682. },
  14683. "output.annotations[].path": {
  14684. required: true,
  14685. type: "string"
  14686. },
  14687. "output.annotations[].raw_details": {
  14688. type: "string"
  14689. },
  14690. "output.annotations[].start_column": {
  14691. type: "integer"
  14692. },
  14693. "output.annotations[].start_line": {
  14694. required: true,
  14695. type: "integer"
  14696. },
  14697. "output.annotations[].title": {
  14698. type: "string"
  14699. },
  14700. "output.images": {
  14701. type: "object[]"
  14702. },
  14703. "output.images[].alt": {
  14704. required: true,
  14705. type: "string"
  14706. },
  14707. "output.images[].caption": {
  14708. type: "string"
  14709. },
  14710. "output.images[].image_url": {
  14711. required: true,
  14712. type: "string"
  14713. },
  14714. "output.summary": {
  14715. required: true,
  14716. type: "string"
  14717. },
  14718. "output.text": {
  14719. type: "string"
  14720. },
  14721. "output.title": {
  14722. type: "string"
  14723. },
  14724. owner: {
  14725. required: true,
  14726. type: "string"
  14727. },
  14728. repo: {
  14729. required: true,
  14730. type: "string"
  14731. },
  14732. started_at: {
  14733. type: "string"
  14734. },
  14735. status: {
  14736. enum: ["queued", "in_progress", "completed"],
  14737. type: "string"
  14738. }
  14739. },
  14740. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14741. }
  14742. },
  14743. codesOfConduct: {
  14744. getConductCode: {
  14745. headers: {
  14746. accept: "application/vnd.github.scarlet-witch-preview+json"
  14747. },
  14748. method: "GET",
  14749. params: {
  14750. key: {
  14751. required: true,
  14752. type: "string"
  14753. }
  14754. },
  14755. url: "/codes_of_conduct/:key"
  14756. },
  14757. getForRepo: {
  14758. headers: {
  14759. accept: "application/vnd.github.scarlet-witch-preview+json"
  14760. },
  14761. method: "GET",
  14762. params: {
  14763. owner: {
  14764. required: true,
  14765. type: "string"
  14766. },
  14767. repo: {
  14768. required: true,
  14769. type: "string"
  14770. }
  14771. },
  14772. url: "/repos/:owner/:repo/community/code_of_conduct"
  14773. },
  14774. listConductCodes: {
  14775. headers: {
  14776. accept: "application/vnd.github.scarlet-witch-preview+json"
  14777. },
  14778. method: "GET",
  14779. params: {},
  14780. url: "/codes_of_conduct"
  14781. }
  14782. },
  14783. emojis: {
  14784. get: {
  14785. method: "GET",
  14786. params: {},
  14787. url: "/emojis"
  14788. }
  14789. },
  14790. gists: {
  14791. checkIsStarred: {
  14792. method: "GET",
  14793. params: {
  14794. gist_id: {
  14795. required: true,
  14796. type: "string"
  14797. }
  14798. },
  14799. url: "/gists/:gist_id/star"
  14800. },
  14801. create: {
  14802. method: "POST",
  14803. params: {
  14804. description: {
  14805. type: "string"
  14806. },
  14807. files: {
  14808. required: true,
  14809. type: "object"
  14810. },
  14811. "files.content": {
  14812. type: "string"
  14813. },
  14814. public: {
  14815. type: "boolean"
  14816. }
  14817. },
  14818. url: "/gists"
  14819. },
  14820. createComment: {
  14821. method: "POST",
  14822. params: {
  14823. body: {
  14824. required: true,
  14825. type: "string"
  14826. },
  14827. gist_id: {
  14828. required: true,
  14829. type: "string"
  14830. }
  14831. },
  14832. url: "/gists/:gist_id/comments"
  14833. },
  14834. delete: {
  14835. method: "DELETE",
  14836. params: {
  14837. gist_id: {
  14838. required: true,
  14839. type: "string"
  14840. }
  14841. },
  14842. url: "/gists/:gist_id"
  14843. },
  14844. deleteComment: {
  14845. method: "DELETE",
  14846. params: {
  14847. comment_id: {
  14848. required: true,
  14849. type: "integer"
  14850. },
  14851. gist_id: {
  14852. required: true,
  14853. type: "string"
  14854. }
  14855. },
  14856. url: "/gists/:gist_id/comments/:comment_id"
  14857. },
  14858. fork: {
  14859. method: "POST",
  14860. params: {
  14861. gist_id: {
  14862. required: true,
  14863. type: "string"
  14864. }
  14865. },
  14866. url: "/gists/:gist_id/forks"
  14867. },
  14868. get: {
  14869. method: "GET",
  14870. params: {
  14871. gist_id: {
  14872. required: true,
  14873. type: "string"
  14874. }
  14875. },
  14876. url: "/gists/:gist_id"
  14877. },
  14878. getComment: {
  14879. method: "GET",
  14880. params: {
  14881. comment_id: {
  14882. required: true,
  14883. type: "integer"
  14884. },
  14885. gist_id: {
  14886. required: true,
  14887. type: "string"
  14888. }
  14889. },
  14890. url: "/gists/:gist_id/comments/:comment_id"
  14891. },
  14892. getRevision: {
  14893. method: "GET",
  14894. params: {
  14895. gist_id: {
  14896. required: true,
  14897. type: "string"
  14898. },
  14899. sha: {
  14900. required: true,
  14901. type: "string"
  14902. }
  14903. },
  14904. url: "/gists/:gist_id/:sha"
  14905. },
  14906. list: {
  14907. method: "GET",
  14908. params: {
  14909. page: {
  14910. type: "integer"
  14911. },
  14912. per_page: {
  14913. type: "integer"
  14914. },
  14915. since: {
  14916. type: "string"
  14917. }
  14918. },
  14919. url: "/gists"
  14920. },
  14921. listComments: {
  14922. method: "GET",
  14923. params: {
  14924. gist_id: {
  14925. required: true,
  14926. type: "string"
  14927. },
  14928. page: {
  14929. type: "integer"
  14930. },
  14931. per_page: {
  14932. type: "integer"
  14933. }
  14934. },
  14935. url: "/gists/:gist_id/comments"
  14936. },
  14937. listCommits: {
  14938. method: "GET",
  14939. params: {
  14940. gist_id: {
  14941. required: true,
  14942. type: "string"
  14943. },
  14944. page: {
  14945. type: "integer"
  14946. },
  14947. per_page: {
  14948. type: "integer"
  14949. }
  14950. },
  14951. url: "/gists/:gist_id/commits"
  14952. },
  14953. listForks: {
  14954. method: "GET",
  14955. params: {
  14956. gist_id: {
  14957. required: true,
  14958. type: "string"
  14959. },
  14960. page: {
  14961. type: "integer"
  14962. },
  14963. per_page: {
  14964. type: "integer"
  14965. }
  14966. },
  14967. url: "/gists/:gist_id/forks"
  14968. },
  14969. listPublic: {
  14970. method: "GET",
  14971. params: {
  14972. page: {
  14973. type: "integer"
  14974. },
  14975. per_page: {
  14976. type: "integer"
  14977. },
  14978. since: {
  14979. type: "string"
  14980. }
  14981. },
  14982. url: "/gists/public"
  14983. },
  14984. listPublicForUser: {
  14985. method: "GET",
  14986. params: {
  14987. page: {
  14988. type: "integer"
  14989. },
  14990. per_page: {
  14991. type: "integer"
  14992. },
  14993. since: {
  14994. type: "string"
  14995. },
  14996. username: {
  14997. required: true,
  14998. type: "string"
  14999. }
  15000. },
  15001. url: "/users/:username/gists"
  15002. },
  15003. listStarred: {
  15004. method: "GET",
  15005. params: {
  15006. page: {
  15007. type: "integer"
  15008. },
  15009. per_page: {
  15010. type: "integer"
  15011. },
  15012. since: {
  15013. type: "string"
  15014. }
  15015. },
  15016. url: "/gists/starred"
  15017. },
  15018. star: {
  15019. method: "PUT",
  15020. params: {
  15021. gist_id: {
  15022. required: true,
  15023. type: "string"
  15024. }
  15025. },
  15026. url: "/gists/:gist_id/star"
  15027. },
  15028. unstar: {
  15029. method: "DELETE",
  15030. params: {
  15031. gist_id: {
  15032. required: true,
  15033. type: "string"
  15034. }
  15035. },
  15036. url: "/gists/:gist_id/star"
  15037. },
  15038. update: {
  15039. method: "PATCH",
  15040. params: {
  15041. description: {
  15042. type: "string"
  15043. },
  15044. files: {
  15045. type: "object"
  15046. },
  15047. "files.content": {
  15048. type: "string"
  15049. },
  15050. "files.filename": {
  15051. type: "string"
  15052. },
  15053. gist_id: {
  15054. required: true,
  15055. type: "string"
  15056. }
  15057. },
  15058. url: "/gists/:gist_id"
  15059. },
  15060. updateComment: {
  15061. method: "PATCH",
  15062. params: {
  15063. body: {
  15064. required: true,
  15065. type: "string"
  15066. },
  15067. comment_id: {
  15068. required: true,
  15069. type: "integer"
  15070. },
  15071. gist_id: {
  15072. required: true,
  15073. type: "string"
  15074. }
  15075. },
  15076. url: "/gists/:gist_id/comments/:comment_id"
  15077. }
  15078. },
  15079. git: {
  15080. createBlob: {
  15081. method: "POST",
  15082. params: {
  15083. content: {
  15084. required: true,
  15085. type: "string"
  15086. },
  15087. encoding: {
  15088. type: "string"
  15089. },
  15090. owner: {
  15091. required: true,
  15092. type: "string"
  15093. },
  15094. repo: {
  15095. required: true,
  15096. type: "string"
  15097. }
  15098. },
  15099. url: "/repos/:owner/:repo/git/blobs"
  15100. },
  15101. createCommit: {
  15102. method: "POST",
  15103. params: {
  15104. author: {
  15105. type: "object"
  15106. },
  15107. "author.date": {
  15108. type: "string"
  15109. },
  15110. "author.email": {
  15111. type: "string"
  15112. },
  15113. "author.name": {
  15114. type: "string"
  15115. },
  15116. committer: {
  15117. type: "object"
  15118. },
  15119. "committer.date": {
  15120. type: "string"
  15121. },
  15122. "committer.email": {
  15123. type: "string"
  15124. },
  15125. "committer.name": {
  15126. type: "string"
  15127. },
  15128. message: {
  15129. required: true,
  15130. type: "string"
  15131. },
  15132. owner: {
  15133. required: true,
  15134. type: "string"
  15135. },
  15136. parents: {
  15137. required: true,
  15138. type: "string[]"
  15139. },
  15140. repo: {
  15141. required: true,
  15142. type: "string"
  15143. },
  15144. signature: {
  15145. type: "string"
  15146. },
  15147. tree: {
  15148. required: true,
  15149. type: "string"
  15150. }
  15151. },
  15152. url: "/repos/:owner/:repo/git/commits"
  15153. },
  15154. createRef: {
  15155. method: "POST",
  15156. params: {
  15157. owner: {
  15158. required: true,
  15159. type: "string"
  15160. },
  15161. ref: {
  15162. required: true,
  15163. type: "string"
  15164. },
  15165. repo: {
  15166. required: true,
  15167. type: "string"
  15168. },
  15169. sha: {
  15170. required: true,
  15171. type: "string"
  15172. }
  15173. },
  15174. url: "/repos/:owner/:repo/git/refs"
  15175. },
  15176. createTag: {
  15177. method: "POST",
  15178. params: {
  15179. message: {
  15180. required: true,
  15181. type: "string"
  15182. },
  15183. object: {
  15184. required: true,
  15185. type: "string"
  15186. },
  15187. owner: {
  15188. required: true,
  15189. type: "string"
  15190. },
  15191. repo: {
  15192. required: true,
  15193. type: "string"
  15194. },
  15195. tag: {
  15196. required: true,
  15197. type: "string"
  15198. },
  15199. tagger: {
  15200. type: "object"
  15201. },
  15202. "tagger.date": {
  15203. type: "string"
  15204. },
  15205. "tagger.email": {
  15206. type: "string"
  15207. },
  15208. "tagger.name": {
  15209. type: "string"
  15210. },
  15211. type: {
  15212. enum: ["commit", "tree", "blob"],
  15213. required: true,
  15214. type: "string"
  15215. }
  15216. },
  15217. url: "/repos/:owner/:repo/git/tags"
  15218. },
  15219. createTree: {
  15220. method: "POST",
  15221. params: {
  15222. base_tree: {
  15223. type: "string"
  15224. },
  15225. owner: {
  15226. required: true,
  15227. type: "string"
  15228. },
  15229. repo: {
  15230. required: true,
  15231. type: "string"
  15232. },
  15233. tree: {
  15234. required: true,
  15235. type: "object[]"
  15236. },
  15237. "tree[].content": {
  15238. type: "string"
  15239. },
  15240. "tree[].mode": {
  15241. enum: ["100644", "100755", "040000", "160000", "120000"],
  15242. type: "string"
  15243. },
  15244. "tree[].path": {
  15245. type: "string"
  15246. },
  15247. "tree[].sha": {
  15248. allowNull: true,
  15249. type: "string"
  15250. },
  15251. "tree[].type": {
  15252. enum: ["blob", "tree", "commit"],
  15253. type: "string"
  15254. }
  15255. },
  15256. url: "/repos/:owner/:repo/git/trees"
  15257. },
  15258. deleteRef: {
  15259. method: "DELETE",
  15260. params: {
  15261. owner: {
  15262. required: true,
  15263. type: "string"
  15264. },
  15265. ref: {
  15266. required: true,
  15267. type: "string"
  15268. },
  15269. repo: {
  15270. required: true,
  15271. type: "string"
  15272. }
  15273. },
  15274. url: "/repos/:owner/:repo/git/refs/:ref"
  15275. },
  15276. getBlob: {
  15277. method: "GET",
  15278. params: {
  15279. file_sha: {
  15280. required: true,
  15281. type: "string"
  15282. },
  15283. owner: {
  15284. required: true,
  15285. type: "string"
  15286. },
  15287. repo: {
  15288. required: true,
  15289. type: "string"
  15290. }
  15291. },
  15292. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15293. },
  15294. getCommit: {
  15295. method: "GET",
  15296. params: {
  15297. commit_sha: {
  15298. required: true,
  15299. type: "string"
  15300. },
  15301. owner: {
  15302. required: true,
  15303. type: "string"
  15304. },
  15305. repo: {
  15306. required: true,
  15307. type: "string"
  15308. }
  15309. },
  15310. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15311. },
  15312. getRef: {
  15313. method: "GET",
  15314. params: {
  15315. owner: {
  15316. required: true,
  15317. type: "string"
  15318. },
  15319. ref: {
  15320. required: true,
  15321. type: "string"
  15322. },
  15323. repo: {
  15324. required: true,
  15325. type: "string"
  15326. }
  15327. },
  15328. url: "/repos/:owner/:repo/git/ref/:ref"
  15329. },
  15330. getTag: {
  15331. method: "GET",
  15332. params: {
  15333. owner: {
  15334. required: true,
  15335. type: "string"
  15336. },
  15337. repo: {
  15338. required: true,
  15339. type: "string"
  15340. },
  15341. tag_sha: {
  15342. required: true,
  15343. type: "string"
  15344. }
  15345. },
  15346. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15347. },
  15348. getTree: {
  15349. method: "GET",
  15350. params: {
  15351. owner: {
  15352. required: true,
  15353. type: "string"
  15354. },
  15355. recursive: {
  15356. enum: ["1"],
  15357. type: "integer"
  15358. },
  15359. repo: {
  15360. required: true,
  15361. type: "string"
  15362. },
  15363. tree_sha: {
  15364. required: true,
  15365. type: "string"
  15366. }
  15367. },
  15368. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15369. },
  15370. listMatchingRefs: {
  15371. method: "GET",
  15372. params: {
  15373. owner: {
  15374. required: true,
  15375. type: "string"
  15376. },
  15377. page: {
  15378. type: "integer"
  15379. },
  15380. per_page: {
  15381. type: "integer"
  15382. },
  15383. ref: {
  15384. required: true,
  15385. type: "string"
  15386. },
  15387. repo: {
  15388. required: true,
  15389. type: "string"
  15390. }
  15391. },
  15392. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15393. },
  15394. listRefs: {
  15395. method: "GET",
  15396. params: {
  15397. namespace: {
  15398. type: "string"
  15399. },
  15400. owner: {
  15401. required: true,
  15402. type: "string"
  15403. },
  15404. page: {
  15405. type: "integer"
  15406. },
  15407. per_page: {
  15408. type: "integer"
  15409. },
  15410. repo: {
  15411. required: true,
  15412. type: "string"
  15413. }
  15414. },
  15415. url: "/repos/:owner/:repo/git/refs/:namespace"
  15416. },
  15417. updateRef: {
  15418. method: "PATCH",
  15419. params: {
  15420. force: {
  15421. type: "boolean"
  15422. },
  15423. owner: {
  15424. required: true,
  15425. type: "string"
  15426. },
  15427. ref: {
  15428. required: true,
  15429. type: "string"
  15430. },
  15431. repo: {
  15432. required: true,
  15433. type: "string"
  15434. },
  15435. sha: {
  15436. required: true,
  15437. type: "string"
  15438. }
  15439. },
  15440. url: "/repos/:owner/:repo/git/refs/:ref"
  15441. }
  15442. },
  15443. gitignore: {
  15444. getTemplate: {
  15445. method: "GET",
  15446. params: {
  15447. name: {
  15448. required: true,
  15449. type: "string"
  15450. }
  15451. },
  15452. url: "/gitignore/templates/:name"
  15453. },
  15454. listTemplates: {
  15455. method: "GET",
  15456. params: {},
  15457. url: "/gitignore/templates"
  15458. }
  15459. },
  15460. interactions: {
  15461. addOrUpdateRestrictionsForOrg: {
  15462. headers: {
  15463. accept: "application/vnd.github.sombra-preview+json"
  15464. },
  15465. method: "PUT",
  15466. params: {
  15467. limit: {
  15468. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15469. required: true,
  15470. type: "string"
  15471. },
  15472. org: {
  15473. required: true,
  15474. type: "string"
  15475. }
  15476. },
  15477. url: "/orgs/:org/interaction-limits"
  15478. },
  15479. addOrUpdateRestrictionsForRepo: {
  15480. headers: {
  15481. accept: "application/vnd.github.sombra-preview+json"
  15482. },
  15483. method: "PUT",
  15484. params: {
  15485. limit: {
  15486. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15487. required: true,
  15488. type: "string"
  15489. },
  15490. owner: {
  15491. required: true,
  15492. type: "string"
  15493. },
  15494. repo: {
  15495. required: true,
  15496. type: "string"
  15497. }
  15498. },
  15499. url: "/repos/:owner/:repo/interaction-limits"
  15500. },
  15501. getRestrictionsForOrg: {
  15502. headers: {
  15503. accept: "application/vnd.github.sombra-preview+json"
  15504. },
  15505. method: "GET",
  15506. params: {
  15507. org: {
  15508. required: true,
  15509. type: "string"
  15510. }
  15511. },
  15512. url: "/orgs/:org/interaction-limits"
  15513. },
  15514. getRestrictionsForRepo: {
  15515. headers: {
  15516. accept: "application/vnd.github.sombra-preview+json"
  15517. },
  15518. method: "GET",
  15519. params: {
  15520. owner: {
  15521. required: true,
  15522. type: "string"
  15523. },
  15524. repo: {
  15525. required: true,
  15526. type: "string"
  15527. }
  15528. },
  15529. url: "/repos/:owner/:repo/interaction-limits"
  15530. },
  15531. removeRestrictionsForOrg: {
  15532. headers: {
  15533. accept: "application/vnd.github.sombra-preview+json"
  15534. },
  15535. method: "DELETE",
  15536. params: {
  15537. org: {
  15538. required: true,
  15539. type: "string"
  15540. }
  15541. },
  15542. url: "/orgs/:org/interaction-limits"
  15543. },
  15544. removeRestrictionsForRepo: {
  15545. headers: {
  15546. accept: "application/vnd.github.sombra-preview+json"
  15547. },
  15548. method: "DELETE",
  15549. params: {
  15550. owner: {
  15551. required: true,
  15552. type: "string"
  15553. },
  15554. repo: {
  15555. required: true,
  15556. type: "string"
  15557. }
  15558. },
  15559. url: "/repos/:owner/:repo/interaction-limits"
  15560. }
  15561. },
  15562. issues: {
  15563. addAssignees: {
  15564. method: "POST",
  15565. params: {
  15566. assignees: {
  15567. type: "string[]"
  15568. },
  15569. issue_number: {
  15570. required: true,
  15571. type: "integer"
  15572. },
  15573. number: {
  15574. alias: "issue_number",
  15575. deprecated: true,
  15576. type: "integer"
  15577. },
  15578. owner: {
  15579. required: true,
  15580. type: "string"
  15581. },
  15582. repo: {
  15583. required: true,
  15584. type: "string"
  15585. }
  15586. },
  15587. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15588. },
  15589. addLabels: {
  15590. method: "POST",
  15591. params: {
  15592. issue_number: {
  15593. required: true,
  15594. type: "integer"
  15595. },
  15596. labels: {
  15597. required: true,
  15598. type: "string[]"
  15599. },
  15600. number: {
  15601. alias: "issue_number",
  15602. deprecated: true,
  15603. type: "integer"
  15604. },
  15605. owner: {
  15606. required: true,
  15607. type: "string"
  15608. },
  15609. repo: {
  15610. required: true,
  15611. type: "string"
  15612. }
  15613. },
  15614. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15615. },
  15616. checkAssignee: {
  15617. method: "GET",
  15618. params: {
  15619. assignee: {
  15620. required: true,
  15621. type: "string"
  15622. },
  15623. owner: {
  15624. required: true,
  15625. type: "string"
  15626. },
  15627. repo: {
  15628. required: true,
  15629. type: "string"
  15630. }
  15631. },
  15632. url: "/repos/:owner/:repo/assignees/:assignee"
  15633. },
  15634. create: {
  15635. method: "POST",
  15636. params: {
  15637. assignee: {
  15638. type: "string"
  15639. },
  15640. assignees: {
  15641. type: "string[]"
  15642. },
  15643. body: {
  15644. type: "string"
  15645. },
  15646. labels: {
  15647. type: "string[]"
  15648. },
  15649. milestone: {
  15650. type: "integer"
  15651. },
  15652. owner: {
  15653. required: true,
  15654. type: "string"
  15655. },
  15656. repo: {
  15657. required: true,
  15658. type: "string"
  15659. },
  15660. title: {
  15661. required: true,
  15662. type: "string"
  15663. }
  15664. },
  15665. url: "/repos/:owner/:repo/issues"
  15666. },
  15667. createComment: {
  15668. method: "POST",
  15669. params: {
  15670. body: {
  15671. required: true,
  15672. type: "string"
  15673. },
  15674. issue_number: {
  15675. required: true,
  15676. type: "integer"
  15677. },
  15678. number: {
  15679. alias: "issue_number",
  15680. deprecated: true,
  15681. type: "integer"
  15682. },
  15683. owner: {
  15684. required: true,
  15685. type: "string"
  15686. },
  15687. repo: {
  15688. required: true,
  15689. type: "string"
  15690. }
  15691. },
  15692. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15693. },
  15694. createLabel: {
  15695. method: "POST",
  15696. params: {
  15697. color: {
  15698. required: true,
  15699. type: "string"
  15700. },
  15701. description: {
  15702. type: "string"
  15703. },
  15704. name: {
  15705. required: true,
  15706. type: "string"
  15707. },
  15708. owner: {
  15709. required: true,
  15710. type: "string"
  15711. },
  15712. repo: {
  15713. required: true,
  15714. type: "string"
  15715. }
  15716. },
  15717. url: "/repos/:owner/:repo/labels"
  15718. },
  15719. createMilestone: {
  15720. method: "POST",
  15721. params: {
  15722. description: {
  15723. type: "string"
  15724. },
  15725. due_on: {
  15726. type: "string"
  15727. },
  15728. owner: {
  15729. required: true,
  15730. type: "string"
  15731. },
  15732. repo: {
  15733. required: true,
  15734. type: "string"
  15735. },
  15736. state: {
  15737. enum: ["open", "closed"],
  15738. type: "string"
  15739. },
  15740. title: {
  15741. required: true,
  15742. type: "string"
  15743. }
  15744. },
  15745. url: "/repos/:owner/:repo/milestones"
  15746. },
  15747. deleteComment: {
  15748. method: "DELETE",
  15749. params: {
  15750. comment_id: {
  15751. required: true,
  15752. type: "integer"
  15753. },
  15754. owner: {
  15755. required: true,
  15756. type: "string"
  15757. },
  15758. repo: {
  15759. required: true,
  15760. type: "string"
  15761. }
  15762. },
  15763. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15764. },
  15765. deleteLabel: {
  15766. method: "DELETE",
  15767. params: {
  15768. name: {
  15769. required: true,
  15770. type: "string"
  15771. },
  15772. owner: {
  15773. required: true,
  15774. type: "string"
  15775. },
  15776. repo: {
  15777. required: true,
  15778. type: "string"
  15779. }
  15780. },
  15781. url: "/repos/:owner/:repo/labels/:name"
  15782. },
  15783. deleteMilestone: {
  15784. method: "DELETE",
  15785. params: {
  15786. milestone_number: {
  15787. required: true,
  15788. type: "integer"
  15789. },
  15790. number: {
  15791. alias: "milestone_number",
  15792. deprecated: true,
  15793. type: "integer"
  15794. },
  15795. owner: {
  15796. required: true,
  15797. type: "string"
  15798. },
  15799. repo: {
  15800. required: true,
  15801. type: "string"
  15802. }
  15803. },
  15804. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15805. },
  15806. get: {
  15807. method: "GET",
  15808. params: {
  15809. issue_number: {
  15810. required: true,
  15811. type: "integer"
  15812. },
  15813. number: {
  15814. alias: "issue_number",
  15815. deprecated: true,
  15816. type: "integer"
  15817. },
  15818. owner: {
  15819. required: true,
  15820. type: "string"
  15821. },
  15822. repo: {
  15823. required: true,
  15824. type: "string"
  15825. }
  15826. },
  15827. url: "/repos/:owner/:repo/issues/:issue_number"
  15828. },
  15829. getComment: {
  15830. method: "GET",
  15831. params: {
  15832. comment_id: {
  15833. required: true,
  15834. type: "integer"
  15835. },
  15836. owner: {
  15837. required: true,
  15838. type: "string"
  15839. },
  15840. repo: {
  15841. required: true,
  15842. type: "string"
  15843. }
  15844. },
  15845. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15846. },
  15847. getEvent: {
  15848. method: "GET",
  15849. params: {
  15850. event_id: {
  15851. required: true,
  15852. type: "integer"
  15853. },
  15854. owner: {
  15855. required: true,
  15856. type: "string"
  15857. },
  15858. repo: {
  15859. required: true,
  15860. type: "string"
  15861. }
  15862. },
  15863. url: "/repos/:owner/:repo/issues/events/:event_id"
  15864. },
  15865. getLabel: {
  15866. method: "GET",
  15867. params: {
  15868. name: {
  15869. required: true,
  15870. type: "string"
  15871. },
  15872. owner: {
  15873. required: true,
  15874. type: "string"
  15875. },
  15876. repo: {
  15877. required: true,
  15878. type: "string"
  15879. }
  15880. },
  15881. url: "/repos/:owner/:repo/labels/:name"
  15882. },
  15883. getMilestone: {
  15884. method: "GET",
  15885. params: {
  15886. milestone_number: {
  15887. required: true,
  15888. type: "integer"
  15889. },
  15890. number: {
  15891. alias: "milestone_number",
  15892. deprecated: true,
  15893. type: "integer"
  15894. },
  15895. owner: {
  15896. required: true,
  15897. type: "string"
  15898. },
  15899. repo: {
  15900. required: true,
  15901. type: "string"
  15902. }
  15903. },
  15904. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15905. },
  15906. list: {
  15907. method: "GET",
  15908. params: {
  15909. direction: {
  15910. enum: ["asc", "desc"],
  15911. type: "string"
  15912. },
  15913. filter: {
  15914. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15915. type: "string"
  15916. },
  15917. labels: {
  15918. type: "string"
  15919. },
  15920. page: {
  15921. type: "integer"
  15922. },
  15923. per_page: {
  15924. type: "integer"
  15925. },
  15926. since: {
  15927. type: "string"
  15928. },
  15929. sort: {
  15930. enum: ["created", "updated", "comments"],
  15931. type: "string"
  15932. },
  15933. state: {
  15934. enum: ["open", "closed", "all"],
  15935. type: "string"
  15936. }
  15937. },
  15938. url: "/issues"
  15939. },
  15940. listAssignees: {
  15941. method: "GET",
  15942. params: {
  15943. owner: {
  15944. required: true,
  15945. type: "string"
  15946. },
  15947. page: {
  15948. type: "integer"
  15949. },
  15950. per_page: {
  15951. type: "integer"
  15952. },
  15953. repo: {
  15954. required: true,
  15955. type: "string"
  15956. }
  15957. },
  15958. url: "/repos/:owner/:repo/assignees"
  15959. },
  15960. listComments: {
  15961. method: "GET",
  15962. params: {
  15963. issue_number: {
  15964. required: true,
  15965. type: "integer"
  15966. },
  15967. number: {
  15968. alias: "issue_number",
  15969. deprecated: true,
  15970. type: "integer"
  15971. },
  15972. owner: {
  15973. required: true,
  15974. type: "string"
  15975. },
  15976. page: {
  15977. type: "integer"
  15978. },
  15979. per_page: {
  15980. type: "integer"
  15981. },
  15982. repo: {
  15983. required: true,
  15984. type: "string"
  15985. },
  15986. since: {
  15987. type: "string"
  15988. }
  15989. },
  15990. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15991. },
  15992. listCommentsForRepo: {
  15993. method: "GET",
  15994. params: {
  15995. direction: {
  15996. enum: ["asc", "desc"],
  15997. type: "string"
  15998. },
  15999. owner: {
  16000. required: true,
  16001. type: "string"
  16002. },
  16003. repo: {
  16004. required: true,
  16005. type: "string"
  16006. },
  16007. since: {
  16008. type: "string"
  16009. },
  16010. sort: {
  16011. enum: ["created", "updated"],
  16012. type: "string"
  16013. }
  16014. },
  16015. url: "/repos/:owner/:repo/issues/comments"
  16016. },
  16017. listEvents: {
  16018. method: "GET",
  16019. params: {
  16020. issue_number: {
  16021. required: true,
  16022. type: "integer"
  16023. },
  16024. number: {
  16025. alias: "issue_number",
  16026. deprecated: true,
  16027. type: "integer"
  16028. },
  16029. owner: {
  16030. required: true,
  16031. type: "string"
  16032. },
  16033. page: {
  16034. type: "integer"
  16035. },
  16036. per_page: {
  16037. type: "integer"
  16038. },
  16039. repo: {
  16040. required: true,
  16041. type: "string"
  16042. }
  16043. },
  16044. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16045. },
  16046. listEventsForRepo: {
  16047. method: "GET",
  16048. params: {
  16049. owner: {
  16050. required: true,
  16051. type: "string"
  16052. },
  16053. page: {
  16054. type: "integer"
  16055. },
  16056. per_page: {
  16057. type: "integer"
  16058. },
  16059. repo: {
  16060. required: true,
  16061. type: "string"
  16062. }
  16063. },
  16064. url: "/repos/:owner/:repo/issues/events"
  16065. },
  16066. listEventsForTimeline: {
  16067. headers: {
  16068. accept: "application/vnd.github.mockingbird-preview+json"
  16069. },
  16070. method: "GET",
  16071. params: {
  16072. issue_number: {
  16073. required: true,
  16074. type: "integer"
  16075. },
  16076. number: {
  16077. alias: "issue_number",
  16078. deprecated: true,
  16079. type: "integer"
  16080. },
  16081. owner: {
  16082. required: true,
  16083. type: "string"
  16084. },
  16085. page: {
  16086. type: "integer"
  16087. },
  16088. per_page: {
  16089. type: "integer"
  16090. },
  16091. repo: {
  16092. required: true,
  16093. type: "string"
  16094. }
  16095. },
  16096. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16097. },
  16098. listForAuthenticatedUser: {
  16099. method: "GET",
  16100. params: {
  16101. direction: {
  16102. enum: ["asc", "desc"],
  16103. type: "string"
  16104. },
  16105. filter: {
  16106. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16107. type: "string"
  16108. },
  16109. labels: {
  16110. type: "string"
  16111. },
  16112. page: {
  16113. type: "integer"
  16114. },
  16115. per_page: {
  16116. type: "integer"
  16117. },
  16118. since: {
  16119. type: "string"
  16120. },
  16121. sort: {
  16122. enum: ["created", "updated", "comments"],
  16123. type: "string"
  16124. },
  16125. state: {
  16126. enum: ["open", "closed", "all"],
  16127. type: "string"
  16128. }
  16129. },
  16130. url: "/user/issues"
  16131. },
  16132. listForOrg: {
  16133. method: "GET",
  16134. params: {
  16135. direction: {
  16136. enum: ["asc", "desc"],
  16137. type: "string"
  16138. },
  16139. filter: {
  16140. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16141. type: "string"
  16142. },
  16143. labels: {
  16144. type: "string"
  16145. },
  16146. org: {
  16147. required: true,
  16148. type: "string"
  16149. },
  16150. page: {
  16151. type: "integer"
  16152. },
  16153. per_page: {
  16154. type: "integer"
  16155. },
  16156. since: {
  16157. type: "string"
  16158. },
  16159. sort: {
  16160. enum: ["created", "updated", "comments"],
  16161. type: "string"
  16162. },
  16163. state: {
  16164. enum: ["open", "closed", "all"],
  16165. type: "string"
  16166. }
  16167. },
  16168. url: "/orgs/:org/issues"
  16169. },
  16170. listForRepo: {
  16171. method: "GET",
  16172. params: {
  16173. assignee: {
  16174. type: "string"
  16175. },
  16176. creator: {
  16177. type: "string"
  16178. },
  16179. direction: {
  16180. enum: ["asc", "desc"],
  16181. type: "string"
  16182. },
  16183. labels: {
  16184. type: "string"
  16185. },
  16186. mentioned: {
  16187. type: "string"
  16188. },
  16189. milestone: {
  16190. type: "string"
  16191. },
  16192. owner: {
  16193. required: true,
  16194. type: "string"
  16195. },
  16196. page: {
  16197. type: "integer"
  16198. },
  16199. per_page: {
  16200. type: "integer"
  16201. },
  16202. repo: {
  16203. required: true,
  16204. type: "string"
  16205. },
  16206. since: {
  16207. type: "string"
  16208. },
  16209. sort: {
  16210. enum: ["created", "updated", "comments"],
  16211. type: "string"
  16212. },
  16213. state: {
  16214. enum: ["open", "closed", "all"],
  16215. type: "string"
  16216. }
  16217. },
  16218. url: "/repos/:owner/:repo/issues"
  16219. },
  16220. listLabelsForMilestone: {
  16221. method: "GET",
  16222. params: {
  16223. milestone_number: {
  16224. required: true,
  16225. type: "integer"
  16226. },
  16227. number: {
  16228. alias: "milestone_number",
  16229. deprecated: true,
  16230. type: "integer"
  16231. },
  16232. owner: {
  16233. required: true,
  16234. type: "string"
  16235. },
  16236. page: {
  16237. type: "integer"
  16238. },
  16239. per_page: {
  16240. type: "integer"
  16241. },
  16242. repo: {
  16243. required: true,
  16244. type: "string"
  16245. }
  16246. },
  16247. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16248. },
  16249. listLabelsForRepo: {
  16250. method: "GET",
  16251. params: {
  16252. owner: {
  16253. required: true,
  16254. type: "string"
  16255. },
  16256. page: {
  16257. type: "integer"
  16258. },
  16259. per_page: {
  16260. type: "integer"
  16261. },
  16262. repo: {
  16263. required: true,
  16264. type: "string"
  16265. }
  16266. },
  16267. url: "/repos/:owner/:repo/labels"
  16268. },
  16269. listLabelsOnIssue: {
  16270. method: "GET",
  16271. params: {
  16272. issue_number: {
  16273. required: true,
  16274. type: "integer"
  16275. },
  16276. number: {
  16277. alias: "issue_number",
  16278. deprecated: true,
  16279. type: "integer"
  16280. },
  16281. owner: {
  16282. required: true,
  16283. type: "string"
  16284. },
  16285. page: {
  16286. type: "integer"
  16287. },
  16288. per_page: {
  16289. type: "integer"
  16290. },
  16291. repo: {
  16292. required: true,
  16293. type: "string"
  16294. }
  16295. },
  16296. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16297. },
  16298. listMilestonesForRepo: {
  16299. method: "GET",
  16300. params: {
  16301. direction: {
  16302. enum: ["asc", "desc"],
  16303. type: "string"
  16304. },
  16305. owner: {
  16306. required: true,
  16307. type: "string"
  16308. },
  16309. page: {
  16310. type: "integer"
  16311. },
  16312. per_page: {
  16313. type: "integer"
  16314. },
  16315. repo: {
  16316. required: true,
  16317. type: "string"
  16318. },
  16319. sort: {
  16320. enum: ["due_on", "completeness"],
  16321. type: "string"
  16322. },
  16323. state: {
  16324. enum: ["open", "closed", "all"],
  16325. type: "string"
  16326. }
  16327. },
  16328. url: "/repos/:owner/:repo/milestones"
  16329. },
  16330. lock: {
  16331. method: "PUT",
  16332. params: {
  16333. issue_number: {
  16334. required: true,
  16335. type: "integer"
  16336. },
  16337. lock_reason: {
  16338. enum: ["off-topic", "too heated", "resolved", "spam"],
  16339. type: "string"
  16340. },
  16341. number: {
  16342. alias: "issue_number",
  16343. deprecated: true,
  16344. type: "integer"
  16345. },
  16346. owner: {
  16347. required: true,
  16348. type: "string"
  16349. },
  16350. repo: {
  16351. required: true,
  16352. type: "string"
  16353. }
  16354. },
  16355. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16356. },
  16357. removeAssignees: {
  16358. method: "DELETE",
  16359. params: {
  16360. assignees: {
  16361. type: "string[]"
  16362. },
  16363. issue_number: {
  16364. required: true,
  16365. type: "integer"
  16366. },
  16367. number: {
  16368. alias: "issue_number",
  16369. deprecated: true,
  16370. type: "integer"
  16371. },
  16372. owner: {
  16373. required: true,
  16374. type: "string"
  16375. },
  16376. repo: {
  16377. required: true,
  16378. type: "string"
  16379. }
  16380. },
  16381. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16382. },
  16383. removeLabel: {
  16384. method: "DELETE",
  16385. params: {
  16386. issue_number: {
  16387. required: true,
  16388. type: "integer"
  16389. },
  16390. name: {
  16391. required: true,
  16392. type: "string"
  16393. },
  16394. number: {
  16395. alias: "issue_number",
  16396. deprecated: true,
  16397. type: "integer"
  16398. },
  16399. owner: {
  16400. required: true,
  16401. type: "string"
  16402. },
  16403. repo: {
  16404. required: true,
  16405. type: "string"
  16406. }
  16407. },
  16408. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16409. },
  16410. removeLabels: {
  16411. method: "DELETE",
  16412. params: {
  16413. issue_number: {
  16414. required: true,
  16415. type: "integer"
  16416. },
  16417. number: {
  16418. alias: "issue_number",
  16419. deprecated: true,
  16420. type: "integer"
  16421. },
  16422. owner: {
  16423. required: true,
  16424. type: "string"
  16425. },
  16426. repo: {
  16427. required: true,
  16428. type: "string"
  16429. }
  16430. },
  16431. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16432. },
  16433. replaceLabels: {
  16434. method: "PUT",
  16435. params: {
  16436. issue_number: {
  16437. required: true,
  16438. type: "integer"
  16439. },
  16440. labels: {
  16441. type: "string[]"
  16442. },
  16443. number: {
  16444. alias: "issue_number",
  16445. deprecated: true,
  16446. type: "integer"
  16447. },
  16448. owner: {
  16449. required: true,
  16450. type: "string"
  16451. },
  16452. repo: {
  16453. required: true,
  16454. type: "string"
  16455. }
  16456. },
  16457. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16458. },
  16459. unlock: {
  16460. method: "DELETE",
  16461. params: {
  16462. issue_number: {
  16463. required: true,
  16464. type: "integer"
  16465. },
  16466. number: {
  16467. alias: "issue_number",
  16468. deprecated: true,
  16469. type: "integer"
  16470. },
  16471. owner: {
  16472. required: true,
  16473. type: "string"
  16474. },
  16475. repo: {
  16476. required: true,
  16477. type: "string"
  16478. }
  16479. },
  16480. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16481. },
  16482. update: {
  16483. method: "PATCH",
  16484. params: {
  16485. assignee: {
  16486. type: "string"
  16487. },
  16488. assignees: {
  16489. type: "string[]"
  16490. },
  16491. body: {
  16492. type: "string"
  16493. },
  16494. issue_number: {
  16495. required: true,
  16496. type: "integer"
  16497. },
  16498. labels: {
  16499. type: "string[]"
  16500. },
  16501. milestone: {
  16502. allowNull: true,
  16503. type: "integer"
  16504. },
  16505. number: {
  16506. alias: "issue_number",
  16507. deprecated: true,
  16508. type: "integer"
  16509. },
  16510. owner: {
  16511. required: true,
  16512. type: "string"
  16513. },
  16514. repo: {
  16515. required: true,
  16516. type: "string"
  16517. },
  16518. state: {
  16519. enum: ["open", "closed"],
  16520. type: "string"
  16521. },
  16522. title: {
  16523. type: "string"
  16524. }
  16525. },
  16526. url: "/repos/:owner/:repo/issues/:issue_number"
  16527. },
  16528. updateComment: {
  16529. method: "PATCH",
  16530. params: {
  16531. body: {
  16532. required: true,
  16533. type: "string"
  16534. },
  16535. comment_id: {
  16536. required: true,
  16537. type: "integer"
  16538. },
  16539. owner: {
  16540. required: true,
  16541. type: "string"
  16542. },
  16543. repo: {
  16544. required: true,
  16545. type: "string"
  16546. }
  16547. },
  16548. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16549. },
  16550. updateLabel: {
  16551. method: "PATCH",
  16552. params: {
  16553. color: {
  16554. type: "string"
  16555. },
  16556. current_name: {
  16557. required: true,
  16558. type: "string"
  16559. },
  16560. description: {
  16561. type: "string"
  16562. },
  16563. name: {
  16564. type: "string"
  16565. },
  16566. owner: {
  16567. required: true,
  16568. type: "string"
  16569. },
  16570. repo: {
  16571. required: true,
  16572. type: "string"
  16573. }
  16574. },
  16575. url: "/repos/:owner/:repo/labels/:current_name"
  16576. },
  16577. updateMilestone: {
  16578. method: "PATCH",
  16579. params: {
  16580. description: {
  16581. type: "string"
  16582. },
  16583. due_on: {
  16584. type: "string"
  16585. },
  16586. milestone_number: {
  16587. required: true,
  16588. type: "integer"
  16589. },
  16590. number: {
  16591. alias: "milestone_number",
  16592. deprecated: true,
  16593. type: "integer"
  16594. },
  16595. owner: {
  16596. required: true,
  16597. type: "string"
  16598. },
  16599. repo: {
  16600. required: true,
  16601. type: "string"
  16602. },
  16603. state: {
  16604. enum: ["open", "closed"],
  16605. type: "string"
  16606. },
  16607. title: {
  16608. type: "string"
  16609. }
  16610. },
  16611. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16612. }
  16613. },
  16614. licenses: {
  16615. get: {
  16616. method: "GET",
  16617. params: {
  16618. license: {
  16619. required: true,
  16620. type: "string"
  16621. }
  16622. },
  16623. url: "/licenses/:license"
  16624. },
  16625. getForRepo: {
  16626. method: "GET",
  16627. params: {
  16628. owner: {
  16629. required: true,
  16630. type: "string"
  16631. },
  16632. repo: {
  16633. required: true,
  16634. type: "string"
  16635. }
  16636. },
  16637. url: "/repos/:owner/:repo/license"
  16638. },
  16639. list: {
  16640. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16641. method: "GET",
  16642. params: {},
  16643. url: "/licenses"
  16644. },
  16645. listCommonlyUsed: {
  16646. method: "GET",
  16647. params: {},
  16648. url: "/licenses"
  16649. }
  16650. },
  16651. markdown: {
  16652. render: {
  16653. method: "POST",
  16654. params: {
  16655. context: {
  16656. type: "string"
  16657. },
  16658. mode: {
  16659. enum: ["markdown", "gfm"],
  16660. type: "string"
  16661. },
  16662. text: {
  16663. required: true,
  16664. type: "string"
  16665. }
  16666. },
  16667. url: "/markdown"
  16668. },
  16669. renderRaw: {
  16670. headers: {
  16671. "content-type": "text/plain; charset=utf-8"
  16672. },
  16673. method: "POST",
  16674. params: {
  16675. data: {
  16676. mapTo: "data",
  16677. required: true,
  16678. type: "string"
  16679. }
  16680. },
  16681. url: "/markdown/raw"
  16682. }
  16683. },
  16684. meta: {
  16685. get: {
  16686. method: "GET",
  16687. params: {},
  16688. url: "/meta"
  16689. }
  16690. },
  16691. migrations: {
  16692. cancelImport: {
  16693. method: "DELETE",
  16694. params: {
  16695. owner: {
  16696. required: true,
  16697. type: "string"
  16698. },
  16699. repo: {
  16700. required: true,
  16701. type: "string"
  16702. }
  16703. },
  16704. url: "/repos/:owner/:repo/import"
  16705. },
  16706. deleteArchiveForAuthenticatedUser: {
  16707. headers: {
  16708. accept: "application/vnd.github.wyandotte-preview+json"
  16709. },
  16710. method: "DELETE",
  16711. params: {
  16712. migration_id: {
  16713. required: true,
  16714. type: "integer"
  16715. }
  16716. },
  16717. url: "/user/migrations/:migration_id/archive"
  16718. },
  16719. deleteArchiveForOrg: {
  16720. headers: {
  16721. accept: "application/vnd.github.wyandotte-preview+json"
  16722. },
  16723. method: "DELETE",
  16724. params: {
  16725. migration_id: {
  16726. required: true,
  16727. type: "integer"
  16728. },
  16729. org: {
  16730. required: true,
  16731. type: "string"
  16732. }
  16733. },
  16734. url: "/orgs/:org/migrations/:migration_id/archive"
  16735. },
  16736. downloadArchiveForOrg: {
  16737. headers: {
  16738. accept: "application/vnd.github.wyandotte-preview+json"
  16739. },
  16740. method: "GET",
  16741. params: {
  16742. migration_id: {
  16743. required: true,
  16744. type: "integer"
  16745. },
  16746. org: {
  16747. required: true,
  16748. type: "string"
  16749. }
  16750. },
  16751. url: "/orgs/:org/migrations/:migration_id/archive"
  16752. },
  16753. getArchiveForAuthenticatedUser: {
  16754. headers: {
  16755. accept: "application/vnd.github.wyandotte-preview+json"
  16756. },
  16757. method: "GET",
  16758. params: {
  16759. migration_id: {
  16760. required: true,
  16761. type: "integer"
  16762. }
  16763. },
  16764. url: "/user/migrations/:migration_id/archive"
  16765. },
  16766. getArchiveForOrg: {
  16767. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16768. headers: {
  16769. accept: "application/vnd.github.wyandotte-preview+json"
  16770. },
  16771. method: "GET",
  16772. params: {
  16773. migration_id: {
  16774. required: true,
  16775. type: "integer"
  16776. },
  16777. org: {
  16778. required: true,
  16779. type: "string"
  16780. }
  16781. },
  16782. url: "/orgs/:org/migrations/:migration_id/archive"
  16783. },
  16784. getCommitAuthors: {
  16785. method: "GET",
  16786. params: {
  16787. owner: {
  16788. required: true,
  16789. type: "string"
  16790. },
  16791. repo: {
  16792. required: true,
  16793. type: "string"
  16794. },
  16795. since: {
  16796. type: "string"
  16797. }
  16798. },
  16799. url: "/repos/:owner/:repo/import/authors"
  16800. },
  16801. getImportProgress: {
  16802. method: "GET",
  16803. params: {
  16804. owner: {
  16805. required: true,
  16806. type: "string"
  16807. },
  16808. repo: {
  16809. required: true,
  16810. type: "string"
  16811. }
  16812. },
  16813. url: "/repos/:owner/:repo/import"
  16814. },
  16815. getLargeFiles: {
  16816. method: "GET",
  16817. params: {
  16818. owner: {
  16819. required: true,
  16820. type: "string"
  16821. },
  16822. repo: {
  16823. required: true,
  16824. type: "string"
  16825. }
  16826. },
  16827. url: "/repos/:owner/:repo/import/large_files"
  16828. },
  16829. getStatusForAuthenticatedUser: {
  16830. headers: {
  16831. accept: "application/vnd.github.wyandotte-preview+json"
  16832. },
  16833. method: "GET",
  16834. params: {
  16835. migration_id: {
  16836. required: true,
  16837. type: "integer"
  16838. }
  16839. },
  16840. url: "/user/migrations/:migration_id"
  16841. },
  16842. getStatusForOrg: {
  16843. headers: {
  16844. accept: "application/vnd.github.wyandotte-preview+json"
  16845. },
  16846. method: "GET",
  16847. params: {
  16848. migration_id: {
  16849. required: true,
  16850. type: "integer"
  16851. },
  16852. org: {
  16853. required: true,
  16854. type: "string"
  16855. }
  16856. },
  16857. url: "/orgs/:org/migrations/:migration_id"
  16858. },
  16859. listForAuthenticatedUser: {
  16860. headers: {
  16861. accept: "application/vnd.github.wyandotte-preview+json"
  16862. },
  16863. method: "GET",
  16864. params: {
  16865. page: {
  16866. type: "integer"
  16867. },
  16868. per_page: {
  16869. type: "integer"
  16870. }
  16871. },
  16872. url: "/user/migrations"
  16873. },
  16874. listForOrg: {
  16875. headers: {
  16876. accept: "application/vnd.github.wyandotte-preview+json"
  16877. },
  16878. method: "GET",
  16879. params: {
  16880. org: {
  16881. required: true,
  16882. type: "string"
  16883. },
  16884. page: {
  16885. type: "integer"
  16886. },
  16887. per_page: {
  16888. type: "integer"
  16889. }
  16890. },
  16891. url: "/orgs/:org/migrations"
  16892. },
  16893. listReposForOrg: {
  16894. headers: {
  16895. accept: "application/vnd.github.wyandotte-preview+json"
  16896. },
  16897. method: "GET",
  16898. params: {
  16899. migration_id: {
  16900. required: true,
  16901. type: "integer"
  16902. },
  16903. org: {
  16904. required: true,
  16905. type: "string"
  16906. },
  16907. page: {
  16908. type: "integer"
  16909. },
  16910. per_page: {
  16911. type: "integer"
  16912. }
  16913. },
  16914. url: "/orgs/:org/migrations/:migration_id/repositories"
  16915. },
  16916. listReposForUser: {
  16917. headers: {
  16918. accept: "application/vnd.github.wyandotte-preview+json"
  16919. },
  16920. method: "GET",
  16921. params: {
  16922. migration_id: {
  16923. required: true,
  16924. type: "integer"
  16925. },
  16926. page: {
  16927. type: "integer"
  16928. },
  16929. per_page: {
  16930. type: "integer"
  16931. }
  16932. },
  16933. url: "/user/:migration_id/repositories"
  16934. },
  16935. mapCommitAuthor: {
  16936. method: "PATCH",
  16937. params: {
  16938. author_id: {
  16939. required: true,
  16940. type: "integer"
  16941. },
  16942. email: {
  16943. type: "string"
  16944. },
  16945. name: {
  16946. type: "string"
  16947. },
  16948. owner: {
  16949. required: true,
  16950. type: "string"
  16951. },
  16952. repo: {
  16953. required: true,
  16954. type: "string"
  16955. }
  16956. },
  16957. url: "/repos/:owner/:repo/import/authors/:author_id"
  16958. },
  16959. setLfsPreference: {
  16960. method: "PATCH",
  16961. params: {
  16962. owner: {
  16963. required: true,
  16964. type: "string"
  16965. },
  16966. repo: {
  16967. required: true,
  16968. type: "string"
  16969. },
  16970. use_lfs: {
  16971. enum: ["opt_in", "opt_out"],
  16972. required: true,
  16973. type: "string"
  16974. }
  16975. },
  16976. url: "/repos/:owner/:repo/import/lfs"
  16977. },
  16978. startForAuthenticatedUser: {
  16979. method: "POST",
  16980. params: {
  16981. exclude_attachments: {
  16982. type: "boolean"
  16983. },
  16984. lock_repositories: {
  16985. type: "boolean"
  16986. },
  16987. repositories: {
  16988. required: true,
  16989. type: "string[]"
  16990. }
  16991. },
  16992. url: "/user/migrations"
  16993. },
  16994. startForOrg: {
  16995. method: "POST",
  16996. params: {
  16997. exclude_attachments: {
  16998. type: "boolean"
  16999. },
  17000. lock_repositories: {
  17001. type: "boolean"
  17002. },
  17003. org: {
  17004. required: true,
  17005. type: "string"
  17006. },
  17007. repositories: {
  17008. required: true,
  17009. type: "string[]"
  17010. }
  17011. },
  17012. url: "/orgs/:org/migrations"
  17013. },
  17014. startImport: {
  17015. method: "PUT",
  17016. params: {
  17017. owner: {
  17018. required: true,
  17019. type: "string"
  17020. },
  17021. repo: {
  17022. required: true,
  17023. type: "string"
  17024. },
  17025. tfvc_project: {
  17026. type: "string"
  17027. },
  17028. vcs: {
  17029. enum: ["subversion", "git", "mercurial", "tfvc"],
  17030. type: "string"
  17031. },
  17032. vcs_password: {
  17033. type: "string"
  17034. },
  17035. vcs_url: {
  17036. required: true,
  17037. type: "string"
  17038. },
  17039. vcs_username: {
  17040. type: "string"
  17041. }
  17042. },
  17043. url: "/repos/:owner/:repo/import"
  17044. },
  17045. unlockRepoForAuthenticatedUser: {
  17046. headers: {
  17047. accept: "application/vnd.github.wyandotte-preview+json"
  17048. },
  17049. method: "DELETE",
  17050. params: {
  17051. migration_id: {
  17052. required: true,
  17053. type: "integer"
  17054. },
  17055. repo_name: {
  17056. required: true,
  17057. type: "string"
  17058. }
  17059. },
  17060. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17061. },
  17062. unlockRepoForOrg: {
  17063. headers: {
  17064. accept: "application/vnd.github.wyandotte-preview+json"
  17065. },
  17066. method: "DELETE",
  17067. params: {
  17068. migration_id: {
  17069. required: true,
  17070. type: "integer"
  17071. },
  17072. org: {
  17073. required: true,
  17074. type: "string"
  17075. },
  17076. repo_name: {
  17077. required: true,
  17078. type: "string"
  17079. }
  17080. },
  17081. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17082. },
  17083. updateImport: {
  17084. method: "PATCH",
  17085. params: {
  17086. owner: {
  17087. required: true,
  17088. type: "string"
  17089. },
  17090. repo: {
  17091. required: true,
  17092. type: "string"
  17093. },
  17094. vcs_password: {
  17095. type: "string"
  17096. },
  17097. vcs_username: {
  17098. type: "string"
  17099. }
  17100. },
  17101. url: "/repos/:owner/:repo/import"
  17102. }
  17103. },
  17104. oauthAuthorizations: {
  17105. checkAuthorization: {
  17106. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17107. method: "GET",
  17108. params: {
  17109. access_token: {
  17110. required: true,
  17111. type: "string"
  17112. },
  17113. client_id: {
  17114. required: true,
  17115. type: "string"
  17116. }
  17117. },
  17118. url: "/applications/:client_id/tokens/:access_token"
  17119. },
  17120. createAuthorization: {
  17121. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17122. method: "POST",
  17123. params: {
  17124. client_id: {
  17125. type: "string"
  17126. },
  17127. client_secret: {
  17128. type: "string"
  17129. },
  17130. fingerprint: {
  17131. type: "string"
  17132. },
  17133. note: {
  17134. required: true,
  17135. type: "string"
  17136. },
  17137. note_url: {
  17138. type: "string"
  17139. },
  17140. scopes: {
  17141. type: "string[]"
  17142. }
  17143. },
  17144. url: "/authorizations"
  17145. },
  17146. deleteAuthorization: {
  17147. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17148. method: "DELETE",
  17149. params: {
  17150. authorization_id: {
  17151. required: true,
  17152. type: "integer"
  17153. }
  17154. },
  17155. url: "/authorizations/:authorization_id"
  17156. },
  17157. deleteGrant: {
  17158. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17159. method: "DELETE",
  17160. params: {
  17161. grant_id: {
  17162. required: true,
  17163. type: "integer"
  17164. }
  17165. },
  17166. url: "/applications/grants/:grant_id"
  17167. },
  17168. getAuthorization: {
  17169. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17170. method: "GET",
  17171. params: {
  17172. authorization_id: {
  17173. required: true,
  17174. type: "integer"
  17175. }
  17176. },
  17177. url: "/authorizations/:authorization_id"
  17178. },
  17179. getGrant: {
  17180. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17181. method: "GET",
  17182. params: {
  17183. grant_id: {
  17184. required: true,
  17185. type: "integer"
  17186. }
  17187. },
  17188. url: "/applications/grants/:grant_id"
  17189. },
  17190. getOrCreateAuthorizationForApp: {
  17191. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17192. method: "PUT",
  17193. params: {
  17194. client_id: {
  17195. required: true,
  17196. type: "string"
  17197. },
  17198. client_secret: {
  17199. required: true,
  17200. type: "string"
  17201. },
  17202. fingerprint: {
  17203. type: "string"
  17204. },
  17205. note: {
  17206. type: "string"
  17207. },
  17208. note_url: {
  17209. type: "string"
  17210. },
  17211. scopes: {
  17212. type: "string[]"
  17213. }
  17214. },
  17215. url: "/authorizations/clients/:client_id"
  17216. },
  17217. getOrCreateAuthorizationForAppAndFingerprint: {
  17218. 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",
  17219. method: "PUT",
  17220. params: {
  17221. client_id: {
  17222. required: true,
  17223. type: "string"
  17224. },
  17225. client_secret: {
  17226. required: true,
  17227. type: "string"
  17228. },
  17229. fingerprint: {
  17230. required: true,
  17231. type: "string"
  17232. },
  17233. note: {
  17234. type: "string"
  17235. },
  17236. note_url: {
  17237. type: "string"
  17238. },
  17239. scopes: {
  17240. type: "string[]"
  17241. }
  17242. },
  17243. url: "/authorizations/clients/:client_id/:fingerprint"
  17244. },
  17245. getOrCreateAuthorizationForAppFingerprint: {
  17246. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17247. method: "PUT",
  17248. params: {
  17249. client_id: {
  17250. required: true,
  17251. type: "string"
  17252. },
  17253. client_secret: {
  17254. required: true,
  17255. type: "string"
  17256. },
  17257. fingerprint: {
  17258. required: true,
  17259. type: "string"
  17260. },
  17261. note: {
  17262. type: "string"
  17263. },
  17264. note_url: {
  17265. type: "string"
  17266. },
  17267. scopes: {
  17268. type: "string[]"
  17269. }
  17270. },
  17271. url: "/authorizations/clients/:client_id/:fingerprint"
  17272. },
  17273. listAuthorizations: {
  17274. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17275. method: "GET",
  17276. params: {
  17277. page: {
  17278. type: "integer"
  17279. },
  17280. per_page: {
  17281. type: "integer"
  17282. }
  17283. },
  17284. url: "/authorizations"
  17285. },
  17286. listGrants: {
  17287. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17288. method: "GET",
  17289. params: {
  17290. page: {
  17291. type: "integer"
  17292. },
  17293. per_page: {
  17294. type: "integer"
  17295. }
  17296. },
  17297. url: "/applications/grants"
  17298. },
  17299. resetAuthorization: {
  17300. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17301. method: "POST",
  17302. params: {
  17303. access_token: {
  17304. required: true,
  17305. type: "string"
  17306. },
  17307. client_id: {
  17308. required: true,
  17309. type: "string"
  17310. }
  17311. },
  17312. url: "/applications/:client_id/tokens/:access_token"
  17313. },
  17314. revokeAuthorizationForApplication: {
  17315. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17316. method: "DELETE",
  17317. params: {
  17318. access_token: {
  17319. required: true,
  17320. type: "string"
  17321. },
  17322. client_id: {
  17323. required: true,
  17324. type: "string"
  17325. }
  17326. },
  17327. url: "/applications/:client_id/tokens/:access_token"
  17328. },
  17329. revokeGrantForApplication: {
  17330. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17331. method: "DELETE",
  17332. params: {
  17333. access_token: {
  17334. required: true,
  17335. type: "string"
  17336. },
  17337. client_id: {
  17338. required: true,
  17339. type: "string"
  17340. }
  17341. },
  17342. url: "/applications/:client_id/grants/:access_token"
  17343. },
  17344. updateAuthorization: {
  17345. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17346. method: "PATCH",
  17347. params: {
  17348. add_scopes: {
  17349. type: "string[]"
  17350. },
  17351. authorization_id: {
  17352. required: true,
  17353. type: "integer"
  17354. },
  17355. fingerprint: {
  17356. type: "string"
  17357. },
  17358. note: {
  17359. type: "string"
  17360. },
  17361. note_url: {
  17362. type: "string"
  17363. },
  17364. remove_scopes: {
  17365. type: "string[]"
  17366. },
  17367. scopes: {
  17368. type: "string[]"
  17369. }
  17370. },
  17371. url: "/authorizations/:authorization_id"
  17372. }
  17373. },
  17374. orgs: {
  17375. addOrUpdateMembership: {
  17376. method: "PUT",
  17377. params: {
  17378. org: {
  17379. required: true,
  17380. type: "string"
  17381. },
  17382. role: {
  17383. enum: ["admin", "member"],
  17384. type: "string"
  17385. },
  17386. username: {
  17387. required: true,
  17388. type: "string"
  17389. }
  17390. },
  17391. url: "/orgs/:org/memberships/:username"
  17392. },
  17393. blockUser: {
  17394. method: "PUT",
  17395. params: {
  17396. org: {
  17397. required: true,
  17398. type: "string"
  17399. },
  17400. username: {
  17401. required: true,
  17402. type: "string"
  17403. }
  17404. },
  17405. url: "/orgs/:org/blocks/:username"
  17406. },
  17407. checkBlockedUser: {
  17408. method: "GET",
  17409. params: {
  17410. org: {
  17411. required: true,
  17412. type: "string"
  17413. },
  17414. username: {
  17415. required: true,
  17416. type: "string"
  17417. }
  17418. },
  17419. url: "/orgs/:org/blocks/:username"
  17420. },
  17421. checkMembership: {
  17422. method: "GET",
  17423. params: {
  17424. org: {
  17425. required: true,
  17426. type: "string"
  17427. },
  17428. username: {
  17429. required: true,
  17430. type: "string"
  17431. }
  17432. },
  17433. url: "/orgs/:org/members/:username"
  17434. },
  17435. checkPublicMembership: {
  17436. method: "GET",
  17437. params: {
  17438. org: {
  17439. required: true,
  17440. type: "string"
  17441. },
  17442. username: {
  17443. required: true,
  17444. type: "string"
  17445. }
  17446. },
  17447. url: "/orgs/:org/public_members/:username"
  17448. },
  17449. concealMembership: {
  17450. method: "DELETE",
  17451. params: {
  17452. org: {
  17453. required: true,
  17454. type: "string"
  17455. },
  17456. username: {
  17457. required: true,
  17458. type: "string"
  17459. }
  17460. },
  17461. url: "/orgs/:org/public_members/:username"
  17462. },
  17463. convertMemberToOutsideCollaborator: {
  17464. method: "PUT",
  17465. params: {
  17466. org: {
  17467. required: true,
  17468. type: "string"
  17469. },
  17470. username: {
  17471. required: true,
  17472. type: "string"
  17473. }
  17474. },
  17475. url: "/orgs/:org/outside_collaborators/:username"
  17476. },
  17477. createHook: {
  17478. method: "POST",
  17479. params: {
  17480. active: {
  17481. type: "boolean"
  17482. },
  17483. config: {
  17484. required: true,
  17485. type: "object"
  17486. },
  17487. "config.content_type": {
  17488. type: "string"
  17489. },
  17490. "config.insecure_ssl": {
  17491. type: "string"
  17492. },
  17493. "config.secret": {
  17494. type: "string"
  17495. },
  17496. "config.url": {
  17497. required: true,
  17498. type: "string"
  17499. },
  17500. events: {
  17501. type: "string[]"
  17502. },
  17503. name: {
  17504. required: true,
  17505. type: "string"
  17506. },
  17507. org: {
  17508. required: true,
  17509. type: "string"
  17510. }
  17511. },
  17512. url: "/orgs/:org/hooks"
  17513. },
  17514. createInvitation: {
  17515. method: "POST",
  17516. params: {
  17517. email: {
  17518. type: "string"
  17519. },
  17520. invitee_id: {
  17521. type: "integer"
  17522. },
  17523. org: {
  17524. required: true,
  17525. type: "string"
  17526. },
  17527. role: {
  17528. enum: ["admin", "direct_member", "billing_manager"],
  17529. type: "string"
  17530. },
  17531. team_ids: {
  17532. type: "integer[]"
  17533. }
  17534. },
  17535. url: "/orgs/:org/invitations"
  17536. },
  17537. deleteHook: {
  17538. method: "DELETE",
  17539. params: {
  17540. hook_id: {
  17541. required: true,
  17542. type: "integer"
  17543. },
  17544. org: {
  17545. required: true,
  17546. type: "string"
  17547. }
  17548. },
  17549. url: "/orgs/:org/hooks/:hook_id"
  17550. },
  17551. get: {
  17552. method: "GET",
  17553. params: {
  17554. org: {
  17555. required: true,
  17556. type: "string"
  17557. }
  17558. },
  17559. url: "/orgs/:org"
  17560. },
  17561. getHook: {
  17562. method: "GET",
  17563. params: {
  17564. hook_id: {
  17565. required: true,
  17566. type: "integer"
  17567. },
  17568. org: {
  17569. required: true,
  17570. type: "string"
  17571. }
  17572. },
  17573. url: "/orgs/:org/hooks/:hook_id"
  17574. },
  17575. getMembership: {
  17576. method: "GET",
  17577. params: {
  17578. org: {
  17579. required: true,
  17580. type: "string"
  17581. },
  17582. username: {
  17583. required: true,
  17584. type: "string"
  17585. }
  17586. },
  17587. url: "/orgs/:org/memberships/:username"
  17588. },
  17589. getMembershipForAuthenticatedUser: {
  17590. method: "GET",
  17591. params: {
  17592. org: {
  17593. required: true,
  17594. type: "string"
  17595. }
  17596. },
  17597. url: "/user/memberships/orgs/:org"
  17598. },
  17599. list: {
  17600. method: "GET",
  17601. params: {
  17602. page: {
  17603. type: "integer"
  17604. },
  17605. per_page: {
  17606. type: "integer"
  17607. },
  17608. since: {
  17609. type: "integer"
  17610. }
  17611. },
  17612. url: "/organizations"
  17613. },
  17614. listBlockedUsers: {
  17615. method: "GET",
  17616. params: {
  17617. org: {
  17618. required: true,
  17619. type: "string"
  17620. }
  17621. },
  17622. url: "/orgs/:org/blocks"
  17623. },
  17624. listForAuthenticatedUser: {
  17625. method: "GET",
  17626. params: {
  17627. page: {
  17628. type: "integer"
  17629. },
  17630. per_page: {
  17631. type: "integer"
  17632. }
  17633. },
  17634. url: "/user/orgs"
  17635. },
  17636. listForUser: {
  17637. method: "GET",
  17638. params: {
  17639. page: {
  17640. type: "integer"
  17641. },
  17642. per_page: {
  17643. type: "integer"
  17644. },
  17645. username: {
  17646. required: true,
  17647. type: "string"
  17648. }
  17649. },
  17650. url: "/users/:username/orgs"
  17651. },
  17652. listHooks: {
  17653. method: "GET",
  17654. params: {
  17655. org: {
  17656. required: true,
  17657. type: "string"
  17658. },
  17659. page: {
  17660. type: "integer"
  17661. },
  17662. per_page: {
  17663. type: "integer"
  17664. }
  17665. },
  17666. url: "/orgs/:org/hooks"
  17667. },
  17668. listInstallations: {
  17669. headers: {
  17670. accept: "application/vnd.github.machine-man-preview+json"
  17671. },
  17672. method: "GET",
  17673. params: {
  17674. org: {
  17675. required: true,
  17676. type: "string"
  17677. },
  17678. page: {
  17679. type: "integer"
  17680. },
  17681. per_page: {
  17682. type: "integer"
  17683. }
  17684. },
  17685. url: "/orgs/:org/installations"
  17686. },
  17687. listInvitationTeams: {
  17688. method: "GET",
  17689. params: {
  17690. invitation_id: {
  17691. required: true,
  17692. type: "integer"
  17693. },
  17694. org: {
  17695. required: true,
  17696. type: "string"
  17697. },
  17698. page: {
  17699. type: "integer"
  17700. },
  17701. per_page: {
  17702. type: "integer"
  17703. }
  17704. },
  17705. url: "/orgs/:org/invitations/:invitation_id/teams"
  17706. },
  17707. listMembers: {
  17708. method: "GET",
  17709. params: {
  17710. filter: {
  17711. enum: ["2fa_disabled", "all"],
  17712. type: "string"
  17713. },
  17714. org: {
  17715. required: true,
  17716. type: "string"
  17717. },
  17718. page: {
  17719. type: "integer"
  17720. },
  17721. per_page: {
  17722. type: "integer"
  17723. },
  17724. role: {
  17725. enum: ["all", "admin", "member"],
  17726. type: "string"
  17727. }
  17728. },
  17729. url: "/orgs/:org/members"
  17730. },
  17731. listMemberships: {
  17732. method: "GET",
  17733. params: {
  17734. page: {
  17735. type: "integer"
  17736. },
  17737. per_page: {
  17738. type: "integer"
  17739. },
  17740. state: {
  17741. enum: ["active", "pending"],
  17742. type: "string"
  17743. }
  17744. },
  17745. url: "/user/memberships/orgs"
  17746. },
  17747. listOutsideCollaborators: {
  17748. method: "GET",
  17749. params: {
  17750. filter: {
  17751. enum: ["2fa_disabled", "all"],
  17752. type: "string"
  17753. },
  17754. org: {
  17755. required: true,
  17756. type: "string"
  17757. },
  17758. page: {
  17759. type: "integer"
  17760. },
  17761. per_page: {
  17762. type: "integer"
  17763. }
  17764. },
  17765. url: "/orgs/:org/outside_collaborators"
  17766. },
  17767. listPendingInvitations: {
  17768. method: "GET",
  17769. params: {
  17770. org: {
  17771. required: true,
  17772. type: "string"
  17773. },
  17774. page: {
  17775. type: "integer"
  17776. },
  17777. per_page: {
  17778. type: "integer"
  17779. }
  17780. },
  17781. url: "/orgs/:org/invitations"
  17782. },
  17783. listPublicMembers: {
  17784. method: "GET",
  17785. params: {
  17786. org: {
  17787. required: true,
  17788. type: "string"
  17789. },
  17790. page: {
  17791. type: "integer"
  17792. },
  17793. per_page: {
  17794. type: "integer"
  17795. }
  17796. },
  17797. url: "/orgs/:org/public_members"
  17798. },
  17799. pingHook: {
  17800. method: "POST",
  17801. params: {
  17802. hook_id: {
  17803. required: true,
  17804. type: "integer"
  17805. },
  17806. org: {
  17807. required: true,
  17808. type: "string"
  17809. }
  17810. },
  17811. url: "/orgs/:org/hooks/:hook_id/pings"
  17812. },
  17813. publicizeMembership: {
  17814. method: "PUT",
  17815. params: {
  17816. org: {
  17817. required: true,
  17818. type: "string"
  17819. },
  17820. username: {
  17821. required: true,
  17822. type: "string"
  17823. }
  17824. },
  17825. url: "/orgs/:org/public_members/:username"
  17826. },
  17827. removeMember: {
  17828. method: "DELETE",
  17829. params: {
  17830. org: {
  17831. required: true,
  17832. type: "string"
  17833. },
  17834. username: {
  17835. required: true,
  17836. type: "string"
  17837. }
  17838. },
  17839. url: "/orgs/:org/members/:username"
  17840. },
  17841. removeMembership: {
  17842. method: "DELETE",
  17843. params: {
  17844. org: {
  17845. required: true,
  17846. type: "string"
  17847. },
  17848. username: {
  17849. required: true,
  17850. type: "string"
  17851. }
  17852. },
  17853. url: "/orgs/:org/memberships/:username"
  17854. },
  17855. removeOutsideCollaborator: {
  17856. method: "DELETE",
  17857. params: {
  17858. org: {
  17859. required: true,
  17860. type: "string"
  17861. },
  17862. username: {
  17863. required: true,
  17864. type: "string"
  17865. }
  17866. },
  17867. url: "/orgs/:org/outside_collaborators/:username"
  17868. },
  17869. unblockUser: {
  17870. method: "DELETE",
  17871. params: {
  17872. org: {
  17873. required: true,
  17874. type: "string"
  17875. },
  17876. username: {
  17877. required: true,
  17878. type: "string"
  17879. }
  17880. },
  17881. url: "/orgs/:org/blocks/:username"
  17882. },
  17883. update: {
  17884. method: "PATCH",
  17885. params: {
  17886. billing_email: {
  17887. type: "string"
  17888. },
  17889. company: {
  17890. type: "string"
  17891. },
  17892. default_repository_permission: {
  17893. enum: ["read", "write", "admin", "none"],
  17894. type: "string"
  17895. },
  17896. description: {
  17897. type: "string"
  17898. },
  17899. email: {
  17900. type: "string"
  17901. },
  17902. has_organization_projects: {
  17903. type: "boolean"
  17904. },
  17905. has_repository_projects: {
  17906. type: "boolean"
  17907. },
  17908. location: {
  17909. type: "string"
  17910. },
  17911. members_allowed_repository_creation_type: {
  17912. enum: ["all", "private", "none"],
  17913. type: "string"
  17914. },
  17915. members_can_create_internal_repositories: {
  17916. type: "boolean"
  17917. },
  17918. members_can_create_private_repositories: {
  17919. type: "boolean"
  17920. },
  17921. members_can_create_public_repositories: {
  17922. type: "boolean"
  17923. },
  17924. members_can_create_repositories: {
  17925. type: "boolean"
  17926. },
  17927. name: {
  17928. type: "string"
  17929. },
  17930. org: {
  17931. required: true,
  17932. type: "string"
  17933. }
  17934. },
  17935. url: "/orgs/:org"
  17936. },
  17937. updateHook: {
  17938. method: "PATCH",
  17939. params: {
  17940. active: {
  17941. type: "boolean"
  17942. },
  17943. config: {
  17944. type: "object"
  17945. },
  17946. "config.content_type": {
  17947. type: "string"
  17948. },
  17949. "config.insecure_ssl": {
  17950. type: "string"
  17951. },
  17952. "config.secret": {
  17953. type: "string"
  17954. },
  17955. "config.url": {
  17956. required: true,
  17957. type: "string"
  17958. },
  17959. events: {
  17960. type: "string[]"
  17961. },
  17962. hook_id: {
  17963. required: true,
  17964. type: "integer"
  17965. },
  17966. org: {
  17967. required: true,
  17968. type: "string"
  17969. }
  17970. },
  17971. url: "/orgs/:org/hooks/:hook_id"
  17972. },
  17973. updateMembership: {
  17974. method: "PATCH",
  17975. params: {
  17976. org: {
  17977. required: true,
  17978. type: "string"
  17979. },
  17980. state: {
  17981. enum: ["active"],
  17982. required: true,
  17983. type: "string"
  17984. }
  17985. },
  17986. url: "/user/memberships/orgs/:org"
  17987. }
  17988. },
  17989. projects: {
  17990. addCollaborator: {
  17991. headers: {
  17992. accept: "application/vnd.github.inertia-preview+json"
  17993. },
  17994. method: "PUT",
  17995. params: {
  17996. permission: {
  17997. enum: ["read", "write", "admin"],
  17998. type: "string"
  17999. },
  18000. project_id: {
  18001. required: true,
  18002. type: "integer"
  18003. },
  18004. username: {
  18005. required: true,
  18006. type: "string"
  18007. }
  18008. },
  18009. url: "/projects/:project_id/collaborators/:username"
  18010. },
  18011. createCard: {
  18012. headers: {
  18013. accept: "application/vnd.github.inertia-preview+json"
  18014. },
  18015. method: "POST",
  18016. params: {
  18017. column_id: {
  18018. required: true,
  18019. type: "integer"
  18020. },
  18021. content_id: {
  18022. type: "integer"
  18023. },
  18024. content_type: {
  18025. type: "string"
  18026. },
  18027. note: {
  18028. type: "string"
  18029. }
  18030. },
  18031. url: "/projects/columns/:column_id/cards"
  18032. },
  18033. createColumn: {
  18034. headers: {
  18035. accept: "application/vnd.github.inertia-preview+json"
  18036. },
  18037. method: "POST",
  18038. params: {
  18039. name: {
  18040. required: true,
  18041. type: "string"
  18042. },
  18043. project_id: {
  18044. required: true,
  18045. type: "integer"
  18046. }
  18047. },
  18048. url: "/projects/:project_id/columns"
  18049. },
  18050. createForAuthenticatedUser: {
  18051. headers: {
  18052. accept: "application/vnd.github.inertia-preview+json"
  18053. },
  18054. method: "POST",
  18055. params: {
  18056. body: {
  18057. type: "string"
  18058. },
  18059. name: {
  18060. required: true,
  18061. type: "string"
  18062. }
  18063. },
  18064. url: "/user/projects"
  18065. },
  18066. createForOrg: {
  18067. headers: {
  18068. accept: "application/vnd.github.inertia-preview+json"
  18069. },
  18070. method: "POST",
  18071. params: {
  18072. body: {
  18073. type: "string"
  18074. },
  18075. name: {
  18076. required: true,
  18077. type: "string"
  18078. },
  18079. org: {
  18080. required: true,
  18081. type: "string"
  18082. }
  18083. },
  18084. url: "/orgs/:org/projects"
  18085. },
  18086. createForRepo: {
  18087. headers: {
  18088. accept: "application/vnd.github.inertia-preview+json"
  18089. },
  18090. method: "POST",
  18091. params: {
  18092. body: {
  18093. type: "string"
  18094. },
  18095. name: {
  18096. required: true,
  18097. type: "string"
  18098. },
  18099. owner: {
  18100. required: true,
  18101. type: "string"
  18102. },
  18103. repo: {
  18104. required: true,
  18105. type: "string"
  18106. }
  18107. },
  18108. url: "/repos/:owner/:repo/projects"
  18109. },
  18110. delete: {
  18111. headers: {
  18112. accept: "application/vnd.github.inertia-preview+json"
  18113. },
  18114. method: "DELETE",
  18115. params: {
  18116. project_id: {
  18117. required: true,
  18118. type: "integer"
  18119. }
  18120. },
  18121. url: "/projects/:project_id"
  18122. },
  18123. deleteCard: {
  18124. headers: {
  18125. accept: "application/vnd.github.inertia-preview+json"
  18126. },
  18127. method: "DELETE",
  18128. params: {
  18129. card_id: {
  18130. required: true,
  18131. type: "integer"
  18132. }
  18133. },
  18134. url: "/projects/columns/cards/:card_id"
  18135. },
  18136. deleteColumn: {
  18137. headers: {
  18138. accept: "application/vnd.github.inertia-preview+json"
  18139. },
  18140. method: "DELETE",
  18141. params: {
  18142. column_id: {
  18143. required: true,
  18144. type: "integer"
  18145. }
  18146. },
  18147. url: "/projects/columns/:column_id"
  18148. },
  18149. get: {
  18150. headers: {
  18151. accept: "application/vnd.github.inertia-preview+json"
  18152. },
  18153. method: "GET",
  18154. params: {
  18155. project_id: {
  18156. required: true,
  18157. type: "integer"
  18158. }
  18159. },
  18160. url: "/projects/:project_id"
  18161. },
  18162. getCard: {
  18163. headers: {
  18164. accept: "application/vnd.github.inertia-preview+json"
  18165. },
  18166. method: "GET",
  18167. params: {
  18168. card_id: {
  18169. required: true,
  18170. type: "integer"
  18171. }
  18172. },
  18173. url: "/projects/columns/cards/:card_id"
  18174. },
  18175. getColumn: {
  18176. headers: {
  18177. accept: "application/vnd.github.inertia-preview+json"
  18178. },
  18179. method: "GET",
  18180. params: {
  18181. column_id: {
  18182. required: true,
  18183. type: "integer"
  18184. }
  18185. },
  18186. url: "/projects/columns/:column_id"
  18187. },
  18188. listCards: {
  18189. headers: {
  18190. accept: "application/vnd.github.inertia-preview+json"
  18191. },
  18192. method: "GET",
  18193. params: {
  18194. archived_state: {
  18195. enum: ["all", "archived", "not_archived"],
  18196. type: "string"
  18197. },
  18198. column_id: {
  18199. required: true,
  18200. type: "integer"
  18201. },
  18202. page: {
  18203. type: "integer"
  18204. },
  18205. per_page: {
  18206. type: "integer"
  18207. }
  18208. },
  18209. url: "/projects/columns/:column_id/cards"
  18210. },
  18211. listCollaborators: {
  18212. headers: {
  18213. accept: "application/vnd.github.inertia-preview+json"
  18214. },
  18215. method: "GET",
  18216. params: {
  18217. affiliation: {
  18218. enum: ["outside", "direct", "all"],
  18219. type: "string"
  18220. },
  18221. page: {
  18222. type: "integer"
  18223. },
  18224. per_page: {
  18225. type: "integer"
  18226. },
  18227. project_id: {
  18228. required: true,
  18229. type: "integer"
  18230. }
  18231. },
  18232. url: "/projects/:project_id/collaborators"
  18233. },
  18234. listColumns: {
  18235. headers: {
  18236. accept: "application/vnd.github.inertia-preview+json"
  18237. },
  18238. method: "GET",
  18239. params: {
  18240. page: {
  18241. type: "integer"
  18242. },
  18243. per_page: {
  18244. type: "integer"
  18245. },
  18246. project_id: {
  18247. required: true,
  18248. type: "integer"
  18249. }
  18250. },
  18251. url: "/projects/:project_id/columns"
  18252. },
  18253. listForOrg: {
  18254. headers: {
  18255. accept: "application/vnd.github.inertia-preview+json"
  18256. },
  18257. method: "GET",
  18258. params: {
  18259. org: {
  18260. required: true,
  18261. type: "string"
  18262. },
  18263. page: {
  18264. type: "integer"
  18265. },
  18266. per_page: {
  18267. type: "integer"
  18268. },
  18269. state: {
  18270. enum: ["open", "closed", "all"],
  18271. type: "string"
  18272. }
  18273. },
  18274. url: "/orgs/:org/projects"
  18275. },
  18276. listForRepo: {
  18277. headers: {
  18278. accept: "application/vnd.github.inertia-preview+json"
  18279. },
  18280. method: "GET",
  18281. params: {
  18282. owner: {
  18283. required: true,
  18284. type: "string"
  18285. },
  18286. page: {
  18287. type: "integer"
  18288. },
  18289. per_page: {
  18290. type: "integer"
  18291. },
  18292. repo: {
  18293. required: true,
  18294. type: "string"
  18295. },
  18296. state: {
  18297. enum: ["open", "closed", "all"],
  18298. type: "string"
  18299. }
  18300. },
  18301. url: "/repos/:owner/:repo/projects"
  18302. },
  18303. listForUser: {
  18304. headers: {
  18305. accept: "application/vnd.github.inertia-preview+json"
  18306. },
  18307. method: "GET",
  18308. params: {
  18309. page: {
  18310. type: "integer"
  18311. },
  18312. per_page: {
  18313. type: "integer"
  18314. },
  18315. state: {
  18316. enum: ["open", "closed", "all"],
  18317. type: "string"
  18318. },
  18319. username: {
  18320. required: true,
  18321. type: "string"
  18322. }
  18323. },
  18324. url: "/users/:username/projects"
  18325. },
  18326. moveCard: {
  18327. headers: {
  18328. accept: "application/vnd.github.inertia-preview+json"
  18329. },
  18330. method: "POST",
  18331. params: {
  18332. card_id: {
  18333. required: true,
  18334. type: "integer"
  18335. },
  18336. column_id: {
  18337. type: "integer"
  18338. },
  18339. position: {
  18340. required: true,
  18341. type: "string",
  18342. validation: "^(top|bottom|after:\\d+)$"
  18343. }
  18344. },
  18345. url: "/projects/columns/cards/:card_id/moves"
  18346. },
  18347. moveColumn: {
  18348. headers: {
  18349. accept: "application/vnd.github.inertia-preview+json"
  18350. },
  18351. method: "POST",
  18352. params: {
  18353. column_id: {
  18354. required: true,
  18355. type: "integer"
  18356. },
  18357. position: {
  18358. required: true,
  18359. type: "string",
  18360. validation: "^(first|last|after:\\d+)$"
  18361. }
  18362. },
  18363. url: "/projects/columns/:column_id/moves"
  18364. },
  18365. removeCollaborator: {
  18366. headers: {
  18367. accept: "application/vnd.github.inertia-preview+json"
  18368. },
  18369. method: "DELETE",
  18370. params: {
  18371. project_id: {
  18372. required: true,
  18373. type: "integer"
  18374. },
  18375. username: {
  18376. required: true,
  18377. type: "string"
  18378. }
  18379. },
  18380. url: "/projects/:project_id/collaborators/:username"
  18381. },
  18382. reviewUserPermissionLevel: {
  18383. headers: {
  18384. accept: "application/vnd.github.inertia-preview+json"
  18385. },
  18386. method: "GET",
  18387. params: {
  18388. project_id: {
  18389. required: true,
  18390. type: "integer"
  18391. },
  18392. username: {
  18393. required: true,
  18394. type: "string"
  18395. }
  18396. },
  18397. url: "/projects/:project_id/collaborators/:username/permission"
  18398. },
  18399. update: {
  18400. headers: {
  18401. accept: "application/vnd.github.inertia-preview+json"
  18402. },
  18403. method: "PATCH",
  18404. params: {
  18405. body: {
  18406. type: "string"
  18407. },
  18408. name: {
  18409. type: "string"
  18410. },
  18411. organization_permission: {
  18412. type: "string"
  18413. },
  18414. private: {
  18415. type: "boolean"
  18416. },
  18417. project_id: {
  18418. required: true,
  18419. type: "integer"
  18420. },
  18421. state: {
  18422. enum: ["open", "closed"],
  18423. type: "string"
  18424. }
  18425. },
  18426. url: "/projects/:project_id"
  18427. },
  18428. updateCard: {
  18429. headers: {
  18430. accept: "application/vnd.github.inertia-preview+json"
  18431. },
  18432. method: "PATCH",
  18433. params: {
  18434. archived: {
  18435. type: "boolean"
  18436. },
  18437. card_id: {
  18438. required: true,
  18439. type: "integer"
  18440. },
  18441. note: {
  18442. type: "string"
  18443. }
  18444. },
  18445. url: "/projects/columns/cards/:card_id"
  18446. },
  18447. updateColumn: {
  18448. headers: {
  18449. accept: "application/vnd.github.inertia-preview+json"
  18450. },
  18451. method: "PATCH",
  18452. params: {
  18453. column_id: {
  18454. required: true,
  18455. type: "integer"
  18456. },
  18457. name: {
  18458. required: true,
  18459. type: "string"
  18460. }
  18461. },
  18462. url: "/projects/columns/:column_id"
  18463. }
  18464. },
  18465. pulls: {
  18466. checkIfMerged: {
  18467. method: "GET",
  18468. params: {
  18469. number: {
  18470. alias: "pull_number",
  18471. deprecated: true,
  18472. type: "integer"
  18473. },
  18474. owner: {
  18475. required: true,
  18476. type: "string"
  18477. },
  18478. pull_number: {
  18479. required: true,
  18480. type: "integer"
  18481. },
  18482. repo: {
  18483. required: true,
  18484. type: "string"
  18485. }
  18486. },
  18487. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18488. },
  18489. create: {
  18490. method: "POST",
  18491. params: {
  18492. base: {
  18493. required: true,
  18494. type: "string"
  18495. },
  18496. body: {
  18497. type: "string"
  18498. },
  18499. draft: {
  18500. type: "boolean"
  18501. },
  18502. head: {
  18503. required: true,
  18504. type: "string"
  18505. },
  18506. maintainer_can_modify: {
  18507. type: "boolean"
  18508. },
  18509. owner: {
  18510. required: true,
  18511. type: "string"
  18512. },
  18513. repo: {
  18514. required: true,
  18515. type: "string"
  18516. },
  18517. title: {
  18518. required: true,
  18519. type: "string"
  18520. }
  18521. },
  18522. url: "/repos/:owner/:repo/pulls"
  18523. },
  18524. createComment: {
  18525. method: "POST",
  18526. params: {
  18527. body: {
  18528. required: true,
  18529. type: "string"
  18530. },
  18531. commit_id: {
  18532. required: true,
  18533. type: "string"
  18534. },
  18535. in_reply_to: {
  18536. deprecated: true,
  18537. 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.",
  18538. type: "integer"
  18539. },
  18540. line: {
  18541. type: "integer"
  18542. },
  18543. number: {
  18544. alias: "pull_number",
  18545. deprecated: true,
  18546. type: "integer"
  18547. },
  18548. owner: {
  18549. required: true,
  18550. type: "string"
  18551. },
  18552. path: {
  18553. required: true,
  18554. type: "string"
  18555. },
  18556. position: {
  18557. type: "integer"
  18558. },
  18559. pull_number: {
  18560. required: true,
  18561. type: "integer"
  18562. },
  18563. repo: {
  18564. required: true,
  18565. type: "string"
  18566. },
  18567. side: {
  18568. enum: ["LEFT", "RIGHT"],
  18569. type: "string"
  18570. },
  18571. start_line: {
  18572. type: "integer"
  18573. },
  18574. start_side: {
  18575. enum: ["LEFT", "RIGHT", "side"],
  18576. type: "string"
  18577. }
  18578. },
  18579. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18580. },
  18581. createCommentReply: {
  18582. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18583. method: "POST",
  18584. params: {
  18585. body: {
  18586. required: true,
  18587. type: "string"
  18588. },
  18589. commit_id: {
  18590. required: true,
  18591. type: "string"
  18592. },
  18593. in_reply_to: {
  18594. deprecated: true,
  18595. 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.",
  18596. type: "integer"
  18597. },
  18598. line: {
  18599. type: "integer"
  18600. },
  18601. number: {
  18602. alias: "pull_number",
  18603. deprecated: true,
  18604. type: "integer"
  18605. },
  18606. owner: {
  18607. required: true,
  18608. type: "string"
  18609. },
  18610. path: {
  18611. required: true,
  18612. type: "string"
  18613. },
  18614. position: {
  18615. type: "integer"
  18616. },
  18617. pull_number: {
  18618. required: true,
  18619. type: "integer"
  18620. },
  18621. repo: {
  18622. required: true,
  18623. type: "string"
  18624. },
  18625. side: {
  18626. enum: ["LEFT", "RIGHT"],
  18627. type: "string"
  18628. },
  18629. start_line: {
  18630. type: "integer"
  18631. },
  18632. start_side: {
  18633. enum: ["LEFT", "RIGHT", "side"],
  18634. type: "string"
  18635. }
  18636. },
  18637. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18638. },
  18639. createFromIssue: {
  18640. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18641. method: "POST",
  18642. params: {
  18643. base: {
  18644. required: true,
  18645. type: "string"
  18646. },
  18647. draft: {
  18648. type: "boolean"
  18649. },
  18650. head: {
  18651. required: true,
  18652. type: "string"
  18653. },
  18654. issue: {
  18655. required: true,
  18656. type: "integer"
  18657. },
  18658. maintainer_can_modify: {
  18659. type: "boolean"
  18660. },
  18661. owner: {
  18662. required: true,
  18663. type: "string"
  18664. },
  18665. repo: {
  18666. required: true,
  18667. type: "string"
  18668. }
  18669. },
  18670. url: "/repos/:owner/:repo/pulls"
  18671. },
  18672. createReview: {
  18673. method: "POST",
  18674. params: {
  18675. body: {
  18676. type: "string"
  18677. },
  18678. comments: {
  18679. type: "object[]"
  18680. },
  18681. "comments[].body": {
  18682. required: true,
  18683. type: "string"
  18684. },
  18685. "comments[].path": {
  18686. required: true,
  18687. type: "string"
  18688. },
  18689. "comments[].position": {
  18690. required: true,
  18691. type: "integer"
  18692. },
  18693. commit_id: {
  18694. type: "string"
  18695. },
  18696. event: {
  18697. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18698. type: "string"
  18699. },
  18700. number: {
  18701. alias: "pull_number",
  18702. deprecated: true,
  18703. type: "integer"
  18704. },
  18705. owner: {
  18706. required: true,
  18707. type: "string"
  18708. },
  18709. pull_number: {
  18710. required: true,
  18711. type: "integer"
  18712. },
  18713. repo: {
  18714. required: true,
  18715. type: "string"
  18716. }
  18717. },
  18718. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18719. },
  18720. createReviewCommentReply: {
  18721. method: "POST",
  18722. params: {
  18723. body: {
  18724. required: true,
  18725. type: "string"
  18726. },
  18727. comment_id: {
  18728. required: true,
  18729. type: "integer"
  18730. },
  18731. owner: {
  18732. required: true,
  18733. type: "string"
  18734. },
  18735. pull_number: {
  18736. required: true,
  18737. type: "integer"
  18738. },
  18739. repo: {
  18740. required: true,
  18741. type: "string"
  18742. }
  18743. },
  18744. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18745. },
  18746. createReviewRequest: {
  18747. method: "POST",
  18748. params: {
  18749. number: {
  18750. alias: "pull_number",
  18751. deprecated: true,
  18752. type: "integer"
  18753. },
  18754. owner: {
  18755. required: true,
  18756. type: "string"
  18757. },
  18758. pull_number: {
  18759. required: true,
  18760. type: "integer"
  18761. },
  18762. repo: {
  18763. required: true,
  18764. type: "string"
  18765. },
  18766. reviewers: {
  18767. type: "string[]"
  18768. },
  18769. team_reviewers: {
  18770. type: "string[]"
  18771. }
  18772. },
  18773. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18774. },
  18775. deleteComment: {
  18776. method: "DELETE",
  18777. params: {
  18778. comment_id: {
  18779. required: true,
  18780. type: "integer"
  18781. },
  18782. owner: {
  18783. required: true,
  18784. type: "string"
  18785. },
  18786. repo: {
  18787. required: true,
  18788. type: "string"
  18789. }
  18790. },
  18791. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18792. },
  18793. deletePendingReview: {
  18794. method: "DELETE",
  18795. params: {
  18796. number: {
  18797. alias: "pull_number",
  18798. deprecated: true,
  18799. type: "integer"
  18800. },
  18801. owner: {
  18802. required: true,
  18803. type: "string"
  18804. },
  18805. pull_number: {
  18806. required: true,
  18807. type: "integer"
  18808. },
  18809. repo: {
  18810. required: true,
  18811. type: "string"
  18812. },
  18813. review_id: {
  18814. required: true,
  18815. type: "integer"
  18816. }
  18817. },
  18818. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18819. },
  18820. deleteReviewRequest: {
  18821. method: "DELETE",
  18822. params: {
  18823. number: {
  18824. alias: "pull_number",
  18825. deprecated: true,
  18826. type: "integer"
  18827. },
  18828. owner: {
  18829. required: true,
  18830. type: "string"
  18831. },
  18832. pull_number: {
  18833. required: true,
  18834. type: "integer"
  18835. },
  18836. repo: {
  18837. required: true,
  18838. type: "string"
  18839. },
  18840. reviewers: {
  18841. type: "string[]"
  18842. },
  18843. team_reviewers: {
  18844. type: "string[]"
  18845. }
  18846. },
  18847. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18848. },
  18849. dismissReview: {
  18850. method: "PUT",
  18851. params: {
  18852. message: {
  18853. required: true,
  18854. type: "string"
  18855. },
  18856. number: {
  18857. alias: "pull_number",
  18858. deprecated: true,
  18859. type: "integer"
  18860. },
  18861. owner: {
  18862. required: true,
  18863. type: "string"
  18864. },
  18865. pull_number: {
  18866. required: true,
  18867. type: "integer"
  18868. },
  18869. repo: {
  18870. required: true,
  18871. type: "string"
  18872. },
  18873. review_id: {
  18874. required: true,
  18875. type: "integer"
  18876. }
  18877. },
  18878. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18879. },
  18880. get: {
  18881. method: "GET",
  18882. params: {
  18883. number: {
  18884. alias: "pull_number",
  18885. deprecated: true,
  18886. type: "integer"
  18887. },
  18888. owner: {
  18889. required: true,
  18890. type: "string"
  18891. },
  18892. pull_number: {
  18893. required: true,
  18894. type: "integer"
  18895. },
  18896. repo: {
  18897. required: true,
  18898. type: "string"
  18899. }
  18900. },
  18901. url: "/repos/:owner/:repo/pulls/:pull_number"
  18902. },
  18903. getComment: {
  18904. method: "GET",
  18905. params: {
  18906. comment_id: {
  18907. required: true,
  18908. type: "integer"
  18909. },
  18910. owner: {
  18911. required: true,
  18912. type: "string"
  18913. },
  18914. repo: {
  18915. required: true,
  18916. type: "string"
  18917. }
  18918. },
  18919. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18920. },
  18921. getCommentsForReview: {
  18922. method: "GET",
  18923. params: {
  18924. number: {
  18925. alias: "pull_number",
  18926. deprecated: true,
  18927. type: "integer"
  18928. },
  18929. owner: {
  18930. required: true,
  18931. type: "string"
  18932. },
  18933. page: {
  18934. type: "integer"
  18935. },
  18936. per_page: {
  18937. type: "integer"
  18938. },
  18939. pull_number: {
  18940. required: true,
  18941. type: "integer"
  18942. },
  18943. repo: {
  18944. required: true,
  18945. type: "string"
  18946. },
  18947. review_id: {
  18948. required: true,
  18949. type: "integer"
  18950. }
  18951. },
  18952. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  18953. },
  18954. getReview: {
  18955. method: "GET",
  18956. params: {
  18957. number: {
  18958. alias: "pull_number",
  18959. deprecated: true,
  18960. type: "integer"
  18961. },
  18962. owner: {
  18963. required: true,
  18964. type: "string"
  18965. },
  18966. pull_number: {
  18967. required: true,
  18968. type: "integer"
  18969. },
  18970. repo: {
  18971. required: true,
  18972. type: "string"
  18973. },
  18974. review_id: {
  18975. required: true,
  18976. type: "integer"
  18977. }
  18978. },
  18979. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18980. },
  18981. list: {
  18982. method: "GET",
  18983. params: {
  18984. base: {
  18985. type: "string"
  18986. },
  18987. direction: {
  18988. enum: ["asc", "desc"],
  18989. type: "string"
  18990. },
  18991. head: {
  18992. type: "string"
  18993. },
  18994. owner: {
  18995. required: true,
  18996. type: "string"
  18997. },
  18998. page: {
  18999. type: "integer"
  19000. },
  19001. per_page: {
  19002. type: "integer"
  19003. },
  19004. repo: {
  19005. required: true,
  19006. type: "string"
  19007. },
  19008. sort: {
  19009. enum: ["created", "updated", "popularity", "long-running"],
  19010. type: "string"
  19011. },
  19012. state: {
  19013. enum: ["open", "closed", "all"],
  19014. type: "string"
  19015. }
  19016. },
  19017. url: "/repos/:owner/:repo/pulls"
  19018. },
  19019. listComments: {
  19020. method: "GET",
  19021. params: {
  19022. direction: {
  19023. enum: ["asc", "desc"],
  19024. type: "string"
  19025. },
  19026. number: {
  19027. alias: "pull_number",
  19028. deprecated: true,
  19029. type: "integer"
  19030. },
  19031. owner: {
  19032. required: true,
  19033. type: "string"
  19034. },
  19035. page: {
  19036. type: "integer"
  19037. },
  19038. per_page: {
  19039. type: "integer"
  19040. },
  19041. pull_number: {
  19042. required: true,
  19043. type: "integer"
  19044. },
  19045. repo: {
  19046. required: true,
  19047. type: "string"
  19048. },
  19049. since: {
  19050. type: "string"
  19051. },
  19052. sort: {
  19053. enum: ["created", "updated"],
  19054. type: "string"
  19055. }
  19056. },
  19057. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19058. },
  19059. listCommentsForRepo: {
  19060. method: "GET",
  19061. params: {
  19062. direction: {
  19063. enum: ["asc", "desc"],
  19064. type: "string"
  19065. },
  19066. owner: {
  19067. required: true,
  19068. type: "string"
  19069. },
  19070. page: {
  19071. type: "integer"
  19072. },
  19073. per_page: {
  19074. type: "integer"
  19075. },
  19076. repo: {
  19077. required: true,
  19078. type: "string"
  19079. },
  19080. since: {
  19081. type: "string"
  19082. },
  19083. sort: {
  19084. enum: ["created", "updated"],
  19085. type: "string"
  19086. }
  19087. },
  19088. url: "/repos/:owner/:repo/pulls/comments"
  19089. },
  19090. listCommits: {
  19091. method: "GET",
  19092. params: {
  19093. number: {
  19094. alias: "pull_number",
  19095. deprecated: true,
  19096. type: "integer"
  19097. },
  19098. owner: {
  19099. required: true,
  19100. type: "string"
  19101. },
  19102. page: {
  19103. type: "integer"
  19104. },
  19105. per_page: {
  19106. type: "integer"
  19107. },
  19108. pull_number: {
  19109. required: true,
  19110. type: "integer"
  19111. },
  19112. repo: {
  19113. required: true,
  19114. type: "string"
  19115. }
  19116. },
  19117. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19118. },
  19119. listFiles: {
  19120. method: "GET",
  19121. params: {
  19122. number: {
  19123. alias: "pull_number",
  19124. deprecated: true,
  19125. type: "integer"
  19126. },
  19127. owner: {
  19128. required: true,
  19129. type: "string"
  19130. },
  19131. page: {
  19132. type: "integer"
  19133. },
  19134. per_page: {
  19135. type: "integer"
  19136. },
  19137. pull_number: {
  19138. required: true,
  19139. type: "integer"
  19140. },
  19141. repo: {
  19142. required: true,
  19143. type: "string"
  19144. }
  19145. },
  19146. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19147. },
  19148. listReviewRequests: {
  19149. method: "GET",
  19150. params: {
  19151. number: {
  19152. alias: "pull_number",
  19153. deprecated: true,
  19154. type: "integer"
  19155. },
  19156. owner: {
  19157. required: true,
  19158. type: "string"
  19159. },
  19160. page: {
  19161. type: "integer"
  19162. },
  19163. per_page: {
  19164. type: "integer"
  19165. },
  19166. pull_number: {
  19167. required: true,
  19168. type: "integer"
  19169. },
  19170. repo: {
  19171. required: true,
  19172. type: "string"
  19173. }
  19174. },
  19175. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19176. },
  19177. listReviews: {
  19178. method: "GET",
  19179. params: {
  19180. number: {
  19181. alias: "pull_number",
  19182. deprecated: true,
  19183. type: "integer"
  19184. },
  19185. owner: {
  19186. required: true,
  19187. type: "string"
  19188. },
  19189. page: {
  19190. type: "integer"
  19191. },
  19192. per_page: {
  19193. type: "integer"
  19194. },
  19195. pull_number: {
  19196. required: true,
  19197. type: "integer"
  19198. },
  19199. repo: {
  19200. required: true,
  19201. type: "string"
  19202. }
  19203. },
  19204. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19205. },
  19206. merge: {
  19207. method: "PUT",
  19208. params: {
  19209. commit_message: {
  19210. type: "string"
  19211. },
  19212. commit_title: {
  19213. type: "string"
  19214. },
  19215. merge_method: {
  19216. enum: ["merge", "squash", "rebase"],
  19217. type: "string"
  19218. },
  19219. number: {
  19220. alias: "pull_number",
  19221. deprecated: true,
  19222. type: "integer"
  19223. },
  19224. owner: {
  19225. required: true,
  19226. type: "string"
  19227. },
  19228. pull_number: {
  19229. required: true,
  19230. type: "integer"
  19231. },
  19232. repo: {
  19233. required: true,
  19234. type: "string"
  19235. },
  19236. sha: {
  19237. type: "string"
  19238. }
  19239. },
  19240. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19241. },
  19242. submitReview: {
  19243. method: "POST",
  19244. params: {
  19245. body: {
  19246. type: "string"
  19247. },
  19248. event: {
  19249. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19250. required: true,
  19251. type: "string"
  19252. },
  19253. number: {
  19254. alias: "pull_number",
  19255. deprecated: true,
  19256. type: "integer"
  19257. },
  19258. owner: {
  19259. required: true,
  19260. type: "string"
  19261. },
  19262. pull_number: {
  19263. required: true,
  19264. type: "integer"
  19265. },
  19266. repo: {
  19267. required: true,
  19268. type: "string"
  19269. },
  19270. review_id: {
  19271. required: true,
  19272. type: "integer"
  19273. }
  19274. },
  19275. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19276. },
  19277. update: {
  19278. method: "PATCH",
  19279. params: {
  19280. base: {
  19281. type: "string"
  19282. },
  19283. body: {
  19284. type: "string"
  19285. },
  19286. maintainer_can_modify: {
  19287. type: "boolean"
  19288. },
  19289. number: {
  19290. alias: "pull_number",
  19291. deprecated: true,
  19292. type: "integer"
  19293. },
  19294. owner: {
  19295. required: true,
  19296. type: "string"
  19297. },
  19298. pull_number: {
  19299. required: true,
  19300. type: "integer"
  19301. },
  19302. repo: {
  19303. required: true,
  19304. type: "string"
  19305. },
  19306. state: {
  19307. enum: ["open", "closed"],
  19308. type: "string"
  19309. },
  19310. title: {
  19311. type: "string"
  19312. }
  19313. },
  19314. url: "/repos/:owner/:repo/pulls/:pull_number"
  19315. },
  19316. updateBranch: {
  19317. headers: {
  19318. accept: "application/vnd.github.lydian-preview+json"
  19319. },
  19320. method: "PUT",
  19321. params: {
  19322. expected_head_sha: {
  19323. type: "string"
  19324. },
  19325. owner: {
  19326. required: true,
  19327. type: "string"
  19328. },
  19329. pull_number: {
  19330. required: true,
  19331. type: "integer"
  19332. },
  19333. repo: {
  19334. required: true,
  19335. type: "string"
  19336. }
  19337. },
  19338. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19339. },
  19340. updateComment: {
  19341. method: "PATCH",
  19342. params: {
  19343. body: {
  19344. required: true,
  19345. type: "string"
  19346. },
  19347. comment_id: {
  19348. required: true,
  19349. type: "integer"
  19350. },
  19351. owner: {
  19352. required: true,
  19353. type: "string"
  19354. },
  19355. repo: {
  19356. required: true,
  19357. type: "string"
  19358. }
  19359. },
  19360. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19361. },
  19362. updateReview: {
  19363. method: "PUT",
  19364. params: {
  19365. body: {
  19366. required: true,
  19367. type: "string"
  19368. },
  19369. number: {
  19370. alias: "pull_number",
  19371. deprecated: true,
  19372. type: "integer"
  19373. },
  19374. owner: {
  19375. required: true,
  19376. type: "string"
  19377. },
  19378. pull_number: {
  19379. required: true,
  19380. type: "integer"
  19381. },
  19382. repo: {
  19383. required: true,
  19384. type: "string"
  19385. },
  19386. review_id: {
  19387. required: true,
  19388. type: "integer"
  19389. }
  19390. },
  19391. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19392. }
  19393. },
  19394. rateLimit: {
  19395. get: {
  19396. method: "GET",
  19397. params: {},
  19398. url: "/rate_limit"
  19399. }
  19400. },
  19401. reactions: {
  19402. createForCommitComment: {
  19403. headers: {
  19404. accept: "application/vnd.github.squirrel-girl-preview+json"
  19405. },
  19406. method: "POST",
  19407. params: {
  19408. comment_id: {
  19409. required: true,
  19410. type: "integer"
  19411. },
  19412. content: {
  19413. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19414. required: true,
  19415. type: "string"
  19416. },
  19417. owner: {
  19418. required: true,
  19419. type: "string"
  19420. },
  19421. repo: {
  19422. required: true,
  19423. type: "string"
  19424. }
  19425. },
  19426. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19427. },
  19428. createForIssue: {
  19429. headers: {
  19430. accept: "application/vnd.github.squirrel-girl-preview+json"
  19431. },
  19432. method: "POST",
  19433. params: {
  19434. content: {
  19435. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19436. required: true,
  19437. type: "string"
  19438. },
  19439. issue_number: {
  19440. required: true,
  19441. type: "integer"
  19442. },
  19443. number: {
  19444. alias: "issue_number",
  19445. deprecated: true,
  19446. type: "integer"
  19447. },
  19448. owner: {
  19449. required: true,
  19450. type: "string"
  19451. },
  19452. repo: {
  19453. required: true,
  19454. type: "string"
  19455. }
  19456. },
  19457. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19458. },
  19459. createForIssueComment: {
  19460. headers: {
  19461. accept: "application/vnd.github.squirrel-girl-preview+json"
  19462. },
  19463. method: "POST",
  19464. params: {
  19465. comment_id: {
  19466. required: true,
  19467. type: "integer"
  19468. },
  19469. content: {
  19470. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19471. required: true,
  19472. type: "string"
  19473. },
  19474. owner: {
  19475. required: true,
  19476. type: "string"
  19477. },
  19478. repo: {
  19479. required: true,
  19480. type: "string"
  19481. }
  19482. },
  19483. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19484. },
  19485. createForPullRequestReviewComment: {
  19486. headers: {
  19487. accept: "application/vnd.github.squirrel-girl-preview+json"
  19488. },
  19489. method: "POST",
  19490. params: {
  19491. comment_id: {
  19492. required: true,
  19493. type: "integer"
  19494. },
  19495. content: {
  19496. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19497. required: true,
  19498. type: "string"
  19499. },
  19500. owner: {
  19501. required: true,
  19502. type: "string"
  19503. },
  19504. repo: {
  19505. required: true,
  19506. type: "string"
  19507. }
  19508. },
  19509. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19510. },
  19511. createForTeamDiscussion: {
  19512. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19513. headers: {
  19514. accept: "application/vnd.github.squirrel-girl-preview+json"
  19515. },
  19516. method: "POST",
  19517. params: {
  19518. content: {
  19519. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19520. required: true,
  19521. type: "string"
  19522. },
  19523. discussion_number: {
  19524. required: true,
  19525. type: "integer"
  19526. },
  19527. team_id: {
  19528. required: true,
  19529. type: "integer"
  19530. }
  19531. },
  19532. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19533. },
  19534. createForTeamDiscussionComment: {
  19535. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19536. headers: {
  19537. accept: "application/vnd.github.squirrel-girl-preview+json"
  19538. },
  19539. method: "POST",
  19540. params: {
  19541. comment_number: {
  19542. required: true,
  19543. type: "integer"
  19544. },
  19545. content: {
  19546. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19547. required: true,
  19548. type: "string"
  19549. },
  19550. discussion_number: {
  19551. required: true,
  19552. type: "integer"
  19553. },
  19554. team_id: {
  19555. required: true,
  19556. type: "integer"
  19557. }
  19558. },
  19559. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19560. },
  19561. createForTeamDiscussionCommentInOrg: {
  19562. headers: {
  19563. accept: "application/vnd.github.squirrel-girl-preview+json"
  19564. },
  19565. method: "POST",
  19566. params: {
  19567. comment_number: {
  19568. required: true,
  19569. type: "integer"
  19570. },
  19571. content: {
  19572. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19573. required: true,
  19574. type: "string"
  19575. },
  19576. discussion_number: {
  19577. required: true,
  19578. type: "integer"
  19579. },
  19580. org: {
  19581. required: true,
  19582. type: "string"
  19583. },
  19584. team_slug: {
  19585. required: true,
  19586. type: "string"
  19587. }
  19588. },
  19589. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19590. },
  19591. createForTeamDiscussionCommentLegacy: {
  19592. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19593. headers: {
  19594. accept: "application/vnd.github.squirrel-girl-preview+json"
  19595. },
  19596. method: "POST",
  19597. params: {
  19598. comment_number: {
  19599. required: true,
  19600. type: "integer"
  19601. },
  19602. content: {
  19603. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19604. required: true,
  19605. type: "string"
  19606. },
  19607. discussion_number: {
  19608. required: true,
  19609. type: "integer"
  19610. },
  19611. team_id: {
  19612. required: true,
  19613. type: "integer"
  19614. }
  19615. },
  19616. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19617. },
  19618. createForTeamDiscussionInOrg: {
  19619. headers: {
  19620. accept: "application/vnd.github.squirrel-girl-preview+json"
  19621. },
  19622. method: "POST",
  19623. params: {
  19624. content: {
  19625. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19626. required: true,
  19627. type: "string"
  19628. },
  19629. discussion_number: {
  19630. required: true,
  19631. type: "integer"
  19632. },
  19633. org: {
  19634. required: true,
  19635. type: "string"
  19636. },
  19637. team_slug: {
  19638. required: true,
  19639. type: "string"
  19640. }
  19641. },
  19642. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19643. },
  19644. createForTeamDiscussionLegacy: {
  19645. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19646. headers: {
  19647. accept: "application/vnd.github.squirrel-girl-preview+json"
  19648. },
  19649. method: "POST",
  19650. params: {
  19651. content: {
  19652. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19653. required: true,
  19654. type: "string"
  19655. },
  19656. discussion_number: {
  19657. required: true,
  19658. type: "integer"
  19659. },
  19660. team_id: {
  19661. required: true,
  19662. type: "integer"
  19663. }
  19664. },
  19665. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19666. },
  19667. delete: {
  19668. headers: {
  19669. accept: "application/vnd.github.squirrel-girl-preview+json"
  19670. },
  19671. method: "DELETE",
  19672. params: {
  19673. reaction_id: {
  19674. required: true,
  19675. type: "integer"
  19676. }
  19677. },
  19678. url: "/reactions/:reaction_id"
  19679. },
  19680. listForCommitComment: {
  19681. headers: {
  19682. accept: "application/vnd.github.squirrel-girl-preview+json"
  19683. },
  19684. method: "GET",
  19685. params: {
  19686. comment_id: {
  19687. required: true,
  19688. type: "integer"
  19689. },
  19690. content: {
  19691. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19692. type: "string"
  19693. },
  19694. owner: {
  19695. required: true,
  19696. type: "string"
  19697. },
  19698. page: {
  19699. type: "integer"
  19700. },
  19701. per_page: {
  19702. type: "integer"
  19703. },
  19704. repo: {
  19705. required: true,
  19706. type: "string"
  19707. }
  19708. },
  19709. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19710. },
  19711. listForIssue: {
  19712. headers: {
  19713. accept: "application/vnd.github.squirrel-girl-preview+json"
  19714. },
  19715. method: "GET",
  19716. params: {
  19717. content: {
  19718. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19719. type: "string"
  19720. },
  19721. issue_number: {
  19722. required: true,
  19723. type: "integer"
  19724. },
  19725. number: {
  19726. alias: "issue_number",
  19727. deprecated: true,
  19728. type: "integer"
  19729. },
  19730. owner: {
  19731. required: true,
  19732. type: "string"
  19733. },
  19734. page: {
  19735. type: "integer"
  19736. },
  19737. per_page: {
  19738. type: "integer"
  19739. },
  19740. repo: {
  19741. required: true,
  19742. type: "string"
  19743. }
  19744. },
  19745. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19746. },
  19747. listForIssueComment: {
  19748. headers: {
  19749. accept: "application/vnd.github.squirrel-girl-preview+json"
  19750. },
  19751. method: "GET",
  19752. params: {
  19753. comment_id: {
  19754. required: true,
  19755. type: "integer"
  19756. },
  19757. content: {
  19758. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19759. type: "string"
  19760. },
  19761. owner: {
  19762. required: true,
  19763. type: "string"
  19764. },
  19765. page: {
  19766. type: "integer"
  19767. },
  19768. per_page: {
  19769. type: "integer"
  19770. },
  19771. repo: {
  19772. required: true,
  19773. type: "string"
  19774. }
  19775. },
  19776. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19777. },
  19778. listForPullRequestReviewComment: {
  19779. headers: {
  19780. accept: "application/vnd.github.squirrel-girl-preview+json"
  19781. },
  19782. method: "GET",
  19783. params: {
  19784. comment_id: {
  19785. required: true,
  19786. type: "integer"
  19787. },
  19788. content: {
  19789. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19790. type: "string"
  19791. },
  19792. owner: {
  19793. required: true,
  19794. type: "string"
  19795. },
  19796. page: {
  19797. type: "integer"
  19798. },
  19799. per_page: {
  19800. type: "integer"
  19801. },
  19802. repo: {
  19803. required: true,
  19804. type: "string"
  19805. }
  19806. },
  19807. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19808. },
  19809. listForTeamDiscussion: {
  19810. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19811. headers: {
  19812. accept: "application/vnd.github.squirrel-girl-preview+json"
  19813. },
  19814. method: "GET",
  19815. params: {
  19816. content: {
  19817. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19818. type: "string"
  19819. },
  19820. discussion_number: {
  19821. required: true,
  19822. type: "integer"
  19823. },
  19824. page: {
  19825. type: "integer"
  19826. },
  19827. per_page: {
  19828. type: "integer"
  19829. },
  19830. team_id: {
  19831. required: true,
  19832. type: "integer"
  19833. }
  19834. },
  19835. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19836. },
  19837. listForTeamDiscussionComment: {
  19838. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19839. headers: {
  19840. accept: "application/vnd.github.squirrel-girl-preview+json"
  19841. },
  19842. method: "GET",
  19843. params: {
  19844. comment_number: {
  19845. required: true,
  19846. type: "integer"
  19847. },
  19848. content: {
  19849. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19850. type: "string"
  19851. },
  19852. discussion_number: {
  19853. required: true,
  19854. type: "integer"
  19855. },
  19856. page: {
  19857. type: "integer"
  19858. },
  19859. per_page: {
  19860. type: "integer"
  19861. },
  19862. team_id: {
  19863. required: true,
  19864. type: "integer"
  19865. }
  19866. },
  19867. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19868. },
  19869. listForTeamDiscussionCommentInOrg: {
  19870. headers: {
  19871. accept: "application/vnd.github.squirrel-girl-preview+json"
  19872. },
  19873. method: "GET",
  19874. params: {
  19875. comment_number: {
  19876. required: true,
  19877. type: "integer"
  19878. },
  19879. content: {
  19880. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19881. type: "string"
  19882. },
  19883. discussion_number: {
  19884. required: true,
  19885. type: "integer"
  19886. },
  19887. org: {
  19888. required: true,
  19889. type: "string"
  19890. },
  19891. page: {
  19892. type: "integer"
  19893. },
  19894. per_page: {
  19895. type: "integer"
  19896. },
  19897. team_slug: {
  19898. required: true,
  19899. type: "string"
  19900. }
  19901. },
  19902. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19903. },
  19904. listForTeamDiscussionCommentLegacy: {
  19905. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19906. headers: {
  19907. accept: "application/vnd.github.squirrel-girl-preview+json"
  19908. },
  19909. method: "GET",
  19910. params: {
  19911. comment_number: {
  19912. required: true,
  19913. type: "integer"
  19914. },
  19915. content: {
  19916. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19917. type: "string"
  19918. },
  19919. discussion_number: {
  19920. required: true,
  19921. type: "integer"
  19922. },
  19923. page: {
  19924. type: "integer"
  19925. },
  19926. per_page: {
  19927. type: "integer"
  19928. },
  19929. team_id: {
  19930. required: true,
  19931. type: "integer"
  19932. }
  19933. },
  19934. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19935. },
  19936. listForTeamDiscussionInOrg: {
  19937. headers: {
  19938. accept: "application/vnd.github.squirrel-girl-preview+json"
  19939. },
  19940. method: "GET",
  19941. params: {
  19942. content: {
  19943. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19944. type: "string"
  19945. },
  19946. discussion_number: {
  19947. required: true,
  19948. type: "integer"
  19949. },
  19950. org: {
  19951. required: true,
  19952. type: "string"
  19953. },
  19954. page: {
  19955. type: "integer"
  19956. },
  19957. per_page: {
  19958. type: "integer"
  19959. },
  19960. team_slug: {
  19961. required: true,
  19962. type: "string"
  19963. }
  19964. },
  19965. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19966. },
  19967. listForTeamDiscussionLegacy: {
  19968. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  19969. headers: {
  19970. accept: "application/vnd.github.squirrel-girl-preview+json"
  19971. },
  19972. method: "GET",
  19973. params: {
  19974. content: {
  19975. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19976. type: "string"
  19977. },
  19978. discussion_number: {
  19979. required: true,
  19980. type: "integer"
  19981. },
  19982. page: {
  19983. type: "integer"
  19984. },
  19985. per_page: {
  19986. type: "integer"
  19987. },
  19988. team_id: {
  19989. required: true,
  19990. type: "integer"
  19991. }
  19992. },
  19993. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19994. }
  19995. },
  19996. repos: {
  19997. acceptInvitation: {
  19998. method: "PATCH",
  19999. params: {
  20000. invitation_id: {
  20001. required: true,
  20002. type: "integer"
  20003. }
  20004. },
  20005. url: "/user/repository_invitations/:invitation_id"
  20006. },
  20007. addCollaborator: {
  20008. method: "PUT",
  20009. params: {
  20010. owner: {
  20011. required: true,
  20012. type: "string"
  20013. },
  20014. permission: {
  20015. enum: ["pull", "push", "admin"],
  20016. type: "string"
  20017. },
  20018. repo: {
  20019. required: true,
  20020. type: "string"
  20021. },
  20022. username: {
  20023. required: true,
  20024. type: "string"
  20025. }
  20026. },
  20027. url: "/repos/:owner/:repo/collaborators/:username"
  20028. },
  20029. addDeployKey: {
  20030. method: "POST",
  20031. params: {
  20032. key: {
  20033. required: true,
  20034. type: "string"
  20035. },
  20036. owner: {
  20037. required: true,
  20038. type: "string"
  20039. },
  20040. read_only: {
  20041. type: "boolean"
  20042. },
  20043. repo: {
  20044. required: true,
  20045. type: "string"
  20046. },
  20047. title: {
  20048. type: "string"
  20049. }
  20050. },
  20051. url: "/repos/:owner/:repo/keys"
  20052. },
  20053. addProtectedBranchAdminEnforcement: {
  20054. method: "POST",
  20055. params: {
  20056. branch: {
  20057. required: true,
  20058. type: "string"
  20059. },
  20060. owner: {
  20061. required: true,
  20062. type: "string"
  20063. },
  20064. repo: {
  20065. required: true,
  20066. type: "string"
  20067. }
  20068. },
  20069. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20070. },
  20071. addProtectedBranchAppRestrictions: {
  20072. method: "POST",
  20073. params: {
  20074. apps: {
  20075. mapTo: "data",
  20076. required: true,
  20077. type: "string[]"
  20078. },
  20079. branch: {
  20080. required: true,
  20081. type: "string"
  20082. },
  20083. owner: {
  20084. required: true,
  20085. type: "string"
  20086. },
  20087. repo: {
  20088. required: true,
  20089. type: "string"
  20090. }
  20091. },
  20092. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20093. },
  20094. addProtectedBranchRequiredSignatures: {
  20095. headers: {
  20096. accept: "application/vnd.github.zzzax-preview+json"
  20097. },
  20098. method: "POST",
  20099. params: {
  20100. branch: {
  20101. required: true,
  20102. type: "string"
  20103. },
  20104. owner: {
  20105. required: true,
  20106. type: "string"
  20107. },
  20108. repo: {
  20109. required: true,
  20110. type: "string"
  20111. }
  20112. },
  20113. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20114. },
  20115. addProtectedBranchRequiredStatusChecksContexts: {
  20116. method: "POST",
  20117. params: {
  20118. branch: {
  20119. required: true,
  20120. type: "string"
  20121. },
  20122. contexts: {
  20123. mapTo: "data",
  20124. required: true,
  20125. type: "string[]"
  20126. },
  20127. owner: {
  20128. required: true,
  20129. type: "string"
  20130. },
  20131. repo: {
  20132. required: true,
  20133. type: "string"
  20134. }
  20135. },
  20136. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20137. },
  20138. addProtectedBranchTeamRestrictions: {
  20139. method: "POST",
  20140. params: {
  20141. branch: {
  20142. required: true,
  20143. type: "string"
  20144. },
  20145. owner: {
  20146. required: true,
  20147. type: "string"
  20148. },
  20149. repo: {
  20150. required: true,
  20151. type: "string"
  20152. },
  20153. teams: {
  20154. mapTo: "data",
  20155. required: true,
  20156. type: "string[]"
  20157. }
  20158. },
  20159. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20160. },
  20161. addProtectedBranchUserRestrictions: {
  20162. method: "POST",
  20163. params: {
  20164. branch: {
  20165. required: true,
  20166. type: "string"
  20167. },
  20168. owner: {
  20169. required: true,
  20170. type: "string"
  20171. },
  20172. repo: {
  20173. required: true,
  20174. type: "string"
  20175. },
  20176. users: {
  20177. mapTo: "data",
  20178. required: true,
  20179. type: "string[]"
  20180. }
  20181. },
  20182. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20183. },
  20184. checkCollaborator: {
  20185. method: "GET",
  20186. params: {
  20187. owner: {
  20188. required: true,
  20189. type: "string"
  20190. },
  20191. repo: {
  20192. required: true,
  20193. type: "string"
  20194. },
  20195. username: {
  20196. required: true,
  20197. type: "string"
  20198. }
  20199. },
  20200. url: "/repos/:owner/:repo/collaborators/:username"
  20201. },
  20202. checkVulnerabilityAlerts: {
  20203. headers: {
  20204. accept: "application/vnd.github.dorian-preview+json"
  20205. },
  20206. method: "GET",
  20207. params: {
  20208. owner: {
  20209. required: true,
  20210. type: "string"
  20211. },
  20212. repo: {
  20213. required: true,
  20214. type: "string"
  20215. }
  20216. },
  20217. url: "/repos/:owner/:repo/vulnerability-alerts"
  20218. },
  20219. compareCommits: {
  20220. method: "GET",
  20221. params: {
  20222. base: {
  20223. required: true,
  20224. type: "string"
  20225. },
  20226. head: {
  20227. required: true,
  20228. type: "string"
  20229. },
  20230. owner: {
  20231. required: true,
  20232. type: "string"
  20233. },
  20234. repo: {
  20235. required: true,
  20236. type: "string"
  20237. }
  20238. },
  20239. url: "/repos/:owner/:repo/compare/:base...:head"
  20240. },
  20241. createCommitComment: {
  20242. method: "POST",
  20243. params: {
  20244. body: {
  20245. required: true,
  20246. type: "string"
  20247. },
  20248. commit_sha: {
  20249. required: true,
  20250. type: "string"
  20251. },
  20252. line: {
  20253. type: "integer"
  20254. },
  20255. owner: {
  20256. required: true,
  20257. type: "string"
  20258. },
  20259. path: {
  20260. type: "string"
  20261. },
  20262. position: {
  20263. type: "integer"
  20264. },
  20265. repo: {
  20266. required: true,
  20267. type: "string"
  20268. },
  20269. sha: {
  20270. alias: "commit_sha",
  20271. deprecated: true,
  20272. type: "string"
  20273. }
  20274. },
  20275. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20276. },
  20277. createDeployment: {
  20278. method: "POST",
  20279. params: {
  20280. auto_merge: {
  20281. type: "boolean"
  20282. },
  20283. description: {
  20284. type: "string"
  20285. },
  20286. environment: {
  20287. type: "string"
  20288. },
  20289. owner: {
  20290. required: true,
  20291. type: "string"
  20292. },
  20293. payload: {
  20294. type: "string"
  20295. },
  20296. production_environment: {
  20297. type: "boolean"
  20298. },
  20299. ref: {
  20300. required: true,
  20301. type: "string"
  20302. },
  20303. repo: {
  20304. required: true,
  20305. type: "string"
  20306. },
  20307. required_contexts: {
  20308. type: "string[]"
  20309. },
  20310. task: {
  20311. type: "string"
  20312. },
  20313. transient_environment: {
  20314. type: "boolean"
  20315. }
  20316. },
  20317. url: "/repos/:owner/:repo/deployments"
  20318. },
  20319. createDeploymentStatus: {
  20320. method: "POST",
  20321. params: {
  20322. auto_inactive: {
  20323. type: "boolean"
  20324. },
  20325. deployment_id: {
  20326. required: true,
  20327. type: "integer"
  20328. },
  20329. description: {
  20330. type: "string"
  20331. },
  20332. environment: {
  20333. enum: ["production", "staging", "qa"],
  20334. type: "string"
  20335. },
  20336. environment_url: {
  20337. type: "string"
  20338. },
  20339. log_url: {
  20340. type: "string"
  20341. },
  20342. owner: {
  20343. required: true,
  20344. type: "string"
  20345. },
  20346. repo: {
  20347. required: true,
  20348. type: "string"
  20349. },
  20350. state: {
  20351. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20352. required: true,
  20353. type: "string"
  20354. },
  20355. target_url: {
  20356. type: "string"
  20357. }
  20358. },
  20359. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20360. },
  20361. createDispatchEvent: {
  20362. method: "POST",
  20363. params: {
  20364. client_payload: {
  20365. type: "object"
  20366. },
  20367. event_type: {
  20368. type: "string"
  20369. },
  20370. owner: {
  20371. required: true,
  20372. type: "string"
  20373. },
  20374. repo: {
  20375. required: true,
  20376. type: "string"
  20377. }
  20378. },
  20379. url: "/repos/:owner/:repo/dispatches"
  20380. },
  20381. createFile: {
  20382. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20383. method: "PUT",
  20384. params: {
  20385. author: {
  20386. type: "object"
  20387. },
  20388. "author.email": {
  20389. required: true,
  20390. type: "string"
  20391. },
  20392. "author.name": {
  20393. required: true,
  20394. type: "string"
  20395. },
  20396. branch: {
  20397. type: "string"
  20398. },
  20399. committer: {
  20400. type: "object"
  20401. },
  20402. "committer.email": {
  20403. required: true,
  20404. type: "string"
  20405. },
  20406. "committer.name": {
  20407. required: true,
  20408. type: "string"
  20409. },
  20410. content: {
  20411. required: true,
  20412. type: "string"
  20413. },
  20414. message: {
  20415. required: true,
  20416. type: "string"
  20417. },
  20418. owner: {
  20419. required: true,
  20420. type: "string"
  20421. },
  20422. path: {
  20423. required: true,
  20424. type: "string"
  20425. },
  20426. repo: {
  20427. required: true,
  20428. type: "string"
  20429. },
  20430. sha: {
  20431. type: "string"
  20432. }
  20433. },
  20434. url: "/repos/:owner/:repo/contents/:path"
  20435. },
  20436. createForAuthenticatedUser: {
  20437. method: "POST",
  20438. params: {
  20439. allow_merge_commit: {
  20440. type: "boolean"
  20441. },
  20442. allow_rebase_merge: {
  20443. type: "boolean"
  20444. },
  20445. allow_squash_merge: {
  20446. type: "boolean"
  20447. },
  20448. auto_init: {
  20449. type: "boolean"
  20450. },
  20451. delete_branch_on_merge: {
  20452. type: "boolean"
  20453. },
  20454. description: {
  20455. type: "string"
  20456. },
  20457. gitignore_template: {
  20458. type: "string"
  20459. },
  20460. has_issues: {
  20461. type: "boolean"
  20462. },
  20463. has_projects: {
  20464. type: "boolean"
  20465. },
  20466. has_wiki: {
  20467. type: "boolean"
  20468. },
  20469. homepage: {
  20470. type: "string"
  20471. },
  20472. is_template: {
  20473. type: "boolean"
  20474. },
  20475. license_template: {
  20476. type: "string"
  20477. },
  20478. name: {
  20479. required: true,
  20480. type: "string"
  20481. },
  20482. private: {
  20483. type: "boolean"
  20484. },
  20485. team_id: {
  20486. type: "integer"
  20487. },
  20488. visibility: {
  20489. enum: ["public", "private", "visibility", "internal"],
  20490. type: "string"
  20491. }
  20492. },
  20493. url: "/user/repos"
  20494. },
  20495. createFork: {
  20496. method: "POST",
  20497. params: {
  20498. organization: {
  20499. type: "string"
  20500. },
  20501. owner: {
  20502. required: true,
  20503. type: "string"
  20504. },
  20505. repo: {
  20506. required: true,
  20507. type: "string"
  20508. }
  20509. },
  20510. url: "/repos/:owner/:repo/forks"
  20511. },
  20512. createHook: {
  20513. method: "POST",
  20514. params: {
  20515. active: {
  20516. type: "boolean"
  20517. },
  20518. config: {
  20519. required: true,
  20520. type: "object"
  20521. },
  20522. "config.content_type": {
  20523. type: "string"
  20524. },
  20525. "config.insecure_ssl": {
  20526. type: "string"
  20527. },
  20528. "config.secret": {
  20529. type: "string"
  20530. },
  20531. "config.url": {
  20532. required: true,
  20533. type: "string"
  20534. },
  20535. events: {
  20536. type: "string[]"
  20537. },
  20538. name: {
  20539. type: "string"
  20540. },
  20541. owner: {
  20542. required: true,
  20543. type: "string"
  20544. },
  20545. repo: {
  20546. required: true,
  20547. type: "string"
  20548. }
  20549. },
  20550. url: "/repos/:owner/:repo/hooks"
  20551. },
  20552. createInOrg: {
  20553. method: "POST",
  20554. params: {
  20555. allow_merge_commit: {
  20556. type: "boolean"
  20557. },
  20558. allow_rebase_merge: {
  20559. type: "boolean"
  20560. },
  20561. allow_squash_merge: {
  20562. type: "boolean"
  20563. },
  20564. auto_init: {
  20565. type: "boolean"
  20566. },
  20567. delete_branch_on_merge: {
  20568. type: "boolean"
  20569. },
  20570. description: {
  20571. type: "string"
  20572. },
  20573. gitignore_template: {
  20574. type: "string"
  20575. },
  20576. has_issues: {
  20577. type: "boolean"
  20578. },
  20579. has_projects: {
  20580. type: "boolean"
  20581. },
  20582. has_wiki: {
  20583. type: "boolean"
  20584. },
  20585. homepage: {
  20586. type: "string"
  20587. },
  20588. is_template: {
  20589. type: "boolean"
  20590. },
  20591. license_template: {
  20592. type: "string"
  20593. },
  20594. name: {
  20595. required: true,
  20596. type: "string"
  20597. },
  20598. org: {
  20599. required: true,
  20600. type: "string"
  20601. },
  20602. private: {
  20603. type: "boolean"
  20604. },
  20605. team_id: {
  20606. type: "integer"
  20607. },
  20608. visibility: {
  20609. enum: ["public", "private", "visibility", "internal"],
  20610. type: "string"
  20611. }
  20612. },
  20613. url: "/orgs/:org/repos"
  20614. },
  20615. createOrUpdateFile: {
  20616. method: "PUT",
  20617. params: {
  20618. author: {
  20619. type: "object"
  20620. },
  20621. "author.email": {
  20622. required: true,
  20623. type: "string"
  20624. },
  20625. "author.name": {
  20626. required: true,
  20627. type: "string"
  20628. },
  20629. branch: {
  20630. type: "string"
  20631. },
  20632. committer: {
  20633. type: "object"
  20634. },
  20635. "committer.email": {
  20636. required: true,
  20637. type: "string"
  20638. },
  20639. "committer.name": {
  20640. required: true,
  20641. type: "string"
  20642. },
  20643. content: {
  20644. required: true,
  20645. type: "string"
  20646. },
  20647. message: {
  20648. required: true,
  20649. type: "string"
  20650. },
  20651. owner: {
  20652. required: true,
  20653. type: "string"
  20654. },
  20655. path: {
  20656. required: true,
  20657. type: "string"
  20658. },
  20659. repo: {
  20660. required: true,
  20661. type: "string"
  20662. },
  20663. sha: {
  20664. type: "string"
  20665. }
  20666. },
  20667. url: "/repos/:owner/:repo/contents/:path"
  20668. },
  20669. createRelease: {
  20670. method: "POST",
  20671. params: {
  20672. body: {
  20673. type: "string"
  20674. },
  20675. draft: {
  20676. type: "boolean"
  20677. },
  20678. name: {
  20679. type: "string"
  20680. },
  20681. owner: {
  20682. required: true,
  20683. type: "string"
  20684. },
  20685. prerelease: {
  20686. type: "boolean"
  20687. },
  20688. repo: {
  20689. required: true,
  20690. type: "string"
  20691. },
  20692. tag_name: {
  20693. required: true,
  20694. type: "string"
  20695. },
  20696. target_commitish: {
  20697. type: "string"
  20698. }
  20699. },
  20700. url: "/repos/:owner/:repo/releases"
  20701. },
  20702. createStatus: {
  20703. method: "POST",
  20704. params: {
  20705. context: {
  20706. type: "string"
  20707. },
  20708. description: {
  20709. type: "string"
  20710. },
  20711. owner: {
  20712. required: true,
  20713. type: "string"
  20714. },
  20715. repo: {
  20716. required: true,
  20717. type: "string"
  20718. },
  20719. sha: {
  20720. required: true,
  20721. type: "string"
  20722. },
  20723. state: {
  20724. enum: ["error", "failure", "pending", "success"],
  20725. required: true,
  20726. type: "string"
  20727. },
  20728. target_url: {
  20729. type: "string"
  20730. }
  20731. },
  20732. url: "/repos/:owner/:repo/statuses/:sha"
  20733. },
  20734. createUsingTemplate: {
  20735. headers: {
  20736. accept: "application/vnd.github.baptiste-preview+json"
  20737. },
  20738. method: "POST",
  20739. params: {
  20740. description: {
  20741. type: "string"
  20742. },
  20743. name: {
  20744. required: true,
  20745. type: "string"
  20746. },
  20747. owner: {
  20748. type: "string"
  20749. },
  20750. private: {
  20751. type: "boolean"
  20752. },
  20753. template_owner: {
  20754. required: true,
  20755. type: "string"
  20756. },
  20757. template_repo: {
  20758. required: true,
  20759. type: "string"
  20760. }
  20761. },
  20762. url: "/repos/:template_owner/:template_repo/generate"
  20763. },
  20764. declineInvitation: {
  20765. method: "DELETE",
  20766. params: {
  20767. invitation_id: {
  20768. required: true,
  20769. type: "integer"
  20770. }
  20771. },
  20772. url: "/user/repository_invitations/:invitation_id"
  20773. },
  20774. delete: {
  20775. method: "DELETE",
  20776. params: {
  20777. owner: {
  20778. required: true,
  20779. type: "string"
  20780. },
  20781. repo: {
  20782. required: true,
  20783. type: "string"
  20784. }
  20785. },
  20786. url: "/repos/:owner/:repo"
  20787. },
  20788. deleteCommitComment: {
  20789. method: "DELETE",
  20790. params: {
  20791. comment_id: {
  20792. required: true,
  20793. type: "integer"
  20794. },
  20795. owner: {
  20796. required: true,
  20797. type: "string"
  20798. },
  20799. repo: {
  20800. required: true,
  20801. type: "string"
  20802. }
  20803. },
  20804. url: "/repos/:owner/:repo/comments/:comment_id"
  20805. },
  20806. deleteDownload: {
  20807. method: "DELETE",
  20808. params: {
  20809. download_id: {
  20810. required: true,
  20811. type: "integer"
  20812. },
  20813. owner: {
  20814. required: true,
  20815. type: "string"
  20816. },
  20817. repo: {
  20818. required: true,
  20819. type: "string"
  20820. }
  20821. },
  20822. url: "/repos/:owner/:repo/downloads/:download_id"
  20823. },
  20824. deleteFile: {
  20825. method: "DELETE",
  20826. params: {
  20827. author: {
  20828. type: "object"
  20829. },
  20830. "author.email": {
  20831. type: "string"
  20832. },
  20833. "author.name": {
  20834. type: "string"
  20835. },
  20836. branch: {
  20837. type: "string"
  20838. },
  20839. committer: {
  20840. type: "object"
  20841. },
  20842. "committer.email": {
  20843. type: "string"
  20844. },
  20845. "committer.name": {
  20846. type: "string"
  20847. },
  20848. message: {
  20849. required: true,
  20850. type: "string"
  20851. },
  20852. owner: {
  20853. required: true,
  20854. type: "string"
  20855. },
  20856. path: {
  20857. required: true,
  20858. type: "string"
  20859. },
  20860. repo: {
  20861. required: true,
  20862. type: "string"
  20863. },
  20864. sha: {
  20865. required: true,
  20866. type: "string"
  20867. }
  20868. },
  20869. url: "/repos/:owner/:repo/contents/:path"
  20870. },
  20871. deleteHook: {
  20872. method: "DELETE",
  20873. params: {
  20874. hook_id: {
  20875. required: true,
  20876. type: "integer"
  20877. },
  20878. owner: {
  20879. required: true,
  20880. type: "string"
  20881. },
  20882. repo: {
  20883. required: true,
  20884. type: "string"
  20885. }
  20886. },
  20887. url: "/repos/:owner/:repo/hooks/:hook_id"
  20888. },
  20889. deleteInvitation: {
  20890. method: "DELETE",
  20891. params: {
  20892. invitation_id: {
  20893. required: true,
  20894. type: "integer"
  20895. },
  20896. owner: {
  20897. required: true,
  20898. type: "string"
  20899. },
  20900. repo: {
  20901. required: true,
  20902. type: "string"
  20903. }
  20904. },
  20905. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20906. },
  20907. deleteRelease: {
  20908. method: "DELETE",
  20909. params: {
  20910. owner: {
  20911. required: true,
  20912. type: "string"
  20913. },
  20914. release_id: {
  20915. required: true,
  20916. type: "integer"
  20917. },
  20918. repo: {
  20919. required: true,
  20920. type: "string"
  20921. }
  20922. },
  20923. url: "/repos/:owner/:repo/releases/:release_id"
  20924. },
  20925. deleteReleaseAsset: {
  20926. method: "DELETE",
  20927. params: {
  20928. asset_id: {
  20929. required: true,
  20930. type: "integer"
  20931. },
  20932. owner: {
  20933. required: true,
  20934. type: "string"
  20935. },
  20936. repo: {
  20937. required: true,
  20938. type: "string"
  20939. }
  20940. },
  20941. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20942. },
  20943. disableAutomatedSecurityFixes: {
  20944. headers: {
  20945. accept: "application/vnd.github.london-preview+json"
  20946. },
  20947. method: "DELETE",
  20948. params: {
  20949. owner: {
  20950. required: true,
  20951. type: "string"
  20952. },
  20953. repo: {
  20954. required: true,
  20955. type: "string"
  20956. }
  20957. },
  20958. url: "/repos/:owner/:repo/automated-security-fixes"
  20959. },
  20960. disablePagesSite: {
  20961. headers: {
  20962. accept: "application/vnd.github.switcheroo-preview+json"
  20963. },
  20964. method: "DELETE",
  20965. params: {
  20966. owner: {
  20967. required: true,
  20968. type: "string"
  20969. },
  20970. repo: {
  20971. required: true,
  20972. type: "string"
  20973. }
  20974. },
  20975. url: "/repos/:owner/:repo/pages"
  20976. },
  20977. disableVulnerabilityAlerts: {
  20978. headers: {
  20979. accept: "application/vnd.github.dorian-preview+json"
  20980. },
  20981. method: "DELETE",
  20982. params: {
  20983. owner: {
  20984. required: true,
  20985. type: "string"
  20986. },
  20987. repo: {
  20988. required: true,
  20989. type: "string"
  20990. }
  20991. },
  20992. url: "/repos/:owner/:repo/vulnerability-alerts"
  20993. },
  20994. enableAutomatedSecurityFixes: {
  20995. headers: {
  20996. accept: "application/vnd.github.london-preview+json"
  20997. },
  20998. method: "PUT",
  20999. params: {
  21000. owner: {
  21001. required: true,
  21002. type: "string"
  21003. },
  21004. repo: {
  21005. required: true,
  21006. type: "string"
  21007. }
  21008. },
  21009. url: "/repos/:owner/:repo/automated-security-fixes"
  21010. },
  21011. enablePagesSite: {
  21012. headers: {
  21013. accept: "application/vnd.github.switcheroo-preview+json"
  21014. },
  21015. method: "POST",
  21016. params: {
  21017. owner: {
  21018. required: true,
  21019. type: "string"
  21020. },
  21021. repo: {
  21022. required: true,
  21023. type: "string"
  21024. },
  21025. source: {
  21026. type: "object"
  21027. },
  21028. "source.branch": {
  21029. enum: ["master", "gh-pages"],
  21030. type: "string"
  21031. },
  21032. "source.path": {
  21033. type: "string"
  21034. }
  21035. },
  21036. url: "/repos/:owner/:repo/pages"
  21037. },
  21038. enableVulnerabilityAlerts: {
  21039. headers: {
  21040. accept: "application/vnd.github.dorian-preview+json"
  21041. },
  21042. method: "PUT",
  21043. params: {
  21044. owner: {
  21045. required: true,
  21046. type: "string"
  21047. },
  21048. repo: {
  21049. required: true,
  21050. type: "string"
  21051. }
  21052. },
  21053. url: "/repos/:owner/:repo/vulnerability-alerts"
  21054. },
  21055. get: {
  21056. method: "GET",
  21057. params: {
  21058. owner: {
  21059. required: true,
  21060. type: "string"
  21061. },
  21062. repo: {
  21063. required: true,
  21064. type: "string"
  21065. }
  21066. },
  21067. url: "/repos/:owner/:repo"
  21068. },
  21069. getAppsWithAccessToProtectedBranch: {
  21070. method: "GET",
  21071. params: {
  21072. branch: {
  21073. required: true,
  21074. type: "string"
  21075. },
  21076. owner: {
  21077. required: true,
  21078. type: "string"
  21079. },
  21080. repo: {
  21081. required: true,
  21082. type: "string"
  21083. }
  21084. },
  21085. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21086. },
  21087. getArchiveLink: {
  21088. method: "GET",
  21089. params: {
  21090. archive_format: {
  21091. required: true,
  21092. type: "string"
  21093. },
  21094. owner: {
  21095. required: true,
  21096. type: "string"
  21097. },
  21098. ref: {
  21099. required: true,
  21100. type: "string"
  21101. },
  21102. repo: {
  21103. required: true,
  21104. type: "string"
  21105. }
  21106. },
  21107. url: "/repos/:owner/:repo/:archive_format/:ref"
  21108. },
  21109. getBranch: {
  21110. method: "GET",
  21111. params: {
  21112. branch: {
  21113. required: true,
  21114. type: "string"
  21115. },
  21116. owner: {
  21117. required: true,
  21118. type: "string"
  21119. },
  21120. repo: {
  21121. required: true,
  21122. type: "string"
  21123. }
  21124. },
  21125. url: "/repos/:owner/:repo/branches/:branch"
  21126. },
  21127. getBranchProtection: {
  21128. method: "GET",
  21129. params: {
  21130. branch: {
  21131. required: true,
  21132. type: "string"
  21133. },
  21134. owner: {
  21135. required: true,
  21136. type: "string"
  21137. },
  21138. repo: {
  21139. required: true,
  21140. type: "string"
  21141. }
  21142. },
  21143. url: "/repos/:owner/:repo/branches/:branch/protection"
  21144. },
  21145. getClones: {
  21146. method: "GET",
  21147. params: {
  21148. owner: {
  21149. required: true,
  21150. type: "string"
  21151. },
  21152. per: {
  21153. enum: ["day", "week"],
  21154. type: "string"
  21155. },
  21156. repo: {
  21157. required: true,
  21158. type: "string"
  21159. }
  21160. },
  21161. url: "/repos/:owner/:repo/traffic/clones"
  21162. },
  21163. getCodeFrequencyStats: {
  21164. method: "GET",
  21165. params: {
  21166. owner: {
  21167. required: true,
  21168. type: "string"
  21169. },
  21170. repo: {
  21171. required: true,
  21172. type: "string"
  21173. }
  21174. },
  21175. url: "/repos/:owner/:repo/stats/code_frequency"
  21176. },
  21177. getCollaboratorPermissionLevel: {
  21178. method: "GET",
  21179. params: {
  21180. owner: {
  21181. required: true,
  21182. type: "string"
  21183. },
  21184. repo: {
  21185. required: true,
  21186. type: "string"
  21187. },
  21188. username: {
  21189. required: true,
  21190. type: "string"
  21191. }
  21192. },
  21193. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21194. },
  21195. getCombinedStatusForRef: {
  21196. method: "GET",
  21197. params: {
  21198. owner: {
  21199. required: true,
  21200. type: "string"
  21201. },
  21202. ref: {
  21203. required: true,
  21204. type: "string"
  21205. },
  21206. repo: {
  21207. required: true,
  21208. type: "string"
  21209. }
  21210. },
  21211. url: "/repos/:owner/:repo/commits/:ref/status"
  21212. },
  21213. getCommit: {
  21214. method: "GET",
  21215. params: {
  21216. commit_sha: {
  21217. alias: "ref",
  21218. deprecated: true,
  21219. type: "string"
  21220. },
  21221. owner: {
  21222. required: true,
  21223. type: "string"
  21224. },
  21225. ref: {
  21226. required: true,
  21227. type: "string"
  21228. },
  21229. repo: {
  21230. required: true,
  21231. type: "string"
  21232. },
  21233. sha: {
  21234. alias: "ref",
  21235. deprecated: true,
  21236. type: "string"
  21237. }
  21238. },
  21239. url: "/repos/:owner/:repo/commits/:ref"
  21240. },
  21241. getCommitActivityStats: {
  21242. method: "GET",
  21243. params: {
  21244. owner: {
  21245. required: true,
  21246. type: "string"
  21247. },
  21248. repo: {
  21249. required: true,
  21250. type: "string"
  21251. }
  21252. },
  21253. url: "/repos/:owner/:repo/stats/commit_activity"
  21254. },
  21255. getCommitComment: {
  21256. method: "GET",
  21257. params: {
  21258. comment_id: {
  21259. required: true,
  21260. type: "integer"
  21261. },
  21262. owner: {
  21263. required: true,
  21264. type: "string"
  21265. },
  21266. repo: {
  21267. required: true,
  21268. type: "string"
  21269. }
  21270. },
  21271. url: "/repos/:owner/:repo/comments/:comment_id"
  21272. },
  21273. getCommitRefSha: {
  21274. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21275. headers: {
  21276. accept: "application/vnd.github.v3.sha"
  21277. },
  21278. method: "GET",
  21279. params: {
  21280. owner: {
  21281. required: true,
  21282. type: "string"
  21283. },
  21284. ref: {
  21285. required: true,
  21286. type: "string"
  21287. },
  21288. repo: {
  21289. required: true,
  21290. type: "string"
  21291. }
  21292. },
  21293. url: "/repos/:owner/:repo/commits/:ref"
  21294. },
  21295. getContents: {
  21296. method: "GET",
  21297. params: {
  21298. owner: {
  21299. required: true,
  21300. type: "string"
  21301. },
  21302. path: {
  21303. required: true,
  21304. type: "string"
  21305. },
  21306. ref: {
  21307. type: "string"
  21308. },
  21309. repo: {
  21310. required: true,
  21311. type: "string"
  21312. }
  21313. },
  21314. url: "/repos/:owner/:repo/contents/:path"
  21315. },
  21316. getContributorsStats: {
  21317. method: "GET",
  21318. params: {
  21319. owner: {
  21320. required: true,
  21321. type: "string"
  21322. },
  21323. repo: {
  21324. required: true,
  21325. type: "string"
  21326. }
  21327. },
  21328. url: "/repos/:owner/:repo/stats/contributors"
  21329. },
  21330. getDeployKey: {
  21331. method: "GET",
  21332. params: {
  21333. key_id: {
  21334. required: true,
  21335. type: "integer"
  21336. },
  21337. owner: {
  21338. required: true,
  21339. type: "string"
  21340. },
  21341. repo: {
  21342. required: true,
  21343. type: "string"
  21344. }
  21345. },
  21346. url: "/repos/:owner/:repo/keys/:key_id"
  21347. },
  21348. getDeployment: {
  21349. method: "GET",
  21350. params: {
  21351. deployment_id: {
  21352. required: true,
  21353. type: "integer"
  21354. },
  21355. owner: {
  21356. required: true,
  21357. type: "string"
  21358. },
  21359. repo: {
  21360. required: true,
  21361. type: "string"
  21362. }
  21363. },
  21364. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21365. },
  21366. getDeploymentStatus: {
  21367. method: "GET",
  21368. params: {
  21369. deployment_id: {
  21370. required: true,
  21371. type: "integer"
  21372. },
  21373. owner: {
  21374. required: true,
  21375. type: "string"
  21376. },
  21377. repo: {
  21378. required: true,
  21379. type: "string"
  21380. },
  21381. status_id: {
  21382. required: true,
  21383. type: "integer"
  21384. }
  21385. },
  21386. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21387. },
  21388. getDownload: {
  21389. method: "GET",
  21390. params: {
  21391. download_id: {
  21392. required: true,
  21393. type: "integer"
  21394. },
  21395. owner: {
  21396. required: true,
  21397. type: "string"
  21398. },
  21399. repo: {
  21400. required: true,
  21401. type: "string"
  21402. }
  21403. },
  21404. url: "/repos/:owner/:repo/downloads/:download_id"
  21405. },
  21406. getHook: {
  21407. method: "GET",
  21408. params: {
  21409. hook_id: {
  21410. required: true,
  21411. type: "integer"
  21412. },
  21413. owner: {
  21414. required: true,
  21415. type: "string"
  21416. },
  21417. repo: {
  21418. required: true,
  21419. type: "string"
  21420. }
  21421. },
  21422. url: "/repos/:owner/:repo/hooks/:hook_id"
  21423. },
  21424. getLatestPagesBuild: {
  21425. method: "GET",
  21426. params: {
  21427. owner: {
  21428. required: true,
  21429. type: "string"
  21430. },
  21431. repo: {
  21432. required: true,
  21433. type: "string"
  21434. }
  21435. },
  21436. url: "/repos/:owner/:repo/pages/builds/latest"
  21437. },
  21438. getLatestRelease: {
  21439. method: "GET",
  21440. params: {
  21441. owner: {
  21442. required: true,
  21443. type: "string"
  21444. },
  21445. repo: {
  21446. required: true,
  21447. type: "string"
  21448. }
  21449. },
  21450. url: "/repos/:owner/:repo/releases/latest"
  21451. },
  21452. getPages: {
  21453. method: "GET",
  21454. params: {
  21455. owner: {
  21456. required: true,
  21457. type: "string"
  21458. },
  21459. repo: {
  21460. required: true,
  21461. type: "string"
  21462. }
  21463. },
  21464. url: "/repos/:owner/:repo/pages"
  21465. },
  21466. getPagesBuild: {
  21467. method: "GET",
  21468. params: {
  21469. build_id: {
  21470. required: true,
  21471. type: "integer"
  21472. },
  21473. owner: {
  21474. required: true,
  21475. type: "string"
  21476. },
  21477. repo: {
  21478. required: true,
  21479. type: "string"
  21480. }
  21481. },
  21482. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21483. },
  21484. getParticipationStats: {
  21485. method: "GET",
  21486. params: {
  21487. owner: {
  21488. required: true,
  21489. type: "string"
  21490. },
  21491. repo: {
  21492. required: true,
  21493. type: "string"
  21494. }
  21495. },
  21496. url: "/repos/:owner/:repo/stats/participation"
  21497. },
  21498. getProtectedBranchAdminEnforcement: {
  21499. method: "GET",
  21500. params: {
  21501. branch: {
  21502. required: true,
  21503. type: "string"
  21504. },
  21505. owner: {
  21506. required: true,
  21507. type: "string"
  21508. },
  21509. repo: {
  21510. required: true,
  21511. type: "string"
  21512. }
  21513. },
  21514. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21515. },
  21516. getProtectedBranchPullRequestReviewEnforcement: {
  21517. method: "GET",
  21518. params: {
  21519. branch: {
  21520. required: true,
  21521. type: "string"
  21522. },
  21523. owner: {
  21524. required: true,
  21525. type: "string"
  21526. },
  21527. repo: {
  21528. required: true,
  21529. type: "string"
  21530. }
  21531. },
  21532. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21533. },
  21534. getProtectedBranchRequiredSignatures: {
  21535. headers: {
  21536. accept: "application/vnd.github.zzzax-preview+json"
  21537. },
  21538. method: "GET",
  21539. params: {
  21540. branch: {
  21541. required: true,
  21542. type: "string"
  21543. },
  21544. owner: {
  21545. required: true,
  21546. type: "string"
  21547. },
  21548. repo: {
  21549. required: true,
  21550. type: "string"
  21551. }
  21552. },
  21553. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21554. },
  21555. getProtectedBranchRequiredStatusChecks: {
  21556. method: "GET",
  21557. params: {
  21558. branch: {
  21559. required: true,
  21560. type: "string"
  21561. },
  21562. owner: {
  21563. required: true,
  21564. type: "string"
  21565. },
  21566. repo: {
  21567. required: true,
  21568. type: "string"
  21569. }
  21570. },
  21571. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21572. },
  21573. getProtectedBranchRestrictions: {
  21574. method: "GET",
  21575. params: {
  21576. branch: {
  21577. required: true,
  21578. type: "string"
  21579. },
  21580. owner: {
  21581. required: true,
  21582. type: "string"
  21583. },
  21584. repo: {
  21585. required: true,
  21586. type: "string"
  21587. }
  21588. },
  21589. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21590. },
  21591. getPunchCardStats: {
  21592. method: "GET",
  21593. params: {
  21594. owner: {
  21595. required: true,
  21596. type: "string"
  21597. },
  21598. repo: {
  21599. required: true,
  21600. type: "string"
  21601. }
  21602. },
  21603. url: "/repos/:owner/:repo/stats/punch_card"
  21604. },
  21605. getReadme: {
  21606. method: "GET",
  21607. params: {
  21608. owner: {
  21609. required: true,
  21610. type: "string"
  21611. },
  21612. ref: {
  21613. type: "string"
  21614. },
  21615. repo: {
  21616. required: true,
  21617. type: "string"
  21618. }
  21619. },
  21620. url: "/repos/:owner/:repo/readme"
  21621. },
  21622. getRelease: {
  21623. method: "GET",
  21624. params: {
  21625. owner: {
  21626. required: true,
  21627. type: "string"
  21628. },
  21629. release_id: {
  21630. required: true,
  21631. type: "integer"
  21632. },
  21633. repo: {
  21634. required: true,
  21635. type: "string"
  21636. }
  21637. },
  21638. url: "/repos/:owner/:repo/releases/:release_id"
  21639. },
  21640. getReleaseAsset: {
  21641. method: "GET",
  21642. params: {
  21643. asset_id: {
  21644. required: true,
  21645. type: "integer"
  21646. },
  21647. owner: {
  21648. required: true,
  21649. type: "string"
  21650. },
  21651. repo: {
  21652. required: true,
  21653. type: "string"
  21654. }
  21655. },
  21656. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21657. },
  21658. getReleaseByTag: {
  21659. method: "GET",
  21660. params: {
  21661. owner: {
  21662. required: true,
  21663. type: "string"
  21664. },
  21665. repo: {
  21666. required: true,
  21667. type: "string"
  21668. },
  21669. tag: {
  21670. required: true,
  21671. type: "string"
  21672. }
  21673. },
  21674. url: "/repos/:owner/:repo/releases/tags/:tag"
  21675. },
  21676. getTeamsWithAccessToProtectedBranch: {
  21677. method: "GET",
  21678. params: {
  21679. branch: {
  21680. required: true,
  21681. type: "string"
  21682. },
  21683. owner: {
  21684. required: true,
  21685. type: "string"
  21686. },
  21687. repo: {
  21688. required: true,
  21689. type: "string"
  21690. }
  21691. },
  21692. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21693. },
  21694. getTopPaths: {
  21695. method: "GET",
  21696. params: {
  21697. owner: {
  21698. required: true,
  21699. type: "string"
  21700. },
  21701. repo: {
  21702. required: true,
  21703. type: "string"
  21704. }
  21705. },
  21706. url: "/repos/:owner/:repo/traffic/popular/paths"
  21707. },
  21708. getTopReferrers: {
  21709. method: "GET",
  21710. params: {
  21711. owner: {
  21712. required: true,
  21713. type: "string"
  21714. },
  21715. repo: {
  21716. required: true,
  21717. type: "string"
  21718. }
  21719. },
  21720. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21721. },
  21722. getUsersWithAccessToProtectedBranch: {
  21723. method: "GET",
  21724. params: {
  21725. branch: {
  21726. required: true,
  21727. type: "string"
  21728. },
  21729. owner: {
  21730. required: true,
  21731. type: "string"
  21732. },
  21733. repo: {
  21734. required: true,
  21735. type: "string"
  21736. }
  21737. },
  21738. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21739. },
  21740. getViews: {
  21741. method: "GET",
  21742. params: {
  21743. owner: {
  21744. required: true,
  21745. type: "string"
  21746. },
  21747. per: {
  21748. enum: ["day", "week"],
  21749. type: "string"
  21750. },
  21751. repo: {
  21752. required: true,
  21753. type: "string"
  21754. }
  21755. },
  21756. url: "/repos/:owner/:repo/traffic/views"
  21757. },
  21758. list: {
  21759. method: "GET",
  21760. params: {
  21761. affiliation: {
  21762. type: "string"
  21763. },
  21764. direction: {
  21765. enum: ["asc", "desc"],
  21766. type: "string"
  21767. },
  21768. page: {
  21769. type: "integer"
  21770. },
  21771. per_page: {
  21772. type: "integer"
  21773. },
  21774. sort: {
  21775. enum: ["created", "updated", "pushed", "full_name"],
  21776. type: "string"
  21777. },
  21778. type: {
  21779. enum: ["all", "owner", "public", "private", "member"],
  21780. type: "string"
  21781. },
  21782. visibility: {
  21783. enum: ["all", "public", "private"],
  21784. type: "string"
  21785. }
  21786. },
  21787. url: "/user/repos"
  21788. },
  21789. listAppsWithAccessToProtectedBranch: {
  21790. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21791. method: "GET",
  21792. params: {
  21793. branch: {
  21794. required: true,
  21795. type: "string"
  21796. },
  21797. owner: {
  21798. required: true,
  21799. type: "string"
  21800. },
  21801. repo: {
  21802. required: true,
  21803. type: "string"
  21804. }
  21805. },
  21806. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21807. },
  21808. listAssetsForRelease: {
  21809. method: "GET",
  21810. params: {
  21811. owner: {
  21812. required: true,
  21813. type: "string"
  21814. },
  21815. page: {
  21816. type: "integer"
  21817. },
  21818. per_page: {
  21819. type: "integer"
  21820. },
  21821. release_id: {
  21822. required: true,
  21823. type: "integer"
  21824. },
  21825. repo: {
  21826. required: true,
  21827. type: "string"
  21828. }
  21829. },
  21830. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21831. },
  21832. listBranches: {
  21833. method: "GET",
  21834. params: {
  21835. owner: {
  21836. required: true,
  21837. type: "string"
  21838. },
  21839. page: {
  21840. type: "integer"
  21841. },
  21842. per_page: {
  21843. type: "integer"
  21844. },
  21845. protected: {
  21846. type: "boolean"
  21847. },
  21848. repo: {
  21849. required: true,
  21850. type: "string"
  21851. }
  21852. },
  21853. url: "/repos/:owner/:repo/branches"
  21854. },
  21855. listBranchesForHeadCommit: {
  21856. headers: {
  21857. accept: "application/vnd.github.groot-preview+json"
  21858. },
  21859. method: "GET",
  21860. params: {
  21861. commit_sha: {
  21862. required: true,
  21863. type: "string"
  21864. },
  21865. owner: {
  21866. required: true,
  21867. type: "string"
  21868. },
  21869. repo: {
  21870. required: true,
  21871. type: "string"
  21872. }
  21873. },
  21874. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21875. },
  21876. listCollaborators: {
  21877. method: "GET",
  21878. params: {
  21879. affiliation: {
  21880. enum: ["outside", "direct", "all"],
  21881. type: "string"
  21882. },
  21883. owner: {
  21884. required: true,
  21885. type: "string"
  21886. },
  21887. page: {
  21888. type: "integer"
  21889. },
  21890. per_page: {
  21891. type: "integer"
  21892. },
  21893. repo: {
  21894. required: true,
  21895. type: "string"
  21896. }
  21897. },
  21898. url: "/repos/:owner/:repo/collaborators"
  21899. },
  21900. listCommentsForCommit: {
  21901. method: "GET",
  21902. params: {
  21903. commit_sha: {
  21904. required: true,
  21905. type: "string"
  21906. },
  21907. owner: {
  21908. required: true,
  21909. type: "string"
  21910. },
  21911. page: {
  21912. type: "integer"
  21913. },
  21914. per_page: {
  21915. type: "integer"
  21916. },
  21917. ref: {
  21918. alias: "commit_sha",
  21919. deprecated: true,
  21920. type: "string"
  21921. },
  21922. repo: {
  21923. required: true,
  21924. type: "string"
  21925. }
  21926. },
  21927. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21928. },
  21929. listCommitComments: {
  21930. method: "GET",
  21931. params: {
  21932. owner: {
  21933. required: true,
  21934. type: "string"
  21935. },
  21936. page: {
  21937. type: "integer"
  21938. },
  21939. per_page: {
  21940. type: "integer"
  21941. },
  21942. repo: {
  21943. required: true,
  21944. type: "string"
  21945. }
  21946. },
  21947. url: "/repos/:owner/:repo/comments"
  21948. },
  21949. listCommits: {
  21950. method: "GET",
  21951. params: {
  21952. author: {
  21953. type: "string"
  21954. },
  21955. owner: {
  21956. required: true,
  21957. type: "string"
  21958. },
  21959. page: {
  21960. type: "integer"
  21961. },
  21962. path: {
  21963. type: "string"
  21964. },
  21965. per_page: {
  21966. type: "integer"
  21967. },
  21968. repo: {
  21969. required: true,
  21970. type: "string"
  21971. },
  21972. sha: {
  21973. type: "string"
  21974. },
  21975. since: {
  21976. type: "string"
  21977. },
  21978. until: {
  21979. type: "string"
  21980. }
  21981. },
  21982. url: "/repos/:owner/:repo/commits"
  21983. },
  21984. listContributors: {
  21985. method: "GET",
  21986. params: {
  21987. anon: {
  21988. type: "string"
  21989. },
  21990. owner: {
  21991. required: true,
  21992. type: "string"
  21993. },
  21994. page: {
  21995. type: "integer"
  21996. },
  21997. per_page: {
  21998. type: "integer"
  21999. },
  22000. repo: {
  22001. required: true,
  22002. type: "string"
  22003. }
  22004. },
  22005. url: "/repos/:owner/:repo/contributors"
  22006. },
  22007. listDeployKeys: {
  22008. method: "GET",
  22009. params: {
  22010. owner: {
  22011. required: true,
  22012. type: "string"
  22013. },
  22014. page: {
  22015. type: "integer"
  22016. },
  22017. per_page: {
  22018. type: "integer"
  22019. },
  22020. repo: {
  22021. required: true,
  22022. type: "string"
  22023. }
  22024. },
  22025. url: "/repos/:owner/:repo/keys"
  22026. },
  22027. listDeploymentStatuses: {
  22028. method: "GET",
  22029. params: {
  22030. deployment_id: {
  22031. required: true,
  22032. type: "integer"
  22033. },
  22034. owner: {
  22035. required: true,
  22036. type: "string"
  22037. },
  22038. page: {
  22039. type: "integer"
  22040. },
  22041. per_page: {
  22042. type: "integer"
  22043. },
  22044. repo: {
  22045. required: true,
  22046. type: "string"
  22047. }
  22048. },
  22049. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22050. },
  22051. listDeployments: {
  22052. method: "GET",
  22053. params: {
  22054. environment: {
  22055. type: "string"
  22056. },
  22057. owner: {
  22058. required: true,
  22059. type: "string"
  22060. },
  22061. page: {
  22062. type: "integer"
  22063. },
  22064. per_page: {
  22065. type: "integer"
  22066. },
  22067. ref: {
  22068. type: "string"
  22069. },
  22070. repo: {
  22071. required: true,
  22072. type: "string"
  22073. },
  22074. sha: {
  22075. type: "string"
  22076. },
  22077. task: {
  22078. type: "string"
  22079. }
  22080. },
  22081. url: "/repos/:owner/:repo/deployments"
  22082. },
  22083. listDownloads: {
  22084. method: "GET",
  22085. params: {
  22086. owner: {
  22087. required: true,
  22088. type: "string"
  22089. },
  22090. page: {
  22091. type: "integer"
  22092. },
  22093. per_page: {
  22094. type: "integer"
  22095. },
  22096. repo: {
  22097. required: true,
  22098. type: "string"
  22099. }
  22100. },
  22101. url: "/repos/:owner/:repo/downloads"
  22102. },
  22103. listForOrg: {
  22104. method: "GET",
  22105. params: {
  22106. direction: {
  22107. enum: ["asc", "desc"],
  22108. type: "string"
  22109. },
  22110. org: {
  22111. required: true,
  22112. type: "string"
  22113. },
  22114. page: {
  22115. type: "integer"
  22116. },
  22117. per_page: {
  22118. type: "integer"
  22119. },
  22120. sort: {
  22121. enum: ["created", "updated", "pushed", "full_name"],
  22122. type: "string"
  22123. },
  22124. type: {
  22125. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22126. type: "string"
  22127. }
  22128. },
  22129. url: "/orgs/:org/repos"
  22130. },
  22131. listForUser: {
  22132. method: "GET",
  22133. params: {
  22134. direction: {
  22135. enum: ["asc", "desc"],
  22136. type: "string"
  22137. },
  22138. page: {
  22139. type: "integer"
  22140. },
  22141. per_page: {
  22142. type: "integer"
  22143. },
  22144. sort: {
  22145. enum: ["created", "updated", "pushed", "full_name"],
  22146. type: "string"
  22147. },
  22148. type: {
  22149. enum: ["all", "owner", "member"],
  22150. type: "string"
  22151. },
  22152. username: {
  22153. required: true,
  22154. type: "string"
  22155. }
  22156. },
  22157. url: "/users/:username/repos"
  22158. },
  22159. listForks: {
  22160. method: "GET",
  22161. params: {
  22162. owner: {
  22163. required: true,
  22164. type: "string"
  22165. },
  22166. page: {
  22167. type: "integer"
  22168. },
  22169. per_page: {
  22170. type: "integer"
  22171. },
  22172. repo: {
  22173. required: true,
  22174. type: "string"
  22175. },
  22176. sort: {
  22177. enum: ["newest", "oldest", "stargazers"],
  22178. type: "string"
  22179. }
  22180. },
  22181. url: "/repos/:owner/:repo/forks"
  22182. },
  22183. listHooks: {
  22184. method: "GET",
  22185. params: {
  22186. owner: {
  22187. required: true,
  22188. type: "string"
  22189. },
  22190. page: {
  22191. type: "integer"
  22192. },
  22193. per_page: {
  22194. type: "integer"
  22195. },
  22196. repo: {
  22197. required: true,
  22198. type: "string"
  22199. }
  22200. },
  22201. url: "/repos/:owner/:repo/hooks"
  22202. },
  22203. listInvitations: {
  22204. method: "GET",
  22205. params: {
  22206. owner: {
  22207. required: true,
  22208. type: "string"
  22209. },
  22210. page: {
  22211. type: "integer"
  22212. },
  22213. per_page: {
  22214. type: "integer"
  22215. },
  22216. repo: {
  22217. required: true,
  22218. type: "string"
  22219. }
  22220. },
  22221. url: "/repos/:owner/:repo/invitations"
  22222. },
  22223. listInvitationsForAuthenticatedUser: {
  22224. method: "GET",
  22225. params: {
  22226. page: {
  22227. type: "integer"
  22228. },
  22229. per_page: {
  22230. type: "integer"
  22231. }
  22232. },
  22233. url: "/user/repository_invitations"
  22234. },
  22235. listLanguages: {
  22236. method: "GET",
  22237. params: {
  22238. owner: {
  22239. required: true,
  22240. type: "string"
  22241. },
  22242. repo: {
  22243. required: true,
  22244. type: "string"
  22245. }
  22246. },
  22247. url: "/repos/:owner/:repo/languages"
  22248. },
  22249. listPagesBuilds: {
  22250. method: "GET",
  22251. params: {
  22252. owner: {
  22253. required: true,
  22254. type: "string"
  22255. },
  22256. page: {
  22257. type: "integer"
  22258. },
  22259. per_page: {
  22260. type: "integer"
  22261. },
  22262. repo: {
  22263. required: true,
  22264. type: "string"
  22265. }
  22266. },
  22267. url: "/repos/:owner/:repo/pages/builds"
  22268. },
  22269. listProtectedBranchRequiredStatusChecksContexts: {
  22270. method: "GET",
  22271. params: {
  22272. branch: {
  22273. required: true,
  22274. type: "string"
  22275. },
  22276. owner: {
  22277. required: true,
  22278. type: "string"
  22279. },
  22280. repo: {
  22281. required: true,
  22282. type: "string"
  22283. }
  22284. },
  22285. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22286. },
  22287. listProtectedBranchTeamRestrictions: {
  22288. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22289. method: "GET",
  22290. params: {
  22291. branch: {
  22292. required: true,
  22293. type: "string"
  22294. },
  22295. owner: {
  22296. required: true,
  22297. type: "string"
  22298. },
  22299. repo: {
  22300. required: true,
  22301. type: "string"
  22302. }
  22303. },
  22304. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22305. },
  22306. listProtectedBranchUserRestrictions: {
  22307. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22308. method: "GET",
  22309. params: {
  22310. branch: {
  22311. required: true,
  22312. type: "string"
  22313. },
  22314. owner: {
  22315. required: true,
  22316. type: "string"
  22317. },
  22318. repo: {
  22319. required: true,
  22320. type: "string"
  22321. }
  22322. },
  22323. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22324. },
  22325. listPublic: {
  22326. method: "GET",
  22327. params: {
  22328. page: {
  22329. type: "integer"
  22330. },
  22331. per_page: {
  22332. type: "integer"
  22333. },
  22334. since: {
  22335. type: "integer"
  22336. }
  22337. },
  22338. url: "/repositories"
  22339. },
  22340. listPullRequestsAssociatedWithCommit: {
  22341. headers: {
  22342. accept: "application/vnd.github.groot-preview+json"
  22343. },
  22344. method: "GET",
  22345. params: {
  22346. commit_sha: {
  22347. required: true,
  22348. type: "string"
  22349. },
  22350. owner: {
  22351. required: true,
  22352. type: "string"
  22353. },
  22354. page: {
  22355. type: "integer"
  22356. },
  22357. per_page: {
  22358. type: "integer"
  22359. },
  22360. repo: {
  22361. required: true,
  22362. type: "string"
  22363. }
  22364. },
  22365. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22366. },
  22367. listReleases: {
  22368. method: "GET",
  22369. params: {
  22370. owner: {
  22371. required: true,
  22372. type: "string"
  22373. },
  22374. page: {
  22375. type: "integer"
  22376. },
  22377. per_page: {
  22378. type: "integer"
  22379. },
  22380. repo: {
  22381. required: true,
  22382. type: "string"
  22383. }
  22384. },
  22385. url: "/repos/:owner/:repo/releases"
  22386. },
  22387. listStatusesForRef: {
  22388. method: "GET",
  22389. params: {
  22390. owner: {
  22391. required: true,
  22392. type: "string"
  22393. },
  22394. page: {
  22395. type: "integer"
  22396. },
  22397. per_page: {
  22398. type: "integer"
  22399. },
  22400. ref: {
  22401. required: true,
  22402. type: "string"
  22403. },
  22404. repo: {
  22405. required: true,
  22406. type: "string"
  22407. }
  22408. },
  22409. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22410. },
  22411. listTags: {
  22412. method: "GET",
  22413. params: {
  22414. owner: {
  22415. required: true,
  22416. type: "string"
  22417. },
  22418. page: {
  22419. type: "integer"
  22420. },
  22421. per_page: {
  22422. type: "integer"
  22423. },
  22424. repo: {
  22425. required: true,
  22426. type: "string"
  22427. }
  22428. },
  22429. url: "/repos/:owner/:repo/tags"
  22430. },
  22431. listTeams: {
  22432. method: "GET",
  22433. params: {
  22434. owner: {
  22435. required: true,
  22436. type: "string"
  22437. },
  22438. page: {
  22439. type: "integer"
  22440. },
  22441. per_page: {
  22442. type: "integer"
  22443. },
  22444. repo: {
  22445. required: true,
  22446. type: "string"
  22447. }
  22448. },
  22449. url: "/repos/:owner/:repo/teams"
  22450. },
  22451. listTeamsWithAccessToProtectedBranch: {
  22452. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22453. method: "GET",
  22454. params: {
  22455. branch: {
  22456. required: true,
  22457. type: "string"
  22458. },
  22459. owner: {
  22460. required: true,
  22461. type: "string"
  22462. },
  22463. repo: {
  22464. required: true,
  22465. type: "string"
  22466. }
  22467. },
  22468. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22469. },
  22470. listTopics: {
  22471. headers: {
  22472. accept: "application/vnd.github.mercy-preview+json"
  22473. },
  22474. method: "GET",
  22475. params: {
  22476. owner: {
  22477. required: true,
  22478. type: "string"
  22479. },
  22480. repo: {
  22481. required: true,
  22482. type: "string"
  22483. }
  22484. },
  22485. url: "/repos/:owner/:repo/topics"
  22486. },
  22487. listUsersWithAccessToProtectedBranch: {
  22488. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22489. method: "GET",
  22490. params: {
  22491. branch: {
  22492. required: true,
  22493. type: "string"
  22494. },
  22495. owner: {
  22496. required: true,
  22497. type: "string"
  22498. },
  22499. repo: {
  22500. required: true,
  22501. type: "string"
  22502. }
  22503. },
  22504. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22505. },
  22506. merge: {
  22507. method: "POST",
  22508. params: {
  22509. base: {
  22510. required: true,
  22511. type: "string"
  22512. },
  22513. commit_message: {
  22514. type: "string"
  22515. },
  22516. head: {
  22517. required: true,
  22518. type: "string"
  22519. },
  22520. owner: {
  22521. required: true,
  22522. type: "string"
  22523. },
  22524. repo: {
  22525. required: true,
  22526. type: "string"
  22527. }
  22528. },
  22529. url: "/repos/:owner/:repo/merges"
  22530. },
  22531. pingHook: {
  22532. method: "POST",
  22533. params: {
  22534. hook_id: {
  22535. required: true,
  22536. type: "integer"
  22537. },
  22538. owner: {
  22539. required: true,
  22540. type: "string"
  22541. },
  22542. repo: {
  22543. required: true,
  22544. type: "string"
  22545. }
  22546. },
  22547. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22548. },
  22549. removeBranchProtection: {
  22550. method: "DELETE",
  22551. params: {
  22552. branch: {
  22553. required: true,
  22554. type: "string"
  22555. },
  22556. owner: {
  22557. required: true,
  22558. type: "string"
  22559. },
  22560. repo: {
  22561. required: true,
  22562. type: "string"
  22563. }
  22564. },
  22565. url: "/repos/:owner/:repo/branches/:branch/protection"
  22566. },
  22567. removeCollaborator: {
  22568. method: "DELETE",
  22569. params: {
  22570. owner: {
  22571. required: true,
  22572. type: "string"
  22573. },
  22574. repo: {
  22575. required: true,
  22576. type: "string"
  22577. },
  22578. username: {
  22579. required: true,
  22580. type: "string"
  22581. }
  22582. },
  22583. url: "/repos/:owner/:repo/collaborators/:username"
  22584. },
  22585. removeDeployKey: {
  22586. method: "DELETE",
  22587. params: {
  22588. key_id: {
  22589. required: true,
  22590. type: "integer"
  22591. },
  22592. owner: {
  22593. required: true,
  22594. type: "string"
  22595. },
  22596. repo: {
  22597. required: true,
  22598. type: "string"
  22599. }
  22600. },
  22601. url: "/repos/:owner/:repo/keys/:key_id"
  22602. },
  22603. removeProtectedBranchAdminEnforcement: {
  22604. method: "DELETE",
  22605. params: {
  22606. branch: {
  22607. required: true,
  22608. type: "string"
  22609. },
  22610. owner: {
  22611. required: true,
  22612. type: "string"
  22613. },
  22614. repo: {
  22615. required: true,
  22616. type: "string"
  22617. }
  22618. },
  22619. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22620. },
  22621. removeProtectedBranchAppRestrictions: {
  22622. method: "DELETE",
  22623. params: {
  22624. apps: {
  22625. mapTo: "data",
  22626. required: true,
  22627. type: "string[]"
  22628. },
  22629. branch: {
  22630. required: true,
  22631. type: "string"
  22632. },
  22633. owner: {
  22634. required: true,
  22635. type: "string"
  22636. },
  22637. repo: {
  22638. required: true,
  22639. type: "string"
  22640. }
  22641. },
  22642. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22643. },
  22644. removeProtectedBranchPullRequestReviewEnforcement: {
  22645. method: "DELETE",
  22646. params: {
  22647. branch: {
  22648. required: true,
  22649. type: "string"
  22650. },
  22651. owner: {
  22652. required: true,
  22653. type: "string"
  22654. },
  22655. repo: {
  22656. required: true,
  22657. type: "string"
  22658. }
  22659. },
  22660. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22661. },
  22662. removeProtectedBranchRequiredSignatures: {
  22663. headers: {
  22664. accept: "application/vnd.github.zzzax-preview+json"
  22665. },
  22666. method: "DELETE",
  22667. params: {
  22668. branch: {
  22669. required: true,
  22670. type: "string"
  22671. },
  22672. owner: {
  22673. required: true,
  22674. type: "string"
  22675. },
  22676. repo: {
  22677. required: true,
  22678. type: "string"
  22679. }
  22680. },
  22681. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22682. },
  22683. removeProtectedBranchRequiredStatusChecks: {
  22684. method: "DELETE",
  22685. params: {
  22686. branch: {
  22687. required: true,
  22688. type: "string"
  22689. },
  22690. owner: {
  22691. required: true,
  22692. type: "string"
  22693. },
  22694. repo: {
  22695. required: true,
  22696. type: "string"
  22697. }
  22698. },
  22699. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22700. },
  22701. removeProtectedBranchRequiredStatusChecksContexts: {
  22702. method: "DELETE",
  22703. params: {
  22704. branch: {
  22705. required: true,
  22706. type: "string"
  22707. },
  22708. contexts: {
  22709. mapTo: "data",
  22710. required: true,
  22711. type: "string[]"
  22712. },
  22713. owner: {
  22714. required: true,
  22715. type: "string"
  22716. },
  22717. repo: {
  22718. required: true,
  22719. type: "string"
  22720. }
  22721. },
  22722. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22723. },
  22724. removeProtectedBranchRestrictions: {
  22725. method: "DELETE",
  22726. params: {
  22727. branch: {
  22728. required: true,
  22729. type: "string"
  22730. },
  22731. owner: {
  22732. required: true,
  22733. type: "string"
  22734. },
  22735. repo: {
  22736. required: true,
  22737. type: "string"
  22738. }
  22739. },
  22740. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22741. },
  22742. removeProtectedBranchTeamRestrictions: {
  22743. method: "DELETE",
  22744. params: {
  22745. branch: {
  22746. required: true,
  22747. type: "string"
  22748. },
  22749. owner: {
  22750. required: true,
  22751. type: "string"
  22752. },
  22753. repo: {
  22754. required: true,
  22755. type: "string"
  22756. },
  22757. teams: {
  22758. mapTo: "data",
  22759. required: true,
  22760. type: "string[]"
  22761. }
  22762. },
  22763. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22764. },
  22765. removeProtectedBranchUserRestrictions: {
  22766. method: "DELETE",
  22767. params: {
  22768. branch: {
  22769. required: true,
  22770. type: "string"
  22771. },
  22772. owner: {
  22773. required: true,
  22774. type: "string"
  22775. },
  22776. repo: {
  22777. required: true,
  22778. type: "string"
  22779. },
  22780. users: {
  22781. mapTo: "data",
  22782. required: true,
  22783. type: "string[]"
  22784. }
  22785. },
  22786. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22787. },
  22788. replaceProtectedBranchAppRestrictions: {
  22789. method: "PUT",
  22790. params: {
  22791. apps: {
  22792. mapTo: "data",
  22793. required: true,
  22794. type: "string[]"
  22795. },
  22796. branch: {
  22797. required: true,
  22798. type: "string"
  22799. },
  22800. owner: {
  22801. required: true,
  22802. type: "string"
  22803. },
  22804. repo: {
  22805. required: true,
  22806. type: "string"
  22807. }
  22808. },
  22809. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22810. },
  22811. replaceProtectedBranchRequiredStatusChecksContexts: {
  22812. method: "PUT",
  22813. params: {
  22814. branch: {
  22815. required: true,
  22816. type: "string"
  22817. },
  22818. contexts: {
  22819. mapTo: "data",
  22820. required: true,
  22821. type: "string[]"
  22822. },
  22823. owner: {
  22824. required: true,
  22825. type: "string"
  22826. },
  22827. repo: {
  22828. required: true,
  22829. type: "string"
  22830. }
  22831. },
  22832. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22833. },
  22834. replaceProtectedBranchTeamRestrictions: {
  22835. method: "PUT",
  22836. params: {
  22837. branch: {
  22838. required: true,
  22839. type: "string"
  22840. },
  22841. owner: {
  22842. required: true,
  22843. type: "string"
  22844. },
  22845. repo: {
  22846. required: true,
  22847. type: "string"
  22848. },
  22849. teams: {
  22850. mapTo: "data",
  22851. required: true,
  22852. type: "string[]"
  22853. }
  22854. },
  22855. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22856. },
  22857. replaceProtectedBranchUserRestrictions: {
  22858. method: "PUT",
  22859. params: {
  22860. branch: {
  22861. required: true,
  22862. type: "string"
  22863. },
  22864. owner: {
  22865. required: true,
  22866. type: "string"
  22867. },
  22868. repo: {
  22869. required: true,
  22870. type: "string"
  22871. },
  22872. users: {
  22873. mapTo: "data",
  22874. required: true,
  22875. type: "string[]"
  22876. }
  22877. },
  22878. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22879. },
  22880. replaceTopics: {
  22881. headers: {
  22882. accept: "application/vnd.github.mercy-preview+json"
  22883. },
  22884. method: "PUT",
  22885. params: {
  22886. names: {
  22887. required: true,
  22888. type: "string[]"
  22889. },
  22890. owner: {
  22891. required: true,
  22892. type: "string"
  22893. },
  22894. repo: {
  22895. required: true,
  22896. type: "string"
  22897. }
  22898. },
  22899. url: "/repos/:owner/:repo/topics"
  22900. },
  22901. requestPageBuild: {
  22902. method: "POST",
  22903. params: {
  22904. owner: {
  22905. required: true,
  22906. type: "string"
  22907. },
  22908. repo: {
  22909. required: true,
  22910. type: "string"
  22911. }
  22912. },
  22913. url: "/repos/:owner/:repo/pages/builds"
  22914. },
  22915. retrieveCommunityProfileMetrics: {
  22916. method: "GET",
  22917. params: {
  22918. owner: {
  22919. required: true,
  22920. type: "string"
  22921. },
  22922. repo: {
  22923. required: true,
  22924. type: "string"
  22925. }
  22926. },
  22927. url: "/repos/:owner/:repo/community/profile"
  22928. },
  22929. testPushHook: {
  22930. method: "POST",
  22931. params: {
  22932. hook_id: {
  22933. required: true,
  22934. type: "integer"
  22935. },
  22936. owner: {
  22937. required: true,
  22938. type: "string"
  22939. },
  22940. repo: {
  22941. required: true,
  22942. type: "string"
  22943. }
  22944. },
  22945. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22946. },
  22947. transfer: {
  22948. method: "POST",
  22949. params: {
  22950. new_owner: {
  22951. type: "string"
  22952. },
  22953. owner: {
  22954. required: true,
  22955. type: "string"
  22956. },
  22957. repo: {
  22958. required: true,
  22959. type: "string"
  22960. },
  22961. team_ids: {
  22962. type: "integer[]"
  22963. }
  22964. },
  22965. url: "/repos/:owner/:repo/transfer"
  22966. },
  22967. update: {
  22968. method: "PATCH",
  22969. params: {
  22970. allow_merge_commit: {
  22971. type: "boolean"
  22972. },
  22973. allow_rebase_merge: {
  22974. type: "boolean"
  22975. },
  22976. allow_squash_merge: {
  22977. type: "boolean"
  22978. },
  22979. archived: {
  22980. type: "boolean"
  22981. },
  22982. default_branch: {
  22983. type: "string"
  22984. },
  22985. delete_branch_on_merge: {
  22986. type: "boolean"
  22987. },
  22988. description: {
  22989. type: "string"
  22990. },
  22991. has_issues: {
  22992. type: "boolean"
  22993. },
  22994. has_projects: {
  22995. type: "boolean"
  22996. },
  22997. has_wiki: {
  22998. type: "boolean"
  22999. },
  23000. homepage: {
  23001. type: "string"
  23002. },
  23003. is_template: {
  23004. type: "boolean"
  23005. },
  23006. name: {
  23007. type: "string"
  23008. },
  23009. owner: {
  23010. required: true,
  23011. type: "string"
  23012. },
  23013. private: {
  23014. type: "boolean"
  23015. },
  23016. repo: {
  23017. required: true,
  23018. type: "string"
  23019. },
  23020. visibility: {
  23021. enum: ["public", "private", "visibility", "internal"],
  23022. type: "string"
  23023. }
  23024. },
  23025. url: "/repos/:owner/:repo"
  23026. },
  23027. updateBranchProtection: {
  23028. method: "PUT",
  23029. params: {
  23030. allow_deletions: {
  23031. type: "boolean"
  23032. },
  23033. allow_force_pushes: {
  23034. allowNull: true,
  23035. type: "boolean"
  23036. },
  23037. branch: {
  23038. required: true,
  23039. type: "string"
  23040. },
  23041. enforce_admins: {
  23042. allowNull: true,
  23043. required: true,
  23044. type: "boolean"
  23045. },
  23046. owner: {
  23047. required: true,
  23048. type: "string"
  23049. },
  23050. repo: {
  23051. required: true,
  23052. type: "string"
  23053. },
  23054. required_linear_history: {
  23055. type: "boolean"
  23056. },
  23057. required_pull_request_reviews: {
  23058. allowNull: true,
  23059. required: true,
  23060. type: "object"
  23061. },
  23062. "required_pull_request_reviews.dismiss_stale_reviews": {
  23063. type: "boolean"
  23064. },
  23065. "required_pull_request_reviews.dismissal_restrictions": {
  23066. type: "object"
  23067. },
  23068. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23069. type: "string[]"
  23070. },
  23071. "required_pull_request_reviews.dismissal_restrictions.users": {
  23072. type: "string[]"
  23073. },
  23074. "required_pull_request_reviews.require_code_owner_reviews": {
  23075. type: "boolean"
  23076. },
  23077. "required_pull_request_reviews.required_approving_review_count": {
  23078. type: "integer"
  23079. },
  23080. required_status_checks: {
  23081. allowNull: true,
  23082. required: true,
  23083. type: "object"
  23084. },
  23085. "required_status_checks.contexts": {
  23086. required: true,
  23087. type: "string[]"
  23088. },
  23089. "required_status_checks.strict": {
  23090. required: true,
  23091. type: "boolean"
  23092. },
  23093. restrictions: {
  23094. allowNull: true,
  23095. required: true,
  23096. type: "object"
  23097. },
  23098. "restrictions.apps": {
  23099. type: "string[]"
  23100. },
  23101. "restrictions.teams": {
  23102. required: true,
  23103. type: "string[]"
  23104. },
  23105. "restrictions.users": {
  23106. required: true,
  23107. type: "string[]"
  23108. }
  23109. },
  23110. url: "/repos/:owner/:repo/branches/:branch/protection"
  23111. },
  23112. updateCommitComment: {
  23113. method: "PATCH",
  23114. params: {
  23115. body: {
  23116. required: true,
  23117. type: "string"
  23118. },
  23119. comment_id: {
  23120. required: true,
  23121. type: "integer"
  23122. },
  23123. owner: {
  23124. required: true,
  23125. type: "string"
  23126. },
  23127. repo: {
  23128. required: true,
  23129. type: "string"
  23130. }
  23131. },
  23132. url: "/repos/:owner/:repo/comments/:comment_id"
  23133. },
  23134. updateFile: {
  23135. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23136. method: "PUT",
  23137. params: {
  23138. author: {
  23139. type: "object"
  23140. },
  23141. "author.email": {
  23142. required: true,
  23143. type: "string"
  23144. },
  23145. "author.name": {
  23146. required: true,
  23147. type: "string"
  23148. },
  23149. branch: {
  23150. type: "string"
  23151. },
  23152. committer: {
  23153. type: "object"
  23154. },
  23155. "committer.email": {
  23156. required: true,
  23157. type: "string"
  23158. },
  23159. "committer.name": {
  23160. required: true,
  23161. type: "string"
  23162. },
  23163. content: {
  23164. required: true,
  23165. type: "string"
  23166. },
  23167. message: {
  23168. required: true,
  23169. type: "string"
  23170. },
  23171. owner: {
  23172. required: true,
  23173. type: "string"
  23174. },
  23175. path: {
  23176. required: true,
  23177. type: "string"
  23178. },
  23179. repo: {
  23180. required: true,
  23181. type: "string"
  23182. },
  23183. sha: {
  23184. type: "string"
  23185. }
  23186. },
  23187. url: "/repos/:owner/:repo/contents/:path"
  23188. },
  23189. updateHook: {
  23190. method: "PATCH",
  23191. params: {
  23192. active: {
  23193. type: "boolean"
  23194. },
  23195. add_events: {
  23196. type: "string[]"
  23197. },
  23198. config: {
  23199. type: "object"
  23200. },
  23201. "config.content_type": {
  23202. type: "string"
  23203. },
  23204. "config.insecure_ssl": {
  23205. type: "string"
  23206. },
  23207. "config.secret": {
  23208. type: "string"
  23209. },
  23210. "config.url": {
  23211. required: true,
  23212. type: "string"
  23213. },
  23214. events: {
  23215. type: "string[]"
  23216. },
  23217. hook_id: {
  23218. required: true,
  23219. type: "integer"
  23220. },
  23221. owner: {
  23222. required: true,
  23223. type: "string"
  23224. },
  23225. remove_events: {
  23226. type: "string[]"
  23227. },
  23228. repo: {
  23229. required: true,
  23230. type: "string"
  23231. }
  23232. },
  23233. url: "/repos/:owner/:repo/hooks/:hook_id"
  23234. },
  23235. updateInformationAboutPagesSite: {
  23236. method: "PUT",
  23237. params: {
  23238. cname: {
  23239. type: "string"
  23240. },
  23241. owner: {
  23242. required: true,
  23243. type: "string"
  23244. },
  23245. repo: {
  23246. required: true,
  23247. type: "string"
  23248. },
  23249. source: {
  23250. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23251. type: "string"
  23252. }
  23253. },
  23254. url: "/repos/:owner/:repo/pages"
  23255. },
  23256. updateInvitation: {
  23257. method: "PATCH",
  23258. params: {
  23259. invitation_id: {
  23260. required: true,
  23261. type: "integer"
  23262. },
  23263. owner: {
  23264. required: true,
  23265. type: "string"
  23266. },
  23267. permissions: {
  23268. enum: ["read", "write", "admin"],
  23269. type: "string"
  23270. },
  23271. repo: {
  23272. required: true,
  23273. type: "string"
  23274. }
  23275. },
  23276. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23277. },
  23278. updateProtectedBranchPullRequestReviewEnforcement: {
  23279. method: "PATCH",
  23280. params: {
  23281. branch: {
  23282. required: true,
  23283. type: "string"
  23284. },
  23285. dismiss_stale_reviews: {
  23286. type: "boolean"
  23287. },
  23288. dismissal_restrictions: {
  23289. type: "object"
  23290. },
  23291. "dismissal_restrictions.teams": {
  23292. type: "string[]"
  23293. },
  23294. "dismissal_restrictions.users": {
  23295. type: "string[]"
  23296. },
  23297. owner: {
  23298. required: true,
  23299. type: "string"
  23300. },
  23301. repo: {
  23302. required: true,
  23303. type: "string"
  23304. },
  23305. require_code_owner_reviews: {
  23306. type: "boolean"
  23307. },
  23308. required_approving_review_count: {
  23309. type: "integer"
  23310. }
  23311. },
  23312. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23313. },
  23314. updateProtectedBranchRequiredStatusChecks: {
  23315. method: "PATCH",
  23316. params: {
  23317. branch: {
  23318. required: true,
  23319. type: "string"
  23320. },
  23321. contexts: {
  23322. type: "string[]"
  23323. },
  23324. owner: {
  23325. required: true,
  23326. type: "string"
  23327. },
  23328. repo: {
  23329. required: true,
  23330. type: "string"
  23331. },
  23332. strict: {
  23333. type: "boolean"
  23334. }
  23335. },
  23336. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23337. },
  23338. updateRelease: {
  23339. method: "PATCH",
  23340. params: {
  23341. body: {
  23342. type: "string"
  23343. },
  23344. draft: {
  23345. type: "boolean"
  23346. },
  23347. name: {
  23348. type: "string"
  23349. },
  23350. owner: {
  23351. required: true,
  23352. type: "string"
  23353. },
  23354. prerelease: {
  23355. type: "boolean"
  23356. },
  23357. release_id: {
  23358. required: true,
  23359. type: "integer"
  23360. },
  23361. repo: {
  23362. required: true,
  23363. type: "string"
  23364. },
  23365. tag_name: {
  23366. type: "string"
  23367. },
  23368. target_commitish: {
  23369. type: "string"
  23370. }
  23371. },
  23372. url: "/repos/:owner/:repo/releases/:release_id"
  23373. },
  23374. updateReleaseAsset: {
  23375. method: "PATCH",
  23376. params: {
  23377. asset_id: {
  23378. required: true,
  23379. type: "integer"
  23380. },
  23381. label: {
  23382. type: "string"
  23383. },
  23384. name: {
  23385. type: "string"
  23386. },
  23387. owner: {
  23388. required: true,
  23389. type: "string"
  23390. },
  23391. repo: {
  23392. required: true,
  23393. type: "string"
  23394. }
  23395. },
  23396. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23397. },
  23398. uploadReleaseAsset: {
  23399. method: "POST",
  23400. params: {
  23401. data: {
  23402. mapTo: "data",
  23403. required: true,
  23404. type: "string | object"
  23405. },
  23406. file: {
  23407. alias: "data",
  23408. deprecated: true,
  23409. type: "string | object"
  23410. },
  23411. headers: {
  23412. required: true,
  23413. type: "object"
  23414. },
  23415. "headers.content-length": {
  23416. required: true,
  23417. type: "integer"
  23418. },
  23419. "headers.content-type": {
  23420. required: true,
  23421. type: "string"
  23422. },
  23423. label: {
  23424. type: "string"
  23425. },
  23426. name: {
  23427. required: true,
  23428. type: "string"
  23429. },
  23430. url: {
  23431. required: true,
  23432. type: "string"
  23433. }
  23434. },
  23435. url: ":url"
  23436. }
  23437. },
  23438. search: {
  23439. code: {
  23440. method: "GET",
  23441. params: {
  23442. order: {
  23443. enum: ["desc", "asc"],
  23444. type: "string"
  23445. },
  23446. page: {
  23447. type: "integer"
  23448. },
  23449. per_page: {
  23450. type: "integer"
  23451. },
  23452. q: {
  23453. required: true,
  23454. type: "string"
  23455. },
  23456. sort: {
  23457. enum: ["indexed"],
  23458. type: "string"
  23459. }
  23460. },
  23461. url: "/search/code"
  23462. },
  23463. commits: {
  23464. headers: {
  23465. accept: "application/vnd.github.cloak-preview+json"
  23466. },
  23467. method: "GET",
  23468. params: {
  23469. order: {
  23470. enum: ["desc", "asc"],
  23471. type: "string"
  23472. },
  23473. page: {
  23474. type: "integer"
  23475. },
  23476. per_page: {
  23477. type: "integer"
  23478. },
  23479. q: {
  23480. required: true,
  23481. type: "string"
  23482. },
  23483. sort: {
  23484. enum: ["author-date", "committer-date"],
  23485. type: "string"
  23486. }
  23487. },
  23488. url: "/search/commits"
  23489. },
  23490. issues: {
  23491. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23492. method: "GET",
  23493. params: {
  23494. order: {
  23495. enum: ["desc", "asc"],
  23496. type: "string"
  23497. },
  23498. page: {
  23499. type: "integer"
  23500. },
  23501. per_page: {
  23502. type: "integer"
  23503. },
  23504. q: {
  23505. required: true,
  23506. type: "string"
  23507. },
  23508. sort: {
  23509. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23510. type: "string"
  23511. }
  23512. },
  23513. url: "/search/issues"
  23514. },
  23515. issuesAndPullRequests: {
  23516. method: "GET",
  23517. params: {
  23518. order: {
  23519. enum: ["desc", "asc"],
  23520. type: "string"
  23521. },
  23522. page: {
  23523. type: "integer"
  23524. },
  23525. per_page: {
  23526. type: "integer"
  23527. },
  23528. q: {
  23529. required: true,
  23530. type: "string"
  23531. },
  23532. sort: {
  23533. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23534. type: "string"
  23535. }
  23536. },
  23537. url: "/search/issues"
  23538. },
  23539. labels: {
  23540. method: "GET",
  23541. params: {
  23542. order: {
  23543. enum: ["desc", "asc"],
  23544. type: "string"
  23545. },
  23546. q: {
  23547. required: true,
  23548. type: "string"
  23549. },
  23550. repository_id: {
  23551. required: true,
  23552. type: "integer"
  23553. },
  23554. sort: {
  23555. enum: ["created", "updated"],
  23556. type: "string"
  23557. }
  23558. },
  23559. url: "/search/labels"
  23560. },
  23561. repos: {
  23562. method: "GET",
  23563. params: {
  23564. order: {
  23565. enum: ["desc", "asc"],
  23566. type: "string"
  23567. },
  23568. page: {
  23569. type: "integer"
  23570. },
  23571. per_page: {
  23572. type: "integer"
  23573. },
  23574. q: {
  23575. required: true,
  23576. type: "string"
  23577. },
  23578. sort: {
  23579. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23580. type: "string"
  23581. }
  23582. },
  23583. url: "/search/repositories"
  23584. },
  23585. topics: {
  23586. method: "GET",
  23587. params: {
  23588. q: {
  23589. required: true,
  23590. type: "string"
  23591. }
  23592. },
  23593. url: "/search/topics"
  23594. },
  23595. users: {
  23596. method: "GET",
  23597. params: {
  23598. order: {
  23599. enum: ["desc", "asc"],
  23600. type: "string"
  23601. },
  23602. page: {
  23603. type: "integer"
  23604. },
  23605. per_page: {
  23606. type: "integer"
  23607. },
  23608. q: {
  23609. required: true,
  23610. type: "string"
  23611. },
  23612. sort: {
  23613. enum: ["followers", "repositories", "joined"],
  23614. type: "string"
  23615. }
  23616. },
  23617. url: "/search/users"
  23618. }
  23619. },
  23620. teams: {
  23621. addMember: {
  23622. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23623. method: "PUT",
  23624. params: {
  23625. team_id: {
  23626. required: true,
  23627. type: "integer"
  23628. },
  23629. username: {
  23630. required: true,
  23631. type: "string"
  23632. }
  23633. },
  23634. url: "/teams/:team_id/members/:username"
  23635. },
  23636. addMemberLegacy: {
  23637. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23638. method: "PUT",
  23639. params: {
  23640. team_id: {
  23641. required: true,
  23642. type: "integer"
  23643. },
  23644. username: {
  23645. required: true,
  23646. type: "string"
  23647. }
  23648. },
  23649. url: "/teams/:team_id/members/:username"
  23650. },
  23651. addOrUpdateMembership: {
  23652. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23653. method: "PUT",
  23654. params: {
  23655. role: {
  23656. enum: ["member", "maintainer"],
  23657. type: "string"
  23658. },
  23659. team_id: {
  23660. required: true,
  23661. type: "integer"
  23662. },
  23663. username: {
  23664. required: true,
  23665. type: "string"
  23666. }
  23667. },
  23668. url: "/teams/:team_id/memberships/:username"
  23669. },
  23670. addOrUpdateMembershipInOrg: {
  23671. method: "PUT",
  23672. params: {
  23673. org: {
  23674. required: true,
  23675. type: "string"
  23676. },
  23677. role: {
  23678. enum: ["member", "maintainer"],
  23679. type: "string"
  23680. },
  23681. team_slug: {
  23682. required: true,
  23683. type: "string"
  23684. },
  23685. username: {
  23686. required: true,
  23687. type: "string"
  23688. }
  23689. },
  23690. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23691. },
  23692. addOrUpdateMembershipLegacy: {
  23693. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23694. method: "PUT",
  23695. params: {
  23696. role: {
  23697. enum: ["member", "maintainer"],
  23698. type: "string"
  23699. },
  23700. team_id: {
  23701. required: true,
  23702. type: "integer"
  23703. },
  23704. username: {
  23705. required: true,
  23706. type: "string"
  23707. }
  23708. },
  23709. url: "/teams/:team_id/memberships/:username"
  23710. },
  23711. addOrUpdateProject: {
  23712. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23713. headers: {
  23714. accept: "application/vnd.github.inertia-preview+json"
  23715. },
  23716. method: "PUT",
  23717. params: {
  23718. permission: {
  23719. enum: ["read", "write", "admin"],
  23720. type: "string"
  23721. },
  23722. project_id: {
  23723. required: true,
  23724. type: "integer"
  23725. },
  23726. team_id: {
  23727. required: true,
  23728. type: "integer"
  23729. }
  23730. },
  23731. url: "/teams/:team_id/projects/:project_id"
  23732. },
  23733. addOrUpdateProjectInOrg: {
  23734. headers: {
  23735. accept: "application/vnd.github.inertia-preview+json"
  23736. },
  23737. method: "PUT",
  23738. params: {
  23739. org: {
  23740. required: true,
  23741. type: "string"
  23742. },
  23743. permission: {
  23744. enum: ["read", "write", "admin"],
  23745. type: "string"
  23746. },
  23747. project_id: {
  23748. required: true,
  23749. type: "integer"
  23750. },
  23751. team_slug: {
  23752. required: true,
  23753. type: "string"
  23754. }
  23755. },
  23756. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23757. },
  23758. addOrUpdateProjectLegacy: {
  23759. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23760. headers: {
  23761. accept: "application/vnd.github.inertia-preview+json"
  23762. },
  23763. method: "PUT",
  23764. params: {
  23765. permission: {
  23766. enum: ["read", "write", "admin"],
  23767. type: "string"
  23768. },
  23769. project_id: {
  23770. required: true,
  23771. type: "integer"
  23772. },
  23773. team_id: {
  23774. required: true,
  23775. type: "integer"
  23776. }
  23777. },
  23778. url: "/teams/:team_id/projects/:project_id"
  23779. },
  23780. addOrUpdateRepo: {
  23781. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23782. method: "PUT",
  23783. params: {
  23784. owner: {
  23785. required: true,
  23786. type: "string"
  23787. },
  23788. permission: {
  23789. enum: ["pull", "push", "admin"],
  23790. type: "string"
  23791. },
  23792. repo: {
  23793. required: true,
  23794. type: "string"
  23795. },
  23796. team_id: {
  23797. required: true,
  23798. type: "integer"
  23799. }
  23800. },
  23801. url: "/teams/:team_id/repos/:owner/:repo"
  23802. },
  23803. addOrUpdateRepoInOrg: {
  23804. method: "PUT",
  23805. params: {
  23806. org: {
  23807. required: true,
  23808. type: "string"
  23809. },
  23810. owner: {
  23811. required: true,
  23812. type: "string"
  23813. },
  23814. permission: {
  23815. enum: ["pull", "push", "admin"],
  23816. type: "string"
  23817. },
  23818. repo: {
  23819. required: true,
  23820. type: "string"
  23821. },
  23822. team_slug: {
  23823. required: true,
  23824. type: "string"
  23825. }
  23826. },
  23827. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23828. },
  23829. addOrUpdateRepoLegacy: {
  23830. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23831. method: "PUT",
  23832. params: {
  23833. owner: {
  23834. required: true,
  23835. type: "string"
  23836. },
  23837. permission: {
  23838. enum: ["pull", "push", "admin"],
  23839. type: "string"
  23840. },
  23841. repo: {
  23842. required: true,
  23843. type: "string"
  23844. },
  23845. team_id: {
  23846. required: true,
  23847. type: "integer"
  23848. }
  23849. },
  23850. url: "/teams/:team_id/repos/:owner/:repo"
  23851. },
  23852. checkManagesRepo: {
  23853. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23854. method: "GET",
  23855. params: {
  23856. owner: {
  23857. required: true,
  23858. type: "string"
  23859. },
  23860. repo: {
  23861. required: true,
  23862. type: "string"
  23863. },
  23864. team_id: {
  23865. required: true,
  23866. type: "integer"
  23867. }
  23868. },
  23869. url: "/teams/:team_id/repos/:owner/:repo"
  23870. },
  23871. checkManagesRepoInOrg: {
  23872. method: "GET",
  23873. params: {
  23874. org: {
  23875. required: true,
  23876. type: "string"
  23877. },
  23878. owner: {
  23879. required: true,
  23880. type: "string"
  23881. },
  23882. repo: {
  23883. required: true,
  23884. type: "string"
  23885. },
  23886. team_slug: {
  23887. required: true,
  23888. type: "string"
  23889. }
  23890. },
  23891. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23892. },
  23893. checkManagesRepoLegacy: {
  23894. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23895. method: "GET",
  23896. params: {
  23897. owner: {
  23898. required: true,
  23899. type: "string"
  23900. },
  23901. repo: {
  23902. required: true,
  23903. type: "string"
  23904. },
  23905. team_id: {
  23906. required: true,
  23907. type: "integer"
  23908. }
  23909. },
  23910. url: "/teams/:team_id/repos/:owner/:repo"
  23911. },
  23912. create: {
  23913. method: "POST",
  23914. params: {
  23915. description: {
  23916. type: "string"
  23917. },
  23918. maintainers: {
  23919. type: "string[]"
  23920. },
  23921. name: {
  23922. required: true,
  23923. type: "string"
  23924. },
  23925. org: {
  23926. required: true,
  23927. type: "string"
  23928. },
  23929. parent_team_id: {
  23930. type: "integer"
  23931. },
  23932. permission: {
  23933. enum: ["pull", "push", "admin"],
  23934. type: "string"
  23935. },
  23936. privacy: {
  23937. enum: ["secret", "closed"],
  23938. type: "string"
  23939. },
  23940. repo_names: {
  23941. type: "string[]"
  23942. }
  23943. },
  23944. url: "/orgs/:org/teams"
  23945. },
  23946. createDiscussion: {
  23947. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23948. method: "POST",
  23949. params: {
  23950. body: {
  23951. required: true,
  23952. type: "string"
  23953. },
  23954. private: {
  23955. type: "boolean"
  23956. },
  23957. team_id: {
  23958. required: true,
  23959. type: "integer"
  23960. },
  23961. title: {
  23962. required: true,
  23963. type: "string"
  23964. }
  23965. },
  23966. url: "/teams/:team_id/discussions"
  23967. },
  23968. createDiscussionComment: {
  23969. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  23970. method: "POST",
  23971. params: {
  23972. body: {
  23973. required: true,
  23974. type: "string"
  23975. },
  23976. discussion_number: {
  23977. required: true,
  23978. type: "integer"
  23979. },
  23980. team_id: {
  23981. required: true,
  23982. type: "integer"
  23983. }
  23984. },
  23985. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23986. },
  23987. createDiscussionCommentInOrg: {
  23988. method: "POST",
  23989. params: {
  23990. body: {
  23991. required: true,
  23992. type: "string"
  23993. },
  23994. discussion_number: {
  23995. required: true,
  23996. type: "integer"
  23997. },
  23998. org: {
  23999. required: true,
  24000. type: "string"
  24001. },
  24002. team_slug: {
  24003. required: true,
  24004. type: "string"
  24005. }
  24006. },
  24007. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24008. },
  24009. createDiscussionCommentLegacy: {
  24010. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24011. method: "POST",
  24012. params: {
  24013. body: {
  24014. required: true,
  24015. type: "string"
  24016. },
  24017. discussion_number: {
  24018. required: true,
  24019. type: "integer"
  24020. },
  24021. team_id: {
  24022. required: true,
  24023. type: "integer"
  24024. }
  24025. },
  24026. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24027. },
  24028. createDiscussionInOrg: {
  24029. method: "POST",
  24030. params: {
  24031. body: {
  24032. required: true,
  24033. type: "string"
  24034. },
  24035. org: {
  24036. required: true,
  24037. type: "string"
  24038. },
  24039. private: {
  24040. type: "boolean"
  24041. },
  24042. team_slug: {
  24043. required: true,
  24044. type: "string"
  24045. },
  24046. title: {
  24047. required: true,
  24048. type: "string"
  24049. }
  24050. },
  24051. url: "/orgs/:org/teams/:team_slug/discussions"
  24052. },
  24053. createDiscussionLegacy: {
  24054. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24055. method: "POST",
  24056. params: {
  24057. body: {
  24058. required: true,
  24059. type: "string"
  24060. },
  24061. private: {
  24062. type: "boolean"
  24063. },
  24064. team_id: {
  24065. required: true,
  24066. type: "integer"
  24067. },
  24068. title: {
  24069. required: true,
  24070. type: "string"
  24071. }
  24072. },
  24073. url: "/teams/:team_id/discussions"
  24074. },
  24075. delete: {
  24076. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24077. method: "DELETE",
  24078. params: {
  24079. team_id: {
  24080. required: true,
  24081. type: "integer"
  24082. }
  24083. },
  24084. url: "/teams/:team_id"
  24085. },
  24086. deleteDiscussion: {
  24087. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24088. method: "DELETE",
  24089. params: {
  24090. discussion_number: {
  24091. required: true,
  24092. type: "integer"
  24093. },
  24094. team_id: {
  24095. required: true,
  24096. type: "integer"
  24097. }
  24098. },
  24099. url: "/teams/:team_id/discussions/:discussion_number"
  24100. },
  24101. deleteDiscussionComment: {
  24102. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24103. method: "DELETE",
  24104. params: {
  24105. comment_number: {
  24106. required: true,
  24107. type: "integer"
  24108. },
  24109. discussion_number: {
  24110. required: true,
  24111. type: "integer"
  24112. },
  24113. team_id: {
  24114. required: true,
  24115. type: "integer"
  24116. }
  24117. },
  24118. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24119. },
  24120. deleteDiscussionCommentInOrg: {
  24121. method: "DELETE",
  24122. params: {
  24123. comment_number: {
  24124. required: true,
  24125. type: "integer"
  24126. },
  24127. discussion_number: {
  24128. required: true,
  24129. type: "integer"
  24130. },
  24131. org: {
  24132. required: true,
  24133. type: "string"
  24134. },
  24135. team_slug: {
  24136. required: true,
  24137. type: "string"
  24138. }
  24139. },
  24140. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24141. },
  24142. deleteDiscussionCommentLegacy: {
  24143. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24144. method: "DELETE",
  24145. params: {
  24146. comment_number: {
  24147. required: true,
  24148. type: "integer"
  24149. },
  24150. discussion_number: {
  24151. required: true,
  24152. type: "integer"
  24153. },
  24154. team_id: {
  24155. required: true,
  24156. type: "integer"
  24157. }
  24158. },
  24159. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24160. },
  24161. deleteDiscussionInOrg: {
  24162. method: "DELETE",
  24163. params: {
  24164. discussion_number: {
  24165. required: true,
  24166. type: "integer"
  24167. },
  24168. org: {
  24169. required: true,
  24170. type: "string"
  24171. },
  24172. team_slug: {
  24173. required: true,
  24174. type: "string"
  24175. }
  24176. },
  24177. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24178. },
  24179. deleteDiscussionLegacy: {
  24180. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24181. method: "DELETE",
  24182. params: {
  24183. discussion_number: {
  24184. required: true,
  24185. type: "integer"
  24186. },
  24187. team_id: {
  24188. required: true,
  24189. type: "integer"
  24190. }
  24191. },
  24192. url: "/teams/:team_id/discussions/:discussion_number"
  24193. },
  24194. deleteInOrg: {
  24195. method: "DELETE",
  24196. params: {
  24197. org: {
  24198. required: true,
  24199. type: "string"
  24200. },
  24201. team_slug: {
  24202. required: true,
  24203. type: "string"
  24204. }
  24205. },
  24206. url: "/orgs/:org/teams/:team_slug"
  24207. },
  24208. deleteLegacy: {
  24209. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24210. method: "DELETE",
  24211. params: {
  24212. team_id: {
  24213. required: true,
  24214. type: "integer"
  24215. }
  24216. },
  24217. url: "/teams/:team_id"
  24218. },
  24219. get: {
  24220. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24221. method: "GET",
  24222. params: {
  24223. team_id: {
  24224. required: true,
  24225. type: "integer"
  24226. }
  24227. },
  24228. url: "/teams/:team_id"
  24229. },
  24230. getByName: {
  24231. method: "GET",
  24232. params: {
  24233. org: {
  24234. required: true,
  24235. type: "string"
  24236. },
  24237. team_slug: {
  24238. required: true,
  24239. type: "string"
  24240. }
  24241. },
  24242. url: "/orgs/:org/teams/:team_slug"
  24243. },
  24244. getDiscussion: {
  24245. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24246. method: "GET",
  24247. params: {
  24248. discussion_number: {
  24249. required: true,
  24250. type: "integer"
  24251. },
  24252. team_id: {
  24253. required: true,
  24254. type: "integer"
  24255. }
  24256. },
  24257. url: "/teams/:team_id/discussions/:discussion_number"
  24258. },
  24259. getDiscussionComment: {
  24260. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24261. method: "GET",
  24262. params: {
  24263. comment_number: {
  24264. required: true,
  24265. type: "integer"
  24266. },
  24267. discussion_number: {
  24268. required: true,
  24269. type: "integer"
  24270. },
  24271. team_id: {
  24272. required: true,
  24273. type: "integer"
  24274. }
  24275. },
  24276. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24277. },
  24278. getDiscussionCommentInOrg: {
  24279. method: "GET",
  24280. params: {
  24281. comment_number: {
  24282. required: true,
  24283. type: "integer"
  24284. },
  24285. discussion_number: {
  24286. required: true,
  24287. type: "integer"
  24288. },
  24289. org: {
  24290. required: true,
  24291. type: "string"
  24292. },
  24293. team_slug: {
  24294. required: true,
  24295. type: "string"
  24296. }
  24297. },
  24298. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24299. },
  24300. getDiscussionCommentLegacy: {
  24301. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24302. method: "GET",
  24303. params: {
  24304. comment_number: {
  24305. required: true,
  24306. type: "integer"
  24307. },
  24308. discussion_number: {
  24309. required: true,
  24310. type: "integer"
  24311. },
  24312. team_id: {
  24313. required: true,
  24314. type: "integer"
  24315. }
  24316. },
  24317. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24318. },
  24319. getDiscussionInOrg: {
  24320. method: "GET",
  24321. params: {
  24322. discussion_number: {
  24323. required: true,
  24324. type: "integer"
  24325. },
  24326. org: {
  24327. required: true,
  24328. type: "string"
  24329. },
  24330. team_slug: {
  24331. required: true,
  24332. type: "string"
  24333. }
  24334. },
  24335. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24336. },
  24337. getDiscussionLegacy: {
  24338. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24339. method: "GET",
  24340. params: {
  24341. discussion_number: {
  24342. required: true,
  24343. type: "integer"
  24344. },
  24345. team_id: {
  24346. required: true,
  24347. type: "integer"
  24348. }
  24349. },
  24350. url: "/teams/:team_id/discussions/:discussion_number"
  24351. },
  24352. getLegacy: {
  24353. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24354. method: "GET",
  24355. params: {
  24356. team_id: {
  24357. required: true,
  24358. type: "integer"
  24359. }
  24360. },
  24361. url: "/teams/:team_id"
  24362. },
  24363. getMember: {
  24364. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24365. method: "GET",
  24366. params: {
  24367. team_id: {
  24368. required: true,
  24369. type: "integer"
  24370. },
  24371. username: {
  24372. required: true,
  24373. type: "string"
  24374. }
  24375. },
  24376. url: "/teams/:team_id/members/:username"
  24377. },
  24378. getMemberLegacy: {
  24379. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24380. method: "GET",
  24381. params: {
  24382. team_id: {
  24383. required: true,
  24384. type: "integer"
  24385. },
  24386. username: {
  24387. required: true,
  24388. type: "string"
  24389. }
  24390. },
  24391. url: "/teams/:team_id/members/:username"
  24392. },
  24393. getMembership: {
  24394. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24395. method: "GET",
  24396. params: {
  24397. team_id: {
  24398. required: true,
  24399. type: "integer"
  24400. },
  24401. username: {
  24402. required: true,
  24403. type: "string"
  24404. }
  24405. },
  24406. url: "/teams/:team_id/memberships/:username"
  24407. },
  24408. getMembershipInOrg: {
  24409. method: "GET",
  24410. params: {
  24411. org: {
  24412. required: true,
  24413. type: "string"
  24414. },
  24415. team_slug: {
  24416. required: true,
  24417. type: "string"
  24418. },
  24419. username: {
  24420. required: true,
  24421. type: "string"
  24422. }
  24423. },
  24424. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24425. },
  24426. getMembershipLegacy: {
  24427. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24428. method: "GET",
  24429. params: {
  24430. team_id: {
  24431. required: true,
  24432. type: "integer"
  24433. },
  24434. username: {
  24435. required: true,
  24436. type: "string"
  24437. }
  24438. },
  24439. url: "/teams/:team_id/memberships/:username"
  24440. },
  24441. list: {
  24442. method: "GET",
  24443. params: {
  24444. org: {
  24445. required: true,
  24446. type: "string"
  24447. },
  24448. page: {
  24449. type: "integer"
  24450. },
  24451. per_page: {
  24452. type: "integer"
  24453. }
  24454. },
  24455. url: "/orgs/:org/teams"
  24456. },
  24457. listChild: {
  24458. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24459. method: "GET",
  24460. params: {
  24461. page: {
  24462. type: "integer"
  24463. },
  24464. per_page: {
  24465. type: "integer"
  24466. },
  24467. team_id: {
  24468. required: true,
  24469. type: "integer"
  24470. }
  24471. },
  24472. url: "/teams/:team_id/teams"
  24473. },
  24474. listChildInOrg: {
  24475. method: "GET",
  24476. params: {
  24477. org: {
  24478. required: true,
  24479. type: "string"
  24480. },
  24481. page: {
  24482. type: "integer"
  24483. },
  24484. per_page: {
  24485. type: "integer"
  24486. },
  24487. team_slug: {
  24488. required: true,
  24489. type: "string"
  24490. }
  24491. },
  24492. url: "/orgs/:org/teams/:team_slug/teams"
  24493. },
  24494. listChildLegacy: {
  24495. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24496. method: "GET",
  24497. params: {
  24498. page: {
  24499. type: "integer"
  24500. },
  24501. per_page: {
  24502. type: "integer"
  24503. },
  24504. team_id: {
  24505. required: true,
  24506. type: "integer"
  24507. }
  24508. },
  24509. url: "/teams/:team_id/teams"
  24510. },
  24511. listDiscussionComments: {
  24512. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24513. method: "GET",
  24514. params: {
  24515. direction: {
  24516. enum: ["asc", "desc"],
  24517. type: "string"
  24518. },
  24519. discussion_number: {
  24520. required: true,
  24521. type: "integer"
  24522. },
  24523. page: {
  24524. type: "integer"
  24525. },
  24526. per_page: {
  24527. type: "integer"
  24528. },
  24529. team_id: {
  24530. required: true,
  24531. type: "integer"
  24532. }
  24533. },
  24534. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24535. },
  24536. listDiscussionCommentsInOrg: {
  24537. method: "GET",
  24538. params: {
  24539. direction: {
  24540. enum: ["asc", "desc"],
  24541. type: "string"
  24542. },
  24543. discussion_number: {
  24544. required: true,
  24545. type: "integer"
  24546. },
  24547. org: {
  24548. required: true,
  24549. type: "string"
  24550. },
  24551. page: {
  24552. type: "integer"
  24553. },
  24554. per_page: {
  24555. type: "integer"
  24556. },
  24557. team_slug: {
  24558. required: true,
  24559. type: "string"
  24560. }
  24561. },
  24562. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24563. },
  24564. listDiscussionCommentsLegacy: {
  24565. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24566. method: "GET",
  24567. params: {
  24568. direction: {
  24569. enum: ["asc", "desc"],
  24570. type: "string"
  24571. },
  24572. discussion_number: {
  24573. required: true,
  24574. type: "integer"
  24575. },
  24576. page: {
  24577. type: "integer"
  24578. },
  24579. per_page: {
  24580. type: "integer"
  24581. },
  24582. team_id: {
  24583. required: true,
  24584. type: "integer"
  24585. }
  24586. },
  24587. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24588. },
  24589. listDiscussions: {
  24590. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24591. method: "GET",
  24592. params: {
  24593. direction: {
  24594. enum: ["asc", "desc"],
  24595. type: "string"
  24596. },
  24597. page: {
  24598. type: "integer"
  24599. },
  24600. per_page: {
  24601. type: "integer"
  24602. },
  24603. team_id: {
  24604. required: true,
  24605. type: "integer"
  24606. }
  24607. },
  24608. url: "/teams/:team_id/discussions"
  24609. },
  24610. listDiscussionsInOrg: {
  24611. method: "GET",
  24612. params: {
  24613. direction: {
  24614. enum: ["asc", "desc"],
  24615. type: "string"
  24616. },
  24617. org: {
  24618. required: true,
  24619. type: "string"
  24620. },
  24621. page: {
  24622. type: "integer"
  24623. },
  24624. per_page: {
  24625. type: "integer"
  24626. },
  24627. team_slug: {
  24628. required: true,
  24629. type: "string"
  24630. }
  24631. },
  24632. url: "/orgs/:org/teams/:team_slug/discussions"
  24633. },
  24634. listDiscussionsLegacy: {
  24635. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24636. method: "GET",
  24637. params: {
  24638. direction: {
  24639. enum: ["asc", "desc"],
  24640. type: "string"
  24641. },
  24642. page: {
  24643. type: "integer"
  24644. },
  24645. per_page: {
  24646. type: "integer"
  24647. },
  24648. team_id: {
  24649. required: true,
  24650. type: "integer"
  24651. }
  24652. },
  24653. url: "/teams/:team_id/discussions"
  24654. },
  24655. listForAuthenticatedUser: {
  24656. method: "GET",
  24657. params: {
  24658. page: {
  24659. type: "integer"
  24660. },
  24661. per_page: {
  24662. type: "integer"
  24663. }
  24664. },
  24665. url: "/user/teams"
  24666. },
  24667. listMembers: {
  24668. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24669. method: "GET",
  24670. params: {
  24671. page: {
  24672. type: "integer"
  24673. },
  24674. per_page: {
  24675. type: "integer"
  24676. },
  24677. role: {
  24678. enum: ["member", "maintainer", "all"],
  24679. type: "string"
  24680. },
  24681. team_id: {
  24682. required: true,
  24683. type: "integer"
  24684. }
  24685. },
  24686. url: "/teams/:team_id/members"
  24687. },
  24688. listMembersInOrg: {
  24689. method: "GET",
  24690. params: {
  24691. org: {
  24692. required: true,
  24693. type: "string"
  24694. },
  24695. page: {
  24696. type: "integer"
  24697. },
  24698. per_page: {
  24699. type: "integer"
  24700. },
  24701. role: {
  24702. enum: ["member", "maintainer", "all"],
  24703. type: "string"
  24704. },
  24705. team_slug: {
  24706. required: true,
  24707. type: "string"
  24708. }
  24709. },
  24710. url: "/orgs/:org/teams/:team_slug/members"
  24711. },
  24712. listMembersLegacy: {
  24713. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24714. method: "GET",
  24715. params: {
  24716. page: {
  24717. type: "integer"
  24718. },
  24719. per_page: {
  24720. type: "integer"
  24721. },
  24722. role: {
  24723. enum: ["member", "maintainer", "all"],
  24724. type: "string"
  24725. },
  24726. team_id: {
  24727. required: true,
  24728. type: "integer"
  24729. }
  24730. },
  24731. url: "/teams/:team_id/members"
  24732. },
  24733. listPendingInvitations: {
  24734. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24735. method: "GET",
  24736. params: {
  24737. page: {
  24738. type: "integer"
  24739. },
  24740. per_page: {
  24741. type: "integer"
  24742. },
  24743. team_id: {
  24744. required: true,
  24745. type: "integer"
  24746. }
  24747. },
  24748. url: "/teams/:team_id/invitations"
  24749. },
  24750. listPendingInvitationsInOrg: {
  24751. method: "GET",
  24752. params: {
  24753. org: {
  24754. required: true,
  24755. type: "string"
  24756. },
  24757. page: {
  24758. type: "integer"
  24759. },
  24760. per_page: {
  24761. type: "integer"
  24762. },
  24763. team_slug: {
  24764. required: true,
  24765. type: "string"
  24766. }
  24767. },
  24768. url: "/orgs/:org/teams/:team_slug/invitations"
  24769. },
  24770. listPendingInvitationsLegacy: {
  24771. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24772. method: "GET",
  24773. params: {
  24774. page: {
  24775. type: "integer"
  24776. },
  24777. per_page: {
  24778. type: "integer"
  24779. },
  24780. team_id: {
  24781. required: true,
  24782. type: "integer"
  24783. }
  24784. },
  24785. url: "/teams/:team_id/invitations"
  24786. },
  24787. listProjects: {
  24788. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24789. headers: {
  24790. accept: "application/vnd.github.inertia-preview+json"
  24791. },
  24792. method: "GET",
  24793. params: {
  24794. page: {
  24795. type: "integer"
  24796. },
  24797. per_page: {
  24798. type: "integer"
  24799. },
  24800. team_id: {
  24801. required: true,
  24802. type: "integer"
  24803. }
  24804. },
  24805. url: "/teams/:team_id/projects"
  24806. },
  24807. listProjectsInOrg: {
  24808. headers: {
  24809. accept: "application/vnd.github.inertia-preview+json"
  24810. },
  24811. method: "GET",
  24812. params: {
  24813. org: {
  24814. required: true,
  24815. type: "string"
  24816. },
  24817. page: {
  24818. type: "integer"
  24819. },
  24820. per_page: {
  24821. type: "integer"
  24822. },
  24823. team_slug: {
  24824. required: true,
  24825. type: "string"
  24826. }
  24827. },
  24828. url: "/orgs/:org/teams/:team_slug/projects"
  24829. },
  24830. listProjectsLegacy: {
  24831. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24832. headers: {
  24833. accept: "application/vnd.github.inertia-preview+json"
  24834. },
  24835. method: "GET",
  24836. params: {
  24837. page: {
  24838. type: "integer"
  24839. },
  24840. per_page: {
  24841. type: "integer"
  24842. },
  24843. team_id: {
  24844. required: true,
  24845. type: "integer"
  24846. }
  24847. },
  24848. url: "/teams/:team_id/projects"
  24849. },
  24850. listRepos: {
  24851. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24852. method: "GET",
  24853. params: {
  24854. page: {
  24855. type: "integer"
  24856. },
  24857. per_page: {
  24858. type: "integer"
  24859. },
  24860. team_id: {
  24861. required: true,
  24862. type: "integer"
  24863. }
  24864. },
  24865. url: "/teams/:team_id/repos"
  24866. },
  24867. listReposInOrg: {
  24868. method: "GET",
  24869. params: {
  24870. org: {
  24871. required: true,
  24872. type: "string"
  24873. },
  24874. page: {
  24875. type: "integer"
  24876. },
  24877. per_page: {
  24878. type: "integer"
  24879. },
  24880. team_slug: {
  24881. required: true,
  24882. type: "string"
  24883. }
  24884. },
  24885. url: "/orgs/:org/teams/:team_slug/repos"
  24886. },
  24887. listReposLegacy: {
  24888. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24889. method: "GET",
  24890. params: {
  24891. page: {
  24892. type: "integer"
  24893. },
  24894. per_page: {
  24895. type: "integer"
  24896. },
  24897. team_id: {
  24898. required: true,
  24899. type: "integer"
  24900. }
  24901. },
  24902. url: "/teams/:team_id/repos"
  24903. },
  24904. removeMember: {
  24905. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24906. method: "DELETE",
  24907. params: {
  24908. team_id: {
  24909. required: true,
  24910. type: "integer"
  24911. },
  24912. username: {
  24913. required: true,
  24914. type: "string"
  24915. }
  24916. },
  24917. url: "/teams/:team_id/members/:username"
  24918. },
  24919. removeMemberLegacy: {
  24920. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24921. method: "DELETE",
  24922. params: {
  24923. team_id: {
  24924. required: true,
  24925. type: "integer"
  24926. },
  24927. username: {
  24928. required: true,
  24929. type: "string"
  24930. }
  24931. },
  24932. url: "/teams/:team_id/members/:username"
  24933. },
  24934. removeMembership: {
  24935. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24936. method: "DELETE",
  24937. params: {
  24938. team_id: {
  24939. required: true,
  24940. type: "integer"
  24941. },
  24942. username: {
  24943. required: true,
  24944. type: "string"
  24945. }
  24946. },
  24947. url: "/teams/:team_id/memberships/:username"
  24948. },
  24949. removeMembershipInOrg: {
  24950. method: "DELETE",
  24951. params: {
  24952. org: {
  24953. required: true,
  24954. type: "string"
  24955. },
  24956. team_slug: {
  24957. required: true,
  24958. type: "string"
  24959. },
  24960. username: {
  24961. required: true,
  24962. type: "string"
  24963. }
  24964. },
  24965. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24966. },
  24967. removeMembershipLegacy: {
  24968. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  24969. method: "DELETE",
  24970. params: {
  24971. team_id: {
  24972. required: true,
  24973. type: "integer"
  24974. },
  24975. username: {
  24976. required: true,
  24977. type: "string"
  24978. }
  24979. },
  24980. url: "/teams/:team_id/memberships/:username"
  24981. },
  24982. removeProject: {
  24983. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  24984. method: "DELETE",
  24985. params: {
  24986. project_id: {
  24987. required: true,
  24988. type: "integer"
  24989. },
  24990. team_id: {
  24991. required: true,
  24992. type: "integer"
  24993. }
  24994. },
  24995. url: "/teams/:team_id/projects/:project_id"
  24996. },
  24997. removeProjectInOrg: {
  24998. method: "DELETE",
  24999. params: {
  25000. org: {
  25001. required: true,
  25002. type: "string"
  25003. },
  25004. project_id: {
  25005. required: true,
  25006. type: "integer"
  25007. },
  25008. team_slug: {
  25009. required: true,
  25010. type: "string"
  25011. }
  25012. },
  25013. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25014. },
  25015. removeProjectLegacy: {
  25016. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25017. method: "DELETE",
  25018. params: {
  25019. project_id: {
  25020. required: true,
  25021. type: "integer"
  25022. },
  25023. team_id: {
  25024. required: true,
  25025. type: "integer"
  25026. }
  25027. },
  25028. url: "/teams/:team_id/projects/:project_id"
  25029. },
  25030. removeRepo: {
  25031. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25032. method: "DELETE",
  25033. params: {
  25034. owner: {
  25035. required: true,
  25036. type: "string"
  25037. },
  25038. repo: {
  25039. required: true,
  25040. type: "string"
  25041. },
  25042. team_id: {
  25043. required: true,
  25044. type: "integer"
  25045. }
  25046. },
  25047. url: "/teams/:team_id/repos/:owner/:repo"
  25048. },
  25049. removeRepoInOrg: {
  25050. method: "DELETE",
  25051. params: {
  25052. org: {
  25053. required: true,
  25054. type: "string"
  25055. },
  25056. owner: {
  25057. required: true,
  25058. type: "string"
  25059. },
  25060. repo: {
  25061. required: true,
  25062. type: "string"
  25063. },
  25064. team_slug: {
  25065. required: true,
  25066. type: "string"
  25067. }
  25068. },
  25069. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25070. },
  25071. removeRepoLegacy: {
  25072. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25073. method: "DELETE",
  25074. params: {
  25075. owner: {
  25076. required: true,
  25077. type: "string"
  25078. },
  25079. repo: {
  25080. required: true,
  25081. type: "string"
  25082. },
  25083. team_id: {
  25084. required: true,
  25085. type: "integer"
  25086. }
  25087. },
  25088. url: "/teams/:team_id/repos/:owner/:repo"
  25089. },
  25090. reviewProject: {
  25091. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25092. headers: {
  25093. accept: "application/vnd.github.inertia-preview+json"
  25094. },
  25095. method: "GET",
  25096. params: {
  25097. project_id: {
  25098. required: true,
  25099. type: "integer"
  25100. },
  25101. team_id: {
  25102. required: true,
  25103. type: "integer"
  25104. }
  25105. },
  25106. url: "/teams/:team_id/projects/:project_id"
  25107. },
  25108. reviewProjectInOrg: {
  25109. headers: {
  25110. accept: "application/vnd.github.inertia-preview+json"
  25111. },
  25112. method: "GET",
  25113. params: {
  25114. org: {
  25115. required: true,
  25116. type: "string"
  25117. },
  25118. project_id: {
  25119. required: true,
  25120. type: "integer"
  25121. },
  25122. team_slug: {
  25123. required: true,
  25124. type: "string"
  25125. }
  25126. },
  25127. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25128. },
  25129. reviewProjectLegacy: {
  25130. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25131. headers: {
  25132. accept: "application/vnd.github.inertia-preview+json"
  25133. },
  25134. method: "GET",
  25135. params: {
  25136. project_id: {
  25137. required: true,
  25138. type: "integer"
  25139. },
  25140. team_id: {
  25141. required: true,
  25142. type: "integer"
  25143. }
  25144. },
  25145. url: "/teams/:team_id/projects/:project_id"
  25146. },
  25147. update: {
  25148. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25149. method: "PATCH",
  25150. params: {
  25151. description: {
  25152. type: "string"
  25153. },
  25154. name: {
  25155. required: true,
  25156. type: "string"
  25157. },
  25158. parent_team_id: {
  25159. type: "integer"
  25160. },
  25161. permission: {
  25162. enum: ["pull", "push", "admin"],
  25163. type: "string"
  25164. },
  25165. privacy: {
  25166. enum: ["secret", "closed"],
  25167. type: "string"
  25168. },
  25169. team_id: {
  25170. required: true,
  25171. type: "integer"
  25172. }
  25173. },
  25174. url: "/teams/:team_id"
  25175. },
  25176. updateDiscussion: {
  25177. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25178. method: "PATCH",
  25179. params: {
  25180. body: {
  25181. type: "string"
  25182. },
  25183. discussion_number: {
  25184. required: true,
  25185. type: "integer"
  25186. },
  25187. team_id: {
  25188. required: true,
  25189. type: "integer"
  25190. },
  25191. title: {
  25192. type: "string"
  25193. }
  25194. },
  25195. url: "/teams/:team_id/discussions/:discussion_number"
  25196. },
  25197. updateDiscussionComment: {
  25198. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25199. method: "PATCH",
  25200. params: {
  25201. body: {
  25202. required: true,
  25203. type: "string"
  25204. },
  25205. comment_number: {
  25206. required: true,
  25207. type: "integer"
  25208. },
  25209. discussion_number: {
  25210. required: true,
  25211. type: "integer"
  25212. },
  25213. team_id: {
  25214. required: true,
  25215. type: "integer"
  25216. }
  25217. },
  25218. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25219. },
  25220. updateDiscussionCommentInOrg: {
  25221. method: "PATCH",
  25222. params: {
  25223. body: {
  25224. required: true,
  25225. type: "string"
  25226. },
  25227. comment_number: {
  25228. required: true,
  25229. type: "integer"
  25230. },
  25231. discussion_number: {
  25232. required: true,
  25233. type: "integer"
  25234. },
  25235. org: {
  25236. required: true,
  25237. type: "string"
  25238. },
  25239. team_slug: {
  25240. required: true,
  25241. type: "string"
  25242. }
  25243. },
  25244. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25245. },
  25246. updateDiscussionCommentLegacy: {
  25247. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25248. method: "PATCH",
  25249. params: {
  25250. body: {
  25251. required: true,
  25252. type: "string"
  25253. },
  25254. comment_number: {
  25255. required: true,
  25256. type: "integer"
  25257. },
  25258. discussion_number: {
  25259. required: true,
  25260. type: "integer"
  25261. },
  25262. team_id: {
  25263. required: true,
  25264. type: "integer"
  25265. }
  25266. },
  25267. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25268. },
  25269. updateDiscussionInOrg: {
  25270. method: "PATCH",
  25271. params: {
  25272. body: {
  25273. type: "string"
  25274. },
  25275. discussion_number: {
  25276. required: true,
  25277. type: "integer"
  25278. },
  25279. org: {
  25280. required: true,
  25281. type: "string"
  25282. },
  25283. team_slug: {
  25284. required: true,
  25285. type: "string"
  25286. },
  25287. title: {
  25288. type: "string"
  25289. }
  25290. },
  25291. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25292. },
  25293. updateDiscussionLegacy: {
  25294. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25295. method: "PATCH",
  25296. params: {
  25297. body: {
  25298. type: "string"
  25299. },
  25300. discussion_number: {
  25301. required: true,
  25302. type: "integer"
  25303. },
  25304. team_id: {
  25305. required: true,
  25306. type: "integer"
  25307. },
  25308. title: {
  25309. type: "string"
  25310. }
  25311. },
  25312. url: "/teams/:team_id/discussions/:discussion_number"
  25313. },
  25314. updateInOrg: {
  25315. method: "PATCH",
  25316. params: {
  25317. description: {
  25318. type: "string"
  25319. },
  25320. name: {
  25321. required: true,
  25322. type: "string"
  25323. },
  25324. org: {
  25325. required: true,
  25326. type: "string"
  25327. },
  25328. parent_team_id: {
  25329. type: "integer"
  25330. },
  25331. permission: {
  25332. enum: ["pull", "push", "admin"],
  25333. type: "string"
  25334. },
  25335. privacy: {
  25336. enum: ["secret", "closed"],
  25337. type: "string"
  25338. },
  25339. team_slug: {
  25340. required: true,
  25341. type: "string"
  25342. }
  25343. },
  25344. url: "/orgs/:org/teams/:team_slug"
  25345. },
  25346. updateLegacy: {
  25347. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25348. method: "PATCH",
  25349. params: {
  25350. description: {
  25351. type: "string"
  25352. },
  25353. name: {
  25354. required: true,
  25355. type: "string"
  25356. },
  25357. parent_team_id: {
  25358. type: "integer"
  25359. },
  25360. permission: {
  25361. enum: ["pull", "push", "admin"],
  25362. type: "string"
  25363. },
  25364. privacy: {
  25365. enum: ["secret", "closed"],
  25366. type: "string"
  25367. },
  25368. team_id: {
  25369. required: true,
  25370. type: "integer"
  25371. }
  25372. },
  25373. url: "/teams/:team_id"
  25374. }
  25375. },
  25376. users: {
  25377. addEmails: {
  25378. method: "POST",
  25379. params: {
  25380. emails: {
  25381. required: true,
  25382. type: "string[]"
  25383. }
  25384. },
  25385. url: "/user/emails"
  25386. },
  25387. block: {
  25388. method: "PUT",
  25389. params: {
  25390. username: {
  25391. required: true,
  25392. type: "string"
  25393. }
  25394. },
  25395. url: "/user/blocks/:username"
  25396. },
  25397. checkBlocked: {
  25398. method: "GET",
  25399. params: {
  25400. username: {
  25401. required: true,
  25402. type: "string"
  25403. }
  25404. },
  25405. url: "/user/blocks/:username"
  25406. },
  25407. checkFollowing: {
  25408. method: "GET",
  25409. params: {
  25410. username: {
  25411. required: true,
  25412. type: "string"
  25413. }
  25414. },
  25415. url: "/user/following/:username"
  25416. },
  25417. checkFollowingForUser: {
  25418. method: "GET",
  25419. params: {
  25420. target_user: {
  25421. required: true,
  25422. type: "string"
  25423. },
  25424. username: {
  25425. required: true,
  25426. type: "string"
  25427. }
  25428. },
  25429. url: "/users/:username/following/:target_user"
  25430. },
  25431. createGpgKey: {
  25432. method: "POST",
  25433. params: {
  25434. armored_public_key: {
  25435. type: "string"
  25436. }
  25437. },
  25438. url: "/user/gpg_keys"
  25439. },
  25440. createPublicKey: {
  25441. method: "POST",
  25442. params: {
  25443. key: {
  25444. type: "string"
  25445. },
  25446. title: {
  25447. type: "string"
  25448. }
  25449. },
  25450. url: "/user/keys"
  25451. },
  25452. deleteEmails: {
  25453. method: "DELETE",
  25454. params: {
  25455. emails: {
  25456. required: true,
  25457. type: "string[]"
  25458. }
  25459. },
  25460. url: "/user/emails"
  25461. },
  25462. deleteGpgKey: {
  25463. method: "DELETE",
  25464. params: {
  25465. gpg_key_id: {
  25466. required: true,
  25467. type: "integer"
  25468. }
  25469. },
  25470. url: "/user/gpg_keys/:gpg_key_id"
  25471. },
  25472. deletePublicKey: {
  25473. method: "DELETE",
  25474. params: {
  25475. key_id: {
  25476. required: true,
  25477. type: "integer"
  25478. }
  25479. },
  25480. url: "/user/keys/:key_id"
  25481. },
  25482. follow: {
  25483. method: "PUT",
  25484. params: {
  25485. username: {
  25486. required: true,
  25487. type: "string"
  25488. }
  25489. },
  25490. url: "/user/following/:username"
  25491. },
  25492. getAuthenticated: {
  25493. method: "GET",
  25494. params: {},
  25495. url: "/user"
  25496. },
  25497. getByUsername: {
  25498. method: "GET",
  25499. params: {
  25500. username: {
  25501. required: true,
  25502. type: "string"
  25503. }
  25504. },
  25505. url: "/users/:username"
  25506. },
  25507. getContextForUser: {
  25508. method: "GET",
  25509. params: {
  25510. subject_id: {
  25511. type: "string"
  25512. },
  25513. subject_type: {
  25514. enum: ["organization", "repository", "issue", "pull_request"],
  25515. type: "string"
  25516. },
  25517. username: {
  25518. required: true,
  25519. type: "string"
  25520. }
  25521. },
  25522. url: "/users/:username/hovercard"
  25523. },
  25524. getGpgKey: {
  25525. method: "GET",
  25526. params: {
  25527. gpg_key_id: {
  25528. required: true,
  25529. type: "integer"
  25530. }
  25531. },
  25532. url: "/user/gpg_keys/:gpg_key_id"
  25533. },
  25534. getPublicKey: {
  25535. method: "GET",
  25536. params: {
  25537. key_id: {
  25538. required: true,
  25539. type: "integer"
  25540. }
  25541. },
  25542. url: "/user/keys/:key_id"
  25543. },
  25544. list: {
  25545. method: "GET",
  25546. params: {
  25547. page: {
  25548. type: "integer"
  25549. },
  25550. per_page: {
  25551. type: "integer"
  25552. },
  25553. since: {
  25554. type: "string"
  25555. }
  25556. },
  25557. url: "/users"
  25558. },
  25559. listBlocked: {
  25560. method: "GET",
  25561. params: {},
  25562. url: "/user/blocks"
  25563. },
  25564. listEmails: {
  25565. method: "GET",
  25566. params: {
  25567. page: {
  25568. type: "integer"
  25569. },
  25570. per_page: {
  25571. type: "integer"
  25572. }
  25573. },
  25574. url: "/user/emails"
  25575. },
  25576. listFollowersForAuthenticatedUser: {
  25577. method: "GET",
  25578. params: {
  25579. page: {
  25580. type: "integer"
  25581. },
  25582. per_page: {
  25583. type: "integer"
  25584. }
  25585. },
  25586. url: "/user/followers"
  25587. },
  25588. listFollowersForUser: {
  25589. method: "GET",
  25590. params: {
  25591. page: {
  25592. type: "integer"
  25593. },
  25594. per_page: {
  25595. type: "integer"
  25596. },
  25597. username: {
  25598. required: true,
  25599. type: "string"
  25600. }
  25601. },
  25602. url: "/users/:username/followers"
  25603. },
  25604. listFollowingForAuthenticatedUser: {
  25605. method: "GET",
  25606. params: {
  25607. page: {
  25608. type: "integer"
  25609. },
  25610. per_page: {
  25611. type: "integer"
  25612. }
  25613. },
  25614. url: "/user/following"
  25615. },
  25616. listFollowingForUser: {
  25617. method: "GET",
  25618. params: {
  25619. page: {
  25620. type: "integer"
  25621. },
  25622. per_page: {
  25623. type: "integer"
  25624. },
  25625. username: {
  25626. required: true,
  25627. type: "string"
  25628. }
  25629. },
  25630. url: "/users/:username/following"
  25631. },
  25632. listGpgKeys: {
  25633. method: "GET",
  25634. params: {
  25635. page: {
  25636. type: "integer"
  25637. },
  25638. per_page: {
  25639. type: "integer"
  25640. }
  25641. },
  25642. url: "/user/gpg_keys"
  25643. },
  25644. listGpgKeysForUser: {
  25645. method: "GET",
  25646. params: {
  25647. page: {
  25648. type: "integer"
  25649. },
  25650. per_page: {
  25651. type: "integer"
  25652. },
  25653. username: {
  25654. required: true,
  25655. type: "string"
  25656. }
  25657. },
  25658. url: "/users/:username/gpg_keys"
  25659. },
  25660. listPublicEmails: {
  25661. method: "GET",
  25662. params: {
  25663. page: {
  25664. type: "integer"
  25665. },
  25666. per_page: {
  25667. type: "integer"
  25668. }
  25669. },
  25670. url: "/user/public_emails"
  25671. },
  25672. listPublicKeys: {
  25673. method: "GET",
  25674. params: {
  25675. page: {
  25676. type: "integer"
  25677. },
  25678. per_page: {
  25679. type: "integer"
  25680. }
  25681. },
  25682. url: "/user/keys"
  25683. },
  25684. listPublicKeysForUser: {
  25685. method: "GET",
  25686. params: {
  25687. page: {
  25688. type: "integer"
  25689. },
  25690. per_page: {
  25691. type: "integer"
  25692. },
  25693. username: {
  25694. required: true,
  25695. type: "string"
  25696. }
  25697. },
  25698. url: "/users/:username/keys"
  25699. },
  25700. togglePrimaryEmailVisibility: {
  25701. method: "PATCH",
  25702. params: {
  25703. email: {
  25704. required: true,
  25705. type: "string"
  25706. },
  25707. visibility: {
  25708. required: true,
  25709. type: "string"
  25710. }
  25711. },
  25712. url: "/user/email/visibility"
  25713. },
  25714. unblock: {
  25715. method: "DELETE",
  25716. params: {
  25717. username: {
  25718. required: true,
  25719. type: "string"
  25720. }
  25721. },
  25722. url: "/user/blocks/:username"
  25723. },
  25724. unfollow: {
  25725. method: "DELETE",
  25726. params: {
  25727. username: {
  25728. required: true,
  25729. type: "string"
  25730. }
  25731. },
  25732. url: "/user/following/:username"
  25733. },
  25734. updateAuthenticated: {
  25735. method: "PATCH",
  25736. params: {
  25737. bio: {
  25738. type: "string"
  25739. },
  25740. blog: {
  25741. type: "string"
  25742. },
  25743. company: {
  25744. type: "string"
  25745. },
  25746. email: {
  25747. type: "string"
  25748. },
  25749. hireable: {
  25750. type: "boolean"
  25751. },
  25752. location: {
  25753. type: "string"
  25754. },
  25755. name: {
  25756. type: "string"
  25757. }
  25758. },
  25759. url: "/user"
  25760. }
  25761. }
  25762. };
  25763. const VERSION = "2.4.0";
  25764. function registerEndpoints(octokit, routes) {
  25765. Object.keys(routes).forEach(namespaceName => {
  25766. if (!octokit[namespaceName]) {
  25767. octokit[namespaceName] = {};
  25768. }
  25769. Object.keys(routes[namespaceName]).forEach(apiName => {
  25770. const apiOptions = routes[namespaceName][apiName];
  25771. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25772. if (typeof apiOptions[key] !== "undefined") {
  25773. map[key] = apiOptions[key];
  25774. }
  25775. return map;
  25776. }, {});
  25777. endpointDefaults.request = {
  25778. validate: apiOptions.params
  25779. };
  25780. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25781. // Not the most elegant solution, but we don’t want to move deprecation
  25782. // logic into octokit/endpoint.js as it’s out of scope
  25783. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25784. if (hasDeprecatedParam) {
  25785. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25786. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25787. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25788. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25789. }
  25790. if (apiOptions.deprecated) {
  25791. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25792. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25793. octokit[namespaceName][apiName] = request;
  25794. return request.apply(null, arguments);
  25795. }, request);
  25796. return;
  25797. }
  25798. octokit[namespaceName][apiName] = request;
  25799. });
  25800. });
  25801. }
  25802. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25803. const patchedMethod = options => {
  25804. options = Object.assign({}, options);
  25805. Object.keys(options).forEach(key => {
  25806. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25807. const aliasKey = apiOptions.params[key].alias;
  25808. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25809. if (!(aliasKey in options)) {
  25810. options[aliasKey] = options[key];
  25811. }
  25812. delete options[key];
  25813. }
  25814. });
  25815. return method(options);
  25816. };
  25817. Object.keys(method).forEach(key => {
  25818. patchedMethod[key] = method[key];
  25819. });
  25820. return patchedMethod;
  25821. }
  25822. /**
  25823. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25824. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25825. * done, we will remove the registerEndpoints methods and return the methods
  25826. * directly as with the other plugins. At that point we will also remove the
  25827. * legacy workarounds and deprecations.
  25828. *
  25829. * See the plan at
  25830. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25831. */
  25832. function restEndpointMethods(octokit) {
  25833. // @ts-ignore
  25834. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25835. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25836. // See https://github.com/octokit/rest.js/pull/1134
  25837. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25838. Object.defineProperty(octokit, deprecatedScope, {
  25839. get() {
  25840. octokit.log.warn( // @ts-ignore
  25841. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25842. return octokit[scope];
  25843. }
  25844. });
  25845. });
  25846. return {};
  25847. }
  25848. restEndpointMethods.VERSION = VERSION;
  25849. exports.restEndpointMethods = restEndpointMethods;
  25850. //# sourceMappingURL=index.js.map
  25851. /***/ }),
  25852. /***/ 850:
  25853. /***/ (function(module, __unusedexports, __webpack_require__) {
  25854. module.exports = paginationMethodsPlugin
  25855. function paginationMethodsPlugin (octokit) {
  25856. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25857. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25858. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25859. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25860. octokit.hasFirstPage = __webpack_require__(536)
  25861. octokit.hasLastPage = __webpack_require__(336)
  25862. octokit.hasNextPage = __webpack_require__(929)
  25863. octokit.hasPreviousPage = __webpack_require__(558)
  25864. }
  25865. /***/ }),
  25866. /***/ 854:
  25867. /***/ (function(module) {
  25868. /**
  25869. * lodash (Custom Build) <https://lodash.com/>
  25870. * Build: `lodash modularize exports="npm" -o ./`
  25871. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25872. * Released under MIT license <https://lodash.com/license>
  25873. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25874. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25875. */
  25876. /** Used as the `TypeError` message for "Functions" methods. */
  25877. var FUNC_ERROR_TEXT = 'Expected a function';
  25878. /** Used to stand-in for `undefined` hash values. */
  25879. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25880. /** Used as references for various `Number` constants. */
  25881. var INFINITY = 1 / 0;
  25882. /** `Object#toString` result references. */
  25883. var funcTag = '[object Function]',
  25884. genTag = '[object GeneratorFunction]',
  25885. symbolTag = '[object Symbol]';
  25886. /** Used to match property names within property paths. */
  25887. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25888. reIsPlainProp = /^\w*$/,
  25889. reLeadingDot = /^\./,
  25890. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25891. /**
  25892. * Used to match `RegExp`
  25893. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25894. */
  25895. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25896. /** Used to match backslashes in property paths. */
  25897. var reEscapeChar = /\\(\\)?/g;
  25898. /** Used to detect host constructors (Safari). */
  25899. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25900. /** Detect free variable `global` from Node.js. */
  25901. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25902. /** Detect free variable `self`. */
  25903. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25904. /** Used as a reference to the global object. */
  25905. var root = freeGlobal || freeSelf || Function('return this')();
  25906. /**
  25907. * Gets the value at `key` of `object`.
  25908. *
  25909. * @private
  25910. * @param {Object} [object] The object to query.
  25911. * @param {string} key The key of the property to get.
  25912. * @returns {*} Returns the property value.
  25913. */
  25914. function getValue(object, key) {
  25915. return object == null ? undefined : object[key];
  25916. }
  25917. /**
  25918. * Checks if `value` is a host object in IE < 9.
  25919. *
  25920. * @private
  25921. * @param {*} value The value to check.
  25922. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25923. */
  25924. function isHostObject(value) {
  25925. // Many host objects are `Object` objects that can coerce to strings
  25926. // despite having improperly defined `toString` methods.
  25927. var result = false;
  25928. if (value != null && typeof value.toString != 'function') {
  25929. try {
  25930. result = !!(value + '');
  25931. } catch (e) {}
  25932. }
  25933. return result;
  25934. }
  25935. /** Used for built-in method references. */
  25936. var arrayProto = Array.prototype,
  25937. funcProto = Function.prototype,
  25938. objectProto = Object.prototype;
  25939. /** Used to detect overreaching core-js shims. */
  25940. var coreJsData = root['__core-js_shared__'];
  25941. /** Used to detect methods masquerading as native. */
  25942. var maskSrcKey = (function() {
  25943. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25944. return uid ? ('Symbol(src)_1.' + uid) : '';
  25945. }());
  25946. /** Used to resolve the decompiled source of functions. */
  25947. var funcToString = funcProto.toString;
  25948. /** Used to check objects for own properties. */
  25949. var hasOwnProperty = objectProto.hasOwnProperty;
  25950. /**
  25951. * Used to resolve the
  25952. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25953. * of values.
  25954. */
  25955. var objectToString = objectProto.toString;
  25956. /** Used to detect if a method is native. */
  25957. var reIsNative = RegExp('^' +
  25958. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25959. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25960. );
  25961. /** Built-in value references. */
  25962. var Symbol = root.Symbol,
  25963. splice = arrayProto.splice;
  25964. /* Built-in method references that are verified to be native. */
  25965. var Map = getNative(root, 'Map'),
  25966. nativeCreate = getNative(Object, 'create');
  25967. /** Used to convert symbols to primitives and strings. */
  25968. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25969. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25970. /**
  25971. * Creates a hash object.
  25972. *
  25973. * @private
  25974. * @constructor
  25975. * @param {Array} [entries] The key-value pairs to cache.
  25976. */
  25977. function Hash(entries) {
  25978. var index = -1,
  25979. length = entries ? entries.length : 0;
  25980. this.clear();
  25981. while (++index < length) {
  25982. var entry = entries[index];
  25983. this.set(entry[0], entry[1]);
  25984. }
  25985. }
  25986. /**
  25987. * Removes all key-value entries from the hash.
  25988. *
  25989. * @private
  25990. * @name clear
  25991. * @memberOf Hash
  25992. */
  25993. function hashClear() {
  25994. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25995. }
  25996. /**
  25997. * Removes `key` and its value from the hash.
  25998. *
  25999. * @private
  26000. * @name delete
  26001. * @memberOf Hash
  26002. * @param {Object} hash The hash to modify.
  26003. * @param {string} key The key of the value to remove.
  26004. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26005. */
  26006. function hashDelete(key) {
  26007. return this.has(key) && delete this.__data__[key];
  26008. }
  26009. /**
  26010. * Gets the hash value for `key`.
  26011. *
  26012. * @private
  26013. * @name get
  26014. * @memberOf Hash
  26015. * @param {string} key The key of the value to get.
  26016. * @returns {*} Returns the entry value.
  26017. */
  26018. function hashGet(key) {
  26019. var data = this.__data__;
  26020. if (nativeCreate) {
  26021. var result = data[key];
  26022. return result === HASH_UNDEFINED ? undefined : result;
  26023. }
  26024. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26025. }
  26026. /**
  26027. * Checks if a hash value for `key` exists.
  26028. *
  26029. * @private
  26030. * @name has
  26031. * @memberOf Hash
  26032. * @param {string} key The key of the entry to check.
  26033. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26034. */
  26035. function hashHas(key) {
  26036. var data = this.__data__;
  26037. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26038. }
  26039. /**
  26040. * Sets the hash `key` to `value`.
  26041. *
  26042. * @private
  26043. * @name set
  26044. * @memberOf Hash
  26045. * @param {string} key The key of the value to set.
  26046. * @param {*} value The value to set.
  26047. * @returns {Object} Returns the hash instance.
  26048. */
  26049. function hashSet(key, value) {
  26050. var data = this.__data__;
  26051. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26052. return this;
  26053. }
  26054. // Add methods to `Hash`.
  26055. Hash.prototype.clear = hashClear;
  26056. Hash.prototype['delete'] = hashDelete;
  26057. Hash.prototype.get = hashGet;
  26058. Hash.prototype.has = hashHas;
  26059. Hash.prototype.set = hashSet;
  26060. /**
  26061. * Creates an list cache object.
  26062. *
  26063. * @private
  26064. * @constructor
  26065. * @param {Array} [entries] The key-value pairs to cache.
  26066. */
  26067. function ListCache(entries) {
  26068. var index = -1,
  26069. length = entries ? entries.length : 0;
  26070. this.clear();
  26071. while (++index < length) {
  26072. var entry = entries[index];
  26073. this.set(entry[0], entry[1]);
  26074. }
  26075. }
  26076. /**
  26077. * Removes all key-value entries from the list cache.
  26078. *
  26079. * @private
  26080. * @name clear
  26081. * @memberOf ListCache
  26082. */
  26083. function listCacheClear() {
  26084. this.__data__ = [];
  26085. }
  26086. /**
  26087. * Removes `key` and its value from the list cache.
  26088. *
  26089. * @private
  26090. * @name delete
  26091. * @memberOf ListCache
  26092. * @param {string} key The key of the value to remove.
  26093. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26094. */
  26095. function listCacheDelete(key) {
  26096. var data = this.__data__,
  26097. index = assocIndexOf(data, key);
  26098. if (index < 0) {
  26099. return false;
  26100. }
  26101. var lastIndex = data.length - 1;
  26102. if (index == lastIndex) {
  26103. data.pop();
  26104. } else {
  26105. splice.call(data, index, 1);
  26106. }
  26107. return true;
  26108. }
  26109. /**
  26110. * Gets the list cache value for `key`.
  26111. *
  26112. * @private
  26113. * @name get
  26114. * @memberOf ListCache
  26115. * @param {string} key The key of the value to get.
  26116. * @returns {*} Returns the entry value.
  26117. */
  26118. function listCacheGet(key) {
  26119. var data = this.__data__,
  26120. index = assocIndexOf(data, key);
  26121. return index < 0 ? undefined : data[index][1];
  26122. }
  26123. /**
  26124. * Checks if a list cache value for `key` exists.
  26125. *
  26126. * @private
  26127. * @name has
  26128. * @memberOf ListCache
  26129. * @param {string} key The key of the entry to check.
  26130. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26131. */
  26132. function listCacheHas(key) {
  26133. return assocIndexOf(this.__data__, key) > -1;
  26134. }
  26135. /**
  26136. * Sets the list cache `key` to `value`.
  26137. *
  26138. * @private
  26139. * @name set
  26140. * @memberOf ListCache
  26141. * @param {string} key The key of the value to set.
  26142. * @param {*} value The value to set.
  26143. * @returns {Object} Returns the list cache instance.
  26144. */
  26145. function listCacheSet(key, value) {
  26146. var data = this.__data__,
  26147. index = assocIndexOf(data, key);
  26148. if (index < 0) {
  26149. data.push([key, value]);
  26150. } else {
  26151. data[index][1] = value;
  26152. }
  26153. return this;
  26154. }
  26155. // Add methods to `ListCache`.
  26156. ListCache.prototype.clear = listCacheClear;
  26157. ListCache.prototype['delete'] = listCacheDelete;
  26158. ListCache.prototype.get = listCacheGet;
  26159. ListCache.prototype.has = listCacheHas;
  26160. ListCache.prototype.set = listCacheSet;
  26161. /**
  26162. * Creates a map cache object to store key-value pairs.
  26163. *
  26164. * @private
  26165. * @constructor
  26166. * @param {Array} [entries] The key-value pairs to cache.
  26167. */
  26168. function MapCache(entries) {
  26169. var index = -1,
  26170. length = entries ? entries.length : 0;
  26171. this.clear();
  26172. while (++index < length) {
  26173. var entry = entries[index];
  26174. this.set(entry[0], entry[1]);
  26175. }
  26176. }
  26177. /**
  26178. * Removes all key-value entries from the map.
  26179. *
  26180. * @private
  26181. * @name clear
  26182. * @memberOf MapCache
  26183. */
  26184. function mapCacheClear() {
  26185. this.__data__ = {
  26186. 'hash': new Hash,
  26187. 'map': new (Map || ListCache),
  26188. 'string': new Hash
  26189. };
  26190. }
  26191. /**
  26192. * Removes `key` and its value from the map.
  26193. *
  26194. * @private
  26195. * @name delete
  26196. * @memberOf MapCache
  26197. * @param {string} key The key of the value to remove.
  26198. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26199. */
  26200. function mapCacheDelete(key) {
  26201. return getMapData(this, key)['delete'](key);
  26202. }
  26203. /**
  26204. * Gets the map value for `key`.
  26205. *
  26206. * @private
  26207. * @name get
  26208. * @memberOf MapCache
  26209. * @param {string} key The key of the value to get.
  26210. * @returns {*} Returns the entry value.
  26211. */
  26212. function mapCacheGet(key) {
  26213. return getMapData(this, key).get(key);
  26214. }
  26215. /**
  26216. * Checks if a map value for `key` exists.
  26217. *
  26218. * @private
  26219. * @name has
  26220. * @memberOf MapCache
  26221. * @param {string} key The key of the entry to check.
  26222. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26223. */
  26224. function mapCacheHas(key) {
  26225. return getMapData(this, key).has(key);
  26226. }
  26227. /**
  26228. * Sets the map `key` to `value`.
  26229. *
  26230. * @private
  26231. * @name set
  26232. * @memberOf MapCache
  26233. * @param {string} key The key of the value to set.
  26234. * @param {*} value The value to set.
  26235. * @returns {Object} Returns the map cache instance.
  26236. */
  26237. function mapCacheSet(key, value) {
  26238. getMapData(this, key).set(key, value);
  26239. return this;
  26240. }
  26241. // Add methods to `MapCache`.
  26242. MapCache.prototype.clear = mapCacheClear;
  26243. MapCache.prototype['delete'] = mapCacheDelete;
  26244. MapCache.prototype.get = mapCacheGet;
  26245. MapCache.prototype.has = mapCacheHas;
  26246. MapCache.prototype.set = mapCacheSet;
  26247. /**
  26248. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26249. *
  26250. * @private
  26251. * @param {Array} array The array to inspect.
  26252. * @param {*} key The key to search for.
  26253. * @returns {number} Returns the index of the matched value, else `-1`.
  26254. */
  26255. function assocIndexOf(array, key) {
  26256. var length = array.length;
  26257. while (length--) {
  26258. if (eq(array[length][0], key)) {
  26259. return length;
  26260. }
  26261. }
  26262. return -1;
  26263. }
  26264. /**
  26265. * The base implementation of `_.get` without support for default values.
  26266. *
  26267. * @private
  26268. * @param {Object} object The object to query.
  26269. * @param {Array|string} path The path of the property to get.
  26270. * @returns {*} Returns the resolved value.
  26271. */
  26272. function baseGet(object, path) {
  26273. path = isKey(path, object) ? [path] : castPath(path);
  26274. var index = 0,
  26275. length = path.length;
  26276. while (object != null && index < length) {
  26277. object = object[toKey(path[index++])];
  26278. }
  26279. return (index && index == length) ? object : undefined;
  26280. }
  26281. /**
  26282. * The base implementation of `_.isNative` without bad shim checks.
  26283. *
  26284. * @private
  26285. * @param {*} value The value to check.
  26286. * @returns {boolean} Returns `true` if `value` is a native function,
  26287. * else `false`.
  26288. */
  26289. function baseIsNative(value) {
  26290. if (!isObject(value) || isMasked(value)) {
  26291. return false;
  26292. }
  26293. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26294. return pattern.test(toSource(value));
  26295. }
  26296. /**
  26297. * The base implementation of `_.toString` which doesn't convert nullish
  26298. * values to empty strings.
  26299. *
  26300. * @private
  26301. * @param {*} value The value to process.
  26302. * @returns {string} Returns the string.
  26303. */
  26304. function baseToString(value) {
  26305. // Exit early for strings to avoid a performance hit in some environments.
  26306. if (typeof value == 'string') {
  26307. return value;
  26308. }
  26309. if (isSymbol(value)) {
  26310. return symbolToString ? symbolToString.call(value) : '';
  26311. }
  26312. var result = (value + '');
  26313. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26314. }
  26315. /**
  26316. * Casts `value` to a path array if it's not one.
  26317. *
  26318. * @private
  26319. * @param {*} value The value to inspect.
  26320. * @returns {Array} Returns the cast property path array.
  26321. */
  26322. function castPath(value) {
  26323. return isArray(value) ? value : stringToPath(value);
  26324. }
  26325. /**
  26326. * Gets the data for `map`.
  26327. *
  26328. * @private
  26329. * @param {Object} map The map to query.
  26330. * @param {string} key The reference key.
  26331. * @returns {*} Returns the map data.
  26332. */
  26333. function getMapData(map, key) {
  26334. var data = map.__data__;
  26335. return isKeyable(key)
  26336. ? data[typeof key == 'string' ? 'string' : 'hash']
  26337. : data.map;
  26338. }
  26339. /**
  26340. * Gets the native function at `key` of `object`.
  26341. *
  26342. * @private
  26343. * @param {Object} object The object to query.
  26344. * @param {string} key The key of the method to get.
  26345. * @returns {*} Returns the function if it's native, else `undefined`.
  26346. */
  26347. function getNative(object, key) {
  26348. var value = getValue(object, key);
  26349. return baseIsNative(value) ? value : undefined;
  26350. }
  26351. /**
  26352. * Checks if `value` is a property name and not a property path.
  26353. *
  26354. * @private
  26355. * @param {*} value The value to check.
  26356. * @param {Object} [object] The object to query keys on.
  26357. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26358. */
  26359. function isKey(value, object) {
  26360. if (isArray(value)) {
  26361. return false;
  26362. }
  26363. var type = typeof value;
  26364. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26365. value == null || isSymbol(value)) {
  26366. return true;
  26367. }
  26368. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26369. (object != null && value in Object(object));
  26370. }
  26371. /**
  26372. * Checks if `value` is suitable for use as unique object key.
  26373. *
  26374. * @private
  26375. * @param {*} value The value to check.
  26376. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26377. */
  26378. function isKeyable(value) {
  26379. var type = typeof value;
  26380. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26381. ? (value !== '__proto__')
  26382. : (value === null);
  26383. }
  26384. /**
  26385. * Checks if `func` has its source masked.
  26386. *
  26387. * @private
  26388. * @param {Function} func The function to check.
  26389. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26390. */
  26391. function isMasked(func) {
  26392. return !!maskSrcKey && (maskSrcKey in func);
  26393. }
  26394. /**
  26395. * Converts `string` to a property path array.
  26396. *
  26397. * @private
  26398. * @param {string} string The string to convert.
  26399. * @returns {Array} Returns the property path array.
  26400. */
  26401. var stringToPath = memoize(function(string) {
  26402. string = toString(string);
  26403. var result = [];
  26404. if (reLeadingDot.test(string)) {
  26405. result.push('');
  26406. }
  26407. string.replace(rePropName, function(match, number, quote, string) {
  26408. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26409. });
  26410. return result;
  26411. });
  26412. /**
  26413. * Converts `value` to a string key if it's not a string or symbol.
  26414. *
  26415. * @private
  26416. * @param {*} value The value to inspect.
  26417. * @returns {string|symbol} Returns the key.
  26418. */
  26419. function toKey(value) {
  26420. if (typeof value == 'string' || isSymbol(value)) {
  26421. return value;
  26422. }
  26423. var result = (value + '');
  26424. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26425. }
  26426. /**
  26427. * Converts `func` to its source code.
  26428. *
  26429. * @private
  26430. * @param {Function} func The function to process.
  26431. * @returns {string} Returns the source code.
  26432. */
  26433. function toSource(func) {
  26434. if (func != null) {
  26435. try {
  26436. return funcToString.call(func);
  26437. } catch (e) {}
  26438. try {
  26439. return (func + '');
  26440. } catch (e) {}
  26441. }
  26442. return '';
  26443. }
  26444. /**
  26445. * Creates a function that memoizes the result of `func`. If `resolver` is
  26446. * provided, it determines the cache key for storing the result based on the
  26447. * arguments provided to the memoized function. By default, the first argument
  26448. * provided to the memoized function is used as the map cache key. The `func`
  26449. * is invoked with the `this` binding of the memoized function.
  26450. *
  26451. * **Note:** The cache is exposed as the `cache` property on the memoized
  26452. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26453. * constructor with one whose instances implement the
  26454. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26455. * method interface of `delete`, `get`, `has`, and `set`.
  26456. *
  26457. * @static
  26458. * @memberOf _
  26459. * @since 0.1.0
  26460. * @category Function
  26461. * @param {Function} func The function to have its output memoized.
  26462. * @param {Function} [resolver] The function to resolve the cache key.
  26463. * @returns {Function} Returns the new memoized function.
  26464. * @example
  26465. *
  26466. * var object = { 'a': 1, 'b': 2 };
  26467. * var other = { 'c': 3, 'd': 4 };
  26468. *
  26469. * var values = _.memoize(_.values);
  26470. * values(object);
  26471. * // => [1, 2]
  26472. *
  26473. * values(other);
  26474. * // => [3, 4]
  26475. *
  26476. * object.a = 2;
  26477. * values(object);
  26478. * // => [1, 2]
  26479. *
  26480. * // Modify the result cache.
  26481. * values.cache.set(object, ['a', 'b']);
  26482. * values(object);
  26483. * // => ['a', 'b']
  26484. *
  26485. * // Replace `_.memoize.Cache`.
  26486. * _.memoize.Cache = WeakMap;
  26487. */
  26488. function memoize(func, resolver) {
  26489. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26490. throw new TypeError(FUNC_ERROR_TEXT);
  26491. }
  26492. var memoized = function() {
  26493. var args = arguments,
  26494. key = resolver ? resolver.apply(this, args) : args[0],
  26495. cache = memoized.cache;
  26496. if (cache.has(key)) {
  26497. return cache.get(key);
  26498. }
  26499. var result = func.apply(this, args);
  26500. memoized.cache = cache.set(key, result);
  26501. return result;
  26502. };
  26503. memoized.cache = new (memoize.Cache || MapCache);
  26504. return memoized;
  26505. }
  26506. // Assign cache to `_.memoize`.
  26507. memoize.Cache = MapCache;
  26508. /**
  26509. * Performs a
  26510. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26511. * comparison between two values to determine if they are equivalent.
  26512. *
  26513. * @static
  26514. * @memberOf _
  26515. * @since 4.0.0
  26516. * @category Lang
  26517. * @param {*} value The value to compare.
  26518. * @param {*} other The other value to compare.
  26519. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26520. * @example
  26521. *
  26522. * var object = { 'a': 1 };
  26523. * var other = { 'a': 1 };
  26524. *
  26525. * _.eq(object, object);
  26526. * // => true
  26527. *
  26528. * _.eq(object, other);
  26529. * // => false
  26530. *
  26531. * _.eq('a', 'a');
  26532. * // => true
  26533. *
  26534. * _.eq('a', Object('a'));
  26535. * // => false
  26536. *
  26537. * _.eq(NaN, NaN);
  26538. * // => true
  26539. */
  26540. function eq(value, other) {
  26541. return value === other || (value !== value && other !== other);
  26542. }
  26543. /**
  26544. * Checks if `value` is classified as an `Array` object.
  26545. *
  26546. * @static
  26547. * @memberOf _
  26548. * @since 0.1.0
  26549. * @category Lang
  26550. * @param {*} value The value to check.
  26551. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26552. * @example
  26553. *
  26554. * _.isArray([1, 2, 3]);
  26555. * // => true
  26556. *
  26557. * _.isArray(document.body.children);
  26558. * // => false
  26559. *
  26560. * _.isArray('abc');
  26561. * // => false
  26562. *
  26563. * _.isArray(_.noop);
  26564. * // => false
  26565. */
  26566. var isArray = Array.isArray;
  26567. /**
  26568. * Checks if `value` is classified as a `Function` object.
  26569. *
  26570. * @static
  26571. * @memberOf _
  26572. * @since 0.1.0
  26573. * @category Lang
  26574. * @param {*} value The value to check.
  26575. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26576. * @example
  26577. *
  26578. * _.isFunction(_);
  26579. * // => true
  26580. *
  26581. * _.isFunction(/abc/);
  26582. * // => false
  26583. */
  26584. function isFunction(value) {
  26585. // The use of `Object#toString` avoids issues with the `typeof` operator
  26586. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26587. var tag = isObject(value) ? objectToString.call(value) : '';
  26588. return tag == funcTag || tag == genTag;
  26589. }
  26590. /**
  26591. * Checks if `value` is the
  26592. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26593. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26594. *
  26595. * @static
  26596. * @memberOf _
  26597. * @since 0.1.0
  26598. * @category Lang
  26599. * @param {*} value The value to check.
  26600. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26601. * @example
  26602. *
  26603. * _.isObject({});
  26604. * // => true
  26605. *
  26606. * _.isObject([1, 2, 3]);
  26607. * // => true
  26608. *
  26609. * _.isObject(_.noop);
  26610. * // => true
  26611. *
  26612. * _.isObject(null);
  26613. * // => false
  26614. */
  26615. function isObject(value) {
  26616. var type = typeof value;
  26617. return !!value && (type == 'object' || type == 'function');
  26618. }
  26619. /**
  26620. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26621. * and has a `typeof` result of "object".
  26622. *
  26623. * @static
  26624. * @memberOf _
  26625. * @since 4.0.0
  26626. * @category Lang
  26627. * @param {*} value The value to check.
  26628. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26629. * @example
  26630. *
  26631. * _.isObjectLike({});
  26632. * // => true
  26633. *
  26634. * _.isObjectLike([1, 2, 3]);
  26635. * // => true
  26636. *
  26637. * _.isObjectLike(_.noop);
  26638. * // => false
  26639. *
  26640. * _.isObjectLike(null);
  26641. * // => false
  26642. */
  26643. function isObjectLike(value) {
  26644. return !!value && typeof value == 'object';
  26645. }
  26646. /**
  26647. * Checks if `value` is classified as a `Symbol` primitive or object.
  26648. *
  26649. * @static
  26650. * @memberOf _
  26651. * @since 4.0.0
  26652. * @category Lang
  26653. * @param {*} value The value to check.
  26654. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26655. * @example
  26656. *
  26657. * _.isSymbol(Symbol.iterator);
  26658. * // => true
  26659. *
  26660. * _.isSymbol('abc');
  26661. * // => false
  26662. */
  26663. function isSymbol(value) {
  26664. return typeof value == 'symbol' ||
  26665. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26666. }
  26667. /**
  26668. * Converts `value` to a string. An empty string is returned for `null`
  26669. * and `undefined` values. The sign of `-0` is preserved.
  26670. *
  26671. * @static
  26672. * @memberOf _
  26673. * @since 4.0.0
  26674. * @category Lang
  26675. * @param {*} value The value to process.
  26676. * @returns {string} Returns the string.
  26677. * @example
  26678. *
  26679. * _.toString(null);
  26680. * // => ''
  26681. *
  26682. * _.toString(-0);
  26683. * // => '-0'
  26684. *
  26685. * _.toString([1, 2, 3]);
  26686. * // => '1,2,3'
  26687. */
  26688. function toString(value) {
  26689. return value == null ? '' : baseToString(value);
  26690. }
  26691. /**
  26692. * Gets the value at `path` of `object`. If the resolved value is
  26693. * `undefined`, the `defaultValue` is returned in its place.
  26694. *
  26695. * @static
  26696. * @memberOf _
  26697. * @since 3.7.0
  26698. * @category Object
  26699. * @param {Object} object The object to query.
  26700. * @param {Array|string} path The path of the property to get.
  26701. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26702. * @returns {*} Returns the resolved value.
  26703. * @example
  26704. *
  26705. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26706. *
  26707. * _.get(object, 'a[0].b.c');
  26708. * // => 3
  26709. *
  26710. * _.get(object, ['a', '0', 'b', 'c']);
  26711. * // => 3
  26712. *
  26713. * _.get(object, 'a.b.c', 'default');
  26714. * // => 'default'
  26715. */
  26716. function get(object, path, defaultValue) {
  26717. var result = object == null ? undefined : baseGet(object, path);
  26718. return result === undefined ? defaultValue : result;
  26719. }
  26720. module.exports = get;
  26721. /***/ }),
  26722. /***/ 855:
  26723. /***/ (function(module, __unusedexports, __webpack_require__) {
  26724. module.exports = registerPlugin;
  26725. const factory = __webpack_require__(47);
  26726. function registerPlugin(plugins, pluginFunction) {
  26727. return factory(
  26728. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26729. );
  26730. }
  26731. /***/ }),
  26732. /***/ 856:
  26733. /***/ (function(module, __unusedexports, __webpack_require__) {
  26734. module.exports = __webpack_require__(141);
  26735. /***/ }),
  26736. /***/ 863:
  26737. /***/ (function(module, __unusedexports, __webpack_require__) {
  26738. module.exports = authenticationBeforeRequest;
  26739. const btoa = __webpack_require__(675);
  26740. const withAuthorizationPrefix = __webpack_require__(143);
  26741. function authenticationBeforeRequest(state, options) {
  26742. if (typeof state.auth === "string") {
  26743. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26744. return;
  26745. }
  26746. if (state.auth.username) {
  26747. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26748. options.headers.authorization = `Basic ${hash}`;
  26749. if (state.otp) {
  26750. options.headers["x-github-otp"] = state.otp;
  26751. }
  26752. return;
  26753. }
  26754. if (state.auth.clientId) {
  26755. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26756. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26757. // URL though: `/applications/:client_id/tokens/:access_token`.
  26758. //
  26759. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26760. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26761. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26762. //
  26763. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26764. // as well as "/applications/123/tokens/token456"
  26765. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26766. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26767. options.headers.authorization = `Basic ${hash}`;
  26768. return;
  26769. }
  26770. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26771. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26772. return;
  26773. }
  26774. return Promise.resolve()
  26775. .then(() => {
  26776. return state.auth();
  26777. })
  26778. .then(authorization => {
  26779. options.headers.authorization = withAuthorizationPrefix(authorization);
  26780. });
  26781. }
  26782. /***/ }),
  26783. /***/ 866:
  26784. /***/ (function(module, __unusedexports, __webpack_require__) {
  26785. "use strict";
  26786. var shebangRegex = __webpack_require__(816);
  26787. module.exports = function (str) {
  26788. var match = str.match(shebangRegex);
  26789. if (!match) {
  26790. return null;
  26791. }
  26792. var arr = match[0].replace(/#! ?/, '').split(' ');
  26793. var bin = arr[0].split('/').pop();
  26794. var arg = arr[1];
  26795. return (bin === 'env' ?
  26796. arg :
  26797. bin + (arg ? ' ' + arg : '')
  26798. );
  26799. };
  26800. /***/ }),
  26801. /***/ 874:
  26802. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26803. "use strict";
  26804. // Copyright (c) Microsoft. All rights reserved.
  26805. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26806. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26807. return new (P || (P = Promise))(function (resolve, reject) {
  26808. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26809. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26810. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26811. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26812. });
  26813. };
  26814. Object.defineProperty(exports, "__esModule", { value: true });
  26815. const url = __webpack_require__(835);
  26816. const http = __webpack_require__(605);
  26817. const https = __webpack_require__(34);
  26818. let fs;
  26819. let tunnel;
  26820. var HttpCodes;
  26821. (function (HttpCodes) {
  26822. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26823. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26824. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26825. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26826. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26827. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26828. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26829. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26830. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26831. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26832. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26833. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26834. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26835. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26836. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26837. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26838. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26839. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26840. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26841. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26842. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26843. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26844. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26845. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26846. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26847. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26848. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26849. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26850. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26851. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26852. const ExponentialBackoffCeiling = 10;
  26853. const ExponentialBackoffTimeSlice = 5;
  26854. class HttpClientResponse {
  26855. constructor(message) {
  26856. this.message = message;
  26857. }
  26858. readBody() {
  26859. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26860. let output = '';
  26861. this.message.on('data', (chunk) => {
  26862. output += chunk;
  26863. });
  26864. this.message.on('end', () => {
  26865. resolve(output);
  26866. });
  26867. }));
  26868. }
  26869. }
  26870. exports.HttpClientResponse = HttpClientResponse;
  26871. function isHttps(requestUrl) {
  26872. let parsedUrl = url.parse(requestUrl);
  26873. return parsedUrl.protocol === 'https:';
  26874. }
  26875. exports.isHttps = isHttps;
  26876. var EnvironmentVariables;
  26877. (function (EnvironmentVariables) {
  26878. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26879. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26880. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26881. class HttpClient {
  26882. constructor(userAgent, handlers, requestOptions) {
  26883. this._ignoreSslError = false;
  26884. this._allowRedirects = true;
  26885. this._maxRedirects = 50;
  26886. this._allowRetries = false;
  26887. this._maxRetries = 1;
  26888. this._keepAlive = false;
  26889. this._disposed = false;
  26890. this.userAgent = userAgent;
  26891. this.handlers = handlers || [];
  26892. this.requestOptions = requestOptions;
  26893. if (requestOptions) {
  26894. if (requestOptions.ignoreSslError != null) {
  26895. this._ignoreSslError = requestOptions.ignoreSslError;
  26896. }
  26897. this._socketTimeout = requestOptions.socketTimeout;
  26898. this._httpProxy = requestOptions.proxy;
  26899. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26900. this._httpProxyBypassHosts = [];
  26901. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26902. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26903. });
  26904. }
  26905. this._certConfig = requestOptions.cert;
  26906. if (this._certConfig) {
  26907. // If using cert, need fs
  26908. fs = __webpack_require__(747);
  26909. // cache the cert content into memory, so we don't have to read it from disk every time
  26910. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26911. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26912. }
  26913. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26914. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26915. }
  26916. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26917. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26918. }
  26919. }
  26920. if (requestOptions.allowRedirects != null) {
  26921. this._allowRedirects = requestOptions.allowRedirects;
  26922. }
  26923. if (requestOptions.maxRedirects != null) {
  26924. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26925. }
  26926. if (requestOptions.keepAlive != null) {
  26927. this._keepAlive = requestOptions.keepAlive;
  26928. }
  26929. if (requestOptions.allowRetries != null) {
  26930. this._allowRetries = requestOptions.allowRetries;
  26931. }
  26932. if (requestOptions.maxRetries != null) {
  26933. this._maxRetries = requestOptions.maxRetries;
  26934. }
  26935. }
  26936. }
  26937. options(requestUrl, additionalHeaders) {
  26938. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26939. }
  26940. get(requestUrl, additionalHeaders) {
  26941. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26942. }
  26943. del(requestUrl, additionalHeaders) {
  26944. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26945. }
  26946. post(requestUrl, data, additionalHeaders) {
  26947. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26948. }
  26949. patch(requestUrl, data, additionalHeaders) {
  26950. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26951. }
  26952. put(requestUrl, data, additionalHeaders) {
  26953. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  26954. }
  26955. head(requestUrl, additionalHeaders) {
  26956. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  26957. }
  26958. sendStream(verb, requestUrl, stream, additionalHeaders) {
  26959. return this.request(verb, requestUrl, stream, additionalHeaders);
  26960. }
  26961. /**
  26962. * Makes a raw http request.
  26963. * All other methods such as get, post, patch, and request ultimately call this.
  26964. * Prefer get, del, post and patch
  26965. */
  26966. request(verb, requestUrl, data, headers) {
  26967. return __awaiter(this, void 0, void 0, function* () {
  26968. if (this._disposed) {
  26969. throw new Error("Client has already been disposed.");
  26970. }
  26971. let info = this._prepareRequest(verb, requestUrl, headers);
  26972. // Only perform retries on reads since writes may not be idempotent.
  26973. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  26974. let numTries = 0;
  26975. let response;
  26976. while (numTries < maxTries) {
  26977. response = yield this.requestRaw(info, data);
  26978. // Check if it's an authentication challenge
  26979. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  26980. let authenticationHandler;
  26981. for (let i = 0; i < this.handlers.length; i++) {
  26982. if (this.handlers[i].canHandleAuthentication(response)) {
  26983. authenticationHandler = this.handlers[i];
  26984. break;
  26985. }
  26986. }
  26987. if (authenticationHandler) {
  26988. return authenticationHandler.handleAuthentication(this, info, data);
  26989. }
  26990. else {
  26991. // We have received an unauthorized response but have no handlers to handle it.
  26992. // Let the response return to the caller.
  26993. return response;
  26994. }
  26995. }
  26996. let redirectsRemaining = this._maxRedirects;
  26997. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  26998. && this._allowRedirects
  26999. && redirectsRemaining > 0) {
  27000. const redirectUrl = response.message.headers["location"];
  27001. if (!redirectUrl) {
  27002. // if there's no location to redirect to, we won't
  27003. break;
  27004. }
  27005. // we need to finish reading the response before reassigning response
  27006. // which will leak the open socket.
  27007. yield response.readBody();
  27008. // let's make the request with the new redirectUrl
  27009. info = this._prepareRequest(verb, redirectUrl, headers);
  27010. response = yield this.requestRaw(info, data);
  27011. redirectsRemaining--;
  27012. }
  27013. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27014. // If not a retry code, return immediately instead of retrying
  27015. return response;
  27016. }
  27017. numTries += 1;
  27018. if (numTries < maxTries) {
  27019. yield response.readBody();
  27020. yield this._performExponentialBackoff(numTries);
  27021. }
  27022. }
  27023. return response;
  27024. });
  27025. }
  27026. /**
  27027. * Needs to be called if keepAlive is set to true in request options.
  27028. */
  27029. dispose() {
  27030. if (this._agent) {
  27031. this._agent.destroy();
  27032. }
  27033. this._disposed = true;
  27034. }
  27035. /**
  27036. * Raw request.
  27037. * @param info
  27038. * @param data
  27039. */
  27040. requestRaw(info, data) {
  27041. return new Promise((resolve, reject) => {
  27042. let callbackForResult = function (err, res) {
  27043. if (err) {
  27044. reject(err);
  27045. }
  27046. resolve(res);
  27047. };
  27048. this.requestRawWithCallback(info, data, callbackForResult);
  27049. });
  27050. }
  27051. /**
  27052. * Raw request with callback.
  27053. * @param info
  27054. * @param data
  27055. * @param onResult
  27056. */
  27057. requestRawWithCallback(info, data, onResult) {
  27058. let socket;
  27059. let isDataString = typeof (data) === 'string';
  27060. if (typeof (data) === 'string') {
  27061. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27062. }
  27063. let callbackCalled = false;
  27064. let handleResult = (err, res) => {
  27065. if (!callbackCalled) {
  27066. callbackCalled = true;
  27067. onResult(err, res);
  27068. }
  27069. };
  27070. let req = info.httpModule.request(info.options, (msg) => {
  27071. let res = new HttpClientResponse(msg);
  27072. handleResult(null, res);
  27073. });
  27074. req.on('socket', (sock) => {
  27075. socket = sock;
  27076. });
  27077. // If we ever get disconnected, we want the socket to timeout eventually
  27078. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27079. if (socket) {
  27080. socket.end();
  27081. }
  27082. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27083. });
  27084. req.on('error', function (err) {
  27085. // err has statusCode property
  27086. // res should have headers
  27087. handleResult(err, null);
  27088. });
  27089. if (data && typeof (data) === 'string') {
  27090. req.write(data, 'utf8');
  27091. }
  27092. if (data && typeof (data) !== 'string') {
  27093. data.on('close', function () {
  27094. req.end();
  27095. });
  27096. data.pipe(req);
  27097. }
  27098. else {
  27099. req.end();
  27100. }
  27101. }
  27102. _prepareRequest(method, requestUrl, headers) {
  27103. const info = {};
  27104. info.parsedUrl = url.parse(requestUrl);
  27105. const usingSsl = info.parsedUrl.protocol === 'https:';
  27106. info.httpModule = usingSsl ? https : http;
  27107. const defaultPort = usingSsl ? 443 : 80;
  27108. info.options = {};
  27109. info.options.host = info.parsedUrl.hostname;
  27110. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27111. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27112. info.options.method = method;
  27113. info.options.headers = this._mergeHeaders(headers);
  27114. info.options.headers["user-agent"] = this.userAgent;
  27115. info.options.agent = this._getAgent(requestUrl);
  27116. // gives handlers an opportunity to participate
  27117. if (this.handlers && !this._isPresigned(requestUrl)) {
  27118. this.handlers.forEach((handler) => {
  27119. handler.prepareRequest(info.options);
  27120. });
  27121. }
  27122. return info;
  27123. }
  27124. _isPresigned(requestUrl) {
  27125. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27126. const patterns = this.requestOptions.presignedUrlPatterns;
  27127. for (let i = 0; i < patterns.length; i++) {
  27128. if (requestUrl.match(patterns[i])) {
  27129. return true;
  27130. }
  27131. }
  27132. }
  27133. return false;
  27134. }
  27135. _mergeHeaders(headers) {
  27136. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27137. if (this.requestOptions && this.requestOptions.headers) {
  27138. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27139. }
  27140. return lowercaseKeys(headers || {});
  27141. }
  27142. _getAgent(requestUrl) {
  27143. let agent;
  27144. let proxy = this._getProxy(requestUrl);
  27145. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27146. if (this._keepAlive && useProxy) {
  27147. agent = this._proxyAgent;
  27148. }
  27149. if (this._keepAlive && !useProxy) {
  27150. agent = this._agent;
  27151. }
  27152. // if agent is already assigned use that agent.
  27153. if (!!agent) {
  27154. return agent;
  27155. }
  27156. let parsedUrl = url.parse(requestUrl);
  27157. const usingSsl = parsedUrl.protocol === 'https:';
  27158. let maxSockets = 100;
  27159. if (!!this.requestOptions) {
  27160. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27161. }
  27162. if (useProxy) {
  27163. // If using proxy, need tunnel
  27164. if (!tunnel) {
  27165. tunnel = __webpack_require__(856);
  27166. }
  27167. const agentOptions = {
  27168. maxSockets: maxSockets,
  27169. keepAlive: this._keepAlive,
  27170. proxy: {
  27171. proxyAuth: proxy.proxyAuth,
  27172. host: proxy.proxyUrl.hostname,
  27173. port: proxy.proxyUrl.port
  27174. },
  27175. };
  27176. let tunnelAgent;
  27177. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27178. if (usingSsl) {
  27179. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27180. }
  27181. else {
  27182. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27183. }
  27184. agent = tunnelAgent(agentOptions);
  27185. this._proxyAgent = agent;
  27186. }
  27187. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27188. if (this._keepAlive && !agent) {
  27189. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27190. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27191. this._agent = agent;
  27192. }
  27193. // if not using private agent and tunnel agent isn't setup then use global agent
  27194. if (!agent) {
  27195. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27196. }
  27197. if (usingSsl && this._ignoreSslError) {
  27198. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27199. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27200. // we have to cast it to any and change it directly
  27201. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27202. }
  27203. if (usingSsl && this._certConfig) {
  27204. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27205. }
  27206. return agent;
  27207. }
  27208. _getProxy(requestUrl) {
  27209. const parsedUrl = url.parse(requestUrl);
  27210. let usingSsl = parsedUrl.protocol === 'https:';
  27211. let proxyConfig = this._httpProxy;
  27212. // fallback to http_proxy and https_proxy env
  27213. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27214. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27215. if (!proxyConfig) {
  27216. if (https_proxy && usingSsl) {
  27217. proxyConfig = {
  27218. proxyUrl: https_proxy
  27219. };
  27220. }
  27221. else if (http_proxy) {
  27222. proxyConfig = {
  27223. proxyUrl: http_proxy
  27224. };
  27225. }
  27226. }
  27227. let proxyUrl;
  27228. let proxyAuth;
  27229. if (proxyConfig) {
  27230. if (proxyConfig.proxyUrl.length > 0) {
  27231. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27232. }
  27233. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27234. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27235. }
  27236. }
  27237. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27238. }
  27239. _isBypassProxy(requestUrl) {
  27240. if (!this._httpProxyBypassHosts) {
  27241. return false;
  27242. }
  27243. let bypass = false;
  27244. this._httpProxyBypassHosts.forEach(bypassHost => {
  27245. if (bypassHost.test(requestUrl)) {
  27246. bypass = true;
  27247. }
  27248. });
  27249. return bypass;
  27250. }
  27251. _performExponentialBackoff(retryNumber) {
  27252. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27253. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27254. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27255. }
  27256. }
  27257. exports.HttpClient = HttpClient;
  27258. /***/ }),
  27259. /***/ 881:
  27260. /***/ (function(module) {
  27261. "use strict";
  27262. const isWin = process.platform === 'win32';
  27263. function notFoundError(original, syscall) {
  27264. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27265. code: 'ENOENT',
  27266. errno: 'ENOENT',
  27267. syscall: `${syscall} ${original.command}`,
  27268. path: original.command,
  27269. spawnargs: original.args,
  27270. });
  27271. }
  27272. function hookChildProcess(cp, parsed) {
  27273. if (!isWin) {
  27274. return;
  27275. }
  27276. const originalEmit = cp.emit;
  27277. cp.emit = function (name, arg1) {
  27278. // If emitting "exit" event and exit code is 1, we need to check if
  27279. // the command exists and emit an "error" instead
  27280. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27281. if (name === 'exit') {
  27282. const err = verifyENOENT(arg1, parsed, 'spawn');
  27283. if (err) {
  27284. return originalEmit.call(cp, 'error', err);
  27285. }
  27286. }
  27287. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27288. };
  27289. }
  27290. function verifyENOENT(status, parsed) {
  27291. if (isWin && status === 1 && !parsed.file) {
  27292. return notFoundError(parsed.original, 'spawn');
  27293. }
  27294. return null;
  27295. }
  27296. function verifyENOENTSync(status, parsed) {
  27297. if (isWin && status === 1 && !parsed.file) {
  27298. return notFoundError(parsed.original, 'spawnSync');
  27299. }
  27300. return null;
  27301. }
  27302. module.exports = {
  27303. hookChildProcess,
  27304. verifyENOENT,
  27305. verifyENOENTSync,
  27306. notFoundError,
  27307. };
  27308. /***/ }),
  27309. /***/ 883:
  27310. /***/ (function(module) {
  27311. /**
  27312. * lodash (Custom Build) <https://lodash.com/>
  27313. * Build: `lodash modularize exports="npm" -o ./`
  27314. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27315. * Released under MIT license <https://lodash.com/license>
  27316. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27317. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27318. */
  27319. /** Used as the `TypeError` message for "Functions" methods. */
  27320. var FUNC_ERROR_TEXT = 'Expected a function';
  27321. /** Used to stand-in for `undefined` hash values. */
  27322. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27323. /** Used as references for various `Number` constants. */
  27324. var INFINITY = 1 / 0,
  27325. MAX_SAFE_INTEGER = 9007199254740991;
  27326. /** `Object#toString` result references. */
  27327. var funcTag = '[object Function]',
  27328. genTag = '[object GeneratorFunction]',
  27329. symbolTag = '[object Symbol]';
  27330. /** Used to match property names within property paths. */
  27331. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27332. reIsPlainProp = /^\w*$/,
  27333. reLeadingDot = /^\./,
  27334. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27335. /**
  27336. * Used to match `RegExp`
  27337. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27338. */
  27339. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27340. /** Used to match backslashes in property paths. */
  27341. var reEscapeChar = /\\(\\)?/g;
  27342. /** Used to detect host constructors (Safari). */
  27343. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27344. /** Used to detect unsigned integer values. */
  27345. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27346. /** Detect free variable `global` from Node.js. */
  27347. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27348. /** Detect free variable `self`. */
  27349. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27350. /** Used as a reference to the global object. */
  27351. var root = freeGlobal || freeSelf || Function('return this')();
  27352. /**
  27353. * Gets the value at `key` of `object`.
  27354. *
  27355. * @private
  27356. * @param {Object} [object] The object to query.
  27357. * @param {string} key The key of the property to get.
  27358. * @returns {*} Returns the property value.
  27359. */
  27360. function getValue(object, key) {
  27361. return object == null ? undefined : object[key];
  27362. }
  27363. /**
  27364. * Checks if `value` is a host object in IE < 9.
  27365. *
  27366. * @private
  27367. * @param {*} value The value to check.
  27368. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27369. */
  27370. function isHostObject(value) {
  27371. // Many host objects are `Object` objects that can coerce to strings
  27372. // despite having improperly defined `toString` methods.
  27373. var result = false;
  27374. if (value != null && typeof value.toString != 'function') {
  27375. try {
  27376. result = !!(value + '');
  27377. } catch (e) {}
  27378. }
  27379. return result;
  27380. }
  27381. /** Used for built-in method references. */
  27382. var arrayProto = Array.prototype,
  27383. funcProto = Function.prototype,
  27384. objectProto = Object.prototype;
  27385. /** Used to detect overreaching core-js shims. */
  27386. var coreJsData = root['__core-js_shared__'];
  27387. /** Used to detect methods masquerading as native. */
  27388. var maskSrcKey = (function() {
  27389. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27390. return uid ? ('Symbol(src)_1.' + uid) : '';
  27391. }());
  27392. /** Used to resolve the decompiled source of functions. */
  27393. var funcToString = funcProto.toString;
  27394. /** Used to check objects for own properties. */
  27395. var hasOwnProperty = objectProto.hasOwnProperty;
  27396. /**
  27397. * Used to resolve the
  27398. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27399. * of values.
  27400. */
  27401. var objectToString = objectProto.toString;
  27402. /** Used to detect if a method is native. */
  27403. var reIsNative = RegExp('^' +
  27404. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27405. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27406. );
  27407. /** Built-in value references. */
  27408. var Symbol = root.Symbol,
  27409. splice = arrayProto.splice;
  27410. /* Built-in method references that are verified to be native. */
  27411. var Map = getNative(root, 'Map'),
  27412. nativeCreate = getNative(Object, 'create');
  27413. /** Used to convert symbols to primitives and strings. */
  27414. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27415. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27416. /**
  27417. * Creates a hash object.
  27418. *
  27419. * @private
  27420. * @constructor
  27421. * @param {Array} [entries] The key-value pairs to cache.
  27422. */
  27423. function Hash(entries) {
  27424. var index = -1,
  27425. length = entries ? entries.length : 0;
  27426. this.clear();
  27427. while (++index < length) {
  27428. var entry = entries[index];
  27429. this.set(entry[0], entry[1]);
  27430. }
  27431. }
  27432. /**
  27433. * Removes all key-value entries from the hash.
  27434. *
  27435. * @private
  27436. * @name clear
  27437. * @memberOf Hash
  27438. */
  27439. function hashClear() {
  27440. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27441. }
  27442. /**
  27443. * Removes `key` and its value from the hash.
  27444. *
  27445. * @private
  27446. * @name delete
  27447. * @memberOf Hash
  27448. * @param {Object} hash The hash to modify.
  27449. * @param {string} key The key of the value to remove.
  27450. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27451. */
  27452. function hashDelete(key) {
  27453. return this.has(key) && delete this.__data__[key];
  27454. }
  27455. /**
  27456. * Gets the hash value for `key`.
  27457. *
  27458. * @private
  27459. * @name get
  27460. * @memberOf Hash
  27461. * @param {string} key The key of the value to get.
  27462. * @returns {*} Returns the entry value.
  27463. */
  27464. function hashGet(key) {
  27465. var data = this.__data__;
  27466. if (nativeCreate) {
  27467. var result = data[key];
  27468. return result === HASH_UNDEFINED ? undefined : result;
  27469. }
  27470. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27471. }
  27472. /**
  27473. * Checks if a hash value for `key` exists.
  27474. *
  27475. * @private
  27476. * @name has
  27477. * @memberOf Hash
  27478. * @param {string} key The key of the entry to check.
  27479. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27480. */
  27481. function hashHas(key) {
  27482. var data = this.__data__;
  27483. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27484. }
  27485. /**
  27486. * Sets the hash `key` to `value`.
  27487. *
  27488. * @private
  27489. * @name set
  27490. * @memberOf Hash
  27491. * @param {string} key The key of the value to set.
  27492. * @param {*} value The value to set.
  27493. * @returns {Object} Returns the hash instance.
  27494. */
  27495. function hashSet(key, value) {
  27496. var data = this.__data__;
  27497. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27498. return this;
  27499. }
  27500. // Add methods to `Hash`.
  27501. Hash.prototype.clear = hashClear;
  27502. Hash.prototype['delete'] = hashDelete;
  27503. Hash.prototype.get = hashGet;
  27504. Hash.prototype.has = hashHas;
  27505. Hash.prototype.set = hashSet;
  27506. /**
  27507. * Creates an list cache object.
  27508. *
  27509. * @private
  27510. * @constructor
  27511. * @param {Array} [entries] The key-value pairs to cache.
  27512. */
  27513. function ListCache(entries) {
  27514. var index = -1,
  27515. length = entries ? entries.length : 0;
  27516. this.clear();
  27517. while (++index < length) {
  27518. var entry = entries[index];
  27519. this.set(entry[0], entry[1]);
  27520. }
  27521. }
  27522. /**
  27523. * Removes all key-value entries from the list cache.
  27524. *
  27525. * @private
  27526. * @name clear
  27527. * @memberOf ListCache
  27528. */
  27529. function listCacheClear() {
  27530. this.__data__ = [];
  27531. }
  27532. /**
  27533. * Removes `key` and its value from the list cache.
  27534. *
  27535. * @private
  27536. * @name delete
  27537. * @memberOf ListCache
  27538. * @param {string} key The key of the value to remove.
  27539. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27540. */
  27541. function listCacheDelete(key) {
  27542. var data = this.__data__,
  27543. index = assocIndexOf(data, key);
  27544. if (index < 0) {
  27545. return false;
  27546. }
  27547. var lastIndex = data.length - 1;
  27548. if (index == lastIndex) {
  27549. data.pop();
  27550. } else {
  27551. splice.call(data, index, 1);
  27552. }
  27553. return true;
  27554. }
  27555. /**
  27556. * Gets the list cache value for `key`.
  27557. *
  27558. * @private
  27559. * @name get
  27560. * @memberOf ListCache
  27561. * @param {string} key The key of the value to get.
  27562. * @returns {*} Returns the entry value.
  27563. */
  27564. function listCacheGet(key) {
  27565. var data = this.__data__,
  27566. index = assocIndexOf(data, key);
  27567. return index < 0 ? undefined : data[index][1];
  27568. }
  27569. /**
  27570. * Checks if a list cache value for `key` exists.
  27571. *
  27572. * @private
  27573. * @name has
  27574. * @memberOf ListCache
  27575. * @param {string} key The key of the entry to check.
  27576. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27577. */
  27578. function listCacheHas(key) {
  27579. return assocIndexOf(this.__data__, key) > -1;
  27580. }
  27581. /**
  27582. * Sets the list cache `key` to `value`.
  27583. *
  27584. * @private
  27585. * @name set
  27586. * @memberOf ListCache
  27587. * @param {string} key The key of the value to set.
  27588. * @param {*} value The value to set.
  27589. * @returns {Object} Returns the list cache instance.
  27590. */
  27591. function listCacheSet(key, value) {
  27592. var data = this.__data__,
  27593. index = assocIndexOf(data, key);
  27594. if (index < 0) {
  27595. data.push([key, value]);
  27596. } else {
  27597. data[index][1] = value;
  27598. }
  27599. return this;
  27600. }
  27601. // Add methods to `ListCache`.
  27602. ListCache.prototype.clear = listCacheClear;
  27603. ListCache.prototype['delete'] = listCacheDelete;
  27604. ListCache.prototype.get = listCacheGet;
  27605. ListCache.prototype.has = listCacheHas;
  27606. ListCache.prototype.set = listCacheSet;
  27607. /**
  27608. * Creates a map cache object to store key-value pairs.
  27609. *
  27610. * @private
  27611. * @constructor
  27612. * @param {Array} [entries] The key-value pairs to cache.
  27613. */
  27614. function MapCache(entries) {
  27615. var index = -1,
  27616. length = entries ? entries.length : 0;
  27617. this.clear();
  27618. while (++index < length) {
  27619. var entry = entries[index];
  27620. this.set(entry[0], entry[1]);
  27621. }
  27622. }
  27623. /**
  27624. * Removes all key-value entries from the map.
  27625. *
  27626. * @private
  27627. * @name clear
  27628. * @memberOf MapCache
  27629. */
  27630. function mapCacheClear() {
  27631. this.__data__ = {
  27632. 'hash': new Hash,
  27633. 'map': new (Map || ListCache),
  27634. 'string': new Hash
  27635. };
  27636. }
  27637. /**
  27638. * Removes `key` and its value from the map.
  27639. *
  27640. * @private
  27641. * @name delete
  27642. * @memberOf MapCache
  27643. * @param {string} key The key of the value to remove.
  27644. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27645. */
  27646. function mapCacheDelete(key) {
  27647. return getMapData(this, key)['delete'](key);
  27648. }
  27649. /**
  27650. * Gets the map value for `key`.
  27651. *
  27652. * @private
  27653. * @name get
  27654. * @memberOf MapCache
  27655. * @param {string} key The key of the value to get.
  27656. * @returns {*} Returns the entry value.
  27657. */
  27658. function mapCacheGet(key) {
  27659. return getMapData(this, key).get(key);
  27660. }
  27661. /**
  27662. * Checks if a map value for `key` exists.
  27663. *
  27664. * @private
  27665. * @name has
  27666. * @memberOf MapCache
  27667. * @param {string} key The key of the entry to check.
  27668. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27669. */
  27670. function mapCacheHas(key) {
  27671. return getMapData(this, key).has(key);
  27672. }
  27673. /**
  27674. * Sets the map `key` to `value`.
  27675. *
  27676. * @private
  27677. * @name set
  27678. * @memberOf MapCache
  27679. * @param {string} key The key of the value to set.
  27680. * @param {*} value The value to set.
  27681. * @returns {Object} Returns the map cache instance.
  27682. */
  27683. function mapCacheSet(key, value) {
  27684. getMapData(this, key).set(key, value);
  27685. return this;
  27686. }
  27687. // Add methods to `MapCache`.
  27688. MapCache.prototype.clear = mapCacheClear;
  27689. MapCache.prototype['delete'] = mapCacheDelete;
  27690. MapCache.prototype.get = mapCacheGet;
  27691. MapCache.prototype.has = mapCacheHas;
  27692. MapCache.prototype.set = mapCacheSet;
  27693. /**
  27694. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27695. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27696. * for equality comparisons.
  27697. *
  27698. * @private
  27699. * @param {Object} object The object to modify.
  27700. * @param {string} key The key of the property to assign.
  27701. * @param {*} value The value to assign.
  27702. */
  27703. function assignValue(object, key, value) {
  27704. var objValue = object[key];
  27705. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27706. (value === undefined && !(key in object))) {
  27707. object[key] = value;
  27708. }
  27709. }
  27710. /**
  27711. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27712. *
  27713. * @private
  27714. * @param {Array} array The array to inspect.
  27715. * @param {*} key The key to search for.
  27716. * @returns {number} Returns the index of the matched value, else `-1`.
  27717. */
  27718. function assocIndexOf(array, key) {
  27719. var length = array.length;
  27720. while (length--) {
  27721. if (eq(array[length][0], key)) {
  27722. return length;
  27723. }
  27724. }
  27725. return -1;
  27726. }
  27727. /**
  27728. * The base implementation of `_.isNative` without bad shim checks.
  27729. *
  27730. * @private
  27731. * @param {*} value The value to check.
  27732. * @returns {boolean} Returns `true` if `value` is a native function,
  27733. * else `false`.
  27734. */
  27735. function baseIsNative(value) {
  27736. if (!isObject(value) || isMasked(value)) {
  27737. return false;
  27738. }
  27739. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27740. return pattern.test(toSource(value));
  27741. }
  27742. /**
  27743. * The base implementation of `_.set`.
  27744. *
  27745. * @private
  27746. * @param {Object} object The object to modify.
  27747. * @param {Array|string} path The path of the property to set.
  27748. * @param {*} value The value to set.
  27749. * @param {Function} [customizer] The function to customize path creation.
  27750. * @returns {Object} Returns `object`.
  27751. */
  27752. function baseSet(object, path, value, customizer) {
  27753. if (!isObject(object)) {
  27754. return object;
  27755. }
  27756. path = isKey(path, object) ? [path] : castPath(path);
  27757. var index = -1,
  27758. length = path.length,
  27759. lastIndex = length - 1,
  27760. nested = object;
  27761. while (nested != null && ++index < length) {
  27762. var key = toKey(path[index]),
  27763. newValue = value;
  27764. if (index != lastIndex) {
  27765. var objValue = nested[key];
  27766. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27767. if (newValue === undefined) {
  27768. newValue = isObject(objValue)
  27769. ? objValue
  27770. : (isIndex(path[index + 1]) ? [] : {});
  27771. }
  27772. }
  27773. assignValue(nested, key, newValue);
  27774. nested = nested[key];
  27775. }
  27776. return object;
  27777. }
  27778. /**
  27779. * The base implementation of `_.toString` which doesn't convert nullish
  27780. * values to empty strings.
  27781. *
  27782. * @private
  27783. * @param {*} value The value to process.
  27784. * @returns {string} Returns the string.
  27785. */
  27786. function baseToString(value) {
  27787. // Exit early for strings to avoid a performance hit in some environments.
  27788. if (typeof value == 'string') {
  27789. return value;
  27790. }
  27791. if (isSymbol(value)) {
  27792. return symbolToString ? symbolToString.call(value) : '';
  27793. }
  27794. var result = (value + '');
  27795. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27796. }
  27797. /**
  27798. * Casts `value` to a path array if it's not one.
  27799. *
  27800. * @private
  27801. * @param {*} value The value to inspect.
  27802. * @returns {Array} Returns the cast property path array.
  27803. */
  27804. function castPath(value) {
  27805. return isArray(value) ? value : stringToPath(value);
  27806. }
  27807. /**
  27808. * Gets the data for `map`.
  27809. *
  27810. * @private
  27811. * @param {Object} map The map to query.
  27812. * @param {string} key The reference key.
  27813. * @returns {*} Returns the map data.
  27814. */
  27815. function getMapData(map, key) {
  27816. var data = map.__data__;
  27817. return isKeyable(key)
  27818. ? data[typeof key == 'string' ? 'string' : 'hash']
  27819. : data.map;
  27820. }
  27821. /**
  27822. * Gets the native function at `key` of `object`.
  27823. *
  27824. * @private
  27825. * @param {Object} object The object to query.
  27826. * @param {string} key The key of the method to get.
  27827. * @returns {*} Returns the function if it's native, else `undefined`.
  27828. */
  27829. function getNative(object, key) {
  27830. var value = getValue(object, key);
  27831. return baseIsNative(value) ? value : undefined;
  27832. }
  27833. /**
  27834. * Checks if `value` is a valid array-like index.
  27835. *
  27836. * @private
  27837. * @param {*} value The value to check.
  27838. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27839. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27840. */
  27841. function isIndex(value, length) {
  27842. length = length == null ? MAX_SAFE_INTEGER : length;
  27843. return !!length &&
  27844. (typeof value == 'number' || reIsUint.test(value)) &&
  27845. (value > -1 && value % 1 == 0 && value < length);
  27846. }
  27847. /**
  27848. * Checks if `value` is a property name and not a property path.
  27849. *
  27850. * @private
  27851. * @param {*} value The value to check.
  27852. * @param {Object} [object] The object to query keys on.
  27853. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27854. */
  27855. function isKey(value, object) {
  27856. if (isArray(value)) {
  27857. return false;
  27858. }
  27859. var type = typeof value;
  27860. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27861. value == null || isSymbol(value)) {
  27862. return true;
  27863. }
  27864. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27865. (object != null && value in Object(object));
  27866. }
  27867. /**
  27868. * Checks if `value` is suitable for use as unique object key.
  27869. *
  27870. * @private
  27871. * @param {*} value The value to check.
  27872. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27873. */
  27874. function isKeyable(value) {
  27875. var type = typeof value;
  27876. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27877. ? (value !== '__proto__')
  27878. : (value === null);
  27879. }
  27880. /**
  27881. * Checks if `func` has its source masked.
  27882. *
  27883. * @private
  27884. * @param {Function} func The function to check.
  27885. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27886. */
  27887. function isMasked(func) {
  27888. return !!maskSrcKey && (maskSrcKey in func);
  27889. }
  27890. /**
  27891. * Converts `string` to a property path array.
  27892. *
  27893. * @private
  27894. * @param {string} string The string to convert.
  27895. * @returns {Array} Returns the property path array.
  27896. */
  27897. var stringToPath = memoize(function(string) {
  27898. string = toString(string);
  27899. var result = [];
  27900. if (reLeadingDot.test(string)) {
  27901. result.push('');
  27902. }
  27903. string.replace(rePropName, function(match, number, quote, string) {
  27904. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27905. });
  27906. return result;
  27907. });
  27908. /**
  27909. * Converts `value` to a string key if it's not a string or symbol.
  27910. *
  27911. * @private
  27912. * @param {*} value The value to inspect.
  27913. * @returns {string|symbol} Returns the key.
  27914. */
  27915. function toKey(value) {
  27916. if (typeof value == 'string' || isSymbol(value)) {
  27917. return value;
  27918. }
  27919. var result = (value + '');
  27920. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27921. }
  27922. /**
  27923. * Converts `func` to its source code.
  27924. *
  27925. * @private
  27926. * @param {Function} func The function to process.
  27927. * @returns {string} Returns the source code.
  27928. */
  27929. function toSource(func) {
  27930. if (func != null) {
  27931. try {
  27932. return funcToString.call(func);
  27933. } catch (e) {}
  27934. try {
  27935. return (func + '');
  27936. } catch (e) {}
  27937. }
  27938. return '';
  27939. }
  27940. /**
  27941. * Creates a function that memoizes the result of `func`. If `resolver` is
  27942. * provided, it determines the cache key for storing the result based on the
  27943. * arguments provided to the memoized function. By default, the first argument
  27944. * provided to the memoized function is used as the map cache key. The `func`
  27945. * is invoked with the `this` binding of the memoized function.
  27946. *
  27947. * **Note:** The cache is exposed as the `cache` property on the memoized
  27948. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27949. * constructor with one whose instances implement the
  27950. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27951. * method interface of `delete`, `get`, `has`, and `set`.
  27952. *
  27953. * @static
  27954. * @memberOf _
  27955. * @since 0.1.0
  27956. * @category Function
  27957. * @param {Function} func The function to have its output memoized.
  27958. * @param {Function} [resolver] The function to resolve the cache key.
  27959. * @returns {Function} Returns the new memoized function.
  27960. * @example
  27961. *
  27962. * var object = { 'a': 1, 'b': 2 };
  27963. * var other = { 'c': 3, 'd': 4 };
  27964. *
  27965. * var values = _.memoize(_.values);
  27966. * values(object);
  27967. * // => [1, 2]
  27968. *
  27969. * values(other);
  27970. * // => [3, 4]
  27971. *
  27972. * object.a = 2;
  27973. * values(object);
  27974. * // => [1, 2]
  27975. *
  27976. * // Modify the result cache.
  27977. * values.cache.set(object, ['a', 'b']);
  27978. * values(object);
  27979. * // => ['a', 'b']
  27980. *
  27981. * // Replace `_.memoize.Cache`.
  27982. * _.memoize.Cache = WeakMap;
  27983. */
  27984. function memoize(func, resolver) {
  27985. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  27986. throw new TypeError(FUNC_ERROR_TEXT);
  27987. }
  27988. var memoized = function() {
  27989. var args = arguments,
  27990. key = resolver ? resolver.apply(this, args) : args[0],
  27991. cache = memoized.cache;
  27992. if (cache.has(key)) {
  27993. return cache.get(key);
  27994. }
  27995. var result = func.apply(this, args);
  27996. memoized.cache = cache.set(key, result);
  27997. return result;
  27998. };
  27999. memoized.cache = new (memoize.Cache || MapCache);
  28000. return memoized;
  28001. }
  28002. // Assign cache to `_.memoize`.
  28003. memoize.Cache = MapCache;
  28004. /**
  28005. * Performs a
  28006. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28007. * comparison between two values to determine if they are equivalent.
  28008. *
  28009. * @static
  28010. * @memberOf _
  28011. * @since 4.0.0
  28012. * @category Lang
  28013. * @param {*} value The value to compare.
  28014. * @param {*} other The other value to compare.
  28015. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28016. * @example
  28017. *
  28018. * var object = { 'a': 1 };
  28019. * var other = { 'a': 1 };
  28020. *
  28021. * _.eq(object, object);
  28022. * // => true
  28023. *
  28024. * _.eq(object, other);
  28025. * // => false
  28026. *
  28027. * _.eq('a', 'a');
  28028. * // => true
  28029. *
  28030. * _.eq('a', Object('a'));
  28031. * // => false
  28032. *
  28033. * _.eq(NaN, NaN);
  28034. * // => true
  28035. */
  28036. function eq(value, other) {
  28037. return value === other || (value !== value && other !== other);
  28038. }
  28039. /**
  28040. * Checks if `value` is classified as an `Array` object.
  28041. *
  28042. * @static
  28043. * @memberOf _
  28044. * @since 0.1.0
  28045. * @category Lang
  28046. * @param {*} value The value to check.
  28047. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28048. * @example
  28049. *
  28050. * _.isArray([1, 2, 3]);
  28051. * // => true
  28052. *
  28053. * _.isArray(document.body.children);
  28054. * // => false
  28055. *
  28056. * _.isArray('abc');
  28057. * // => false
  28058. *
  28059. * _.isArray(_.noop);
  28060. * // => false
  28061. */
  28062. var isArray = Array.isArray;
  28063. /**
  28064. * Checks if `value` is classified as a `Function` object.
  28065. *
  28066. * @static
  28067. * @memberOf _
  28068. * @since 0.1.0
  28069. * @category Lang
  28070. * @param {*} value The value to check.
  28071. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28072. * @example
  28073. *
  28074. * _.isFunction(_);
  28075. * // => true
  28076. *
  28077. * _.isFunction(/abc/);
  28078. * // => false
  28079. */
  28080. function isFunction(value) {
  28081. // The use of `Object#toString` avoids issues with the `typeof` operator
  28082. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28083. var tag = isObject(value) ? objectToString.call(value) : '';
  28084. return tag == funcTag || tag == genTag;
  28085. }
  28086. /**
  28087. * Checks if `value` is the
  28088. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28089. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28090. *
  28091. * @static
  28092. * @memberOf _
  28093. * @since 0.1.0
  28094. * @category Lang
  28095. * @param {*} value The value to check.
  28096. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28097. * @example
  28098. *
  28099. * _.isObject({});
  28100. * // => true
  28101. *
  28102. * _.isObject([1, 2, 3]);
  28103. * // => true
  28104. *
  28105. * _.isObject(_.noop);
  28106. * // => true
  28107. *
  28108. * _.isObject(null);
  28109. * // => false
  28110. */
  28111. function isObject(value) {
  28112. var type = typeof value;
  28113. return !!value && (type == 'object' || type == 'function');
  28114. }
  28115. /**
  28116. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28117. * and has a `typeof` result of "object".
  28118. *
  28119. * @static
  28120. * @memberOf _
  28121. * @since 4.0.0
  28122. * @category Lang
  28123. * @param {*} value The value to check.
  28124. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28125. * @example
  28126. *
  28127. * _.isObjectLike({});
  28128. * // => true
  28129. *
  28130. * _.isObjectLike([1, 2, 3]);
  28131. * // => true
  28132. *
  28133. * _.isObjectLike(_.noop);
  28134. * // => false
  28135. *
  28136. * _.isObjectLike(null);
  28137. * // => false
  28138. */
  28139. function isObjectLike(value) {
  28140. return !!value && typeof value == 'object';
  28141. }
  28142. /**
  28143. * Checks if `value` is classified as a `Symbol` primitive or object.
  28144. *
  28145. * @static
  28146. * @memberOf _
  28147. * @since 4.0.0
  28148. * @category Lang
  28149. * @param {*} value The value to check.
  28150. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28151. * @example
  28152. *
  28153. * _.isSymbol(Symbol.iterator);
  28154. * // => true
  28155. *
  28156. * _.isSymbol('abc');
  28157. * // => false
  28158. */
  28159. function isSymbol(value) {
  28160. return typeof value == 'symbol' ||
  28161. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28162. }
  28163. /**
  28164. * Converts `value` to a string. An empty string is returned for `null`
  28165. * and `undefined` values. The sign of `-0` is preserved.
  28166. *
  28167. * @static
  28168. * @memberOf _
  28169. * @since 4.0.0
  28170. * @category Lang
  28171. * @param {*} value The value to process.
  28172. * @returns {string} Returns the string.
  28173. * @example
  28174. *
  28175. * _.toString(null);
  28176. * // => ''
  28177. *
  28178. * _.toString(-0);
  28179. * // => '-0'
  28180. *
  28181. * _.toString([1, 2, 3]);
  28182. * // => '1,2,3'
  28183. */
  28184. function toString(value) {
  28185. return value == null ? '' : baseToString(value);
  28186. }
  28187. /**
  28188. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28189. * it's created. Arrays are created for missing index properties while objects
  28190. * are created for all other missing properties. Use `_.setWith` to customize
  28191. * `path` creation.
  28192. *
  28193. * **Note:** This method mutates `object`.
  28194. *
  28195. * @static
  28196. * @memberOf _
  28197. * @since 3.7.0
  28198. * @category Object
  28199. * @param {Object} object The object to modify.
  28200. * @param {Array|string} path The path of the property to set.
  28201. * @param {*} value The value to set.
  28202. * @returns {Object} Returns `object`.
  28203. * @example
  28204. *
  28205. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28206. *
  28207. * _.set(object, 'a[0].b.c', 4);
  28208. * console.log(object.a[0].b.c);
  28209. * // => 4
  28210. *
  28211. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28212. * console.log(object.x[0].y.z);
  28213. * // => 5
  28214. */
  28215. function set(object, path, value) {
  28216. return object == null ? object : baseSet(object, path, value);
  28217. }
  28218. module.exports = set;
  28219. /***/ }),
  28220. /***/ 898:
  28221. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28222. "use strict";
  28223. Object.defineProperty(exports, '__esModule', { value: true });
  28224. var request = __webpack_require__(753);
  28225. var universalUserAgent = __webpack_require__(796);
  28226. const VERSION = "4.3.1";
  28227. class GraphqlError extends Error {
  28228. constructor(request, response) {
  28229. const message = response.data.errors[0].message;
  28230. super(message);
  28231. Object.assign(this, response.data);
  28232. this.name = "GraphqlError";
  28233. this.request = request; // Maintains proper stack trace (only available on V8)
  28234. /* istanbul ignore next */
  28235. if (Error.captureStackTrace) {
  28236. Error.captureStackTrace(this, this.constructor);
  28237. }
  28238. }
  28239. }
  28240. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28241. function graphql(request, query, options) {
  28242. options = typeof query === "string" ? options = Object.assign({
  28243. query
  28244. }, options) : options = query;
  28245. const requestOptions = Object.keys(options).reduce((result, key) => {
  28246. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28247. result[key] = options[key];
  28248. return result;
  28249. }
  28250. if (!result.variables) {
  28251. result.variables = {};
  28252. }
  28253. result.variables[key] = options[key];
  28254. return result;
  28255. }, {});
  28256. return request(requestOptions).then(response => {
  28257. if (response.data.errors) {
  28258. throw new GraphqlError(requestOptions, {
  28259. data: response.data
  28260. });
  28261. }
  28262. return response.data.data;
  28263. });
  28264. }
  28265. function withDefaults(request$1, newDefaults) {
  28266. const newRequest = request$1.defaults(newDefaults);
  28267. const newApi = (query, options) => {
  28268. return graphql(newRequest, query, options);
  28269. };
  28270. return Object.assign(newApi, {
  28271. defaults: withDefaults.bind(null, newRequest),
  28272. endpoint: request.request.endpoint
  28273. });
  28274. }
  28275. const graphql$1 = withDefaults(request.request, {
  28276. headers: {
  28277. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28278. },
  28279. method: "POST",
  28280. url: "/graphql"
  28281. });
  28282. function withCustomRequest(customRequest) {
  28283. return withDefaults(customRequest, {
  28284. method: "POST",
  28285. url: "/graphql"
  28286. });
  28287. }
  28288. exports.graphql = graphql$1;
  28289. exports.withCustomRequest = withCustomRequest;
  28290. //# sourceMappingURL=index.js.map
  28291. /***/ }),
  28292. /***/ 916:
  28293. /***/ (function(__unusedmodule, exports) {
  28294. "use strict";
  28295. Object.defineProperty(exports, '__esModule', { value: true });
  28296. const VERSION = "1.0.0";
  28297. /**
  28298. * @param octokit Octokit instance
  28299. * @param options Options passed to Octokit constructor
  28300. */
  28301. function requestLog(octokit) {
  28302. octokit.hook.wrap("request", (request, options) => {
  28303. octokit.log.debug("request", options);
  28304. const start = Date.now();
  28305. const requestOptions = octokit.request.endpoint.parse(options);
  28306. const path = requestOptions.url.replace(options.baseUrl, "");
  28307. return request(options).then(response => {
  28308. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28309. return response;
  28310. }).catch(error => {
  28311. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28312. throw error;
  28313. });
  28314. });
  28315. }
  28316. requestLog.VERSION = VERSION;
  28317. exports.requestLog = requestLog;
  28318. //# sourceMappingURL=index.js.map
  28319. /***/ }),
  28320. /***/ 929:
  28321. /***/ (function(module, __unusedexports, __webpack_require__) {
  28322. module.exports = hasNextPage
  28323. const deprecate = __webpack_require__(370)
  28324. const getPageLinks = __webpack_require__(577)
  28325. function hasNextPage (link) {
  28326. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28327. return getPageLinks(link).next
  28328. }
  28329. /***/ }),
  28330. /***/ 948:
  28331. /***/ (function(module) {
  28332. "use strict";
  28333. /**
  28334. * Tries to execute a function and discards any error that occurs.
  28335. * @param {Function} fn - Function that might or might not throw an error.
  28336. * @returns {?*} Return-value of the function when no error occurred.
  28337. */
  28338. module.exports = function(fn) {
  28339. try { return fn() } catch (e) {}
  28340. }
  28341. /***/ }),
  28342. /***/ 950:
  28343. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28344. "use strict";
  28345. Object.defineProperty(exports, "__esModule", { value: true });
  28346. const url = __webpack_require__(835);
  28347. function getProxyUrl(reqUrl) {
  28348. let usingSsl = reqUrl.protocol === 'https:';
  28349. let proxyUrl;
  28350. if (checkBypass(reqUrl)) {
  28351. return proxyUrl;
  28352. }
  28353. let proxyVar;
  28354. if (usingSsl) {
  28355. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28356. }
  28357. else {
  28358. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28359. }
  28360. if (proxyVar) {
  28361. proxyUrl = url.parse(proxyVar);
  28362. }
  28363. return proxyUrl;
  28364. }
  28365. exports.getProxyUrl = getProxyUrl;
  28366. function checkBypass(reqUrl) {
  28367. if (!reqUrl.hostname) {
  28368. return false;
  28369. }
  28370. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28371. if (!noProxy) {
  28372. return false;
  28373. }
  28374. // Determine the request port
  28375. let reqPort;
  28376. if (reqUrl.port) {
  28377. reqPort = Number(reqUrl.port);
  28378. }
  28379. else if (reqUrl.protocol === 'http:') {
  28380. reqPort = 80;
  28381. }
  28382. else if (reqUrl.protocol === 'https:') {
  28383. reqPort = 443;
  28384. }
  28385. // Format the request hostname and hostname with port
  28386. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28387. if (typeof reqPort === 'number') {
  28388. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28389. }
  28390. // Compare request host against noproxy
  28391. for (let upperNoProxyItem of noProxy
  28392. .split(',')
  28393. .map(x => x.trim().toUpperCase())
  28394. .filter(x => x)) {
  28395. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28396. return true;
  28397. }
  28398. }
  28399. return false;
  28400. }
  28401. exports.checkBypass = checkBypass;
  28402. /***/ }),
  28403. /***/ 954:
  28404. /***/ (function(module) {
  28405. module.exports = validateAuth;
  28406. function validateAuth(auth) {
  28407. if (typeof auth === "string") {
  28408. return;
  28409. }
  28410. if (typeof auth === "function") {
  28411. return;
  28412. }
  28413. if (auth.username && auth.password) {
  28414. return;
  28415. }
  28416. if (auth.clientId && auth.clientSecret) {
  28417. return;
  28418. }
  28419. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28420. }
  28421. /***/ }),
  28422. /***/ 955:
  28423. /***/ (function(module, __unusedexports, __webpack_require__) {
  28424. "use strict";
  28425. const path = __webpack_require__(622);
  28426. const childProcess = __webpack_require__(129);
  28427. const crossSpawn = __webpack_require__(20);
  28428. const stripEof = __webpack_require__(768);
  28429. const npmRunPath = __webpack_require__(621);
  28430. const isStream = __webpack_require__(323);
  28431. const _getStream = __webpack_require__(145);
  28432. const pFinally = __webpack_require__(697);
  28433. const onExit = __webpack_require__(260);
  28434. const errname = __webpack_require__(427);
  28435. const stdio = __webpack_require__(168);
  28436. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28437. function handleArgs(cmd, args, opts) {
  28438. let parsed;
  28439. opts = Object.assign({
  28440. extendEnv: true,
  28441. env: {}
  28442. }, opts);
  28443. if (opts.extendEnv) {
  28444. opts.env = Object.assign({}, process.env, opts.env);
  28445. }
  28446. if (opts.__winShell === true) {
  28447. delete opts.__winShell;
  28448. parsed = {
  28449. command: cmd,
  28450. args,
  28451. options: opts,
  28452. file: cmd,
  28453. original: {
  28454. cmd,
  28455. args
  28456. }
  28457. };
  28458. } else {
  28459. parsed = crossSpawn._parse(cmd, args, opts);
  28460. }
  28461. opts = Object.assign({
  28462. maxBuffer: TEN_MEGABYTES,
  28463. buffer: true,
  28464. stripEof: true,
  28465. preferLocal: true,
  28466. localDir: parsed.options.cwd || process.cwd(),
  28467. encoding: 'utf8',
  28468. reject: true,
  28469. cleanup: true
  28470. }, parsed.options);
  28471. opts.stdio = stdio(opts);
  28472. if (opts.preferLocal) {
  28473. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28474. }
  28475. if (opts.detached) {
  28476. // #115
  28477. opts.cleanup = false;
  28478. }
  28479. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28480. // #116
  28481. parsed.args.unshift('/q');
  28482. }
  28483. return {
  28484. cmd: parsed.command,
  28485. args: parsed.args,
  28486. opts,
  28487. parsed
  28488. };
  28489. }
  28490. function handleInput(spawned, input) {
  28491. if (input === null || input === undefined) {
  28492. return;
  28493. }
  28494. if (isStream(input)) {
  28495. input.pipe(spawned.stdin);
  28496. } else {
  28497. spawned.stdin.end(input);
  28498. }
  28499. }
  28500. function handleOutput(opts, val) {
  28501. if (val && opts.stripEof) {
  28502. val = stripEof(val);
  28503. }
  28504. return val;
  28505. }
  28506. function handleShell(fn, cmd, opts) {
  28507. let file = '/bin/sh';
  28508. let args = ['-c', cmd];
  28509. opts = Object.assign({}, opts);
  28510. if (process.platform === 'win32') {
  28511. opts.__winShell = true;
  28512. file = process.env.comspec || 'cmd.exe';
  28513. args = ['/s', '/c', `"${cmd}"`];
  28514. opts.windowsVerbatimArguments = true;
  28515. }
  28516. if (opts.shell) {
  28517. file = opts.shell;
  28518. delete opts.shell;
  28519. }
  28520. return fn(file, args, opts);
  28521. }
  28522. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28523. if (!process[stream]) {
  28524. return null;
  28525. }
  28526. let ret;
  28527. if (!buffer) {
  28528. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28529. ret = new Promise((resolve, reject) => {
  28530. process[stream]
  28531. .once('end', resolve)
  28532. .once('error', reject);
  28533. });
  28534. } else if (encoding) {
  28535. ret = _getStream(process[stream], {
  28536. encoding,
  28537. maxBuffer
  28538. });
  28539. } else {
  28540. ret = _getStream.buffer(process[stream], {maxBuffer});
  28541. }
  28542. return ret.catch(err => {
  28543. err.stream = stream;
  28544. err.message = `${stream} ${err.message}`;
  28545. throw err;
  28546. });
  28547. }
  28548. function makeError(result, options) {
  28549. const {stdout, stderr} = result;
  28550. let err = result.error;
  28551. const {code, signal} = result;
  28552. const {parsed, joinedCmd} = options;
  28553. const timedOut = options.timedOut || false;
  28554. if (!err) {
  28555. let output = '';
  28556. if (Array.isArray(parsed.opts.stdio)) {
  28557. if (parsed.opts.stdio[2] !== 'inherit') {
  28558. output += output.length > 0 ? stderr : `\n${stderr}`;
  28559. }
  28560. if (parsed.opts.stdio[1] !== 'inherit') {
  28561. output += `\n${stdout}`;
  28562. }
  28563. } else if (parsed.opts.stdio !== 'inherit') {
  28564. output = `\n${stderr}${stdout}`;
  28565. }
  28566. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28567. err.code = code < 0 ? errname(code) : code;
  28568. }
  28569. err.stdout = stdout;
  28570. err.stderr = stderr;
  28571. err.failed = true;
  28572. err.signal = signal || null;
  28573. err.cmd = joinedCmd;
  28574. err.timedOut = timedOut;
  28575. return err;
  28576. }
  28577. function joinCmd(cmd, args) {
  28578. let joinedCmd = cmd;
  28579. if (Array.isArray(args) && args.length > 0) {
  28580. joinedCmd += ' ' + args.join(' ');
  28581. }
  28582. return joinedCmd;
  28583. }
  28584. module.exports = (cmd, args, opts) => {
  28585. const parsed = handleArgs(cmd, args, opts);
  28586. const {encoding, buffer, maxBuffer} = parsed.opts;
  28587. const joinedCmd = joinCmd(cmd, args);
  28588. let spawned;
  28589. try {
  28590. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28591. } catch (err) {
  28592. return Promise.reject(err);
  28593. }
  28594. let removeExitHandler;
  28595. if (parsed.opts.cleanup) {
  28596. removeExitHandler = onExit(() => {
  28597. spawned.kill();
  28598. });
  28599. }
  28600. let timeoutId = null;
  28601. let timedOut = false;
  28602. const cleanup = () => {
  28603. if (timeoutId) {
  28604. clearTimeout(timeoutId);
  28605. timeoutId = null;
  28606. }
  28607. if (removeExitHandler) {
  28608. removeExitHandler();
  28609. }
  28610. };
  28611. if (parsed.opts.timeout > 0) {
  28612. timeoutId = setTimeout(() => {
  28613. timeoutId = null;
  28614. timedOut = true;
  28615. spawned.kill(parsed.opts.killSignal);
  28616. }, parsed.opts.timeout);
  28617. }
  28618. const processDone = new Promise(resolve => {
  28619. spawned.on('exit', (code, signal) => {
  28620. cleanup();
  28621. resolve({code, signal});
  28622. });
  28623. spawned.on('error', err => {
  28624. cleanup();
  28625. resolve({error: err});
  28626. });
  28627. if (spawned.stdin) {
  28628. spawned.stdin.on('error', err => {
  28629. cleanup();
  28630. resolve({error: err});
  28631. });
  28632. }
  28633. });
  28634. function destroy() {
  28635. if (spawned.stdout) {
  28636. spawned.stdout.destroy();
  28637. }
  28638. if (spawned.stderr) {
  28639. spawned.stderr.destroy();
  28640. }
  28641. }
  28642. const handlePromise = () => pFinally(Promise.all([
  28643. processDone,
  28644. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28645. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28646. ]).then(arr => {
  28647. const result = arr[0];
  28648. result.stdout = arr[1];
  28649. result.stderr = arr[2];
  28650. if (result.error || result.code !== 0 || result.signal !== null) {
  28651. const err = makeError(result, {
  28652. joinedCmd,
  28653. parsed,
  28654. timedOut
  28655. });
  28656. // TODO: missing some timeout logic for killed
  28657. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28658. // err.killed = spawned.killed || killed;
  28659. err.killed = err.killed || spawned.killed;
  28660. if (!parsed.opts.reject) {
  28661. return err;
  28662. }
  28663. throw err;
  28664. }
  28665. return {
  28666. stdout: handleOutput(parsed.opts, result.stdout),
  28667. stderr: handleOutput(parsed.opts, result.stderr),
  28668. code: 0,
  28669. failed: false,
  28670. killed: false,
  28671. signal: null,
  28672. cmd: joinedCmd,
  28673. timedOut: false
  28674. };
  28675. }), destroy);
  28676. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28677. handleInput(spawned, parsed.opts.input);
  28678. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28679. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28680. return spawned;
  28681. };
  28682. // TODO: set `stderr: 'ignore'` when that option is implemented
  28683. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28684. // TODO: set `stdout: 'ignore'` when that option is implemented
  28685. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28686. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28687. module.exports.sync = (cmd, args, opts) => {
  28688. const parsed = handleArgs(cmd, args, opts);
  28689. const joinedCmd = joinCmd(cmd, args);
  28690. if (isStream(parsed.opts.input)) {
  28691. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28692. }
  28693. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28694. result.code = result.status;
  28695. if (result.error || result.status !== 0 || result.signal !== null) {
  28696. const err = makeError(result, {
  28697. joinedCmd,
  28698. parsed
  28699. });
  28700. if (!parsed.opts.reject) {
  28701. return err;
  28702. }
  28703. throw err;
  28704. }
  28705. return {
  28706. stdout: handleOutput(parsed.opts, result.stdout),
  28707. stderr: handleOutput(parsed.opts, result.stderr),
  28708. code: 0,
  28709. failed: false,
  28710. signal: null,
  28711. cmd: joinedCmd,
  28712. timedOut: false
  28713. };
  28714. };
  28715. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28716. /***/ }),
  28717. /***/ 966:
  28718. /***/ (function(module, __unusedexports, __webpack_require__) {
  28719. "use strict";
  28720. const {PassThrough} = __webpack_require__(413);
  28721. module.exports = options => {
  28722. options = Object.assign({}, options);
  28723. const {array} = options;
  28724. let {encoding} = options;
  28725. const buffer = encoding === 'buffer';
  28726. let objectMode = false;
  28727. if (array) {
  28728. objectMode = !(encoding || buffer);
  28729. } else {
  28730. encoding = encoding || 'utf8';
  28731. }
  28732. if (buffer) {
  28733. encoding = null;
  28734. }
  28735. let len = 0;
  28736. const ret = [];
  28737. const stream = new PassThrough({objectMode});
  28738. if (encoding) {
  28739. stream.setEncoding(encoding);
  28740. }
  28741. stream.on('data', chunk => {
  28742. ret.push(chunk);
  28743. if (objectMode) {
  28744. len = ret.length;
  28745. } else {
  28746. len += chunk.length;
  28747. }
  28748. });
  28749. stream.getBufferedValue = () => {
  28750. if (array) {
  28751. return ret;
  28752. }
  28753. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28754. };
  28755. stream.getBufferedLength = () => len;
  28756. return stream;
  28757. };
  28758. /***/ }),
  28759. /***/ 969:
  28760. /***/ (function(module, __unusedexports, __webpack_require__) {
  28761. var wrappy = __webpack_require__(11)
  28762. module.exports = wrappy(once)
  28763. module.exports.strict = wrappy(onceStrict)
  28764. once.proto = once(function () {
  28765. Object.defineProperty(Function.prototype, 'once', {
  28766. value: function () {
  28767. return once(this)
  28768. },
  28769. configurable: true
  28770. })
  28771. Object.defineProperty(Function.prototype, 'onceStrict', {
  28772. value: function () {
  28773. return onceStrict(this)
  28774. },
  28775. configurable: true
  28776. })
  28777. })
  28778. function once (fn) {
  28779. var f = function () {
  28780. if (f.called) return f.value
  28781. f.called = true
  28782. return f.value = fn.apply(this, arguments)
  28783. }
  28784. f.called = false
  28785. return f
  28786. }
  28787. function onceStrict (fn) {
  28788. var f = function () {
  28789. if (f.called)
  28790. throw new Error(f.onceError)
  28791. f.called = true
  28792. return f.value = fn.apply(this, arguments)
  28793. }
  28794. var name = fn.name || 'Function wrapped with `once`'
  28795. f.onceError = name + " shouldn't be called more than once"
  28796. f.called = false
  28797. return f
  28798. }
  28799. /***/ }),
  28800. /***/ 986:
  28801. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28802. "use strict";
  28803. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28804. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28805. return new (P || (P = Promise))(function (resolve, reject) {
  28806. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28807. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28808. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28809. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28810. });
  28811. };
  28812. Object.defineProperty(exports, "__esModule", { value: true });
  28813. const tr = __webpack_require__(9);
  28814. /**
  28815. * Exec a command.
  28816. * Output will be streamed to the live console.
  28817. * Returns promise with return code
  28818. *
  28819. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28820. * @param args optional arguments for tool. Escaping is handled by the lib.
  28821. * @param options optional exec options. See ExecOptions
  28822. * @returns Promise<number> exit code
  28823. */
  28824. function exec(commandLine, args, options) {
  28825. return __awaiter(this, void 0, void 0, function* () {
  28826. const commandArgs = tr.argStringToArray(commandLine);
  28827. if (commandArgs.length === 0) {
  28828. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28829. }
  28830. // Path to tool to execute should be first arg
  28831. const toolPath = commandArgs[0];
  28832. args = commandArgs.slice(1).concat(args || []);
  28833. const runner = new tr.ToolRunner(toolPath, args, options);
  28834. return runner.exec();
  28835. });
  28836. }
  28837. exports.exec = exec;
  28838. //# sourceMappingURL=exec.js.map
  28839. /***/ }),
  28840. /***/ 991:
  28841. /***/ (function(module, __unusedexports, __webpack_require__) {
  28842. module.exports = authenticationRequestError;
  28843. const { RequestError } = __webpack_require__(497);
  28844. function authenticationRequestError(state, error, options) {
  28845. if (!error.headers) throw error;
  28846. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28847. // handle "2FA required" error only
  28848. if (error.status !== 401 || !otpRequired) {
  28849. throw error;
  28850. }
  28851. if (
  28852. error.status === 401 &&
  28853. otpRequired &&
  28854. error.request &&
  28855. error.request.headers["x-github-otp"]
  28856. ) {
  28857. if (state.otp) {
  28858. delete state.otp; // no longer valid, request again
  28859. } else {
  28860. throw new RequestError(
  28861. "Invalid one-time password for two-factor authentication",
  28862. 401,
  28863. {
  28864. headers: error.headers,
  28865. request: options
  28866. }
  28867. );
  28868. }
  28869. }
  28870. if (typeof state.auth.on2fa !== "function") {
  28871. throw new RequestError(
  28872. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28873. 401,
  28874. {
  28875. headers: error.headers,
  28876. request: options
  28877. }
  28878. );
  28879. }
  28880. return Promise.resolve()
  28881. .then(() => {
  28882. return state.auth.on2fa();
  28883. })
  28884. .then(oneTimePassword => {
  28885. const newOptions = Object.assign(options, {
  28886. headers: Object.assign(options.headers, {
  28887. "x-github-otp": oneTimePassword
  28888. })
  28889. });
  28890. return state.octokit.request(newOptions).then(response => {
  28891. // If OTP still valid, then persist it for following requests
  28892. state.otp = oneTimePassword;
  28893. return response;
  28894. });
  28895. });
  28896. }
  28897. /***/ })
  28898. /******/ });