index.js 799 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029
  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) {
  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. Object.defineProperty(exports, "__esModule", { value: true });
  2958. function getCheckoutInfo(git, ref, commit) {
  2959. return __awaiter(this, void 0, void 0, function* () {
  2960. if (!git) {
  2961. throw new Error('Arg git cannot be empty');
  2962. }
  2963. if (!ref && !commit) {
  2964. throw new Error('Args ref and commit cannot both be empty');
  2965. }
  2966. const result = {};
  2967. const upperRef = (ref || '').toUpperCase();
  2968. // SHA only
  2969. if (!ref) {
  2970. result.ref = commit;
  2971. }
  2972. // refs/heads/
  2973. else if (upperRef.startsWith('REFS/HEADS/')) {
  2974. const branch = ref.substring('refs/heads/'.length);
  2975. result.ref = branch;
  2976. result.startPoint = `refs/remotes/origin/${branch}`;
  2977. }
  2978. // refs/pull/
  2979. else if (upperRef.startsWith('REFS/PULL/')) {
  2980. const branch = ref.substring('refs/pull/'.length);
  2981. result.ref = `refs/remotes/pull/${branch}`;
  2982. }
  2983. // refs/tags/
  2984. else if (upperRef.startsWith('REFS/')) {
  2985. result.ref = ref;
  2986. }
  2987. // Unqualified ref, check for a matching branch or tag
  2988. else {
  2989. if (yield git.branchExists(true, `origin/${ref}`)) {
  2990. result.ref = ref;
  2991. result.startPoint = `refs/remotes/origin/${ref}`;
  2992. }
  2993. else if (yield git.tagExists(`${ref}`)) {
  2994. result.ref = `refs/tags/${ref}`;
  2995. }
  2996. else {
  2997. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2998. }
  2999. }
  3000. return result;
  3001. });
  3002. }
  3003. exports.getCheckoutInfo = getCheckoutInfo;
  3004. function getRefSpec(ref, commit) {
  3005. if (!ref && !commit) {
  3006. throw new Error('Args ref and commit cannot both be empty');
  3007. }
  3008. const upperRef = (ref || '').toUpperCase();
  3009. // SHA
  3010. if (commit) {
  3011. // refs/heads
  3012. if (upperRef.startsWith('REFS/HEADS/')) {
  3013. const branch = ref.substring('refs/heads/'.length);
  3014. return [`+${commit}:refs/remotes/origin/${branch}`];
  3015. }
  3016. // refs/pull/
  3017. else if (upperRef.startsWith('REFS/PULL/')) {
  3018. const branch = ref.substring('refs/pull/'.length);
  3019. return [`+${commit}:refs/remotes/pull/${branch}`];
  3020. }
  3021. // refs/tags/
  3022. else if (upperRef.startsWith('REFS/TAGS/')) {
  3023. return [`+${commit}:${ref}`];
  3024. }
  3025. // Otherwise no destination ref
  3026. else {
  3027. return [commit];
  3028. }
  3029. }
  3030. // Unqualified ref, check for a matching branch or tag
  3031. else if (!upperRef.startsWith('REFS/')) {
  3032. return [
  3033. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3034. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3035. ];
  3036. }
  3037. // refs/heads/
  3038. else if (upperRef.startsWith('REFS/HEADS/')) {
  3039. const branch = ref.substring('refs/heads/'.length);
  3040. return [`+${ref}:refs/remotes/origin/${branch}`];
  3041. }
  3042. // refs/pull/
  3043. else if (upperRef.startsWith('REFS/PULL/')) {
  3044. const branch = ref.substring('refs/pull/'.length);
  3045. return [`+${ref}:refs/remotes/pull/${branch}`];
  3046. }
  3047. // refs/tags/
  3048. else {
  3049. return [`+${ref}:${ref}`];
  3050. }
  3051. }
  3052. exports.getRefSpec = getRefSpec;
  3053. /***/ }),
  3054. /***/ 260:
  3055. /***/ (function(module, __unusedexports, __webpack_require__) {
  3056. // Note: since nyc uses this module to output coverage, any lines
  3057. // that are in the direct sync flow of nyc's outputCoverage are
  3058. // ignored, since we can never get coverage for them.
  3059. var assert = __webpack_require__(357)
  3060. var signals = __webpack_require__(654)
  3061. var EE = __webpack_require__(614)
  3062. /* istanbul ignore if */
  3063. if (typeof EE !== 'function') {
  3064. EE = EE.EventEmitter
  3065. }
  3066. var emitter
  3067. if (process.__signal_exit_emitter__) {
  3068. emitter = process.__signal_exit_emitter__
  3069. } else {
  3070. emitter = process.__signal_exit_emitter__ = new EE()
  3071. emitter.count = 0
  3072. emitter.emitted = {}
  3073. }
  3074. // Because this emitter is a global, we have to check to see if a
  3075. // previous version of this library failed to enable infinite listeners.
  3076. // I know what you're about to say. But literally everything about
  3077. // signal-exit is a compromise with evil. Get used to it.
  3078. if (!emitter.infinite) {
  3079. emitter.setMaxListeners(Infinity)
  3080. emitter.infinite = true
  3081. }
  3082. module.exports = function (cb, opts) {
  3083. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3084. if (loaded === false) {
  3085. load()
  3086. }
  3087. var ev = 'exit'
  3088. if (opts && opts.alwaysLast) {
  3089. ev = 'afterexit'
  3090. }
  3091. var remove = function () {
  3092. emitter.removeListener(ev, cb)
  3093. if (emitter.listeners('exit').length === 0 &&
  3094. emitter.listeners('afterexit').length === 0) {
  3095. unload()
  3096. }
  3097. }
  3098. emitter.on(ev, cb)
  3099. return remove
  3100. }
  3101. module.exports.unload = unload
  3102. function unload () {
  3103. if (!loaded) {
  3104. return
  3105. }
  3106. loaded = false
  3107. signals.forEach(function (sig) {
  3108. try {
  3109. process.removeListener(sig, sigListeners[sig])
  3110. } catch (er) {}
  3111. })
  3112. process.emit = originalProcessEmit
  3113. process.reallyExit = originalProcessReallyExit
  3114. emitter.count -= 1
  3115. }
  3116. function emit (event, code, signal) {
  3117. if (emitter.emitted[event]) {
  3118. return
  3119. }
  3120. emitter.emitted[event] = true
  3121. emitter.emit(event, code, signal)
  3122. }
  3123. // { <signal>: <listener fn>, ... }
  3124. var sigListeners = {}
  3125. signals.forEach(function (sig) {
  3126. sigListeners[sig] = function listener () {
  3127. // If there are no other listeners, an exit is coming!
  3128. // Simplest way: remove us and then re-send the signal.
  3129. // We know that this will kill the process, so we can
  3130. // safely emit now.
  3131. var listeners = process.listeners(sig)
  3132. if (listeners.length === emitter.count) {
  3133. unload()
  3134. emit('exit', null, sig)
  3135. /* istanbul ignore next */
  3136. emit('afterexit', null, sig)
  3137. /* istanbul ignore next */
  3138. process.kill(process.pid, sig)
  3139. }
  3140. }
  3141. })
  3142. module.exports.signals = function () {
  3143. return signals
  3144. }
  3145. module.exports.load = load
  3146. var loaded = false
  3147. function load () {
  3148. if (loaded) {
  3149. return
  3150. }
  3151. loaded = true
  3152. // This is the number of onSignalExit's that are in play.
  3153. // It's important so that we can count the correct number of
  3154. // listeners on signals, and don't wait for the other one to
  3155. // handle it instead of us.
  3156. emitter.count += 1
  3157. signals = signals.filter(function (sig) {
  3158. try {
  3159. process.on(sig, sigListeners[sig])
  3160. return true
  3161. } catch (er) {
  3162. return false
  3163. }
  3164. })
  3165. process.emit = processEmit
  3166. process.reallyExit = processReallyExit
  3167. }
  3168. var originalProcessReallyExit = process.reallyExit
  3169. function processReallyExit (code) {
  3170. process.exitCode = code || 0
  3171. emit('exit', process.exitCode, null)
  3172. /* istanbul ignore next */
  3173. emit('afterexit', process.exitCode, null)
  3174. /* istanbul ignore next */
  3175. originalProcessReallyExit.call(process, process.exitCode)
  3176. }
  3177. var originalProcessEmit = process.emit
  3178. function processEmit (ev, arg) {
  3179. if (ev === 'exit') {
  3180. if (arg !== undefined) {
  3181. process.exitCode = arg
  3182. }
  3183. var ret = originalProcessEmit.apply(this, arguments)
  3184. emit('exit', process.exitCode, null)
  3185. /* istanbul ignore next */
  3186. emit('afterexit', process.exitCode, null)
  3187. return ret
  3188. } else {
  3189. return originalProcessEmit.apply(this, arguments)
  3190. }
  3191. }
  3192. /***/ }),
  3193. /***/ 262:
  3194. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3195. "use strict";
  3196. Object.defineProperty(exports, "__esModule", { value: true });
  3197. const fs_1 = __webpack_require__(747);
  3198. const os_1 = __webpack_require__(87);
  3199. class Context {
  3200. /**
  3201. * Hydrate the context from the environment
  3202. */
  3203. constructor() {
  3204. this.payload = {};
  3205. if (process.env.GITHUB_EVENT_PATH) {
  3206. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3207. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3208. }
  3209. else {
  3210. const path = process.env.GITHUB_EVENT_PATH;
  3211. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3212. }
  3213. }
  3214. this.eventName = process.env.GITHUB_EVENT_NAME;
  3215. this.sha = process.env.GITHUB_SHA;
  3216. this.ref = process.env.GITHUB_REF;
  3217. this.workflow = process.env.GITHUB_WORKFLOW;
  3218. this.action = process.env.GITHUB_ACTION;
  3219. this.actor = process.env.GITHUB_ACTOR;
  3220. }
  3221. get issue() {
  3222. const payload = this.payload;
  3223. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3224. }
  3225. get repo() {
  3226. if (process.env.GITHUB_REPOSITORY) {
  3227. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3228. return { owner, repo };
  3229. }
  3230. if (this.payload.repository) {
  3231. return {
  3232. owner: this.payload.repository.owner.login,
  3233. repo: this.payload.repository.name
  3234. };
  3235. }
  3236. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3237. }
  3238. }
  3239. exports.Context = Context;
  3240. //# sourceMappingURL=context.js.map
  3241. /***/ }),
  3242. /***/ 265:
  3243. /***/ (function(module, __unusedexports, __webpack_require__) {
  3244. module.exports = getPage
  3245. const deprecate = __webpack_require__(370)
  3246. const getPageLinks = __webpack_require__(577)
  3247. const HttpError = __webpack_require__(297)
  3248. function getPage (octokit, link, which, headers) {
  3249. 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.`)
  3250. const url = getPageLinks(link)[which]
  3251. if (!url) {
  3252. const urlError = new HttpError(`No ${which} page found`, 404)
  3253. return Promise.reject(urlError)
  3254. }
  3255. const requestOptions = {
  3256. url,
  3257. headers: applyAcceptHeader(link, headers)
  3258. }
  3259. const promise = octokit.request(requestOptions)
  3260. return promise
  3261. }
  3262. function applyAcceptHeader (res, headers) {
  3263. const previous = res.headers && res.headers['x-github-media-type']
  3264. if (!previous || (headers && headers.accept)) {
  3265. return headers
  3266. }
  3267. headers = headers || {}
  3268. headers.accept = 'application/vnd.' + previous
  3269. .replace('; param=', '.')
  3270. .replace('; format=', '+')
  3271. return headers
  3272. }
  3273. /***/ }),
  3274. /***/ 280:
  3275. /***/ (function(module, exports) {
  3276. exports = module.exports = SemVer
  3277. var debug
  3278. /* istanbul ignore next */
  3279. if (typeof process === 'object' &&
  3280. process.env &&
  3281. process.env.NODE_DEBUG &&
  3282. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3283. debug = function () {
  3284. var args = Array.prototype.slice.call(arguments, 0)
  3285. args.unshift('SEMVER')
  3286. console.log.apply(console, args)
  3287. }
  3288. } else {
  3289. debug = function () {}
  3290. }
  3291. // Note: this is the semver.org version of the spec that it implements
  3292. // Not necessarily the package version of this code.
  3293. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3294. var MAX_LENGTH = 256
  3295. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3296. /* istanbul ignore next */ 9007199254740991
  3297. // Max safe segment length for coercion.
  3298. var MAX_SAFE_COMPONENT_LENGTH = 16
  3299. // The actual regexps go on exports.re
  3300. var re = exports.re = []
  3301. var src = exports.src = []
  3302. var R = 0
  3303. // The following Regular Expressions can be used for tokenizing,
  3304. // validating, and parsing SemVer version strings.
  3305. // ## Numeric Identifier
  3306. // A single `0`, or a non-zero digit followed by zero or more digits.
  3307. var NUMERICIDENTIFIER = R++
  3308. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3309. var NUMERICIDENTIFIERLOOSE = R++
  3310. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3311. // ## Non-numeric Identifier
  3312. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3313. // more letters, digits, or hyphens.
  3314. var NONNUMERICIDENTIFIER = R++
  3315. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3316. // ## Main Version
  3317. // Three dot-separated numeric identifiers.
  3318. var MAINVERSION = R++
  3319. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3320. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3321. '(' + src[NUMERICIDENTIFIER] + ')'
  3322. var MAINVERSIONLOOSE = R++
  3323. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3324. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3325. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3326. // ## Pre-release Version Identifier
  3327. // A numeric identifier, or a non-numeric identifier.
  3328. var PRERELEASEIDENTIFIER = R++
  3329. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3330. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3331. var PRERELEASEIDENTIFIERLOOSE = R++
  3332. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3333. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3334. // ## Pre-release Version
  3335. // Hyphen, followed by one or more dot-separated pre-release version
  3336. // identifiers.
  3337. var PRERELEASE = R++
  3338. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3339. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3340. var PRERELEASELOOSE = R++
  3341. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3342. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3343. // ## Build Metadata Identifier
  3344. // Any combination of digits, letters, or hyphens.
  3345. var BUILDIDENTIFIER = R++
  3346. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3347. // ## Build Metadata
  3348. // Plus sign, followed by one or more period-separated build metadata
  3349. // identifiers.
  3350. var BUILD = R++
  3351. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3352. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3353. // ## Full Version String
  3354. // A main version, followed optionally by a pre-release version and
  3355. // build metadata.
  3356. // Note that the only major, minor, patch, and pre-release sections of
  3357. // the version string are capturing groups. The build metadata is not a
  3358. // capturing group, because it should not ever be used in version
  3359. // comparison.
  3360. var FULL = R++
  3361. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3362. src[PRERELEASE] + '?' +
  3363. src[BUILD] + '?'
  3364. src[FULL] = '^' + FULLPLAIN + '$'
  3365. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3366. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3367. // common in the npm registry.
  3368. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3369. src[PRERELEASELOOSE] + '?' +
  3370. src[BUILD] + '?'
  3371. var LOOSE = R++
  3372. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3373. var GTLT = R++
  3374. src[GTLT] = '((?:<|>)?=?)'
  3375. // Something like "2.*" or "1.2.x".
  3376. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3377. // Only the first item is strictly required.
  3378. var XRANGEIDENTIFIERLOOSE = R++
  3379. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3380. var XRANGEIDENTIFIER = R++
  3381. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3382. var XRANGEPLAIN = R++
  3383. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3384. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3385. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3386. '(?:' + src[PRERELEASE] + ')?' +
  3387. src[BUILD] + '?' +
  3388. ')?)?'
  3389. var XRANGEPLAINLOOSE = R++
  3390. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3391. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3392. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3393. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3394. src[BUILD] + '?' +
  3395. ')?)?'
  3396. var XRANGE = R++
  3397. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3398. var XRANGELOOSE = R++
  3399. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3400. // Coercion.
  3401. // Extract anything that could conceivably be a part of a valid semver
  3402. var COERCE = R++
  3403. src[COERCE] = '(?:^|[^\\d])' +
  3404. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3405. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3406. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3407. '(?:$|[^\\d])'
  3408. // Tilde ranges.
  3409. // Meaning is "reasonably at or greater than"
  3410. var LONETILDE = R++
  3411. src[LONETILDE] = '(?:~>?)'
  3412. var TILDETRIM = R++
  3413. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3414. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3415. var tildeTrimReplace = '$1~'
  3416. var TILDE = R++
  3417. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3418. var TILDELOOSE = R++
  3419. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3420. // Caret ranges.
  3421. // Meaning is "at least and backwards compatible with"
  3422. var LONECARET = R++
  3423. src[LONECARET] = '(?:\\^)'
  3424. var CARETTRIM = R++
  3425. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3426. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3427. var caretTrimReplace = '$1^'
  3428. var CARET = R++
  3429. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3430. var CARETLOOSE = R++
  3431. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3432. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3433. var COMPARATORLOOSE = R++
  3434. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3435. var COMPARATOR = R++
  3436. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3437. // An expression to strip any whitespace between the gtlt and the thing
  3438. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3439. var COMPARATORTRIM = R++
  3440. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3441. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3442. // this one has to use the /g flag
  3443. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3444. var comparatorTrimReplace = '$1$2$3'
  3445. // Something like `1.2.3 - 1.2.4`
  3446. // Note that these all use the loose form, because they'll be
  3447. // checked against either the strict or loose comparator form
  3448. // later.
  3449. var HYPHENRANGE = R++
  3450. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3451. '\\s+-\\s+' +
  3452. '(' + src[XRANGEPLAIN] + ')' +
  3453. '\\s*$'
  3454. var HYPHENRANGELOOSE = R++
  3455. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3456. '\\s+-\\s+' +
  3457. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3458. '\\s*$'
  3459. // Star ranges basically just allow anything at all.
  3460. var STAR = R++
  3461. src[STAR] = '(<|>)?=?\\s*\\*'
  3462. // Compile to actual regexp objects.
  3463. // All are flag-free, unless they were created above with a flag.
  3464. for (var i = 0; i < R; i++) {
  3465. debug(i, src[i])
  3466. if (!re[i]) {
  3467. re[i] = new RegExp(src[i])
  3468. }
  3469. }
  3470. exports.parse = parse
  3471. function parse (version, options) {
  3472. if (!options || typeof options !== 'object') {
  3473. options = {
  3474. loose: !!options,
  3475. includePrerelease: false
  3476. }
  3477. }
  3478. if (version instanceof SemVer) {
  3479. return version
  3480. }
  3481. if (typeof version !== 'string') {
  3482. return null
  3483. }
  3484. if (version.length > MAX_LENGTH) {
  3485. return null
  3486. }
  3487. var r = options.loose ? re[LOOSE] : re[FULL]
  3488. if (!r.test(version)) {
  3489. return null
  3490. }
  3491. try {
  3492. return new SemVer(version, options)
  3493. } catch (er) {
  3494. return null
  3495. }
  3496. }
  3497. exports.valid = valid
  3498. function valid (version, options) {
  3499. var v = parse(version, options)
  3500. return v ? v.version : null
  3501. }
  3502. exports.clean = clean
  3503. function clean (version, options) {
  3504. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3505. return s ? s.version : null
  3506. }
  3507. exports.SemVer = SemVer
  3508. function SemVer (version, options) {
  3509. if (!options || typeof options !== 'object') {
  3510. options = {
  3511. loose: !!options,
  3512. includePrerelease: false
  3513. }
  3514. }
  3515. if (version instanceof SemVer) {
  3516. if (version.loose === options.loose) {
  3517. return version
  3518. } else {
  3519. version = version.version
  3520. }
  3521. } else if (typeof version !== 'string') {
  3522. throw new TypeError('Invalid Version: ' + version)
  3523. }
  3524. if (version.length > MAX_LENGTH) {
  3525. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3526. }
  3527. if (!(this instanceof SemVer)) {
  3528. return new SemVer(version, options)
  3529. }
  3530. debug('SemVer', version, options)
  3531. this.options = options
  3532. this.loose = !!options.loose
  3533. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3534. if (!m) {
  3535. throw new TypeError('Invalid Version: ' + version)
  3536. }
  3537. this.raw = version
  3538. // these are actually numbers
  3539. this.major = +m[1]
  3540. this.minor = +m[2]
  3541. this.patch = +m[3]
  3542. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3543. throw new TypeError('Invalid major version')
  3544. }
  3545. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3546. throw new TypeError('Invalid minor version')
  3547. }
  3548. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3549. throw new TypeError('Invalid patch version')
  3550. }
  3551. // numberify any prerelease numeric ids
  3552. if (!m[4]) {
  3553. this.prerelease = []
  3554. } else {
  3555. this.prerelease = m[4].split('.').map(function (id) {
  3556. if (/^[0-9]+$/.test(id)) {
  3557. var num = +id
  3558. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3559. return num
  3560. }
  3561. }
  3562. return id
  3563. })
  3564. }
  3565. this.build = m[5] ? m[5].split('.') : []
  3566. this.format()
  3567. }
  3568. SemVer.prototype.format = function () {
  3569. this.version = this.major + '.' + this.minor + '.' + this.patch
  3570. if (this.prerelease.length) {
  3571. this.version += '-' + this.prerelease.join('.')
  3572. }
  3573. return this.version
  3574. }
  3575. SemVer.prototype.toString = function () {
  3576. return this.version
  3577. }
  3578. SemVer.prototype.compare = function (other) {
  3579. debug('SemVer.compare', this.version, this.options, other)
  3580. if (!(other instanceof SemVer)) {
  3581. other = new SemVer(other, this.options)
  3582. }
  3583. return this.compareMain(other) || this.comparePre(other)
  3584. }
  3585. SemVer.prototype.compareMain = function (other) {
  3586. if (!(other instanceof SemVer)) {
  3587. other = new SemVer(other, this.options)
  3588. }
  3589. return compareIdentifiers(this.major, other.major) ||
  3590. compareIdentifiers(this.minor, other.minor) ||
  3591. compareIdentifiers(this.patch, other.patch)
  3592. }
  3593. SemVer.prototype.comparePre = function (other) {
  3594. if (!(other instanceof SemVer)) {
  3595. other = new SemVer(other, this.options)
  3596. }
  3597. // NOT having a prerelease is > having one
  3598. if (this.prerelease.length && !other.prerelease.length) {
  3599. return -1
  3600. } else if (!this.prerelease.length && other.prerelease.length) {
  3601. return 1
  3602. } else if (!this.prerelease.length && !other.prerelease.length) {
  3603. return 0
  3604. }
  3605. var i = 0
  3606. do {
  3607. var a = this.prerelease[i]
  3608. var b = other.prerelease[i]
  3609. debug('prerelease compare', i, a, b)
  3610. if (a === undefined && b === undefined) {
  3611. return 0
  3612. } else if (b === undefined) {
  3613. return 1
  3614. } else if (a === undefined) {
  3615. return -1
  3616. } else if (a === b) {
  3617. continue
  3618. } else {
  3619. return compareIdentifiers(a, b)
  3620. }
  3621. } while (++i)
  3622. }
  3623. // preminor will bump the version up to the next minor release, and immediately
  3624. // down to pre-release. premajor and prepatch work the same way.
  3625. SemVer.prototype.inc = function (release, identifier) {
  3626. switch (release) {
  3627. case 'premajor':
  3628. this.prerelease.length = 0
  3629. this.patch = 0
  3630. this.minor = 0
  3631. this.major++
  3632. this.inc('pre', identifier)
  3633. break
  3634. case 'preminor':
  3635. this.prerelease.length = 0
  3636. this.patch = 0
  3637. this.minor++
  3638. this.inc('pre', identifier)
  3639. break
  3640. case 'prepatch':
  3641. // If this is already a prerelease, it will bump to the next version
  3642. // drop any prereleases that might already exist, since they are not
  3643. // relevant at this point.
  3644. this.prerelease.length = 0
  3645. this.inc('patch', identifier)
  3646. this.inc('pre', identifier)
  3647. break
  3648. // If the input is a non-prerelease version, this acts the same as
  3649. // prepatch.
  3650. case 'prerelease':
  3651. if (this.prerelease.length === 0) {
  3652. this.inc('patch', identifier)
  3653. }
  3654. this.inc('pre', identifier)
  3655. break
  3656. case 'major':
  3657. // If this is a pre-major version, bump up to the same major version.
  3658. // Otherwise increment major.
  3659. // 1.0.0-5 bumps to 1.0.0
  3660. // 1.1.0 bumps to 2.0.0
  3661. if (this.minor !== 0 ||
  3662. this.patch !== 0 ||
  3663. this.prerelease.length === 0) {
  3664. this.major++
  3665. }
  3666. this.minor = 0
  3667. this.patch = 0
  3668. this.prerelease = []
  3669. break
  3670. case 'minor':
  3671. // If this is a pre-minor version, bump up to the same minor version.
  3672. // Otherwise increment minor.
  3673. // 1.2.0-5 bumps to 1.2.0
  3674. // 1.2.1 bumps to 1.3.0
  3675. if (this.patch !== 0 || this.prerelease.length === 0) {
  3676. this.minor++
  3677. }
  3678. this.patch = 0
  3679. this.prerelease = []
  3680. break
  3681. case 'patch':
  3682. // If this is not a pre-release version, it will increment the patch.
  3683. // If it is a pre-release it will bump up to the same patch version.
  3684. // 1.2.0-5 patches to 1.2.0
  3685. // 1.2.0 patches to 1.2.1
  3686. if (this.prerelease.length === 0) {
  3687. this.patch++
  3688. }
  3689. this.prerelease = []
  3690. break
  3691. // This probably shouldn't be used publicly.
  3692. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3693. case 'pre':
  3694. if (this.prerelease.length === 0) {
  3695. this.prerelease = [0]
  3696. } else {
  3697. var i = this.prerelease.length
  3698. while (--i >= 0) {
  3699. if (typeof this.prerelease[i] === 'number') {
  3700. this.prerelease[i]++
  3701. i = -2
  3702. }
  3703. }
  3704. if (i === -1) {
  3705. // didn't increment anything
  3706. this.prerelease.push(0)
  3707. }
  3708. }
  3709. if (identifier) {
  3710. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3711. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3712. if (this.prerelease[0] === identifier) {
  3713. if (isNaN(this.prerelease[1])) {
  3714. this.prerelease = [identifier, 0]
  3715. }
  3716. } else {
  3717. this.prerelease = [identifier, 0]
  3718. }
  3719. }
  3720. break
  3721. default:
  3722. throw new Error('invalid increment argument: ' + release)
  3723. }
  3724. this.format()
  3725. this.raw = this.version
  3726. return this
  3727. }
  3728. exports.inc = inc
  3729. function inc (version, release, loose, identifier) {
  3730. if (typeof (loose) === 'string') {
  3731. identifier = loose
  3732. loose = undefined
  3733. }
  3734. try {
  3735. return new SemVer(version, loose).inc(release, identifier).version
  3736. } catch (er) {
  3737. return null
  3738. }
  3739. }
  3740. exports.diff = diff
  3741. function diff (version1, version2) {
  3742. if (eq(version1, version2)) {
  3743. return null
  3744. } else {
  3745. var v1 = parse(version1)
  3746. var v2 = parse(version2)
  3747. var prefix = ''
  3748. if (v1.prerelease.length || v2.prerelease.length) {
  3749. prefix = 'pre'
  3750. var defaultResult = 'prerelease'
  3751. }
  3752. for (var key in v1) {
  3753. if (key === 'major' || key === 'minor' || key === 'patch') {
  3754. if (v1[key] !== v2[key]) {
  3755. return prefix + key
  3756. }
  3757. }
  3758. }
  3759. return defaultResult // may be undefined
  3760. }
  3761. }
  3762. exports.compareIdentifiers = compareIdentifiers
  3763. var numeric = /^[0-9]+$/
  3764. function compareIdentifiers (a, b) {
  3765. var anum = numeric.test(a)
  3766. var bnum = numeric.test(b)
  3767. if (anum && bnum) {
  3768. a = +a
  3769. b = +b
  3770. }
  3771. return a === b ? 0
  3772. : (anum && !bnum) ? -1
  3773. : (bnum && !anum) ? 1
  3774. : a < b ? -1
  3775. : 1
  3776. }
  3777. exports.rcompareIdentifiers = rcompareIdentifiers
  3778. function rcompareIdentifiers (a, b) {
  3779. return compareIdentifiers(b, a)
  3780. }
  3781. exports.major = major
  3782. function major (a, loose) {
  3783. return new SemVer(a, loose).major
  3784. }
  3785. exports.minor = minor
  3786. function minor (a, loose) {
  3787. return new SemVer(a, loose).minor
  3788. }
  3789. exports.patch = patch
  3790. function patch (a, loose) {
  3791. return new SemVer(a, loose).patch
  3792. }
  3793. exports.compare = compare
  3794. function compare (a, b, loose) {
  3795. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3796. }
  3797. exports.compareLoose = compareLoose
  3798. function compareLoose (a, b) {
  3799. return compare(a, b, true)
  3800. }
  3801. exports.rcompare = rcompare
  3802. function rcompare (a, b, loose) {
  3803. return compare(b, a, loose)
  3804. }
  3805. exports.sort = sort
  3806. function sort (list, loose) {
  3807. return list.sort(function (a, b) {
  3808. return exports.compare(a, b, loose)
  3809. })
  3810. }
  3811. exports.rsort = rsort
  3812. function rsort (list, loose) {
  3813. return list.sort(function (a, b) {
  3814. return exports.rcompare(a, b, loose)
  3815. })
  3816. }
  3817. exports.gt = gt
  3818. function gt (a, b, loose) {
  3819. return compare(a, b, loose) > 0
  3820. }
  3821. exports.lt = lt
  3822. function lt (a, b, loose) {
  3823. return compare(a, b, loose) < 0
  3824. }
  3825. exports.eq = eq
  3826. function eq (a, b, loose) {
  3827. return compare(a, b, loose) === 0
  3828. }
  3829. exports.neq = neq
  3830. function neq (a, b, loose) {
  3831. return compare(a, b, loose) !== 0
  3832. }
  3833. exports.gte = gte
  3834. function gte (a, b, loose) {
  3835. return compare(a, b, loose) >= 0
  3836. }
  3837. exports.lte = lte
  3838. function lte (a, b, loose) {
  3839. return compare(a, b, loose) <= 0
  3840. }
  3841. exports.cmp = cmp
  3842. function cmp (a, op, b, loose) {
  3843. switch (op) {
  3844. case '===':
  3845. if (typeof a === 'object')
  3846. a = a.version
  3847. if (typeof b === 'object')
  3848. b = b.version
  3849. return a === b
  3850. case '!==':
  3851. if (typeof a === 'object')
  3852. a = a.version
  3853. if (typeof b === 'object')
  3854. b = b.version
  3855. return a !== b
  3856. case '':
  3857. case '=':
  3858. case '==':
  3859. return eq(a, b, loose)
  3860. case '!=':
  3861. return neq(a, b, loose)
  3862. case '>':
  3863. return gt(a, b, loose)
  3864. case '>=':
  3865. return gte(a, b, loose)
  3866. case '<':
  3867. return lt(a, b, loose)
  3868. case '<=':
  3869. return lte(a, b, loose)
  3870. default:
  3871. throw new TypeError('Invalid operator: ' + op)
  3872. }
  3873. }
  3874. exports.Comparator = Comparator
  3875. function Comparator (comp, options) {
  3876. if (!options || typeof options !== 'object') {
  3877. options = {
  3878. loose: !!options,
  3879. includePrerelease: false
  3880. }
  3881. }
  3882. if (comp instanceof Comparator) {
  3883. if (comp.loose === !!options.loose) {
  3884. return comp
  3885. } else {
  3886. comp = comp.value
  3887. }
  3888. }
  3889. if (!(this instanceof Comparator)) {
  3890. return new Comparator(comp, options)
  3891. }
  3892. debug('comparator', comp, options)
  3893. this.options = options
  3894. this.loose = !!options.loose
  3895. this.parse(comp)
  3896. if (this.semver === ANY) {
  3897. this.value = ''
  3898. } else {
  3899. this.value = this.operator + this.semver.version
  3900. }
  3901. debug('comp', this)
  3902. }
  3903. var ANY = {}
  3904. Comparator.prototype.parse = function (comp) {
  3905. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3906. var m = comp.match(r)
  3907. if (!m) {
  3908. throw new TypeError('Invalid comparator: ' + comp)
  3909. }
  3910. this.operator = m[1]
  3911. if (this.operator === '=') {
  3912. this.operator = ''
  3913. }
  3914. // if it literally is just '>' or '' then allow anything.
  3915. if (!m[2]) {
  3916. this.semver = ANY
  3917. } else {
  3918. this.semver = new SemVer(m[2], this.options.loose)
  3919. }
  3920. }
  3921. Comparator.prototype.toString = function () {
  3922. return this.value
  3923. }
  3924. Comparator.prototype.test = function (version) {
  3925. debug('Comparator.test', version, this.options.loose)
  3926. if (this.semver === ANY) {
  3927. return true
  3928. }
  3929. if (typeof version === 'string') {
  3930. version = new SemVer(version, this.options)
  3931. }
  3932. return cmp(version, this.operator, this.semver, this.options)
  3933. }
  3934. Comparator.prototype.intersects = function (comp, options) {
  3935. if (!(comp instanceof Comparator)) {
  3936. throw new TypeError('a Comparator is required')
  3937. }
  3938. if (!options || typeof options !== 'object') {
  3939. options = {
  3940. loose: !!options,
  3941. includePrerelease: false
  3942. }
  3943. }
  3944. var rangeTmp
  3945. if (this.operator === '') {
  3946. rangeTmp = new Range(comp.value, options)
  3947. return satisfies(this.value, rangeTmp, options)
  3948. } else if (comp.operator === '') {
  3949. rangeTmp = new Range(this.value, options)
  3950. return satisfies(comp.semver, rangeTmp, options)
  3951. }
  3952. var sameDirectionIncreasing =
  3953. (this.operator === '>=' || this.operator === '>') &&
  3954. (comp.operator === '>=' || comp.operator === '>')
  3955. var sameDirectionDecreasing =
  3956. (this.operator === '<=' || this.operator === '<') &&
  3957. (comp.operator === '<=' || comp.operator === '<')
  3958. var sameSemVer = this.semver.version === comp.semver.version
  3959. var differentDirectionsInclusive =
  3960. (this.operator === '>=' || this.operator === '<=') &&
  3961. (comp.operator === '>=' || comp.operator === '<=')
  3962. var oppositeDirectionsLessThan =
  3963. cmp(this.semver, '<', comp.semver, options) &&
  3964. ((this.operator === '>=' || this.operator === '>') &&
  3965. (comp.operator === '<=' || comp.operator === '<'))
  3966. var oppositeDirectionsGreaterThan =
  3967. cmp(this.semver, '>', comp.semver, options) &&
  3968. ((this.operator === '<=' || this.operator === '<') &&
  3969. (comp.operator === '>=' || comp.operator === '>'))
  3970. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3971. (sameSemVer && differentDirectionsInclusive) ||
  3972. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3973. }
  3974. exports.Range = Range
  3975. function Range (range, options) {
  3976. if (!options || typeof options !== 'object') {
  3977. options = {
  3978. loose: !!options,
  3979. includePrerelease: false
  3980. }
  3981. }
  3982. if (range instanceof Range) {
  3983. if (range.loose === !!options.loose &&
  3984. range.includePrerelease === !!options.includePrerelease) {
  3985. return range
  3986. } else {
  3987. return new Range(range.raw, options)
  3988. }
  3989. }
  3990. if (range instanceof Comparator) {
  3991. return new Range(range.value, options)
  3992. }
  3993. if (!(this instanceof Range)) {
  3994. return new Range(range, options)
  3995. }
  3996. this.options = options
  3997. this.loose = !!options.loose
  3998. this.includePrerelease = !!options.includePrerelease
  3999. // First, split based on boolean or ||
  4000. this.raw = range
  4001. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4002. return this.parseRange(range.trim())
  4003. }, this).filter(function (c) {
  4004. // throw out any that are not relevant for whatever reason
  4005. return c.length
  4006. })
  4007. if (!this.set.length) {
  4008. throw new TypeError('Invalid SemVer Range: ' + range)
  4009. }
  4010. this.format()
  4011. }
  4012. Range.prototype.format = function () {
  4013. this.range = this.set.map(function (comps) {
  4014. return comps.join(' ').trim()
  4015. }).join('||').trim()
  4016. return this.range
  4017. }
  4018. Range.prototype.toString = function () {
  4019. return this.range
  4020. }
  4021. Range.prototype.parseRange = function (range) {
  4022. var loose = this.options.loose
  4023. range = range.trim()
  4024. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4025. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4026. range = range.replace(hr, hyphenReplace)
  4027. debug('hyphen replace', range)
  4028. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4029. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4030. debug('comparator trim', range, re[COMPARATORTRIM])
  4031. // `~ 1.2.3` => `~1.2.3`
  4032. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4033. // `^ 1.2.3` => `^1.2.3`
  4034. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4035. // normalize spaces
  4036. range = range.split(/\s+/).join(' ')
  4037. // At this point, the range is completely trimmed and
  4038. // ready to be split into comparators.
  4039. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4040. var set = range.split(' ').map(function (comp) {
  4041. return parseComparator(comp, this.options)
  4042. }, this).join(' ').split(/\s+/)
  4043. if (this.options.loose) {
  4044. // in loose mode, throw out any that are not valid comparators
  4045. set = set.filter(function (comp) {
  4046. return !!comp.match(compRe)
  4047. })
  4048. }
  4049. set = set.map(function (comp) {
  4050. return new Comparator(comp, this.options)
  4051. }, this)
  4052. return set
  4053. }
  4054. Range.prototype.intersects = function (range, options) {
  4055. if (!(range instanceof Range)) {
  4056. throw new TypeError('a Range is required')
  4057. }
  4058. return this.set.some(function (thisComparators) {
  4059. return thisComparators.every(function (thisComparator) {
  4060. return range.set.some(function (rangeComparators) {
  4061. return rangeComparators.every(function (rangeComparator) {
  4062. return thisComparator.intersects(rangeComparator, options)
  4063. })
  4064. })
  4065. })
  4066. })
  4067. }
  4068. // Mostly just for testing and legacy API reasons
  4069. exports.toComparators = toComparators
  4070. function toComparators (range, options) {
  4071. return new Range(range, options).set.map(function (comp) {
  4072. return comp.map(function (c) {
  4073. return c.value
  4074. }).join(' ').trim().split(' ')
  4075. })
  4076. }
  4077. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4078. // already replaced the hyphen ranges
  4079. // turn into a set of JUST comparators.
  4080. function parseComparator (comp, options) {
  4081. debug('comp', comp, options)
  4082. comp = replaceCarets(comp, options)
  4083. debug('caret', comp)
  4084. comp = replaceTildes(comp, options)
  4085. debug('tildes', comp)
  4086. comp = replaceXRanges(comp, options)
  4087. debug('xrange', comp)
  4088. comp = replaceStars(comp, options)
  4089. debug('stars', comp)
  4090. return comp
  4091. }
  4092. function isX (id) {
  4093. return !id || id.toLowerCase() === 'x' || id === '*'
  4094. }
  4095. // ~, ~> --> * (any, kinda silly)
  4096. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4097. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4098. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4099. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4100. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4101. function replaceTildes (comp, options) {
  4102. return comp.trim().split(/\s+/).map(function (comp) {
  4103. return replaceTilde(comp, options)
  4104. }).join(' ')
  4105. }
  4106. function replaceTilde (comp, options) {
  4107. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4108. return comp.replace(r, function (_, M, m, p, pr) {
  4109. debug('tilde', comp, _, M, m, p, pr)
  4110. var ret
  4111. if (isX(M)) {
  4112. ret = ''
  4113. } else if (isX(m)) {
  4114. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4115. } else if (isX(p)) {
  4116. // ~1.2 == >=1.2.0 <1.3.0
  4117. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4118. } else if (pr) {
  4119. debug('replaceTilde pr', pr)
  4120. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4121. ' <' + M + '.' + (+m + 1) + '.0'
  4122. } else {
  4123. // ~1.2.3 == >=1.2.3 <1.3.0
  4124. ret = '>=' + M + '.' + m + '.' + p +
  4125. ' <' + M + '.' + (+m + 1) + '.0'
  4126. }
  4127. debug('tilde return', ret)
  4128. return ret
  4129. })
  4130. }
  4131. // ^ --> * (any, kinda silly)
  4132. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4133. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4134. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4135. // ^1.2.3 --> >=1.2.3 <2.0.0
  4136. // ^1.2.0 --> >=1.2.0 <2.0.0
  4137. function replaceCarets (comp, options) {
  4138. return comp.trim().split(/\s+/).map(function (comp) {
  4139. return replaceCaret(comp, options)
  4140. }).join(' ')
  4141. }
  4142. function replaceCaret (comp, options) {
  4143. debug('caret', comp, options)
  4144. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4145. return comp.replace(r, function (_, M, m, p, pr) {
  4146. debug('caret', comp, _, M, m, p, pr)
  4147. var ret
  4148. if (isX(M)) {
  4149. ret = ''
  4150. } else if (isX(m)) {
  4151. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4152. } else if (isX(p)) {
  4153. if (M === '0') {
  4154. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4155. } else {
  4156. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4157. }
  4158. } else if (pr) {
  4159. debug('replaceCaret pr', pr)
  4160. if (M === '0') {
  4161. if (m === '0') {
  4162. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4163. ' <' + M + '.' + m + '.' + (+p + 1)
  4164. } else {
  4165. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4166. ' <' + M + '.' + (+m + 1) + '.0'
  4167. }
  4168. } else {
  4169. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4170. ' <' + (+M + 1) + '.0.0'
  4171. }
  4172. } else {
  4173. debug('no pr')
  4174. if (M === '0') {
  4175. if (m === '0') {
  4176. ret = '>=' + M + '.' + m + '.' + p +
  4177. ' <' + M + '.' + m + '.' + (+p + 1)
  4178. } else {
  4179. ret = '>=' + M + '.' + m + '.' + p +
  4180. ' <' + M + '.' + (+m + 1) + '.0'
  4181. }
  4182. } else {
  4183. ret = '>=' + M + '.' + m + '.' + p +
  4184. ' <' + (+M + 1) + '.0.0'
  4185. }
  4186. }
  4187. debug('caret return', ret)
  4188. return ret
  4189. })
  4190. }
  4191. function replaceXRanges (comp, options) {
  4192. debug('replaceXRanges', comp, options)
  4193. return comp.split(/\s+/).map(function (comp) {
  4194. return replaceXRange(comp, options)
  4195. }).join(' ')
  4196. }
  4197. function replaceXRange (comp, options) {
  4198. comp = comp.trim()
  4199. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4200. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4201. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4202. var xM = isX(M)
  4203. var xm = xM || isX(m)
  4204. var xp = xm || isX(p)
  4205. var anyX = xp
  4206. if (gtlt === '=' && anyX) {
  4207. gtlt = ''
  4208. }
  4209. if (xM) {
  4210. if (gtlt === '>' || gtlt === '<') {
  4211. // nothing is allowed
  4212. ret = '<0.0.0'
  4213. } else {
  4214. // nothing is forbidden
  4215. ret = '*'
  4216. }
  4217. } else if (gtlt && anyX) {
  4218. // we know patch is an x, because we have any x at all.
  4219. // replace X with 0
  4220. if (xm) {
  4221. m = 0
  4222. }
  4223. p = 0
  4224. if (gtlt === '>') {
  4225. // >1 => >=2.0.0
  4226. // >1.2 => >=1.3.0
  4227. // >1.2.3 => >= 1.2.4
  4228. gtlt = '>='
  4229. if (xm) {
  4230. M = +M + 1
  4231. m = 0
  4232. p = 0
  4233. } else {
  4234. m = +m + 1
  4235. p = 0
  4236. }
  4237. } else if (gtlt === '<=') {
  4238. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4239. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4240. gtlt = '<'
  4241. if (xm) {
  4242. M = +M + 1
  4243. } else {
  4244. m = +m + 1
  4245. }
  4246. }
  4247. ret = gtlt + M + '.' + m + '.' + p
  4248. } else if (xm) {
  4249. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4250. } else if (xp) {
  4251. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4252. }
  4253. debug('xRange return', ret)
  4254. return ret
  4255. })
  4256. }
  4257. // Because * is AND-ed with everything else in the comparator,
  4258. // and '' means "any version", just remove the *s entirely.
  4259. function replaceStars (comp, options) {
  4260. debug('replaceStars', comp, options)
  4261. // Looseness is ignored here. star is always as loose as it gets!
  4262. return comp.trim().replace(re[STAR], '')
  4263. }
  4264. // This function is passed to string.replace(re[HYPHENRANGE])
  4265. // M, m, patch, prerelease, build
  4266. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4267. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4268. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4269. function hyphenReplace ($0,
  4270. from, fM, fm, fp, fpr, fb,
  4271. to, tM, tm, tp, tpr, tb) {
  4272. if (isX(fM)) {
  4273. from = ''
  4274. } else if (isX(fm)) {
  4275. from = '>=' + fM + '.0.0'
  4276. } else if (isX(fp)) {
  4277. from = '>=' + fM + '.' + fm + '.0'
  4278. } else {
  4279. from = '>=' + from
  4280. }
  4281. if (isX(tM)) {
  4282. to = ''
  4283. } else if (isX(tm)) {
  4284. to = '<' + (+tM + 1) + '.0.0'
  4285. } else if (isX(tp)) {
  4286. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4287. } else if (tpr) {
  4288. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4289. } else {
  4290. to = '<=' + to
  4291. }
  4292. return (from + ' ' + to).trim()
  4293. }
  4294. // if ANY of the sets match ALL of its comparators, then pass
  4295. Range.prototype.test = function (version) {
  4296. if (!version) {
  4297. return false
  4298. }
  4299. if (typeof version === 'string') {
  4300. version = new SemVer(version, this.options)
  4301. }
  4302. for (var i = 0; i < this.set.length; i++) {
  4303. if (testSet(this.set[i], version, this.options)) {
  4304. return true
  4305. }
  4306. }
  4307. return false
  4308. }
  4309. function testSet (set, version, options) {
  4310. for (var i = 0; i < set.length; i++) {
  4311. if (!set[i].test(version)) {
  4312. return false
  4313. }
  4314. }
  4315. if (version.prerelease.length && !options.includePrerelease) {
  4316. // Find the set of versions that are allowed to have prereleases
  4317. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4318. // That should allow `1.2.3-pr.2` to pass.
  4319. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4320. // even though it's within the range set by the comparators.
  4321. for (i = 0; i < set.length; i++) {
  4322. debug(set[i].semver)
  4323. if (set[i].semver === ANY) {
  4324. continue
  4325. }
  4326. if (set[i].semver.prerelease.length > 0) {
  4327. var allowed = set[i].semver
  4328. if (allowed.major === version.major &&
  4329. allowed.minor === version.minor &&
  4330. allowed.patch === version.patch) {
  4331. return true
  4332. }
  4333. }
  4334. }
  4335. // Version has a -pre, but it's not one of the ones we like.
  4336. return false
  4337. }
  4338. return true
  4339. }
  4340. exports.satisfies = satisfies
  4341. function satisfies (version, range, options) {
  4342. try {
  4343. range = new Range(range, options)
  4344. } catch (er) {
  4345. return false
  4346. }
  4347. return range.test(version)
  4348. }
  4349. exports.maxSatisfying = maxSatisfying
  4350. function maxSatisfying (versions, range, options) {
  4351. var max = null
  4352. var maxSV = null
  4353. try {
  4354. var rangeObj = new Range(range, options)
  4355. } catch (er) {
  4356. return null
  4357. }
  4358. versions.forEach(function (v) {
  4359. if (rangeObj.test(v)) {
  4360. // satisfies(v, range, options)
  4361. if (!max || maxSV.compare(v) === -1) {
  4362. // compare(max, v, true)
  4363. max = v
  4364. maxSV = new SemVer(max, options)
  4365. }
  4366. }
  4367. })
  4368. return max
  4369. }
  4370. exports.minSatisfying = minSatisfying
  4371. function minSatisfying (versions, range, options) {
  4372. var min = null
  4373. var minSV = null
  4374. try {
  4375. var rangeObj = new Range(range, options)
  4376. } catch (er) {
  4377. return null
  4378. }
  4379. versions.forEach(function (v) {
  4380. if (rangeObj.test(v)) {
  4381. // satisfies(v, range, options)
  4382. if (!min || minSV.compare(v) === 1) {
  4383. // compare(min, v, true)
  4384. min = v
  4385. minSV = new SemVer(min, options)
  4386. }
  4387. }
  4388. })
  4389. return min
  4390. }
  4391. exports.minVersion = minVersion
  4392. function minVersion (range, loose) {
  4393. range = new Range(range, loose)
  4394. var minver = new SemVer('0.0.0')
  4395. if (range.test(minver)) {
  4396. return minver
  4397. }
  4398. minver = new SemVer('0.0.0-0')
  4399. if (range.test(minver)) {
  4400. return minver
  4401. }
  4402. minver = null
  4403. for (var i = 0; i < range.set.length; ++i) {
  4404. var comparators = range.set[i]
  4405. comparators.forEach(function (comparator) {
  4406. // Clone to avoid manipulating the comparator's semver object.
  4407. var compver = new SemVer(comparator.semver.version)
  4408. switch (comparator.operator) {
  4409. case '>':
  4410. if (compver.prerelease.length === 0) {
  4411. compver.patch++
  4412. } else {
  4413. compver.prerelease.push(0)
  4414. }
  4415. compver.raw = compver.format()
  4416. /* fallthrough */
  4417. case '':
  4418. case '>=':
  4419. if (!minver || gt(minver, compver)) {
  4420. minver = compver
  4421. }
  4422. break
  4423. case '<':
  4424. case '<=':
  4425. /* Ignore maximum versions */
  4426. break
  4427. /* istanbul ignore next */
  4428. default:
  4429. throw new Error('Unexpected operation: ' + comparator.operator)
  4430. }
  4431. })
  4432. }
  4433. if (minver && range.test(minver)) {
  4434. return minver
  4435. }
  4436. return null
  4437. }
  4438. exports.validRange = validRange
  4439. function validRange (range, options) {
  4440. try {
  4441. // Return '*' instead of '' so that truthiness works.
  4442. // This will throw if it's invalid anyway
  4443. return new Range(range, options).range || '*'
  4444. } catch (er) {
  4445. return null
  4446. }
  4447. }
  4448. // Determine if version is less than all the versions possible in the range
  4449. exports.ltr = ltr
  4450. function ltr (version, range, options) {
  4451. return outside(version, range, '<', options)
  4452. }
  4453. // Determine if version is greater than all the versions possible in the range.
  4454. exports.gtr = gtr
  4455. function gtr (version, range, options) {
  4456. return outside(version, range, '>', options)
  4457. }
  4458. exports.outside = outside
  4459. function outside (version, range, hilo, options) {
  4460. version = new SemVer(version, options)
  4461. range = new Range(range, options)
  4462. var gtfn, ltefn, ltfn, comp, ecomp
  4463. switch (hilo) {
  4464. case '>':
  4465. gtfn = gt
  4466. ltefn = lte
  4467. ltfn = lt
  4468. comp = '>'
  4469. ecomp = '>='
  4470. break
  4471. case '<':
  4472. gtfn = lt
  4473. ltefn = gte
  4474. ltfn = gt
  4475. comp = '<'
  4476. ecomp = '<='
  4477. break
  4478. default:
  4479. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4480. }
  4481. // If it satisifes the range it is not outside
  4482. if (satisfies(version, range, options)) {
  4483. return false
  4484. }
  4485. // From now on, variable terms are as if we're in "gtr" mode.
  4486. // but note that everything is flipped for the "ltr" function.
  4487. for (var i = 0; i < range.set.length; ++i) {
  4488. var comparators = range.set[i]
  4489. var high = null
  4490. var low = null
  4491. comparators.forEach(function (comparator) {
  4492. if (comparator.semver === ANY) {
  4493. comparator = new Comparator('>=0.0.0')
  4494. }
  4495. high = high || comparator
  4496. low = low || comparator
  4497. if (gtfn(comparator.semver, high.semver, options)) {
  4498. high = comparator
  4499. } else if (ltfn(comparator.semver, low.semver, options)) {
  4500. low = comparator
  4501. }
  4502. })
  4503. // If the edge version comparator has a operator then our version
  4504. // isn't outside it
  4505. if (high.operator === comp || high.operator === ecomp) {
  4506. return false
  4507. }
  4508. // If the lowest version comparator has an operator and our version
  4509. // is less than it then it isn't higher than the range
  4510. if ((!low.operator || low.operator === comp) &&
  4511. ltefn(version, low.semver)) {
  4512. return false
  4513. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4514. return false
  4515. }
  4516. }
  4517. return true
  4518. }
  4519. exports.prerelease = prerelease
  4520. function prerelease (version, options) {
  4521. var parsed = parse(version, options)
  4522. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4523. }
  4524. exports.intersects = intersects
  4525. function intersects (r1, r2, options) {
  4526. r1 = new Range(r1, options)
  4527. r2 = new Range(r2, options)
  4528. return r1.intersects(r2)
  4529. }
  4530. exports.coerce = coerce
  4531. function coerce (version) {
  4532. if (version instanceof SemVer) {
  4533. return version
  4534. }
  4535. if (typeof version !== 'string') {
  4536. return null
  4537. }
  4538. var match = version.match(re[COERCE])
  4539. if (match == null) {
  4540. return null
  4541. }
  4542. return parse(match[1] +
  4543. '.' + (match[2] || '0') +
  4544. '.' + (match[3] || '0'))
  4545. }
  4546. /***/ }),
  4547. /***/ 287:
  4548. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4549. "use strict";
  4550. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4551. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4552. return new (P || (P = Promise))(function (resolve, reject) {
  4553. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4554. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4555. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4556. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4557. });
  4558. };
  4559. var __importStar = (this && this.__importStar) || function (mod) {
  4560. if (mod && mod.__esModule) return mod;
  4561. var result = {};
  4562. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4563. result["default"] = mod;
  4564. return result;
  4565. };
  4566. var __importDefault = (this && this.__importDefault) || function (mod) {
  4567. return (mod && mod.__esModule) ? mod : { "default": mod };
  4568. };
  4569. Object.defineProperty(exports, "__esModule", { value: true });
  4570. const assert = __importStar(__webpack_require__(357));
  4571. const core = __importStar(__webpack_require__(470));
  4572. const exec = __importStar(__webpack_require__(986));
  4573. const fs = __importStar(__webpack_require__(747));
  4574. const io = __importStar(__webpack_require__(1));
  4575. const os = __importStar(__webpack_require__(87));
  4576. const path = __importStar(__webpack_require__(622));
  4577. const regexpHelper = __importStar(__webpack_require__(528));
  4578. const stateHelper = __importStar(__webpack_require__(153));
  4579. const urlHelper = __importStar(__webpack_require__(81));
  4580. const v4_1 = __importDefault(__webpack_require__(826));
  4581. const IS_WINDOWS = process.platform === 'win32';
  4582. const SSH_COMMAND_KEY = 'core.sshCommand';
  4583. function createAuthHelper(git, settings) {
  4584. return new GitAuthHelper(git, settings);
  4585. }
  4586. exports.createAuthHelper = createAuthHelper;
  4587. class GitAuthHelper {
  4588. constructor(gitCommandManager, gitSourceSettings) {
  4589. this.sshCommand = '';
  4590. this.sshKeyPath = '';
  4591. this.sshKnownHostsPath = '';
  4592. this.temporaryHomePath = '';
  4593. this.git = gitCommandManager;
  4594. this.settings = gitSourceSettings || {};
  4595. // Token auth header
  4596. const serverUrl = urlHelper.getServerUrl();
  4597. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4598. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4599. core.setSecret(basicCredential);
  4600. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4601. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4602. // Instead of SSH URL
  4603. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4604. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4605. }
  4606. configureAuth() {
  4607. return __awaiter(this, void 0, void 0, function* () {
  4608. // Remove possible previous values
  4609. yield this.removeAuth();
  4610. // Configure new values
  4611. yield this.configureSsh();
  4612. yield this.configureToken();
  4613. });
  4614. }
  4615. configureGlobalAuth() {
  4616. return __awaiter(this, void 0, void 0, function* () {
  4617. // Create a temp home directory
  4618. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4619. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4620. const uniqueId = v4_1.default();
  4621. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4622. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4623. // Copy the global git config
  4624. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4625. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4626. let configExists = false;
  4627. try {
  4628. yield fs.promises.stat(gitConfigPath);
  4629. configExists = true;
  4630. }
  4631. catch (err) {
  4632. if (err.code !== 'ENOENT') {
  4633. throw err;
  4634. }
  4635. }
  4636. if (configExists) {
  4637. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4638. yield io.cp(gitConfigPath, newGitConfigPath);
  4639. }
  4640. else {
  4641. yield fs.promises.writeFile(newGitConfigPath, '');
  4642. }
  4643. try {
  4644. // Override HOME
  4645. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4646. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4647. // Configure the token
  4648. yield this.configureToken(newGitConfigPath, true);
  4649. // Configure HTTPS instead of SSH
  4650. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4651. if (!this.settings.sshKey) {
  4652. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4653. }
  4654. }
  4655. catch (err) {
  4656. // Unset in case somehow written to the real global config
  4657. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4658. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4659. throw err;
  4660. }
  4661. });
  4662. }
  4663. configureSubmoduleAuth() {
  4664. return __awaiter(this, void 0, void 0, function* () {
  4665. // Remove possible previous HTTPS instead of SSH
  4666. yield this.removeGitConfig(this.insteadOfKey, true);
  4667. if (this.settings.persistCredentials) {
  4668. // Configure a placeholder value. This approach avoids the credential being captured
  4669. // by process creation audit events, which are commonly logged. For more information,
  4670. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4671. 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);
  4672. // Replace the placeholder
  4673. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4674. for (const configPath of configPaths) {
  4675. core.debug(`Replacing token placeholder in '${configPath}'`);
  4676. this.replaceTokenPlaceholder(configPath);
  4677. }
  4678. if (this.settings.sshKey) {
  4679. // Configure core.sshCommand
  4680. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4681. }
  4682. else {
  4683. // Configure HTTPS instead of SSH
  4684. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4685. }
  4686. }
  4687. });
  4688. }
  4689. removeAuth() {
  4690. return __awaiter(this, void 0, void 0, function* () {
  4691. yield this.removeSsh();
  4692. yield this.removeToken();
  4693. });
  4694. }
  4695. removeGlobalAuth() {
  4696. return __awaiter(this, void 0, void 0, function* () {
  4697. core.debug(`Unsetting HOME override`);
  4698. this.git.removeEnvironmentVariable('HOME');
  4699. yield io.rmRF(this.temporaryHomePath);
  4700. });
  4701. }
  4702. configureSsh() {
  4703. return __awaiter(this, void 0, void 0, function* () {
  4704. if (!this.settings.sshKey) {
  4705. return;
  4706. }
  4707. // Write key
  4708. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4709. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4710. const uniqueId = v4_1.default();
  4711. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4712. stateHelper.setSshKeyPath(this.sshKeyPath);
  4713. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4714. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4715. // Remove inherited permissions on Windows
  4716. if (IS_WINDOWS) {
  4717. const icacls = yield io.which('icacls.exe');
  4718. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4719. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4720. }
  4721. // Write known hosts
  4722. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4723. let userKnownHosts = '';
  4724. try {
  4725. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4726. }
  4727. catch (err) {
  4728. if (err.code !== 'ENOENT') {
  4729. throw err;
  4730. }
  4731. }
  4732. let knownHosts = '';
  4733. if (userKnownHosts) {
  4734. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4735. }
  4736. if (this.settings.sshKnownHosts) {
  4737. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4738. }
  4739. 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`;
  4740. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4741. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4742. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4743. // Configure GIT_SSH_COMMAND
  4744. const sshPath = yield io.which('ssh', true);
  4745. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4746. if (this.settings.sshStrict) {
  4747. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4748. }
  4749. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4750. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4751. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4752. // Configure core.sshCommand
  4753. if (this.settings.persistCredentials) {
  4754. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4755. }
  4756. });
  4757. }
  4758. configureToken(configPath, globalConfig) {
  4759. return __awaiter(this, void 0, void 0, function* () {
  4760. // Validate args
  4761. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4762. // Default config path
  4763. if (!configPath && !globalConfig) {
  4764. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4765. }
  4766. // Configure a placeholder value. This approach avoids the credential being captured
  4767. // by process creation audit events, which are commonly logged. For more information,
  4768. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4769. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4770. // Replace the placeholder
  4771. yield this.replaceTokenPlaceholder(configPath || '');
  4772. });
  4773. }
  4774. replaceTokenPlaceholder(configPath) {
  4775. return __awaiter(this, void 0, void 0, function* () {
  4776. assert.ok(configPath, 'configPath is not defined');
  4777. let content = (yield fs.promises.readFile(configPath)).toString();
  4778. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4779. if (placeholderIndex < 0 ||
  4780. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4781. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4782. }
  4783. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4784. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4785. yield fs.promises.writeFile(configPath, content);
  4786. });
  4787. }
  4788. removeSsh() {
  4789. return __awaiter(this, void 0, void 0, function* () {
  4790. // SSH key
  4791. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4792. if (keyPath) {
  4793. try {
  4794. yield io.rmRF(keyPath);
  4795. }
  4796. catch (err) {
  4797. core.debug(err.message);
  4798. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4799. }
  4800. }
  4801. // SSH known hosts
  4802. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4803. if (knownHostsPath) {
  4804. try {
  4805. yield io.rmRF(knownHostsPath);
  4806. }
  4807. catch (_a) {
  4808. // Intentionally empty
  4809. }
  4810. }
  4811. // SSH command
  4812. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4813. });
  4814. }
  4815. removeToken() {
  4816. return __awaiter(this, void 0, void 0, function* () {
  4817. // HTTP extra header
  4818. yield this.removeGitConfig(this.tokenConfigKey);
  4819. });
  4820. }
  4821. removeGitConfig(configKey, submoduleOnly = false) {
  4822. return __awaiter(this, void 0, void 0, function* () {
  4823. if (!submoduleOnly) {
  4824. if ((yield this.git.configExists(configKey)) &&
  4825. !(yield this.git.tryConfigUnset(configKey))) {
  4826. // Load the config contents
  4827. core.warning(`Failed to remove '${configKey}' from the git config`);
  4828. }
  4829. }
  4830. const pattern = regexpHelper.escape(configKey);
  4831. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4832. });
  4833. }
  4834. }
  4835. /***/ }),
  4836. /***/ 289:
  4837. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4838. "use strict";
  4839. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4840. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4841. return new (P || (P = Promise))(function (resolve, reject) {
  4842. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4843. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4844. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4845. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4846. });
  4847. };
  4848. var __importStar = (this && this.__importStar) || function (mod) {
  4849. if (mod && mod.__esModule) return mod;
  4850. var result = {};
  4851. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4852. result["default"] = mod;
  4853. return result;
  4854. };
  4855. Object.defineProperty(exports, "__esModule", { value: true });
  4856. const core = __importStar(__webpack_require__(470));
  4857. const exec = __importStar(__webpack_require__(986));
  4858. const fshelper = __importStar(__webpack_require__(618));
  4859. const io = __importStar(__webpack_require__(1));
  4860. const path = __importStar(__webpack_require__(622));
  4861. const regexpHelper = __importStar(__webpack_require__(528));
  4862. const retryHelper = __importStar(__webpack_require__(587));
  4863. const git_version_1 = __webpack_require__(559);
  4864. // Auth header not supported before 2.9
  4865. // Wire protocol v2 not supported before 2.18
  4866. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4867. function createCommandManager(workingDirectory, lfs) {
  4868. return __awaiter(this, void 0, void 0, function* () {
  4869. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4870. });
  4871. }
  4872. exports.createCommandManager = createCommandManager;
  4873. class GitCommandManager {
  4874. // Private constructor; use createCommandManager()
  4875. constructor() {
  4876. this.gitEnv = {
  4877. GIT_TERMINAL_PROMPT: '0',
  4878. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4879. };
  4880. this.gitPath = '';
  4881. this.lfs = false;
  4882. this.workingDirectory = '';
  4883. }
  4884. branchDelete(remote, branch) {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. const args = ['branch', '--delete', '--force'];
  4887. if (remote) {
  4888. args.push('--remote');
  4889. }
  4890. args.push(branch);
  4891. yield this.execGit(args);
  4892. });
  4893. }
  4894. branchExists(remote, pattern) {
  4895. return __awaiter(this, void 0, void 0, function* () {
  4896. const args = ['branch', '--list'];
  4897. if (remote) {
  4898. args.push('--remote');
  4899. }
  4900. args.push(pattern);
  4901. const output = yield this.execGit(args);
  4902. return !!output.stdout.trim();
  4903. });
  4904. }
  4905. branchList(remote) {
  4906. return __awaiter(this, void 0, void 0, function* () {
  4907. const result = [];
  4908. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4909. // "branch --list" is more difficult when in a detached HEAD state.
  4910. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4911. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4912. const args = ['rev-parse', '--symbolic-full-name'];
  4913. if (remote) {
  4914. args.push('--remotes=origin');
  4915. }
  4916. else {
  4917. args.push('--branches');
  4918. }
  4919. const output = yield this.execGit(args);
  4920. for (let branch of output.stdout.trim().split('\n')) {
  4921. branch = branch.trim();
  4922. if (branch) {
  4923. if (branch.startsWith('refs/heads/')) {
  4924. branch = branch.substr('refs/heads/'.length);
  4925. }
  4926. else if (branch.startsWith('refs/remotes/')) {
  4927. branch = branch.substr('refs/remotes/'.length);
  4928. }
  4929. result.push(branch);
  4930. }
  4931. }
  4932. return result;
  4933. });
  4934. }
  4935. checkout(ref, startPoint) {
  4936. return __awaiter(this, void 0, void 0, function* () {
  4937. const args = ['checkout', '--progress', '--force'];
  4938. if (startPoint) {
  4939. args.push('-B', ref, startPoint);
  4940. }
  4941. else {
  4942. args.push(ref);
  4943. }
  4944. yield this.execGit(args);
  4945. });
  4946. }
  4947. checkoutDetach() {
  4948. return __awaiter(this, void 0, void 0, function* () {
  4949. const args = ['checkout', '--detach'];
  4950. yield this.execGit(args);
  4951. });
  4952. }
  4953. config(configKey, configValue, globalConfig) {
  4954. return __awaiter(this, void 0, void 0, function* () {
  4955. yield this.execGit([
  4956. 'config',
  4957. globalConfig ? '--global' : '--local',
  4958. configKey,
  4959. configValue
  4960. ]);
  4961. });
  4962. }
  4963. configExists(configKey, globalConfig) {
  4964. return __awaiter(this, void 0, void 0, function* () {
  4965. const pattern = regexpHelper.escape(configKey);
  4966. const output = yield this.execGit([
  4967. 'config',
  4968. globalConfig ? '--global' : '--local',
  4969. '--name-only',
  4970. '--get-regexp',
  4971. pattern
  4972. ], true);
  4973. return output.exitCode === 0;
  4974. });
  4975. }
  4976. fetch(fetchDepth, refSpec) {
  4977. return __awaiter(this, void 0, void 0, function* () {
  4978. const args = [
  4979. '-c',
  4980. 'protocol.version=2',
  4981. 'fetch',
  4982. '--no-tags',
  4983. '--prune',
  4984. '--progress',
  4985. '--no-recurse-submodules'
  4986. ];
  4987. if (fetchDepth > 0) {
  4988. args.push(`--depth=${fetchDepth}`);
  4989. }
  4990. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4991. args.push('--unshallow');
  4992. }
  4993. args.push('origin');
  4994. for (const arg of refSpec) {
  4995. args.push(arg);
  4996. }
  4997. const that = this;
  4998. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4999. yield that.execGit(args);
  5000. }));
  5001. });
  5002. }
  5003. getWorkingDirectory() {
  5004. return this.workingDirectory;
  5005. }
  5006. init() {
  5007. return __awaiter(this, void 0, void 0, function* () {
  5008. yield this.execGit(['init', this.workingDirectory]);
  5009. });
  5010. }
  5011. isDetached() {
  5012. return __awaiter(this, void 0, void 0, function* () {
  5013. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5014. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5015. return !output.stdout.trim().startsWith('refs/heads/');
  5016. });
  5017. }
  5018. lfsFetch(ref) {
  5019. return __awaiter(this, void 0, void 0, function* () {
  5020. const args = ['lfs', 'fetch', 'origin', ref];
  5021. const that = this;
  5022. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5023. yield that.execGit(args);
  5024. }));
  5025. });
  5026. }
  5027. lfsInstall() {
  5028. return __awaiter(this, void 0, void 0, function* () {
  5029. yield this.execGit(['lfs', 'install', '--local']);
  5030. });
  5031. }
  5032. log1() {
  5033. return __awaiter(this, void 0, void 0, function* () {
  5034. yield this.execGit(['log', '-1']);
  5035. });
  5036. }
  5037. remoteAdd(remoteName, remoteUrl) {
  5038. return __awaiter(this, void 0, void 0, function* () {
  5039. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5040. });
  5041. }
  5042. removeEnvironmentVariable(name) {
  5043. delete this.gitEnv[name];
  5044. }
  5045. setEnvironmentVariable(name, value) {
  5046. this.gitEnv[name] = value;
  5047. }
  5048. submoduleForeach(command, recursive) {
  5049. return __awaiter(this, void 0, void 0, function* () {
  5050. const args = ['submodule', 'foreach'];
  5051. if (recursive) {
  5052. args.push('--recursive');
  5053. }
  5054. args.push(command);
  5055. const output = yield this.execGit(args);
  5056. return output.stdout;
  5057. });
  5058. }
  5059. submoduleSync(recursive) {
  5060. return __awaiter(this, void 0, void 0, function* () {
  5061. const args = ['submodule', 'sync'];
  5062. if (recursive) {
  5063. args.push('--recursive');
  5064. }
  5065. yield this.execGit(args);
  5066. });
  5067. }
  5068. submoduleUpdate(fetchDepth, recursive) {
  5069. return __awaiter(this, void 0, void 0, function* () {
  5070. const args = ['-c', 'protocol.version=2'];
  5071. args.push('submodule', 'update', '--init', '--force');
  5072. if (fetchDepth > 0) {
  5073. args.push(`--depth=${fetchDepth}`);
  5074. }
  5075. if (recursive) {
  5076. args.push('--recursive');
  5077. }
  5078. yield this.execGit(args);
  5079. });
  5080. }
  5081. tagExists(pattern) {
  5082. return __awaiter(this, void 0, void 0, function* () {
  5083. const output = yield this.execGit(['tag', '--list', pattern]);
  5084. return !!output.stdout.trim();
  5085. });
  5086. }
  5087. tryClean() {
  5088. return __awaiter(this, void 0, void 0, function* () {
  5089. const output = yield this.execGit(['clean', '-ffdx'], true);
  5090. return output.exitCode === 0;
  5091. });
  5092. }
  5093. tryConfigUnset(configKey, globalConfig) {
  5094. return __awaiter(this, void 0, void 0, function* () {
  5095. const output = yield this.execGit([
  5096. 'config',
  5097. globalConfig ? '--global' : '--local',
  5098. '--unset-all',
  5099. configKey
  5100. ], true);
  5101. return output.exitCode === 0;
  5102. });
  5103. }
  5104. tryDisableAutomaticGarbageCollection() {
  5105. return __awaiter(this, void 0, void 0, function* () {
  5106. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5107. return output.exitCode === 0;
  5108. });
  5109. }
  5110. tryGetFetchUrl() {
  5111. return __awaiter(this, void 0, void 0, function* () {
  5112. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5113. if (output.exitCode !== 0) {
  5114. return '';
  5115. }
  5116. const stdout = output.stdout.trim();
  5117. if (stdout.includes('\n')) {
  5118. return '';
  5119. }
  5120. return stdout;
  5121. });
  5122. }
  5123. tryReset() {
  5124. return __awaiter(this, void 0, void 0, function* () {
  5125. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5126. return output.exitCode === 0;
  5127. });
  5128. }
  5129. static createCommandManager(workingDirectory, lfs) {
  5130. return __awaiter(this, void 0, void 0, function* () {
  5131. const result = new GitCommandManager();
  5132. yield result.initializeCommandManager(workingDirectory, lfs);
  5133. return result;
  5134. });
  5135. }
  5136. execGit(args, allowAllExitCodes = false) {
  5137. return __awaiter(this, void 0, void 0, function* () {
  5138. fshelper.directoryExistsSync(this.workingDirectory, true);
  5139. const result = new GitOutput();
  5140. const env = {};
  5141. for (const key of Object.keys(process.env)) {
  5142. env[key] = process.env[key];
  5143. }
  5144. for (const key of Object.keys(this.gitEnv)) {
  5145. env[key] = this.gitEnv[key];
  5146. }
  5147. const stdout = [];
  5148. const options = {
  5149. cwd: this.workingDirectory,
  5150. env,
  5151. ignoreReturnCode: allowAllExitCodes,
  5152. listeners: {
  5153. stdout: (data) => {
  5154. stdout.push(data.toString());
  5155. }
  5156. }
  5157. };
  5158. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5159. result.stdout = stdout.join('');
  5160. return result;
  5161. });
  5162. }
  5163. initializeCommandManager(workingDirectory, lfs) {
  5164. return __awaiter(this, void 0, void 0, function* () {
  5165. this.workingDirectory = workingDirectory;
  5166. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5167. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5168. this.lfs = lfs;
  5169. if (!this.lfs) {
  5170. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5171. }
  5172. this.gitPath = yield io.which('git', true);
  5173. // Git version
  5174. core.debug('Getting git version');
  5175. let gitVersion = new git_version_1.GitVersion();
  5176. let gitOutput = yield this.execGit(['version']);
  5177. let stdout = gitOutput.stdout.trim();
  5178. if (!stdout.includes('\n')) {
  5179. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5180. if (match) {
  5181. gitVersion = new git_version_1.GitVersion(match[0]);
  5182. }
  5183. }
  5184. if (!gitVersion.isValid()) {
  5185. throw new Error('Unable to determine git version');
  5186. }
  5187. // Minimum git version
  5188. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5189. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5190. }
  5191. if (this.lfs) {
  5192. // Git-lfs version
  5193. core.debug('Getting git-lfs version');
  5194. let gitLfsVersion = new git_version_1.GitVersion();
  5195. const gitLfsPath = yield io.which('git-lfs', true);
  5196. gitOutput = yield this.execGit(['lfs', 'version']);
  5197. stdout = gitOutput.stdout.trim();
  5198. if (!stdout.includes('\n')) {
  5199. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5200. if (match) {
  5201. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5202. }
  5203. }
  5204. if (!gitLfsVersion.isValid()) {
  5205. throw new Error('Unable to determine git-lfs version');
  5206. }
  5207. // Minimum git-lfs version
  5208. // Note:
  5209. // - Auth header not supported before 2.1
  5210. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5211. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5212. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5213. }
  5214. }
  5215. // Set the user agent
  5216. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5217. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5218. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5219. });
  5220. }
  5221. }
  5222. class GitOutput {
  5223. constructor() {
  5224. this.stdout = '';
  5225. this.exitCode = 0;
  5226. }
  5227. }
  5228. /***/ }),
  5229. /***/ 293:
  5230. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5231. "use strict";
  5232. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5233. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5234. return new (P || (P = Promise))(function (resolve, reject) {
  5235. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5236. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5237. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5238. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5239. });
  5240. };
  5241. var __importStar = (this && this.__importStar) || function (mod) {
  5242. if (mod && mod.__esModule) return mod;
  5243. var result = {};
  5244. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5245. result["default"] = mod;
  5246. return result;
  5247. };
  5248. Object.defineProperty(exports, "__esModule", { value: true });
  5249. const core = __importStar(__webpack_require__(470));
  5250. const fsHelper = __importStar(__webpack_require__(618));
  5251. const gitAuthHelper = __importStar(__webpack_require__(287));
  5252. const gitCommandManager = __importStar(__webpack_require__(289));
  5253. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5254. const githubApiHelper = __importStar(__webpack_require__(464));
  5255. const io = __importStar(__webpack_require__(1));
  5256. const path = __importStar(__webpack_require__(622));
  5257. const refHelper = __importStar(__webpack_require__(227));
  5258. const stateHelper = __importStar(__webpack_require__(153));
  5259. const urlHelper = __importStar(__webpack_require__(81));
  5260. function getSource(settings) {
  5261. return __awaiter(this, void 0, void 0, function* () {
  5262. // Repository URL
  5263. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5264. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5265. // Remove conflicting file path
  5266. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5267. yield io.rmRF(settings.repositoryPath);
  5268. }
  5269. // Create directory
  5270. let isExisting = true;
  5271. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5272. isExisting = false;
  5273. yield io.mkdirP(settings.repositoryPath);
  5274. }
  5275. // Git command manager
  5276. core.startGroup('Getting Git version info');
  5277. const git = yield getGitCommandManager(settings);
  5278. core.endGroup();
  5279. // Prepare existing directory, otherwise recreate
  5280. if (isExisting) {
  5281. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5282. }
  5283. if (!git) {
  5284. // Downloading using REST API
  5285. core.info(`The repository will be downloaded using the GitHub REST API`);
  5286. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5287. if (settings.submodules) {
  5288. 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.`);
  5289. }
  5290. else if (settings.sshKey) {
  5291. 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.`);
  5292. }
  5293. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5294. return;
  5295. }
  5296. // Save state for POST action
  5297. stateHelper.setRepositoryPath(settings.repositoryPath);
  5298. // Initialize the repository
  5299. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5300. core.startGroup('Initializing the repository');
  5301. yield git.init();
  5302. yield git.remoteAdd('origin', repositoryUrl);
  5303. core.endGroup();
  5304. }
  5305. // Disable automatic garbage collection
  5306. core.startGroup('Disabling automatic garbage collection');
  5307. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5308. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5309. }
  5310. core.endGroup();
  5311. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5312. try {
  5313. // Configure auth
  5314. core.startGroup('Setting up auth');
  5315. yield authHelper.configureAuth();
  5316. core.endGroup();
  5317. // LFS install
  5318. if (settings.lfs) {
  5319. yield git.lfsInstall();
  5320. }
  5321. // Fetch
  5322. core.startGroup('Fetching the repository');
  5323. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5324. yield git.fetch(settings.fetchDepth, refSpec);
  5325. core.endGroup();
  5326. // Checkout info
  5327. core.startGroup('Determining the checkout info');
  5328. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5329. core.endGroup();
  5330. // LFS fetch
  5331. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5332. // Explicit lfs fetch will fetch lfs objects in parallel.
  5333. if (settings.lfs) {
  5334. core.startGroup('Fetching LFS objects');
  5335. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5336. core.endGroup();
  5337. }
  5338. // Checkout
  5339. core.startGroup('Checking out the ref');
  5340. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5341. core.endGroup();
  5342. // Submodules
  5343. if (settings.submodules) {
  5344. try {
  5345. // Temporarily override global config
  5346. core.startGroup('Setting up auth for fetching submodules');
  5347. yield authHelper.configureGlobalAuth();
  5348. core.endGroup();
  5349. // Checkout submodules
  5350. core.startGroup('Fetching submodules');
  5351. yield git.submoduleSync(settings.nestedSubmodules);
  5352. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5353. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5354. core.endGroup();
  5355. // Persist credentials
  5356. if (settings.persistCredentials) {
  5357. core.startGroup('Persisting credentials for submodules');
  5358. yield authHelper.configureSubmoduleAuth();
  5359. core.endGroup();
  5360. }
  5361. }
  5362. finally {
  5363. // Remove temporary global config override
  5364. yield authHelper.removeGlobalAuth();
  5365. }
  5366. }
  5367. // Dump some info about the checked out commit
  5368. yield git.log1();
  5369. }
  5370. finally {
  5371. // Remove auth
  5372. if (!settings.persistCredentials) {
  5373. core.startGroup('Removing auth');
  5374. yield authHelper.removeAuth();
  5375. core.endGroup();
  5376. }
  5377. }
  5378. });
  5379. }
  5380. exports.getSource = getSource;
  5381. function cleanup(repositoryPath) {
  5382. return __awaiter(this, void 0, void 0, function* () {
  5383. // Repo exists?
  5384. if (!repositoryPath ||
  5385. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5386. return;
  5387. }
  5388. let git;
  5389. try {
  5390. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5391. }
  5392. catch (_a) {
  5393. return;
  5394. }
  5395. // Remove auth
  5396. const authHelper = gitAuthHelper.createAuthHelper(git);
  5397. yield authHelper.removeAuth();
  5398. });
  5399. }
  5400. exports.cleanup = cleanup;
  5401. function getGitCommandManager(settings) {
  5402. return __awaiter(this, void 0, void 0, function* () {
  5403. core.info(`Working directory is '${settings.repositoryPath}'`);
  5404. try {
  5405. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5406. }
  5407. catch (err) {
  5408. // Git is required for LFS
  5409. if (settings.lfs) {
  5410. throw err;
  5411. }
  5412. // Otherwise fallback to REST API
  5413. return undefined;
  5414. }
  5415. });
  5416. }
  5417. /***/ }),
  5418. /***/ 294:
  5419. /***/ (function(module, __unusedexports, __webpack_require__) {
  5420. module.exports = parseOptions;
  5421. const { Deprecation } = __webpack_require__(692);
  5422. const { getUserAgent } = __webpack_require__(796);
  5423. const once = __webpack_require__(969);
  5424. const pkg = __webpack_require__(215);
  5425. const deprecateOptionsTimeout = once((log, deprecation) =>
  5426. log.warn(deprecation)
  5427. );
  5428. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5429. const deprecateOptionsHeaders = once((log, deprecation) =>
  5430. log.warn(deprecation)
  5431. );
  5432. function parseOptions(options, log, hook) {
  5433. if (options.headers) {
  5434. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5435. newObj[key.toLowerCase()] = options.headers[key];
  5436. return newObj;
  5437. }, {});
  5438. }
  5439. const clientDefaults = {
  5440. headers: options.headers || {},
  5441. request: options.request || {},
  5442. mediaType: {
  5443. previews: [],
  5444. format: ""
  5445. }
  5446. };
  5447. if (options.baseUrl) {
  5448. clientDefaults.baseUrl = options.baseUrl;
  5449. }
  5450. if (options.userAgent) {
  5451. clientDefaults.headers["user-agent"] = options.userAgent;
  5452. }
  5453. if (options.previews) {
  5454. clientDefaults.mediaType.previews = options.previews;
  5455. }
  5456. if (options.timeZone) {
  5457. clientDefaults.headers["time-zone"] = options.timeZone;
  5458. }
  5459. if (options.timeout) {
  5460. deprecateOptionsTimeout(
  5461. log,
  5462. new Deprecation(
  5463. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5464. )
  5465. );
  5466. clientDefaults.request.timeout = options.timeout;
  5467. }
  5468. if (options.agent) {
  5469. deprecateOptionsAgent(
  5470. log,
  5471. new Deprecation(
  5472. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5473. )
  5474. );
  5475. clientDefaults.request.agent = options.agent;
  5476. }
  5477. if (options.headers) {
  5478. deprecateOptionsHeaders(
  5479. log,
  5480. new Deprecation(
  5481. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5482. )
  5483. );
  5484. }
  5485. const userAgentOption = clientDefaults.headers["user-agent"];
  5486. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5487. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5488. .filter(Boolean)
  5489. .join(" ");
  5490. clientDefaults.request.hook = hook.bind(null, "request");
  5491. return clientDefaults;
  5492. }
  5493. /***/ }),
  5494. /***/ 297:
  5495. /***/ (function(module) {
  5496. module.exports = class HttpError extends Error {
  5497. constructor (message, code, headers) {
  5498. super(message)
  5499. // Maintains proper stack trace (only available on V8)
  5500. /* istanbul ignore next */
  5501. if (Error.captureStackTrace) {
  5502. Error.captureStackTrace(this, this.constructor)
  5503. }
  5504. this.name = 'HttpError'
  5505. this.code = code
  5506. this.headers = headers
  5507. }
  5508. }
  5509. /***/ }),
  5510. /***/ 299:
  5511. /***/ (function(__unusedmodule, exports) {
  5512. "use strict";
  5513. Object.defineProperty(exports, '__esModule', { value: true });
  5514. const VERSION = "1.1.2";
  5515. /**
  5516. * Some “list” response that can be paginated have a different response structure
  5517. *
  5518. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5519. * /installation/repositories also has `repository_selection`), as well as a key with
  5520. * the list of the items which name varies from endpoint to endpoint:
  5521. *
  5522. * - https://developer.github.com/v3/search/#example (key `items`)
  5523. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5524. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5525. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5526. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5527. *
  5528. * Octokit normalizes these responses so that paginated results are always returned following
  5529. * the same structure. One challenge is that if the list response has only one page, no Link
  5530. * header is provided, so this header alone is not sufficient to check wether a response is
  5531. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5532. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5533. * property because it also exists in the response of Get the combined status for a specific ref.
  5534. */
  5535. 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))?([^/]|$)/];
  5536. function normalizePaginatedListResponse(octokit, url, response) {
  5537. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5538. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5539. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5540. // to retrieve the same information.
  5541. const incompleteResults = response.data.incomplete_results;
  5542. const repositorySelection = response.data.repository_selection;
  5543. const totalCount = response.data.total_count;
  5544. delete response.data.incomplete_results;
  5545. delete response.data.repository_selection;
  5546. delete response.data.total_count;
  5547. const namespaceKey = Object.keys(response.data)[0];
  5548. const data = response.data[namespaceKey];
  5549. response.data = data;
  5550. if (typeof incompleteResults !== "undefined") {
  5551. response.data.incomplete_results = incompleteResults;
  5552. }
  5553. if (typeof repositorySelection !== "undefined") {
  5554. response.data.repository_selection = repositorySelection;
  5555. }
  5556. response.data.total_count = totalCount;
  5557. Object.defineProperty(response.data, namespaceKey, {
  5558. get() {
  5559. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5560. return Array.from(data);
  5561. }
  5562. });
  5563. }
  5564. function iterator(octokit, route, parameters) {
  5565. const options = octokit.request.endpoint(route, parameters);
  5566. const method = options.method;
  5567. const headers = options.headers;
  5568. let url = options.url;
  5569. return {
  5570. [Symbol.asyncIterator]: () => ({
  5571. next() {
  5572. if (!url) {
  5573. return Promise.resolve({
  5574. done: true
  5575. });
  5576. }
  5577. return octokit.request({
  5578. method,
  5579. url,
  5580. headers
  5581. }).then(response => {
  5582. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5583. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5584. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5585. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5586. return {
  5587. value: response
  5588. };
  5589. });
  5590. }
  5591. })
  5592. };
  5593. }
  5594. function paginate(octokit, route, parameters, mapFn) {
  5595. if (typeof parameters === "function") {
  5596. mapFn = parameters;
  5597. parameters = undefined;
  5598. }
  5599. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5600. }
  5601. function gather(octokit, results, iterator, mapFn) {
  5602. return iterator.next().then(result => {
  5603. if (result.done) {
  5604. return results;
  5605. }
  5606. let earlyExit = false;
  5607. function done() {
  5608. earlyExit = true;
  5609. }
  5610. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5611. if (earlyExit) {
  5612. return results;
  5613. }
  5614. return gather(octokit, results, iterator, mapFn);
  5615. });
  5616. }
  5617. /**
  5618. * @param octokit Octokit instance
  5619. * @param options Options passed to Octokit constructor
  5620. */
  5621. function paginateRest(octokit) {
  5622. return {
  5623. paginate: Object.assign(paginate.bind(null, octokit), {
  5624. iterator: iterator.bind(null, octokit)
  5625. })
  5626. };
  5627. }
  5628. paginateRest.VERSION = VERSION;
  5629. exports.paginateRest = paginateRest;
  5630. //# sourceMappingURL=index.js.map
  5631. /***/ }),
  5632. /***/ 323:
  5633. /***/ (function(module) {
  5634. "use strict";
  5635. var isStream = module.exports = function (stream) {
  5636. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5637. };
  5638. isStream.writable = function (stream) {
  5639. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5640. };
  5641. isStream.readable = function (stream) {
  5642. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5643. };
  5644. isStream.duplex = function (stream) {
  5645. return isStream.writable(stream) && isStream.readable(stream);
  5646. };
  5647. isStream.transform = function (stream) {
  5648. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5649. };
  5650. /***/ }),
  5651. /***/ 335:
  5652. /***/ (function(module, __unusedexports, __webpack_require__) {
  5653. module.exports = __webpack_require__(179);
  5654. /***/ }),
  5655. /***/ 336:
  5656. /***/ (function(module, __unusedexports, __webpack_require__) {
  5657. module.exports = hasLastPage
  5658. const deprecate = __webpack_require__(370)
  5659. const getPageLinks = __webpack_require__(577)
  5660. function hasLastPage (link) {
  5661. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5662. return getPageLinks(link).last
  5663. }
  5664. /***/ }),
  5665. /***/ 348:
  5666. /***/ (function(module, __unusedexports, __webpack_require__) {
  5667. "use strict";
  5668. module.exports = validate;
  5669. const { RequestError } = __webpack_require__(497);
  5670. const get = __webpack_require__(854);
  5671. const set = __webpack_require__(883);
  5672. function validate(octokit, options) {
  5673. if (!options.request.validate) {
  5674. return;
  5675. }
  5676. const { validate: params } = options.request;
  5677. Object.keys(params).forEach(parameterName => {
  5678. const parameter = get(params, parameterName);
  5679. const expectedType = parameter.type;
  5680. let parentParameterName;
  5681. let parentValue;
  5682. let parentParamIsPresent = true;
  5683. let parentParameterIsArray = false;
  5684. if (/\./.test(parameterName)) {
  5685. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5686. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5687. if (parentParameterIsArray) {
  5688. parentParameterName = parentParameterName.slice(0, -2);
  5689. }
  5690. parentValue = get(options, parentParameterName);
  5691. parentParamIsPresent =
  5692. parentParameterName === "headers" ||
  5693. (typeof parentValue === "object" && parentValue !== null);
  5694. }
  5695. const values = parentParameterIsArray
  5696. ? (get(options, parentParameterName) || []).map(
  5697. value => value[parameterName.split(/\./).pop()]
  5698. )
  5699. : [get(options, parameterName)];
  5700. values.forEach((value, i) => {
  5701. const valueIsPresent = typeof value !== "undefined";
  5702. const valueIsNull = value === null;
  5703. const currentParameterName = parentParameterIsArray
  5704. ? parameterName.replace(/\[\]/, `[${i}]`)
  5705. : parameterName;
  5706. if (!parameter.required && !valueIsPresent) {
  5707. return;
  5708. }
  5709. // if the parent parameter is of type object but allows null
  5710. // then the child parameters can be ignored
  5711. if (!parentParamIsPresent) {
  5712. return;
  5713. }
  5714. if (parameter.allowNull && valueIsNull) {
  5715. return;
  5716. }
  5717. if (!parameter.allowNull && valueIsNull) {
  5718. throw new RequestError(
  5719. `'${currentParameterName}' cannot be null`,
  5720. 400,
  5721. {
  5722. request: options
  5723. }
  5724. );
  5725. }
  5726. if (parameter.required && !valueIsPresent) {
  5727. throw new RequestError(
  5728. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5729. value
  5730. )}`,
  5731. 400,
  5732. {
  5733. request: options
  5734. }
  5735. );
  5736. }
  5737. // parse to integer before checking for enum
  5738. // so that string "1" will match enum with number 1
  5739. if (expectedType === "integer") {
  5740. const unparsedValue = value;
  5741. value = parseInt(value, 10);
  5742. if (isNaN(value)) {
  5743. throw new RequestError(
  5744. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5745. unparsedValue
  5746. )} is NaN`,
  5747. 400,
  5748. {
  5749. request: options
  5750. }
  5751. );
  5752. }
  5753. }
  5754. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5755. throw new RequestError(
  5756. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5757. value
  5758. )}`,
  5759. 400,
  5760. {
  5761. request: options
  5762. }
  5763. );
  5764. }
  5765. if (parameter.validation) {
  5766. const regex = new RegExp(parameter.validation);
  5767. if (!regex.test(value)) {
  5768. throw new RequestError(
  5769. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5770. value
  5771. )}`,
  5772. 400,
  5773. {
  5774. request: options
  5775. }
  5776. );
  5777. }
  5778. }
  5779. if (expectedType === "object" && typeof value === "string") {
  5780. try {
  5781. value = JSON.parse(value);
  5782. } catch (exception) {
  5783. throw new RequestError(
  5784. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5785. value
  5786. )}`,
  5787. 400,
  5788. {
  5789. request: options
  5790. }
  5791. );
  5792. }
  5793. }
  5794. set(options, parameter.mapTo || currentParameterName, value);
  5795. });
  5796. });
  5797. return options;
  5798. }
  5799. /***/ }),
  5800. /***/ 349:
  5801. /***/ (function(module, __unusedexports, __webpack_require__) {
  5802. module.exports = authenticationRequestError;
  5803. const { RequestError } = __webpack_require__(497);
  5804. function authenticationRequestError(state, error, options) {
  5805. /* istanbul ignore next */
  5806. if (!error.headers) throw error;
  5807. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5808. // handle "2FA required" error only
  5809. if (error.status !== 401 || !otpRequired) {
  5810. throw error;
  5811. }
  5812. if (
  5813. error.status === 401 &&
  5814. otpRequired &&
  5815. error.request &&
  5816. error.request.headers["x-github-otp"]
  5817. ) {
  5818. throw new RequestError(
  5819. "Invalid one-time password for two-factor authentication",
  5820. 401,
  5821. {
  5822. headers: error.headers,
  5823. request: options
  5824. }
  5825. );
  5826. }
  5827. if (typeof state.auth.on2fa !== "function") {
  5828. throw new RequestError(
  5829. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5830. 401,
  5831. {
  5832. headers: error.headers,
  5833. request: options
  5834. }
  5835. );
  5836. }
  5837. return Promise.resolve()
  5838. .then(() => {
  5839. return state.auth.on2fa();
  5840. })
  5841. .then(oneTimePassword => {
  5842. const newOptions = Object.assign(options, {
  5843. headers: Object.assign(
  5844. { "x-github-otp": oneTimePassword },
  5845. options.headers
  5846. )
  5847. });
  5848. return state.octokit.request(newOptions);
  5849. });
  5850. }
  5851. /***/ }),
  5852. /***/ 357:
  5853. /***/ (function(module) {
  5854. module.exports = require("assert");
  5855. /***/ }),
  5856. /***/ 363:
  5857. /***/ (function(module) {
  5858. module.exports = register
  5859. function register (state, name, method, options) {
  5860. if (typeof method !== 'function') {
  5861. throw new Error('method for before hook must be a function')
  5862. }
  5863. if (!options) {
  5864. options = {}
  5865. }
  5866. if (Array.isArray(name)) {
  5867. return name.reverse().reduce(function (callback, name) {
  5868. return register.bind(null, state, name, callback, options)
  5869. }, method)()
  5870. }
  5871. return Promise.resolve()
  5872. .then(function () {
  5873. if (!state.registry[name]) {
  5874. return method(options)
  5875. }
  5876. return (state.registry[name]).reduce(function (method, registered) {
  5877. return registered.hook.bind(null, method, options)
  5878. }, method)()
  5879. })
  5880. }
  5881. /***/ }),
  5882. /***/ 368:
  5883. /***/ (function(module) {
  5884. module.exports = function atob(str) {
  5885. return Buffer.from(str, 'base64').toString('binary')
  5886. }
  5887. /***/ }),
  5888. /***/ 370:
  5889. /***/ (function(module) {
  5890. module.exports = deprecate
  5891. const loggedMessages = {}
  5892. function deprecate (message) {
  5893. if (loggedMessages[message]) {
  5894. return
  5895. }
  5896. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5897. loggedMessages[message] = 1
  5898. }
  5899. /***/ }),
  5900. /***/ 385:
  5901. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5902. "use strict";
  5903. Object.defineProperty(exports, '__esModule', { value: true });
  5904. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5905. var isPlainObject = _interopDefault(__webpack_require__(696));
  5906. var universalUserAgent = __webpack_require__(562);
  5907. function lowercaseKeys(object) {
  5908. if (!object) {
  5909. return {};
  5910. }
  5911. return Object.keys(object).reduce((newObj, key) => {
  5912. newObj[key.toLowerCase()] = object[key];
  5913. return newObj;
  5914. }, {});
  5915. }
  5916. function mergeDeep(defaults, options) {
  5917. const result = Object.assign({}, defaults);
  5918. Object.keys(options).forEach(key => {
  5919. if (isPlainObject(options[key])) {
  5920. if (!(key in defaults)) Object.assign(result, {
  5921. [key]: options[key]
  5922. });else result[key] = mergeDeep(defaults[key], options[key]);
  5923. } else {
  5924. Object.assign(result, {
  5925. [key]: options[key]
  5926. });
  5927. }
  5928. });
  5929. return result;
  5930. }
  5931. function merge(defaults, route, options) {
  5932. if (typeof route === "string") {
  5933. let [method, url] = route.split(" ");
  5934. options = Object.assign(url ? {
  5935. method,
  5936. url
  5937. } : {
  5938. url: method
  5939. }, options);
  5940. } else {
  5941. options = Object.assign({}, route);
  5942. } // lowercase header names before merging with defaults to avoid duplicates
  5943. options.headers = lowercaseKeys(options.headers);
  5944. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5945. if (defaults && defaults.mediaType.previews.length) {
  5946. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5947. }
  5948. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5949. return mergedOptions;
  5950. }
  5951. function addQueryParameters(url, parameters) {
  5952. const separator = /\?/.test(url) ? "&" : "?";
  5953. const names = Object.keys(parameters);
  5954. if (names.length === 0) {
  5955. return url;
  5956. }
  5957. return url + separator + names.map(name => {
  5958. if (name === "q") {
  5959. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5960. }
  5961. return `${name}=${encodeURIComponent(parameters[name])}`;
  5962. }).join("&");
  5963. }
  5964. const urlVariableRegex = /\{[^}]+\}/g;
  5965. function removeNonChars(variableName) {
  5966. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5967. }
  5968. function extractUrlVariableNames(url) {
  5969. const matches = url.match(urlVariableRegex);
  5970. if (!matches) {
  5971. return [];
  5972. }
  5973. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5974. }
  5975. function omit(object, keysToOmit) {
  5976. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5977. obj[key] = object[key];
  5978. return obj;
  5979. }, {});
  5980. }
  5981. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5982. // TODO: create separate package.
  5983. //
  5984. // Copyright (c) 2012-2014, Bram Stein
  5985. // All rights reserved.
  5986. // Redistribution and use in source and binary forms, with or without
  5987. // modification, are permitted provided that the following conditions
  5988. // are met:
  5989. // 1. Redistributions of source code must retain the above copyright
  5990. // notice, this list of conditions and the following disclaimer.
  5991. // 2. Redistributions in binary form must reproduce the above copyright
  5992. // notice, this list of conditions and the following disclaimer in the
  5993. // documentation and/or other materials provided with the distribution.
  5994. // 3. The name of the author may not be used to endorse or promote products
  5995. // derived from this software without specific prior written permission.
  5996. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5997. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5998. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5999. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6000. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6001. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6002. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6003. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6004. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6005. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6006. /* istanbul ignore file */
  6007. function encodeReserved(str) {
  6008. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6009. if (!/%[0-9A-Fa-f]/.test(part)) {
  6010. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6011. }
  6012. return part;
  6013. }).join("");
  6014. }
  6015. function encodeUnreserved(str) {
  6016. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6017. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6018. });
  6019. }
  6020. function encodeValue(operator, value, key) {
  6021. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6022. if (key) {
  6023. return encodeUnreserved(key) + "=" + value;
  6024. } else {
  6025. return value;
  6026. }
  6027. }
  6028. function isDefined(value) {
  6029. return value !== undefined && value !== null;
  6030. }
  6031. function isKeyOperator(operator) {
  6032. return operator === ";" || operator === "&" || operator === "?";
  6033. }
  6034. function getValues(context, operator, key, modifier) {
  6035. var value = context[key],
  6036. result = [];
  6037. if (isDefined(value) && value !== "") {
  6038. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6039. value = value.toString();
  6040. if (modifier && modifier !== "*") {
  6041. value = value.substring(0, parseInt(modifier, 10));
  6042. }
  6043. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6044. } else {
  6045. if (modifier === "*") {
  6046. if (Array.isArray(value)) {
  6047. value.filter(isDefined).forEach(function (value) {
  6048. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6049. });
  6050. } else {
  6051. Object.keys(value).forEach(function (k) {
  6052. if (isDefined(value[k])) {
  6053. result.push(encodeValue(operator, value[k], k));
  6054. }
  6055. });
  6056. }
  6057. } else {
  6058. const tmp = [];
  6059. if (Array.isArray(value)) {
  6060. value.filter(isDefined).forEach(function (value) {
  6061. tmp.push(encodeValue(operator, value));
  6062. });
  6063. } else {
  6064. Object.keys(value).forEach(function (k) {
  6065. if (isDefined(value[k])) {
  6066. tmp.push(encodeUnreserved(k));
  6067. tmp.push(encodeValue(operator, value[k].toString()));
  6068. }
  6069. });
  6070. }
  6071. if (isKeyOperator(operator)) {
  6072. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6073. } else if (tmp.length !== 0) {
  6074. result.push(tmp.join(","));
  6075. }
  6076. }
  6077. }
  6078. } else {
  6079. if (operator === ";") {
  6080. if (isDefined(value)) {
  6081. result.push(encodeUnreserved(key));
  6082. }
  6083. } else if (value === "" && (operator === "&" || operator === "?")) {
  6084. result.push(encodeUnreserved(key) + "=");
  6085. } else if (value === "") {
  6086. result.push("");
  6087. }
  6088. }
  6089. return result;
  6090. }
  6091. function parseUrl(template) {
  6092. return {
  6093. expand: expand.bind(null, template)
  6094. };
  6095. }
  6096. function expand(template, context) {
  6097. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6098. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6099. if (expression) {
  6100. let operator = "";
  6101. const values = [];
  6102. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6103. operator = expression.charAt(0);
  6104. expression = expression.substr(1);
  6105. }
  6106. expression.split(/,/g).forEach(function (variable) {
  6107. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6108. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6109. });
  6110. if (operator && operator !== "+") {
  6111. var separator = ",";
  6112. if (operator === "?") {
  6113. separator = "&";
  6114. } else if (operator !== "#") {
  6115. separator = operator;
  6116. }
  6117. return (values.length !== 0 ? operator : "") + values.join(separator);
  6118. } else {
  6119. return values.join(",");
  6120. }
  6121. } else {
  6122. return encodeReserved(literal);
  6123. }
  6124. });
  6125. }
  6126. function parse(options) {
  6127. // https://fetch.spec.whatwg.org/#methods
  6128. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6129. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6130. let headers = Object.assign({}, options.headers);
  6131. let body;
  6132. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6133. const urlVariableNames = extractUrlVariableNames(url);
  6134. url = parseUrl(url).expand(parameters);
  6135. if (!/^http/.test(url)) {
  6136. url = options.baseUrl + url;
  6137. }
  6138. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6139. const remainingParameters = omit(parameters, omittedParameters);
  6140. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6141. if (!isBinaryRequset) {
  6142. if (options.mediaType.format) {
  6143. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6144. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6145. }
  6146. if (options.mediaType.previews.length) {
  6147. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6148. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6149. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6150. return `application/vnd.github.${preview}-preview${format}`;
  6151. }).join(",");
  6152. }
  6153. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6154. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6155. if (["GET", "HEAD"].includes(method)) {
  6156. url = addQueryParameters(url, remainingParameters);
  6157. } else {
  6158. if ("data" in remainingParameters) {
  6159. body = remainingParameters.data;
  6160. } else {
  6161. if (Object.keys(remainingParameters).length) {
  6162. body = remainingParameters;
  6163. } else {
  6164. headers["content-length"] = 0;
  6165. }
  6166. }
  6167. } // default content-type for JSON if body is set
  6168. if (!headers["content-type"] && typeof body !== "undefined") {
  6169. headers["content-type"] = "application/json; charset=utf-8";
  6170. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6171. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6172. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6173. body = "";
  6174. } // Only return body/request keys if present
  6175. return Object.assign({
  6176. method,
  6177. url,
  6178. headers
  6179. }, typeof body !== "undefined" ? {
  6180. body
  6181. } : null, options.request ? {
  6182. request: options.request
  6183. } : null);
  6184. }
  6185. function endpointWithDefaults(defaults, route, options) {
  6186. return parse(merge(defaults, route, options));
  6187. }
  6188. function withDefaults(oldDefaults, newDefaults) {
  6189. const DEFAULTS = merge(oldDefaults, newDefaults);
  6190. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6191. return Object.assign(endpoint, {
  6192. DEFAULTS,
  6193. defaults: withDefaults.bind(null, DEFAULTS),
  6194. merge: merge.bind(null, DEFAULTS),
  6195. parse
  6196. });
  6197. }
  6198. const VERSION = "6.0.1";
  6199. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6200. // So we use RequestParameters and add method as additional required property.
  6201. const DEFAULTS = {
  6202. method: "GET",
  6203. baseUrl: "https://api.github.com",
  6204. headers: {
  6205. accept: "application/vnd.github.v3+json",
  6206. "user-agent": userAgent
  6207. },
  6208. mediaType: {
  6209. format: "",
  6210. previews: []
  6211. }
  6212. };
  6213. const endpoint = withDefaults(null, DEFAULTS);
  6214. exports.endpoint = endpoint;
  6215. //# sourceMappingURL=index.js.map
  6216. /***/ }),
  6217. /***/ 389:
  6218. /***/ (function(module, __unusedexports, __webpack_require__) {
  6219. "use strict";
  6220. const fs = __webpack_require__(747);
  6221. const shebangCommand = __webpack_require__(866);
  6222. function readShebang(command) {
  6223. // Read the first 150 bytes from the file
  6224. const size = 150;
  6225. let buffer;
  6226. if (Buffer.alloc) {
  6227. // Node.js v4.5+ / v5.10+
  6228. buffer = Buffer.alloc(size);
  6229. } else {
  6230. // Old Node.js API
  6231. buffer = new Buffer(size);
  6232. buffer.fill(0); // zero-fill
  6233. }
  6234. let fd;
  6235. try {
  6236. fd = fs.openSync(command, 'r');
  6237. fs.readSync(fd, buffer, 0, size, 0);
  6238. fs.closeSync(fd);
  6239. } catch (e) { /* Empty */ }
  6240. // Attempt to extract shebang (null is returned if not a shebang)
  6241. return shebangCommand(buffer.toString());
  6242. }
  6243. module.exports = readShebang;
  6244. /***/ }),
  6245. /***/ 402:
  6246. /***/ (function(module, __unusedexports, __webpack_require__) {
  6247. module.exports = Octokit;
  6248. const { request } = __webpack_require__(753);
  6249. const Hook = __webpack_require__(523);
  6250. const parseClientOptions = __webpack_require__(294);
  6251. function Octokit(plugins, options) {
  6252. options = options || {};
  6253. const hook = new Hook.Collection();
  6254. const log = Object.assign(
  6255. {
  6256. debug: () => {},
  6257. info: () => {},
  6258. warn: console.warn,
  6259. error: console.error
  6260. },
  6261. options && options.log
  6262. );
  6263. const api = {
  6264. hook,
  6265. log,
  6266. request: request.defaults(parseClientOptions(options, log, hook))
  6267. };
  6268. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6269. return api;
  6270. }
  6271. /***/ }),
  6272. /***/ 413:
  6273. /***/ (function(module) {
  6274. module.exports = require("stream");
  6275. /***/ }),
  6276. /***/ 417:
  6277. /***/ (function(module) {
  6278. module.exports = require("crypto");
  6279. /***/ }),
  6280. /***/ 427:
  6281. /***/ (function(module, __unusedexports, __webpack_require__) {
  6282. "use strict";
  6283. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6284. // In that case, fall back to a deprecated internal.
  6285. const util = __webpack_require__(669);
  6286. let uv;
  6287. if (typeof util.getSystemErrorName === 'function') {
  6288. module.exports = util.getSystemErrorName;
  6289. } else {
  6290. try {
  6291. uv = process.binding('uv');
  6292. if (typeof uv.errname !== 'function') {
  6293. throw new TypeError('uv.errname is not a function');
  6294. }
  6295. } catch (err) {
  6296. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6297. uv = null;
  6298. }
  6299. module.exports = code => errname(uv, code);
  6300. }
  6301. // Used for testing the fallback behavior
  6302. module.exports.__test__ = errname;
  6303. function errname(uv, code) {
  6304. if (uv) {
  6305. return uv.errname(code);
  6306. }
  6307. if (!(code < 0)) {
  6308. throw new Error('err >= 0');
  6309. }
  6310. return `Unknown system error ${code}`;
  6311. }
  6312. /***/ }),
  6313. /***/ 430:
  6314. /***/ (function(module, __unusedexports, __webpack_require__) {
  6315. module.exports = octokitValidate;
  6316. const validate = __webpack_require__(348);
  6317. function octokitValidate(octokit) {
  6318. octokit.hook.before("request", validate.bind(null, octokit));
  6319. }
  6320. /***/ }),
  6321. /***/ 431:
  6322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6323. "use strict";
  6324. Object.defineProperty(exports, "__esModule", { value: true });
  6325. const os = __webpack_require__(87);
  6326. /**
  6327. * Commands
  6328. *
  6329. * Command Format:
  6330. * ##[name key=value;key=value]message
  6331. *
  6332. * Examples:
  6333. * ##[warning]This is the user warning message
  6334. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6335. */
  6336. function issueCommand(command, properties, message) {
  6337. const cmd = new Command(command, properties, message);
  6338. process.stdout.write(cmd.toString() + os.EOL);
  6339. }
  6340. exports.issueCommand = issueCommand;
  6341. function issue(name, message = '') {
  6342. issueCommand(name, {}, message);
  6343. }
  6344. exports.issue = issue;
  6345. const CMD_STRING = '::';
  6346. class Command {
  6347. constructor(command, properties, message) {
  6348. if (!command) {
  6349. command = 'missing.command';
  6350. }
  6351. this.command = command;
  6352. this.properties = properties;
  6353. this.message = message;
  6354. }
  6355. toString() {
  6356. let cmdStr = CMD_STRING + this.command;
  6357. if (this.properties && Object.keys(this.properties).length > 0) {
  6358. cmdStr += ' ';
  6359. for (const key in this.properties) {
  6360. if (this.properties.hasOwnProperty(key)) {
  6361. const val = this.properties[key];
  6362. if (val) {
  6363. // safely append the val - avoid blowing up when attempting to
  6364. // call .replace() if message is not a string for some reason
  6365. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6366. }
  6367. }
  6368. }
  6369. }
  6370. cmdStr += CMD_STRING;
  6371. // safely append the message - avoid blowing up when attempting to
  6372. // call .replace() if message is not a string for some reason
  6373. const message = `${this.message || ''}`;
  6374. cmdStr += escapeData(message);
  6375. return cmdStr;
  6376. }
  6377. }
  6378. function escapeData(s) {
  6379. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6380. }
  6381. function escape(s) {
  6382. return s
  6383. .replace(/\r/g, '%0D')
  6384. .replace(/\n/g, '%0A')
  6385. .replace(/]/g, '%5D')
  6386. .replace(/;/g, '%3B');
  6387. }
  6388. //# sourceMappingURL=command.js.map
  6389. /***/ }),
  6390. /***/ 438:
  6391. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6392. "use strict";
  6393. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6394. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6395. return new (P || (P = Promise))(function (resolve, reject) {
  6396. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6397. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6398. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6399. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6400. });
  6401. };
  6402. var __importStar = (this && this.__importStar) || function (mod) {
  6403. if (mod && mod.__esModule) return mod;
  6404. var result = {};
  6405. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6406. result["default"] = mod;
  6407. return result;
  6408. };
  6409. Object.defineProperty(exports, "__esModule", { value: true });
  6410. const assert = __importStar(__webpack_require__(357));
  6411. const core = __importStar(__webpack_require__(470));
  6412. const fs = __importStar(__webpack_require__(747));
  6413. const fsHelper = __importStar(__webpack_require__(618));
  6414. const io = __importStar(__webpack_require__(1));
  6415. const path = __importStar(__webpack_require__(622));
  6416. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6417. return __awaiter(this, void 0, void 0, function* () {
  6418. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6419. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6420. // Indicates whether to delete the directory contents
  6421. let remove = false;
  6422. // Check whether using git or REST API
  6423. if (!git) {
  6424. remove = true;
  6425. }
  6426. // Fetch URL does not match
  6427. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6428. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6429. remove = true;
  6430. }
  6431. else {
  6432. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6433. const lockPaths = [
  6434. path.join(repositoryPath, '.git', 'index.lock'),
  6435. path.join(repositoryPath, '.git', 'shallow.lock')
  6436. ];
  6437. for (const lockPath of lockPaths) {
  6438. try {
  6439. yield io.rmRF(lockPath);
  6440. }
  6441. catch (error) {
  6442. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6443. }
  6444. }
  6445. try {
  6446. core.startGroup('Removing previously created refs, to avoid conflicts');
  6447. // Checkout detached HEAD
  6448. if (!(yield git.isDetached())) {
  6449. yield git.checkoutDetach();
  6450. }
  6451. // Remove all refs/heads/*
  6452. let branches = yield git.branchList(false);
  6453. for (const branch of branches) {
  6454. yield git.branchDelete(false, branch);
  6455. }
  6456. // Remove all refs/remotes/origin/* to avoid conflicts
  6457. branches = yield git.branchList(true);
  6458. for (const branch of branches) {
  6459. yield git.branchDelete(true, branch);
  6460. }
  6461. core.endGroup();
  6462. // Clean
  6463. if (clean) {
  6464. core.startGroup('Cleaning the repository');
  6465. if (!(yield git.tryClean())) {
  6466. 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}'.`);
  6467. remove = true;
  6468. }
  6469. else if (!(yield git.tryReset())) {
  6470. remove = true;
  6471. }
  6472. core.endGroup();
  6473. if (remove) {
  6474. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6475. }
  6476. }
  6477. }
  6478. catch (error) {
  6479. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6480. remove = true;
  6481. }
  6482. }
  6483. if (remove) {
  6484. // Delete the contents of the directory. Don't delete the directory itself
  6485. // since it might be the current working directory.
  6486. core.info(`Deleting the contents of '${repositoryPath}'`);
  6487. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6488. yield io.rmRF(path.join(repositoryPath, file));
  6489. }
  6490. }
  6491. });
  6492. }
  6493. exports.prepareExistingDirectory = prepareExistingDirectory;
  6494. /***/ }),
  6495. /***/ 453:
  6496. /***/ (function(module, __unusedexports, __webpack_require__) {
  6497. var once = __webpack_require__(969)
  6498. var eos = __webpack_require__(3)
  6499. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6500. var noop = function () {}
  6501. var ancient = /^v?\.0/.test(process.version)
  6502. var isFn = function (fn) {
  6503. return typeof fn === 'function'
  6504. }
  6505. var isFS = function (stream) {
  6506. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6507. if (!fs) return false // browser
  6508. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6509. }
  6510. var isRequest = function (stream) {
  6511. return stream.setHeader && isFn(stream.abort)
  6512. }
  6513. var destroyer = function (stream, reading, writing, callback) {
  6514. callback = once(callback)
  6515. var closed = false
  6516. stream.on('close', function () {
  6517. closed = true
  6518. })
  6519. eos(stream, {readable: reading, writable: writing}, function (err) {
  6520. if (err) return callback(err)
  6521. closed = true
  6522. callback()
  6523. })
  6524. var destroyed = false
  6525. return function (err) {
  6526. if (closed) return
  6527. if (destroyed) return
  6528. destroyed = true
  6529. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6530. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6531. if (isFn(stream.destroy)) return stream.destroy()
  6532. callback(err || new Error('stream was destroyed'))
  6533. }
  6534. }
  6535. var call = function (fn) {
  6536. fn()
  6537. }
  6538. var pipe = function (from, to) {
  6539. return from.pipe(to)
  6540. }
  6541. var pump = function () {
  6542. var streams = Array.prototype.slice.call(arguments)
  6543. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6544. if (Array.isArray(streams[0])) streams = streams[0]
  6545. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6546. var error
  6547. var destroys = streams.map(function (stream, i) {
  6548. var reading = i < streams.length - 1
  6549. var writing = i > 0
  6550. return destroyer(stream, reading, writing, function (err) {
  6551. if (!error) error = err
  6552. if (err) destroys.forEach(call)
  6553. if (reading) return
  6554. destroys.forEach(call)
  6555. callback(error)
  6556. })
  6557. })
  6558. return streams.reduce(pipe)
  6559. }
  6560. module.exports = pump
  6561. /***/ }),
  6562. /***/ 454:
  6563. /***/ (function(module, exports, __webpack_require__) {
  6564. "use strict";
  6565. Object.defineProperty(exports, '__esModule', { value: true });
  6566. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6567. var Stream = _interopDefault(__webpack_require__(413));
  6568. var http = _interopDefault(__webpack_require__(605));
  6569. var Url = _interopDefault(__webpack_require__(835));
  6570. var https = _interopDefault(__webpack_require__(34));
  6571. var zlib = _interopDefault(__webpack_require__(761));
  6572. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6573. // fix for "Readable" isn't a named export issue
  6574. const Readable = Stream.Readable;
  6575. const BUFFER = Symbol('buffer');
  6576. const TYPE = Symbol('type');
  6577. class Blob {
  6578. constructor() {
  6579. this[TYPE] = '';
  6580. const blobParts = arguments[0];
  6581. const options = arguments[1];
  6582. const buffers = [];
  6583. let size = 0;
  6584. if (blobParts) {
  6585. const a = blobParts;
  6586. const length = Number(a.length);
  6587. for (let i = 0; i < length; i++) {
  6588. const element = a[i];
  6589. let buffer;
  6590. if (element instanceof Buffer) {
  6591. buffer = element;
  6592. } else if (ArrayBuffer.isView(element)) {
  6593. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6594. } else if (element instanceof ArrayBuffer) {
  6595. buffer = Buffer.from(element);
  6596. } else if (element instanceof Blob) {
  6597. buffer = element[BUFFER];
  6598. } else {
  6599. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6600. }
  6601. size += buffer.length;
  6602. buffers.push(buffer);
  6603. }
  6604. }
  6605. this[BUFFER] = Buffer.concat(buffers);
  6606. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6607. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6608. this[TYPE] = type;
  6609. }
  6610. }
  6611. get size() {
  6612. return this[BUFFER].length;
  6613. }
  6614. get type() {
  6615. return this[TYPE];
  6616. }
  6617. text() {
  6618. return Promise.resolve(this[BUFFER].toString());
  6619. }
  6620. arrayBuffer() {
  6621. const buf = this[BUFFER];
  6622. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6623. return Promise.resolve(ab);
  6624. }
  6625. stream() {
  6626. const readable = new Readable();
  6627. readable._read = function () {};
  6628. readable.push(this[BUFFER]);
  6629. readable.push(null);
  6630. return readable;
  6631. }
  6632. toString() {
  6633. return '[object Blob]';
  6634. }
  6635. slice() {
  6636. const size = this.size;
  6637. const start = arguments[0];
  6638. const end = arguments[1];
  6639. let relativeStart, relativeEnd;
  6640. if (start === undefined) {
  6641. relativeStart = 0;
  6642. } else if (start < 0) {
  6643. relativeStart = Math.max(size + start, 0);
  6644. } else {
  6645. relativeStart = Math.min(start, size);
  6646. }
  6647. if (end === undefined) {
  6648. relativeEnd = size;
  6649. } else if (end < 0) {
  6650. relativeEnd = Math.max(size + end, 0);
  6651. } else {
  6652. relativeEnd = Math.min(end, size);
  6653. }
  6654. const span = Math.max(relativeEnd - relativeStart, 0);
  6655. const buffer = this[BUFFER];
  6656. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6657. const blob = new Blob([], { type: arguments[2] });
  6658. blob[BUFFER] = slicedBuffer;
  6659. return blob;
  6660. }
  6661. }
  6662. Object.defineProperties(Blob.prototype, {
  6663. size: { enumerable: true },
  6664. type: { enumerable: true },
  6665. slice: { enumerable: true }
  6666. });
  6667. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6668. value: 'Blob',
  6669. writable: false,
  6670. enumerable: false,
  6671. configurable: true
  6672. });
  6673. /**
  6674. * fetch-error.js
  6675. *
  6676. * FetchError interface for operational errors
  6677. */
  6678. /**
  6679. * Create FetchError instance
  6680. *
  6681. * @param String message Error message for human
  6682. * @param String type Error type for machine
  6683. * @param String systemError For Node.js system error
  6684. * @return FetchError
  6685. */
  6686. function FetchError(message, type, systemError) {
  6687. Error.call(this, message);
  6688. this.message = message;
  6689. this.type = type;
  6690. // when err.type is `system`, err.code contains system error code
  6691. if (systemError) {
  6692. this.code = this.errno = systemError.code;
  6693. }
  6694. // hide custom error implementation details from end-users
  6695. Error.captureStackTrace(this, this.constructor);
  6696. }
  6697. FetchError.prototype = Object.create(Error.prototype);
  6698. FetchError.prototype.constructor = FetchError;
  6699. FetchError.prototype.name = 'FetchError';
  6700. let convert;
  6701. try {
  6702. convert = __webpack_require__(18).convert;
  6703. } catch (e) {}
  6704. const INTERNALS = Symbol('Body internals');
  6705. // fix an issue where "PassThrough" isn't a named export for node <10
  6706. const PassThrough = Stream.PassThrough;
  6707. /**
  6708. * Body mixin
  6709. *
  6710. * Ref: https://fetch.spec.whatwg.org/#body
  6711. *
  6712. * @param Stream body Readable stream
  6713. * @param Object opts Response options
  6714. * @return Void
  6715. */
  6716. function Body(body) {
  6717. var _this = this;
  6718. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6719. _ref$size = _ref.size;
  6720. let size = _ref$size === undefined ? 0 : _ref$size;
  6721. var _ref$timeout = _ref.timeout;
  6722. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6723. if (body == null) {
  6724. // body is undefined or null
  6725. body = null;
  6726. } else if (isURLSearchParams(body)) {
  6727. // body is a URLSearchParams
  6728. body = Buffer.from(body.toString());
  6729. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6730. // body is ArrayBuffer
  6731. body = Buffer.from(body);
  6732. } else if (ArrayBuffer.isView(body)) {
  6733. // body is ArrayBufferView
  6734. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6735. } else if (body instanceof Stream) ; else {
  6736. // none of the above
  6737. // coerce to string then buffer
  6738. body = Buffer.from(String(body));
  6739. }
  6740. this[INTERNALS] = {
  6741. body,
  6742. disturbed: false,
  6743. error: null
  6744. };
  6745. this.size = size;
  6746. this.timeout = timeout;
  6747. if (body instanceof Stream) {
  6748. body.on('error', function (err) {
  6749. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6750. _this[INTERNALS].error = error;
  6751. });
  6752. }
  6753. }
  6754. Body.prototype = {
  6755. get body() {
  6756. return this[INTERNALS].body;
  6757. },
  6758. get bodyUsed() {
  6759. return this[INTERNALS].disturbed;
  6760. },
  6761. /**
  6762. * Decode response as ArrayBuffer
  6763. *
  6764. * @return Promise
  6765. */
  6766. arrayBuffer() {
  6767. return consumeBody.call(this).then(function (buf) {
  6768. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6769. });
  6770. },
  6771. /**
  6772. * Return raw response as Blob
  6773. *
  6774. * @return Promise
  6775. */
  6776. blob() {
  6777. let ct = this.headers && this.headers.get('content-type') || '';
  6778. return consumeBody.call(this).then(function (buf) {
  6779. return Object.assign(
  6780. // Prevent copying
  6781. new Blob([], {
  6782. type: ct.toLowerCase()
  6783. }), {
  6784. [BUFFER]: buf
  6785. });
  6786. });
  6787. },
  6788. /**
  6789. * Decode response as json
  6790. *
  6791. * @return Promise
  6792. */
  6793. json() {
  6794. var _this2 = this;
  6795. return consumeBody.call(this).then(function (buffer) {
  6796. try {
  6797. return JSON.parse(buffer.toString());
  6798. } catch (err) {
  6799. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6800. }
  6801. });
  6802. },
  6803. /**
  6804. * Decode response as text
  6805. *
  6806. * @return Promise
  6807. */
  6808. text() {
  6809. return consumeBody.call(this).then(function (buffer) {
  6810. return buffer.toString();
  6811. });
  6812. },
  6813. /**
  6814. * Decode response as buffer (non-spec api)
  6815. *
  6816. * @return Promise
  6817. */
  6818. buffer() {
  6819. return consumeBody.call(this);
  6820. },
  6821. /**
  6822. * Decode response as text, while automatically detecting the encoding and
  6823. * trying to decode to UTF-8 (non-spec api)
  6824. *
  6825. * @return Promise
  6826. */
  6827. textConverted() {
  6828. var _this3 = this;
  6829. return consumeBody.call(this).then(function (buffer) {
  6830. return convertBody(buffer, _this3.headers);
  6831. });
  6832. }
  6833. };
  6834. // In browsers, all properties are enumerable.
  6835. Object.defineProperties(Body.prototype, {
  6836. body: { enumerable: true },
  6837. bodyUsed: { enumerable: true },
  6838. arrayBuffer: { enumerable: true },
  6839. blob: { enumerable: true },
  6840. json: { enumerable: true },
  6841. text: { enumerable: true }
  6842. });
  6843. Body.mixIn = function (proto) {
  6844. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6845. // istanbul ignore else: future proof
  6846. if (!(name in proto)) {
  6847. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6848. Object.defineProperty(proto, name, desc);
  6849. }
  6850. }
  6851. };
  6852. /**
  6853. * Consume and convert an entire Body to a Buffer.
  6854. *
  6855. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6856. *
  6857. * @return Promise
  6858. */
  6859. function consumeBody() {
  6860. var _this4 = this;
  6861. if (this[INTERNALS].disturbed) {
  6862. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6863. }
  6864. this[INTERNALS].disturbed = true;
  6865. if (this[INTERNALS].error) {
  6866. return Body.Promise.reject(this[INTERNALS].error);
  6867. }
  6868. let body = this.body;
  6869. // body is null
  6870. if (body === null) {
  6871. return Body.Promise.resolve(Buffer.alloc(0));
  6872. }
  6873. // body is blob
  6874. if (isBlob(body)) {
  6875. body = body.stream();
  6876. }
  6877. // body is buffer
  6878. if (Buffer.isBuffer(body)) {
  6879. return Body.Promise.resolve(body);
  6880. }
  6881. // istanbul ignore if: should never happen
  6882. if (!(body instanceof Stream)) {
  6883. return Body.Promise.resolve(Buffer.alloc(0));
  6884. }
  6885. // body is stream
  6886. // get ready to actually consume the body
  6887. let accum = [];
  6888. let accumBytes = 0;
  6889. let abort = false;
  6890. return new Body.Promise(function (resolve, reject) {
  6891. let resTimeout;
  6892. // allow timeout on slow response body
  6893. if (_this4.timeout) {
  6894. resTimeout = setTimeout(function () {
  6895. abort = true;
  6896. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6897. }, _this4.timeout);
  6898. }
  6899. // handle stream errors
  6900. body.on('error', function (err) {
  6901. if (err.name === 'AbortError') {
  6902. // if the request was aborted, reject with this Error
  6903. abort = true;
  6904. reject(err);
  6905. } else {
  6906. // other errors, such as incorrect content-encoding
  6907. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6908. }
  6909. });
  6910. body.on('data', function (chunk) {
  6911. if (abort || chunk === null) {
  6912. return;
  6913. }
  6914. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6915. abort = true;
  6916. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6917. return;
  6918. }
  6919. accumBytes += chunk.length;
  6920. accum.push(chunk);
  6921. });
  6922. body.on('end', function () {
  6923. if (abort) {
  6924. return;
  6925. }
  6926. clearTimeout(resTimeout);
  6927. try {
  6928. resolve(Buffer.concat(accum, accumBytes));
  6929. } catch (err) {
  6930. // handle streams that have accumulated too much data (issue #414)
  6931. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6932. }
  6933. });
  6934. });
  6935. }
  6936. /**
  6937. * Detect buffer encoding and convert to target encoding
  6938. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6939. *
  6940. * @param Buffer buffer Incoming buffer
  6941. * @param String encoding Target encoding
  6942. * @return String
  6943. */
  6944. function convertBody(buffer, headers) {
  6945. if (typeof convert !== 'function') {
  6946. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6947. }
  6948. const ct = headers.get('content-type');
  6949. let charset = 'utf-8';
  6950. let res, str;
  6951. // header
  6952. if (ct) {
  6953. res = /charset=([^;]*)/i.exec(ct);
  6954. }
  6955. // no charset in content type, peek at response body for at most 1024 bytes
  6956. str = buffer.slice(0, 1024).toString();
  6957. // html5
  6958. if (!res && str) {
  6959. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6960. }
  6961. // html4
  6962. if (!res && str) {
  6963. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6964. if (res) {
  6965. res = /charset=(.*)/i.exec(res.pop());
  6966. }
  6967. }
  6968. // xml
  6969. if (!res && str) {
  6970. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6971. }
  6972. // found charset
  6973. if (res) {
  6974. charset = res.pop();
  6975. // prevent decode issues when sites use incorrect encoding
  6976. // ref: https://hsivonen.fi/encoding-menu/
  6977. if (charset === 'gb2312' || charset === 'gbk') {
  6978. charset = 'gb18030';
  6979. }
  6980. }
  6981. // turn raw buffers into a single utf-8 buffer
  6982. return convert(buffer, 'UTF-8', charset).toString();
  6983. }
  6984. /**
  6985. * Detect a URLSearchParams object
  6986. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6987. *
  6988. * @param Object obj Object to detect by type or brand
  6989. * @return String
  6990. */
  6991. function isURLSearchParams(obj) {
  6992. // Duck-typing as a necessary condition.
  6993. 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') {
  6994. return false;
  6995. }
  6996. // Brand-checking and more duck-typing as optional condition.
  6997. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6998. }
  6999. /**
  7000. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7001. * @param {*} obj
  7002. * @return {boolean}
  7003. */
  7004. function isBlob(obj) {
  7005. 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]);
  7006. }
  7007. /**
  7008. * Clone body given Res/Req instance
  7009. *
  7010. * @param Mixed instance Response or Request instance
  7011. * @return Mixed
  7012. */
  7013. function clone(instance) {
  7014. let p1, p2;
  7015. let body = instance.body;
  7016. // don't allow cloning a used body
  7017. if (instance.bodyUsed) {
  7018. throw new Error('cannot clone body after it is used');
  7019. }
  7020. // check that body is a stream and not form-data object
  7021. // note: we can't clone the form-data object without having it as a dependency
  7022. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7023. // tee instance body
  7024. p1 = new PassThrough();
  7025. p2 = new PassThrough();
  7026. body.pipe(p1);
  7027. body.pipe(p2);
  7028. // set instance body to teed body and return the other teed body
  7029. instance[INTERNALS].body = p1;
  7030. body = p2;
  7031. }
  7032. return body;
  7033. }
  7034. /**
  7035. * Performs the operation "extract a `Content-Type` value from |object|" as
  7036. * specified in the specification:
  7037. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7038. *
  7039. * This function assumes that instance.body is present.
  7040. *
  7041. * @param Mixed instance Any options.body input
  7042. */
  7043. function extractContentType(body) {
  7044. if (body === null) {
  7045. // body is null
  7046. return null;
  7047. } else if (typeof body === 'string') {
  7048. // body is string
  7049. return 'text/plain;charset=UTF-8';
  7050. } else if (isURLSearchParams(body)) {
  7051. // body is a URLSearchParams
  7052. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7053. } else if (isBlob(body)) {
  7054. // body is blob
  7055. return body.type || null;
  7056. } else if (Buffer.isBuffer(body)) {
  7057. // body is buffer
  7058. return null;
  7059. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7060. // body is ArrayBuffer
  7061. return null;
  7062. } else if (ArrayBuffer.isView(body)) {
  7063. // body is ArrayBufferView
  7064. return null;
  7065. } else if (typeof body.getBoundary === 'function') {
  7066. // detect form data input from form-data module
  7067. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7068. } else if (body instanceof Stream) {
  7069. // body is stream
  7070. // can't really do much about this
  7071. return null;
  7072. } else {
  7073. // Body constructor defaults other things to string
  7074. return 'text/plain;charset=UTF-8';
  7075. }
  7076. }
  7077. /**
  7078. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7079. * For us, we have to explicitly get it with a function.
  7080. *
  7081. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7082. *
  7083. * @param Body instance Instance of Body
  7084. * @return Number? Number of bytes, or null if not possible
  7085. */
  7086. function getTotalBytes(instance) {
  7087. const body = instance.body;
  7088. if (body === null) {
  7089. // body is null
  7090. return 0;
  7091. } else if (isBlob(body)) {
  7092. return body.size;
  7093. } else if (Buffer.isBuffer(body)) {
  7094. // body is buffer
  7095. return body.length;
  7096. } else if (body && typeof body.getLengthSync === 'function') {
  7097. // detect form data input from form-data module
  7098. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7099. body.hasKnownLength && body.hasKnownLength()) {
  7100. // 2.x
  7101. return body.getLengthSync();
  7102. }
  7103. return null;
  7104. } else {
  7105. // body is stream
  7106. return null;
  7107. }
  7108. }
  7109. /**
  7110. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7111. *
  7112. * @param Body instance Instance of Body
  7113. * @return Void
  7114. */
  7115. function writeToStream(dest, instance) {
  7116. const body = instance.body;
  7117. if (body === null) {
  7118. // body is null
  7119. dest.end();
  7120. } else if (isBlob(body)) {
  7121. body.stream().pipe(dest);
  7122. } else if (Buffer.isBuffer(body)) {
  7123. // body is buffer
  7124. dest.write(body);
  7125. dest.end();
  7126. } else {
  7127. // body is stream
  7128. body.pipe(dest);
  7129. }
  7130. }
  7131. // expose Promise
  7132. Body.Promise = global.Promise;
  7133. /**
  7134. * headers.js
  7135. *
  7136. * Headers class offers convenient helpers
  7137. */
  7138. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7139. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7140. function validateName(name) {
  7141. name = `${name}`;
  7142. if (invalidTokenRegex.test(name) || name === '') {
  7143. throw new TypeError(`${name} is not a legal HTTP header name`);
  7144. }
  7145. }
  7146. function validateValue(value) {
  7147. value = `${value}`;
  7148. if (invalidHeaderCharRegex.test(value)) {
  7149. throw new TypeError(`${value} is not a legal HTTP header value`);
  7150. }
  7151. }
  7152. /**
  7153. * Find the key in the map object given a header name.
  7154. *
  7155. * Returns undefined if not found.
  7156. *
  7157. * @param String name Header name
  7158. * @return String|Undefined
  7159. */
  7160. function find(map, name) {
  7161. name = name.toLowerCase();
  7162. for (const key in map) {
  7163. if (key.toLowerCase() === name) {
  7164. return key;
  7165. }
  7166. }
  7167. return undefined;
  7168. }
  7169. const MAP = Symbol('map');
  7170. class Headers {
  7171. /**
  7172. * Headers class
  7173. *
  7174. * @param Object headers Response headers
  7175. * @return Void
  7176. */
  7177. constructor() {
  7178. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7179. this[MAP] = Object.create(null);
  7180. if (init instanceof Headers) {
  7181. const rawHeaders = init.raw();
  7182. const headerNames = Object.keys(rawHeaders);
  7183. for (const headerName of headerNames) {
  7184. for (const value of rawHeaders[headerName]) {
  7185. this.append(headerName, value);
  7186. }
  7187. }
  7188. return;
  7189. }
  7190. // We don't worry about converting prop to ByteString here as append()
  7191. // will handle it.
  7192. if (init == null) ; else if (typeof init === 'object') {
  7193. const method = init[Symbol.iterator];
  7194. if (method != null) {
  7195. if (typeof method !== 'function') {
  7196. throw new TypeError('Header pairs must be iterable');
  7197. }
  7198. // sequence<sequence<ByteString>>
  7199. // Note: per spec we have to first exhaust the lists then process them
  7200. const pairs = [];
  7201. for (const pair of init) {
  7202. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7203. throw new TypeError('Each header pair must be iterable');
  7204. }
  7205. pairs.push(Array.from(pair));
  7206. }
  7207. for (const pair of pairs) {
  7208. if (pair.length !== 2) {
  7209. throw new TypeError('Each header pair must be a name/value tuple');
  7210. }
  7211. this.append(pair[0], pair[1]);
  7212. }
  7213. } else {
  7214. // record<ByteString, ByteString>
  7215. for (const key of Object.keys(init)) {
  7216. const value = init[key];
  7217. this.append(key, value);
  7218. }
  7219. }
  7220. } else {
  7221. throw new TypeError('Provided initializer must be an object');
  7222. }
  7223. }
  7224. /**
  7225. * Return combined header value given name
  7226. *
  7227. * @param String name Header name
  7228. * @return Mixed
  7229. */
  7230. get(name) {
  7231. name = `${name}`;
  7232. validateName(name);
  7233. const key = find(this[MAP], name);
  7234. if (key === undefined) {
  7235. return null;
  7236. }
  7237. return this[MAP][key].join(', ');
  7238. }
  7239. /**
  7240. * Iterate over all headers
  7241. *
  7242. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7243. * @param Boolean thisArg `this` context for callback function
  7244. * @return Void
  7245. */
  7246. forEach(callback) {
  7247. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7248. let pairs = getHeaders(this);
  7249. let i = 0;
  7250. while (i < pairs.length) {
  7251. var _pairs$i = pairs[i];
  7252. const name = _pairs$i[0],
  7253. value = _pairs$i[1];
  7254. callback.call(thisArg, value, name, this);
  7255. pairs = getHeaders(this);
  7256. i++;
  7257. }
  7258. }
  7259. /**
  7260. * Overwrite header values given name
  7261. *
  7262. * @param String name Header name
  7263. * @param String value Header value
  7264. * @return Void
  7265. */
  7266. set(name, value) {
  7267. name = `${name}`;
  7268. value = `${value}`;
  7269. validateName(name);
  7270. validateValue(value);
  7271. const key = find(this[MAP], name);
  7272. this[MAP][key !== undefined ? key : name] = [value];
  7273. }
  7274. /**
  7275. * Append a value onto existing header
  7276. *
  7277. * @param String name Header name
  7278. * @param String value Header value
  7279. * @return Void
  7280. */
  7281. append(name, value) {
  7282. name = `${name}`;
  7283. value = `${value}`;
  7284. validateName(name);
  7285. validateValue(value);
  7286. const key = find(this[MAP], name);
  7287. if (key !== undefined) {
  7288. this[MAP][key].push(value);
  7289. } else {
  7290. this[MAP][name] = [value];
  7291. }
  7292. }
  7293. /**
  7294. * Check for header name existence
  7295. *
  7296. * @param String name Header name
  7297. * @return Boolean
  7298. */
  7299. has(name) {
  7300. name = `${name}`;
  7301. validateName(name);
  7302. return find(this[MAP], name) !== undefined;
  7303. }
  7304. /**
  7305. * Delete all header values given name
  7306. *
  7307. * @param String name Header name
  7308. * @return Void
  7309. */
  7310. delete(name) {
  7311. name = `${name}`;
  7312. validateName(name);
  7313. const key = find(this[MAP], name);
  7314. if (key !== undefined) {
  7315. delete this[MAP][key];
  7316. }
  7317. }
  7318. /**
  7319. * Return raw headers (non-spec api)
  7320. *
  7321. * @return Object
  7322. */
  7323. raw() {
  7324. return this[MAP];
  7325. }
  7326. /**
  7327. * Get an iterator on keys.
  7328. *
  7329. * @return Iterator
  7330. */
  7331. keys() {
  7332. return createHeadersIterator(this, 'key');
  7333. }
  7334. /**
  7335. * Get an iterator on values.
  7336. *
  7337. * @return Iterator
  7338. */
  7339. values() {
  7340. return createHeadersIterator(this, 'value');
  7341. }
  7342. /**
  7343. * Get an iterator on entries.
  7344. *
  7345. * This is the default iterator of the Headers object.
  7346. *
  7347. * @return Iterator
  7348. */
  7349. [Symbol.iterator]() {
  7350. return createHeadersIterator(this, 'key+value');
  7351. }
  7352. }
  7353. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7354. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7355. value: 'Headers',
  7356. writable: false,
  7357. enumerable: false,
  7358. configurable: true
  7359. });
  7360. Object.defineProperties(Headers.prototype, {
  7361. get: { enumerable: true },
  7362. forEach: { enumerable: true },
  7363. set: { enumerable: true },
  7364. append: { enumerable: true },
  7365. has: { enumerable: true },
  7366. delete: { enumerable: true },
  7367. keys: { enumerable: true },
  7368. values: { enumerable: true },
  7369. entries: { enumerable: true }
  7370. });
  7371. function getHeaders(headers) {
  7372. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7373. const keys = Object.keys(headers[MAP]).sort();
  7374. return keys.map(kind === 'key' ? function (k) {
  7375. return k.toLowerCase();
  7376. } : kind === 'value' ? function (k) {
  7377. return headers[MAP][k].join(', ');
  7378. } : function (k) {
  7379. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7380. });
  7381. }
  7382. const INTERNAL = Symbol('internal');
  7383. function createHeadersIterator(target, kind) {
  7384. const iterator = Object.create(HeadersIteratorPrototype);
  7385. iterator[INTERNAL] = {
  7386. target,
  7387. kind,
  7388. index: 0
  7389. };
  7390. return iterator;
  7391. }
  7392. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7393. next() {
  7394. // istanbul ignore if
  7395. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7396. throw new TypeError('Value of `this` is not a HeadersIterator');
  7397. }
  7398. var _INTERNAL = this[INTERNAL];
  7399. const target = _INTERNAL.target,
  7400. kind = _INTERNAL.kind,
  7401. index = _INTERNAL.index;
  7402. const values = getHeaders(target, kind);
  7403. const len = values.length;
  7404. if (index >= len) {
  7405. return {
  7406. value: undefined,
  7407. done: true
  7408. };
  7409. }
  7410. this[INTERNAL].index = index + 1;
  7411. return {
  7412. value: values[index],
  7413. done: false
  7414. };
  7415. }
  7416. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7417. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7418. value: 'HeadersIterator',
  7419. writable: false,
  7420. enumerable: false,
  7421. configurable: true
  7422. });
  7423. /**
  7424. * Export the Headers object in a form that Node.js can consume.
  7425. *
  7426. * @param Headers headers
  7427. * @return Object
  7428. */
  7429. function exportNodeCompatibleHeaders(headers) {
  7430. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7431. // http.request() only supports string as Host header. This hack makes
  7432. // specifying custom Host header possible.
  7433. const hostHeaderKey = find(headers[MAP], 'Host');
  7434. if (hostHeaderKey !== undefined) {
  7435. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7436. }
  7437. return obj;
  7438. }
  7439. /**
  7440. * Create a Headers object from an object of headers, ignoring those that do
  7441. * not conform to HTTP grammar productions.
  7442. *
  7443. * @param Object obj Object of headers
  7444. * @return Headers
  7445. */
  7446. function createHeadersLenient(obj) {
  7447. const headers = new Headers();
  7448. for (const name of Object.keys(obj)) {
  7449. if (invalidTokenRegex.test(name)) {
  7450. continue;
  7451. }
  7452. if (Array.isArray(obj[name])) {
  7453. for (const val of obj[name]) {
  7454. if (invalidHeaderCharRegex.test(val)) {
  7455. continue;
  7456. }
  7457. if (headers[MAP][name] === undefined) {
  7458. headers[MAP][name] = [val];
  7459. } else {
  7460. headers[MAP][name].push(val);
  7461. }
  7462. }
  7463. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7464. headers[MAP][name] = [obj[name]];
  7465. }
  7466. }
  7467. return headers;
  7468. }
  7469. const INTERNALS$1 = Symbol('Response internals');
  7470. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7471. const STATUS_CODES = http.STATUS_CODES;
  7472. /**
  7473. * Response class
  7474. *
  7475. * @param Stream body Readable stream
  7476. * @param Object opts Response options
  7477. * @return Void
  7478. */
  7479. class Response {
  7480. constructor() {
  7481. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7482. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7483. Body.call(this, body, opts);
  7484. const status = opts.status || 200;
  7485. const headers = new Headers(opts.headers);
  7486. if (body != null && !headers.has('Content-Type')) {
  7487. const contentType = extractContentType(body);
  7488. if (contentType) {
  7489. headers.append('Content-Type', contentType);
  7490. }
  7491. }
  7492. this[INTERNALS$1] = {
  7493. url: opts.url,
  7494. status,
  7495. statusText: opts.statusText || STATUS_CODES[status],
  7496. headers,
  7497. counter: opts.counter
  7498. };
  7499. }
  7500. get url() {
  7501. return this[INTERNALS$1].url || '';
  7502. }
  7503. get status() {
  7504. return this[INTERNALS$1].status;
  7505. }
  7506. /**
  7507. * Convenience property representing if the request ended normally
  7508. */
  7509. get ok() {
  7510. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7511. }
  7512. get redirected() {
  7513. return this[INTERNALS$1].counter > 0;
  7514. }
  7515. get statusText() {
  7516. return this[INTERNALS$1].statusText;
  7517. }
  7518. get headers() {
  7519. return this[INTERNALS$1].headers;
  7520. }
  7521. /**
  7522. * Clone this response
  7523. *
  7524. * @return Response
  7525. */
  7526. clone() {
  7527. return new Response(clone(this), {
  7528. url: this.url,
  7529. status: this.status,
  7530. statusText: this.statusText,
  7531. headers: this.headers,
  7532. ok: this.ok,
  7533. redirected: this.redirected
  7534. });
  7535. }
  7536. }
  7537. Body.mixIn(Response.prototype);
  7538. Object.defineProperties(Response.prototype, {
  7539. url: { enumerable: true },
  7540. status: { enumerable: true },
  7541. ok: { enumerable: true },
  7542. redirected: { enumerable: true },
  7543. statusText: { enumerable: true },
  7544. headers: { enumerable: true },
  7545. clone: { enumerable: true }
  7546. });
  7547. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7548. value: 'Response',
  7549. writable: false,
  7550. enumerable: false,
  7551. configurable: true
  7552. });
  7553. const INTERNALS$2 = Symbol('Request internals');
  7554. // fix an issue where "format", "parse" aren't a named export for node <10
  7555. const parse_url = Url.parse;
  7556. const format_url = Url.format;
  7557. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7558. /**
  7559. * Check if a value is an instance of Request.
  7560. *
  7561. * @param Mixed input
  7562. * @return Boolean
  7563. */
  7564. function isRequest(input) {
  7565. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7566. }
  7567. function isAbortSignal(signal) {
  7568. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7569. return !!(proto && proto.constructor.name === 'AbortSignal');
  7570. }
  7571. /**
  7572. * Request class
  7573. *
  7574. * @param Mixed input Url or Request instance
  7575. * @param Object init Custom options
  7576. * @return Void
  7577. */
  7578. class Request {
  7579. constructor(input) {
  7580. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7581. let parsedURL;
  7582. // normalize input
  7583. if (!isRequest(input)) {
  7584. if (input && input.href) {
  7585. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7586. // will fall into this branch also (since their `toString()` will return
  7587. // `href` property anyway)
  7588. parsedURL = parse_url(input.href);
  7589. } else {
  7590. // coerce input to a string before attempting to parse
  7591. parsedURL = parse_url(`${input}`);
  7592. }
  7593. input = {};
  7594. } else {
  7595. parsedURL = parse_url(input.url);
  7596. }
  7597. let method = init.method || input.method || 'GET';
  7598. method = method.toUpperCase();
  7599. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7600. throw new TypeError('Request with GET/HEAD method cannot have body');
  7601. }
  7602. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7603. Body.call(this, inputBody, {
  7604. timeout: init.timeout || input.timeout || 0,
  7605. size: init.size || input.size || 0
  7606. });
  7607. const headers = new Headers(init.headers || input.headers || {});
  7608. if (inputBody != null && !headers.has('Content-Type')) {
  7609. const contentType = extractContentType(inputBody);
  7610. if (contentType) {
  7611. headers.append('Content-Type', contentType);
  7612. }
  7613. }
  7614. let signal = isRequest(input) ? input.signal : null;
  7615. if ('signal' in init) signal = init.signal;
  7616. if (signal != null && !isAbortSignal(signal)) {
  7617. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7618. }
  7619. this[INTERNALS$2] = {
  7620. method,
  7621. redirect: init.redirect || input.redirect || 'follow',
  7622. headers,
  7623. parsedURL,
  7624. signal
  7625. };
  7626. // node-fetch-only options
  7627. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7628. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7629. this.counter = init.counter || input.counter || 0;
  7630. this.agent = init.agent || input.agent;
  7631. }
  7632. get method() {
  7633. return this[INTERNALS$2].method;
  7634. }
  7635. get url() {
  7636. return format_url(this[INTERNALS$2].parsedURL);
  7637. }
  7638. get headers() {
  7639. return this[INTERNALS$2].headers;
  7640. }
  7641. get redirect() {
  7642. return this[INTERNALS$2].redirect;
  7643. }
  7644. get signal() {
  7645. return this[INTERNALS$2].signal;
  7646. }
  7647. /**
  7648. * Clone this request
  7649. *
  7650. * @return Request
  7651. */
  7652. clone() {
  7653. return new Request(this);
  7654. }
  7655. }
  7656. Body.mixIn(Request.prototype);
  7657. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7658. value: 'Request',
  7659. writable: false,
  7660. enumerable: false,
  7661. configurable: true
  7662. });
  7663. Object.defineProperties(Request.prototype, {
  7664. method: { enumerable: true },
  7665. url: { enumerable: true },
  7666. headers: { enumerable: true },
  7667. redirect: { enumerable: true },
  7668. clone: { enumerable: true },
  7669. signal: { enumerable: true }
  7670. });
  7671. /**
  7672. * Convert a Request to Node.js http request options.
  7673. *
  7674. * @param Request A Request instance
  7675. * @return Object The options object to be passed to http.request
  7676. */
  7677. function getNodeRequestOptions(request) {
  7678. const parsedURL = request[INTERNALS$2].parsedURL;
  7679. const headers = new Headers(request[INTERNALS$2].headers);
  7680. // fetch step 1.3
  7681. if (!headers.has('Accept')) {
  7682. headers.set('Accept', '*/*');
  7683. }
  7684. // Basic fetch
  7685. if (!parsedURL.protocol || !parsedURL.hostname) {
  7686. throw new TypeError('Only absolute URLs are supported');
  7687. }
  7688. if (!/^https?:$/.test(parsedURL.protocol)) {
  7689. throw new TypeError('Only HTTP(S) protocols are supported');
  7690. }
  7691. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7692. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7693. }
  7694. // HTTP-network-or-cache fetch steps 2.4-2.7
  7695. let contentLengthValue = null;
  7696. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7697. contentLengthValue = '0';
  7698. }
  7699. if (request.body != null) {
  7700. const totalBytes = getTotalBytes(request);
  7701. if (typeof totalBytes === 'number') {
  7702. contentLengthValue = String(totalBytes);
  7703. }
  7704. }
  7705. if (contentLengthValue) {
  7706. headers.set('Content-Length', contentLengthValue);
  7707. }
  7708. // HTTP-network-or-cache fetch step 2.11
  7709. if (!headers.has('User-Agent')) {
  7710. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7711. }
  7712. // HTTP-network-or-cache fetch step 2.15
  7713. if (request.compress && !headers.has('Accept-Encoding')) {
  7714. headers.set('Accept-Encoding', 'gzip,deflate');
  7715. }
  7716. let agent = request.agent;
  7717. if (typeof agent === 'function') {
  7718. agent = agent(parsedURL);
  7719. }
  7720. if (!headers.has('Connection') && !agent) {
  7721. headers.set('Connection', 'close');
  7722. }
  7723. // HTTP-network fetch step 4.2
  7724. // chunked encoding is handled by Node.js
  7725. return Object.assign({}, parsedURL, {
  7726. method: request.method,
  7727. headers: exportNodeCompatibleHeaders(headers),
  7728. agent
  7729. });
  7730. }
  7731. /**
  7732. * abort-error.js
  7733. *
  7734. * AbortError interface for cancelled requests
  7735. */
  7736. /**
  7737. * Create AbortError instance
  7738. *
  7739. * @param String message Error message for human
  7740. * @return AbortError
  7741. */
  7742. function AbortError(message) {
  7743. Error.call(this, message);
  7744. this.type = 'aborted';
  7745. this.message = message;
  7746. // hide custom error implementation details from end-users
  7747. Error.captureStackTrace(this, this.constructor);
  7748. }
  7749. AbortError.prototype = Object.create(Error.prototype);
  7750. AbortError.prototype.constructor = AbortError;
  7751. AbortError.prototype.name = 'AbortError';
  7752. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7753. const PassThrough$1 = Stream.PassThrough;
  7754. const resolve_url = Url.resolve;
  7755. /**
  7756. * Fetch function
  7757. *
  7758. * @param Mixed url Absolute url or Request instance
  7759. * @param Object opts Fetch options
  7760. * @return Promise
  7761. */
  7762. function fetch(url, opts) {
  7763. // allow custom promise
  7764. if (!fetch.Promise) {
  7765. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7766. }
  7767. Body.Promise = fetch.Promise;
  7768. // wrap http.request into fetch
  7769. return new fetch.Promise(function (resolve, reject) {
  7770. // build request object
  7771. const request = new Request(url, opts);
  7772. const options = getNodeRequestOptions(request);
  7773. const send = (options.protocol === 'https:' ? https : http).request;
  7774. const signal = request.signal;
  7775. let response = null;
  7776. const abort = function abort() {
  7777. let error = new AbortError('The user aborted a request.');
  7778. reject(error);
  7779. if (request.body && request.body instanceof Stream.Readable) {
  7780. request.body.destroy(error);
  7781. }
  7782. if (!response || !response.body) return;
  7783. response.body.emit('error', error);
  7784. };
  7785. if (signal && signal.aborted) {
  7786. abort();
  7787. return;
  7788. }
  7789. const abortAndFinalize = function abortAndFinalize() {
  7790. abort();
  7791. finalize();
  7792. };
  7793. // send request
  7794. const req = send(options);
  7795. let reqTimeout;
  7796. if (signal) {
  7797. signal.addEventListener('abort', abortAndFinalize);
  7798. }
  7799. function finalize() {
  7800. req.abort();
  7801. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7802. clearTimeout(reqTimeout);
  7803. }
  7804. if (request.timeout) {
  7805. req.once('socket', function (socket) {
  7806. reqTimeout = setTimeout(function () {
  7807. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7808. finalize();
  7809. }, request.timeout);
  7810. });
  7811. }
  7812. req.on('error', function (err) {
  7813. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7814. finalize();
  7815. });
  7816. req.on('response', function (res) {
  7817. clearTimeout(reqTimeout);
  7818. const headers = createHeadersLenient(res.headers);
  7819. // HTTP fetch step 5
  7820. if (fetch.isRedirect(res.statusCode)) {
  7821. // HTTP fetch step 5.2
  7822. const location = headers.get('Location');
  7823. // HTTP fetch step 5.3
  7824. const locationURL = location === null ? null : resolve_url(request.url, location);
  7825. // HTTP fetch step 5.5
  7826. switch (request.redirect) {
  7827. case 'error':
  7828. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7829. finalize();
  7830. return;
  7831. case 'manual':
  7832. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7833. if (locationURL !== null) {
  7834. // handle corrupted header
  7835. try {
  7836. headers.set('Location', locationURL);
  7837. } catch (err) {
  7838. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7839. reject(err);
  7840. }
  7841. }
  7842. break;
  7843. case 'follow':
  7844. // HTTP-redirect fetch step 2
  7845. if (locationURL === null) {
  7846. break;
  7847. }
  7848. // HTTP-redirect fetch step 5
  7849. if (request.counter >= request.follow) {
  7850. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7851. finalize();
  7852. return;
  7853. }
  7854. // HTTP-redirect fetch step 6 (counter increment)
  7855. // Create a new Request object.
  7856. const requestOpts = {
  7857. headers: new Headers(request.headers),
  7858. follow: request.follow,
  7859. counter: request.counter + 1,
  7860. agent: request.agent,
  7861. compress: request.compress,
  7862. method: request.method,
  7863. body: request.body,
  7864. signal: request.signal,
  7865. timeout: request.timeout
  7866. };
  7867. // HTTP-redirect fetch step 9
  7868. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7869. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7870. finalize();
  7871. return;
  7872. }
  7873. // HTTP-redirect fetch step 11
  7874. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7875. requestOpts.method = 'GET';
  7876. requestOpts.body = undefined;
  7877. requestOpts.headers.delete('content-length');
  7878. }
  7879. // HTTP-redirect fetch step 15
  7880. resolve(fetch(new Request(locationURL, requestOpts)));
  7881. finalize();
  7882. return;
  7883. }
  7884. }
  7885. // prepare response
  7886. res.once('end', function () {
  7887. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7888. });
  7889. let body = res.pipe(new PassThrough$1());
  7890. const response_options = {
  7891. url: request.url,
  7892. status: res.statusCode,
  7893. statusText: res.statusMessage,
  7894. headers: headers,
  7895. size: request.size,
  7896. timeout: request.timeout,
  7897. counter: request.counter
  7898. };
  7899. // HTTP-network fetch step 12.1.1.3
  7900. const codings = headers.get('Content-Encoding');
  7901. // HTTP-network fetch step 12.1.1.4: handle content codings
  7902. // in following scenarios we ignore compression support
  7903. // 1. compression support is disabled
  7904. // 2. HEAD request
  7905. // 3. no Content-Encoding header
  7906. // 4. no content response (204)
  7907. // 5. content not modified response (304)
  7908. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7909. response = new Response(body, response_options);
  7910. resolve(response);
  7911. return;
  7912. }
  7913. // For Node v6+
  7914. // Be less strict when decoding compressed responses, since sometimes
  7915. // servers send slightly invalid responses that are still accepted
  7916. // by common browsers.
  7917. // Always using Z_SYNC_FLUSH is what cURL does.
  7918. const zlibOptions = {
  7919. flush: zlib.Z_SYNC_FLUSH,
  7920. finishFlush: zlib.Z_SYNC_FLUSH
  7921. };
  7922. // for gzip
  7923. if (codings == 'gzip' || codings == 'x-gzip') {
  7924. body = body.pipe(zlib.createGunzip(zlibOptions));
  7925. response = new Response(body, response_options);
  7926. resolve(response);
  7927. return;
  7928. }
  7929. // for deflate
  7930. if (codings == 'deflate' || codings == 'x-deflate') {
  7931. // handle the infamous raw deflate response from old servers
  7932. // a hack for old IIS and Apache servers
  7933. const raw = res.pipe(new PassThrough$1());
  7934. raw.once('data', function (chunk) {
  7935. // see http://stackoverflow.com/questions/37519828
  7936. if ((chunk[0] & 0x0F) === 0x08) {
  7937. body = body.pipe(zlib.createInflate());
  7938. } else {
  7939. body = body.pipe(zlib.createInflateRaw());
  7940. }
  7941. response = new Response(body, response_options);
  7942. resolve(response);
  7943. });
  7944. return;
  7945. }
  7946. // for br
  7947. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7948. body = body.pipe(zlib.createBrotliDecompress());
  7949. response = new Response(body, response_options);
  7950. resolve(response);
  7951. return;
  7952. }
  7953. // otherwise, use response as-is
  7954. response = new Response(body, response_options);
  7955. resolve(response);
  7956. });
  7957. writeToStream(req, request);
  7958. });
  7959. }
  7960. /**
  7961. * Redirect code matching
  7962. *
  7963. * @param Number code Status code
  7964. * @return Boolean
  7965. */
  7966. fetch.isRedirect = function (code) {
  7967. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7968. };
  7969. // expose Promise
  7970. fetch.Promise = global.Promise;
  7971. module.exports = exports = fetch;
  7972. Object.defineProperty(exports, "__esModule", { value: true });
  7973. exports.default = exports;
  7974. exports.Headers = Headers;
  7975. exports.Request = Request;
  7976. exports.Response = Response;
  7977. exports.FetchError = FetchError;
  7978. /***/ }),
  7979. /***/ 462:
  7980. /***/ (function(module) {
  7981. "use strict";
  7982. // See http://www.robvanderwoude.com/escapechars.php
  7983. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7984. function escapeCommand(arg) {
  7985. // Escape meta chars
  7986. arg = arg.replace(metaCharsRegExp, '^$1');
  7987. return arg;
  7988. }
  7989. function escapeArgument(arg, doubleEscapeMetaChars) {
  7990. // Convert to string
  7991. arg = `${arg}`;
  7992. // Algorithm below is based on https://qntm.org/cmd
  7993. // Sequence of backslashes followed by a double quote:
  7994. // double up all the backslashes and escape the double quote
  7995. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7996. // Sequence of backslashes followed by the end of the string
  7997. // (which will become a double quote later):
  7998. // double up all the backslashes
  7999. arg = arg.replace(/(\\*)$/, '$1$1');
  8000. // All other backslashes occur literally
  8001. // Quote the whole thing:
  8002. arg = `"${arg}"`;
  8003. // Escape meta chars
  8004. arg = arg.replace(metaCharsRegExp, '^$1');
  8005. // Double escape meta chars if necessary
  8006. if (doubleEscapeMetaChars) {
  8007. arg = arg.replace(metaCharsRegExp, '^$1');
  8008. }
  8009. return arg;
  8010. }
  8011. module.exports.command = escapeCommand;
  8012. module.exports.argument = escapeArgument;
  8013. /***/ }),
  8014. /***/ 463:
  8015. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8016. "use strict";
  8017. Object.defineProperty(exports, '__esModule', { value: true });
  8018. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8019. var deprecation = __webpack_require__(692);
  8020. var once = _interopDefault(__webpack_require__(969));
  8021. const logOnce = once(deprecation => console.warn(deprecation));
  8022. /**
  8023. * Error with extra properties to help with debugging
  8024. */
  8025. class RequestError extends Error {
  8026. constructor(message, statusCode, options) {
  8027. super(message); // Maintains proper stack trace (only available on V8)
  8028. /* istanbul ignore next */
  8029. if (Error.captureStackTrace) {
  8030. Error.captureStackTrace(this, this.constructor);
  8031. }
  8032. this.name = "HttpError";
  8033. this.status = statusCode;
  8034. Object.defineProperty(this, "code", {
  8035. get() {
  8036. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8037. return statusCode;
  8038. }
  8039. });
  8040. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8041. const requestCopy = Object.assign({}, options.request);
  8042. if (options.request.headers.authorization) {
  8043. requestCopy.headers = Object.assign({}, options.request.headers, {
  8044. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8045. });
  8046. }
  8047. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8048. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8049. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8050. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8051. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8052. this.request = requestCopy;
  8053. }
  8054. }
  8055. exports.RequestError = RequestError;
  8056. //# sourceMappingURL=index.js.map
  8057. /***/ }),
  8058. /***/ 464:
  8059. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8060. "use strict";
  8061. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8062. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8063. return new (P || (P = Promise))(function (resolve, reject) {
  8064. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8065. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8066. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8067. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8068. });
  8069. };
  8070. var __importStar = (this && this.__importStar) || function (mod) {
  8071. if (mod && mod.__esModule) return mod;
  8072. var result = {};
  8073. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8074. result["default"] = mod;
  8075. return result;
  8076. };
  8077. var __importDefault = (this && this.__importDefault) || function (mod) {
  8078. return (mod && mod.__esModule) ? mod : { "default": mod };
  8079. };
  8080. Object.defineProperty(exports, "__esModule", { value: true });
  8081. const assert = __importStar(__webpack_require__(357));
  8082. const core = __importStar(__webpack_require__(470));
  8083. const fs = __importStar(__webpack_require__(747));
  8084. const github = __importStar(__webpack_require__(469));
  8085. const io = __importStar(__webpack_require__(1));
  8086. const path = __importStar(__webpack_require__(622));
  8087. const retryHelper = __importStar(__webpack_require__(587));
  8088. const toolCache = __importStar(__webpack_require__(533));
  8089. const v4_1 = __importDefault(__webpack_require__(826));
  8090. const IS_WINDOWS = process.platform === 'win32';
  8091. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8092. return __awaiter(this, void 0, void 0, function* () {
  8093. // Download the archive
  8094. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8095. core.info('Downloading the archive');
  8096. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8097. }));
  8098. // Write archive to disk
  8099. core.info('Writing archive to disk');
  8100. const uniqueId = v4_1.default();
  8101. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8102. yield fs.promises.writeFile(archivePath, archiveData);
  8103. archiveData = Buffer.from(''); // Free memory
  8104. // Extract archive
  8105. core.info('Extracting the archive');
  8106. const extractPath = path.join(repositoryPath, uniqueId);
  8107. yield io.mkdirP(extractPath);
  8108. if (IS_WINDOWS) {
  8109. yield toolCache.extractZip(archivePath, extractPath);
  8110. }
  8111. else {
  8112. yield toolCache.extractTar(archivePath, extractPath);
  8113. }
  8114. io.rmRF(archivePath);
  8115. // Determine the path of the repository content. The archive contains
  8116. // a top-level folder and the repository content is inside.
  8117. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8118. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8119. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8120. core.info(`Resolved version ${archiveVersion}`);
  8121. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8122. // Move the files
  8123. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8124. const sourcePath = path.join(tempRepositoryPath, fileName);
  8125. const targetPath = path.join(repositoryPath, fileName);
  8126. if (IS_WINDOWS) {
  8127. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8128. }
  8129. else {
  8130. yield io.mv(sourcePath, targetPath);
  8131. }
  8132. }
  8133. io.rmRF(extractPath);
  8134. });
  8135. }
  8136. exports.downloadRepository = downloadRepository;
  8137. function downloadArchive(authToken, owner, repo, ref, commit) {
  8138. return __awaiter(this, void 0, void 0, function* () {
  8139. const octokit = new github.GitHub(authToken);
  8140. const params = {
  8141. owner: owner,
  8142. repo: repo,
  8143. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8144. ref: commit || ref
  8145. };
  8146. const response = yield octokit.repos.getArchiveLink(params);
  8147. if (response.status != 200) {
  8148. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8149. }
  8150. return Buffer.from(response.data); // response.data is ArrayBuffer
  8151. });
  8152. }
  8153. /***/ }),
  8154. /***/ 469:
  8155. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8156. "use strict";
  8157. var __importStar = (this && this.__importStar) || function (mod) {
  8158. if (mod && mod.__esModule) return mod;
  8159. var result = {};
  8160. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8161. result["default"] = mod;
  8162. return result;
  8163. };
  8164. Object.defineProperty(exports, "__esModule", { value: true });
  8165. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8166. const graphql_1 = __webpack_require__(898);
  8167. const rest_1 = __webpack_require__(0);
  8168. const Context = __importStar(__webpack_require__(262));
  8169. const httpClient = __importStar(__webpack_require__(539));
  8170. // We need this in order to extend Octokit
  8171. rest_1.Octokit.prototype = new rest_1.Octokit();
  8172. exports.context = new Context.Context();
  8173. class GitHub extends rest_1.Octokit {
  8174. constructor(token, opts) {
  8175. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8176. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8177. }
  8178. /**
  8179. * Disambiguates the constructor overload parameters
  8180. */
  8181. static disambiguate(token, opts) {
  8182. return [
  8183. typeof token === 'string' ? token : '',
  8184. typeof token === 'object' ? token : opts || {}
  8185. ];
  8186. }
  8187. static getOctokitOptions(args) {
  8188. const token = args[0];
  8189. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8190. // Base URL - GHES or Dotcom
  8191. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8192. // Auth
  8193. const auth = GitHub.getAuthString(token, options);
  8194. if (auth) {
  8195. options.auth = auth;
  8196. }
  8197. // Proxy
  8198. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8199. if (agent) {
  8200. // Shallow clone - don't mutate the object provided by the caller
  8201. options.request = options.request ? Object.assign({}, options.request) : {};
  8202. // Set the agent
  8203. options.request.agent = agent;
  8204. }
  8205. return options;
  8206. }
  8207. static getGraphQL(args) {
  8208. const defaults = {};
  8209. defaults.baseUrl = this.getGraphQLBaseUrl();
  8210. const token = args[0];
  8211. const options = args[1];
  8212. // Authorization
  8213. const auth = this.getAuthString(token, options);
  8214. if (auth) {
  8215. defaults.headers = {
  8216. authorization: auth
  8217. };
  8218. }
  8219. // Proxy
  8220. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8221. if (agent) {
  8222. defaults.request = { agent };
  8223. }
  8224. return graphql_1.graphql.defaults(defaults);
  8225. }
  8226. static getAuthString(token, options) {
  8227. // Validate args
  8228. if (!token && !options.auth) {
  8229. throw new Error('Parameter token or opts.auth is required');
  8230. }
  8231. else if (token && options.auth) {
  8232. throw new Error('Parameters token and opts.auth may not both be specified');
  8233. }
  8234. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8235. }
  8236. static getProxyAgent(destinationUrl, options) {
  8237. var _a;
  8238. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8239. if (httpClient.getProxyUrl(destinationUrl)) {
  8240. const hc = new httpClient.HttpClient();
  8241. return hc.getAgent(destinationUrl);
  8242. }
  8243. }
  8244. return undefined;
  8245. }
  8246. static getApiBaseUrl() {
  8247. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8248. }
  8249. static getGraphQLBaseUrl() {
  8250. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8251. // Shouldn't be a trailing slash, but remove if so
  8252. if (url.endsWith('/')) {
  8253. url = url.substr(0, url.length - 1);
  8254. }
  8255. // Remove trailing "/graphql"
  8256. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8257. url = url.substr(0, url.length - '/graphql'.length);
  8258. }
  8259. return url;
  8260. }
  8261. }
  8262. exports.GitHub = GitHub;
  8263. //# sourceMappingURL=github.js.map
  8264. /***/ }),
  8265. /***/ 470:
  8266. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8267. "use strict";
  8268. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8269. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8270. return new (P || (P = Promise))(function (resolve, reject) {
  8271. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8272. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8273. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8274. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8275. });
  8276. };
  8277. Object.defineProperty(exports, "__esModule", { value: true });
  8278. const command_1 = __webpack_require__(431);
  8279. const os = __webpack_require__(87);
  8280. const path = __webpack_require__(622);
  8281. /**
  8282. * The code to exit an action
  8283. */
  8284. var ExitCode;
  8285. (function (ExitCode) {
  8286. /**
  8287. * A code indicating that the action was successful
  8288. */
  8289. ExitCode[ExitCode["Success"] = 0] = "Success";
  8290. /**
  8291. * A code indicating that the action was a failure
  8292. */
  8293. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8294. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8295. //-----------------------------------------------------------------------
  8296. // Variables
  8297. //-----------------------------------------------------------------------
  8298. /**
  8299. * Sets env variable for this action and future actions in the job
  8300. * @param name the name of the variable to set
  8301. * @param val the value of the variable
  8302. */
  8303. function exportVariable(name, val) {
  8304. process.env[name] = val;
  8305. command_1.issueCommand('set-env', { name }, val);
  8306. }
  8307. exports.exportVariable = exportVariable;
  8308. /**
  8309. * Registers a secret which will get masked from logs
  8310. * @param secret value of the secret
  8311. */
  8312. function setSecret(secret) {
  8313. command_1.issueCommand('add-mask', {}, secret);
  8314. }
  8315. exports.setSecret = setSecret;
  8316. /**
  8317. * Prepends inputPath to the PATH (for this action and future actions)
  8318. * @param inputPath
  8319. */
  8320. function addPath(inputPath) {
  8321. command_1.issueCommand('add-path', {}, inputPath);
  8322. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8323. }
  8324. exports.addPath = addPath;
  8325. /**
  8326. * Gets the value of an input. The value is also trimmed.
  8327. *
  8328. * @param name name of the input to get
  8329. * @param options optional. See InputOptions.
  8330. * @returns string
  8331. */
  8332. function getInput(name, options) {
  8333. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8334. if (options && options.required && !val) {
  8335. throw new Error(`Input required and not supplied: ${name}`);
  8336. }
  8337. return val.trim();
  8338. }
  8339. exports.getInput = getInput;
  8340. /**
  8341. * Sets the value of an output.
  8342. *
  8343. * @param name name of the output to set
  8344. * @param value value to store
  8345. */
  8346. function setOutput(name, value) {
  8347. command_1.issueCommand('set-output', { name }, value);
  8348. }
  8349. exports.setOutput = setOutput;
  8350. //-----------------------------------------------------------------------
  8351. // Results
  8352. //-----------------------------------------------------------------------
  8353. /**
  8354. * Sets the action status to failed.
  8355. * When the action exits it will be with an exit code of 1
  8356. * @param message add error issue message
  8357. */
  8358. function setFailed(message) {
  8359. process.exitCode = ExitCode.Failure;
  8360. error(message);
  8361. }
  8362. exports.setFailed = setFailed;
  8363. //-----------------------------------------------------------------------
  8364. // Logging Commands
  8365. //-----------------------------------------------------------------------
  8366. /**
  8367. * Writes debug message to user log
  8368. * @param message debug message
  8369. */
  8370. function debug(message) {
  8371. command_1.issueCommand('debug', {}, message);
  8372. }
  8373. exports.debug = debug;
  8374. /**
  8375. * Adds an error issue
  8376. * @param message error issue message
  8377. */
  8378. function error(message) {
  8379. command_1.issue('error', message);
  8380. }
  8381. exports.error = error;
  8382. /**
  8383. * Adds an warning issue
  8384. * @param message warning issue message
  8385. */
  8386. function warning(message) {
  8387. command_1.issue('warning', message);
  8388. }
  8389. exports.warning = warning;
  8390. /**
  8391. * Writes info to log with console.log.
  8392. * @param message info message
  8393. */
  8394. function info(message) {
  8395. process.stdout.write(message + os.EOL);
  8396. }
  8397. exports.info = info;
  8398. /**
  8399. * Begin an output group.
  8400. *
  8401. * Output until the next `groupEnd` will be foldable in this group
  8402. *
  8403. * @param name The name of the output group
  8404. */
  8405. function startGroup(name) {
  8406. command_1.issue('group', name);
  8407. }
  8408. exports.startGroup = startGroup;
  8409. /**
  8410. * End an output group.
  8411. */
  8412. function endGroup() {
  8413. command_1.issue('endgroup');
  8414. }
  8415. exports.endGroup = endGroup;
  8416. /**
  8417. * Wrap an asynchronous function call in a group.
  8418. *
  8419. * Returns the same type as the function itself.
  8420. *
  8421. * @param name The name of the group
  8422. * @param fn The function to wrap in the group
  8423. */
  8424. function group(name, fn) {
  8425. return __awaiter(this, void 0, void 0, function* () {
  8426. startGroup(name);
  8427. let result;
  8428. try {
  8429. result = yield fn();
  8430. }
  8431. finally {
  8432. endGroup();
  8433. }
  8434. return result;
  8435. });
  8436. }
  8437. exports.group = group;
  8438. //# sourceMappingURL=core.js.map
  8439. /***/ }),
  8440. /***/ 471:
  8441. /***/ (function(module, __unusedexports, __webpack_require__) {
  8442. module.exports = authenticationBeforeRequest;
  8443. const btoa = __webpack_require__(675);
  8444. const uniq = __webpack_require__(126);
  8445. function authenticationBeforeRequest(state, options) {
  8446. if (!state.auth.type) {
  8447. return;
  8448. }
  8449. if (state.auth.type === "basic") {
  8450. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8451. options.headers.authorization = `Basic ${hash}`;
  8452. return;
  8453. }
  8454. if (state.auth.type === "token") {
  8455. options.headers.authorization = `token ${state.auth.token}`;
  8456. return;
  8457. }
  8458. if (state.auth.type === "app") {
  8459. options.headers.authorization = `Bearer ${state.auth.token}`;
  8460. const acceptHeaders = options.headers.accept
  8461. .split(",")
  8462. .concat("application/vnd.github.machine-man-preview+json");
  8463. options.headers.accept = uniq(acceptHeaders)
  8464. .filter(Boolean)
  8465. .join(",");
  8466. return;
  8467. }
  8468. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8469. if (state.auth.token) {
  8470. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8471. return;
  8472. }
  8473. const key = encodeURIComponent(state.auth.key);
  8474. const secret = encodeURIComponent(state.auth.secret);
  8475. options.url += `client_id=${key}&client_secret=${secret}`;
  8476. }
  8477. /***/ }),
  8478. /***/ 489:
  8479. /***/ (function(module, __unusedexports, __webpack_require__) {
  8480. "use strict";
  8481. const path = __webpack_require__(622);
  8482. const which = __webpack_require__(814);
  8483. const pathKey = __webpack_require__(39)();
  8484. function resolveCommandAttempt(parsed, withoutPathExt) {
  8485. const cwd = process.cwd();
  8486. const hasCustomCwd = parsed.options.cwd != null;
  8487. // If a custom `cwd` was specified, we need to change the process cwd
  8488. // because `which` will do stat calls but does not support a custom cwd
  8489. if (hasCustomCwd) {
  8490. try {
  8491. process.chdir(parsed.options.cwd);
  8492. } catch (err) {
  8493. /* Empty */
  8494. }
  8495. }
  8496. let resolved;
  8497. try {
  8498. resolved = which.sync(parsed.command, {
  8499. path: (parsed.options.env || process.env)[pathKey],
  8500. pathExt: withoutPathExt ? path.delimiter : undefined,
  8501. });
  8502. } catch (e) {
  8503. /* Empty */
  8504. } finally {
  8505. process.chdir(cwd);
  8506. }
  8507. // If we successfully resolved, ensure that an absolute path is returned
  8508. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8509. if (resolved) {
  8510. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8511. }
  8512. return resolved;
  8513. }
  8514. function resolveCommand(parsed) {
  8515. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8516. }
  8517. module.exports = resolveCommand;
  8518. /***/ }),
  8519. /***/ 497:
  8520. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8521. "use strict";
  8522. Object.defineProperty(exports, '__esModule', { value: true });
  8523. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8524. var deprecation = __webpack_require__(692);
  8525. var once = _interopDefault(__webpack_require__(969));
  8526. const logOnce = once(deprecation => console.warn(deprecation));
  8527. /**
  8528. * Error with extra properties to help with debugging
  8529. */
  8530. class RequestError extends Error {
  8531. constructor(message, statusCode, options) {
  8532. super(message); // Maintains proper stack trace (only available on V8)
  8533. /* istanbul ignore next */
  8534. if (Error.captureStackTrace) {
  8535. Error.captureStackTrace(this, this.constructor);
  8536. }
  8537. this.name = "HttpError";
  8538. this.status = statusCode;
  8539. Object.defineProperty(this, "code", {
  8540. get() {
  8541. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8542. return statusCode;
  8543. }
  8544. });
  8545. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8546. const requestCopy = Object.assign({}, options.request);
  8547. if (options.request.headers.authorization) {
  8548. requestCopy.headers = Object.assign({}, options.request.headers, {
  8549. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8550. });
  8551. }
  8552. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8553. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8554. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8555. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8556. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8557. this.request = requestCopy;
  8558. }
  8559. }
  8560. exports.RequestError = RequestError;
  8561. //# sourceMappingURL=index.js.map
  8562. /***/ }),
  8563. /***/ 510:
  8564. /***/ (function(module) {
  8565. module.exports = addHook
  8566. function addHook (state, kind, name, hook) {
  8567. var orig = hook
  8568. if (!state.registry[name]) {
  8569. state.registry[name] = []
  8570. }
  8571. if (kind === 'before') {
  8572. hook = function (method, options) {
  8573. return Promise.resolve()
  8574. .then(orig.bind(null, options))
  8575. .then(method.bind(null, options))
  8576. }
  8577. }
  8578. if (kind === 'after') {
  8579. hook = function (method, options) {
  8580. var result
  8581. return Promise.resolve()
  8582. .then(method.bind(null, options))
  8583. .then(function (result_) {
  8584. result = result_
  8585. return orig(result, options)
  8586. })
  8587. .then(function () {
  8588. return result
  8589. })
  8590. }
  8591. }
  8592. if (kind === 'error') {
  8593. hook = function (method, options) {
  8594. return Promise.resolve()
  8595. .then(method.bind(null, options))
  8596. .catch(function (error) {
  8597. return orig(error, options)
  8598. })
  8599. }
  8600. }
  8601. state.registry[name].push({
  8602. hook: hook,
  8603. orig: orig
  8604. })
  8605. }
  8606. /***/ }),
  8607. /***/ 523:
  8608. /***/ (function(module, __unusedexports, __webpack_require__) {
  8609. var register = __webpack_require__(363)
  8610. var addHook = __webpack_require__(510)
  8611. var removeHook = __webpack_require__(763)
  8612. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8613. var bind = Function.bind
  8614. var bindable = bind.bind(bind)
  8615. function bindApi (hook, state, name) {
  8616. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8617. hook.api = { remove: removeHookRef }
  8618. hook.remove = removeHookRef
  8619. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8620. var args = name ? [state, kind, name] : [state, kind]
  8621. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8622. })
  8623. }
  8624. function HookSingular () {
  8625. var singularHookName = 'h'
  8626. var singularHookState = {
  8627. registry: {}
  8628. }
  8629. var singularHook = register.bind(null, singularHookState, singularHookName)
  8630. bindApi(singularHook, singularHookState, singularHookName)
  8631. return singularHook
  8632. }
  8633. function HookCollection () {
  8634. var state = {
  8635. registry: {}
  8636. }
  8637. var hook = register.bind(null, state)
  8638. bindApi(hook, state)
  8639. return hook
  8640. }
  8641. var collectionHookDeprecationMessageDisplayed = false
  8642. function Hook () {
  8643. if (!collectionHookDeprecationMessageDisplayed) {
  8644. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8645. collectionHookDeprecationMessageDisplayed = true
  8646. }
  8647. return HookCollection()
  8648. }
  8649. Hook.Singular = HookSingular.bind()
  8650. Hook.Collection = HookCollection.bind()
  8651. module.exports = Hook
  8652. // expose constructors as a named property for TypeScript
  8653. module.exports.Hook = Hook
  8654. module.exports.Singular = Hook.Singular
  8655. module.exports.Collection = Hook.Collection
  8656. /***/ }),
  8657. /***/ 528:
  8658. /***/ (function(__unusedmodule, exports) {
  8659. "use strict";
  8660. Object.defineProperty(exports, "__esModule", { value: true });
  8661. function escape(value) {
  8662. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8663. return `\\${x}`;
  8664. });
  8665. }
  8666. exports.escape = escape;
  8667. /***/ }),
  8668. /***/ 529:
  8669. /***/ (function(module, __unusedexports, __webpack_require__) {
  8670. const factory = __webpack_require__(47);
  8671. module.exports = factory();
  8672. /***/ }),
  8673. /***/ 533:
  8674. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8675. "use strict";
  8676. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8677. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8678. return new (P || (P = Promise))(function (resolve, reject) {
  8679. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8680. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8681. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8682. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8683. });
  8684. };
  8685. Object.defineProperty(exports, "__esModule", { value: true });
  8686. const core = __webpack_require__(470);
  8687. const io = __webpack_require__(1);
  8688. const fs = __webpack_require__(747);
  8689. const os = __webpack_require__(87);
  8690. const path = __webpack_require__(622);
  8691. const httpm = __webpack_require__(874);
  8692. const semver = __webpack_require__(656);
  8693. const uuidV4 = __webpack_require__(826);
  8694. const exec_1 = __webpack_require__(986);
  8695. const assert_1 = __webpack_require__(357);
  8696. class HTTPError extends Error {
  8697. constructor(httpStatusCode) {
  8698. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8699. this.httpStatusCode = httpStatusCode;
  8700. Object.setPrototypeOf(this, new.target.prototype);
  8701. }
  8702. }
  8703. exports.HTTPError = HTTPError;
  8704. const IS_WINDOWS = process.platform === 'win32';
  8705. const userAgent = 'actions/tool-cache';
  8706. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8707. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8708. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8709. // If directories not found, place them in common temp locations
  8710. if (!tempDirectory || !cacheRoot) {
  8711. let baseLocation;
  8712. if (IS_WINDOWS) {
  8713. // On windows use the USERPROFILE env variable
  8714. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8715. }
  8716. else {
  8717. if (process.platform === 'darwin') {
  8718. baseLocation = '/Users';
  8719. }
  8720. else {
  8721. baseLocation = '/home';
  8722. }
  8723. }
  8724. if (!tempDirectory) {
  8725. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8726. }
  8727. if (!cacheRoot) {
  8728. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8729. }
  8730. }
  8731. /**
  8732. * Download a tool from an url and stream it into a file
  8733. *
  8734. * @param url url of tool to download
  8735. * @returns path to downloaded tool
  8736. */
  8737. function downloadTool(url) {
  8738. return __awaiter(this, void 0, void 0, function* () {
  8739. // Wrap in a promise so that we can resolve from within stream callbacks
  8740. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8741. try {
  8742. const http = new httpm.HttpClient(userAgent, [], {
  8743. allowRetries: true,
  8744. maxRetries: 3
  8745. });
  8746. const destPath = path.join(tempDirectory, uuidV4());
  8747. yield io.mkdirP(tempDirectory);
  8748. core.debug(`Downloading ${url}`);
  8749. core.debug(`Downloading ${destPath}`);
  8750. if (fs.existsSync(destPath)) {
  8751. throw new Error(`Destination file path ${destPath} already exists`);
  8752. }
  8753. const response = yield http.get(url);
  8754. if (response.message.statusCode !== 200) {
  8755. const err = new HTTPError(response.message.statusCode);
  8756. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8757. throw err;
  8758. }
  8759. const file = fs.createWriteStream(destPath);
  8760. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8761. try {
  8762. const stream = response.message.pipe(file);
  8763. stream.on('close', () => {
  8764. core.debug('download complete');
  8765. resolve(destPath);
  8766. });
  8767. }
  8768. catch (err) {
  8769. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8770. reject(err);
  8771. }
  8772. }));
  8773. file.on('error', err => {
  8774. file.end();
  8775. reject(err);
  8776. });
  8777. }
  8778. catch (err) {
  8779. reject(err);
  8780. }
  8781. }));
  8782. });
  8783. }
  8784. exports.downloadTool = downloadTool;
  8785. /**
  8786. * Extract a .7z file
  8787. *
  8788. * @param file path to the .7z file
  8789. * @param dest destination directory. Optional.
  8790. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8791. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8792. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8793. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8794. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8795. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8796. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8797. * to 7zr.exe can be pass to this function.
  8798. * @returns path to the destination directory
  8799. */
  8800. function extract7z(file, dest, _7zPath) {
  8801. return __awaiter(this, void 0, void 0, function* () {
  8802. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8803. assert_1.ok(file, 'parameter "file" is required');
  8804. dest = dest || (yield _createExtractFolder(dest));
  8805. const originalCwd = process.cwd();
  8806. process.chdir(dest);
  8807. if (_7zPath) {
  8808. try {
  8809. const args = [
  8810. 'x',
  8811. '-bb1',
  8812. '-bd',
  8813. '-sccUTF-8',
  8814. file
  8815. ];
  8816. const options = {
  8817. silent: true
  8818. };
  8819. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8820. }
  8821. finally {
  8822. process.chdir(originalCwd);
  8823. }
  8824. }
  8825. else {
  8826. const escapedScript = path
  8827. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8828. .replace(/'/g, "''")
  8829. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8830. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8831. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8832. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8833. const args = [
  8834. '-NoLogo',
  8835. '-Sta',
  8836. '-NoProfile',
  8837. '-NonInteractive',
  8838. '-ExecutionPolicy',
  8839. 'Unrestricted',
  8840. '-Command',
  8841. command
  8842. ];
  8843. const options = {
  8844. silent: true
  8845. };
  8846. try {
  8847. const powershellPath = yield io.which('powershell', true);
  8848. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8849. }
  8850. finally {
  8851. process.chdir(originalCwd);
  8852. }
  8853. }
  8854. return dest;
  8855. });
  8856. }
  8857. exports.extract7z = extract7z;
  8858. /**
  8859. * Extract a tar
  8860. *
  8861. * @param file path to the tar
  8862. * @param dest destination directory. Optional.
  8863. * @param flags flags for the tar. Optional.
  8864. * @returns path to the destination directory
  8865. */
  8866. function extractTar(file, dest, flags = 'xz') {
  8867. return __awaiter(this, void 0, void 0, function* () {
  8868. if (!file) {
  8869. throw new Error("parameter 'file' is required");
  8870. }
  8871. dest = dest || (yield _createExtractFolder(dest));
  8872. const tarPath = yield io.which('tar', true);
  8873. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8874. return dest;
  8875. });
  8876. }
  8877. exports.extractTar = extractTar;
  8878. /**
  8879. * Extract a zip
  8880. *
  8881. * @param file path to the zip
  8882. * @param dest destination directory. Optional.
  8883. * @returns path to the destination directory
  8884. */
  8885. function extractZip(file, dest) {
  8886. return __awaiter(this, void 0, void 0, function* () {
  8887. if (!file) {
  8888. throw new Error("parameter 'file' is required");
  8889. }
  8890. dest = dest || (yield _createExtractFolder(dest));
  8891. if (IS_WINDOWS) {
  8892. yield extractZipWin(file, dest);
  8893. }
  8894. else {
  8895. yield extractZipNix(file, dest);
  8896. }
  8897. return dest;
  8898. });
  8899. }
  8900. exports.extractZip = extractZip;
  8901. function extractZipWin(file, dest) {
  8902. return __awaiter(this, void 0, void 0, function* () {
  8903. // build the powershell command
  8904. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8905. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8906. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8907. // run powershell
  8908. const powershellPath = yield io.which('powershell');
  8909. const args = [
  8910. '-NoLogo',
  8911. '-Sta',
  8912. '-NoProfile',
  8913. '-NonInteractive',
  8914. '-ExecutionPolicy',
  8915. 'Unrestricted',
  8916. '-Command',
  8917. command
  8918. ];
  8919. yield exec_1.exec(`"${powershellPath}"`, args);
  8920. });
  8921. }
  8922. function extractZipNix(file, dest) {
  8923. return __awaiter(this, void 0, void 0, function* () {
  8924. const unzipPath = yield io.which('unzip');
  8925. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8926. });
  8927. }
  8928. /**
  8929. * Caches a directory and installs it into the tool cacheDir
  8930. *
  8931. * @param sourceDir the directory to cache into tools
  8932. * @param tool tool name
  8933. * @param version version of the tool. semver format
  8934. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8935. */
  8936. function cacheDir(sourceDir, tool, version, arch) {
  8937. return __awaiter(this, void 0, void 0, function* () {
  8938. version = semver.clean(version) || version;
  8939. arch = arch || os.arch();
  8940. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8941. core.debug(`source dir: ${sourceDir}`);
  8942. if (!fs.statSync(sourceDir).isDirectory()) {
  8943. throw new Error('sourceDir is not a directory');
  8944. }
  8945. // Create the tool dir
  8946. const destPath = yield _createToolPath(tool, version, arch);
  8947. // copy each child item. do not move. move can fail on Windows
  8948. // due to anti-virus software having an open handle on a file.
  8949. for (const itemName of fs.readdirSync(sourceDir)) {
  8950. const s = path.join(sourceDir, itemName);
  8951. yield io.cp(s, destPath, { recursive: true });
  8952. }
  8953. // write .complete
  8954. _completeToolPath(tool, version, arch);
  8955. return destPath;
  8956. });
  8957. }
  8958. exports.cacheDir = cacheDir;
  8959. /**
  8960. * Caches a downloaded file (GUID) and installs it
  8961. * into the tool cache with a given targetName
  8962. *
  8963. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8964. * @param targetFile the name of the file name in the tools directory
  8965. * @param tool tool name
  8966. * @param version version of the tool. semver format
  8967. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8968. */
  8969. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8970. return __awaiter(this, void 0, void 0, function* () {
  8971. version = semver.clean(version) || version;
  8972. arch = arch || os.arch();
  8973. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8974. core.debug(`source file: ${sourceFile}`);
  8975. if (!fs.statSync(sourceFile).isFile()) {
  8976. throw new Error('sourceFile is not a file');
  8977. }
  8978. // create the tool dir
  8979. const destFolder = yield _createToolPath(tool, version, arch);
  8980. // copy instead of move. move can fail on Windows due to
  8981. // anti-virus software having an open handle on a file.
  8982. const destPath = path.join(destFolder, targetFile);
  8983. core.debug(`destination file ${destPath}`);
  8984. yield io.cp(sourceFile, destPath);
  8985. // write .complete
  8986. _completeToolPath(tool, version, arch);
  8987. return destFolder;
  8988. });
  8989. }
  8990. exports.cacheFile = cacheFile;
  8991. /**
  8992. * Finds the path to a tool version in the local installed tool cache
  8993. *
  8994. * @param toolName name of the tool
  8995. * @param versionSpec version of the tool
  8996. * @param arch optional arch. defaults to arch of computer
  8997. */
  8998. function find(toolName, versionSpec, arch) {
  8999. if (!toolName) {
  9000. throw new Error('toolName parameter is required');
  9001. }
  9002. if (!versionSpec) {
  9003. throw new Error('versionSpec parameter is required');
  9004. }
  9005. arch = arch || os.arch();
  9006. // attempt to resolve an explicit version
  9007. if (!_isExplicitVersion(versionSpec)) {
  9008. const localVersions = findAllVersions(toolName, arch);
  9009. const match = _evaluateVersions(localVersions, versionSpec);
  9010. versionSpec = match;
  9011. }
  9012. // check for the explicit version in the cache
  9013. let toolPath = '';
  9014. if (versionSpec) {
  9015. versionSpec = semver.clean(versionSpec) || '';
  9016. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9017. core.debug(`checking cache: ${cachePath}`);
  9018. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9019. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9020. toolPath = cachePath;
  9021. }
  9022. else {
  9023. core.debug('not found');
  9024. }
  9025. }
  9026. return toolPath;
  9027. }
  9028. exports.find = find;
  9029. /**
  9030. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9031. *
  9032. * @param toolName name of the tool
  9033. * @param arch optional arch. defaults to arch of computer
  9034. */
  9035. function findAllVersions(toolName, arch) {
  9036. const versions = [];
  9037. arch = arch || os.arch();
  9038. const toolPath = path.join(cacheRoot, toolName);
  9039. if (fs.existsSync(toolPath)) {
  9040. const children = fs.readdirSync(toolPath);
  9041. for (const child of children) {
  9042. if (_isExplicitVersion(child)) {
  9043. const fullPath = path.join(toolPath, child, arch || '');
  9044. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9045. versions.push(child);
  9046. }
  9047. }
  9048. }
  9049. }
  9050. return versions;
  9051. }
  9052. exports.findAllVersions = findAllVersions;
  9053. function _createExtractFolder(dest) {
  9054. return __awaiter(this, void 0, void 0, function* () {
  9055. if (!dest) {
  9056. // create a temp dir
  9057. dest = path.join(tempDirectory, uuidV4());
  9058. }
  9059. yield io.mkdirP(dest);
  9060. return dest;
  9061. });
  9062. }
  9063. function _createToolPath(tool, version, arch) {
  9064. return __awaiter(this, void 0, void 0, function* () {
  9065. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9066. core.debug(`destination ${folderPath}`);
  9067. const markerPath = `${folderPath}.complete`;
  9068. yield io.rmRF(folderPath);
  9069. yield io.rmRF(markerPath);
  9070. yield io.mkdirP(folderPath);
  9071. return folderPath;
  9072. });
  9073. }
  9074. function _completeToolPath(tool, version, arch) {
  9075. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9076. const markerPath = `${folderPath}.complete`;
  9077. fs.writeFileSync(markerPath, '');
  9078. core.debug('finished caching tool');
  9079. }
  9080. function _isExplicitVersion(versionSpec) {
  9081. const c = semver.clean(versionSpec) || '';
  9082. core.debug(`isExplicit: ${c}`);
  9083. const valid = semver.valid(c) != null;
  9084. core.debug(`explicit? ${valid}`);
  9085. return valid;
  9086. }
  9087. function _evaluateVersions(versions, versionSpec) {
  9088. let version = '';
  9089. core.debug(`evaluating ${versions.length} versions`);
  9090. versions = versions.sort((a, b) => {
  9091. if (semver.gt(a, b)) {
  9092. return 1;
  9093. }
  9094. return -1;
  9095. });
  9096. for (let i = versions.length - 1; i >= 0; i--) {
  9097. const potential = versions[i];
  9098. const satisfied = semver.satisfies(potential, versionSpec);
  9099. if (satisfied) {
  9100. version = potential;
  9101. break;
  9102. }
  9103. }
  9104. if (version) {
  9105. core.debug(`matched: ${version}`);
  9106. }
  9107. else {
  9108. core.debug('match not found');
  9109. }
  9110. return version;
  9111. }
  9112. //# sourceMappingURL=tool-cache.js.map
  9113. /***/ }),
  9114. /***/ 536:
  9115. /***/ (function(module, __unusedexports, __webpack_require__) {
  9116. module.exports = hasFirstPage
  9117. const deprecate = __webpack_require__(370)
  9118. const getPageLinks = __webpack_require__(577)
  9119. function hasFirstPage (link) {
  9120. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9121. return getPageLinks(link).first
  9122. }
  9123. /***/ }),
  9124. /***/ 539:
  9125. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9126. "use strict";
  9127. Object.defineProperty(exports, "__esModule", { value: true });
  9128. const url = __webpack_require__(835);
  9129. const http = __webpack_require__(605);
  9130. const https = __webpack_require__(34);
  9131. const pm = __webpack_require__(950);
  9132. let tunnel;
  9133. var HttpCodes;
  9134. (function (HttpCodes) {
  9135. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9136. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9137. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9138. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9139. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9140. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9141. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9142. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9143. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9144. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9145. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9146. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9147. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9148. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9149. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9150. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9151. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9152. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9153. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9154. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9155. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9156. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9157. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9158. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9159. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9160. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9161. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9162. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9163. var Headers;
  9164. (function (Headers) {
  9165. Headers["Accept"] = "accept";
  9166. Headers["ContentType"] = "content-type";
  9167. })(Headers = exports.Headers || (exports.Headers = {}));
  9168. var MediaTypes;
  9169. (function (MediaTypes) {
  9170. MediaTypes["ApplicationJson"] = "application/json";
  9171. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9172. /**
  9173. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9174. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9175. */
  9176. function getProxyUrl(serverUrl) {
  9177. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9178. return proxyUrl ? proxyUrl.href : '';
  9179. }
  9180. exports.getProxyUrl = getProxyUrl;
  9181. const HttpRedirectCodes = [
  9182. HttpCodes.MovedPermanently,
  9183. HttpCodes.ResourceMoved,
  9184. HttpCodes.SeeOther,
  9185. HttpCodes.TemporaryRedirect,
  9186. HttpCodes.PermanentRedirect
  9187. ];
  9188. const HttpResponseRetryCodes = [
  9189. HttpCodes.BadGateway,
  9190. HttpCodes.ServiceUnavailable,
  9191. HttpCodes.GatewayTimeout
  9192. ];
  9193. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9194. const ExponentialBackoffCeiling = 10;
  9195. const ExponentialBackoffTimeSlice = 5;
  9196. class HttpClientResponse {
  9197. constructor(message) {
  9198. this.message = message;
  9199. }
  9200. readBody() {
  9201. return new Promise(async (resolve, reject) => {
  9202. let output = Buffer.alloc(0);
  9203. this.message.on('data', (chunk) => {
  9204. output = Buffer.concat([output, chunk]);
  9205. });
  9206. this.message.on('end', () => {
  9207. resolve(output.toString());
  9208. });
  9209. });
  9210. }
  9211. }
  9212. exports.HttpClientResponse = HttpClientResponse;
  9213. function isHttps(requestUrl) {
  9214. let parsedUrl = url.parse(requestUrl);
  9215. return parsedUrl.protocol === 'https:';
  9216. }
  9217. exports.isHttps = isHttps;
  9218. class HttpClient {
  9219. constructor(userAgent, handlers, requestOptions) {
  9220. this._ignoreSslError = false;
  9221. this._allowRedirects = true;
  9222. this._allowRedirectDowngrade = false;
  9223. this._maxRedirects = 50;
  9224. this._allowRetries = false;
  9225. this._maxRetries = 1;
  9226. this._keepAlive = false;
  9227. this._disposed = false;
  9228. this.userAgent = userAgent;
  9229. this.handlers = handlers || [];
  9230. this.requestOptions = requestOptions;
  9231. if (requestOptions) {
  9232. if (requestOptions.ignoreSslError != null) {
  9233. this._ignoreSslError = requestOptions.ignoreSslError;
  9234. }
  9235. this._socketTimeout = requestOptions.socketTimeout;
  9236. if (requestOptions.allowRedirects != null) {
  9237. this._allowRedirects = requestOptions.allowRedirects;
  9238. }
  9239. if (requestOptions.allowRedirectDowngrade != null) {
  9240. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9241. }
  9242. if (requestOptions.maxRedirects != null) {
  9243. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9244. }
  9245. if (requestOptions.keepAlive != null) {
  9246. this._keepAlive = requestOptions.keepAlive;
  9247. }
  9248. if (requestOptions.allowRetries != null) {
  9249. this._allowRetries = requestOptions.allowRetries;
  9250. }
  9251. if (requestOptions.maxRetries != null) {
  9252. this._maxRetries = requestOptions.maxRetries;
  9253. }
  9254. }
  9255. }
  9256. options(requestUrl, additionalHeaders) {
  9257. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9258. }
  9259. get(requestUrl, additionalHeaders) {
  9260. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9261. }
  9262. del(requestUrl, additionalHeaders) {
  9263. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9264. }
  9265. post(requestUrl, data, additionalHeaders) {
  9266. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9267. }
  9268. patch(requestUrl, data, additionalHeaders) {
  9269. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9270. }
  9271. put(requestUrl, data, additionalHeaders) {
  9272. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9273. }
  9274. head(requestUrl, additionalHeaders) {
  9275. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9276. }
  9277. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9278. return this.request(verb, requestUrl, stream, additionalHeaders);
  9279. }
  9280. /**
  9281. * Gets a typed object from an endpoint
  9282. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9283. */
  9284. async getJson(requestUrl, additionalHeaders = {}) {
  9285. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9286. let res = await this.get(requestUrl, additionalHeaders);
  9287. return this._processResponse(res, this.requestOptions);
  9288. }
  9289. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9290. let data = JSON.stringify(obj, null, 2);
  9291. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9292. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9293. let res = await this.post(requestUrl, data, additionalHeaders);
  9294. return this._processResponse(res, this.requestOptions);
  9295. }
  9296. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9297. let data = JSON.stringify(obj, null, 2);
  9298. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9299. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9300. let res = await this.put(requestUrl, data, additionalHeaders);
  9301. return this._processResponse(res, this.requestOptions);
  9302. }
  9303. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9304. let data = JSON.stringify(obj, null, 2);
  9305. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9306. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9307. let res = await this.patch(requestUrl, data, additionalHeaders);
  9308. return this._processResponse(res, this.requestOptions);
  9309. }
  9310. /**
  9311. * Makes a raw http request.
  9312. * All other methods such as get, post, patch, and request ultimately call this.
  9313. * Prefer get, del, post and patch
  9314. */
  9315. async request(verb, requestUrl, data, headers) {
  9316. if (this._disposed) {
  9317. throw new Error('Client has already been disposed.');
  9318. }
  9319. let parsedUrl = url.parse(requestUrl);
  9320. let info = this._prepareRequest(verb, parsedUrl, headers);
  9321. // Only perform retries on reads since writes may not be idempotent.
  9322. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9323. ? this._maxRetries + 1
  9324. : 1;
  9325. let numTries = 0;
  9326. let response;
  9327. while (numTries < maxTries) {
  9328. response = await this.requestRaw(info, data);
  9329. // Check if it's an authentication challenge
  9330. if (response &&
  9331. response.message &&
  9332. response.message.statusCode === HttpCodes.Unauthorized) {
  9333. let authenticationHandler;
  9334. for (let i = 0; i < this.handlers.length; i++) {
  9335. if (this.handlers[i].canHandleAuthentication(response)) {
  9336. authenticationHandler = this.handlers[i];
  9337. break;
  9338. }
  9339. }
  9340. if (authenticationHandler) {
  9341. return authenticationHandler.handleAuthentication(this, info, data);
  9342. }
  9343. else {
  9344. // We have received an unauthorized response but have no handlers to handle it.
  9345. // Let the response return to the caller.
  9346. return response;
  9347. }
  9348. }
  9349. let redirectsRemaining = this._maxRedirects;
  9350. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9351. this._allowRedirects &&
  9352. redirectsRemaining > 0) {
  9353. const redirectUrl = response.message.headers['location'];
  9354. if (!redirectUrl) {
  9355. // if there's no location to redirect to, we won't
  9356. break;
  9357. }
  9358. let parsedRedirectUrl = url.parse(redirectUrl);
  9359. if (parsedUrl.protocol == 'https:' &&
  9360. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9361. !this._allowRedirectDowngrade) {
  9362. 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.');
  9363. }
  9364. // we need to finish reading the response before reassigning response
  9365. // which will leak the open socket.
  9366. await response.readBody();
  9367. // strip authorization header if redirected to a different hostname
  9368. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9369. for (let header in headers) {
  9370. // header names are case insensitive
  9371. if (header.toLowerCase() === 'authorization') {
  9372. delete headers[header];
  9373. }
  9374. }
  9375. }
  9376. // let's make the request with the new redirectUrl
  9377. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9378. response = await this.requestRaw(info, data);
  9379. redirectsRemaining--;
  9380. }
  9381. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9382. // If not a retry code, return immediately instead of retrying
  9383. return response;
  9384. }
  9385. numTries += 1;
  9386. if (numTries < maxTries) {
  9387. await response.readBody();
  9388. await this._performExponentialBackoff(numTries);
  9389. }
  9390. }
  9391. return response;
  9392. }
  9393. /**
  9394. * Needs to be called if keepAlive is set to true in request options.
  9395. */
  9396. dispose() {
  9397. if (this._agent) {
  9398. this._agent.destroy();
  9399. }
  9400. this._disposed = true;
  9401. }
  9402. /**
  9403. * Raw request.
  9404. * @param info
  9405. * @param data
  9406. */
  9407. requestRaw(info, data) {
  9408. return new Promise((resolve, reject) => {
  9409. let callbackForResult = function (err, res) {
  9410. if (err) {
  9411. reject(err);
  9412. }
  9413. resolve(res);
  9414. };
  9415. this.requestRawWithCallback(info, data, callbackForResult);
  9416. });
  9417. }
  9418. /**
  9419. * Raw request with callback.
  9420. * @param info
  9421. * @param data
  9422. * @param onResult
  9423. */
  9424. requestRawWithCallback(info, data, onResult) {
  9425. let socket;
  9426. if (typeof data === 'string') {
  9427. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9428. }
  9429. let callbackCalled = false;
  9430. let handleResult = (err, res) => {
  9431. if (!callbackCalled) {
  9432. callbackCalled = true;
  9433. onResult(err, res);
  9434. }
  9435. };
  9436. let req = info.httpModule.request(info.options, (msg) => {
  9437. let res = new HttpClientResponse(msg);
  9438. handleResult(null, res);
  9439. });
  9440. req.on('socket', sock => {
  9441. socket = sock;
  9442. });
  9443. // If we ever get disconnected, we want the socket to timeout eventually
  9444. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9445. if (socket) {
  9446. socket.end();
  9447. }
  9448. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9449. });
  9450. req.on('error', function (err) {
  9451. // err has statusCode property
  9452. // res should have headers
  9453. handleResult(err, null);
  9454. });
  9455. if (data && typeof data === 'string') {
  9456. req.write(data, 'utf8');
  9457. }
  9458. if (data && typeof data !== 'string') {
  9459. data.on('close', function () {
  9460. req.end();
  9461. });
  9462. data.pipe(req);
  9463. }
  9464. else {
  9465. req.end();
  9466. }
  9467. }
  9468. /**
  9469. * Gets an http agent. This function is useful when you need an http agent that handles
  9470. * routing through a proxy server - depending upon the url and proxy environment variables.
  9471. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9472. */
  9473. getAgent(serverUrl) {
  9474. let parsedUrl = url.parse(serverUrl);
  9475. return this._getAgent(parsedUrl);
  9476. }
  9477. _prepareRequest(method, requestUrl, headers) {
  9478. const info = {};
  9479. info.parsedUrl = requestUrl;
  9480. const usingSsl = info.parsedUrl.protocol === 'https:';
  9481. info.httpModule = usingSsl ? https : http;
  9482. const defaultPort = usingSsl ? 443 : 80;
  9483. info.options = {};
  9484. info.options.host = info.parsedUrl.hostname;
  9485. info.options.port = info.parsedUrl.port
  9486. ? parseInt(info.parsedUrl.port)
  9487. : defaultPort;
  9488. info.options.path =
  9489. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9490. info.options.method = method;
  9491. info.options.headers = this._mergeHeaders(headers);
  9492. if (this.userAgent != null) {
  9493. info.options.headers['user-agent'] = this.userAgent;
  9494. }
  9495. info.options.agent = this._getAgent(info.parsedUrl);
  9496. // gives handlers an opportunity to participate
  9497. if (this.handlers) {
  9498. this.handlers.forEach(handler => {
  9499. handler.prepareRequest(info.options);
  9500. });
  9501. }
  9502. return info;
  9503. }
  9504. _mergeHeaders(headers) {
  9505. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9506. if (this.requestOptions && this.requestOptions.headers) {
  9507. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9508. }
  9509. return lowercaseKeys(headers || {});
  9510. }
  9511. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9512. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9513. let clientHeader;
  9514. if (this.requestOptions && this.requestOptions.headers) {
  9515. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9516. }
  9517. return additionalHeaders[header] || clientHeader || _default;
  9518. }
  9519. _getAgent(parsedUrl) {
  9520. let agent;
  9521. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9522. let useProxy = proxyUrl && proxyUrl.hostname;
  9523. if (this._keepAlive && useProxy) {
  9524. agent = this._proxyAgent;
  9525. }
  9526. if (this._keepAlive && !useProxy) {
  9527. agent = this._agent;
  9528. }
  9529. // if agent is already assigned use that agent.
  9530. if (!!agent) {
  9531. return agent;
  9532. }
  9533. const usingSsl = parsedUrl.protocol === 'https:';
  9534. let maxSockets = 100;
  9535. if (!!this.requestOptions) {
  9536. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9537. }
  9538. if (useProxy) {
  9539. // If using proxy, need tunnel
  9540. if (!tunnel) {
  9541. tunnel = __webpack_require__(335);
  9542. }
  9543. const agentOptions = {
  9544. maxSockets: maxSockets,
  9545. keepAlive: this._keepAlive,
  9546. proxy: {
  9547. proxyAuth: proxyUrl.auth,
  9548. host: proxyUrl.hostname,
  9549. port: proxyUrl.port
  9550. }
  9551. };
  9552. let tunnelAgent;
  9553. const overHttps = proxyUrl.protocol === 'https:';
  9554. if (usingSsl) {
  9555. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9556. }
  9557. else {
  9558. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9559. }
  9560. agent = tunnelAgent(agentOptions);
  9561. this._proxyAgent = agent;
  9562. }
  9563. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9564. if (this._keepAlive && !agent) {
  9565. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9566. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9567. this._agent = agent;
  9568. }
  9569. // if not using private agent and tunnel agent isn't setup then use global agent
  9570. if (!agent) {
  9571. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9572. }
  9573. if (usingSsl && this._ignoreSslError) {
  9574. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9575. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9576. // we have to cast it to any and change it directly
  9577. agent.options = Object.assign(agent.options || {}, {
  9578. rejectUnauthorized: false
  9579. });
  9580. }
  9581. return agent;
  9582. }
  9583. _performExponentialBackoff(retryNumber) {
  9584. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9585. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9586. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9587. }
  9588. static dateTimeDeserializer(key, value) {
  9589. if (typeof value === 'string') {
  9590. let a = new Date(value);
  9591. if (!isNaN(a.valueOf())) {
  9592. return a;
  9593. }
  9594. }
  9595. return value;
  9596. }
  9597. async _processResponse(res, options) {
  9598. return new Promise(async (resolve, reject) => {
  9599. const statusCode = res.message.statusCode;
  9600. const response = {
  9601. statusCode: statusCode,
  9602. result: null,
  9603. headers: {}
  9604. };
  9605. // not found leads to null obj returned
  9606. if (statusCode == HttpCodes.NotFound) {
  9607. resolve(response);
  9608. }
  9609. let obj;
  9610. let contents;
  9611. // get the result from the body
  9612. try {
  9613. contents = await res.readBody();
  9614. if (contents && contents.length > 0) {
  9615. if (options && options.deserializeDates) {
  9616. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9617. }
  9618. else {
  9619. obj = JSON.parse(contents);
  9620. }
  9621. response.result = obj;
  9622. }
  9623. response.headers = res.message.headers;
  9624. }
  9625. catch (err) {
  9626. // Invalid resource (contents not json); leaving result obj null
  9627. }
  9628. // note that 3xx redirects are handled by the http layer.
  9629. if (statusCode > 299) {
  9630. let msg;
  9631. // if exception/error in body, attempt to get better error
  9632. if (obj && obj.message) {
  9633. msg = obj.message;
  9634. }
  9635. else if (contents && contents.length > 0) {
  9636. // it may be the case that the exception is in the body message as string
  9637. msg = contents;
  9638. }
  9639. else {
  9640. msg = 'Failed request: (' + statusCode + ')';
  9641. }
  9642. let err = new Error(msg);
  9643. // attach statusCode and body obj (if available) to the error object
  9644. err['statusCode'] = statusCode;
  9645. if (response.result) {
  9646. err['result'] = response.result;
  9647. }
  9648. reject(err);
  9649. }
  9650. else {
  9651. resolve(response);
  9652. }
  9653. });
  9654. }
  9655. }
  9656. exports.HttpClient = HttpClient;
  9657. /***/ }),
  9658. /***/ 550:
  9659. /***/ (function(module, __unusedexports, __webpack_require__) {
  9660. module.exports = getNextPage
  9661. const getPage = __webpack_require__(265)
  9662. function getNextPage (octokit, link, headers) {
  9663. return getPage(octokit, link, 'next', headers)
  9664. }
  9665. /***/ }),
  9666. /***/ 558:
  9667. /***/ (function(module, __unusedexports, __webpack_require__) {
  9668. module.exports = hasPreviousPage
  9669. const deprecate = __webpack_require__(370)
  9670. const getPageLinks = __webpack_require__(577)
  9671. function hasPreviousPage (link) {
  9672. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9673. return getPageLinks(link).prev
  9674. }
  9675. /***/ }),
  9676. /***/ 559:
  9677. /***/ (function(__unusedmodule, exports) {
  9678. "use strict";
  9679. Object.defineProperty(exports, "__esModule", { value: true });
  9680. class GitVersion {
  9681. /**
  9682. * Used for comparing the version of git and git-lfs against the minimum required version
  9683. * @param version the version string, e.g. 1.2 or 1.2.3
  9684. */
  9685. constructor(version) {
  9686. this.major = NaN;
  9687. this.minor = NaN;
  9688. this.patch = NaN;
  9689. if (version) {
  9690. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9691. if (match) {
  9692. this.major = Number(match[1]);
  9693. this.minor = Number(match[2]);
  9694. if (match[4]) {
  9695. this.patch = Number(match[4]);
  9696. }
  9697. }
  9698. }
  9699. }
  9700. /**
  9701. * Compares the instance against a minimum required version
  9702. * @param minimum Minimum version
  9703. */
  9704. checkMinimum(minimum) {
  9705. if (!minimum.isValid()) {
  9706. throw new Error('Arg minimum is not a valid version');
  9707. }
  9708. // Major is insufficient
  9709. if (this.major < minimum.major) {
  9710. return false;
  9711. }
  9712. // Major is equal
  9713. if (this.major === minimum.major) {
  9714. // Minor is insufficient
  9715. if (this.minor < minimum.minor) {
  9716. return false;
  9717. }
  9718. // Minor is equal
  9719. if (this.minor === minimum.minor) {
  9720. // Patch is insufficient
  9721. if (this.patch && this.patch < (minimum.patch || 0)) {
  9722. return false;
  9723. }
  9724. }
  9725. }
  9726. return true;
  9727. }
  9728. /**
  9729. * Indicates whether the instance was constructed from a valid version string
  9730. */
  9731. isValid() {
  9732. return !isNaN(this.major);
  9733. }
  9734. /**
  9735. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9736. */
  9737. toString() {
  9738. let result = '';
  9739. if (this.isValid()) {
  9740. result = `${this.major}.${this.minor}`;
  9741. if (!isNaN(this.patch)) {
  9742. result += `.${this.patch}`;
  9743. }
  9744. }
  9745. return result;
  9746. }
  9747. }
  9748. exports.GitVersion = GitVersion;
  9749. /***/ }),
  9750. /***/ 562:
  9751. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9752. "use strict";
  9753. Object.defineProperty(exports, '__esModule', { value: true });
  9754. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9755. var osName = _interopDefault(__webpack_require__(2));
  9756. function getUserAgent() {
  9757. try {
  9758. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  9759. } catch (error) {
  9760. if (/wmic os get Caption/.test(error.message)) {
  9761. return "Windows <version undetectable>";
  9762. }
  9763. return "<environment undetectable>";
  9764. }
  9765. }
  9766. exports.getUserAgent = getUserAgent;
  9767. //# sourceMappingURL=index.js.map
  9768. /***/ }),
  9769. /***/ 563:
  9770. /***/ (function(module, __unusedexports, __webpack_require__) {
  9771. module.exports = getPreviousPage
  9772. const getPage = __webpack_require__(265)
  9773. function getPreviousPage (octokit, link, headers) {
  9774. return getPage(octokit, link, 'prev', headers)
  9775. }
  9776. /***/ }),
  9777. /***/ 568:
  9778. /***/ (function(module, __unusedexports, __webpack_require__) {
  9779. "use strict";
  9780. const path = __webpack_require__(622);
  9781. const niceTry = __webpack_require__(948);
  9782. const resolveCommand = __webpack_require__(489);
  9783. const escape = __webpack_require__(462);
  9784. const readShebang = __webpack_require__(389);
  9785. const semver = __webpack_require__(280);
  9786. const isWin = process.platform === 'win32';
  9787. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9788. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9789. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9790. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9791. function detectShebang(parsed) {
  9792. parsed.file = resolveCommand(parsed);
  9793. const shebang = parsed.file && readShebang(parsed.file);
  9794. if (shebang) {
  9795. parsed.args.unshift(parsed.file);
  9796. parsed.command = shebang;
  9797. return resolveCommand(parsed);
  9798. }
  9799. return parsed.file;
  9800. }
  9801. function parseNonShell(parsed) {
  9802. if (!isWin) {
  9803. return parsed;
  9804. }
  9805. // Detect & add support for shebangs
  9806. const commandFile = detectShebang(parsed);
  9807. // We don't need a shell if the command filename is an executable
  9808. const needsShell = !isExecutableRegExp.test(commandFile);
  9809. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9810. // Note that `forceShell` is an hidden option used only in tests
  9811. if (parsed.options.forceShell || needsShell) {
  9812. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9813. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9814. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9815. // we need to double escape them
  9816. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9817. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9818. // This is necessary otherwise it will always fail with ENOENT in those cases
  9819. parsed.command = path.normalize(parsed.command);
  9820. // Escape command & arguments
  9821. parsed.command = escape.command(parsed.command);
  9822. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9823. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9824. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9825. parsed.command = process.env.comspec || 'cmd.exe';
  9826. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9827. }
  9828. return parsed;
  9829. }
  9830. function parseShell(parsed) {
  9831. // If node supports the shell option, there's no need to mimic its behavior
  9832. if (supportsShellOption) {
  9833. return parsed;
  9834. }
  9835. // Mimic node shell option
  9836. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9837. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9838. if (isWin) {
  9839. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9840. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9841. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9842. } else {
  9843. if (typeof parsed.options.shell === 'string') {
  9844. parsed.command = parsed.options.shell;
  9845. } else if (process.platform === 'android') {
  9846. parsed.command = '/system/bin/sh';
  9847. } else {
  9848. parsed.command = '/bin/sh';
  9849. }
  9850. parsed.args = ['-c', shellCommand];
  9851. }
  9852. return parsed;
  9853. }
  9854. function parse(command, args, options) {
  9855. // Normalize arguments, similar to nodejs
  9856. if (args && !Array.isArray(args)) {
  9857. options = args;
  9858. args = null;
  9859. }
  9860. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9861. options = Object.assign({}, options); // Clone object to avoid changing the original
  9862. // Build our parsed object
  9863. const parsed = {
  9864. command,
  9865. args,
  9866. options,
  9867. file: undefined,
  9868. original: {
  9869. command,
  9870. args,
  9871. },
  9872. };
  9873. // Delegate further parsing to shell or non-shell
  9874. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9875. }
  9876. module.exports = parse;
  9877. /***/ }),
  9878. /***/ 577:
  9879. /***/ (function(module) {
  9880. module.exports = getPageLinks
  9881. function getPageLinks (link) {
  9882. link = link.link || link.headers.link || ''
  9883. const links = {}
  9884. // link format:
  9885. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9886. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9887. links[type] = uri
  9888. })
  9889. return links
  9890. }
  9891. /***/ }),
  9892. /***/ 587:
  9893. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9894. "use strict";
  9895. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9896. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9897. return new (P || (P = Promise))(function (resolve, reject) {
  9898. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9899. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9900. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9901. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9902. });
  9903. };
  9904. var __importStar = (this && this.__importStar) || function (mod) {
  9905. if (mod && mod.__esModule) return mod;
  9906. var result = {};
  9907. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9908. result["default"] = mod;
  9909. return result;
  9910. };
  9911. Object.defineProperty(exports, "__esModule", { value: true });
  9912. const core = __importStar(__webpack_require__(470));
  9913. const defaultMaxAttempts = 3;
  9914. const defaultMinSeconds = 10;
  9915. const defaultMaxSeconds = 20;
  9916. class RetryHelper {
  9917. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9918. this.maxAttempts = maxAttempts;
  9919. this.minSeconds = Math.floor(minSeconds);
  9920. this.maxSeconds = Math.floor(maxSeconds);
  9921. if (this.minSeconds > this.maxSeconds) {
  9922. throw new Error('min seconds should be less than or equal to max seconds');
  9923. }
  9924. }
  9925. execute(action) {
  9926. return __awaiter(this, void 0, void 0, function* () {
  9927. let attempt = 1;
  9928. while (attempt < this.maxAttempts) {
  9929. // Try
  9930. try {
  9931. return yield action();
  9932. }
  9933. catch (err) {
  9934. core.info(err.message);
  9935. }
  9936. // Sleep
  9937. const seconds = this.getSleepAmount();
  9938. core.info(`Waiting ${seconds} seconds before trying again`);
  9939. yield this.sleep(seconds);
  9940. attempt++;
  9941. }
  9942. // Last attempt
  9943. return yield action();
  9944. });
  9945. }
  9946. getSleepAmount() {
  9947. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9948. this.minSeconds);
  9949. }
  9950. sleep(seconds) {
  9951. return __awaiter(this, void 0, void 0, function* () {
  9952. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9953. });
  9954. }
  9955. }
  9956. exports.RetryHelper = RetryHelper;
  9957. function execute(action) {
  9958. return __awaiter(this, void 0, void 0, function* () {
  9959. const retryHelper = new RetryHelper();
  9960. return yield retryHelper.execute(action);
  9961. });
  9962. }
  9963. exports.execute = execute;
  9964. /***/ }),
  9965. /***/ 605:
  9966. /***/ (function(module) {
  9967. module.exports = require("http");
  9968. /***/ }),
  9969. /***/ 614:
  9970. /***/ (function(module) {
  9971. module.exports = require("events");
  9972. /***/ }),
  9973. /***/ 618:
  9974. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9975. "use strict";
  9976. var __importStar = (this && this.__importStar) || function (mod) {
  9977. if (mod && mod.__esModule) return mod;
  9978. var result = {};
  9979. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9980. result["default"] = mod;
  9981. return result;
  9982. };
  9983. Object.defineProperty(exports, "__esModule", { value: true });
  9984. const fs = __importStar(__webpack_require__(747));
  9985. function directoryExistsSync(path, required) {
  9986. if (!path) {
  9987. throw new Error("Arg 'path' must not be empty");
  9988. }
  9989. let stats;
  9990. try {
  9991. stats = fs.statSync(path);
  9992. }
  9993. catch (error) {
  9994. if (error.code === 'ENOENT') {
  9995. if (!required) {
  9996. return false;
  9997. }
  9998. throw new Error(`Directory '${path}' does not exist`);
  9999. }
  10000. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10001. }
  10002. if (stats.isDirectory()) {
  10003. return true;
  10004. }
  10005. else if (!required) {
  10006. return false;
  10007. }
  10008. throw new Error(`Directory '${path}' does not exist`);
  10009. }
  10010. exports.directoryExistsSync = directoryExistsSync;
  10011. function existsSync(path) {
  10012. if (!path) {
  10013. throw new Error("Arg 'path' must not be empty");
  10014. }
  10015. try {
  10016. fs.statSync(path);
  10017. }
  10018. catch (error) {
  10019. if (error.code === 'ENOENT') {
  10020. return false;
  10021. }
  10022. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10023. }
  10024. return true;
  10025. }
  10026. exports.existsSync = existsSync;
  10027. function fileExistsSync(path) {
  10028. if (!path) {
  10029. throw new Error("Arg 'path' must not be empty");
  10030. }
  10031. let stats;
  10032. try {
  10033. stats = fs.statSync(path);
  10034. }
  10035. catch (error) {
  10036. if (error.code === 'ENOENT') {
  10037. return false;
  10038. }
  10039. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10040. }
  10041. if (!stats.isDirectory()) {
  10042. return true;
  10043. }
  10044. return false;
  10045. }
  10046. exports.fileExistsSync = fileExistsSync;
  10047. /***/ }),
  10048. /***/ 621:
  10049. /***/ (function(module, __unusedexports, __webpack_require__) {
  10050. "use strict";
  10051. const path = __webpack_require__(622);
  10052. const pathKey = __webpack_require__(39);
  10053. module.exports = opts => {
  10054. opts = Object.assign({
  10055. cwd: process.cwd(),
  10056. path: process.env[pathKey()]
  10057. }, opts);
  10058. let prev;
  10059. let pth = path.resolve(opts.cwd);
  10060. const ret = [];
  10061. while (prev !== pth) {
  10062. ret.push(path.join(pth, 'node_modules/.bin'));
  10063. prev = pth;
  10064. pth = path.resolve(pth, '..');
  10065. }
  10066. // ensure the running `node` binary is used
  10067. ret.push(path.dirname(process.execPath));
  10068. return ret.concat(opts.path).join(path.delimiter);
  10069. };
  10070. module.exports.env = opts => {
  10071. opts = Object.assign({
  10072. env: process.env
  10073. }, opts);
  10074. const env = Object.assign({}, opts.env);
  10075. const path = pathKey({env});
  10076. opts.path = env[path];
  10077. env[path] = module.exports(opts);
  10078. return env;
  10079. };
  10080. /***/ }),
  10081. /***/ 622:
  10082. /***/ (function(module) {
  10083. module.exports = require("path");
  10084. /***/ }),
  10085. /***/ 631:
  10086. /***/ (function(module) {
  10087. module.exports = require("net");
  10088. /***/ }),
  10089. /***/ 649:
  10090. /***/ (function(module, __unusedexports, __webpack_require__) {
  10091. module.exports = getLastPage
  10092. const getPage = __webpack_require__(265)
  10093. function getLastPage (octokit, link, headers) {
  10094. return getPage(octokit, link, 'last', headers)
  10095. }
  10096. /***/ }),
  10097. /***/ 654:
  10098. /***/ (function(module) {
  10099. // This is not the set of all possible signals.
  10100. //
  10101. // It IS, however, the set of all signals that trigger
  10102. // an exit on either Linux or BSD systems. Linux is a
  10103. // superset of the signal names supported on BSD, and
  10104. // the unknown signals just fail to register, so we can
  10105. // catch that easily enough.
  10106. //
  10107. // Don't bother with SIGKILL. It's uncatchable, which
  10108. // means that we can't fire any callbacks anyway.
  10109. //
  10110. // If a user does happen to register a handler on a non-
  10111. // fatal signal like SIGWINCH or something, and then
  10112. // exit, it'll end up firing `process.emit('exit')`, so
  10113. // the handler will be fired anyway.
  10114. //
  10115. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10116. // artificially, inherently leave the process in a
  10117. // state from which it is not safe to try and enter JS
  10118. // listeners.
  10119. module.exports = [
  10120. 'SIGABRT',
  10121. 'SIGALRM',
  10122. 'SIGHUP',
  10123. 'SIGINT',
  10124. 'SIGTERM'
  10125. ]
  10126. if (process.platform !== 'win32') {
  10127. module.exports.push(
  10128. 'SIGVTALRM',
  10129. 'SIGXCPU',
  10130. 'SIGXFSZ',
  10131. 'SIGUSR2',
  10132. 'SIGTRAP',
  10133. 'SIGSYS',
  10134. 'SIGQUIT',
  10135. 'SIGIOT'
  10136. // should detect profiler and enable/disable accordingly.
  10137. // see #21
  10138. // 'SIGPROF'
  10139. )
  10140. }
  10141. if (process.platform === 'linux') {
  10142. module.exports.push(
  10143. 'SIGIO',
  10144. 'SIGPOLL',
  10145. 'SIGPWR',
  10146. 'SIGSTKFLT',
  10147. 'SIGUNUSED'
  10148. )
  10149. }
  10150. /***/ }),
  10151. /***/ 656:
  10152. /***/ (function(module, exports) {
  10153. exports = module.exports = SemVer
  10154. var debug
  10155. /* istanbul ignore next */
  10156. if (typeof process === 'object' &&
  10157. process.env &&
  10158. process.env.NODE_DEBUG &&
  10159. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10160. debug = function () {
  10161. var args = Array.prototype.slice.call(arguments, 0)
  10162. args.unshift('SEMVER')
  10163. console.log.apply(console, args)
  10164. }
  10165. } else {
  10166. debug = function () {}
  10167. }
  10168. // Note: this is the semver.org version of the spec that it implements
  10169. // Not necessarily the package version of this code.
  10170. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10171. var MAX_LENGTH = 256
  10172. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10173. /* istanbul ignore next */ 9007199254740991
  10174. // Max safe segment length for coercion.
  10175. var MAX_SAFE_COMPONENT_LENGTH = 16
  10176. // The actual regexps go on exports.re
  10177. var re = exports.re = []
  10178. var src = exports.src = []
  10179. var t = exports.tokens = {}
  10180. var R = 0
  10181. function tok (n) {
  10182. t[n] = R++
  10183. }
  10184. // The following Regular Expressions can be used for tokenizing,
  10185. // validating, and parsing SemVer version strings.
  10186. // ## Numeric Identifier
  10187. // A single `0`, or a non-zero digit followed by zero or more digits.
  10188. tok('NUMERICIDENTIFIER')
  10189. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10190. tok('NUMERICIDENTIFIERLOOSE')
  10191. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10192. // ## Non-numeric Identifier
  10193. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10194. // more letters, digits, or hyphens.
  10195. tok('NONNUMERICIDENTIFIER')
  10196. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10197. // ## Main Version
  10198. // Three dot-separated numeric identifiers.
  10199. tok('MAINVERSION')
  10200. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10201. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10202. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10203. tok('MAINVERSIONLOOSE')
  10204. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10205. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10206. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10207. // ## Pre-release Version Identifier
  10208. // A numeric identifier, or a non-numeric identifier.
  10209. tok('PRERELEASEIDENTIFIER')
  10210. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10211. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10212. tok('PRERELEASEIDENTIFIERLOOSE')
  10213. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10214. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10215. // ## Pre-release Version
  10216. // Hyphen, followed by one or more dot-separated pre-release version
  10217. // identifiers.
  10218. tok('PRERELEASE')
  10219. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10220. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10221. tok('PRERELEASELOOSE')
  10222. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10223. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10224. // ## Build Metadata Identifier
  10225. // Any combination of digits, letters, or hyphens.
  10226. tok('BUILDIDENTIFIER')
  10227. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10228. // ## Build Metadata
  10229. // Plus sign, followed by one or more period-separated build metadata
  10230. // identifiers.
  10231. tok('BUILD')
  10232. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10233. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10234. // ## Full Version String
  10235. // A main version, followed optionally by a pre-release version and
  10236. // build metadata.
  10237. // Note that the only major, minor, patch, and pre-release sections of
  10238. // the version string are capturing groups. The build metadata is not a
  10239. // capturing group, because it should not ever be used in version
  10240. // comparison.
  10241. tok('FULL')
  10242. tok('FULLPLAIN')
  10243. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10244. src[t.PRERELEASE] + '?' +
  10245. src[t.BUILD] + '?'
  10246. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10247. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10248. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10249. // common in the npm registry.
  10250. tok('LOOSEPLAIN')
  10251. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10252. src[t.PRERELEASELOOSE] + '?' +
  10253. src[t.BUILD] + '?'
  10254. tok('LOOSE')
  10255. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10256. tok('GTLT')
  10257. src[t.GTLT] = '((?:<|>)?=?)'
  10258. // Something like "2.*" or "1.2.x".
  10259. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10260. // Only the first item is strictly required.
  10261. tok('XRANGEIDENTIFIERLOOSE')
  10262. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10263. tok('XRANGEIDENTIFIER')
  10264. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10265. tok('XRANGEPLAIN')
  10266. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10267. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10268. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10269. '(?:' + src[t.PRERELEASE] + ')?' +
  10270. src[t.BUILD] + '?' +
  10271. ')?)?'
  10272. tok('XRANGEPLAINLOOSE')
  10273. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10274. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10275. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10276. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10277. src[t.BUILD] + '?' +
  10278. ')?)?'
  10279. tok('XRANGE')
  10280. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10281. tok('XRANGELOOSE')
  10282. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10283. // Coercion.
  10284. // Extract anything that could conceivably be a part of a valid semver
  10285. tok('COERCE')
  10286. src[t.COERCE] = '(^|[^\\d])' +
  10287. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10288. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10289. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10290. '(?:$|[^\\d])'
  10291. tok('COERCERTL')
  10292. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10293. // Tilde ranges.
  10294. // Meaning is "reasonably at or greater than"
  10295. tok('LONETILDE')
  10296. src[t.LONETILDE] = '(?:~>?)'
  10297. tok('TILDETRIM')
  10298. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10299. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10300. var tildeTrimReplace = '$1~'
  10301. tok('TILDE')
  10302. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10303. tok('TILDELOOSE')
  10304. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10305. // Caret ranges.
  10306. // Meaning is "at least and backwards compatible with"
  10307. tok('LONECARET')
  10308. src[t.LONECARET] = '(?:\\^)'
  10309. tok('CARETTRIM')
  10310. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10311. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10312. var caretTrimReplace = '$1^'
  10313. tok('CARET')
  10314. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10315. tok('CARETLOOSE')
  10316. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10317. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10318. tok('COMPARATORLOOSE')
  10319. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10320. tok('COMPARATOR')
  10321. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10322. // An expression to strip any whitespace between the gtlt and the thing
  10323. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10324. tok('COMPARATORTRIM')
  10325. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10326. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10327. // this one has to use the /g flag
  10328. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10329. var comparatorTrimReplace = '$1$2$3'
  10330. // Something like `1.2.3 - 1.2.4`
  10331. // Note that these all use the loose form, because they'll be
  10332. // checked against either the strict or loose comparator form
  10333. // later.
  10334. tok('HYPHENRANGE')
  10335. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10336. '\\s+-\\s+' +
  10337. '(' + src[t.XRANGEPLAIN] + ')' +
  10338. '\\s*$'
  10339. tok('HYPHENRANGELOOSE')
  10340. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10341. '\\s+-\\s+' +
  10342. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10343. '\\s*$'
  10344. // Star ranges basically just allow anything at all.
  10345. tok('STAR')
  10346. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10347. // Compile to actual regexp objects.
  10348. // All are flag-free, unless they were created above with a flag.
  10349. for (var i = 0; i < R; i++) {
  10350. debug(i, src[i])
  10351. if (!re[i]) {
  10352. re[i] = new RegExp(src[i])
  10353. }
  10354. }
  10355. exports.parse = parse
  10356. function parse (version, options) {
  10357. if (!options || typeof options !== 'object') {
  10358. options = {
  10359. loose: !!options,
  10360. includePrerelease: false
  10361. }
  10362. }
  10363. if (version instanceof SemVer) {
  10364. return version
  10365. }
  10366. if (typeof version !== 'string') {
  10367. return null
  10368. }
  10369. if (version.length > MAX_LENGTH) {
  10370. return null
  10371. }
  10372. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10373. if (!r.test(version)) {
  10374. return null
  10375. }
  10376. try {
  10377. return new SemVer(version, options)
  10378. } catch (er) {
  10379. return null
  10380. }
  10381. }
  10382. exports.valid = valid
  10383. function valid (version, options) {
  10384. var v = parse(version, options)
  10385. return v ? v.version : null
  10386. }
  10387. exports.clean = clean
  10388. function clean (version, options) {
  10389. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10390. return s ? s.version : null
  10391. }
  10392. exports.SemVer = SemVer
  10393. function SemVer (version, options) {
  10394. if (!options || typeof options !== 'object') {
  10395. options = {
  10396. loose: !!options,
  10397. includePrerelease: false
  10398. }
  10399. }
  10400. if (version instanceof SemVer) {
  10401. if (version.loose === options.loose) {
  10402. return version
  10403. } else {
  10404. version = version.version
  10405. }
  10406. } else if (typeof version !== 'string') {
  10407. throw new TypeError('Invalid Version: ' + version)
  10408. }
  10409. if (version.length > MAX_LENGTH) {
  10410. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10411. }
  10412. if (!(this instanceof SemVer)) {
  10413. return new SemVer(version, options)
  10414. }
  10415. debug('SemVer', version, options)
  10416. this.options = options
  10417. this.loose = !!options.loose
  10418. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10419. if (!m) {
  10420. throw new TypeError('Invalid Version: ' + version)
  10421. }
  10422. this.raw = version
  10423. // these are actually numbers
  10424. this.major = +m[1]
  10425. this.minor = +m[2]
  10426. this.patch = +m[3]
  10427. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10428. throw new TypeError('Invalid major version')
  10429. }
  10430. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10431. throw new TypeError('Invalid minor version')
  10432. }
  10433. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10434. throw new TypeError('Invalid patch version')
  10435. }
  10436. // numberify any prerelease numeric ids
  10437. if (!m[4]) {
  10438. this.prerelease = []
  10439. } else {
  10440. this.prerelease = m[4].split('.').map(function (id) {
  10441. if (/^[0-9]+$/.test(id)) {
  10442. var num = +id
  10443. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10444. return num
  10445. }
  10446. }
  10447. return id
  10448. })
  10449. }
  10450. this.build = m[5] ? m[5].split('.') : []
  10451. this.format()
  10452. }
  10453. SemVer.prototype.format = function () {
  10454. this.version = this.major + '.' + this.minor + '.' + this.patch
  10455. if (this.prerelease.length) {
  10456. this.version += '-' + this.prerelease.join('.')
  10457. }
  10458. return this.version
  10459. }
  10460. SemVer.prototype.toString = function () {
  10461. return this.version
  10462. }
  10463. SemVer.prototype.compare = function (other) {
  10464. debug('SemVer.compare', this.version, this.options, other)
  10465. if (!(other instanceof SemVer)) {
  10466. other = new SemVer(other, this.options)
  10467. }
  10468. return this.compareMain(other) || this.comparePre(other)
  10469. }
  10470. SemVer.prototype.compareMain = function (other) {
  10471. if (!(other instanceof SemVer)) {
  10472. other = new SemVer(other, this.options)
  10473. }
  10474. return compareIdentifiers(this.major, other.major) ||
  10475. compareIdentifiers(this.minor, other.minor) ||
  10476. compareIdentifiers(this.patch, other.patch)
  10477. }
  10478. SemVer.prototype.comparePre = function (other) {
  10479. if (!(other instanceof SemVer)) {
  10480. other = new SemVer(other, this.options)
  10481. }
  10482. // NOT having a prerelease is > having one
  10483. if (this.prerelease.length && !other.prerelease.length) {
  10484. return -1
  10485. } else if (!this.prerelease.length && other.prerelease.length) {
  10486. return 1
  10487. } else if (!this.prerelease.length && !other.prerelease.length) {
  10488. return 0
  10489. }
  10490. var i = 0
  10491. do {
  10492. var a = this.prerelease[i]
  10493. var b = other.prerelease[i]
  10494. debug('prerelease compare', i, a, b)
  10495. if (a === undefined && b === undefined) {
  10496. return 0
  10497. } else if (b === undefined) {
  10498. return 1
  10499. } else if (a === undefined) {
  10500. return -1
  10501. } else if (a === b) {
  10502. continue
  10503. } else {
  10504. return compareIdentifiers(a, b)
  10505. }
  10506. } while (++i)
  10507. }
  10508. SemVer.prototype.compareBuild = function (other) {
  10509. if (!(other instanceof SemVer)) {
  10510. other = new SemVer(other, this.options)
  10511. }
  10512. var i = 0
  10513. do {
  10514. var a = this.build[i]
  10515. var b = other.build[i]
  10516. debug('prerelease compare', i, a, b)
  10517. if (a === undefined && b === undefined) {
  10518. return 0
  10519. } else if (b === undefined) {
  10520. return 1
  10521. } else if (a === undefined) {
  10522. return -1
  10523. } else if (a === b) {
  10524. continue
  10525. } else {
  10526. return compareIdentifiers(a, b)
  10527. }
  10528. } while (++i)
  10529. }
  10530. // preminor will bump the version up to the next minor release, and immediately
  10531. // down to pre-release. premajor and prepatch work the same way.
  10532. SemVer.prototype.inc = function (release, identifier) {
  10533. switch (release) {
  10534. case 'premajor':
  10535. this.prerelease.length = 0
  10536. this.patch = 0
  10537. this.minor = 0
  10538. this.major++
  10539. this.inc('pre', identifier)
  10540. break
  10541. case 'preminor':
  10542. this.prerelease.length = 0
  10543. this.patch = 0
  10544. this.minor++
  10545. this.inc('pre', identifier)
  10546. break
  10547. case 'prepatch':
  10548. // If this is already a prerelease, it will bump to the next version
  10549. // drop any prereleases that might already exist, since they are not
  10550. // relevant at this point.
  10551. this.prerelease.length = 0
  10552. this.inc('patch', identifier)
  10553. this.inc('pre', identifier)
  10554. break
  10555. // If the input is a non-prerelease version, this acts the same as
  10556. // prepatch.
  10557. case 'prerelease':
  10558. if (this.prerelease.length === 0) {
  10559. this.inc('patch', identifier)
  10560. }
  10561. this.inc('pre', identifier)
  10562. break
  10563. case 'major':
  10564. // If this is a pre-major version, bump up to the same major version.
  10565. // Otherwise increment major.
  10566. // 1.0.0-5 bumps to 1.0.0
  10567. // 1.1.0 bumps to 2.0.0
  10568. if (this.minor !== 0 ||
  10569. this.patch !== 0 ||
  10570. this.prerelease.length === 0) {
  10571. this.major++
  10572. }
  10573. this.minor = 0
  10574. this.patch = 0
  10575. this.prerelease = []
  10576. break
  10577. case 'minor':
  10578. // If this is a pre-minor version, bump up to the same minor version.
  10579. // Otherwise increment minor.
  10580. // 1.2.0-5 bumps to 1.2.0
  10581. // 1.2.1 bumps to 1.3.0
  10582. if (this.patch !== 0 || this.prerelease.length === 0) {
  10583. this.minor++
  10584. }
  10585. this.patch = 0
  10586. this.prerelease = []
  10587. break
  10588. case 'patch':
  10589. // If this is not a pre-release version, it will increment the patch.
  10590. // If it is a pre-release it will bump up to the same patch version.
  10591. // 1.2.0-5 patches to 1.2.0
  10592. // 1.2.0 patches to 1.2.1
  10593. if (this.prerelease.length === 0) {
  10594. this.patch++
  10595. }
  10596. this.prerelease = []
  10597. break
  10598. // This probably shouldn't be used publicly.
  10599. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10600. case 'pre':
  10601. if (this.prerelease.length === 0) {
  10602. this.prerelease = [0]
  10603. } else {
  10604. var i = this.prerelease.length
  10605. while (--i >= 0) {
  10606. if (typeof this.prerelease[i] === 'number') {
  10607. this.prerelease[i]++
  10608. i = -2
  10609. }
  10610. }
  10611. if (i === -1) {
  10612. // didn't increment anything
  10613. this.prerelease.push(0)
  10614. }
  10615. }
  10616. if (identifier) {
  10617. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10618. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10619. if (this.prerelease[0] === identifier) {
  10620. if (isNaN(this.prerelease[1])) {
  10621. this.prerelease = [identifier, 0]
  10622. }
  10623. } else {
  10624. this.prerelease = [identifier, 0]
  10625. }
  10626. }
  10627. break
  10628. default:
  10629. throw new Error('invalid increment argument: ' + release)
  10630. }
  10631. this.format()
  10632. this.raw = this.version
  10633. return this
  10634. }
  10635. exports.inc = inc
  10636. function inc (version, release, loose, identifier) {
  10637. if (typeof (loose) === 'string') {
  10638. identifier = loose
  10639. loose = undefined
  10640. }
  10641. try {
  10642. return new SemVer(version, loose).inc(release, identifier).version
  10643. } catch (er) {
  10644. return null
  10645. }
  10646. }
  10647. exports.diff = diff
  10648. function diff (version1, version2) {
  10649. if (eq(version1, version2)) {
  10650. return null
  10651. } else {
  10652. var v1 = parse(version1)
  10653. var v2 = parse(version2)
  10654. var prefix = ''
  10655. if (v1.prerelease.length || v2.prerelease.length) {
  10656. prefix = 'pre'
  10657. var defaultResult = 'prerelease'
  10658. }
  10659. for (var key in v1) {
  10660. if (key === 'major' || key === 'minor' || key === 'patch') {
  10661. if (v1[key] !== v2[key]) {
  10662. return prefix + key
  10663. }
  10664. }
  10665. }
  10666. return defaultResult // may be undefined
  10667. }
  10668. }
  10669. exports.compareIdentifiers = compareIdentifiers
  10670. var numeric = /^[0-9]+$/
  10671. function compareIdentifiers (a, b) {
  10672. var anum = numeric.test(a)
  10673. var bnum = numeric.test(b)
  10674. if (anum && bnum) {
  10675. a = +a
  10676. b = +b
  10677. }
  10678. return a === b ? 0
  10679. : (anum && !bnum) ? -1
  10680. : (bnum && !anum) ? 1
  10681. : a < b ? -1
  10682. : 1
  10683. }
  10684. exports.rcompareIdentifiers = rcompareIdentifiers
  10685. function rcompareIdentifiers (a, b) {
  10686. return compareIdentifiers(b, a)
  10687. }
  10688. exports.major = major
  10689. function major (a, loose) {
  10690. return new SemVer(a, loose).major
  10691. }
  10692. exports.minor = minor
  10693. function minor (a, loose) {
  10694. return new SemVer(a, loose).minor
  10695. }
  10696. exports.patch = patch
  10697. function patch (a, loose) {
  10698. return new SemVer(a, loose).patch
  10699. }
  10700. exports.compare = compare
  10701. function compare (a, b, loose) {
  10702. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10703. }
  10704. exports.compareLoose = compareLoose
  10705. function compareLoose (a, b) {
  10706. return compare(a, b, true)
  10707. }
  10708. exports.compareBuild = compareBuild
  10709. function compareBuild (a, b, loose) {
  10710. var versionA = new SemVer(a, loose)
  10711. var versionB = new SemVer(b, loose)
  10712. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10713. }
  10714. exports.rcompare = rcompare
  10715. function rcompare (a, b, loose) {
  10716. return compare(b, a, loose)
  10717. }
  10718. exports.sort = sort
  10719. function sort (list, loose) {
  10720. return list.sort(function (a, b) {
  10721. return exports.compareBuild(a, b, loose)
  10722. })
  10723. }
  10724. exports.rsort = rsort
  10725. function rsort (list, loose) {
  10726. return list.sort(function (a, b) {
  10727. return exports.compareBuild(b, a, loose)
  10728. })
  10729. }
  10730. exports.gt = gt
  10731. function gt (a, b, loose) {
  10732. return compare(a, b, loose) > 0
  10733. }
  10734. exports.lt = lt
  10735. function lt (a, b, loose) {
  10736. return compare(a, b, loose) < 0
  10737. }
  10738. exports.eq = eq
  10739. function eq (a, b, loose) {
  10740. return compare(a, b, loose) === 0
  10741. }
  10742. exports.neq = neq
  10743. function neq (a, b, loose) {
  10744. return compare(a, b, loose) !== 0
  10745. }
  10746. exports.gte = gte
  10747. function gte (a, b, loose) {
  10748. return compare(a, b, loose) >= 0
  10749. }
  10750. exports.lte = lte
  10751. function lte (a, b, loose) {
  10752. return compare(a, b, loose) <= 0
  10753. }
  10754. exports.cmp = cmp
  10755. function cmp (a, op, b, loose) {
  10756. switch (op) {
  10757. case '===':
  10758. if (typeof a === 'object')
  10759. a = a.version
  10760. if (typeof b === 'object')
  10761. b = b.version
  10762. return a === b
  10763. case '!==':
  10764. if (typeof a === 'object')
  10765. a = a.version
  10766. if (typeof b === 'object')
  10767. b = b.version
  10768. return a !== b
  10769. case '':
  10770. case '=':
  10771. case '==':
  10772. return eq(a, b, loose)
  10773. case '!=':
  10774. return neq(a, b, loose)
  10775. case '>':
  10776. return gt(a, b, loose)
  10777. case '>=':
  10778. return gte(a, b, loose)
  10779. case '<':
  10780. return lt(a, b, loose)
  10781. case '<=':
  10782. return lte(a, b, loose)
  10783. default:
  10784. throw new TypeError('Invalid operator: ' + op)
  10785. }
  10786. }
  10787. exports.Comparator = Comparator
  10788. function Comparator (comp, options) {
  10789. if (!options || typeof options !== 'object') {
  10790. options = {
  10791. loose: !!options,
  10792. includePrerelease: false
  10793. }
  10794. }
  10795. if (comp instanceof Comparator) {
  10796. if (comp.loose === !!options.loose) {
  10797. return comp
  10798. } else {
  10799. comp = comp.value
  10800. }
  10801. }
  10802. if (!(this instanceof Comparator)) {
  10803. return new Comparator(comp, options)
  10804. }
  10805. debug('comparator', comp, options)
  10806. this.options = options
  10807. this.loose = !!options.loose
  10808. this.parse(comp)
  10809. if (this.semver === ANY) {
  10810. this.value = ''
  10811. } else {
  10812. this.value = this.operator + this.semver.version
  10813. }
  10814. debug('comp', this)
  10815. }
  10816. var ANY = {}
  10817. Comparator.prototype.parse = function (comp) {
  10818. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10819. var m = comp.match(r)
  10820. if (!m) {
  10821. throw new TypeError('Invalid comparator: ' + comp)
  10822. }
  10823. this.operator = m[1] !== undefined ? m[1] : ''
  10824. if (this.operator === '=') {
  10825. this.operator = ''
  10826. }
  10827. // if it literally is just '>' or '' then allow anything.
  10828. if (!m[2]) {
  10829. this.semver = ANY
  10830. } else {
  10831. this.semver = new SemVer(m[2], this.options.loose)
  10832. }
  10833. }
  10834. Comparator.prototype.toString = function () {
  10835. return this.value
  10836. }
  10837. Comparator.prototype.test = function (version) {
  10838. debug('Comparator.test', version, this.options.loose)
  10839. if (this.semver === ANY || version === ANY) {
  10840. return true
  10841. }
  10842. if (typeof version === 'string') {
  10843. try {
  10844. version = new SemVer(version, this.options)
  10845. } catch (er) {
  10846. return false
  10847. }
  10848. }
  10849. return cmp(version, this.operator, this.semver, this.options)
  10850. }
  10851. Comparator.prototype.intersects = function (comp, options) {
  10852. if (!(comp instanceof Comparator)) {
  10853. throw new TypeError('a Comparator is required')
  10854. }
  10855. if (!options || typeof options !== 'object') {
  10856. options = {
  10857. loose: !!options,
  10858. includePrerelease: false
  10859. }
  10860. }
  10861. var rangeTmp
  10862. if (this.operator === '') {
  10863. if (this.value === '') {
  10864. return true
  10865. }
  10866. rangeTmp = new Range(comp.value, options)
  10867. return satisfies(this.value, rangeTmp, options)
  10868. } else if (comp.operator === '') {
  10869. if (comp.value === '') {
  10870. return true
  10871. }
  10872. rangeTmp = new Range(this.value, options)
  10873. return satisfies(comp.semver, rangeTmp, options)
  10874. }
  10875. var sameDirectionIncreasing =
  10876. (this.operator === '>=' || this.operator === '>') &&
  10877. (comp.operator === '>=' || comp.operator === '>')
  10878. var sameDirectionDecreasing =
  10879. (this.operator === '<=' || this.operator === '<') &&
  10880. (comp.operator === '<=' || comp.operator === '<')
  10881. var sameSemVer = this.semver.version === comp.semver.version
  10882. var differentDirectionsInclusive =
  10883. (this.operator === '>=' || this.operator === '<=') &&
  10884. (comp.operator === '>=' || comp.operator === '<=')
  10885. var oppositeDirectionsLessThan =
  10886. cmp(this.semver, '<', comp.semver, options) &&
  10887. ((this.operator === '>=' || this.operator === '>') &&
  10888. (comp.operator === '<=' || comp.operator === '<'))
  10889. var oppositeDirectionsGreaterThan =
  10890. cmp(this.semver, '>', comp.semver, options) &&
  10891. ((this.operator === '<=' || this.operator === '<') &&
  10892. (comp.operator === '>=' || comp.operator === '>'))
  10893. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10894. (sameSemVer && differentDirectionsInclusive) ||
  10895. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10896. }
  10897. exports.Range = Range
  10898. function Range (range, options) {
  10899. if (!options || typeof options !== 'object') {
  10900. options = {
  10901. loose: !!options,
  10902. includePrerelease: false
  10903. }
  10904. }
  10905. if (range instanceof Range) {
  10906. if (range.loose === !!options.loose &&
  10907. range.includePrerelease === !!options.includePrerelease) {
  10908. return range
  10909. } else {
  10910. return new Range(range.raw, options)
  10911. }
  10912. }
  10913. if (range instanceof Comparator) {
  10914. return new Range(range.value, options)
  10915. }
  10916. if (!(this instanceof Range)) {
  10917. return new Range(range, options)
  10918. }
  10919. this.options = options
  10920. this.loose = !!options.loose
  10921. this.includePrerelease = !!options.includePrerelease
  10922. // First, split based on boolean or ||
  10923. this.raw = range
  10924. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10925. return this.parseRange(range.trim())
  10926. }, this).filter(function (c) {
  10927. // throw out any that are not relevant for whatever reason
  10928. return c.length
  10929. })
  10930. if (!this.set.length) {
  10931. throw new TypeError('Invalid SemVer Range: ' + range)
  10932. }
  10933. this.format()
  10934. }
  10935. Range.prototype.format = function () {
  10936. this.range = this.set.map(function (comps) {
  10937. return comps.join(' ').trim()
  10938. }).join('||').trim()
  10939. return this.range
  10940. }
  10941. Range.prototype.toString = function () {
  10942. return this.range
  10943. }
  10944. Range.prototype.parseRange = function (range) {
  10945. var loose = this.options.loose
  10946. range = range.trim()
  10947. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10948. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10949. range = range.replace(hr, hyphenReplace)
  10950. debug('hyphen replace', range)
  10951. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10952. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10953. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10954. // `~ 1.2.3` => `~1.2.3`
  10955. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10956. // `^ 1.2.3` => `^1.2.3`
  10957. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10958. // normalize spaces
  10959. range = range.split(/\s+/).join(' ')
  10960. // At this point, the range is completely trimmed and
  10961. // ready to be split into comparators.
  10962. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10963. var set = range.split(' ').map(function (comp) {
  10964. return parseComparator(comp, this.options)
  10965. }, this).join(' ').split(/\s+/)
  10966. if (this.options.loose) {
  10967. // in loose mode, throw out any that are not valid comparators
  10968. set = set.filter(function (comp) {
  10969. return !!comp.match(compRe)
  10970. })
  10971. }
  10972. set = set.map(function (comp) {
  10973. return new Comparator(comp, this.options)
  10974. }, this)
  10975. return set
  10976. }
  10977. Range.prototype.intersects = function (range, options) {
  10978. if (!(range instanceof Range)) {
  10979. throw new TypeError('a Range is required')
  10980. }
  10981. return this.set.some(function (thisComparators) {
  10982. return (
  10983. isSatisfiable(thisComparators, options) &&
  10984. range.set.some(function (rangeComparators) {
  10985. return (
  10986. isSatisfiable(rangeComparators, options) &&
  10987. thisComparators.every(function (thisComparator) {
  10988. return rangeComparators.every(function (rangeComparator) {
  10989. return thisComparator.intersects(rangeComparator, options)
  10990. })
  10991. })
  10992. )
  10993. })
  10994. )
  10995. })
  10996. }
  10997. // take a set of comparators and determine whether there
  10998. // exists a version which can satisfy it
  10999. function isSatisfiable (comparators, options) {
  11000. var result = true
  11001. var remainingComparators = comparators.slice()
  11002. var testComparator = remainingComparators.pop()
  11003. while (result && remainingComparators.length) {
  11004. result = remainingComparators.every(function (otherComparator) {
  11005. return testComparator.intersects(otherComparator, options)
  11006. })
  11007. testComparator = remainingComparators.pop()
  11008. }
  11009. return result
  11010. }
  11011. // Mostly just for testing and legacy API reasons
  11012. exports.toComparators = toComparators
  11013. function toComparators (range, options) {
  11014. return new Range(range, options).set.map(function (comp) {
  11015. return comp.map(function (c) {
  11016. return c.value
  11017. }).join(' ').trim().split(' ')
  11018. })
  11019. }
  11020. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11021. // already replaced the hyphen ranges
  11022. // turn into a set of JUST comparators.
  11023. function parseComparator (comp, options) {
  11024. debug('comp', comp, options)
  11025. comp = replaceCarets(comp, options)
  11026. debug('caret', comp)
  11027. comp = replaceTildes(comp, options)
  11028. debug('tildes', comp)
  11029. comp = replaceXRanges(comp, options)
  11030. debug('xrange', comp)
  11031. comp = replaceStars(comp, options)
  11032. debug('stars', comp)
  11033. return comp
  11034. }
  11035. function isX (id) {
  11036. return !id || id.toLowerCase() === 'x' || id === '*'
  11037. }
  11038. // ~, ~> --> * (any, kinda silly)
  11039. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11040. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11041. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11042. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11043. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11044. function replaceTildes (comp, options) {
  11045. return comp.trim().split(/\s+/).map(function (comp) {
  11046. return replaceTilde(comp, options)
  11047. }).join(' ')
  11048. }
  11049. function replaceTilde (comp, options) {
  11050. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11051. return comp.replace(r, function (_, M, m, p, pr) {
  11052. debug('tilde', comp, _, M, m, p, pr)
  11053. var ret
  11054. if (isX(M)) {
  11055. ret = ''
  11056. } else if (isX(m)) {
  11057. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11058. } else if (isX(p)) {
  11059. // ~1.2 == >=1.2.0 <1.3.0
  11060. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11061. } else if (pr) {
  11062. debug('replaceTilde pr', pr)
  11063. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11064. ' <' + M + '.' + (+m + 1) + '.0'
  11065. } else {
  11066. // ~1.2.3 == >=1.2.3 <1.3.0
  11067. ret = '>=' + M + '.' + m + '.' + p +
  11068. ' <' + M + '.' + (+m + 1) + '.0'
  11069. }
  11070. debug('tilde return', ret)
  11071. return ret
  11072. })
  11073. }
  11074. // ^ --> * (any, kinda silly)
  11075. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11076. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11077. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11078. // ^1.2.3 --> >=1.2.3 <2.0.0
  11079. // ^1.2.0 --> >=1.2.0 <2.0.0
  11080. function replaceCarets (comp, options) {
  11081. return comp.trim().split(/\s+/).map(function (comp) {
  11082. return replaceCaret(comp, options)
  11083. }).join(' ')
  11084. }
  11085. function replaceCaret (comp, options) {
  11086. debug('caret', comp, options)
  11087. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11088. return comp.replace(r, function (_, M, m, p, pr) {
  11089. debug('caret', comp, _, M, m, p, pr)
  11090. var ret
  11091. if (isX(M)) {
  11092. ret = ''
  11093. } else if (isX(m)) {
  11094. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11095. } else if (isX(p)) {
  11096. if (M === '0') {
  11097. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11098. } else {
  11099. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11100. }
  11101. } else if (pr) {
  11102. debug('replaceCaret pr', pr)
  11103. if (M === '0') {
  11104. if (m === '0') {
  11105. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11106. ' <' + M + '.' + m + '.' + (+p + 1)
  11107. } else {
  11108. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11109. ' <' + M + '.' + (+m + 1) + '.0'
  11110. }
  11111. } else {
  11112. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11113. ' <' + (+M + 1) + '.0.0'
  11114. }
  11115. } else {
  11116. debug('no pr')
  11117. if (M === '0') {
  11118. if (m === '0') {
  11119. ret = '>=' + M + '.' + m + '.' + p +
  11120. ' <' + M + '.' + m + '.' + (+p + 1)
  11121. } else {
  11122. ret = '>=' + M + '.' + m + '.' + p +
  11123. ' <' + M + '.' + (+m + 1) + '.0'
  11124. }
  11125. } else {
  11126. ret = '>=' + M + '.' + m + '.' + p +
  11127. ' <' + (+M + 1) + '.0.0'
  11128. }
  11129. }
  11130. debug('caret return', ret)
  11131. return ret
  11132. })
  11133. }
  11134. function replaceXRanges (comp, options) {
  11135. debug('replaceXRanges', comp, options)
  11136. return comp.split(/\s+/).map(function (comp) {
  11137. return replaceXRange(comp, options)
  11138. }).join(' ')
  11139. }
  11140. function replaceXRange (comp, options) {
  11141. comp = comp.trim()
  11142. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11143. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11144. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11145. var xM = isX(M)
  11146. var xm = xM || isX(m)
  11147. var xp = xm || isX(p)
  11148. var anyX = xp
  11149. if (gtlt === '=' && anyX) {
  11150. gtlt = ''
  11151. }
  11152. // if we're including prereleases in the match, then we need
  11153. // to fix this to -0, the lowest possible prerelease value
  11154. pr = options.includePrerelease ? '-0' : ''
  11155. if (xM) {
  11156. if (gtlt === '>' || gtlt === '<') {
  11157. // nothing is allowed
  11158. ret = '<0.0.0-0'
  11159. } else {
  11160. // nothing is forbidden
  11161. ret = '*'
  11162. }
  11163. } else if (gtlt && anyX) {
  11164. // we know patch is an x, because we have any x at all.
  11165. // replace X with 0
  11166. if (xm) {
  11167. m = 0
  11168. }
  11169. p = 0
  11170. if (gtlt === '>') {
  11171. // >1 => >=2.0.0
  11172. // >1.2 => >=1.3.0
  11173. // >1.2.3 => >= 1.2.4
  11174. gtlt = '>='
  11175. if (xm) {
  11176. M = +M + 1
  11177. m = 0
  11178. p = 0
  11179. } else {
  11180. m = +m + 1
  11181. p = 0
  11182. }
  11183. } else if (gtlt === '<=') {
  11184. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11185. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11186. gtlt = '<'
  11187. if (xm) {
  11188. M = +M + 1
  11189. } else {
  11190. m = +m + 1
  11191. }
  11192. }
  11193. ret = gtlt + M + '.' + m + '.' + p + pr
  11194. } else if (xm) {
  11195. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11196. } else if (xp) {
  11197. ret = '>=' + M + '.' + m + '.0' + pr +
  11198. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11199. }
  11200. debug('xRange return', ret)
  11201. return ret
  11202. })
  11203. }
  11204. // Because * is AND-ed with everything else in the comparator,
  11205. // and '' means "any version", just remove the *s entirely.
  11206. function replaceStars (comp, options) {
  11207. debug('replaceStars', comp, options)
  11208. // Looseness is ignored here. star is always as loose as it gets!
  11209. return comp.trim().replace(re[t.STAR], '')
  11210. }
  11211. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11212. // M, m, patch, prerelease, build
  11213. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11214. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11215. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11216. function hyphenReplace ($0,
  11217. from, fM, fm, fp, fpr, fb,
  11218. to, tM, tm, tp, tpr, tb) {
  11219. if (isX(fM)) {
  11220. from = ''
  11221. } else if (isX(fm)) {
  11222. from = '>=' + fM + '.0.0'
  11223. } else if (isX(fp)) {
  11224. from = '>=' + fM + '.' + fm + '.0'
  11225. } else {
  11226. from = '>=' + from
  11227. }
  11228. if (isX(tM)) {
  11229. to = ''
  11230. } else if (isX(tm)) {
  11231. to = '<' + (+tM + 1) + '.0.0'
  11232. } else if (isX(tp)) {
  11233. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11234. } else if (tpr) {
  11235. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11236. } else {
  11237. to = '<=' + to
  11238. }
  11239. return (from + ' ' + to).trim()
  11240. }
  11241. // if ANY of the sets match ALL of its comparators, then pass
  11242. Range.prototype.test = function (version) {
  11243. if (!version) {
  11244. return false
  11245. }
  11246. if (typeof version === 'string') {
  11247. try {
  11248. version = new SemVer(version, this.options)
  11249. } catch (er) {
  11250. return false
  11251. }
  11252. }
  11253. for (var i = 0; i < this.set.length; i++) {
  11254. if (testSet(this.set[i], version, this.options)) {
  11255. return true
  11256. }
  11257. }
  11258. return false
  11259. }
  11260. function testSet (set, version, options) {
  11261. for (var i = 0; i < set.length; i++) {
  11262. if (!set[i].test(version)) {
  11263. return false
  11264. }
  11265. }
  11266. if (version.prerelease.length && !options.includePrerelease) {
  11267. // Find the set of versions that are allowed to have prereleases
  11268. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11269. // That should allow `1.2.3-pr.2` to pass.
  11270. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11271. // even though it's within the range set by the comparators.
  11272. for (i = 0; i < set.length; i++) {
  11273. debug(set[i].semver)
  11274. if (set[i].semver === ANY) {
  11275. continue
  11276. }
  11277. if (set[i].semver.prerelease.length > 0) {
  11278. var allowed = set[i].semver
  11279. if (allowed.major === version.major &&
  11280. allowed.minor === version.minor &&
  11281. allowed.patch === version.patch) {
  11282. return true
  11283. }
  11284. }
  11285. }
  11286. // Version has a -pre, but it's not one of the ones we like.
  11287. return false
  11288. }
  11289. return true
  11290. }
  11291. exports.satisfies = satisfies
  11292. function satisfies (version, range, options) {
  11293. try {
  11294. range = new Range(range, options)
  11295. } catch (er) {
  11296. return false
  11297. }
  11298. return range.test(version)
  11299. }
  11300. exports.maxSatisfying = maxSatisfying
  11301. function maxSatisfying (versions, range, options) {
  11302. var max = null
  11303. var maxSV = null
  11304. try {
  11305. var rangeObj = new Range(range, options)
  11306. } catch (er) {
  11307. return null
  11308. }
  11309. versions.forEach(function (v) {
  11310. if (rangeObj.test(v)) {
  11311. // satisfies(v, range, options)
  11312. if (!max || maxSV.compare(v) === -1) {
  11313. // compare(max, v, true)
  11314. max = v
  11315. maxSV = new SemVer(max, options)
  11316. }
  11317. }
  11318. })
  11319. return max
  11320. }
  11321. exports.minSatisfying = minSatisfying
  11322. function minSatisfying (versions, range, options) {
  11323. var min = null
  11324. var minSV = null
  11325. try {
  11326. var rangeObj = new Range(range, options)
  11327. } catch (er) {
  11328. return null
  11329. }
  11330. versions.forEach(function (v) {
  11331. if (rangeObj.test(v)) {
  11332. // satisfies(v, range, options)
  11333. if (!min || minSV.compare(v) === 1) {
  11334. // compare(min, v, true)
  11335. min = v
  11336. minSV = new SemVer(min, options)
  11337. }
  11338. }
  11339. })
  11340. return min
  11341. }
  11342. exports.minVersion = minVersion
  11343. function minVersion (range, loose) {
  11344. range = new Range(range, loose)
  11345. var minver = new SemVer('0.0.0')
  11346. if (range.test(minver)) {
  11347. return minver
  11348. }
  11349. minver = new SemVer('0.0.0-0')
  11350. if (range.test(minver)) {
  11351. return minver
  11352. }
  11353. minver = null
  11354. for (var i = 0; i < range.set.length; ++i) {
  11355. var comparators = range.set[i]
  11356. comparators.forEach(function (comparator) {
  11357. // Clone to avoid manipulating the comparator's semver object.
  11358. var compver = new SemVer(comparator.semver.version)
  11359. switch (comparator.operator) {
  11360. case '>':
  11361. if (compver.prerelease.length === 0) {
  11362. compver.patch++
  11363. } else {
  11364. compver.prerelease.push(0)
  11365. }
  11366. compver.raw = compver.format()
  11367. /* fallthrough */
  11368. case '':
  11369. case '>=':
  11370. if (!minver || gt(minver, compver)) {
  11371. minver = compver
  11372. }
  11373. break
  11374. case '<':
  11375. case '<=':
  11376. /* Ignore maximum versions */
  11377. break
  11378. /* istanbul ignore next */
  11379. default:
  11380. throw new Error('Unexpected operation: ' + comparator.operator)
  11381. }
  11382. })
  11383. }
  11384. if (minver && range.test(minver)) {
  11385. return minver
  11386. }
  11387. return null
  11388. }
  11389. exports.validRange = validRange
  11390. function validRange (range, options) {
  11391. try {
  11392. // Return '*' instead of '' so that truthiness works.
  11393. // This will throw if it's invalid anyway
  11394. return new Range(range, options).range || '*'
  11395. } catch (er) {
  11396. return null
  11397. }
  11398. }
  11399. // Determine if version is less than all the versions possible in the range
  11400. exports.ltr = ltr
  11401. function ltr (version, range, options) {
  11402. return outside(version, range, '<', options)
  11403. }
  11404. // Determine if version is greater than all the versions possible in the range.
  11405. exports.gtr = gtr
  11406. function gtr (version, range, options) {
  11407. return outside(version, range, '>', options)
  11408. }
  11409. exports.outside = outside
  11410. function outside (version, range, hilo, options) {
  11411. version = new SemVer(version, options)
  11412. range = new Range(range, options)
  11413. var gtfn, ltefn, ltfn, comp, ecomp
  11414. switch (hilo) {
  11415. case '>':
  11416. gtfn = gt
  11417. ltefn = lte
  11418. ltfn = lt
  11419. comp = '>'
  11420. ecomp = '>='
  11421. break
  11422. case '<':
  11423. gtfn = lt
  11424. ltefn = gte
  11425. ltfn = gt
  11426. comp = '<'
  11427. ecomp = '<='
  11428. break
  11429. default:
  11430. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11431. }
  11432. // If it satisifes the range it is not outside
  11433. if (satisfies(version, range, options)) {
  11434. return false
  11435. }
  11436. // From now on, variable terms are as if we're in "gtr" mode.
  11437. // but note that everything is flipped for the "ltr" function.
  11438. for (var i = 0; i < range.set.length; ++i) {
  11439. var comparators = range.set[i]
  11440. var high = null
  11441. var low = null
  11442. comparators.forEach(function (comparator) {
  11443. if (comparator.semver === ANY) {
  11444. comparator = new Comparator('>=0.0.0')
  11445. }
  11446. high = high || comparator
  11447. low = low || comparator
  11448. if (gtfn(comparator.semver, high.semver, options)) {
  11449. high = comparator
  11450. } else if (ltfn(comparator.semver, low.semver, options)) {
  11451. low = comparator
  11452. }
  11453. })
  11454. // If the edge version comparator has a operator then our version
  11455. // isn't outside it
  11456. if (high.operator === comp || high.operator === ecomp) {
  11457. return false
  11458. }
  11459. // If the lowest version comparator has an operator and our version
  11460. // is less than it then it isn't higher than the range
  11461. if ((!low.operator || low.operator === comp) &&
  11462. ltefn(version, low.semver)) {
  11463. return false
  11464. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11465. return false
  11466. }
  11467. }
  11468. return true
  11469. }
  11470. exports.prerelease = prerelease
  11471. function prerelease (version, options) {
  11472. var parsed = parse(version, options)
  11473. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11474. }
  11475. exports.intersects = intersects
  11476. function intersects (r1, r2, options) {
  11477. r1 = new Range(r1, options)
  11478. r2 = new Range(r2, options)
  11479. return r1.intersects(r2)
  11480. }
  11481. exports.coerce = coerce
  11482. function coerce (version, options) {
  11483. if (version instanceof SemVer) {
  11484. return version
  11485. }
  11486. if (typeof version === 'number') {
  11487. version = String(version)
  11488. }
  11489. if (typeof version !== 'string') {
  11490. return null
  11491. }
  11492. options = options || {}
  11493. var match = null
  11494. if (!options.rtl) {
  11495. match = version.match(re[t.COERCE])
  11496. } else {
  11497. // Find the right-most coercible string that does not share
  11498. // a terminus with a more left-ward coercible string.
  11499. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11500. //
  11501. // Walk through the string checking with a /g regexp
  11502. // Manually set the index so as to pick up overlapping matches.
  11503. // Stop when we get a match that ends at the string end, since no
  11504. // coercible string can be more right-ward without the same terminus.
  11505. var next
  11506. while ((next = re[t.COERCERTL].exec(version)) &&
  11507. (!match || match.index + match[0].length !== version.length)
  11508. ) {
  11509. if (!match ||
  11510. next.index + next[0].length !== match.index + match[0].length) {
  11511. match = next
  11512. }
  11513. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11514. }
  11515. // leave it in a clean state
  11516. re[t.COERCERTL].lastIndex = -1
  11517. }
  11518. if (match === null) {
  11519. return null
  11520. }
  11521. return parse(match[2] +
  11522. '.' + (match[3] || '0') +
  11523. '.' + (match[4] || '0'), options)
  11524. }
  11525. /***/ }),
  11526. /***/ 669:
  11527. /***/ (function(module) {
  11528. module.exports = require("util");
  11529. /***/ }),
  11530. /***/ 672:
  11531. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11532. "use strict";
  11533. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11534. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11535. return new (P || (P = Promise))(function (resolve, reject) {
  11536. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11537. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11538. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11539. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11540. });
  11541. };
  11542. var _a;
  11543. Object.defineProperty(exports, "__esModule", { value: true });
  11544. const assert_1 = __webpack_require__(357);
  11545. const fs = __webpack_require__(747);
  11546. const path = __webpack_require__(622);
  11547. _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;
  11548. exports.IS_WINDOWS = process.platform === 'win32';
  11549. function exists(fsPath) {
  11550. return __awaiter(this, void 0, void 0, function* () {
  11551. try {
  11552. yield exports.stat(fsPath);
  11553. }
  11554. catch (err) {
  11555. if (err.code === 'ENOENT') {
  11556. return false;
  11557. }
  11558. throw err;
  11559. }
  11560. return true;
  11561. });
  11562. }
  11563. exports.exists = exists;
  11564. function isDirectory(fsPath, useStat = false) {
  11565. return __awaiter(this, void 0, void 0, function* () {
  11566. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11567. return stats.isDirectory();
  11568. });
  11569. }
  11570. exports.isDirectory = isDirectory;
  11571. /**
  11572. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11573. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11574. */
  11575. function isRooted(p) {
  11576. p = normalizeSeparators(p);
  11577. if (!p) {
  11578. throw new Error('isRooted() parameter "p" cannot be empty');
  11579. }
  11580. if (exports.IS_WINDOWS) {
  11581. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11582. ); // e.g. C: or C:\hello
  11583. }
  11584. return p.startsWith('/');
  11585. }
  11586. exports.isRooted = isRooted;
  11587. /**
  11588. * Recursively create a directory at `fsPath`.
  11589. *
  11590. * This implementation is optimistic, meaning it attempts to create the full
  11591. * path first, and backs up the path stack from there.
  11592. *
  11593. * @param fsPath The path to create
  11594. * @param maxDepth The maximum recursion depth
  11595. * @param depth The current recursion depth
  11596. */
  11597. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11598. return __awaiter(this, void 0, void 0, function* () {
  11599. assert_1.ok(fsPath, 'a path argument must be provided');
  11600. fsPath = path.resolve(fsPath);
  11601. if (depth >= maxDepth)
  11602. return exports.mkdir(fsPath);
  11603. try {
  11604. yield exports.mkdir(fsPath);
  11605. return;
  11606. }
  11607. catch (err) {
  11608. switch (err.code) {
  11609. case 'ENOENT': {
  11610. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11611. yield exports.mkdir(fsPath);
  11612. return;
  11613. }
  11614. default: {
  11615. let stats;
  11616. try {
  11617. stats = yield exports.stat(fsPath);
  11618. }
  11619. catch (err2) {
  11620. throw err;
  11621. }
  11622. if (!stats.isDirectory())
  11623. throw err;
  11624. }
  11625. }
  11626. }
  11627. });
  11628. }
  11629. exports.mkdirP = mkdirP;
  11630. /**
  11631. * Best effort attempt to determine whether a file exists and is executable.
  11632. * @param filePath file path to check
  11633. * @param extensions additional file extensions to try
  11634. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11635. */
  11636. function tryGetExecutablePath(filePath, extensions) {
  11637. return __awaiter(this, void 0, void 0, function* () {
  11638. let stats = undefined;
  11639. try {
  11640. // test file exists
  11641. stats = yield exports.stat(filePath);
  11642. }
  11643. catch (err) {
  11644. if (err.code !== 'ENOENT') {
  11645. // eslint-disable-next-line no-console
  11646. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11647. }
  11648. }
  11649. if (stats && stats.isFile()) {
  11650. if (exports.IS_WINDOWS) {
  11651. // on Windows, test for valid extension
  11652. const upperExt = path.extname(filePath).toUpperCase();
  11653. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11654. return filePath;
  11655. }
  11656. }
  11657. else {
  11658. if (isUnixExecutable(stats)) {
  11659. return filePath;
  11660. }
  11661. }
  11662. }
  11663. // try each extension
  11664. const originalFilePath = filePath;
  11665. for (const extension of extensions) {
  11666. filePath = originalFilePath + extension;
  11667. stats = undefined;
  11668. try {
  11669. stats = yield exports.stat(filePath);
  11670. }
  11671. catch (err) {
  11672. if (err.code !== 'ENOENT') {
  11673. // eslint-disable-next-line no-console
  11674. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11675. }
  11676. }
  11677. if (stats && stats.isFile()) {
  11678. if (exports.IS_WINDOWS) {
  11679. // preserve the case of the actual file (since an extension was appended)
  11680. try {
  11681. const directory = path.dirname(filePath);
  11682. const upperName = path.basename(filePath).toUpperCase();
  11683. for (const actualName of yield exports.readdir(directory)) {
  11684. if (upperName === actualName.toUpperCase()) {
  11685. filePath = path.join(directory, actualName);
  11686. break;
  11687. }
  11688. }
  11689. }
  11690. catch (err) {
  11691. // eslint-disable-next-line no-console
  11692. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11693. }
  11694. return filePath;
  11695. }
  11696. else {
  11697. if (isUnixExecutable(stats)) {
  11698. return filePath;
  11699. }
  11700. }
  11701. }
  11702. }
  11703. return '';
  11704. });
  11705. }
  11706. exports.tryGetExecutablePath = tryGetExecutablePath;
  11707. function normalizeSeparators(p) {
  11708. p = p || '';
  11709. if (exports.IS_WINDOWS) {
  11710. // convert slashes on Windows
  11711. p = p.replace(/\//g, '\\');
  11712. // remove redundant slashes
  11713. return p.replace(/\\\\+/g, '\\');
  11714. }
  11715. // remove redundant slashes
  11716. return p.replace(/\/\/+/g, '/');
  11717. }
  11718. // on Mac/Linux, test the execute bit
  11719. // R W X R W X R W X
  11720. // 256 128 64 32 16 8 4 2 1
  11721. function isUnixExecutable(stats) {
  11722. return ((stats.mode & 1) > 0 ||
  11723. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11724. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11725. }
  11726. //# sourceMappingURL=io-util.js.map
  11727. /***/ }),
  11728. /***/ 674:
  11729. /***/ (function(module, __unusedexports, __webpack_require__) {
  11730. module.exports = authenticate;
  11731. const { Deprecation } = __webpack_require__(692);
  11732. const once = __webpack_require__(969);
  11733. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11734. function authenticate(state, options) {
  11735. deprecateAuthenticate(
  11736. state.octokit.log,
  11737. new Deprecation(
  11738. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11739. )
  11740. );
  11741. if (!options) {
  11742. state.auth = false;
  11743. return;
  11744. }
  11745. switch (options.type) {
  11746. case "basic":
  11747. if (!options.username || !options.password) {
  11748. throw new Error(
  11749. "Basic authentication requires both a username and password to be set"
  11750. );
  11751. }
  11752. break;
  11753. case "oauth":
  11754. if (!options.token && !(options.key && options.secret)) {
  11755. throw new Error(
  11756. "OAuth2 authentication requires a token or key & secret to be set"
  11757. );
  11758. }
  11759. break;
  11760. case "token":
  11761. case "app":
  11762. if (!options.token) {
  11763. throw new Error("Token authentication requires a token to be set");
  11764. }
  11765. break;
  11766. default:
  11767. throw new Error(
  11768. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11769. );
  11770. }
  11771. state.auth = options;
  11772. }
  11773. /***/ }),
  11774. /***/ 675:
  11775. /***/ (function(module) {
  11776. module.exports = function btoa(str) {
  11777. return new Buffer(str).toString('base64')
  11778. }
  11779. /***/ }),
  11780. /***/ 692:
  11781. /***/ (function(__unusedmodule, exports) {
  11782. "use strict";
  11783. Object.defineProperty(exports, '__esModule', { value: true });
  11784. class Deprecation extends Error {
  11785. constructor(message) {
  11786. super(message); // Maintains proper stack trace (only available on V8)
  11787. /* istanbul ignore next */
  11788. if (Error.captureStackTrace) {
  11789. Error.captureStackTrace(this, this.constructor);
  11790. }
  11791. this.name = 'Deprecation';
  11792. }
  11793. }
  11794. exports.Deprecation = Deprecation;
  11795. /***/ }),
  11796. /***/ 696:
  11797. /***/ (function(module) {
  11798. "use strict";
  11799. /*!
  11800. * isobject <https://github.com/jonschlinkert/isobject>
  11801. *
  11802. * Copyright (c) 2014-2017, Jon Schlinkert.
  11803. * Released under the MIT License.
  11804. */
  11805. function isObject(val) {
  11806. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11807. }
  11808. /*!
  11809. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11810. *
  11811. * Copyright (c) 2014-2017, Jon Schlinkert.
  11812. * Released under the MIT License.
  11813. */
  11814. function isObjectObject(o) {
  11815. return isObject(o) === true
  11816. && Object.prototype.toString.call(o) === '[object Object]';
  11817. }
  11818. function isPlainObject(o) {
  11819. var ctor,prot;
  11820. if (isObjectObject(o) === false) return false;
  11821. // If has modified constructor
  11822. ctor = o.constructor;
  11823. if (typeof ctor !== 'function') return false;
  11824. // If has modified prototype
  11825. prot = ctor.prototype;
  11826. if (isObjectObject(prot) === false) return false;
  11827. // If constructor does not have an Object-specific method
  11828. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11829. return false;
  11830. }
  11831. // Most likely a plain Object
  11832. return true;
  11833. }
  11834. module.exports = isPlainObject;
  11835. /***/ }),
  11836. /***/ 697:
  11837. /***/ (function(module) {
  11838. "use strict";
  11839. module.exports = (promise, onFinally) => {
  11840. onFinally = onFinally || (() => {});
  11841. return promise.then(
  11842. val => new Promise(resolve => {
  11843. resolve(onFinally());
  11844. }).then(() => val),
  11845. err => new Promise(resolve => {
  11846. resolve(onFinally());
  11847. }).then(() => {
  11848. throw err;
  11849. })
  11850. );
  11851. };
  11852. /***/ }),
  11853. /***/ 722:
  11854. /***/ (function(module) {
  11855. /**
  11856. * Convert array of 16 byte values to UUID string format of the form:
  11857. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11858. */
  11859. var byteToHex = [];
  11860. for (var i = 0; i < 256; ++i) {
  11861. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11862. }
  11863. function bytesToUuid(buf, offset) {
  11864. var i = offset || 0;
  11865. var bth = byteToHex;
  11866. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11867. return ([bth[buf[i++]], bth[buf[i++]],
  11868. bth[buf[i++]], bth[buf[i++]], '-',
  11869. bth[buf[i++]], bth[buf[i++]], '-',
  11870. bth[buf[i++]], bth[buf[i++]], '-',
  11871. bth[buf[i++]], bth[buf[i++]], '-',
  11872. bth[buf[i++]], bth[buf[i++]],
  11873. bth[buf[i++]], bth[buf[i++]],
  11874. bth[buf[i++]], bth[buf[i++]]]).join('');
  11875. }
  11876. module.exports = bytesToUuid;
  11877. /***/ }),
  11878. /***/ 742:
  11879. /***/ (function(module, __unusedexports, __webpack_require__) {
  11880. var fs = __webpack_require__(747)
  11881. var core
  11882. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11883. core = __webpack_require__(818)
  11884. } else {
  11885. core = __webpack_require__(197)
  11886. }
  11887. module.exports = isexe
  11888. isexe.sync = sync
  11889. function isexe (path, options, cb) {
  11890. if (typeof options === 'function') {
  11891. cb = options
  11892. options = {}
  11893. }
  11894. if (!cb) {
  11895. if (typeof Promise !== 'function') {
  11896. throw new TypeError('callback not provided')
  11897. }
  11898. return new Promise(function (resolve, reject) {
  11899. isexe(path, options || {}, function (er, is) {
  11900. if (er) {
  11901. reject(er)
  11902. } else {
  11903. resolve(is)
  11904. }
  11905. })
  11906. })
  11907. }
  11908. core(path, options || {}, function (er, is) {
  11909. // ignore EACCES because that just means we aren't allowed to run it
  11910. if (er) {
  11911. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11912. er = null
  11913. is = false
  11914. }
  11915. }
  11916. cb(er, is)
  11917. })
  11918. }
  11919. function sync (path, options) {
  11920. // my kingdom for a filtered catch
  11921. try {
  11922. return core.sync(path, options || {})
  11923. } catch (er) {
  11924. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11925. return false
  11926. } else {
  11927. throw er
  11928. }
  11929. }
  11930. }
  11931. /***/ }),
  11932. /***/ 747:
  11933. /***/ (function(module) {
  11934. module.exports = require("fs");
  11935. /***/ }),
  11936. /***/ 753:
  11937. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11938. "use strict";
  11939. Object.defineProperty(exports, '__esModule', { value: true });
  11940. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11941. var endpoint = __webpack_require__(385);
  11942. var universalUserAgent = __webpack_require__(211);
  11943. var isPlainObject = _interopDefault(__webpack_require__(696));
  11944. var nodeFetch = _interopDefault(__webpack_require__(454));
  11945. var requestError = __webpack_require__(463);
  11946. const VERSION = "5.4.2";
  11947. function getBufferResponse(response) {
  11948. return response.arrayBuffer();
  11949. }
  11950. function fetchWrapper(requestOptions) {
  11951. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11952. requestOptions.body = JSON.stringify(requestOptions.body);
  11953. }
  11954. let headers = {};
  11955. let status;
  11956. let url;
  11957. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11958. return fetch(requestOptions.url, Object.assign({
  11959. method: requestOptions.method,
  11960. body: requestOptions.body,
  11961. headers: requestOptions.headers,
  11962. redirect: requestOptions.redirect
  11963. }, requestOptions.request)).then(response => {
  11964. url = response.url;
  11965. status = response.status;
  11966. for (const keyAndValue of response.headers) {
  11967. headers[keyAndValue[0]] = keyAndValue[1];
  11968. }
  11969. if (status === 204 || status === 205) {
  11970. return;
  11971. } // GitHub API returns 200 for HEAD requests
  11972. if (requestOptions.method === "HEAD") {
  11973. if (status < 400) {
  11974. return;
  11975. }
  11976. throw new requestError.RequestError(response.statusText, status, {
  11977. headers,
  11978. request: requestOptions
  11979. });
  11980. }
  11981. if (status === 304) {
  11982. throw new requestError.RequestError("Not modified", status, {
  11983. headers,
  11984. request: requestOptions
  11985. });
  11986. }
  11987. if (status >= 400) {
  11988. return response.text().then(message => {
  11989. const error = new requestError.RequestError(message, status, {
  11990. headers,
  11991. request: requestOptions
  11992. });
  11993. try {
  11994. let responseBody = JSON.parse(error.message);
  11995. Object.assign(error, responseBody);
  11996. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  11997. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11998. } catch (e) {// ignore, see octokit/rest.js#684
  11999. }
  12000. throw error;
  12001. });
  12002. }
  12003. const contentType = response.headers.get("content-type");
  12004. if (/application\/json/.test(contentType)) {
  12005. return response.json();
  12006. }
  12007. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12008. return response.text();
  12009. }
  12010. return getBufferResponse(response);
  12011. }).then(data => {
  12012. return {
  12013. status,
  12014. url,
  12015. headers,
  12016. data
  12017. };
  12018. }).catch(error => {
  12019. if (error instanceof requestError.RequestError) {
  12020. throw error;
  12021. }
  12022. throw new requestError.RequestError(error.message, 500, {
  12023. headers,
  12024. request: requestOptions
  12025. });
  12026. });
  12027. }
  12028. function withDefaults(oldEndpoint, newDefaults) {
  12029. const endpoint = oldEndpoint.defaults(newDefaults);
  12030. const newApi = function (route, parameters) {
  12031. const endpointOptions = endpoint.merge(route, parameters);
  12032. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12033. return fetchWrapper(endpoint.parse(endpointOptions));
  12034. }
  12035. const request = (route, parameters) => {
  12036. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12037. };
  12038. Object.assign(request, {
  12039. endpoint,
  12040. defaults: withDefaults.bind(null, endpoint)
  12041. });
  12042. return endpointOptions.request.hook(request, endpointOptions);
  12043. };
  12044. return Object.assign(newApi, {
  12045. endpoint,
  12046. defaults: withDefaults.bind(null, endpoint)
  12047. });
  12048. }
  12049. const request = withDefaults(endpoint.endpoint, {
  12050. headers: {
  12051. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12052. }
  12053. });
  12054. exports.request = request;
  12055. //# sourceMappingURL=index.js.map
  12056. /***/ }),
  12057. /***/ 761:
  12058. /***/ (function(module) {
  12059. module.exports = require("zlib");
  12060. /***/ }),
  12061. /***/ 763:
  12062. /***/ (function(module) {
  12063. module.exports = removeHook
  12064. function removeHook (state, name, method) {
  12065. if (!state.registry[name]) {
  12066. return
  12067. }
  12068. var index = state.registry[name]
  12069. .map(function (registered) { return registered.orig })
  12070. .indexOf(method)
  12071. if (index === -1) {
  12072. return
  12073. }
  12074. state.registry[name].splice(index, 1)
  12075. }
  12076. /***/ }),
  12077. /***/ 768:
  12078. /***/ (function(module) {
  12079. "use strict";
  12080. module.exports = function (x) {
  12081. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12082. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12083. if (x[x.length - 1] === lf) {
  12084. x = x.slice(0, x.length - 1);
  12085. }
  12086. if (x[x.length - 1] === cr) {
  12087. x = x.slice(0, x.length - 1);
  12088. }
  12089. return x;
  12090. };
  12091. /***/ }),
  12092. /***/ 777:
  12093. /***/ (function(module, __unusedexports, __webpack_require__) {
  12094. module.exports = getFirstPage
  12095. const getPage = __webpack_require__(265)
  12096. function getFirstPage (octokit, link, headers) {
  12097. return getPage(octokit, link, 'first', headers)
  12098. }
  12099. /***/ }),
  12100. /***/ 796:
  12101. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12102. "use strict";
  12103. Object.defineProperty(exports, '__esModule', { value: true });
  12104. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12105. var osName = _interopDefault(__webpack_require__(2));
  12106. function getUserAgent() {
  12107. try {
  12108. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12109. } catch (error) {
  12110. if (/wmic os get Caption/.test(error.message)) {
  12111. return "Windows <version undetectable>";
  12112. }
  12113. throw error;
  12114. }
  12115. }
  12116. exports.getUserAgent = getUserAgent;
  12117. //# sourceMappingURL=index.js.map
  12118. /***/ }),
  12119. /***/ 813:
  12120. /***/ (function(__unusedmodule, exports) {
  12121. "use strict";
  12122. Object.defineProperty(exports, '__esModule', { value: true });
  12123. async function auth(token) {
  12124. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12125. return {
  12126. type: "token",
  12127. token: token,
  12128. tokenType
  12129. };
  12130. }
  12131. /**
  12132. * Prefix token for usage in the Authorization header
  12133. *
  12134. * @param token OAuth token or JSON Web Token
  12135. */
  12136. function withAuthorizationPrefix(token) {
  12137. if (token.split(/\./).length === 3) {
  12138. return `bearer ${token}`;
  12139. }
  12140. return `token ${token}`;
  12141. }
  12142. async function hook(token, request, route, parameters) {
  12143. const endpoint = request.endpoint.merge(route, parameters);
  12144. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12145. return request(endpoint);
  12146. }
  12147. const createTokenAuth = function createTokenAuth(token) {
  12148. if (!token) {
  12149. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12150. }
  12151. if (typeof token !== "string") {
  12152. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12153. }
  12154. token = token.replace(/^(token|bearer) +/i, "");
  12155. return Object.assign(auth.bind(null, token), {
  12156. hook: hook.bind(null, token)
  12157. });
  12158. };
  12159. exports.createTokenAuth = createTokenAuth;
  12160. //# sourceMappingURL=index.js.map
  12161. /***/ }),
  12162. /***/ 814:
  12163. /***/ (function(module, __unusedexports, __webpack_require__) {
  12164. module.exports = which
  12165. which.sync = whichSync
  12166. var isWindows = process.platform === 'win32' ||
  12167. process.env.OSTYPE === 'cygwin' ||
  12168. process.env.OSTYPE === 'msys'
  12169. var path = __webpack_require__(622)
  12170. var COLON = isWindows ? ';' : ':'
  12171. var isexe = __webpack_require__(742)
  12172. function getNotFoundError (cmd) {
  12173. var er = new Error('not found: ' + cmd)
  12174. er.code = 'ENOENT'
  12175. return er
  12176. }
  12177. function getPathInfo (cmd, opt) {
  12178. var colon = opt.colon || COLON
  12179. var pathEnv = opt.path || process.env.PATH || ''
  12180. var pathExt = ['']
  12181. pathEnv = pathEnv.split(colon)
  12182. var pathExtExe = ''
  12183. if (isWindows) {
  12184. pathEnv.unshift(process.cwd())
  12185. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12186. pathExt = pathExtExe.split(colon)
  12187. // Always test the cmd itself first. isexe will check to make sure
  12188. // it's found in the pathExt set.
  12189. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12190. pathExt.unshift('')
  12191. }
  12192. // If it has a slash, then we don't bother searching the pathenv.
  12193. // just check the file itself, and that's it.
  12194. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12195. pathEnv = ['']
  12196. return {
  12197. env: pathEnv,
  12198. ext: pathExt,
  12199. extExe: pathExtExe
  12200. }
  12201. }
  12202. function which (cmd, opt, cb) {
  12203. if (typeof opt === 'function') {
  12204. cb = opt
  12205. opt = {}
  12206. }
  12207. var info = getPathInfo(cmd, opt)
  12208. var pathEnv = info.env
  12209. var pathExt = info.ext
  12210. var pathExtExe = info.extExe
  12211. var found = []
  12212. ;(function F (i, l) {
  12213. if (i === l) {
  12214. if (opt.all && found.length)
  12215. return cb(null, found)
  12216. else
  12217. return cb(getNotFoundError(cmd))
  12218. }
  12219. var pathPart = pathEnv[i]
  12220. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12221. pathPart = pathPart.slice(1, -1)
  12222. var p = path.join(pathPart, cmd)
  12223. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12224. p = cmd.slice(0, 2) + p
  12225. }
  12226. ;(function E (ii, ll) {
  12227. if (ii === ll) return F(i + 1, l)
  12228. var ext = pathExt[ii]
  12229. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12230. if (!er && is) {
  12231. if (opt.all)
  12232. found.push(p + ext)
  12233. else
  12234. return cb(null, p + ext)
  12235. }
  12236. return E(ii + 1, ll)
  12237. })
  12238. })(0, pathExt.length)
  12239. })(0, pathEnv.length)
  12240. }
  12241. function whichSync (cmd, opt) {
  12242. opt = opt || {}
  12243. var info = getPathInfo(cmd, opt)
  12244. var pathEnv = info.env
  12245. var pathExt = info.ext
  12246. var pathExtExe = info.extExe
  12247. var found = []
  12248. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12249. var pathPart = pathEnv[i]
  12250. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12251. pathPart = pathPart.slice(1, -1)
  12252. var p = path.join(pathPart, cmd)
  12253. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12254. p = cmd.slice(0, 2) + p
  12255. }
  12256. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12257. var cur = p + pathExt[j]
  12258. var is
  12259. try {
  12260. is = isexe.sync(cur, { pathExt: pathExtExe })
  12261. if (is) {
  12262. if (opt.all)
  12263. found.push(cur)
  12264. else
  12265. return cur
  12266. }
  12267. } catch (ex) {}
  12268. }
  12269. }
  12270. if (opt.all && found.length)
  12271. return found
  12272. if (opt.nothrow)
  12273. return null
  12274. throw getNotFoundError(cmd)
  12275. }
  12276. /***/ }),
  12277. /***/ 816:
  12278. /***/ (function(module) {
  12279. "use strict";
  12280. module.exports = /^#!.*/;
  12281. /***/ }),
  12282. /***/ 818:
  12283. /***/ (function(module, __unusedexports, __webpack_require__) {
  12284. module.exports = isexe
  12285. isexe.sync = sync
  12286. var fs = __webpack_require__(747)
  12287. function checkPathExt (path, options) {
  12288. var pathext = options.pathExt !== undefined ?
  12289. options.pathExt : process.env.PATHEXT
  12290. if (!pathext) {
  12291. return true
  12292. }
  12293. pathext = pathext.split(';')
  12294. if (pathext.indexOf('') !== -1) {
  12295. return true
  12296. }
  12297. for (var i = 0; i < pathext.length; i++) {
  12298. var p = pathext[i].toLowerCase()
  12299. if (p && path.substr(-p.length).toLowerCase() === p) {
  12300. return true
  12301. }
  12302. }
  12303. return false
  12304. }
  12305. function checkStat (stat, path, options) {
  12306. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12307. return false
  12308. }
  12309. return checkPathExt(path, options)
  12310. }
  12311. function isexe (path, options, cb) {
  12312. fs.stat(path, function (er, stat) {
  12313. cb(er, er ? false : checkStat(stat, path, options))
  12314. })
  12315. }
  12316. function sync (path, options) {
  12317. return checkStat(fs.statSync(path), path, options)
  12318. }
  12319. /***/ }),
  12320. /***/ 821:
  12321. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12322. "use strict";
  12323. var __importStar = (this && this.__importStar) || function (mod) {
  12324. if (mod && mod.__esModule) return mod;
  12325. var result = {};
  12326. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12327. result["default"] = mod;
  12328. return result;
  12329. };
  12330. Object.defineProperty(exports, "__esModule", { value: true });
  12331. const core = __importStar(__webpack_require__(470));
  12332. const fsHelper = __importStar(__webpack_require__(618));
  12333. const github = __importStar(__webpack_require__(469));
  12334. const path = __importStar(__webpack_require__(622));
  12335. function getInputs() {
  12336. const result = {};
  12337. // GitHub workspace
  12338. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12339. if (!githubWorkspacePath) {
  12340. throw new Error('GITHUB_WORKSPACE not defined');
  12341. }
  12342. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12343. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12344. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12345. // Qualified repository
  12346. const qualifiedRepository = core.getInput('repository') ||
  12347. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12348. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12349. const splitRepository = qualifiedRepository.split('/');
  12350. if (splitRepository.length !== 2 ||
  12351. !splitRepository[0] ||
  12352. !splitRepository[1]) {
  12353. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12354. }
  12355. result.repositoryOwner = splitRepository[0];
  12356. result.repositoryName = splitRepository[1];
  12357. // Repository path
  12358. result.repositoryPath = core.getInput('path') || '.';
  12359. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12360. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12361. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12362. }
  12363. // Workflow repository?
  12364. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12365. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12366. // Source branch, source version
  12367. result.ref = core.getInput('ref');
  12368. if (!result.ref) {
  12369. if (isWorkflowRepository) {
  12370. result.ref = github.context.ref;
  12371. result.commit = github.context.sha;
  12372. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12373. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12374. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12375. result.ref = `refs/heads/${result.ref}`;
  12376. }
  12377. }
  12378. if (!result.ref && !result.commit) {
  12379. result.ref = 'refs/heads/master';
  12380. }
  12381. }
  12382. // SHA?
  12383. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12384. result.commit = result.ref;
  12385. result.ref = '';
  12386. }
  12387. core.debug(`ref = '${result.ref}'`);
  12388. core.debug(`commit = '${result.commit}'`);
  12389. // Clean
  12390. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12391. core.debug(`clean = ${result.clean}`);
  12392. // Fetch depth
  12393. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12394. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12395. result.fetchDepth = 0;
  12396. }
  12397. core.debug(`fetch depth = ${result.fetchDepth}`);
  12398. // LFS
  12399. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12400. core.debug(`lfs = ${result.lfs}`);
  12401. // Submodules
  12402. result.submodules = false;
  12403. result.nestedSubmodules = false;
  12404. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12405. if (submodulesString == 'RECURSIVE') {
  12406. result.submodules = true;
  12407. result.nestedSubmodules = true;
  12408. }
  12409. else if (submodulesString == 'TRUE') {
  12410. result.submodules = true;
  12411. }
  12412. core.debug(`submodules = ${result.submodules}`);
  12413. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12414. // Auth token
  12415. result.authToken = core.getInput('token');
  12416. // SSH
  12417. result.sshKey = core.getInput('ssh-key');
  12418. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12419. result.sshStrict =
  12420. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12421. // Persist credentials
  12422. result.persistCredentials =
  12423. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12424. return result;
  12425. }
  12426. exports.getInputs = getInputs;
  12427. /***/ }),
  12428. /***/ 826:
  12429. /***/ (function(module, __unusedexports, __webpack_require__) {
  12430. var rng = __webpack_require__(139);
  12431. var bytesToUuid = __webpack_require__(722);
  12432. function v4(options, buf, offset) {
  12433. var i = buf && offset || 0;
  12434. if (typeof(options) == 'string') {
  12435. buf = options === 'binary' ? new Array(16) : null;
  12436. options = null;
  12437. }
  12438. options = options || {};
  12439. var rnds = options.random || (options.rng || rng)();
  12440. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12441. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12442. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12443. // Copy bytes to buffer, if provided
  12444. if (buf) {
  12445. for (var ii = 0; ii < 16; ++ii) {
  12446. buf[i + ii] = rnds[ii];
  12447. }
  12448. }
  12449. return buf || bytesToUuid(rnds);
  12450. }
  12451. module.exports = v4;
  12452. /***/ }),
  12453. /***/ 835:
  12454. /***/ (function(module) {
  12455. module.exports = require("url");
  12456. /***/ }),
  12457. /***/ 842:
  12458. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12459. "use strict";
  12460. Object.defineProperty(exports, '__esModule', { value: true });
  12461. var deprecation = __webpack_require__(692);
  12462. var endpointsByScope = {
  12463. actions: {
  12464. cancelWorkflowRun: {
  12465. method: "POST",
  12466. params: {
  12467. owner: {
  12468. required: true,
  12469. type: "string"
  12470. },
  12471. repo: {
  12472. required: true,
  12473. type: "string"
  12474. },
  12475. run_id: {
  12476. required: true,
  12477. type: "integer"
  12478. }
  12479. },
  12480. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12481. },
  12482. createOrUpdateSecretForRepo: {
  12483. method: "PUT",
  12484. params: {
  12485. encrypted_value: {
  12486. type: "string"
  12487. },
  12488. key_id: {
  12489. type: "string"
  12490. },
  12491. name: {
  12492. required: true,
  12493. type: "string"
  12494. },
  12495. owner: {
  12496. required: true,
  12497. type: "string"
  12498. },
  12499. repo: {
  12500. required: true,
  12501. type: "string"
  12502. }
  12503. },
  12504. url: "/repos/:owner/:repo/actions/secrets/:name"
  12505. },
  12506. createRegistrationToken: {
  12507. method: "POST",
  12508. params: {
  12509. owner: {
  12510. required: true,
  12511. type: "string"
  12512. },
  12513. repo: {
  12514. required: true,
  12515. type: "string"
  12516. }
  12517. },
  12518. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12519. },
  12520. createRemoveToken: {
  12521. method: "POST",
  12522. params: {
  12523. owner: {
  12524. required: true,
  12525. type: "string"
  12526. },
  12527. repo: {
  12528. required: true,
  12529. type: "string"
  12530. }
  12531. },
  12532. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12533. },
  12534. deleteArtifact: {
  12535. method: "DELETE",
  12536. params: {
  12537. artifact_id: {
  12538. required: true,
  12539. type: "integer"
  12540. },
  12541. owner: {
  12542. required: true,
  12543. type: "string"
  12544. },
  12545. repo: {
  12546. required: true,
  12547. type: "string"
  12548. }
  12549. },
  12550. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12551. },
  12552. deleteSecretFromRepo: {
  12553. method: "DELETE",
  12554. params: {
  12555. name: {
  12556. required: true,
  12557. type: "string"
  12558. },
  12559. owner: {
  12560. required: true,
  12561. type: "string"
  12562. },
  12563. repo: {
  12564. required: true,
  12565. type: "string"
  12566. }
  12567. },
  12568. url: "/repos/:owner/:repo/actions/secrets/:name"
  12569. },
  12570. downloadArtifact: {
  12571. method: "GET",
  12572. params: {
  12573. archive_format: {
  12574. required: true,
  12575. type: "string"
  12576. },
  12577. artifact_id: {
  12578. required: true,
  12579. type: "integer"
  12580. },
  12581. owner: {
  12582. required: true,
  12583. type: "string"
  12584. },
  12585. repo: {
  12586. required: true,
  12587. type: "string"
  12588. }
  12589. },
  12590. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12591. },
  12592. getArtifact: {
  12593. method: "GET",
  12594. params: {
  12595. artifact_id: {
  12596. required: true,
  12597. type: "integer"
  12598. },
  12599. owner: {
  12600. required: true,
  12601. type: "string"
  12602. },
  12603. repo: {
  12604. required: true,
  12605. type: "string"
  12606. }
  12607. },
  12608. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12609. },
  12610. getPublicKey: {
  12611. method: "GET",
  12612. params: {
  12613. owner: {
  12614. required: true,
  12615. type: "string"
  12616. },
  12617. repo: {
  12618. required: true,
  12619. type: "string"
  12620. }
  12621. },
  12622. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12623. },
  12624. getSecret: {
  12625. method: "GET",
  12626. params: {
  12627. name: {
  12628. required: true,
  12629. type: "string"
  12630. },
  12631. owner: {
  12632. required: true,
  12633. type: "string"
  12634. },
  12635. page: {
  12636. type: "integer"
  12637. },
  12638. per_page: {
  12639. type: "integer"
  12640. },
  12641. repo: {
  12642. required: true,
  12643. type: "string"
  12644. }
  12645. },
  12646. url: "/repos/:owner/:repo/actions/secrets/:name"
  12647. },
  12648. getSelfHostedRunner: {
  12649. method: "GET",
  12650. params: {
  12651. owner: {
  12652. required: true,
  12653. type: "string"
  12654. },
  12655. repo: {
  12656. required: true,
  12657. type: "string"
  12658. },
  12659. runner_id: {
  12660. required: true,
  12661. type: "integer"
  12662. }
  12663. },
  12664. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12665. },
  12666. getWorkflow: {
  12667. method: "GET",
  12668. params: {
  12669. owner: {
  12670. required: true,
  12671. type: "string"
  12672. },
  12673. repo: {
  12674. required: true,
  12675. type: "string"
  12676. },
  12677. workflow_id: {
  12678. required: true,
  12679. type: "integer"
  12680. }
  12681. },
  12682. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12683. },
  12684. getWorkflowJob: {
  12685. method: "GET",
  12686. params: {
  12687. job_id: {
  12688. required: true,
  12689. type: "integer"
  12690. },
  12691. owner: {
  12692. required: true,
  12693. type: "string"
  12694. },
  12695. repo: {
  12696. required: true,
  12697. type: "string"
  12698. }
  12699. },
  12700. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12701. },
  12702. getWorkflowRun: {
  12703. method: "GET",
  12704. params: {
  12705. owner: {
  12706. required: true,
  12707. type: "string"
  12708. },
  12709. repo: {
  12710. required: true,
  12711. type: "string"
  12712. },
  12713. run_id: {
  12714. required: true,
  12715. type: "integer"
  12716. }
  12717. },
  12718. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12719. },
  12720. listDownloadsForSelfHostedRunnerApplication: {
  12721. method: "GET",
  12722. params: {
  12723. owner: {
  12724. required: true,
  12725. type: "string"
  12726. },
  12727. repo: {
  12728. required: true,
  12729. type: "string"
  12730. }
  12731. },
  12732. url: "/repos/:owner/:repo/actions/runners/downloads"
  12733. },
  12734. listJobsForWorkflowRun: {
  12735. method: "GET",
  12736. params: {
  12737. owner: {
  12738. required: true,
  12739. type: "string"
  12740. },
  12741. page: {
  12742. type: "integer"
  12743. },
  12744. per_page: {
  12745. type: "integer"
  12746. },
  12747. repo: {
  12748. required: true,
  12749. type: "string"
  12750. },
  12751. run_id: {
  12752. required: true,
  12753. type: "integer"
  12754. }
  12755. },
  12756. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  12757. },
  12758. listRepoWorkflowRuns: {
  12759. method: "GET",
  12760. params: {
  12761. actor: {
  12762. type: "string"
  12763. },
  12764. branch: {
  12765. type: "string"
  12766. },
  12767. event: {
  12768. type: "string"
  12769. },
  12770. owner: {
  12771. required: true,
  12772. type: "string"
  12773. },
  12774. page: {
  12775. type: "integer"
  12776. },
  12777. per_page: {
  12778. type: "integer"
  12779. },
  12780. repo: {
  12781. required: true,
  12782. type: "string"
  12783. },
  12784. status: {
  12785. enum: ["completed", "status", "conclusion"],
  12786. type: "string"
  12787. }
  12788. },
  12789. url: "/repos/:owner/:repo/actions/runs"
  12790. },
  12791. listRepoWorkflows: {
  12792. method: "GET",
  12793. params: {
  12794. owner: {
  12795. required: true,
  12796. type: "string"
  12797. },
  12798. page: {
  12799. type: "integer"
  12800. },
  12801. per_page: {
  12802. type: "integer"
  12803. },
  12804. repo: {
  12805. required: true,
  12806. type: "string"
  12807. }
  12808. },
  12809. url: "/repos/:owner/:repo/actions/workflows"
  12810. },
  12811. listSecretsForRepo: {
  12812. method: "GET",
  12813. params: {
  12814. owner: {
  12815. required: true,
  12816. type: "string"
  12817. },
  12818. page: {
  12819. type: "integer"
  12820. },
  12821. per_page: {
  12822. type: "integer"
  12823. },
  12824. repo: {
  12825. required: true,
  12826. type: "string"
  12827. }
  12828. },
  12829. url: "/repos/:owner/:repo/actions/secrets"
  12830. },
  12831. listSelfHostedRunnersForRepo: {
  12832. method: "GET",
  12833. params: {
  12834. owner: {
  12835. required: true,
  12836. type: "string"
  12837. },
  12838. page: {
  12839. type: "integer"
  12840. },
  12841. per_page: {
  12842. type: "integer"
  12843. },
  12844. repo: {
  12845. required: true,
  12846. type: "string"
  12847. }
  12848. },
  12849. url: "/repos/:owner/:repo/actions/runners"
  12850. },
  12851. listWorkflowJobLogs: {
  12852. method: "GET",
  12853. params: {
  12854. job_id: {
  12855. required: true,
  12856. type: "integer"
  12857. },
  12858. owner: {
  12859. required: true,
  12860. type: "string"
  12861. },
  12862. page: {
  12863. type: "integer"
  12864. },
  12865. per_page: {
  12866. type: "integer"
  12867. },
  12868. repo: {
  12869. required: true,
  12870. type: "string"
  12871. }
  12872. },
  12873. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  12874. },
  12875. listWorkflowRunArtifacts: {
  12876. method: "GET",
  12877. params: {
  12878. owner: {
  12879. required: true,
  12880. type: "string"
  12881. },
  12882. page: {
  12883. type: "integer"
  12884. },
  12885. per_page: {
  12886. type: "integer"
  12887. },
  12888. repo: {
  12889. required: true,
  12890. type: "string"
  12891. },
  12892. run_id: {
  12893. required: true,
  12894. type: "integer"
  12895. }
  12896. },
  12897. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  12898. },
  12899. listWorkflowRunLogs: {
  12900. method: "GET",
  12901. params: {
  12902. owner: {
  12903. required: true,
  12904. type: "string"
  12905. },
  12906. page: {
  12907. type: "integer"
  12908. },
  12909. per_page: {
  12910. type: "integer"
  12911. },
  12912. repo: {
  12913. required: true,
  12914. type: "string"
  12915. },
  12916. run_id: {
  12917. required: true,
  12918. type: "integer"
  12919. }
  12920. },
  12921. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  12922. },
  12923. listWorkflowRuns: {
  12924. method: "GET",
  12925. params: {
  12926. actor: {
  12927. type: "string"
  12928. },
  12929. branch: {
  12930. type: "string"
  12931. },
  12932. event: {
  12933. type: "string"
  12934. },
  12935. owner: {
  12936. required: true,
  12937. type: "string"
  12938. },
  12939. page: {
  12940. type: "integer"
  12941. },
  12942. per_page: {
  12943. type: "integer"
  12944. },
  12945. repo: {
  12946. required: true,
  12947. type: "string"
  12948. },
  12949. status: {
  12950. enum: ["completed", "status", "conclusion"],
  12951. type: "string"
  12952. },
  12953. workflow_id: {
  12954. required: true,
  12955. type: "integer"
  12956. }
  12957. },
  12958. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  12959. },
  12960. reRunWorkflow: {
  12961. method: "POST",
  12962. params: {
  12963. owner: {
  12964. required: true,
  12965. type: "string"
  12966. },
  12967. repo: {
  12968. required: true,
  12969. type: "string"
  12970. },
  12971. run_id: {
  12972. required: true,
  12973. type: "integer"
  12974. }
  12975. },
  12976. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  12977. },
  12978. removeSelfHostedRunner: {
  12979. method: "DELETE",
  12980. params: {
  12981. owner: {
  12982. required: true,
  12983. type: "string"
  12984. },
  12985. repo: {
  12986. required: true,
  12987. type: "string"
  12988. },
  12989. runner_id: {
  12990. required: true,
  12991. type: "integer"
  12992. }
  12993. },
  12994. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12995. }
  12996. },
  12997. activity: {
  12998. checkStarringRepo: {
  12999. method: "GET",
  13000. params: {
  13001. owner: {
  13002. required: true,
  13003. type: "string"
  13004. },
  13005. repo: {
  13006. required: true,
  13007. type: "string"
  13008. }
  13009. },
  13010. url: "/user/starred/:owner/:repo"
  13011. },
  13012. deleteRepoSubscription: {
  13013. method: "DELETE",
  13014. params: {
  13015. owner: {
  13016. required: true,
  13017. type: "string"
  13018. },
  13019. repo: {
  13020. required: true,
  13021. type: "string"
  13022. }
  13023. },
  13024. url: "/repos/:owner/:repo/subscription"
  13025. },
  13026. deleteThreadSubscription: {
  13027. method: "DELETE",
  13028. params: {
  13029. thread_id: {
  13030. required: true,
  13031. type: "integer"
  13032. }
  13033. },
  13034. url: "/notifications/threads/:thread_id/subscription"
  13035. },
  13036. getRepoSubscription: {
  13037. method: "GET",
  13038. params: {
  13039. owner: {
  13040. required: true,
  13041. type: "string"
  13042. },
  13043. repo: {
  13044. required: true,
  13045. type: "string"
  13046. }
  13047. },
  13048. url: "/repos/:owner/:repo/subscription"
  13049. },
  13050. getThread: {
  13051. method: "GET",
  13052. params: {
  13053. thread_id: {
  13054. required: true,
  13055. type: "integer"
  13056. }
  13057. },
  13058. url: "/notifications/threads/:thread_id"
  13059. },
  13060. getThreadSubscription: {
  13061. method: "GET",
  13062. params: {
  13063. thread_id: {
  13064. required: true,
  13065. type: "integer"
  13066. }
  13067. },
  13068. url: "/notifications/threads/:thread_id/subscription"
  13069. },
  13070. listEventsForOrg: {
  13071. method: "GET",
  13072. params: {
  13073. org: {
  13074. required: true,
  13075. type: "string"
  13076. },
  13077. page: {
  13078. type: "integer"
  13079. },
  13080. per_page: {
  13081. type: "integer"
  13082. },
  13083. username: {
  13084. required: true,
  13085. type: "string"
  13086. }
  13087. },
  13088. url: "/users/:username/events/orgs/:org"
  13089. },
  13090. listEventsForUser: {
  13091. method: "GET",
  13092. params: {
  13093. page: {
  13094. type: "integer"
  13095. },
  13096. per_page: {
  13097. type: "integer"
  13098. },
  13099. username: {
  13100. required: true,
  13101. type: "string"
  13102. }
  13103. },
  13104. url: "/users/:username/events"
  13105. },
  13106. listFeeds: {
  13107. method: "GET",
  13108. params: {},
  13109. url: "/feeds"
  13110. },
  13111. listNotifications: {
  13112. method: "GET",
  13113. params: {
  13114. all: {
  13115. type: "boolean"
  13116. },
  13117. before: {
  13118. type: "string"
  13119. },
  13120. page: {
  13121. type: "integer"
  13122. },
  13123. participating: {
  13124. type: "boolean"
  13125. },
  13126. per_page: {
  13127. type: "integer"
  13128. },
  13129. since: {
  13130. type: "string"
  13131. }
  13132. },
  13133. url: "/notifications"
  13134. },
  13135. listNotificationsForRepo: {
  13136. method: "GET",
  13137. params: {
  13138. all: {
  13139. type: "boolean"
  13140. },
  13141. before: {
  13142. type: "string"
  13143. },
  13144. owner: {
  13145. required: true,
  13146. type: "string"
  13147. },
  13148. page: {
  13149. type: "integer"
  13150. },
  13151. participating: {
  13152. type: "boolean"
  13153. },
  13154. per_page: {
  13155. type: "integer"
  13156. },
  13157. repo: {
  13158. required: true,
  13159. type: "string"
  13160. },
  13161. since: {
  13162. type: "string"
  13163. }
  13164. },
  13165. url: "/repos/:owner/:repo/notifications"
  13166. },
  13167. listPublicEvents: {
  13168. method: "GET",
  13169. params: {
  13170. page: {
  13171. type: "integer"
  13172. },
  13173. per_page: {
  13174. type: "integer"
  13175. }
  13176. },
  13177. url: "/events"
  13178. },
  13179. listPublicEventsForOrg: {
  13180. method: "GET",
  13181. params: {
  13182. org: {
  13183. required: true,
  13184. type: "string"
  13185. },
  13186. page: {
  13187. type: "integer"
  13188. },
  13189. per_page: {
  13190. type: "integer"
  13191. }
  13192. },
  13193. url: "/orgs/:org/events"
  13194. },
  13195. listPublicEventsForRepoNetwork: {
  13196. method: "GET",
  13197. params: {
  13198. owner: {
  13199. required: true,
  13200. type: "string"
  13201. },
  13202. page: {
  13203. type: "integer"
  13204. },
  13205. per_page: {
  13206. type: "integer"
  13207. },
  13208. repo: {
  13209. required: true,
  13210. type: "string"
  13211. }
  13212. },
  13213. url: "/networks/:owner/:repo/events"
  13214. },
  13215. listPublicEventsForUser: {
  13216. method: "GET",
  13217. params: {
  13218. page: {
  13219. type: "integer"
  13220. },
  13221. per_page: {
  13222. type: "integer"
  13223. },
  13224. username: {
  13225. required: true,
  13226. type: "string"
  13227. }
  13228. },
  13229. url: "/users/:username/events/public"
  13230. },
  13231. listReceivedEventsForUser: {
  13232. method: "GET",
  13233. params: {
  13234. page: {
  13235. type: "integer"
  13236. },
  13237. per_page: {
  13238. type: "integer"
  13239. },
  13240. username: {
  13241. required: true,
  13242. type: "string"
  13243. }
  13244. },
  13245. url: "/users/:username/received_events"
  13246. },
  13247. listReceivedPublicEventsForUser: {
  13248. method: "GET",
  13249. params: {
  13250. page: {
  13251. type: "integer"
  13252. },
  13253. per_page: {
  13254. type: "integer"
  13255. },
  13256. username: {
  13257. required: true,
  13258. type: "string"
  13259. }
  13260. },
  13261. url: "/users/:username/received_events/public"
  13262. },
  13263. listRepoEvents: {
  13264. method: "GET",
  13265. params: {
  13266. owner: {
  13267. required: true,
  13268. type: "string"
  13269. },
  13270. page: {
  13271. type: "integer"
  13272. },
  13273. per_page: {
  13274. type: "integer"
  13275. },
  13276. repo: {
  13277. required: true,
  13278. type: "string"
  13279. }
  13280. },
  13281. url: "/repos/:owner/:repo/events"
  13282. },
  13283. listReposStarredByAuthenticatedUser: {
  13284. method: "GET",
  13285. params: {
  13286. direction: {
  13287. enum: ["asc", "desc"],
  13288. type: "string"
  13289. },
  13290. page: {
  13291. type: "integer"
  13292. },
  13293. per_page: {
  13294. type: "integer"
  13295. },
  13296. sort: {
  13297. enum: ["created", "updated"],
  13298. type: "string"
  13299. }
  13300. },
  13301. url: "/user/starred"
  13302. },
  13303. listReposStarredByUser: {
  13304. method: "GET",
  13305. params: {
  13306. direction: {
  13307. enum: ["asc", "desc"],
  13308. type: "string"
  13309. },
  13310. page: {
  13311. type: "integer"
  13312. },
  13313. per_page: {
  13314. type: "integer"
  13315. },
  13316. sort: {
  13317. enum: ["created", "updated"],
  13318. type: "string"
  13319. },
  13320. username: {
  13321. required: true,
  13322. type: "string"
  13323. }
  13324. },
  13325. url: "/users/:username/starred"
  13326. },
  13327. listReposWatchedByUser: {
  13328. method: "GET",
  13329. params: {
  13330. page: {
  13331. type: "integer"
  13332. },
  13333. per_page: {
  13334. type: "integer"
  13335. },
  13336. username: {
  13337. required: true,
  13338. type: "string"
  13339. }
  13340. },
  13341. url: "/users/:username/subscriptions"
  13342. },
  13343. listStargazersForRepo: {
  13344. method: "GET",
  13345. params: {
  13346. owner: {
  13347. required: true,
  13348. type: "string"
  13349. },
  13350. page: {
  13351. type: "integer"
  13352. },
  13353. per_page: {
  13354. type: "integer"
  13355. },
  13356. repo: {
  13357. required: true,
  13358. type: "string"
  13359. }
  13360. },
  13361. url: "/repos/:owner/:repo/stargazers"
  13362. },
  13363. listWatchedReposForAuthenticatedUser: {
  13364. method: "GET",
  13365. params: {
  13366. page: {
  13367. type: "integer"
  13368. },
  13369. per_page: {
  13370. type: "integer"
  13371. }
  13372. },
  13373. url: "/user/subscriptions"
  13374. },
  13375. listWatchersForRepo: {
  13376. method: "GET",
  13377. params: {
  13378. owner: {
  13379. required: true,
  13380. type: "string"
  13381. },
  13382. page: {
  13383. type: "integer"
  13384. },
  13385. per_page: {
  13386. type: "integer"
  13387. },
  13388. repo: {
  13389. required: true,
  13390. type: "string"
  13391. }
  13392. },
  13393. url: "/repos/:owner/:repo/subscribers"
  13394. },
  13395. markAsRead: {
  13396. method: "PUT",
  13397. params: {
  13398. last_read_at: {
  13399. type: "string"
  13400. }
  13401. },
  13402. url: "/notifications"
  13403. },
  13404. markNotificationsAsReadForRepo: {
  13405. method: "PUT",
  13406. params: {
  13407. last_read_at: {
  13408. type: "string"
  13409. },
  13410. owner: {
  13411. required: true,
  13412. type: "string"
  13413. },
  13414. repo: {
  13415. required: true,
  13416. type: "string"
  13417. }
  13418. },
  13419. url: "/repos/:owner/:repo/notifications"
  13420. },
  13421. markThreadAsRead: {
  13422. method: "PATCH",
  13423. params: {
  13424. thread_id: {
  13425. required: true,
  13426. type: "integer"
  13427. }
  13428. },
  13429. url: "/notifications/threads/:thread_id"
  13430. },
  13431. setRepoSubscription: {
  13432. method: "PUT",
  13433. params: {
  13434. ignored: {
  13435. type: "boolean"
  13436. },
  13437. owner: {
  13438. required: true,
  13439. type: "string"
  13440. },
  13441. repo: {
  13442. required: true,
  13443. type: "string"
  13444. },
  13445. subscribed: {
  13446. type: "boolean"
  13447. }
  13448. },
  13449. url: "/repos/:owner/:repo/subscription"
  13450. },
  13451. setThreadSubscription: {
  13452. method: "PUT",
  13453. params: {
  13454. ignored: {
  13455. type: "boolean"
  13456. },
  13457. thread_id: {
  13458. required: true,
  13459. type: "integer"
  13460. }
  13461. },
  13462. url: "/notifications/threads/:thread_id/subscription"
  13463. },
  13464. starRepo: {
  13465. method: "PUT",
  13466. params: {
  13467. owner: {
  13468. required: true,
  13469. type: "string"
  13470. },
  13471. repo: {
  13472. required: true,
  13473. type: "string"
  13474. }
  13475. },
  13476. url: "/user/starred/:owner/:repo"
  13477. },
  13478. unstarRepo: {
  13479. method: "DELETE",
  13480. params: {
  13481. owner: {
  13482. required: true,
  13483. type: "string"
  13484. },
  13485. repo: {
  13486. required: true,
  13487. type: "string"
  13488. }
  13489. },
  13490. url: "/user/starred/:owner/:repo"
  13491. }
  13492. },
  13493. apps: {
  13494. addRepoToInstallation: {
  13495. headers: {
  13496. accept: "application/vnd.github.machine-man-preview+json"
  13497. },
  13498. method: "PUT",
  13499. params: {
  13500. installation_id: {
  13501. required: true,
  13502. type: "integer"
  13503. },
  13504. repository_id: {
  13505. required: true,
  13506. type: "integer"
  13507. }
  13508. },
  13509. url: "/user/installations/:installation_id/repositories/:repository_id"
  13510. },
  13511. checkAccountIsAssociatedWithAny: {
  13512. method: "GET",
  13513. params: {
  13514. account_id: {
  13515. required: true,
  13516. type: "integer"
  13517. }
  13518. },
  13519. url: "/marketplace_listing/accounts/:account_id"
  13520. },
  13521. checkAccountIsAssociatedWithAnyStubbed: {
  13522. method: "GET",
  13523. params: {
  13524. account_id: {
  13525. required: true,
  13526. type: "integer"
  13527. }
  13528. },
  13529. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13530. },
  13531. checkAuthorization: {
  13532. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13533. method: "GET",
  13534. params: {
  13535. access_token: {
  13536. required: true,
  13537. type: "string"
  13538. },
  13539. client_id: {
  13540. required: true,
  13541. type: "string"
  13542. }
  13543. },
  13544. url: "/applications/:client_id/tokens/:access_token"
  13545. },
  13546. checkToken: {
  13547. headers: {
  13548. accept: "application/vnd.github.doctor-strange-preview+json"
  13549. },
  13550. method: "POST",
  13551. params: {
  13552. access_token: {
  13553. type: "string"
  13554. },
  13555. client_id: {
  13556. required: true,
  13557. type: "string"
  13558. }
  13559. },
  13560. url: "/applications/:client_id/token"
  13561. },
  13562. createContentAttachment: {
  13563. headers: {
  13564. accept: "application/vnd.github.corsair-preview+json"
  13565. },
  13566. method: "POST",
  13567. params: {
  13568. body: {
  13569. required: true,
  13570. type: "string"
  13571. },
  13572. content_reference_id: {
  13573. required: true,
  13574. type: "integer"
  13575. },
  13576. title: {
  13577. required: true,
  13578. type: "string"
  13579. }
  13580. },
  13581. url: "/content_references/:content_reference_id/attachments"
  13582. },
  13583. createFromManifest: {
  13584. headers: {
  13585. accept: "application/vnd.github.fury-preview+json"
  13586. },
  13587. method: "POST",
  13588. params: {
  13589. code: {
  13590. required: true,
  13591. type: "string"
  13592. }
  13593. },
  13594. url: "/app-manifests/:code/conversions"
  13595. },
  13596. createInstallationToken: {
  13597. headers: {
  13598. accept: "application/vnd.github.machine-man-preview+json"
  13599. },
  13600. method: "POST",
  13601. params: {
  13602. installation_id: {
  13603. required: true,
  13604. type: "integer"
  13605. },
  13606. permissions: {
  13607. type: "object"
  13608. },
  13609. repository_ids: {
  13610. type: "integer[]"
  13611. }
  13612. },
  13613. url: "/app/installations/:installation_id/access_tokens"
  13614. },
  13615. deleteAuthorization: {
  13616. headers: {
  13617. accept: "application/vnd.github.doctor-strange-preview+json"
  13618. },
  13619. method: "DELETE",
  13620. params: {
  13621. access_token: {
  13622. type: "string"
  13623. },
  13624. client_id: {
  13625. required: true,
  13626. type: "string"
  13627. }
  13628. },
  13629. url: "/applications/:client_id/grant"
  13630. },
  13631. deleteInstallation: {
  13632. headers: {
  13633. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13634. },
  13635. method: "DELETE",
  13636. params: {
  13637. installation_id: {
  13638. required: true,
  13639. type: "integer"
  13640. }
  13641. },
  13642. url: "/app/installations/:installation_id"
  13643. },
  13644. deleteToken: {
  13645. headers: {
  13646. accept: "application/vnd.github.doctor-strange-preview+json"
  13647. },
  13648. method: "DELETE",
  13649. params: {
  13650. access_token: {
  13651. type: "string"
  13652. },
  13653. client_id: {
  13654. required: true,
  13655. type: "string"
  13656. }
  13657. },
  13658. url: "/applications/:client_id/token"
  13659. },
  13660. findOrgInstallation: {
  13661. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13662. headers: {
  13663. accept: "application/vnd.github.machine-man-preview+json"
  13664. },
  13665. method: "GET",
  13666. params: {
  13667. org: {
  13668. required: true,
  13669. type: "string"
  13670. }
  13671. },
  13672. url: "/orgs/:org/installation"
  13673. },
  13674. findRepoInstallation: {
  13675. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13676. headers: {
  13677. accept: "application/vnd.github.machine-man-preview+json"
  13678. },
  13679. method: "GET",
  13680. params: {
  13681. owner: {
  13682. required: true,
  13683. type: "string"
  13684. },
  13685. repo: {
  13686. required: true,
  13687. type: "string"
  13688. }
  13689. },
  13690. url: "/repos/:owner/:repo/installation"
  13691. },
  13692. findUserInstallation: {
  13693. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13694. headers: {
  13695. accept: "application/vnd.github.machine-man-preview+json"
  13696. },
  13697. method: "GET",
  13698. params: {
  13699. username: {
  13700. required: true,
  13701. type: "string"
  13702. }
  13703. },
  13704. url: "/users/:username/installation"
  13705. },
  13706. getAuthenticated: {
  13707. headers: {
  13708. accept: "application/vnd.github.machine-man-preview+json"
  13709. },
  13710. method: "GET",
  13711. params: {},
  13712. url: "/app"
  13713. },
  13714. getBySlug: {
  13715. headers: {
  13716. accept: "application/vnd.github.machine-man-preview+json"
  13717. },
  13718. method: "GET",
  13719. params: {
  13720. app_slug: {
  13721. required: true,
  13722. type: "string"
  13723. }
  13724. },
  13725. url: "/apps/:app_slug"
  13726. },
  13727. getInstallation: {
  13728. headers: {
  13729. accept: "application/vnd.github.machine-man-preview+json"
  13730. },
  13731. method: "GET",
  13732. params: {
  13733. installation_id: {
  13734. required: true,
  13735. type: "integer"
  13736. }
  13737. },
  13738. url: "/app/installations/:installation_id"
  13739. },
  13740. getOrgInstallation: {
  13741. headers: {
  13742. accept: "application/vnd.github.machine-man-preview+json"
  13743. },
  13744. method: "GET",
  13745. params: {
  13746. org: {
  13747. required: true,
  13748. type: "string"
  13749. }
  13750. },
  13751. url: "/orgs/:org/installation"
  13752. },
  13753. getRepoInstallation: {
  13754. headers: {
  13755. accept: "application/vnd.github.machine-man-preview+json"
  13756. },
  13757. method: "GET",
  13758. params: {
  13759. owner: {
  13760. required: true,
  13761. type: "string"
  13762. },
  13763. repo: {
  13764. required: true,
  13765. type: "string"
  13766. }
  13767. },
  13768. url: "/repos/:owner/:repo/installation"
  13769. },
  13770. getUserInstallation: {
  13771. headers: {
  13772. accept: "application/vnd.github.machine-man-preview+json"
  13773. },
  13774. method: "GET",
  13775. params: {
  13776. username: {
  13777. required: true,
  13778. type: "string"
  13779. }
  13780. },
  13781. url: "/users/:username/installation"
  13782. },
  13783. listAccountsUserOrOrgOnPlan: {
  13784. method: "GET",
  13785. params: {
  13786. direction: {
  13787. enum: ["asc", "desc"],
  13788. type: "string"
  13789. },
  13790. page: {
  13791. type: "integer"
  13792. },
  13793. per_page: {
  13794. type: "integer"
  13795. },
  13796. plan_id: {
  13797. required: true,
  13798. type: "integer"
  13799. },
  13800. sort: {
  13801. enum: ["created", "updated"],
  13802. type: "string"
  13803. }
  13804. },
  13805. url: "/marketplace_listing/plans/:plan_id/accounts"
  13806. },
  13807. listAccountsUserOrOrgOnPlanStubbed: {
  13808. method: "GET",
  13809. params: {
  13810. direction: {
  13811. enum: ["asc", "desc"],
  13812. type: "string"
  13813. },
  13814. page: {
  13815. type: "integer"
  13816. },
  13817. per_page: {
  13818. type: "integer"
  13819. },
  13820. plan_id: {
  13821. required: true,
  13822. type: "integer"
  13823. },
  13824. sort: {
  13825. enum: ["created", "updated"],
  13826. type: "string"
  13827. }
  13828. },
  13829. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  13830. },
  13831. listInstallationReposForAuthenticatedUser: {
  13832. headers: {
  13833. accept: "application/vnd.github.machine-man-preview+json"
  13834. },
  13835. method: "GET",
  13836. params: {
  13837. installation_id: {
  13838. required: true,
  13839. type: "integer"
  13840. },
  13841. page: {
  13842. type: "integer"
  13843. },
  13844. per_page: {
  13845. type: "integer"
  13846. }
  13847. },
  13848. url: "/user/installations/:installation_id/repositories"
  13849. },
  13850. listInstallations: {
  13851. headers: {
  13852. accept: "application/vnd.github.machine-man-preview+json"
  13853. },
  13854. method: "GET",
  13855. params: {
  13856. page: {
  13857. type: "integer"
  13858. },
  13859. per_page: {
  13860. type: "integer"
  13861. }
  13862. },
  13863. url: "/app/installations"
  13864. },
  13865. listInstallationsForAuthenticatedUser: {
  13866. headers: {
  13867. accept: "application/vnd.github.machine-man-preview+json"
  13868. },
  13869. method: "GET",
  13870. params: {
  13871. page: {
  13872. type: "integer"
  13873. },
  13874. per_page: {
  13875. type: "integer"
  13876. }
  13877. },
  13878. url: "/user/installations"
  13879. },
  13880. listMarketplacePurchasesForAuthenticatedUser: {
  13881. method: "GET",
  13882. params: {
  13883. page: {
  13884. type: "integer"
  13885. },
  13886. per_page: {
  13887. type: "integer"
  13888. }
  13889. },
  13890. url: "/user/marketplace_purchases"
  13891. },
  13892. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  13893. method: "GET",
  13894. params: {
  13895. page: {
  13896. type: "integer"
  13897. },
  13898. per_page: {
  13899. type: "integer"
  13900. }
  13901. },
  13902. url: "/user/marketplace_purchases/stubbed"
  13903. },
  13904. listPlans: {
  13905. method: "GET",
  13906. params: {
  13907. page: {
  13908. type: "integer"
  13909. },
  13910. per_page: {
  13911. type: "integer"
  13912. }
  13913. },
  13914. url: "/marketplace_listing/plans"
  13915. },
  13916. listPlansStubbed: {
  13917. method: "GET",
  13918. params: {
  13919. page: {
  13920. type: "integer"
  13921. },
  13922. per_page: {
  13923. type: "integer"
  13924. }
  13925. },
  13926. url: "/marketplace_listing/stubbed/plans"
  13927. },
  13928. listRepos: {
  13929. headers: {
  13930. accept: "application/vnd.github.machine-man-preview+json"
  13931. },
  13932. method: "GET",
  13933. params: {
  13934. page: {
  13935. type: "integer"
  13936. },
  13937. per_page: {
  13938. type: "integer"
  13939. }
  13940. },
  13941. url: "/installation/repositories"
  13942. },
  13943. removeRepoFromInstallation: {
  13944. headers: {
  13945. accept: "application/vnd.github.machine-man-preview+json"
  13946. },
  13947. method: "DELETE",
  13948. params: {
  13949. installation_id: {
  13950. required: true,
  13951. type: "integer"
  13952. },
  13953. repository_id: {
  13954. required: true,
  13955. type: "integer"
  13956. }
  13957. },
  13958. url: "/user/installations/:installation_id/repositories/:repository_id"
  13959. },
  13960. resetAuthorization: {
  13961. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  13962. method: "POST",
  13963. params: {
  13964. access_token: {
  13965. required: true,
  13966. type: "string"
  13967. },
  13968. client_id: {
  13969. required: true,
  13970. type: "string"
  13971. }
  13972. },
  13973. url: "/applications/:client_id/tokens/:access_token"
  13974. },
  13975. resetToken: {
  13976. headers: {
  13977. accept: "application/vnd.github.doctor-strange-preview+json"
  13978. },
  13979. method: "PATCH",
  13980. params: {
  13981. access_token: {
  13982. type: "string"
  13983. },
  13984. client_id: {
  13985. required: true,
  13986. type: "string"
  13987. }
  13988. },
  13989. url: "/applications/:client_id/token"
  13990. },
  13991. revokeAuthorizationForApplication: {
  13992. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  13993. method: "DELETE",
  13994. params: {
  13995. access_token: {
  13996. required: true,
  13997. type: "string"
  13998. },
  13999. client_id: {
  14000. required: true,
  14001. type: "string"
  14002. }
  14003. },
  14004. url: "/applications/:client_id/tokens/:access_token"
  14005. },
  14006. revokeGrantForApplication: {
  14007. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14008. method: "DELETE",
  14009. params: {
  14010. access_token: {
  14011. required: true,
  14012. type: "string"
  14013. },
  14014. client_id: {
  14015. required: true,
  14016. type: "string"
  14017. }
  14018. },
  14019. url: "/applications/:client_id/grants/:access_token"
  14020. },
  14021. revokeInstallationToken: {
  14022. headers: {
  14023. accept: "application/vnd.github.gambit-preview+json"
  14024. },
  14025. method: "DELETE",
  14026. params: {},
  14027. url: "/installation/token"
  14028. }
  14029. },
  14030. checks: {
  14031. create: {
  14032. headers: {
  14033. accept: "application/vnd.github.antiope-preview+json"
  14034. },
  14035. method: "POST",
  14036. params: {
  14037. actions: {
  14038. type: "object[]"
  14039. },
  14040. "actions[].description": {
  14041. required: true,
  14042. type: "string"
  14043. },
  14044. "actions[].identifier": {
  14045. required: true,
  14046. type: "string"
  14047. },
  14048. "actions[].label": {
  14049. required: true,
  14050. type: "string"
  14051. },
  14052. completed_at: {
  14053. type: "string"
  14054. },
  14055. conclusion: {
  14056. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14057. type: "string"
  14058. },
  14059. details_url: {
  14060. type: "string"
  14061. },
  14062. external_id: {
  14063. type: "string"
  14064. },
  14065. head_sha: {
  14066. required: true,
  14067. type: "string"
  14068. },
  14069. name: {
  14070. required: true,
  14071. type: "string"
  14072. },
  14073. output: {
  14074. type: "object"
  14075. },
  14076. "output.annotations": {
  14077. type: "object[]"
  14078. },
  14079. "output.annotations[].annotation_level": {
  14080. enum: ["notice", "warning", "failure"],
  14081. required: true,
  14082. type: "string"
  14083. },
  14084. "output.annotations[].end_column": {
  14085. type: "integer"
  14086. },
  14087. "output.annotations[].end_line": {
  14088. required: true,
  14089. type: "integer"
  14090. },
  14091. "output.annotations[].message": {
  14092. required: true,
  14093. type: "string"
  14094. },
  14095. "output.annotations[].path": {
  14096. required: true,
  14097. type: "string"
  14098. },
  14099. "output.annotations[].raw_details": {
  14100. type: "string"
  14101. },
  14102. "output.annotations[].start_column": {
  14103. type: "integer"
  14104. },
  14105. "output.annotations[].start_line": {
  14106. required: true,
  14107. type: "integer"
  14108. },
  14109. "output.annotations[].title": {
  14110. type: "string"
  14111. },
  14112. "output.images": {
  14113. type: "object[]"
  14114. },
  14115. "output.images[].alt": {
  14116. required: true,
  14117. type: "string"
  14118. },
  14119. "output.images[].caption": {
  14120. type: "string"
  14121. },
  14122. "output.images[].image_url": {
  14123. required: true,
  14124. type: "string"
  14125. },
  14126. "output.summary": {
  14127. required: true,
  14128. type: "string"
  14129. },
  14130. "output.text": {
  14131. type: "string"
  14132. },
  14133. "output.title": {
  14134. required: true,
  14135. type: "string"
  14136. },
  14137. owner: {
  14138. required: true,
  14139. type: "string"
  14140. },
  14141. repo: {
  14142. required: true,
  14143. type: "string"
  14144. },
  14145. started_at: {
  14146. type: "string"
  14147. },
  14148. status: {
  14149. enum: ["queued", "in_progress", "completed"],
  14150. type: "string"
  14151. }
  14152. },
  14153. url: "/repos/:owner/:repo/check-runs"
  14154. },
  14155. createSuite: {
  14156. headers: {
  14157. accept: "application/vnd.github.antiope-preview+json"
  14158. },
  14159. method: "POST",
  14160. params: {
  14161. head_sha: {
  14162. required: true,
  14163. type: "string"
  14164. },
  14165. owner: {
  14166. required: true,
  14167. type: "string"
  14168. },
  14169. repo: {
  14170. required: true,
  14171. type: "string"
  14172. }
  14173. },
  14174. url: "/repos/:owner/:repo/check-suites"
  14175. },
  14176. get: {
  14177. headers: {
  14178. accept: "application/vnd.github.antiope-preview+json"
  14179. },
  14180. method: "GET",
  14181. params: {
  14182. check_run_id: {
  14183. required: true,
  14184. type: "integer"
  14185. },
  14186. owner: {
  14187. required: true,
  14188. type: "string"
  14189. },
  14190. repo: {
  14191. required: true,
  14192. type: "string"
  14193. }
  14194. },
  14195. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14196. },
  14197. getSuite: {
  14198. headers: {
  14199. accept: "application/vnd.github.antiope-preview+json"
  14200. },
  14201. method: "GET",
  14202. params: {
  14203. check_suite_id: {
  14204. required: true,
  14205. type: "integer"
  14206. },
  14207. owner: {
  14208. required: true,
  14209. type: "string"
  14210. },
  14211. repo: {
  14212. required: true,
  14213. type: "string"
  14214. }
  14215. },
  14216. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14217. },
  14218. listAnnotations: {
  14219. headers: {
  14220. accept: "application/vnd.github.antiope-preview+json"
  14221. },
  14222. method: "GET",
  14223. params: {
  14224. check_run_id: {
  14225. required: true,
  14226. type: "integer"
  14227. },
  14228. owner: {
  14229. required: true,
  14230. type: "string"
  14231. },
  14232. page: {
  14233. type: "integer"
  14234. },
  14235. per_page: {
  14236. type: "integer"
  14237. },
  14238. repo: {
  14239. required: true,
  14240. type: "string"
  14241. }
  14242. },
  14243. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14244. },
  14245. listForRef: {
  14246. headers: {
  14247. accept: "application/vnd.github.antiope-preview+json"
  14248. },
  14249. method: "GET",
  14250. params: {
  14251. check_name: {
  14252. type: "string"
  14253. },
  14254. filter: {
  14255. enum: ["latest", "all"],
  14256. type: "string"
  14257. },
  14258. owner: {
  14259. required: true,
  14260. type: "string"
  14261. },
  14262. page: {
  14263. type: "integer"
  14264. },
  14265. per_page: {
  14266. type: "integer"
  14267. },
  14268. ref: {
  14269. required: true,
  14270. type: "string"
  14271. },
  14272. repo: {
  14273. required: true,
  14274. type: "string"
  14275. },
  14276. status: {
  14277. enum: ["queued", "in_progress", "completed"],
  14278. type: "string"
  14279. }
  14280. },
  14281. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14282. },
  14283. listForSuite: {
  14284. headers: {
  14285. accept: "application/vnd.github.antiope-preview+json"
  14286. },
  14287. method: "GET",
  14288. params: {
  14289. check_name: {
  14290. type: "string"
  14291. },
  14292. check_suite_id: {
  14293. required: true,
  14294. type: "integer"
  14295. },
  14296. filter: {
  14297. enum: ["latest", "all"],
  14298. type: "string"
  14299. },
  14300. owner: {
  14301. required: true,
  14302. type: "string"
  14303. },
  14304. page: {
  14305. type: "integer"
  14306. },
  14307. per_page: {
  14308. type: "integer"
  14309. },
  14310. repo: {
  14311. required: true,
  14312. type: "string"
  14313. },
  14314. status: {
  14315. enum: ["queued", "in_progress", "completed"],
  14316. type: "string"
  14317. }
  14318. },
  14319. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14320. },
  14321. listSuitesForRef: {
  14322. headers: {
  14323. accept: "application/vnd.github.antiope-preview+json"
  14324. },
  14325. method: "GET",
  14326. params: {
  14327. app_id: {
  14328. type: "integer"
  14329. },
  14330. check_name: {
  14331. type: "string"
  14332. },
  14333. owner: {
  14334. required: true,
  14335. type: "string"
  14336. },
  14337. page: {
  14338. type: "integer"
  14339. },
  14340. per_page: {
  14341. type: "integer"
  14342. },
  14343. ref: {
  14344. required: true,
  14345. type: "string"
  14346. },
  14347. repo: {
  14348. required: true,
  14349. type: "string"
  14350. }
  14351. },
  14352. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14353. },
  14354. rerequestSuite: {
  14355. headers: {
  14356. accept: "application/vnd.github.antiope-preview+json"
  14357. },
  14358. method: "POST",
  14359. params: {
  14360. check_suite_id: {
  14361. required: true,
  14362. type: "integer"
  14363. },
  14364. owner: {
  14365. required: true,
  14366. type: "string"
  14367. },
  14368. repo: {
  14369. required: true,
  14370. type: "string"
  14371. }
  14372. },
  14373. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14374. },
  14375. setSuitesPreferences: {
  14376. headers: {
  14377. accept: "application/vnd.github.antiope-preview+json"
  14378. },
  14379. method: "PATCH",
  14380. params: {
  14381. auto_trigger_checks: {
  14382. type: "object[]"
  14383. },
  14384. "auto_trigger_checks[].app_id": {
  14385. required: true,
  14386. type: "integer"
  14387. },
  14388. "auto_trigger_checks[].setting": {
  14389. required: true,
  14390. type: "boolean"
  14391. },
  14392. owner: {
  14393. required: true,
  14394. type: "string"
  14395. },
  14396. repo: {
  14397. required: true,
  14398. type: "string"
  14399. }
  14400. },
  14401. url: "/repos/:owner/:repo/check-suites/preferences"
  14402. },
  14403. update: {
  14404. headers: {
  14405. accept: "application/vnd.github.antiope-preview+json"
  14406. },
  14407. method: "PATCH",
  14408. params: {
  14409. actions: {
  14410. type: "object[]"
  14411. },
  14412. "actions[].description": {
  14413. required: true,
  14414. type: "string"
  14415. },
  14416. "actions[].identifier": {
  14417. required: true,
  14418. type: "string"
  14419. },
  14420. "actions[].label": {
  14421. required: true,
  14422. type: "string"
  14423. },
  14424. check_run_id: {
  14425. required: true,
  14426. type: "integer"
  14427. },
  14428. completed_at: {
  14429. type: "string"
  14430. },
  14431. conclusion: {
  14432. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14433. type: "string"
  14434. },
  14435. details_url: {
  14436. type: "string"
  14437. },
  14438. external_id: {
  14439. type: "string"
  14440. },
  14441. name: {
  14442. type: "string"
  14443. },
  14444. output: {
  14445. type: "object"
  14446. },
  14447. "output.annotations": {
  14448. type: "object[]"
  14449. },
  14450. "output.annotations[].annotation_level": {
  14451. enum: ["notice", "warning", "failure"],
  14452. required: true,
  14453. type: "string"
  14454. },
  14455. "output.annotations[].end_column": {
  14456. type: "integer"
  14457. },
  14458. "output.annotations[].end_line": {
  14459. required: true,
  14460. type: "integer"
  14461. },
  14462. "output.annotations[].message": {
  14463. required: true,
  14464. type: "string"
  14465. },
  14466. "output.annotations[].path": {
  14467. required: true,
  14468. type: "string"
  14469. },
  14470. "output.annotations[].raw_details": {
  14471. type: "string"
  14472. },
  14473. "output.annotations[].start_column": {
  14474. type: "integer"
  14475. },
  14476. "output.annotations[].start_line": {
  14477. required: true,
  14478. type: "integer"
  14479. },
  14480. "output.annotations[].title": {
  14481. type: "string"
  14482. },
  14483. "output.images": {
  14484. type: "object[]"
  14485. },
  14486. "output.images[].alt": {
  14487. required: true,
  14488. type: "string"
  14489. },
  14490. "output.images[].caption": {
  14491. type: "string"
  14492. },
  14493. "output.images[].image_url": {
  14494. required: true,
  14495. type: "string"
  14496. },
  14497. "output.summary": {
  14498. required: true,
  14499. type: "string"
  14500. },
  14501. "output.text": {
  14502. type: "string"
  14503. },
  14504. "output.title": {
  14505. type: "string"
  14506. },
  14507. owner: {
  14508. required: true,
  14509. type: "string"
  14510. },
  14511. repo: {
  14512. required: true,
  14513. type: "string"
  14514. },
  14515. started_at: {
  14516. type: "string"
  14517. },
  14518. status: {
  14519. enum: ["queued", "in_progress", "completed"],
  14520. type: "string"
  14521. }
  14522. },
  14523. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14524. }
  14525. },
  14526. codesOfConduct: {
  14527. getConductCode: {
  14528. headers: {
  14529. accept: "application/vnd.github.scarlet-witch-preview+json"
  14530. },
  14531. method: "GET",
  14532. params: {
  14533. key: {
  14534. required: true,
  14535. type: "string"
  14536. }
  14537. },
  14538. url: "/codes_of_conduct/:key"
  14539. },
  14540. getForRepo: {
  14541. headers: {
  14542. accept: "application/vnd.github.scarlet-witch-preview+json"
  14543. },
  14544. method: "GET",
  14545. params: {
  14546. owner: {
  14547. required: true,
  14548. type: "string"
  14549. },
  14550. repo: {
  14551. required: true,
  14552. type: "string"
  14553. }
  14554. },
  14555. url: "/repos/:owner/:repo/community/code_of_conduct"
  14556. },
  14557. listConductCodes: {
  14558. headers: {
  14559. accept: "application/vnd.github.scarlet-witch-preview+json"
  14560. },
  14561. method: "GET",
  14562. params: {},
  14563. url: "/codes_of_conduct"
  14564. }
  14565. },
  14566. emojis: {
  14567. get: {
  14568. method: "GET",
  14569. params: {},
  14570. url: "/emojis"
  14571. }
  14572. },
  14573. gists: {
  14574. checkIsStarred: {
  14575. method: "GET",
  14576. params: {
  14577. gist_id: {
  14578. required: true,
  14579. type: "string"
  14580. }
  14581. },
  14582. url: "/gists/:gist_id/star"
  14583. },
  14584. create: {
  14585. method: "POST",
  14586. params: {
  14587. description: {
  14588. type: "string"
  14589. },
  14590. files: {
  14591. required: true,
  14592. type: "object"
  14593. },
  14594. "files.content": {
  14595. type: "string"
  14596. },
  14597. public: {
  14598. type: "boolean"
  14599. }
  14600. },
  14601. url: "/gists"
  14602. },
  14603. createComment: {
  14604. method: "POST",
  14605. params: {
  14606. body: {
  14607. required: true,
  14608. type: "string"
  14609. },
  14610. gist_id: {
  14611. required: true,
  14612. type: "string"
  14613. }
  14614. },
  14615. url: "/gists/:gist_id/comments"
  14616. },
  14617. delete: {
  14618. method: "DELETE",
  14619. params: {
  14620. gist_id: {
  14621. required: true,
  14622. type: "string"
  14623. }
  14624. },
  14625. url: "/gists/:gist_id"
  14626. },
  14627. deleteComment: {
  14628. method: "DELETE",
  14629. params: {
  14630. comment_id: {
  14631. required: true,
  14632. type: "integer"
  14633. },
  14634. gist_id: {
  14635. required: true,
  14636. type: "string"
  14637. }
  14638. },
  14639. url: "/gists/:gist_id/comments/:comment_id"
  14640. },
  14641. fork: {
  14642. method: "POST",
  14643. params: {
  14644. gist_id: {
  14645. required: true,
  14646. type: "string"
  14647. }
  14648. },
  14649. url: "/gists/:gist_id/forks"
  14650. },
  14651. get: {
  14652. method: "GET",
  14653. params: {
  14654. gist_id: {
  14655. required: true,
  14656. type: "string"
  14657. }
  14658. },
  14659. url: "/gists/:gist_id"
  14660. },
  14661. getComment: {
  14662. method: "GET",
  14663. params: {
  14664. comment_id: {
  14665. required: true,
  14666. type: "integer"
  14667. },
  14668. gist_id: {
  14669. required: true,
  14670. type: "string"
  14671. }
  14672. },
  14673. url: "/gists/:gist_id/comments/:comment_id"
  14674. },
  14675. getRevision: {
  14676. method: "GET",
  14677. params: {
  14678. gist_id: {
  14679. required: true,
  14680. type: "string"
  14681. },
  14682. sha: {
  14683. required: true,
  14684. type: "string"
  14685. }
  14686. },
  14687. url: "/gists/:gist_id/:sha"
  14688. },
  14689. list: {
  14690. method: "GET",
  14691. params: {
  14692. page: {
  14693. type: "integer"
  14694. },
  14695. per_page: {
  14696. type: "integer"
  14697. },
  14698. since: {
  14699. type: "string"
  14700. }
  14701. },
  14702. url: "/gists"
  14703. },
  14704. listComments: {
  14705. method: "GET",
  14706. params: {
  14707. gist_id: {
  14708. required: true,
  14709. type: "string"
  14710. },
  14711. page: {
  14712. type: "integer"
  14713. },
  14714. per_page: {
  14715. type: "integer"
  14716. }
  14717. },
  14718. url: "/gists/:gist_id/comments"
  14719. },
  14720. listCommits: {
  14721. method: "GET",
  14722. params: {
  14723. gist_id: {
  14724. required: true,
  14725. type: "string"
  14726. },
  14727. page: {
  14728. type: "integer"
  14729. },
  14730. per_page: {
  14731. type: "integer"
  14732. }
  14733. },
  14734. url: "/gists/:gist_id/commits"
  14735. },
  14736. listForks: {
  14737. method: "GET",
  14738. params: {
  14739. gist_id: {
  14740. required: true,
  14741. type: "string"
  14742. },
  14743. page: {
  14744. type: "integer"
  14745. },
  14746. per_page: {
  14747. type: "integer"
  14748. }
  14749. },
  14750. url: "/gists/:gist_id/forks"
  14751. },
  14752. listPublic: {
  14753. method: "GET",
  14754. params: {
  14755. page: {
  14756. type: "integer"
  14757. },
  14758. per_page: {
  14759. type: "integer"
  14760. },
  14761. since: {
  14762. type: "string"
  14763. }
  14764. },
  14765. url: "/gists/public"
  14766. },
  14767. listPublicForUser: {
  14768. method: "GET",
  14769. params: {
  14770. page: {
  14771. type: "integer"
  14772. },
  14773. per_page: {
  14774. type: "integer"
  14775. },
  14776. since: {
  14777. type: "string"
  14778. },
  14779. username: {
  14780. required: true,
  14781. type: "string"
  14782. }
  14783. },
  14784. url: "/users/:username/gists"
  14785. },
  14786. listStarred: {
  14787. method: "GET",
  14788. params: {
  14789. page: {
  14790. type: "integer"
  14791. },
  14792. per_page: {
  14793. type: "integer"
  14794. },
  14795. since: {
  14796. type: "string"
  14797. }
  14798. },
  14799. url: "/gists/starred"
  14800. },
  14801. star: {
  14802. method: "PUT",
  14803. params: {
  14804. gist_id: {
  14805. required: true,
  14806. type: "string"
  14807. }
  14808. },
  14809. url: "/gists/:gist_id/star"
  14810. },
  14811. unstar: {
  14812. method: "DELETE",
  14813. params: {
  14814. gist_id: {
  14815. required: true,
  14816. type: "string"
  14817. }
  14818. },
  14819. url: "/gists/:gist_id/star"
  14820. },
  14821. update: {
  14822. method: "PATCH",
  14823. params: {
  14824. description: {
  14825. type: "string"
  14826. },
  14827. files: {
  14828. type: "object"
  14829. },
  14830. "files.content": {
  14831. type: "string"
  14832. },
  14833. "files.filename": {
  14834. type: "string"
  14835. },
  14836. gist_id: {
  14837. required: true,
  14838. type: "string"
  14839. }
  14840. },
  14841. url: "/gists/:gist_id"
  14842. },
  14843. updateComment: {
  14844. method: "PATCH",
  14845. params: {
  14846. body: {
  14847. required: true,
  14848. type: "string"
  14849. },
  14850. comment_id: {
  14851. required: true,
  14852. type: "integer"
  14853. },
  14854. gist_id: {
  14855. required: true,
  14856. type: "string"
  14857. }
  14858. },
  14859. url: "/gists/:gist_id/comments/:comment_id"
  14860. }
  14861. },
  14862. git: {
  14863. createBlob: {
  14864. method: "POST",
  14865. params: {
  14866. content: {
  14867. required: true,
  14868. type: "string"
  14869. },
  14870. encoding: {
  14871. type: "string"
  14872. },
  14873. owner: {
  14874. required: true,
  14875. type: "string"
  14876. },
  14877. repo: {
  14878. required: true,
  14879. type: "string"
  14880. }
  14881. },
  14882. url: "/repos/:owner/:repo/git/blobs"
  14883. },
  14884. createCommit: {
  14885. method: "POST",
  14886. params: {
  14887. author: {
  14888. type: "object"
  14889. },
  14890. "author.date": {
  14891. type: "string"
  14892. },
  14893. "author.email": {
  14894. type: "string"
  14895. },
  14896. "author.name": {
  14897. type: "string"
  14898. },
  14899. committer: {
  14900. type: "object"
  14901. },
  14902. "committer.date": {
  14903. type: "string"
  14904. },
  14905. "committer.email": {
  14906. type: "string"
  14907. },
  14908. "committer.name": {
  14909. type: "string"
  14910. },
  14911. message: {
  14912. required: true,
  14913. type: "string"
  14914. },
  14915. owner: {
  14916. required: true,
  14917. type: "string"
  14918. },
  14919. parents: {
  14920. required: true,
  14921. type: "string[]"
  14922. },
  14923. repo: {
  14924. required: true,
  14925. type: "string"
  14926. },
  14927. signature: {
  14928. type: "string"
  14929. },
  14930. tree: {
  14931. required: true,
  14932. type: "string"
  14933. }
  14934. },
  14935. url: "/repos/:owner/:repo/git/commits"
  14936. },
  14937. createRef: {
  14938. method: "POST",
  14939. params: {
  14940. owner: {
  14941. required: true,
  14942. type: "string"
  14943. },
  14944. ref: {
  14945. required: true,
  14946. type: "string"
  14947. },
  14948. repo: {
  14949. required: true,
  14950. type: "string"
  14951. },
  14952. sha: {
  14953. required: true,
  14954. type: "string"
  14955. }
  14956. },
  14957. url: "/repos/:owner/:repo/git/refs"
  14958. },
  14959. createTag: {
  14960. method: "POST",
  14961. params: {
  14962. message: {
  14963. required: true,
  14964. type: "string"
  14965. },
  14966. object: {
  14967. required: true,
  14968. type: "string"
  14969. },
  14970. owner: {
  14971. required: true,
  14972. type: "string"
  14973. },
  14974. repo: {
  14975. required: true,
  14976. type: "string"
  14977. },
  14978. tag: {
  14979. required: true,
  14980. type: "string"
  14981. },
  14982. tagger: {
  14983. type: "object"
  14984. },
  14985. "tagger.date": {
  14986. type: "string"
  14987. },
  14988. "tagger.email": {
  14989. type: "string"
  14990. },
  14991. "tagger.name": {
  14992. type: "string"
  14993. },
  14994. type: {
  14995. enum: ["commit", "tree", "blob"],
  14996. required: true,
  14997. type: "string"
  14998. }
  14999. },
  15000. url: "/repos/:owner/:repo/git/tags"
  15001. },
  15002. createTree: {
  15003. method: "POST",
  15004. params: {
  15005. base_tree: {
  15006. type: "string"
  15007. },
  15008. owner: {
  15009. required: true,
  15010. type: "string"
  15011. },
  15012. repo: {
  15013. required: true,
  15014. type: "string"
  15015. },
  15016. tree: {
  15017. required: true,
  15018. type: "object[]"
  15019. },
  15020. "tree[].content": {
  15021. type: "string"
  15022. },
  15023. "tree[].mode": {
  15024. enum: ["100644", "100755", "040000", "160000", "120000"],
  15025. type: "string"
  15026. },
  15027. "tree[].path": {
  15028. type: "string"
  15029. },
  15030. "tree[].sha": {
  15031. allowNull: true,
  15032. type: "string"
  15033. },
  15034. "tree[].type": {
  15035. enum: ["blob", "tree", "commit"],
  15036. type: "string"
  15037. }
  15038. },
  15039. url: "/repos/:owner/:repo/git/trees"
  15040. },
  15041. deleteRef: {
  15042. method: "DELETE",
  15043. params: {
  15044. owner: {
  15045. required: true,
  15046. type: "string"
  15047. },
  15048. ref: {
  15049. required: true,
  15050. type: "string"
  15051. },
  15052. repo: {
  15053. required: true,
  15054. type: "string"
  15055. }
  15056. },
  15057. url: "/repos/:owner/:repo/git/refs/:ref"
  15058. },
  15059. getBlob: {
  15060. method: "GET",
  15061. params: {
  15062. file_sha: {
  15063. required: true,
  15064. type: "string"
  15065. },
  15066. owner: {
  15067. required: true,
  15068. type: "string"
  15069. },
  15070. repo: {
  15071. required: true,
  15072. type: "string"
  15073. }
  15074. },
  15075. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15076. },
  15077. getCommit: {
  15078. method: "GET",
  15079. params: {
  15080. commit_sha: {
  15081. required: true,
  15082. type: "string"
  15083. },
  15084. owner: {
  15085. required: true,
  15086. type: "string"
  15087. },
  15088. repo: {
  15089. required: true,
  15090. type: "string"
  15091. }
  15092. },
  15093. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15094. },
  15095. getRef: {
  15096. method: "GET",
  15097. params: {
  15098. owner: {
  15099. required: true,
  15100. type: "string"
  15101. },
  15102. ref: {
  15103. required: true,
  15104. type: "string"
  15105. },
  15106. repo: {
  15107. required: true,
  15108. type: "string"
  15109. }
  15110. },
  15111. url: "/repos/:owner/:repo/git/ref/:ref"
  15112. },
  15113. getTag: {
  15114. method: "GET",
  15115. params: {
  15116. owner: {
  15117. required: true,
  15118. type: "string"
  15119. },
  15120. repo: {
  15121. required: true,
  15122. type: "string"
  15123. },
  15124. tag_sha: {
  15125. required: true,
  15126. type: "string"
  15127. }
  15128. },
  15129. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15130. },
  15131. getTree: {
  15132. method: "GET",
  15133. params: {
  15134. owner: {
  15135. required: true,
  15136. type: "string"
  15137. },
  15138. recursive: {
  15139. enum: ["1"],
  15140. type: "integer"
  15141. },
  15142. repo: {
  15143. required: true,
  15144. type: "string"
  15145. },
  15146. tree_sha: {
  15147. required: true,
  15148. type: "string"
  15149. }
  15150. },
  15151. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15152. },
  15153. listMatchingRefs: {
  15154. method: "GET",
  15155. params: {
  15156. owner: {
  15157. required: true,
  15158. type: "string"
  15159. },
  15160. page: {
  15161. type: "integer"
  15162. },
  15163. per_page: {
  15164. type: "integer"
  15165. },
  15166. ref: {
  15167. required: true,
  15168. type: "string"
  15169. },
  15170. repo: {
  15171. required: true,
  15172. type: "string"
  15173. }
  15174. },
  15175. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15176. },
  15177. listRefs: {
  15178. method: "GET",
  15179. params: {
  15180. namespace: {
  15181. type: "string"
  15182. },
  15183. owner: {
  15184. required: true,
  15185. type: "string"
  15186. },
  15187. page: {
  15188. type: "integer"
  15189. },
  15190. per_page: {
  15191. type: "integer"
  15192. },
  15193. repo: {
  15194. required: true,
  15195. type: "string"
  15196. }
  15197. },
  15198. url: "/repos/:owner/:repo/git/refs/:namespace"
  15199. },
  15200. updateRef: {
  15201. method: "PATCH",
  15202. params: {
  15203. force: {
  15204. type: "boolean"
  15205. },
  15206. owner: {
  15207. required: true,
  15208. type: "string"
  15209. },
  15210. ref: {
  15211. required: true,
  15212. type: "string"
  15213. },
  15214. repo: {
  15215. required: true,
  15216. type: "string"
  15217. },
  15218. sha: {
  15219. required: true,
  15220. type: "string"
  15221. }
  15222. },
  15223. url: "/repos/:owner/:repo/git/refs/:ref"
  15224. }
  15225. },
  15226. gitignore: {
  15227. getTemplate: {
  15228. method: "GET",
  15229. params: {
  15230. name: {
  15231. required: true,
  15232. type: "string"
  15233. }
  15234. },
  15235. url: "/gitignore/templates/:name"
  15236. },
  15237. listTemplates: {
  15238. method: "GET",
  15239. params: {},
  15240. url: "/gitignore/templates"
  15241. }
  15242. },
  15243. interactions: {
  15244. addOrUpdateRestrictionsForOrg: {
  15245. headers: {
  15246. accept: "application/vnd.github.sombra-preview+json"
  15247. },
  15248. method: "PUT",
  15249. params: {
  15250. limit: {
  15251. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15252. required: true,
  15253. type: "string"
  15254. },
  15255. org: {
  15256. required: true,
  15257. type: "string"
  15258. }
  15259. },
  15260. url: "/orgs/:org/interaction-limits"
  15261. },
  15262. addOrUpdateRestrictionsForRepo: {
  15263. headers: {
  15264. accept: "application/vnd.github.sombra-preview+json"
  15265. },
  15266. method: "PUT",
  15267. params: {
  15268. limit: {
  15269. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15270. required: true,
  15271. type: "string"
  15272. },
  15273. owner: {
  15274. required: true,
  15275. type: "string"
  15276. },
  15277. repo: {
  15278. required: true,
  15279. type: "string"
  15280. }
  15281. },
  15282. url: "/repos/:owner/:repo/interaction-limits"
  15283. },
  15284. getRestrictionsForOrg: {
  15285. headers: {
  15286. accept: "application/vnd.github.sombra-preview+json"
  15287. },
  15288. method: "GET",
  15289. params: {
  15290. org: {
  15291. required: true,
  15292. type: "string"
  15293. }
  15294. },
  15295. url: "/orgs/:org/interaction-limits"
  15296. },
  15297. getRestrictionsForRepo: {
  15298. headers: {
  15299. accept: "application/vnd.github.sombra-preview+json"
  15300. },
  15301. method: "GET",
  15302. params: {
  15303. owner: {
  15304. required: true,
  15305. type: "string"
  15306. },
  15307. repo: {
  15308. required: true,
  15309. type: "string"
  15310. }
  15311. },
  15312. url: "/repos/:owner/:repo/interaction-limits"
  15313. },
  15314. removeRestrictionsForOrg: {
  15315. headers: {
  15316. accept: "application/vnd.github.sombra-preview+json"
  15317. },
  15318. method: "DELETE",
  15319. params: {
  15320. org: {
  15321. required: true,
  15322. type: "string"
  15323. }
  15324. },
  15325. url: "/orgs/:org/interaction-limits"
  15326. },
  15327. removeRestrictionsForRepo: {
  15328. headers: {
  15329. accept: "application/vnd.github.sombra-preview+json"
  15330. },
  15331. method: "DELETE",
  15332. params: {
  15333. owner: {
  15334. required: true,
  15335. type: "string"
  15336. },
  15337. repo: {
  15338. required: true,
  15339. type: "string"
  15340. }
  15341. },
  15342. url: "/repos/:owner/:repo/interaction-limits"
  15343. }
  15344. },
  15345. issues: {
  15346. addAssignees: {
  15347. method: "POST",
  15348. params: {
  15349. assignees: {
  15350. type: "string[]"
  15351. },
  15352. issue_number: {
  15353. required: true,
  15354. type: "integer"
  15355. },
  15356. number: {
  15357. alias: "issue_number",
  15358. deprecated: true,
  15359. type: "integer"
  15360. },
  15361. owner: {
  15362. required: true,
  15363. type: "string"
  15364. },
  15365. repo: {
  15366. required: true,
  15367. type: "string"
  15368. }
  15369. },
  15370. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15371. },
  15372. addLabels: {
  15373. method: "POST",
  15374. params: {
  15375. issue_number: {
  15376. required: true,
  15377. type: "integer"
  15378. },
  15379. labels: {
  15380. required: true,
  15381. type: "string[]"
  15382. },
  15383. number: {
  15384. alias: "issue_number",
  15385. deprecated: true,
  15386. type: "integer"
  15387. },
  15388. owner: {
  15389. required: true,
  15390. type: "string"
  15391. },
  15392. repo: {
  15393. required: true,
  15394. type: "string"
  15395. }
  15396. },
  15397. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15398. },
  15399. checkAssignee: {
  15400. method: "GET",
  15401. params: {
  15402. assignee: {
  15403. required: true,
  15404. type: "string"
  15405. },
  15406. owner: {
  15407. required: true,
  15408. type: "string"
  15409. },
  15410. repo: {
  15411. required: true,
  15412. type: "string"
  15413. }
  15414. },
  15415. url: "/repos/:owner/:repo/assignees/:assignee"
  15416. },
  15417. create: {
  15418. method: "POST",
  15419. params: {
  15420. assignee: {
  15421. type: "string"
  15422. },
  15423. assignees: {
  15424. type: "string[]"
  15425. },
  15426. body: {
  15427. type: "string"
  15428. },
  15429. labels: {
  15430. type: "string[]"
  15431. },
  15432. milestone: {
  15433. type: "integer"
  15434. },
  15435. owner: {
  15436. required: true,
  15437. type: "string"
  15438. },
  15439. repo: {
  15440. required: true,
  15441. type: "string"
  15442. },
  15443. title: {
  15444. required: true,
  15445. type: "string"
  15446. }
  15447. },
  15448. url: "/repos/:owner/:repo/issues"
  15449. },
  15450. createComment: {
  15451. method: "POST",
  15452. params: {
  15453. body: {
  15454. required: true,
  15455. type: "string"
  15456. },
  15457. issue_number: {
  15458. required: true,
  15459. type: "integer"
  15460. },
  15461. number: {
  15462. alias: "issue_number",
  15463. deprecated: true,
  15464. type: "integer"
  15465. },
  15466. owner: {
  15467. required: true,
  15468. type: "string"
  15469. },
  15470. repo: {
  15471. required: true,
  15472. type: "string"
  15473. }
  15474. },
  15475. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15476. },
  15477. createLabel: {
  15478. method: "POST",
  15479. params: {
  15480. color: {
  15481. required: true,
  15482. type: "string"
  15483. },
  15484. description: {
  15485. type: "string"
  15486. },
  15487. name: {
  15488. required: true,
  15489. type: "string"
  15490. },
  15491. owner: {
  15492. required: true,
  15493. type: "string"
  15494. },
  15495. repo: {
  15496. required: true,
  15497. type: "string"
  15498. }
  15499. },
  15500. url: "/repos/:owner/:repo/labels"
  15501. },
  15502. createMilestone: {
  15503. method: "POST",
  15504. params: {
  15505. description: {
  15506. type: "string"
  15507. },
  15508. due_on: {
  15509. type: "string"
  15510. },
  15511. owner: {
  15512. required: true,
  15513. type: "string"
  15514. },
  15515. repo: {
  15516. required: true,
  15517. type: "string"
  15518. },
  15519. state: {
  15520. enum: ["open", "closed"],
  15521. type: "string"
  15522. },
  15523. title: {
  15524. required: true,
  15525. type: "string"
  15526. }
  15527. },
  15528. url: "/repos/:owner/:repo/milestones"
  15529. },
  15530. deleteComment: {
  15531. method: "DELETE",
  15532. params: {
  15533. comment_id: {
  15534. required: true,
  15535. type: "integer"
  15536. },
  15537. owner: {
  15538. required: true,
  15539. type: "string"
  15540. },
  15541. repo: {
  15542. required: true,
  15543. type: "string"
  15544. }
  15545. },
  15546. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15547. },
  15548. deleteLabel: {
  15549. method: "DELETE",
  15550. params: {
  15551. name: {
  15552. required: true,
  15553. type: "string"
  15554. },
  15555. owner: {
  15556. required: true,
  15557. type: "string"
  15558. },
  15559. repo: {
  15560. required: true,
  15561. type: "string"
  15562. }
  15563. },
  15564. url: "/repos/:owner/:repo/labels/:name"
  15565. },
  15566. deleteMilestone: {
  15567. method: "DELETE",
  15568. params: {
  15569. milestone_number: {
  15570. required: true,
  15571. type: "integer"
  15572. },
  15573. number: {
  15574. alias: "milestone_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/milestones/:milestone_number"
  15588. },
  15589. get: {
  15590. method: "GET",
  15591. params: {
  15592. issue_number: {
  15593. required: true,
  15594. type: "integer"
  15595. },
  15596. number: {
  15597. alias: "issue_number",
  15598. deprecated: true,
  15599. type: "integer"
  15600. },
  15601. owner: {
  15602. required: true,
  15603. type: "string"
  15604. },
  15605. repo: {
  15606. required: true,
  15607. type: "string"
  15608. }
  15609. },
  15610. url: "/repos/:owner/:repo/issues/:issue_number"
  15611. },
  15612. getComment: {
  15613. method: "GET",
  15614. params: {
  15615. comment_id: {
  15616. required: true,
  15617. type: "integer"
  15618. },
  15619. owner: {
  15620. required: true,
  15621. type: "string"
  15622. },
  15623. repo: {
  15624. required: true,
  15625. type: "string"
  15626. }
  15627. },
  15628. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15629. },
  15630. getEvent: {
  15631. method: "GET",
  15632. params: {
  15633. event_id: {
  15634. required: true,
  15635. type: "integer"
  15636. },
  15637. owner: {
  15638. required: true,
  15639. type: "string"
  15640. },
  15641. repo: {
  15642. required: true,
  15643. type: "string"
  15644. }
  15645. },
  15646. url: "/repos/:owner/:repo/issues/events/:event_id"
  15647. },
  15648. getLabel: {
  15649. method: "GET",
  15650. params: {
  15651. name: {
  15652. required: true,
  15653. type: "string"
  15654. },
  15655. owner: {
  15656. required: true,
  15657. type: "string"
  15658. },
  15659. repo: {
  15660. required: true,
  15661. type: "string"
  15662. }
  15663. },
  15664. url: "/repos/:owner/:repo/labels/:name"
  15665. },
  15666. getMilestone: {
  15667. method: "GET",
  15668. params: {
  15669. milestone_number: {
  15670. required: true,
  15671. type: "integer"
  15672. },
  15673. number: {
  15674. alias: "milestone_number",
  15675. deprecated: true,
  15676. type: "integer"
  15677. },
  15678. owner: {
  15679. required: true,
  15680. type: "string"
  15681. },
  15682. repo: {
  15683. required: true,
  15684. type: "string"
  15685. }
  15686. },
  15687. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15688. },
  15689. list: {
  15690. method: "GET",
  15691. params: {
  15692. direction: {
  15693. enum: ["asc", "desc"],
  15694. type: "string"
  15695. },
  15696. filter: {
  15697. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15698. type: "string"
  15699. },
  15700. labels: {
  15701. type: "string"
  15702. },
  15703. page: {
  15704. type: "integer"
  15705. },
  15706. per_page: {
  15707. type: "integer"
  15708. },
  15709. since: {
  15710. type: "string"
  15711. },
  15712. sort: {
  15713. enum: ["created", "updated", "comments"],
  15714. type: "string"
  15715. },
  15716. state: {
  15717. enum: ["open", "closed", "all"],
  15718. type: "string"
  15719. }
  15720. },
  15721. url: "/issues"
  15722. },
  15723. listAssignees: {
  15724. method: "GET",
  15725. params: {
  15726. owner: {
  15727. required: true,
  15728. type: "string"
  15729. },
  15730. page: {
  15731. type: "integer"
  15732. },
  15733. per_page: {
  15734. type: "integer"
  15735. },
  15736. repo: {
  15737. required: true,
  15738. type: "string"
  15739. }
  15740. },
  15741. url: "/repos/:owner/:repo/assignees"
  15742. },
  15743. listComments: {
  15744. method: "GET",
  15745. params: {
  15746. issue_number: {
  15747. required: true,
  15748. type: "integer"
  15749. },
  15750. number: {
  15751. alias: "issue_number",
  15752. deprecated: true,
  15753. type: "integer"
  15754. },
  15755. owner: {
  15756. required: true,
  15757. type: "string"
  15758. },
  15759. page: {
  15760. type: "integer"
  15761. },
  15762. per_page: {
  15763. type: "integer"
  15764. },
  15765. repo: {
  15766. required: true,
  15767. type: "string"
  15768. },
  15769. since: {
  15770. type: "string"
  15771. }
  15772. },
  15773. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15774. },
  15775. listCommentsForRepo: {
  15776. method: "GET",
  15777. params: {
  15778. direction: {
  15779. enum: ["asc", "desc"],
  15780. type: "string"
  15781. },
  15782. owner: {
  15783. required: true,
  15784. type: "string"
  15785. },
  15786. repo: {
  15787. required: true,
  15788. type: "string"
  15789. },
  15790. since: {
  15791. type: "string"
  15792. },
  15793. sort: {
  15794. enum: ["created", "updated"],
  15795. type: "string"
  15796. }
  15797. },
  15798. url: "/repos/:owner/:repo/issues/comments"
  15799. },
  15800. listEvents: {
  15801. method: "GET",
  15802. params: {
  15803. issue_number: {
  15804. required: true,
  15805. type: "integer"
  15806. },
  15807. number: {
  15808. alias: "issue_number",
  15809. deprecated: true,
  15810. type: "integer"
  15811. },
  15812. owner: {
  15813. required: true,
  15814. type: "string"
  15815. },
  15816. page: {
  15817. type: "integer"
  15818. },
  15819. per_page: {
  15820. type: "integer"
  15821. },
  15822. repo: {
  15823. required: true,
  15824. type: "string"
  15825. }
  15826. },
  15827. url: "/repos/:owner/:repo/issues/:issue_number/events"
  15828. },
  15829. listEventsForRepo: {
  15830. method: "GET",
  15831. params: {
  15832. owner: {
  15833. required: true,
  15834. type: "string"
  15835. },
  15836. page: {
  15837. type: "integer"
  15838. },
  15839. per_page: {
  15840. type: "integer"
  15841. },
  15842. repo: {
  15843. required: true,
  15844. type: "string"
  15845. }
  15846. },
  15847. url: "/repos/:owner/:repo/issues/events"
  15848. },
  15849. listEventsForTimeline: {
  15850. headers: {
  15851. accept: "application/vnd.github.mockingbird-preview+json"
  15852. },
  15853. method: "GET",
  15854. params: {
  15855. issue_number: {
  15856. required: true,
  15857. type: "integer"
  15858. },
  15859. number: {
  15860. alias: "issue_number",
  15861. deprecated: true,
  15862. type: "integer"
  15863. },
  15864. owner: {
  15865. required: true,
  15866. type: "string"
  15867. },
  15868. page: {
  15869. type: "integer"
  15870. },
  15871. per_page: {
  15872. type: "integer"
  15873. },
  15874. repo: {
  15875. required: true,
  15876. type: "string"
  15877. }
  15878. },
  15879. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  15880. },
  15881. listForAuthenticatedUser: {
  15882. method: "GET",
  15883. params: {
  15884. direction: {
  15885. enum: ["asc", "desc"],
  15886. type: "string"
  15887. },
  15888. filter: {
  15889. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15890. type: "string"
  15891. },
  15892. labels: {
  15893. type: "string"
  15894. },
  15895. page: {
  15896. type: "integer"
  15897. },
  15898. per_page: {
  15899. type: "integer"
  15900. },
  15901. since: {
  15902. type: "string"
  15903. },
  15904. sort: {
  15905. enum: ["created", "updated", "comments"],
  15906. type: "string"
  15907. },
  15908. state: {
  15909. enum: ["open", "closed", "all"],
  15910. type: "string"
  15911. }
  15912. },
  15913. url: "/user/issues"
  15914. },
  15915. listForOrg: {
  15916. method: "GET",
  15917. params: {
  15918. direction: {
  15919. enum: ["asc", "desc"],
  15920. type: "string"
  15921. },
  15922. filter: {
  15923. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15924. type: "string"
  15925. },
  15926. labels: {
  15927. type: "string"
  15928. },
  15929. org: {
  15930. required: true,
  15931. type: "string"
  15932. },
  15933. page: {
  15934. type: "integer"
  15935. },
  15936. per_page: {
  15937. type: "integer"
  15938. },
  15939. since: {
  15940. type: "string"
  15941. },
  15942. sort: {
  15943. enum: ["created", "updated", "comments"],
  15944. type: "string"
  15945. },
  15946. state: {
  15947. enum: ["open", "closed", "all"],
  15948. type: "string"
  15949. }
  15950. },
  15951. url: "/orgs/:org/issues"
  15952. },
  15953. listForRepo: {
  15954. method: "GET",
  15955. params: {
  15956. assignee: {
  15957. type: "string"
  15958. },
  15959. creator: {
  15960. type: "string"
  15961. },
  15962. direction: {
  15963. enum: ["asc", "desc"],
  15964. type: "string"
  15965. },
  15966. labels: {
  15967. type: "string"
  15968. },
  15969. mentioned: {
  15970. type: "string"
  15971. },
  15972. milestone: {
  15973. type: "string"
  15974. },
  15975. owner: {
  15976. required: true,
  15977. type: "string"
  15978. },
  15979. page: {
  15980. type: "integer"
  15981. },
  15982. per_page: {
  15983. type: "integer"
  15984. },
  15985. repo: {
  15986. required: true,
  15987. type: "string"
  15988. },
  15989. since: {
  15990. type: "string"
  15991. },
  15992. sort: {
  15993. enum: ["created", "updated", "comments"],
  15994. type: "string"
  15995. },
  15996. state: {
  15997. enum: ["open", "closed", "all"],
  15998. type: "string"
  15999. }
  16000. },
  16001. url: "/repos/:owner/:repo/issues"
  16002. },
  16003. listLabelsForMilestone: {
  16004. method: "GET",
  16005. params: {
  16006. milestone_number: {
  16007. required: true,
  16008. type: "integer"
  16009. },
  16010. number: {
  16011. alias: "milestone_number",
  16012. deprecated: true,
  16013. type: "integer"
  16014. },
  16015. owner: {
  16016. required: true,
  16017. type: "string"
  16018. },
  16019. page: {
  16020. type: "integer"
  16021. },
  16022. per_page: {
  16023. type: "integer"
  16024. },
  16025. repo: {
  16026. required: true,
  16027. type: "string"
  16028. }
  16029. },
  16030. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16031. },
  16032. listLabelsForRepo: {
  16033. method: "GET",
  16034. params: {
  16035. owner: {
  16036. required: true,
  16037. type: "string"
  16038. },
  16039. page: {
  16040. type: "integer"
  16041. },
  16042. per_page: {
  16043. type: "integer"
  16044. },
  16045. repo: {
  16046. required: true,
  16047. type: "string"
  16048. }
  16049. },
  16050. url: "/repos/:owner/:repo/labels"
  16051. },
  16052. listLabelsOnIssue: {
  16053. method: "GET",
  16054. params: {
  16055. issue_number: {
  16056. required: true,
  16057. type: "integer"
  16058. },
  16059. number: {
  16060. alias: "issue_number",
  16061. deprecated: true,
  16062. type: "integer"
  16063. },
  16064. owner: {
  16065. required: true,
  16066. type: "string"
  16067. },
  16068. page: {
  16069. type: "integer"
  16070. },
  16071. per_page: {
  16072. type: "integer"
  16073. },
  16074. repo: {
  16075. required: true,
  16076. type: "string"
  16077. }
  16078. },
  16079. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16080. },
  16081. listMilestonesForRepo: {
  16082. method: "GET",
  16083. params: {
  16084. direction: {
  16085. enum: ["asc", "desc"],
  16086. type: "string"
  16087. },
  16088. owner: {
  16089. required: true,
  16090. type: "string"
  16091. },
  16092. page: {
  16093. type: "integer"
  16094. },
  16095. per_page: {
  16096. type: "integer"
  16097. },
  16098. repo: {
  16099. required: true,
  16100. type: "string"
  16101. },
  16102. sort: {
  16103. enum: ["due_on", "completeness"],
  16104. type: "string"
  16105. },
  16106. state: {
  16107. enum: ["open", "closed", "all"],
  16108. type: "string"
  16109. }
  16110. },
  16111. url: "/repos/:owner/:repo/milestones"
  16112. },
  16113. lock: {
  16114. method: "PUT",
  16115. params: {
  16116. issue_number: {
  16117. required: true,
  16118. type: "integer"
  16119. },
  16120. lock_reason: {
  16121. enum: ["off-topic", "too heated", "resolved", "spam"],
  16122. type: "string"
  16123. },
  16124. number: {
  16125. alias: "issue_number",
  16126. deprecated: true,
  16127. type: "integer"
  16128. },
  16129. owner: {
  16130. required: true,
  16131. type: "string"
  16132. },
  16133. repo: {
  16134. required: true,
  16135. type: "string"
  16136. }
  16137. },
  16138. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16139. },
  16140. removeAssignees: {
  16141. method: "DELETE",
  16142. params: {
  16143. assignees: {
  16144. type: "string[]"
  16145. },
  16146. issue_number: {
  16147. required: true,
  16148. type: "integer"
  16149. },
  16150. number: {
  16151. alias: "issue_number",
  16152. deprecated: true,
  16153. type: "integer"
  16154. },
  16155. owner: {
  16156. required: true,
  16157. type: "string"
  16158. },
  16159. repo: {
  16160. required: true,
  16161. type: "string"
  16162. }
  16163. },
  16164. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16165. },
  16166. removeLabel: {
  16167. method: "DELETE",
  16168. params: {
  16169. issue_number: {
  16170. required: true,
  16171. type: "integer"
  16172. },
  16173. name: {
  16174. required: true,
  16175. type: "string"
  16176. },
  16177. number: {
  16178. alias: "issue_number",
  16179. deprecated: true,
  16180. type: "integer"
  16181. },
  16182. owner: {
  16183. required: true,
  16184. type: "string"
  16185. },
  16186. repo: {
  16187. required: true,
  16188. type: "string"
  16189. }
  16190. },
  16191. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16192. },
  16193. removeLabels: {
  16194. method: "DELETE",
  16195. params: {
  16196. issue_number: {
  16197. required: true,
  16198. type: "integer"
  16199. },
  16200. number: {
  16201. alias: "issue_number",
  16202. deprecated: true,
  16203. type: "integer"
  16204. },
  16205. owner: {
  16206. required: true,
  16207. type: "string"
  16208. },
  16209. repo: {
  16210. required: true,
  16211. type: "string"
  16212. }
  16213. },
  16214. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16215. },
  16216. replaceLabels: {
  16217. method: "PUT",
  16218. params: {
  16219. issue_number: {
  16220. required: true,
  16221. type: "integer"
  16222. },
  16223. labels: {
  16224. type: "string[]"
  16225. },
  16226. number: {
  16227. alias: "issue_number",
  16228. deprecated: true,
  16229. type: "integer"
  16230. },
  16231. owner: {
  16232. required: true,
  16233. type: "string"
  16234. },
  16235. repo: {
  16236. required: true,
  16237. type: "string"
  16238. }
  16239. },
  16240. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16241. },
  16242. unlock: {
  16243. method: "DELETE",
  16244. params: {
  16245. issue_number: {
  16246. required: true,
  16247. type: "integer"
  16248. },
  16249. number: {
  16250. alias: "issue_number",
  16251. deprecated: true,
  16252. type: "integer"
  16253. },
  16254. owner: {
  16255. required: true,
  16256. type: "string"
  16257. },
  16258. repo: {
  16259. required: true,
  16260. type: "string"
  16261. }
  16262. },
  16263. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16264. },
  16265. update: {
  16266. method: "PATCH",
  16267. params: {
  16268. assignee: {
  16269. type: "string"
  16270. },
  16271. assignees: {
  16272. type: "string[]"
  16273. },
  16274. body: {
  16275. type: "string"
  16276. },
  16277. issue_number: {
  16278. required: true,
  16279. type: "integer"
  16280. },
  16281. labels: {
  16282. type: "string[]"
  16283. },
  16284. milestone: {
  16285. allowNull: true,
  16286. type: "integer"
  16287. },
  16288. number: {
  16289. alias: "issue_number",
  16290. deprecated: true,
  16291. type: "integer"
  16292. },
  16293. owner: {
  16294. required: true,
  16295. type: "string"
  16296. },
  16297. repo: {
  16298. required: true,
  16299. type: "string"
  16300. },
  16301. state: {
  16302. enum: ["open", "closed"],
  16303. type: "string"
  16304. },
  16305. title: {
  16306. type: "string"
  16307. }
  16308. },
  16309. url: "/repos/:owner/:repo/issues/:issue_number"
  16310. },
  16311. updateComment: {
  16312. method: "PATCH",
  16313. params: {
  16314. body: {
  16315. required: true,
  16316. type: "string"
  16317. },
  16318. comment_id: {
  16319. required: true,
  16320. type: "integer"
  16321. },
  16322. owner: {
  16323. required: true,
  16324. type: "string"
  16325. },
  16326. repo: {
  16327. required: true,
  16328. type: "string"
  16329. }
  16330. },
  16331. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16332. },
  16333. updateLabel: {
  16334. method: "PATCH",
  16335. params: {
  16336. color: {
  16337. type: "string"
  16338. },
  16339. current_name: {
  16340. required: true,
  16341. type: "string"
  16342. },
  16343. description: {
  16344. type: "string"
  16345. },
  16346. name: {
  16347. type: "string"
  16348. },
  16349. owner: {
  16350. required: true,
  16351. type: "string"
  16352. },
  16353. repo: {
  16354. required: true,
  16355. type: "string"
  16356. }
  16357. },
  16358. url: "/repos/:owner/:repo/labels/:current_name"
  16359. },
  16360. updateMilestone: {
  16361. method: "PATCH",
  16362. params: {
  16363. description: {
  16364. type: "string"
  16365. },
  16366. due_on: {
  16367. type: "string"
  16368. },
  16369. milestone_number: {
  16370. required: true,
  16371. type: "integer"
  16372. },
  16373. number: {
  16374. alias: "milestone_number",
  16375. deprecated: true,
  16376. type: "integer"
  16377. },
  16378. owner: {
  16379. required: true,
  16380. type: "string"
  16381. },
  16382. repo: {
  16383. required: true,
  16384. type: "string"
  16385. },
  16386. state: {
  16387. enum: ["open", "closed"],
  16388. type: "string"
  16389. },
  16390. title: {
  16391. type: "string"
  16392. }
  16393. },
  16394. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16395. }
  16396. },
  16397. licenses: {
  16398. get: {
  16399. method: "GET",
  16400. params: {
  16401. license: {
  16402. required: true,
  16403. type: "string"
  16404. }
  16405. },
  16406. url: "/licenses/:license"
  16407. },
  16408. getForRepo: {
  16409. method: "GET",
  16410. params: {
  16411. owner: {
  16412. required: true,
  16413. type: "string"
  16414. },
  16415. repo: {
  16416. required: true,
  16417. type: "string"
  16418. }
  16419. },
  16420. url: "/repos/:owner/:repo/license"
  16421. },
  16422. list: {
  16423. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16424. method: "GET",
  16425. params: {},
  16426. url: "/licenses"
  16427. },
  16428. listCommonlyUsed: {
  16429. method: "GET",
  16430. params: {},
  16431. url: "/licenses"
  16432. }
  16433. },
  16434. markdown: {
  16435. render: {
  16436. method: "POST",
  16437. params: {
  16438. context: {
  16439. type: "string"
  16440. },
  16441. mode: {
  16442. enum: ["markdown", "gfm"],
  16443. type: "string"
  16444. },
  16445. text: {
  16446. required: true,
  16447. type: "string"
  16448. }
  16449. },
  16450. url: "/markdown"
  16451. },
  16452. renderRaw: {
  16453. headers: {
  16454. "content-type": "text/plain; charset=utf-8"
  16455. },
  16456. method: "POST",
  16457. params: {
  16458. data: {
  16459. mapTo: "data",
  16460. required: true,
  16461. type: "string"
  16462. }
  16463. },
  16464. url: "/markdown/raw"
  16465. }
  16466. },
  16467. meta: {
  16468. get: {
  16469. method: "GET",
  16470. params: {},
  16471. url: "/meta"
  16472. }
  16473. },
  16474. migrations: {
  16475. cancelImport: {
  16476. method: "DELETE",
  16477. params: {
  16478. owner: {
  16479. required: true,
  16480. type: "string"
  16481. },
  16482. repo: {
  16483. required: true,
  16484. type: "string"
  16485. }
  16486. },
  16487. url: "/repos/:owner/:repo/import"
  16488. },
  16489. deleteArchiveForAuthenticatedUser: {
  16490. headers: {
  16491. accept: "application/vnd.github.wyandotte-preview+json"
  16492. },
  16493. method: "DELETE",
  16494. params: {
  16495. migration_id: {
  16496. required: true,
  16497. type: "integer"
  16498. }
  16499. },
  16500. url: "/user/migrations/:migration_id/archive"
  16501. },
  16502. deleteArchiveForOrg: {
  16503. headers: {
  16504. accept: "application/vnd.github.wyandotte-preview+json"
  16505. },
  16506. method: "DELETE",
  16507. params: {
  16508. migration_id: {
  16509. required: true,
  16510. type: "integer"
  16511. },
  16512. org: {
  16513. required: true,
  16514. type: "string"
  16515. }
  16516. },
  16517. url: "/orgs/:org/migrations/:migration_id/archive"
  16518. },
  16519. downloadArchiveForOrg: {
  16520. headers: {
  16521. accept: "application/vnd.github.wyandotte-preview+json"
  16522. },
  16523. method: "GET",
  16524. params: {
  16525. migration_id: {
  16526. required: true,
  16527. type: "integer"
  16528. },
  16529. org: {
  16530. required: true,
  16531. type: "string"
  16532. }
  16533. },
  16534. url: "/orgs/:org/migrations/:migration_id/archive"
  16535. },
  16536. getArchiveForAuthenticatedUser: {
  16537. headers: {
  16538. accept: "application/vnd.github.wyandotte-preview+json"
  16539. },
  16540. method: "GET",
  16541. params: {
  16542. migration_id: {
  16543. required: true,
  16544. type: "integer"
  16545. }
  16546. },
  16547. url: "/user/migrations/:migration_id/archive"
  16548. },
  16549. getArchiveForOrg: {
  16550. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16551. headers: {
  16552. accept: "application/vnd.github.wyandotte-preview+json"
  16553. },
  16554. method: "GET",
  16555. params: {
  16556. migration_id: {
  16557. required: true,
  16558. type: "integer"
  16559. },
  16560. org: {
  16561. required: true,
  16562. type: "string"
  16563. }
  16564. },
  16565. url: "/orgs/:org/migrations/:migration_id/archive"
  16566. },
  16567. getCommitAuthors: {
  16568. method: "GET",
  16569. params: {
  16570. owner: {
  16571. required: true,
  16572. type: "string"
  16573. },
  16574. repo: {
  16575. required: true,
  16576. type: "string"
  16577. },
  16578. since: {
  16579. type: "string"
  16580. }
  16581. },
  16582. url: "/repos/:owner/:repo/import/authors"
  16583. },
  16584. getImportProgress: {
  16585. method: "GET",
  16586. params: {
  16587. owner: {
  16588. required: true,
  16589. type: "string"
  16590. },
  16591. repo: {
  16592. required: true,
  16593. type: "string"
  16594. }
  16595. },
  16596. url: "/repos/:owner/:repo/import"
  16597. },
  16598. getLargeFiles: {
  16599. method: "GET",
  16600. params: {
  16601. owner: {
  16602. required: true,
  16603. type: "string"
  16604. },
  16605. repo: {
  16606. required: true,
  16607. type: "string"
  16608. }
  16609. },
  16610. url: "/repos/:owner/:repo/import/large_files"
  16611. },
  16612. getStatusForAuthenticatedUser: {
  16613. headers: {
  16614. accept: "application/vnd.github.wyandotte-preview+json"
  16615. },
  16616. method: "GET",
  16617. params: {
  16618. migration_id: {
  16619. required: true,
  16620. type: "integer"
  16621. }
  16622. },
  16623. url: "/user/migrations/:migration_id"
  16624. },
  16625. getStatusForOrg: {
  16626. headers: {
  16627. accept: "application/vnd.github.wyandotte-preview+json"
  16628. },
  16629. method: "GET",
  16630. params: {
  16631. migration_id: {
  16632. required: true,
  16633. type: "integer"
  16634. },
  16635. org: {
  16636. required: true,
  16637. type: "string"
  16638. }
  16639. },
  16640. url: "/orgs/:org/migrations/:migration_id"
  16641. },
  16642. listForAuthenticatedUser: {
  16643. headers: {
  16644. accept: "application/vnd.github.wyandotte-preview+json"
  16645. },
  16646. method: "GET",
  16647. params: {
  16648. page: {
  16649. type: "integer"
  16650. },
  16651. per_page: {
  16652. type: "integer"
  16653. }
  16654. },
  16655. url: "/user/migrations"
  16656. },
  16657. listForOrg: {
  16658. headers: {
  16659. accept: "application/vnd.github.wyandotte-preview+json"
  16660. },
  16661. method: "GET",
  16662. params: {
  16663. org: {
  16664. required: true,
  16665. type: "string"
  16666. },
  16667. page: {
  16668. type: "integer"
  16669. },
  16670. per_page: {
  16671. type: "integer"
  16672. }
  16673. },
  16674. url: "/orgs/:org/migrations"
  16675. },
  16676. listReposForOrg: {
  16677. headers: {
  16678. accept: "application/vnd.github.wyandotte-preview+json"
  16679. },
  16680. method: "GET",
  16681. params: {
  16682. migration_id: {
  16683. required: true,
  16684. type: "integer"
  16685. },
  16686. org: {
  16687. required: true,
  16688. type: "string"
  16689. },
  16690. page: {
  16691. type: "integer"
  16692. },
  16693. per_page: {
  16694. type: "integer"
  16695. }
  16696. },
  16697. url: "/orgs/:org/migrations/:migration_id/repositories"
  16698. },
  16699. listReposForUser: {
  16700. headers: {
  16701. accept: "application/vnd.github.wyandotte-preview+json"
  16702. },
  16703. method: "GET",
  16704. params: {
  16705. migration_id: {
  16706. required: true,
  16707. type: "integer"
  16708. },
  16709. page: {
  16710. type: "integer"
  16711. },
  16712. per_page: {
  16713. type: "integer"
  16714. }
  16715. },
  16716. url: "/user/:migration_id/repositories"
  16717. },
  16718. mapCommitAuthor: {
  16719. method: "PATCH",
  16720. params: {
  16721. author_id: {
  16722. required: true,
  16723. type: "integer"
  16724. },
  16725. email: {
  16726. type: "string"
  16727. },
  16728. name: {
  16729. type: "string"
  16730. },
  16731. owner: {
  16732. required: true,
  16733. type: "string"
  16734. },
  16735. repo: {
  16736. required: true,
  16737. type: "string"
  16738. }
  16739. },
  16740. url: "/repos/:owner/:repo/import/authors/:author_id"
  16741. },
  16742. setLfsPreference: {
  16743. method: "PATCH",
  16744. params: {
  16745. owner: {
  16746. required: true,
  16747. type: "string"
  16748. },
  16749. repo: {
  16750. required: true,
  16751. type: "string"
  16752. },
  16753. use_lfs: {
  16754. enum: ["opt_in", "opt_out"],
  16755. required: true,
  16756. type: "string"
  16757. }
  16758. },
  16759. url: "/repos/:owner/:repo/import/lfs"
  16760. },
  16761. startForAuthenticatedUser: {
  16762. method: "POST",
  16763. params: {
  16764. exclude_attachments: {
  16765. type: "boolean"
  16766. },
  16767. lock_repositories: {
  16768. type: "boolean"
  16769. },
  16770. repositories: {
  16771. required: true,
  16772. type: "string[]"
  16773. }
  16774. },
  16775. url: "/user/migrations"
  16776. },
  16777. startForOrg: {
  16778. method: "POST",
  16779. params: {
  16780. exclude_attachments: {
  16781. type: "boolean"
  16782. },
  16783. lock_repositories: {
  16784. type: "boolean"
  16785. },
  16786. org: {
  16787. required: true,
  16788. type: "string"
  16789. },
  16790. repositories: {
  16791. required: true,
  16792. type: "string[]"
  16793. }
  16794. },
  16795. url: "/orgs/:org/migrations"
  16796. },
  16797. startImport: {
  16798. method: "PUT",
  16799. params: {
  16800. owner: {
  16801. required: true,
  16802. type: "string"
  16803. },
  16804. repo: {
  16805. required: true,
  16806. type: "string"
  16807. },
  16808. tfvc_project: {
  16809. type: "string"
  16810. },
  16811. vcs: {
  16812. enum: ["subversion", "git", "mercurial", "tfvc"],
  16813. type: "string"
  16814. },
  16815. vcs_password: {
  16816. type: "string"
  16817. },
  16818. vcs_url: {
  16819. required: true,
  16820. type: "string"
  16821. },
  16822. vcs_username: {
  16823. type: "string"
  16824. }
  16825. },
  16826. url: "/repos/:owner/:repo/import"
  16827. },
  16828. unlockRepoForAuthenticatedUser: {
  16829. headers: {
  16830. accept: "application/vnd.github.wyandotte-preview+json"
  16831. },
  16832. method: "DELETE",
  16833. params: {
  16834. migration_id: {
  16835. required: true,
  16836. type: "integer"
  16837. },
  16838. repo_name: {
  16839. required: true,
  16840. type: "string"
  16841. }
  16842. },
  16843. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  16844. },
  16845. unlockRepoForOrg: {
  16846. headers: {
  16847. accept: "application/vnd.github.wyandotte-preview+json"
  16848. },
  16849. method: "DELETE",
  16850. params: {
  16851. migration_id: {
  16852. required: true,
  16853. type: "integer"
  16854. },
  16855. org: {
  16856. required: true,
  16857. type: "string"
  16858. },
  16859. repo_name: {
  16860. required: true,
  16861. type: "string"
  16862. }
  16863. },
  16864. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  16865. },
  16866. updateImport: {
  16867. method: "PATCH",
  16868. params: {
  16869. owner: {
  16870. required: true,
  16871. type: "string"
  16872. },
  16873. repo: {
  16874. required: true,
  16875. type: "string"
  16876. },
  16877. vcs_password: {
  16878. type: "string"
  16879. },
  16880. vcs_username: {
  16881. type: "string"
  16882. }
  16883. },
  16884. url: "/repos/:owner/:repo/import"
  16885. }
  16886. },
  16887. oauthAuthorizations: {
  16888. checkAuthorization: {
  16889. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  16890. method: "GET",
  16891. params: {
  16892. access_token: {
  16893. required: true,
  16894. type: "string"
  16895. },
  16896. client_id: {
  16897. required: true,
  16898. type: "string"
  16899. }
  16900. },
  16901. url: "/applications/:client_id/tokens/:access_token"
  16902. },
  16903. createAuthorization: {
  16904. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  16905. method: "POST",
  16906. params: {
  16907. client_id: {
  16908. type: "string"
  16909. },
  16910. client_secret: {
  16911. type: "string"
  16912. },
  16913. fingerprint: {
  16914. type: "string"
  16915. },
  16916. note: {
  16917. required: true,
  16918. type: "string"
  16919. },
  16920. note_url: {
  16921. type: "string"
  16922. },
  16923. scopes: {
  16924. type: "string[]"
  16925. }
  16926. },
  16927. url: "/authorizations"
  16928. },
  16929. deleteAuthorization: {
  16930. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  16931. method: "DELETE",
  16932. params: {
  16933. authorization_id: {
  16934. required: true,
  16935. type: "integer"
  16936. }
  16937. },
  16938. url: "/authorizations/:authorization_id"
  16939. },
  16940. deleteGrant: {
  16941. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  16942. method: "DELETE",
  16943. params: {
  16944. grant_id: {
  16945. required: true,
  16946. type: "integer"
  16947. }
  16948. },
  16949. url: "/applications/grants/:grant_id"
  16950. },
  16951. getAuthorization: {
  16952. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  16953. method: "GET",
  16954. params: {
  16955. authorization_id: {
  16956. required: true,
  16957. type: "integer"
  16958. }
  16959. },
  16960. url: "/authorizations/:authorization_id"
  16961. },
  16962. getGrant: {
  16963. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  16964. method: "GET",
  16965. params: {
  16966. grant_id: {
  16967. required: true,
  16968. type: "integer"
  16969. }
  16970. },
  16971. url: "/applications/grants/:grant_id"
  16972. },
  16973. getOrCreateAuthorizationForApp: {
  16974. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  16975. method: "PUT",
  16976. params: {
  16977. client_id: {
  16978. required: true,
  16979. type: "string"
  16980. },
  16981. client_secret: {
  16982. required: true,
  16983. type: "string"
  16984. },
  16985. fingerprint: {
  16986. type: "string"
  16987. },
  16988. note: {
  16989. type: "string"
  16990. },
  16991. note_url: {
  16992. type: "string"
  16993. },
  16994. scopes: {
  16995. type: "string[]"
  16996. }
  16997. },
  16998. url: "/authorizations/clients/:client_id"
  16999. },
  17000. getOrCreateAuthorizationForAppAndFingerprint: {
  17001. 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",
  17002. method: "PUT",
  17003. params: {
  17004. client_id: {
  17005. required: true,
  17006. type: "string"
  17007. },
  17008. client_secret: {
  17009. required: true,
  17010. type: "string"
  17011. },
  17012. fingerprint: {
  17013. required: true,
  17014. type: "string"
  17015. },
  17016. note: {
  17017. type: "string"
  17018. },
  17019. note_url: {
  17020. type: "string"
  17021. },
  17022. scopes: {
  17023. type: "string[]"
  17024. }
  17025. },
  17026. url: "/authorizations/clients/:client_id/:fingerprint"
  17027. },
  17028. getOrCreateAuthorizationForAppFingerprint: {
  17029. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17030. method: "PUT",
  17031. params: {
  17032. client_id: {
  17033. required: true,
  17034. type: "string"
  17035. },
  17036. client_secret: {
  17037. required: true,
  17038. type: "string"
  17039. },
  17040. fingerprint: {
  17041. required: true,
  17042. type: "string"
  17043. },
  17044. note: {
  17045. type: "string"
  17046. },
  17047. note_url: {
  17048. type: "string"
  17049. },
  17050. scopes: {
  17051. type: "string[]"
  17052. }
  17053. },
  17054. url: "/authorizations/clients/:client_id/:fingerprint"
  17055. },
  17056. listAuthorizations: {
  17057. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17058. method: "GET",
  17059. params: {
  17060. page: {
  17061. type: "integer"
  17062. },
  17063. per_page: {
  17064. type: "integer"
  17065. }
  17066. },
  17067. url: "/authorizations"
  17068. },
  17069. listGrants: {
  17070. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17071. method: "GET",
  17072. params: {
  17073. page: {
  17074. type: "integer"
  17075. },
  17076. per_page: {
  17077. type: "integer"
  17078. }
  17079. },
  17080. url: "/applications/grants"
  17081. },
  17082. resetAuthorization: {
  17083. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17084. method: "POST",
  17085. params: {
  17086. access_token: {
  17087. required: true,
  17088. type: "string"
  17089. },
  17090. client_id: {
  17091. required: true,
  17092. type: "string"
  17093. }
  17094. },
  17095. url: "/applications/:client_id/tokens/:access_token"
  17096. },
  17097. revokeAuthorizationForApplication: {
  17098. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17099. method: "DELETE",
  17100. params: {
  17101. access_token: {
  17102. required: true,
  17103. type: "string"
  17104. },
  17105. client_id: {
  17106. required: true,
  17107. type: "string"
  17108. }
  17109. },
  17110. url: "/applications/:client_id/tokens/:access_token"
  17111. },
  17112. revokeGrantForApplication: {
  17113. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17114. method: "DELETE",
  17115. params: {
  17116. access_token: {
  17117. required: true,
  17118. type: "string"
  17119. },
  17120. client_id: {
  17121. required: true,
  17122. type: "string"
  17123. }
  17124. },
  17125. url: "/applications/:client_id/grants/:access_token"
  17126. },
  17127. updateAuthorization: {
  17128. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17129. method: "PATCH",
  17130. params: {
  17131. add_scopes: {
  17132. type: "string[]"
  17133. },
  17134. authorization_id: {
  17135. required: true,
  17136. type: "integer"
  17137. },
  17138. fingerprint: {
  17139. type: "string"
  17140. },
  17141. note: {
  17142. type: "string"
  17143. },
  17144. note_url: {
  17145. type: "string"
  17146. },
  17147. remove_scopes: {
  17148. type: "string[]"
  17149. },
  17150. scopes: {
  17151. type: "string[]"
  17152. }
  17153. },
  17154. url: "/authorizations/:authorization_id"
  17155. }
  17156. },
  17157. orgs: {
  17158. addOrUpdateMembership: {
  17159. method: "PUT",
  17160. params: {
  17161. org: {
  17162. required: true,
  17163. type: "string"
  17164. },
  17165. role: {
  17166. enum: ["admin", "member"],
  17167. type: "string"
  17168. },
  17169. username: {
  17170. required: true,
  17171. type: "string"
  17172. }
  17173. },
  17174. url: "/orgs/:org/memberships/:username"
  17175. },
  17176. blockUser: {
  17177. method: "PUT",
  17178. params: {
  17179. org: {
  17180. required: true,
  17181. type: "string"
  17182. },
  17183. username: {
  17184. required: true,
  17185. type: "string"
  17186. }
  17187. },
  17188. url: "/orgs/:org/blocks/:username"
  17189. },
  17190. checkBlockedUser: {
  17191. method: "GET",
  17192. params: {
  17193. org: {
  17194. required: true,
  17195. type: "string"
  17196. },
  17197. username: {
  17198. required: true,
  17199. type: "string"
  17200. }
  17201. },
  17202. url: "/orgs/:org/blocks/:username"
  17203. },
  17204. checkMembership: {
  17205. method: "GET",
  17206. params: {
  17207. org: {
  17208. required: true,
  17209. type: "string"
  17210. },
  17211. username: {
  17212. required: true,
  17213. type: "string"
  17214. }
  17215. },
  17216. url: "/orgs/:org/members/:username"
  17217. },
  17218. checkPublicMembership: {
  17219. method: "GET",
  17220. params: {
  17221. org: {
  17222. required: true,
  17223. type: "string"
  17224. },
  17225. username: {
  17226. required: true,
  17227. type: "string"
  17228. }
  17229. },
  17230. url: "/orgs/:org/public_members/:username"
  17231. },
  17232. concealMembership: {
  17233. method: "DELETE",
  17234. params: {
  17235. org: {
  17236. required: true,
  17237. type: "string"
  17238. },
  17239. username: {
  17240. required: true,
  17241. type: "string"
  17242. }
  17243. },
  17244. url: "/orgs/:org/public_members/:username"
  17245. },
  17246. convertMemberToOutsideCollaborator: {
  17247. method: "PUT",
  17248. params: {
  17249. org: {
  17250. required: true,
  17251. type: "string"
  17252. },
  17253. username: {
  17254. required: true,
  17255. type: "string"
  17256. }
  17257. },
  17258. url: "/orgs/:org/outside_collaborators/:username"
  17259. },
  17260. createHook: {
  17261. method: "POST",
  17262. params: {
  17263. active: {
  17264. type: "boolean"
  17265. },
  17266. config: {
  17267. required: true,
  17268. type: "object"
  17269. },
  17270. "config.content_type": {
  17271. type: "string"
  17272. },
  17273. "config.insecure_ssl": {
  17274. type: "string"
  17275. },
  17276. "config.secret": {
  17277. type: "string"
  17278. },
  17279. "config.url": {
  17280. required: true,
  17281. type: "string"
  17282. },
  17283. events: {
  17284. type: "string[]"
  17285. },
  17286. name: {
  17287. required: true,
  17288. type: "string"
  17289. },
  17290. org: {
  17291. required: true,
  17292. type: "string"
  17293. }
  17294. },
  17295. url: "/orgs/:org/hooks"
  17296. },
  17297. createInvitation: {
  17298. method: "POST",
  17299. params: {
  17300. email: {
  17301. type: "string"
  17302. },
  17303. invitee_id: {
  17304. type: "integer"
  17305. },
  17306. org: {
  17307. required: true,
  17308. type: "string"
  17309. },
  17310. role: {
  17311. enum: ["admin", "direct_member", "billing_manager"],
  17312. type: "string"
  17313. },
  17314. team_ids: {
  17315. type: "integer[]"
  17316. }
  17317. },
  17318. url: "/orgs/:org/invitations"
  17319. },
  17320. deleteHook: {
  17321. method: "DELETE",
  17322. params: {
  17323. hook_id: {
  17324. required: true,
  17325. type: "integer"
  17326. },
  17327. org: {
  17328. required: true,
  17329. type: "string"
  17330. }
  17331. },
  17332. url: "/orgs/:org/hooks/:hook_id"
  17333. },
  17334. get: {
  17335. method: "GET",
  17336. params: {
  17337. org: {
  17338. required: true,
  17339. type: "string"
  17340. }
  17341. },
  17342. url: "/orgs/:org"
  17343. },
  17344. getHook: {
  17345. method: "GET",
  17346. params: {
  17347. hook_id: {
  17348. required: true,
  17349. type: "integer"
  17350. },
  17351. org: {
  17352. required: true,
  17353. type: "string"
  17354. }
  17355. },
  17356. url: "/orgs/:org/hooks/:hook_id"
  17357. },
  17358. getMembership: {
  17359. method: "GET",
  17360. params: {
  17361. org: {
  17362. required: true,
  17363. type: "string"
  17364. },
  17365. username: {
  17366. required: true,
  17367. type: "string"
  17368. }
  17369. },
  17370. url: "/orgs/:org/memberships/:username"
  17371. },
  17372. getMembershipForAuthenticatedUser: {
  17373. method: "GET",
  17374. params: {
  17375. org: {
  17376. required: true,
  17377. type: "string"
  17378. }
  17379. },
  17380. url: "/user/memberships/orgs/:org"
  17381. },
  17382. list: {
  17383. method: "GET",
  17384. params: {
  17385. page: {
  17386. type: "integer"
  17387. },
  17388. per_page: {
  17389. type: "integer"
  17390. },
  17391. since: {
  17392. type: "integer"
  17393. }
  17394. },
  17395. url: "/organizations"
  17396. },
  17397. listBlockedUsers: {
  17398. method: "GET",
  17399. params: {
  17400. org: {
  17401. required: true,
  17402. type: "string"
  17403. }
  17404. },
  17405. url: "/orgs/:org/blocks"
  17406. },
  17407. listForAuthenticatedUser: {
  17408. method: "GET",
  17409. params: {
  17410. page: {
  17411. type: "integer"
  17412. },
  17413. per_page: {
  17414. type: "integer"
  17415. }
  17416. },
  17417. url: "/user/orgs"
  17418. },
  17419. listForUser: {
  17420. method: "GET",
  17421. params: {
  17422. page: {
  17423. type: "integer"
  17424. },
  17425. per_page: {
  17426. type: "integer"
  17427. },
  17428. username: {
  17429. required: true,
  17430. type: "string"
  17431. }
  17432. },
  17433. url: "/users/:username/orgs"
  17434. },
  17435. listHooks: {
  17436. method: "GET",
  17437. params: {
  17438. org: {
  17439. required: true,
  17440. type: "string"
  17441. },
  17442. page: {
  17443. type: "integer"
  17444. },
  17445. per_page: {
  17446. type: "integer"
  17447. }
  17448. },
  17449. url: "/orgs/:org/hooks"
  17450. },
  17451. listInstallations: {
  17452. headers: {
  17453. accept: "application/vnd.github.machine-man-preview+json"
  17454. },
  17455. method: "GET",
  17456. params: {
  17457. org: {
  17458. required: true,
  17459. type: "string"
  17460. },
  17461. page: {
  17462. type: "integer"
  17463. },
  17464. per_page: {
  17465. type: "integer"
  17466. }
  17467. },
  17468. url: "/orgs/:org/installations"
  17469. },
  17470. listInvitationTeams: {
  17471. method: "GET",
  17472. params: {
  17473. invitation_id: {
  17474. required: true,
  17475. type: "integer"
  17476. },
  17477. org: {
  17478. required: true,
  17479. type: "string"
  17480. },
  17481. page: {
  17482. type: "integer"
  17483. },
  17484. per_page: {
  17485. type: "integer"
  17486. }
  17487. },
  17488. url: "/orgs/:org/invitations/:invitation_id/teams"
  17489. },
  17490. listMembers: {
  17491. method: "GET",
  17492. params: {
  17493. filter: {
  17494. enum: ["2fa_disabled", "all"],
  17495. type: "string"
  17496. },
  17497. org: {
  17498. required: true,
  17499. type: "string"
  17500. },
  17501. page: {
  17502. type: "integer"
  17503. },
  17504. per_page: {
  17505. type: "integer"
  17506. },
  17507. role: {
  17508. enum: ["all", "admin", "member"],
  17509. type: "string"
  17510. }
  17511. },
  17512. url: "/orgs/:org/members"
  17513. },
  17514. listMemberships: {
  17515. method: "GET",
  17516. params: {
  17517. page: {
  17518. type: "integer"
  17519. },
  17520. per_page: {
  17521. type: "integer"
  17522. },
  17523. state: {
  17524. enum: ["active", "pending"],
  17525. type: "string"
  17526. }
  17527. },
  17528. url: "/user/memberships/orgs"
  17529. },
  17530. listOutsideCollaborators: {
  17531. method: "GET",
  17532. params: {
  17533. filter: {
  17534. enum: ["2fa_disabled", "all"],
  17535. type: "string"
  17536. },
  17537. org: {
  17538. required: true,
  17539. type: "string"
  17540. },
  17541. page: {
  17542. type: "integer"
  17543. },
  17544. per_page: {
  17545. type: "integer"
  17546. }
  17547. },
  17548. url: "/orgs/:org/outside_collaborators"
  17549. },
  17550. listPendingInvitations: {
  17551. method: "GET",
  17552. params: {
  17553. org: {
  17554. required: true,
  17555. type: "string"
  17556. },
  17557. page: {
  17558. type: "integer"
  17559. },
  17560. per_page: {
  17561. type: "integer"
  17562. }
  17563. },
  17564. url: "/orgs/:org/invitations"
  17565. },
  17566. listPublicMembers: {
  17567. method: "GET",
  17568. params: {
  17569. org: {
  17570. required: true,
  17571. type: "string"
  17572. },
  17573. page: {
  17574. type: "integer"
  17575. },
  17576. per_page: {
  17577. type: "integer"
  17578. }
  17579. },
  17580. url: "/orgs/:org/public_members"
  17581. },
  17582. pingHook: {
  17583. method: "POST",
  17584. params: {
  17585. hook_id: {
  17586. required: true,
  17587. type: "integer"
  17588. },
  17589. org: {
  17590. required: true,
  17591. type: "string"
  17592. }
  17593. },
  17594. url: "/orgs/:org/hooks/:hook_id/pings"
  17595. },
  17596. publicizeMembership: {
  17597. method: "PUT",
  17598. params: {
  17599. org: {
  17600. required: true,
  17601. type: "string"
  17602. },
  17603. username: {
  17604. required: true,
  17605. type: "string"
  17606. }
  17607. },
  17608. url: "/orgs/:org/public_members/:username"
  17609. },
  17610. removeMember: {
  17611. method: "DELETE",
  17612. params: {
  17613. org: {
  17614. required: true,
  17615. type: "string"
  17616. },
  17617. username: {
  17618. required: true,
  17619. type: "string"
  17620. }
  17621. },
  17622. url: "/orgs/:org/members/:username"
  17623. },
  17624. removeMembership: {
  17625. method: "DELETE",
  17626. params: {
  17627. org: {
  17628. required: true,
  17629. type: "string"
  17630. },
  17631. username: {
  17632. required: true,
  17633. type: "string"
  17634. }
  17635. },
  17636. url: "/orgs/:org/memberships/:username"
  17637. },
  17638. removeOutsideCollaborator: {
  17639. method: "DELETE",
  17640. params: {
  17641. org: {
  17642. required: true,
  17643. type: "string"
  17644. },
  17645. username: {
  17646. required: true,
  17647. type: "string"
  17648. }
  17649. },
  17650. url: "/orgs/:org/outside_collaborators/:username"
  17651. },
  17652. unblockUser: {
  17653. method: "DELETE",
  17654. params: {
  17655. org: {
  17656. required: true,
  17657. type: "string"
  17658. },
  17659. username: {
  17660. required: true,
  17661. type: "string"
  17662. }
  17663. },
  17664. url: "/orgs/:org/blocks/:username"
  17665. },
  17666. update: {
  17667. method: "PATCH",
  17668. params: {
  17669. billing_email: {
  17670. type: "string"
  17671. },
  17672. company: {
  17673. type: "string"
  17674. },
  17675. default_repository_permission: {
  17676. enum: ["read", "write", "admin", "none"],
  17677. type: "string"
  17678. },
  17679. description: {
  17680. type: "string"
  17681. },
  17682. email: {
  17683. type: "string"
  17684. },
  17685. has_organization_projects: {
  17686. type: "boolean"
  17687. },
  17688. has_repository_projects: {
  17689. type: "boolean"
  17690. },
  17691. location: {
  17692. type: "string"
  17693. },
  17694. members_allowed_repository_creation_type: {
  17695. enum: ["all", "private", "none"],
  17696. type: "string"
  17697. },
  17698. members_can_create_internal_repositories: {
  17699. type: "boolean"
  17700. },
  17701. members_can_create_private_repositories: {
  17702. type: "boolean"
  17703. },
  17704. members_can_create_public_repositories: {
  17705. type: "boolean"
  17706. },
  17707. members_can_create_repositories: {
  17708. type: "boolean"
  17709. },
  17710. name: {
  17711. type: "string"
  17712. },
  17713. org: {
  17714. required: true,
  17715. type: "string"
  17716. }
  17717. },
  17718. url: "/orgs/:org"
  17719. },
  17720. updateHook: {
  17721. method: "PATCH",
  17722. params: {
  17723. active: {
  17724. type: "boolean"
  17725. },
  17726. config: {
  17727. type: "object"
  17728. },
  17729. "config.content_type": {
  17730. type: "string"
  17731. },
  17732. "config.insecure_ssl": {
  17733. type: "string"
  17734. },
  17735. "config.secret": {
  17736. type: "string"
  17737. },
  17738. "config.url": {
  17739. required: true,
  17740. type: "string"
  17741. },
  17742. events: {
  17743. type: "string[]"
  17744. },
  17745. hook_id: {
  17746. required: true,
  17747. type: "integer"
  17748. },
  17749. org: {
  17750. required: true,
  17751. type: "string"
  17752. }
  17753. },
  17754. url: "/orgs/:org/hooks/:hook_id"
  17755. },
  17756. updateMembership: {
  17757. method: "PATCH",
  17758. params: {
  17759. org: {
  17760. required: true,
  17761. type: "string"
  17762. },
  17763. state: {
  17764. enum: ["active"],
  17765. required: true,
  17766. type: "string"
  17767. }
  17768. },
  17769. url: "/user/memberships/orgs/:org"
  17770. }
  17771. },
  17772. projects: {
  17773. addCollaborator: {
  17774. headers: {
  17775. accept: "application/vnd.github.inertia-preview+json"
  17776. },
  17777. method: "PUT",
  17778. params: {
  17779. permission: {
  17780. enum: ["read", "write", "admin"],
  17781. type: "string"
  17782. },
  17783. project_id: {
  17784. required: true,
  17785. type: "integer"
  17786. },
  17787. username: {
  17788. required: true,
  17789. type: "string"
  17790. }
  17791. },
  17792. url: "/projects/:project_id/collaborators/:username"
  17793. },
  17794. createCard: {
  17795. headers: {
  17796. accept: "application/vnd.github.inertia-preview+json"
  17797. },
  17798. method: "POST",
  17799. params: {
  17800. column_id: {
  17801. required: true,
  17802. type: "integer"
  17803. },
  17804. content_id: {
  17805. type: "integer"
  17806. },
  17807. content_type: {
  17808. type: "string"
  17809. },
  17810. note: {
  17811. type: "string"
  17812. }
  17813. },
  17814. url: "/projects/columns/:column_id/cards"
  17815. },
  17816. createColumn: {
  17817. headers: {
  17818. accept: "application/vnd.github.inertia-preview+json"
  17819. },
  17820. method: "POST",
  17821. params: {
  17822. name: {
  17823. required: true,
  17824. type: "string"
  17825. },
  17826. project_id: {
  17827. required: true,
  17828. type: "integer"
  17829. }
  17830. },
  17831. url: "/projects/:project_id/columns"
  17832. },
  17833. createForAuthenticatedUser: {
  17834. headers: {
  17835. accept: "application/vnd.github.inertia-preview+json"
  17836. },
  17837. method: "POST",
  17838. params: {
  17839. body: {
  17840. type: "string"
  17841. },
  17842. name: {
  17843. required: true,
  17844. type: "string"
  17845. }
  17846. },
  17847. url: "/user/projects"
  17848. },
  17849. createForOrg: {
  17850. headers: {
  17851. accept: "application/vnd.github.inertia-preview+json"
  17852. },
  17853. method: "POST",
  17854. params: {
  17855. body: {
  17856. type: "string"
  17857. },
  17858. name: {
  17859. required: true,
  17860. type: "string"
  17861. },
  17862. org: {
  17863. required: true,
  17864. type: "string"
  17865. }
  17866. },
  17867. url: "/orgs/:org/projects"
  17868. },
  17869. createForRepo: {
  17870. headers: {
  17871. accept: "application/vnd.github.inertia-preview+json"
  17872. },
  17873. method: "POST",
  17874. params: {
  17875. body: {
  17876. type: "string"
  17877. },
  17878. name: {
  17879. required: true,
  17880. type: "string"
  17881. },
  17882. owner: {
  17883. required: true,
  17884. type: "string"
  17885. },
  17886. repo: {
  17887. required: true,
  17888. type: "string"
  17889. }
  17890. },
  17891. url: "/repos/:owner/:repo/projects"
  17892. },
  17893. delete: {
  17894. headers: {
  17895. accept: "application/vnd.github.inertia-preview+json"
  17896. },
  17897. method: "DELETE",
  17898. params: {
  17899. project_id: {
  17900. required: true,
  17901. type: "integer"
  17902. }
  17903. },
  17904. url: "/projects/:project_id"
  17905. },
  17906. deleteCard: {
  17907. headers: {
  17908. accept: "application/vnd.github.inertia-preview+json"
  17909. },
  17910. method: "DELETE",
  17911. params: {
  17912. card_id: {
  17913. required: true,
  17914. type: "integer"
  17915. }
  17916. },
  17917. url: "/projects/columns/cards/:card_id"
  17918. },
  17919. deleteColumn: {
  17920. headers: {
  17921. accept: "application/vnd.github.inertia-preview+json"
  17922. },
  17923. method: "DELETE",
  17924. params: {
  17925. column_id: {
  17926. required: true,
  17927. type: "integer"
  17928. }
  17929. },
  17930. url: "/projects/columns/:column_id"
  17931. },
  17932. get: {
  17933. headers: {
  17934. accept: "application/vnd.github.inertia-preview+json"
  17935. },
  17936. method: "GET",
  17937. params: {
  17938. project_id: {
  17939. required: true,
  17940. type: "integer"
  17941. }
  17942. },
  17943. url: "/projects/:project_id"
  17944. },
  17945. getCard: {
  17946. headers: {
  17947. accept: "application/vnd.github.inertia-preview+json"
  17948. },
  17949. method: "GET",
  17950. params: {
  17951. card_id: {
  17952. required: true,
  17953. type: "integer"
  17954. }
  17955. },
  17956. url: "/projects/columns/cards/:card_id"
  17957. },
  17958. getColumn: {
  17959. headers: {
  17960. accept: "application/vnd.github.inertia-preview+json"
  17961. },
  17962. method: "GET",
  17963. params: {
  17964. column_id: {
  17965. required: true,
  17966. type: "integer"
  17967. }
  17968. },
  17969. url: "/projects/columns/:column_id"
  17970. },
  17971. listCards: {
  17972. headers: {
  17973. accept: "application/vnd.github.inertia-preview+json"
  17974. },
  17975. method: "GET",
  17976. params: {
  17977. archived_state: {
  17978. enum: ["all", "archived", "not_archived"],
  17979. type: "string"
  17980. },
  17981. column_id: {
  17982. required: true,
  17983. type: "integer"
  17984. },
  17985. page: {
  17986. type: "integer"
  17987. },
  17988. per_page: {
  17989. type: "integer"
  17990. }
  17991. },
  17992. url: "/projects/columns/:column_id/cards"
  17993. },
  17994. listCollaborators: {
  17995. headers: {
  17996. accept: "application/vnd.github.inertia-preview+json"
  17997. },
  17998. method: "GET",
  17999. params: {
  18000. affiliation: {
  18001. enum: ["outside", "direct", "all"],
  18002. type: "string"
  18003. },
  18004. page: {
  18005. type: "integer"
  18006. },
  18007. per_page: {
  18008. type: "integer"
  18009. },
  18010. project_id: {
  18011. required: true,
  18012. type: "integer"
  18013. }
  18014. },
  18015. url: "/projects/:project_id/collaborators"
  18016. },
  18017. listColumns: {
  18018. headers: {
  18019. accept: "application/vnd.github.inertia-preview+json"
  18020. },
  18021. method: "GET",
  18022. params: {
  18023. page: {
  18024. type: "integer"
  18025. },
  18026. per_page: {
  18027. type: "integer"
  18028. },
  18029. project_id: {
  18030. required: true,
  18031. type: "integer"
  18032. }
  18033. },
  18034. url: "/projects/:project_id/columns"
  18035. },
  18036. listForOrg: {
  18037. headers: {
  18038. accept: "application/vnd.github.inertia-preview+json"
  18039. },
  18040. method: "GET",
  18041. params: {
  18042. org: {
  18043. required: true,
  18044. type: "string"
  18045. },
  18046. page: {
  18047. type: "integer"
  18048. },
  18049. per_page: {
  18050. type: "integer"
  18051. },
  18052. state: {
  18053. enum: ["open", "closed", "all"],
  18054. type: "string"
  18055. }
  18056. },
  18057. url: "/orgs/:org/projects"
  18058. },
  18059. listForRepo: {
  18060. headers: {
  18061. accept: "application/vnd.github.inertia-preview+json"
  18062. },
  18063. method: "GET",
  18064. params: {
  18065. owner: {
  18066. required: true,
  18067. type: "string"
  18068. },
  18069. page: {
  18070. type: "integer"
  18071. },
  18072. per_page: {
  18073. type: "integer"
  18074. },
  18075. repo: {
  18076. required: true,
  18077. type: "string"
  18078. },
  18079. state: {
  18080. enum: ["open", "closed", "all"],
  18081. type: "string"
  18082. }
  18083. },
  18084. url: "/repos/:owner/:repo/projects"
  18085. },
  18086. listForUser: {
  18087. headers: {
  18088. accept: "application/vnd.github.inertia-preview+json"
  18089. },
  18090. method: "GET",
  18091. params: {
  18092. page: {
  18093. type: "integer"
  18094. },
  18095. per_page: {
  18096. type: "integer"
  18097. },
  18098. state: {
  18099. enum: ["open", "closed", "all"],
  18100. type: "string"
  18101. },
  18102. username: {
  18103. required: true,
  18104. type: "string"
  18105. }
  18106. },
  18107. url: "/users/:username/projects"
  18108. },
  18109. moveCard: {
  18110. headers: {
  18111. accept: "application/vnd.github.inertia-preview+json"
  18112. },
  18113. method: "POST",
  18114. params: {
  18115. card_id: {
  18116. required: true,
  18117. type: "integer"
  18118. },
  18119. column_id: {
  18120. type: "integer"
  18121. },
  18122. position: {
  18123. required: true,
  18124. type: "string",
  18125. validation: "^(top|bottom|after:\\d+)$"
  18126. }
  18127. },
  18128. url: "/projects/columns/cards/:card_id/moves"
  18129. },
  18130. moveColumn: {
  18131. headers: {
  18132. accept: "application/vnd.github.inertia-preview+json"
  18133. },
  18134. method: "POST",
  18135. params: {
  18136. column_id: {
  18137. required: true,
  18138. type: "integer"
  18139. },
  18140. position: {
  18141. required: true,
  18142. type: "string",
  18143. validation: "^(first|last|after:\\d+)$"
  18144. }
  18145. },
  18146. url: "/projects/columns/:column_id/moves"
  18147. },
  18148. removeCollaborator: {
  18149. headers: {
  18150. accept: "application/vnd.github.inertia-preview+json"
  18151. },
  18152. method: "DELETE",
  18153. params: {
  18154. project_id: {
  18155. required: true,
  18156. type: "integer"
  18157. },
  18158. username: {
  18159. required: true,
  18160. type: "string"
  18161. }
  18162. },
  18163. url: "/projects/:project_id/collaborators/:username"
  18164. },
  18165. reviewUserPermissionLevel: {
  18166. headers: {
  18167. accept: "application/vnd.github.inertia-preview+json"
  18168. },
  18169. method: "GET",
  18170. params: {
  18171. project_id: {
  18172. required: true,
  18173. type: "integer"
  18174. },
  18175. username: {
  18176. required: true,
  18177. type: "string"
  18178. }
  18179. },
  18180. url: "/projects/:project_id/collaborators/:username/permission"
  18181. },
  18182. update: {
  18183. headers: {
  18184. accept: "application/vnd.github.inertia-preview+json"
  18185. },
  18186. method: "PATCH",
  18187. params: {
  18188. body: {
  18189. type: "string"
  18190. },
  18191. name: {
  18192. type: "string"
  18193. },
  18194. organization_permission: {
  18195. type: "string"
  18196. },
  18197. private: {
  18198. type: "boolean"
  18199. },
  18200. project_id: {
  18201. required: true,
  18202. type: "integer"
  18203. },
  18204. state: {
  18205. enum: ["open", "closed"],
  18206. type: "string"
  18207. }
  18208. },
  18209. url: "/projects/:project_id"
  18210. },
  18211. updateCard: {
  18212. headers: {
  18213. accept: "application/vnd.github.inertia-preview+json"
  18214. },
  18215. method: "PATCH",
  18216. params: {
  18217. archived: {
  18218. type: "boolean"
  18219. },
  18220. card_id: {
  18221. required: true,
  18222. type: "integer"
  18223. },
  18224. note: {
  18225. type: "string"
  18226. }
  18227. },
  18228. url: "/projects/columns/cards/:card_id"
  18229. },
  18230. updateColumn: {
  18231. headers: {
  18232. accept: "application/vnd.github.inertia-preview+json"
  18233. },
  18234. method: "PATCH",
  18235. params: {
  18236. column_id: {
  18237. required: true,
  18238. type: "integer"
  18239. },
  18240. name: {
  18241. required: true,
  18242. type: "string"
  18243. }
  18244. },
  18245. url: "/projects/columns/:column_id"
  18246. }
  18247. },
  18248. pulls: {
  18249. checkIfMerged: {
  18250. method: "GET",
  18251. params: {
  18252. number: {
  18253. alias: "pull_number",
  18254. deprecated: true,
  18255. type: "integer"
  18256. },
  18257. owner: {
  18258. required: true,
  18259. type: "string"
  18260. },
  18261. pull_number: {
  18262. required: true,
  18263. type: "integer"
  18264. },
  18265. repo: {
  18266. required: true,
  18267. type: "string"
  18268. }
  18269. },
  18270. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18271. },
  18272. create: {
  18273. method: "POST",
  18274. params: {
  18275. base: {
  18276. required: true,
  18277. type: "string"
  18278. },
  18279. body: {
  18280. type: "string"
  18281. },
  18282. draft: {
  18283. type: "boolean"
  18284. },
  18285. head: {
  18286. required: true,
  18287. type: "string"
  18288. },
  18289. maintainer_can_modify: {
  18290. type: "boolean"
  18291. },
  18292. owner: {
  18293. required: true,
  18294. type: "string"
  18295. },
  18296. repo: {
  18297. required: true,
  18298. type: "string"
  18299. },
  18300. title: {
  18301. required: true,
  18302. type: "string"
  18303. }
  18304. },
  18305. url: "/repos/:owner/:repo/pulls"
  18306. },
  18307. createComment: {
  18308. method: "POST",
  18309. params: {
  18310. body: {
  18311. required: true,
  18312. type: "string"
  18313. },
  18314. commit_id: {
  18315. required: true,
  18316. type: "string"
  18317. },
  18318. in_reply_to: {
  18319. deprecated: true,
  18320. 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.",
  18321. type: "integer"
  18322. },
  18323. line: {
  18324. type: "integer"
  18325. },
  18326. number: {
  18327. alias: "pull_number",
  18328. deprecated: true,
  18329. type: "integer"
  18330. },
  18331. owner: {
  18332. required: true,
  18333. type: "string"
  18334. },
  18335. path: {
  18336. required: true,
  18337. type: "string"
  18338. },
  18339. position: {
  18340. type: "integer"
  18341. },
  18342. pull_number: {
  18343. required: true,
  18344. type: "integer"
  18345. },
  18346. repo: {
  18347. required: true,
  18348. type: "string"
  18349. },
  18350. side: {
  18351. enum: ["LEFT", "RIGHT"],
  18352. type: "string"
  18353. },
  18354. start_line: {
  18355. type: "integer"
  18356. },
  18357. start_side: {
  18358. enum: ["LEFT", "RIGHT", "side"],
  18359. type: "string"
  18360. }
  18361. },
  18362. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18363. },
  18364. createCommentReply: {
  18365. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18366. method: "POST",
  18367. params: {
  18368. body: {
  18369. required: true,
  18370. type: "string"
  18371. },
  18372. commit_id: {
  18373. required: true,
  18374. type: "string"
  18375. },
  18376. in_reply_to: {
  18377. deprecated: true,
  18378. 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.",
  18379. type: "integer"
  18380. },
  18381. line: {
  18382. type: "integer"
  18383. },
  18384. number: {
  18385. alias: "pull_number",
  18386. deprecated: true,
  18387. type: "integer"
  18388. },
  18389. owner: {
  18390. required: true,
  18391. type: "string"
  18392. },
  18393. path: {
  18394. required: true,
  18395. type: "string"
  18396. },
  18397. position: {
  18398. type: "integer"
  18399. },
  18400. pull_number: {
  18401. required: true,
  18402. type: "integer"
  18403. },
  18404. repo: {
  18405. required: true,
  18406. type: "string"
  18407. },
  18408. side: {
  18409. enum: ["LEFT", "RIGHT"],
  18410. type: "string"
  18411. },
  18412. start_line: {
  18413. type: "integer"
  18414. },
  18415. start_side: {
  18416. enum: ["LEFT", "RIGHT", "side"],
  18417. type: "string"
  18418. }
  18419. },
  18420. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18421. },
  18422. createFromIssue: {
  18423. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18424. method: "POST",
  18425. params: {
  18426. base: {
  18427. required: true,
  18428. type: "string"
  18429. },
  18430. draft: {
  18431. type: "boolean"
  18432. },
  18433. head: {
  18434. required: true,
  18435. type: "string"
  18436. },
  18437. issue: {
  18438. required: true,
  18439. type: "integer"
  18440. },
  18441. maintainer_can_modify: {
  18442. type: "boolean"
  18443. },
  18444. owner: {
  18445. required: true,
  18446. type: "string"
  18447. },
  18448. repo: {
  18449. required: true,
  18450. type: "string"
  18451. }
  18452. },
  18453. url: "/repos/:owner/:repo/pulls"
  18454. },
  18455. createReview: {
  18456. method: "POST",
  18457. params: {
  18458. body: {
  18459. type: "string"
  18460. },
  18461. comments: {
  18462. type: "object[]"
  18463. },
  18464. "comments[].body": {
  18465. required: true,
  18466. type: "string"
  18467. },
  18468. "comments[].path": {
  18469. required: true,
  18470. type: "string"
  18471. },
  18472. "comments[].position": {
  18473. required: true,
  18474. type: "integer"
  18475. },
  18476. commit_id: {
  18477. type: "string"
  18478. },
  18479. event: {
  18480. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18481. type: "string"
  18482. },
  18483. number: {
  18484. alias: "pull_number",
  18485. deprecated: true,
  18486. type: "integer"
  18487. },
  18488. owner: {
  18489. required: true,
  18490. type: "string"
  18491. },
  18492. pull_number: {
  18493. required: true,
  18494. type: "integer"
  18495. },
  18496. repo: {
  18497. required: true,
  18498. type: "string"
  18499. }
  18500. },
  18501. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18502. },
  18503. createReviewCommentReply: {
  18504. method: "POST",
  18505. params: {
  18506. body: {
  18507. required: true,
  18508. type: "string"
  18509. },
  18510. comment_id: {
  18511. required: true,
  18512. type: "integer"
  18513. },
  18514. owner: {
  18515. required: true,
  18516. type: "string"
  18517. },
  18518. pull_number: {
  18519. required: true,
  18520. type: "integer"
  18521. },
  18522. repo: {
  18523. required: true,
  18524. type: "string"
  18525. }
  18526. },
  18527. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18528. },
  18529. createReviewRequest: {
  18530. method: "POST",
  18531. params: {
  18532. number: {
  18533. alias: "pull_number",
  18534. deprecated: true,
  18535. type: "integer"
  18536. },
  18537. owner: {
  18538. required: true,
  18539. type: "string"
  18540. },
  18541. pull_number: {
  18542. required: true,
  18543. type: "integer"
  18544. },
  18545. repo: {
  18546. required: true,
  18547. type: "string"
  18548. },
  18549. reviewers: {
  18550. type: "string[]"
  18551. },
  18552. team_reviewers: {
  18553. type: "string[]"
  18554. }
  18555. },
  18556. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18557. },
  18558. deleteComment: {
  18559. method: "DELETE",
  18560. params: {
  18561. comment_id: {
  18562. required: true,
  18563. type: "integer"
  18564. },
  18565. owner: {
  18566. required: true,
  18567. type: "string"
  18568. },
  18569. repo: {
  18570. required: true,
  18571. type: "string"
  18572. }
  18573. },
  18574. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18575. },
  18576. deletePendingReview: {
  18577. method: "DELETE",
  18578. params: {
  18579. number: {
  18580. alias: "pull_number",
  18581. deprecated: true,
  18582. type: "integer"
  18583. },
  18584. owner: {
  18585. required: true,
  18586. type: "string"
  18587. },
  18588. pull_number: {
  18589. required: true,
  18590. type: "integer"
  18591. },
  18592. repo: {
  18593. required: true,
  18594. type: "string"
  18595. },
  18596. review_id: {
  18597. required: true,
  18598. type: "integer"
  18599. }
  18600. },
  18601. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18602. },
  18603. deleteReviewRequest: {
  18604. method: "DELETE",
  18605. params: {
  18606. number: {
  18607. alias: "pull_number",
  18608. deprecated: true,
  18609. type: "integer"
  18610. },
  18611. owner: {
  18612. required: true,
  18613. type: "string"
  18614. },
  18615. pull_number: {
  18616. required: true,
  18617. type: "integer"
  18618. },
  18619. repo: {
  18620. required: true,
  18621. type: "string"
  18622. },
  18623. reviewers: {
  18624. type: "string[]"
  18625. },
  18626. team_reviewers: {
  18627. type: "string[]"
  18628. }
  18629. },
  18630. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18631. },
  18632. dismissReview: {
  18633. method: "PUT",
  18634. params: {
  18635. message: {
  18636. required: true,
  18637. type: "string"
  18638. },
  18639. number: {
  18640. alias: "pull_number",
  18641. deprecated: true,
  18642. type: "integer"
  18643. },
  18644. owner: {
  18645. required: true,
  18646. type: "string"
  18647. },
  18648. pull_number: {
  18649. required: true,
  18650. type: "integer"
  18651. },
  18652. repo: {
  18653. required: true,
  18654. type: "string"
  18655. },
  18656. review_id: {
  18657. required: true,
  18658. type: "integer"
  18659. }
  18660. },
  18661. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18662. },
  18663. get: {
  18664. method: "GET",
  18665. params: {
  18666. number: {
  18667. alias: "pull_number",
  18668. deprecated: true,
  18669. type: "integer"
  18670. },
  18671. owner: {
  18672. required: true,
  18673. type: "string"
  18674. },
  18675. pull_number: {
  18676. required: true,
  18677. type: "integer"
  18678. },
  18679. repo: {
  18680. required: true,
  18681. type: "string"
  18682. }
  18683. },
  18684. url: "/repos/:owner/:repo/pulls/:pull_number"
  18685. },
  18686. getComment: {
  18687. method: "GET",
  18688. params: {
  18689. comment_id: {
  18690. required: true,
  18691. type: "integer"
  18692. },
  18693. owner: {
  18694. required: true,
  18695. type: "string"
  18696. },
  18697. repo: {
  18698. required: true,
  18699. type: "string"
  18700. }
  18701. },
  18702. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18703. },
  18704. getCommentsForReview: {
  18705. method: "GET",
  18706. params: {
  18707. number: {
  18708. alias: "pull_number",
  18709. deprecated: true,
  18710. type: "integer"
  18711. },
  18712. owner: {
  18713. required: true,
  18714. type: "string"
  18715. },
  18716. page: {
  18717. type: "integer"
  18718. },
  18719. per_page: {
  18720. type: "integer"
  18721. },
  18722. pull_number: {
  18723. required: true,
  18724. type: "integer"
  18725. },
  18726. repo: {
  18727. required: true,
  18728. type: "string"
  18729. },
  18730. review_id: {
  18731. required: true,
  18732. type: "integer"
  18733. }
  18734. },
  18735. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  18736. },
  18737. getReview: {
  18738. method: "GET",
  18739. params: {
  18740. number: {
  18741. alias: "pull_number",
  18742. deprecated: true,
  18743. type: "integer"
  18744. },
  18745. owner: {
  18746. required: true,
  18747. type: "string"
  18748. },
  18749. pull_number: {
  18750. required: true,
  18751. type: "integer"
  18752. },
  18753. repo: {
  18754. required: true,
  18755. type: "string"
  18756. },
  18757. review_id: {
  18758. required: true,
  18759. type: "integer"
  18760. }
  18761. },
  18762. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18763. },
  18764. list: {
  18765. method: "GET",
  18766. params: {
  18767. base: {
  18768. type: "string"
  18769. },
  18770. direction: {
  18771. enum: ["asc", "desc"],
  18772. type: "string"
  18773. },
  18774. head: {
  18775. type: "string"
  18776. },
  18777. owner: {
  18778. required: true,
  18779. type: "string"
  18780. },
  18781. page: {
  18782. type: "integer"
  18783. },
  18784. per_page: {
  18785. type: "integer"
  18786. },
  18787. repo: {
  18788. required: true,
  18789. type: "string"
  18790. },
  18791. sort: {
  18792. enum: ["created", "updated", "popularity", "long-running"],
  18793. type: "string"
  18794. },
  18795. state: {
  18796. enum: ["open", "closed", "all"],
  18797. type: "string"
  18798. }
  18799. },
  18800. url: "/repos/:owner/:repo/pulls"
  18801. },
  18802. listComments: {
  18803. method: "GET",
  18804. params: {
  18805. direction: {
  18806. enum: ["asc", "desc"],
  18807. type: "string"
  18808. },
  18809. number: {
  18810. alias: "pull_number",
  18811. deprecated: true,
  18812. type: "integer"
  18813. },
  18814. owner: {
  18815. required: true,
  18816. type: "string"
  18817. },
  18818. page: {
  18819. type: "integer"
  18820. },
  18821. per_page: {
  18822. type: "integer"
  18823. },
  18824. pull_number: {
  18825. required: true,
  18826. type: "integer"
  18827. },
  18828. repo: {
  18829. required: true,
  18830. type: "string"
  18831. },
  18832. since: {
  18833. type: "string"
  18834. },
  18835. sort: {
  18836. enum: ["created", "updated"],
  18837. type: "string"
  18838. }
  18839. },
  18840. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18841. },
  18842. listCommentsForRepo: {
  18843. method: "GET",
  18844. params: {
  18845. direction: {
  18846. enum: ["asc", "desc"],
  18847. type: "string"
  18848. },
  18849. owner: {
  18850. required: true,
  18851. type: "string"
  18852. },
  18853. page: {
  18854. type: "integer"
  18855. },
  18856. per_page: {
  18857. type: "integer"
  18858. },
  18859. repo: {
  18860. required: true,
  18861. type: "string"
  18862. },
  18863. since: {
  18864. type: "string"
  18865. },
  18866. sort: {
  18867. enum: ["created", "updated"],
  18868. type: "string"
  18869. }
  18870. },
  18871. url: "/repos/:owner/:repo/pulls/comments"
  18872. },
  18873. listCommits: {
  18874. method: "GET",
  18875. params: {
  18876. number: {
  18877. alias: "pull_number",
  18878. deprecated: true,
  18879. type: "integer"
  18880. },
  18881. owner: {
  18882. required: true,
  18883. type: "string"
  18884. },
  18885. page: {
  18886. type: "integer"
  18887. },
  18888. per_page: {
  18889. type: "integer"
  18890. },
  18891. pull_number: {
  18892. required: true,
  18893. type: "integer"
  18894. },
  18895. repo: {
  18896. required: true,
  18897. type: "string"
  18898. }
  18899. },
  18900. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  18901. },
  18902. listFiles: {
  18903. method: "GET",
  18904. params: {
  18905. number: {
  18906. alias: "pull_number",
  18907. deprecated: true,
  18908. type: "integer"
  18909. },
  18910. owner: {
  18911. required: true,
  18912. type: "string"
  18913. },
  18914. page: {
  18915. type: "integer"
  18916. },
  18917. per_page: {
  18918. type: "integer"
  18919. },
  18920. pull_number: {
  18921. required: true,
  18922. type: "integer"
  18923. },
  18924. repo: {
  18925. required: true,
  18926. type: "string"
  18927. }
  18928. },
  18929. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  18930. },
  18931. listReviewRequests: {
  18932. method: "GET",
  18933. params: {
  18934. number: {
  18935. alias: "pull_number",
  18936. deprecated: true,
  18937. type: "integer"
  18938. },
  18939. owner: {
  18940. required: true,
  18941. type: "string"
  18942. },
  18943. page: {
  18944. type: "integer"
  18945. },
  18946. per_page: {
  18947. type: "integer"
  18948. },
  18949. pull_number: {
  18950. required: true,
  18951. type: "integer"
  18952. },
  18953. repo: {
  18954. required: true,
  18955. type: "string"
  18956. }
  18957. },
  18958. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18959. },
  18960. listReviews: {
  18961. method: "GET",
  18962. params: {
  18963. number: {
  18964. alias: "pull_number",
  18965. deprecated: true,
  18966. type: "integer"
  18967. },
  18968. owner: {
  18969. required: true,
  18970. type: "string"
  18971. },
  18972. page: {
  18973. type: "integer"
  18974. },
  18975. per_page: {
  18976. type: "integer"
  18977. },
  18978. pull_number: {
  18979. required: true,
  18980. type: "integer"
  18981. },
  18982. repo: {
  18983. required: true,
  18984. type: "string"
  18985. }
  18986. },
  18987. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18988. },
  18989. merge: {
  18990. method: "PUT",
  18991. params: {
  18992. commit_message: {
  18993. type: "string"
  18994. },
  18995. commit_title: {
  18996. type: "string"
  18997. },
  18998. merge_method: {
  18999. enum: ["merge", "squash", "rebase"],
  19000. type: "string"
  19001. },
  19002. number: {
  19003. alias: "pull_number",
  19004. deprecated: true,
  19005. type: "integer"
  19006. },
  19007. owner: {
  19008. required: true,
  19009. type: "string"
  19010. },
  19011. pull_number: {
  19012. required: true,
  19013. type: "integer"
  19014. },
  19015. repo: {
  19016. required: true,
  19017. type: "string"
  19018. },
  19019. sha: {
  19020. type: "string"
  19021. }
  19022. },
  19023. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19024. },
  19025. submitReview: {
  19026. method: "POST",
  19027. params: {
  19028. body: {
  19029. type: "string"
  19030. },
  19031. event: {
  19032. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19033. required: true,
  19034. type: "string"
  19035. },
  19036. number: {
  19037. alias: "pull_number",
  19038. deprecated: true,
  19039. type: "integer"
  19040. },
  19041. owner: {
  19042. required: true,
  19043. type: "string"
  19044. },
  19045. pull_number: {
  19046. required: true,
  19047. type: "integer"
  19048. },
  19049. repo: {
  19050. required: true,
  19051. type: "string"
  19052. },
  19053. review_id: {
  19054. required: true,
  19055. type: "integer"
  19056. }
  19057. },
  19058. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19059. },
  19060. update: {
  19061. method: "PATCH",
  19062. params: {
  19063. base: {
  19064. type: "string"
  19065. },
  19066. body: {
  19067. type: "string"
  19068. },
  19069. maintainer_can_modify: {
  19070. type: "boolean"
  19071. },
  19072. number: {
  19073. alias: "pull_number",
  19074. deprecated: true,
  19075. type: "integer"
  19076. },
  19077. owner: {
  19078. required: true,
  19079. type: "string"
  19080. },
  19081. pull_number: {
  19082. required: true,
  19083. type: "integer"
  19084. },
  19085. repo: {
  19086. required: true,
  19087. type: "string"
  19088. },
  19089. state: {
  19090. enum: ["open", "closed"],
  19091. type: "string"
  19092. },
  19093. title: {
  19094. type: "string"
  19095. }
  19096. },
  19097. url: "/repos/:owner/:repo/pulls/:pull_number"
  19098. },
  19099. updateBranch: {
  19100. headers: {
  19101. accept: "application/vnd.github.lydian-preview+json"
  19102. },
  19103. method: "PUT",
  19104. params: {
  19105. expected_head_sha: {
  19106. type: "string"
  19107. },
  19108. owner: {
  19109. required: true,
  19110. type: "string"
  19111. },
  19112. pull_number: {
  19113. required: true,
  19114. type: "integer"
  19115. },
  19116. repo: {
  19117. required: true,
  19118. type: "string"
  19119. }
  19120. },
  19121. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19122. },
  19123. updateComment: {
  19124. method: "PATCH",
  19125. params: {
  19126. body: {
  19127. required: true,
  19128. type: "string"
  19129. },
  19130. comment_id: {
  19131. required: true,
  19132. type: "integer"
  19133. },
  19134. owner: {
  19135. required: true,
  19136. type: "string"
  19137. },
  19138. repo: {
  19139. required: true,
  19140. type: "string"
  19141. }
  19142. },
  19143. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19144. },
  19145. updateReview: {
  19146. method: "PUT",
  19147. params: {
  19148. body: {
  19149. required: true,
  19150. type: "string"
  19151. },
  19152. number: {
  19153. alias: "pull_number",
  19154. deprecated: true,
  19155. type: "integer"
  19156. },
  19157. owner: {
  19158. required: true,
  19159. type: "string"
  19160. },
  19161. pull_number: {
  19162. required: true,
  19163. type: "integer"
  19164. },
  19165. repo: {
  19166. required: true,
  19167. type: "string"
  19168. },
  19169. review_id: {
  19170. required: true,
  19171. type: "integer"
  19172. }
  19173. },
  19174. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19175. }
  19176. },
  19177. rateLimit: {
  19178. get: {
  19179. method: "GET",
  19180. params: {},
  19181. url: "/rate_limit"
  19182. }
  19183. },
  19184. reactions: {
  19185. createForCommitComment: {
  19186. headers: {
  19187. accept: "application/vnd.github.squirrel-girl-preview+json"
  19188. },
  19189. method: "POST",
  19190. params: {
  19191. comment_id: {
  19192. required: true,
  19193. type: "integer"
  19194. },
  19195. content: {
  19196. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19197. required: true,
  19198. type: "string"
  19199. },
  19200. owner: {
  19201. required: true,
  19202. type: "string"
  19203. },
  19204. repo: {
  19205. required: true,
  19206. type: "string"
  19207. }
  19208. },
  19209. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19210. },
  19211. createForIssue: {
  19212. headers: {
  19213. accept: "application/vnd.github.squirrel-girl-preview+json"
  19214. },
  19215. method: "POST",
  19216. params: {
  19217. content: {
  19218. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19219. required: true,
  19220. type: "string"
  19221. },
  19222. issue_number: {
  19223. required: true,
  19224. type: "integer"
  19225. },
  19226. number: {
  19227. alias: "issue_number",
  19228. deprecated: true,
  19229. type: "integer"
  19230. },
  19231. owner: {
  19232. required: true,
  19233. type: "string"
  19234. },
  19235. repo: {
  19236. required: true,
  19237. type: "string"
  19238. }
  19239. },
  19240. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19241. },
  19242. createForIssueComment: {
  19243. headers: {
  19244. accept: "application/vnd.github.squirrel-girl-preview+json"
  19245. },
  19246. method: "POST",
  19247. params: {
  19248. comment_id: {
  19249. required: true,
  19250. type: "integer"
  19251. },
  19252. content: {
  19253. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19254. required: true,
  19255. type: "string"
  19256. },
  19257. owner: {
  19258. required: true,
  19259. type: "string"
  19260. },
  19261. repo: {
  19262. required: true,
  19263. type: "string"
  19264. }
  19265. },
  19266. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19267. },
  19268. createForPullRequestReviewComment: {
  19269. headers: {
  19270. accept: "application/vnd.github.squirrel-girl-preview+json"
  19271. },
  19272. method: "POST",
  19273. params: {
  19274. comment_id: {
  19275. required: true,
  19276. type: "integer"
  19277. },
  19278. content: {
  19279. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19280. required: true,
  19281. type: "string"
  19282. },
  19283. owner: {
  19284. required: true,
  19285. type: "string"
  19286. },
  19287. repo: {
  19288. required: true,
  19289. type: "string"
  19290. }
  19291. },
  19292. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19293. },
  19294. createForTeamDiscussion: {
  19295. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19296. headers: {
  19297. accept: "application/vnd.github.squirrel-girl-preview+json"
  19298. },
  19299. method: "POST",
  19300. params: {
  19301. content: {
  19302. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19303. required: true,
  19304. type: "string"
  19305. },
  19306. discussion_number: {
  19307. required: true,
  19308. type: "integer"
  19309. },
  19310. team_id: {
  19311. required: true,
  19312. type: "integer"
  19313. }
  19314. },
  19315. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19316. },
  19317. createForTeamDiscussionComment: {
  19318. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19319. headers: {
  19320. accept: "application/vnd.github.squirrel-girl-preview+json"
  19321. },
  19322. method: "POST",
  19323. params: {
  19324. comment_number: {
  19325. required: true,
  19326. type: "integer"
  19327. },
  19328. content: {
  19329. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19330. required: true,
  19331. type: "string"
  19332. },
  19333. discussion_number: {
  19334. required: true,
  19335. type: "integer"
  19336. },
  19337. team_id: {
  19338. required: true,
  19339. type: "integer"
  19340. }
  19341. },
  19342. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19343. },
  19344. createForTeamDiscussionCommentInOrg: {
  19345. headers: {
  19346. accept: "application/vnd.github.squirrel-girl-preview+json"
  19347. },
  19348. method: "POST",
  19349. params: {
  19350. comment_number: {
  19351. required: true,
  19352. type: "integer"
  19353. },
  19354. content: {
  19355. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19356. required: true,
  19357. type: "string"
  19358. },
  19359. discussion_number: {
  19360. required: true,
  19361. type: "integer"
  19362. },
  19363. org: {
  19364. required: true,
  19365. type: "string"
  19366. },
  19367. team_slug: {
  19368. required: true,
  19369. type: "string"
  19370. }
  19371. },
  19372. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19373. },
  19374. createForTeamDiscussionCommentLegacy: {
  19375. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19376. headers: {
  19377. accept: "application/vnd.github.squirrel-girl-preview+json"
  19378. },
  19379. method: "POST",
  19380. params: {
  19381. comment_number: {
  19382. required: true,
  19383. type: "integer"
  19384. },
  19385. content: {
  19386. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19387. required: true,
  19388. type: "string"
  19389. },
  19390. discussion_number: {
  19391. required: true,
  19392. type: "integer"
  19393. },
  19394. team_id: {
  19395. required: true,
  19396. type: "integer"
  19397. }
  19398. },
  19399. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19400. },
  19401. createForTeamDiscussionInOrg: {
  19402. headers: {
  19403. accept: "application/vnd.github.squirrel-girl-preview+json"
  19404. },
  19405. method: "POST",
  19406. params: {
  19407. content: {
  19408. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19409. required: true,
  19410. type: "string"
  19411. },
  19412. discussion_number: {
  19413. required: true,
  19414. type: "integer"
  19415. },
  19416. org: {
  19417. required: true,
  19418. type: "string"
  19419. },
  19420. team_slug: {
  19421. required: true,
  19422. type: "string"
  19423. }
  19424. },
  19425. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19426. },
  19427. createForTeamDiscussionLegacy: {
  19428. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  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. discussion_number: {
  19440. required: true,
  19441. type: "integer"
  19442. },
  19443. team_id: {
  19444. required: true,
  19445. type: "integer"
  19446. }
  19447. },
  19448. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19449. },
  19450. delete: {
  19451. headers: {
  19452. accept: "application/vnd.github.squirrel-girl-preview+json"
  19453. },
  19454. method: "DELETE",
  19455. params: {
  19456. reaction_id: {
  19457. required: true,
  19458. type: "integer"
  19459. }
  19460. },
  19461. url: "/reactions/:reaction_id"
  19462. },
  19463. listForCommitComment: {
  19464. headers: {
  19465. accept: "application/vnd.github.squirrel-girl-preview+json"
  19466. },
  19467. method: "GET",
  19468. params: {
  19469. comment_id: {
  19470. required: true,
  19471. type: "integer"
  19472. },
  19473. content: {
  19474. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19475. type: "string"
  19476. },
  19477. owner: {
  19478. required: true,
  19479. type: "string"
  19480. },
  19481. page: {
  19482. type: "integer"
  19483. },
  19484. per_page: {
  19485. type: "integer"
  19486. },
  19487. repo: {
  19488. required: true,
  19489. type: "string"
  19490. }
  19491. },
  19492. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19493. },
  19494. listForIssue: {
  19495. headers: {
  19496. accept: "application/vnd.github.squirrel-girl-preview+json"
  19497. },
  19498. method: "GET",
  19499. params: {
  19500. content: {
  19501. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19502. type: "string"
  19503. },
  19504. issue_number: {
  19505. required: true,
  19506. type: "integer"
  19507. },
  19508. number: {
  19509. alias: "issue_number",
  19510. deprecated: true,
  19511. type: "integer"
  19512. },
  19513. owner: {
  19514. required: true,
  19515. type: "string"
  19516. },
  19517. page: {
  19518. type: "integer"
  19519. },
  19520. per_page: {
  19521. type: "integer"
  19522. },
  19523. repo: {
  19524. required: true,
  19525. type: "string"
  19526. }
  19527. },
  19528. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19529. },
  19530. listForIssueComment: {
  19531. headers: {
  19532. accept: "application/vnd.github.squirrel-girl-preview+json"
  19533. },
  19534. method: "GET",
  19535. params: {
  19536. comment_id: {
  19537. required: true,
  19538. type: "integer"
  19539. },
  19540. content: {
  19541. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19542. type: "string"
  19543. },
  19544. owner: {
  19545. required: true,
  19546. type: "string"
  19547. },
  19548. page: {
  19549. type: "integer"
  19550. },
  19551. per_page: {
  19552. type: "integer"
  19553. },
  19554. repo: {
  19555. required: true,
  19556. type: "string"
  19557. }
  19558. },
  19559. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19560. },
  19561. listForPullRequestReviewComment: {
  19562. headers: {
  19563. accept: "application/vnd.github.squirrel-girl-preview+json"
  19564. },
  19565. method: "GET",
  19566. params: {
  19567. comment_id: {
  19568. required: true,
  19569. type: "integer"
  19570. },
  19571. content: {
  19572. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19573. type: "string"
  19574. },
  19575. owner: {
  19576. required: true,
  19577. type: "string"
  19578. },
  19579. page: {
  19580. type: "integer"
  19581. },
  19582. per_page: {
  19583. type: "integer"
  19584. },
  19585. repo: {
  19586. required: true,
  19587. type: "string"
  19588. }
  19589. },
  19590. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19591. },
  19592. listForTeamDiscussion: {
  19593. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19594. headers: {
  19595. accept: "application/vnd.github.squirrel-girl-preview+json"
  19596. },
  19597. method: "GET",
  19598. params: {
  19599. content: {
  19600. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19601. type: "string"
  19602. },
  19603. discussion_number: {
  19604. required: true,
  19605. type: "integer"
  19606. },
  19607. page: {
  19608. type: "integer"
  19609. },
  19610. per_page: {
  19611. type: "integer"
  19612. },
  19613. team_id: {
  19614. required: true,
  19615. type: "integer"
  19616. }
  19617. },
  19618. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19619. },
  19620. listForTeamDiscussionComment: {
  19621. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19622. headers: {
  19623. accept: "application/vnd.github.squirrel-girl-preview+json"
  19624. },
  19625. method: "GET",
  19626. params: {
  19627. comment_number: {
  19628. required: true,
  19629. type: "integer"
  19630. },
  19631. content: {
  19632. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19633. type: "string"
  19634. },
  19635. discussion_number: {
  19636. required: true,
  19637. type: "integer"
  19638. },
  19639. page: {
  19640. type: "integer"
  19641. },
  19642. per_page: {
  19643. type: "integer"
  19644. },
  19645. team_id: {
  19646. required: true,
  19647. type: "integer"
  19648. }
  19649. },
  19650. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19651. },
  19652. listForTeamDiscussionCommentInOrg: {
  19653. headers: {
  19654. accept: "application/vnd.github.squirrel-girl-preview+json"
  19655. },
  19656. method: "GET",
  19657. params: {
  19658. comment_number: {
  19659. required: true,
  19660. type: "integer"
  19661. },
  19662. content: {
  19663. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19664. type: "string"
  19665. },
  19666. discussion_number: {
  19667. required: true,
  19668. type: "integer"
  19669. },
  19670. org: {
  19671. required: true,
  19672. type: "string"
  19673. },
  19674. page: {
  19675. type: "integer"
  19676. },
  19677. per_page: {
  19678. type: "integer"
  19679. },
  19680. team_slug: {
  19681. required: true,
  19682. type: "string"
  19683. }
  19684. },
  19685. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19686. },
  19687. listForTeamDiscussionCommentLegacy: {
  19688. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19689. headers: {
  19690. accept: "application/vnd.github.squirrel-girl-preview+json"
  19691. },
  19692. method: "GET",
  19693. params: {
  19694. comment_number: {
  19695. required: true,
  19696. type: "integer"
  19697. },
  19698. content: {
  19699. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19700. type: "string"
  19701. },
  19702. discussion_number: {
  19703. required: true,
  19704. type: "integer"
  19705. },
  19706. page: {
  19707. type: "integer"
  19708. },
  19709. per_page: {
  19710. type: "integer"
  19711. },
  19712. team_id: {
  19713. required: true,
  19714. type: "integer"
  19715. }
  19716. },
  19717. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19718. },
  19719. listForTeamDiscussionInOrg: {
  19720. headers: {
  19721. accept: "application/vnd.github.squirrel-girl-preview+json"
  19722. },
  19723. method: "GET",
  19724. params: {
  19725. content: {
  19726. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19727. type: "string"
  19728. },
  19729. discussion_number: {
  19730. required: true,
  19731. type: "integer"
  19732. },
  19733. org: {
  19734. required: true,
  19735. type: "string"
  19736. },
  19737. page: {
  19738. type: "integer"
  19739. },
  19740. per_page: {
  19741. type: "integer"
  19742. },
  19743. team_slug: {
  19744. required: true,
  19745. type: "string"
  19746. }
  19747. },
  19748. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19749. },
  19750. listForTeamDiscussionLegacy: {
  19751. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  19752. headers: {
  19753. accept: "application/vnd.github.squirrel-girl-preview+json"
  19754. },
  19755. method: "GET",
  19756. params: {
  19757. content: {
  19758. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19759. type: "string"
  19760. },
  19761. discussion_number: {
  19762. required: true,
  19763. type: "integer"
  19764. },
  19765. page: {
  19766. type: "integer"
  19767. },
  19768. per_page: {
  19769. type: "integer"
  19770. },
  19771. team_id: {
  19772. required: true,
  19773. type: "integer"
  19774. }
  19775. },
  19776. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19777. }
  19778. },
  19779. repos: {
  19780. acceptInvitation: {
  19781. method: "PATCH",
  19782. params: {
  19783. invitation_id: {
  19784. required: true,
  19785. type: "integer"
  19786. }
  19787. },
  19788. url: "/user/repository_invitations/:invitation_id"
  19789. },
  19790. addCollaborator: {
  19791. method: "PUT",
  19792. params: {
  19793. owner: {
  19794. required: true,
  19795. type: "string"
  19796. },
  19797. permission: {
  19798. enum: ["pull", "push", "admin"],
  19799. type: "string"
  19800. },
  19801. repo: {
  19802. required: true,
  19803. type: "string"
  19804. },
  19805. username: {
  19806. required: true,
  19807. type: "string"
  19808. }
  19809. },
  19810. url: "/repos/:owner/:repo/collaborators/:username"
  19811. },
  19812. addDeployKey: {
  19813. method: "POST",
  19814. params: {
  19815. key: {
  19816. required: true,
  19817. type: "string"
  19818. },
  19819. owner: {
  19820. required: true,
  19821. type: "string"
  19822. },
  19823. read_only: {
  19824. type: "boolean"
  19825. },
  19826. repo: {
  19827. required: true,
  19828. type: "string"
  19829. },
  19830. title: {
  19831. type: "string"
  19832. }
  19833. },
  19834. url: "/repos/:owner/:repo/keys"
  19835. },
  19836. addProtectedBranchAdminEnforcement: {
  19837. method: "POST",
  19838. params: {
  19839. branch: {
  19840. required: true,
  19841. type: "string"
  19842. },
  19843. owner: {
  19844. required: true,
  19845. type: "string"
  19846. },
  19847. repo: {
  19848. required: true,
  19849. type: "string"
  19850. }
  19851. },
  19852. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  19853. },
  19854. addProtectedBranchAppRestrictions: {
  19855. method: "POST",
  19856. params: {
  19857. apps: {
  19858. mapTo: "data",
  19859. required: true,
  19860. type: "string[]"
  19861. },
  19862. branch: {
  19863. required: true,
  19864. type: "string"
  19865. },
  19866. owner: {
  19867. required: true,
  19868. type: "string"
  19869. },
  19870. repo: {
  19871. required: true,
  19872. type: "string"
  19873. }
  19874. },
  19875. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  19876. },
  19877. addProtectedBranchRequiredSignatures: {
  19878. headers: {
  19879. accept: "application/vnd.github.zzzax-preview+json"
  19880. },
  19881. method: "POST",
  19882. params: {
  19883. branch: {
  19884. required: true,
  19885. type: "string"
  19886. },
  19887. owner: {
  19888. required: true,
  19889. type: "string"
  19890. },
  19891. repo: {
  19892. required: true,
  19893. type: "string"
  19894. }
  19895. },
  19896. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  19897. },
  19898. addProtectedBranchRequiredStatusChecksContexts: {
  19899. method: "POST",
  19900. params: {
  19901. branch: {
  19902. required: true,
  19903. type: "string"
  19904. },
  19905. contexts: {
  19906. mapTo: "data",
  19907. required: true,
  19908. type: "string[]"
  19909. },
  19910. owner: {
  19911. required: true,
  19912. type: "string"
  19913. },
  19914. repo: {
  19915. required: true,
  19916. type: "string"
  19917. }
  19918. },
  19919. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  19920. },
  19921. addProtectedBranchTeamRestrictions: {
  19922. method: "POST",
  19923. params: {
  19924. branch: {
  19925. required: true,
  19926. type: "string"
  19927. },
  19928. owner: {
  19929. required: true,
  19930. type: "string"
  19931. },
  19932. repo: {
  19933. required: true,
  19934. type: "string"
  19935. },
  19936. teams: {
  19937. mapTo: "data",
  19938. required: true,
  19939. type: "string[]"
  19940. }
  19941. },
  19942. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  19943. },
  19944. addProtectedBranchUserRestrictions: {
  19945. method: "POST",
  19946. params: {
  19947. branch: {
  19948. required: true,
  19949. type: "string"
  19950. },
  19951. owner: {
  19952. required: true,
  19953. type: "string"
  19954. },
  19955. repo: {
  19956. required: true,
  19957. type: "string"
  19958. },
  19959. users: {
  19960. mapTo: "data",
  19961. required: true,
  19962. type: "string[]"
  19963. }
  19964. },
  19965. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  19966. },
  19967. checkCollaborator: {
  19968. method: "GET",
  19969. params: {
  19970. owner: {
  19971. required: true,
  19972. type: "string"
  19973. },
  19974. repo: {
  19975. required: true,
  19976. type: "string"
  19977. },
  19978. username: {
  19979. required: true,
  19980. type: "string"
  19981. }
  19982. },
  19983. url: "/repos/:owner/:repo/collaborators/:username"
  19984. },
  19985. checkVulnerabilityAlerts: {
  19986. headers: {
  19987. accept: "application/vnd.github.dorian-preview+json"
  19988. },
  19989. method: "GET",
  19990. params: {
  19991. owner: {
  19992. required: true,
  19993. type: "string"
  19994. },
  19995. repo: {
  19996. required: true,
  19997. type: "string"
  19998. }
  19999. },
  20000. url: "/repos/:owner/:repo/vulnerability-alerts"
  20001. },
  20002. compareCommits: {
  20003. method: "GET",
  20004. params: {
  20005. base: {
  20006. required: true,
  20007. type: "string"
  20008. },
  20009. head: {
  20010. required: true,
  20011. type: "string"
  20012. },
  20013. owner: {
  20014. required: true,
  20015. type: "string"
  20016. },
  20017. repo: {
  20018. required: true,
  20019. type: "string"
  20020. }
  20021. },
  20022. url: "/repos/:owner/:repo/compare/:base...:head"
  20023. },
  20024. createCommitComment: {
  20025. method: "POST",
  20026. params: {
  20027. body: {
  20028. required: true,
  20029. type: "string"
  20030. },
  20031. commit_sha: {
  20032. required: true,
  20033. type: "string"
  20034. },
  20035. line: {
  20036. type: "integer"
  20037. },
  20038. owner: {
  20039. required: true,
  20040. type: "string"
  20041. },
  20042. path: {
  20043. type: "string"
  20044. },
  20045. position: {
  20046. type: "integer"
  20047. },
  20048. repo: {
  20049. required: true,
  20050. type: "string"
  20051. },
  20052. sha: {
  20053. alias: "commit_sha",
  20054. deprecated: true,
  20055. type: "string"
  20056. }
  20057. },
  20058. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20059. },
  20060. createDeployment: {
  20061. method: "POST",
  20062. params: {
  20063. auto_merge: {
  20064. type: "boolean"
  20065. },
  20066. description: {
  20067. type: "string"
  20068. },
  20069. environment: {
  20070. type: "string"
  20071. },
  20072. owner: {
  20073. required: true,
  20074. type: "string"
  20075. },
  20076. payload: {
  20077. type: "string"
  20078. },
  20079. production_environment: {
  20080. type: "boolean"
  20081. },
  20082. ref: {
  20083. required: true,
  20084. type: "string"
  20085. },
  20086. repo: {
  20087. required: true,
  20088. type: "string"
  20089. },
  20090. required_contexts: {
  20091. type: "string[]"
  20092. },
  20093. task: {
  20094. type: "string"
  20095. },
  20096. transient_environment: {
  20097. type: "boolean"
  20098. }
  20099. },
  20100. url: "/repos/:owner/:repo/deployments"
  20101. },
  20102. createDeploymentStatus: {
  20103. method: "POST",
  20104. params: {
  20105. auto_inactive: {
  20106. type: "boolean"
  20107. },
  20108. deployment_id: {
  20109. required: true,
  20110. type: "integer"
  20111. },
  20112. description: {
  20113. type: "string"
  20114. },
  20115. environment: {
  20116. enum: ["production", "staging", "qa"],
  20117. type: "string"
  20118. },
  20119. environment_url: {
  20120. type: "string"
  20121. },
  20122. log_url: {
  20123. type: "string"
  20124. },
  20125. owner: {
  20126. required: true,
  20127. type: "string"
  20128. },
  20129. repo: {
  20130. required: true,
  20131. type: "string"
  20132. },
  20133. state: {
  20134. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20135. required: true,
  20136. type: "string"
  20137. },
  20138. target_url: {
  20139. type: "string"
  20140. }
  20141. },
  20142. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20143. },
  20144. createDispatchEvent: {
  20145. method: "POST",
  20146. params: {
  20147. client_payload: {
  20148. type: "object"
  20149. },
  20150. event_type: {
  20151. type: "string"
  20152. },
  20153. owner: {
  20154. required: true,
  20155. type: "string"
  20156. },
  20157. repo: {
  20158. required: true,
  20159. type: "string"
  20160. }
  20161. },
  20162. url: "/repos/:owner/:repo/dispatches"
  20163. },
  20164. createFile: {
  20165. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20166. method: "PUT",
  20167. params: {
  20168. author: {
  20169. type: "object"
  20170. },
  20171. "author.email": {
  20172. required: true,
  20173. type: "string"
  20174. },
  20175. "author.name": {
  20176. required: true,
  20177. type: "string"
  20178. },
  20179. branch: {
  20180. type: "string"
  20181. },
  20182. committer: {
  20183. type: "object"
  20184. },
  20185. "committer.email": {
  20186. required: true,
  20187. type: "string"
  20188. },
  20189. "committer.name": {
  20190. required: true,
  20191. type: "string"
  20192. },
  20193. content: {
  20194. required: true,
  20195. type: "string"
  20196. },
  20197. message: {
  20198. required: true,
  20199. type: "string"
  20200. },
  20201. owner: {
  20202. required: true,
  20203. type: "string"
  20204. },
  20205. path: {
  20206. required: true,
  20207. type: "string"
  20208. },
  20209. repo: {
  20210. required: true,
  20211. type: "string"
  20212. },
  20213. sha: {
  20214. type: "string"
  20215. }
  20216. },
  20217. url: "/repos/:owner/:repo/contents/:path"
  20218. },
  20219. createForAuthenticatedUser: {
  20220. method: "POST",
  20221. params: {
  20222. allow_merge_commit: {
  20223. type: "boolean"
  20224. },
  20225. allow_rebase_merge: {
  20226. type: "boolean"
  20227. },
  20228. allow_squash_merge: {
  20229. type: "boolean"
  20230. },
  20231. auto_init: {
  20232. type: "boolean"
  20233. },
  20234. delete_branch_on_merge: {
  20235. type: "boolean"
  20236. },
  20237. description: {
  20238. type: "string"
  20239. },
  20240. gitignore_template: {
  20241. type: "string"
  20242. },
  20243. has_issues: {
  20244. type: "boolean"
  20245. },
  20246. has_projects: {
  20247. type: "boolean"
  20248. },
  20249. has_wiki: {
  20250. type: "boolean"
  20251. },
  20252. homepage: {
  20253. type: "string"
  20254. },
  20255. is_template: {
  20256. type: "boolean"
  20257. },
  20258. license_template: {
  20259. type: "string"
  20260. },
  20261. name: {
  20262. required: true,
  20263. type: "string"
  20264. },
  20265. private: {
  20266. type: "boolean"
  20267. },
  20268. team_id: {
  20269. type: "integer"
  20270. },
  20271. visibility: {
  20272. enum: ["public", "private", "visibility", "internal"],
  20273. type: "string"
  20274. }
  20275. },
  20276. url: "/user/repos"
  20277. },
  20278. createFork: {
  20279. method: "POST",
  20280. params: {
  20281. organization: {
  20282. type: "string"
  20283. },
  20284. owner: {
  20285. required: true,
  20286. type: "string"
  20287. },
  20288. repo: {
  20289. required: true,
  20290. type: "string"
  20291. }
  20292. },
  20293. url: "/repos/:owner/:repo/forks"
  20294. },
  20295. createHook: {
  20296. method: "POST",
  20297. params: {
  20298. active: {
  20299. type: "boolean"
  20300. },
  20301. config: {
  20302. required: true,
  20303. type: "object"
  20304. },
  20305. "config.content_type": {
  20306. type: "string"
  20307. },
  20308. "config.insecure_ssl": {
  20309. type: "string"
  20310. },
  20311. "config.secret": {
  20312. type: "string"
  20313. },
  20314. "config.url": {
  20315. required: true,
  20316. type: "string"
  20317. },
  20318. events: {
  20319. type: "string[]"
  20320. },
  20321. name: {
  20322. type: "string"
  20323. },
  20324. owner: {
  20325. required: true,
  20326. type: "string"
  20327. },
  20328. repo: {
  20329. required: true,
  20330. type: "string"
  20331. }
  20332. },
  20333. url: "/repos/:owner/:repo/hooks"
  20334. },
  20335. createInOrg: {
  20336. method: "POST",
  20337. params: {
  20338. allow_merge_commit: {
  20339. type: "boolean"
  20340. },
  20341. allow_rebase_merge: {
  20342. type: "boolean"
  20343. },
  20344. allow_squash_merge: {
  20345. type: "boolean"
  20346. },
  20347. auto_init: {
  20348. type: "boolean"
  20349. },
  20350. delete_branch_on_merge: {
  20351. type: "boolean"
  20352. },
  20353. description: {
  20354. type: "string"
  20355. },
  20356. gitignore_template: {
  20357. type: "string"
  20358. },
  20359. has_issues: {
  20360. type: "boolean"
  20361. },
  20362. has_projects: {
  20363. type: "boolean"
  20364. },
  20365. has_wiki: {
  20366. type: "boolean"
  20367. },
  20368. homepage: {
  20369. type: "string"
  20370. },
  20371. is_template: {
  20372. type: "boolean"
  20373. },
  20374. license_template: {
  20375. type: "string"
  20376. },
  20377. name: {
  20378. required: true,
  20379. type: "string"
  20380. },
  20381. org: {
  20382. required: true,
  20383. type: "string"
  20384. },
  20385. private: {
  20386. type: "boolean"
  20387. },
  20388. team_id: {
  20389. type: "integer"
  20390. },
  20391. visibility: {
  20392. enum: ["public", "private", "visibility", "internal"],
  20393. type: "string"
  20394. }
  20395. },
  20396. url: "/orgs/:org/repos"
  20397. },
  20398. createOrUpdateFile: {
  20399. method: "PUT",
  20400. params: {
  20401. author: {
  20402. type: "object"
  20403. },
  20404. "author.email": {
  20405. required: true,
  20406. type: "string"
  20407. },
  20408. "author.name": {
  20409. required: true,
  20410. type: "string"
  20411. },
  20412. branch: {
  20413. type: "string"
  20414. },
  20415. committer: {
  20416. type: "object"
  20417. },
  20418. "committer.email": {
  20419. required: true,
  20420. type: "string"
  20421. },
  20422. "committer.name": {
  20423. required: true,
  20424. type: "string"
  20425. },
  20426. content: {
  20427. required: true,
  20428. type: "string"
  20429. },
  20430. message: {
  20431. required: true,
  20432. type: "string"
  20433. },
  20434. owner: {
  20435. required: true,
  20436. type: "string"
  20437. },
  20438. path: {
  20439. required: true,
  20440. type: "string"
  20441. },
  20442. repo: {
  20443. required: true,
  20444. type: "string"
  20445. },
  20446. sha: {
  20447. type: "string"
  20448. }
  20449. },
  20450. url: "/repos/:owner/:repo/contents/:path"
  20451. },
  20452. createRelease: {
  20453. method: "POST",
  20454. params: {
  20455. body: {
  20456. type: "string"
  20457. },
  20458. draft: {
  20459. type: "boolean"
  20460. },
  20461. name: {
  20462. type: "string"
  20463. },
  20464. owner: {
  20465. required: true,
  20466. type: "string"
  20467. },
  20468. prerelease: {
  20469. type: "boolean"
  20470. },
  20471. repo: {
  20472. required: true,
  20473. type: "string"
  20474. },
  20475. tag_name: {
  20476. required: true,
  20477. type: "string"
  20478. },
  20479. target_commitish: {
  20480. type: "string"
  20481. }
  20482. },
  20483. url: "/repos/:owner/:repo/releases"
  20484. },
  20485. createStatus: {
  20486. method: "POST",
  20487. params: {
  20488. context: {
  20489. type: "string"
  20490. },
  20491. description: {
  20492. type: "string"
  20493. },
  20494. owner: {
  20495. required: true,
  20496. type: "string"
  20497. },
  20498. repo: {
  20499. required: true,
  20500. type: "string"
  20501. },
  20502. sha: {
  20503. required: true,
  20504. type: "string"
  20505. },
  20506. state: {
  20507. enum: ["error", "failure", "pending", "success"],
  20508. required: true,
  20509. type: "string"
  20510. },
  20511. target_url: {
  20512. type: "string"
  20513. }
  20514. },
  20515. url: "/repos/:owner/:repo/statuses/:sha"
  20516. },
  20517. createUsingTemplate: {
  20518. headers: {
  20519. accept: "application/vnd.github.baptiste-preview+json"
  20520. },
  20521. method: "POST",
  20522. params: {
  20523. description: {
  20524. type: "string"
  20525. },
  20526. name: {
  20527. required: true,
  20528. type: "string"
  20529. },
  20530. owner: {
  20531. type: "string"
  20532. },
  20533. private: {
  20534. type: "boolean"
  20535. },
  20536. template_owner: {
  20537. required: true,
  20538. type: "string"
  20539. },
  20540. template_repo: {
  20541. required: true,
  20542. type: "string"
  20543. }
  20544. },
  20545. url: "/repos/:template_owner/:template_repo/generate"
  20546. },
  20547. declineInvitation: {
  20548. method: "DELETE",
  20549. params: {
  20550. invitation_id: {
  20551. required: true,
  20552. type: "integer"
  20553. }
  20554. },
  20555. url: "/user/repository_invitations/:invitation_id"
  20556. },
  20557. delete: {
  20558. method: "DELETE",
  20559. params: {
  20560. owner: {
  20561. required: true,
  20562. type: "string"
  20563. },
  20564. repo: {
  20565. required: true,
  20566. type: "string"
  20567. }
  20568. },
  20569. url: "/repos/:owner/:repo"
  20570. },
  20571. deleteCommitComment: {
  20572. method: "DELETE",
  20573. params: {
  20574. comment_id: {
  20575. required: true,
  20576. type: "integer"
  20577. },
  20578. owner: {
  20579. required: true,
  20580. type: "string"
  20581. },
  20582. repo: {
  20583. required: true,
  20584. type: "string"
  20585. }
  20586. },
  20587. url: "/repos/:owner/:repo/comments/:comment_id"
  20588. },
  20589. deleteDownload: {
  20590. method: "DELETE",
  20591. params: {
  20592. download_id: {
  20593. required: true,
  20594. type: "integer"
  20595. },
  20596. owner: {
  20597. required: true,
  20598. type: "string"
  20599. },
  20600. repo: {
  20601. required: true,
  20602. type: "string"
  20603. }
  20604. },
  20605. url: "/repos/:owner/:repo/downloads/:download_id"
  20606. },
  20607. deleteFile: {
  20608. method: "DELETE",
  20609. params: {
  20610. author: {
  20611. type: "object"
  20612. },
  20613. "author.email": {
  20614. type: "string"
  20615. },
  20616. "author.name": {
  20617. type: "string"
  20618. },
  20619. branch: {
  20620. type: "string"
  20621. },
  20622. committer: {
  20623. type: "object"
  20624. },
  20625. "committer.email": {
  20626. type: "string"
  20627. },
  20628. "committer.name": {
  20629. type: "string"
  20630. },
  20631. message: {
  20632. required: true,
  20633. type: "string"
  20634. },
  20635. owner: {
  20636. required: true,
  20637. type: "string"
  20638. },
  20639. path: {
  20640. required: true,
  20641. type: "string"
  20642. },
  20643. repo: {
  20644. required: true,
  20645. type: "string"
  20646. },
  20647. sha: {
  20648. required: true,
  20649. type: "string"
  20650. }
  20651. },
  20652. url: "/repos/:owner/:repo/contents/:path"
  20653. },
  20654. deleteHook: {
  20655. method: "DELETE",
  20656. params: {
  20657. hook_id: {
  20658. required: true,
  20659. type: "integer"
  20660. },
  20661. owner: {
  20662. required: true,
  20663. type: "string"
  20664. },
  20665. repo: {
  20666. required: true,
  20667. type: "string"
  20668. }
  20669. },
  20670. url: "/repos/:owner/:repo/hooks/:hook_id"
  20671. },
  20672. deleteInvitation: {
  20673. method: "DELETE",
  20674. params: {
  20675. invitation_id: {
  20676. required: true,
  20677. type: "integer"
  20678. },
  20679. owner: {
  20680. required: true,
  20681. type: "string"
  20682. },
  20683. repo: {
  20684. required: true,
  20685. type: "string"
  20686. }
  20687. },
  20688. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20689. },
  20690. deleteRelease: {
  20691. method: "DELETE",
  20692. params: {
  20693. owner: {
  20694. required: true,
  20695. type: "string"
  20696. },
  20697. release_id: {
  20698. required: true,
  20699. type: "integer"
  20700. },
  20701. repo: {
  20702. required: true,
  20703. type: "string"
  20704. }
  20705. },
  20706. url: "/repos/:owner/:repo/releases/:release_id"
  20707. },
  20708. deleteReleaseAsset: {
  20709. method: "DELETE",
  20710. params: {
  20711. asset_id: {
  20712. required: true,
  20713. type: "integer"
  20714. },
  20715. owner: {
  20716. required: true,
  20717. type: "string"
  20718. },
  20719. repo: {
  20720. required: true,
  20721. type: "string"
  20722. }
  20723. },
  20724. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20725. },
  20726. disableAutomatedSecurityFixes: {
  20727. headers: {
  20728. accept: "application/vnd.github.london-preview+json"
  20729. },
  20730. method: "DELETE",
  20731. params: {
  20732. owner: {
  20733. required: true,
  20734. type: "string"
  20735. },
  20736. repo: {
  20737. required: true,
  20738. type: "string"
  20739. }
  20740. },
  20741. url: "/repos/:owner/:repo/automated-security-fixes"
  20742. },
  20743. disablePagesSite: {
  20744. headers: {
  20745. accept: "application/vnd.github.switcheroo-preview+json"
  20746. },
  20747. method: "DELETE",
  20748. params: {
  20749. owner: {
  20750. required: true,
  20751. type: "string"
  20752. },
  20753. repo: {
  20754. required: true,
  20755. type: "string"
  20756. }
  20757. },
  20758. url: "/repos/:owner/:repo/pages"
  20759. },
  20760. disableVulnerabilityAlerts: {
  20761. headers: {
  20762. accept: "application/vnd.github.dorian-preview+json"
  20763. },
  20764. method: "DELETE",
  20765. params: {
  20766. owner: {
  20767. required: true,
  20768. type: "string"
  20769. },
  20770. repo: {
  20771. required: true,
  20772. type: "string"
  20773. }
  20774. },
  20775. url: "/repos/:owner/:repo/vulnerability-alerts"
  20776. },
  20777. enableAutomatedSecurityFixes: {
  20778. headers: {
  20779. accept: "application/vnd.github.london-preview+json"
  20780. },
  20781. method: "PUT",
  20782. params: {
  20783. owner: {
  20784. required: true,
  20785. type: "string"
  20786. },
  20787. repo: {
  20788. required: true,
  20789. type: "string"
  20790. }
  20791. },
  20792. url: "/repos/:owner/:repo/automated-security-fixes"
  20793. },
  20794. enablePagesSite: {
  20795. headers: {
  20796. accept: "application/vnd.github.switcheroo-preview+json"
  20797. },
  20798. method: "POST",
  20799. params: {
  20800. owner: {
  20801. required: true,
  20802. type: "string"
  20803. },
  20804. repo: {
  20805. required: true,
  20806. type: "string"
  20807. },
  20808. source: {
  20809. type: "object"
  20810. },
  20811. "source.branch": {
  20812. enum: ["master", "gh-pages"],
  20813. type: "string"
  20814. },
  20815. "source.path": {
  20816. type: "string"
  20817. }
  20818. },
  20819. url: "/repos/:owner/:repo/pages"
  20820. },
  20821. enableVulnerabilityAlerts: {
  20822. headers: {
  20823. accept: "application/vnd.github.dorian-preview+json"
  20824. },
  20825. method: "PUT",
  20826. params: {
  20827. owner: {
  20828. required: true,
  20829. type: "string"
  20830. },
  20831. repo: {
  20832. required: true,
  20833. type: "string"
  20834. }
  20835. },
  20836. url: "/repos/:owner/:repo/vulnerability-alerts"
  20837. },
  20838. get: {
  20839. method: "GET",
  20840. params: {
  20841. owner: {
  20842. required: true,
  20843. type: "string"
  20844. },
  20845. repo: {
  20846. required: true,
  20847. type: "string"
  20848. }
  20849. },
  20850. url: "/repos/:owner/:repo"
  20851. },
  20852. getAppsWithAccessToProtectedBranch: {
  20853. method: "GET",
  20854. params: {
  20855. branch: {
  20856. required: true,
  20857. type: "string"
  20858. },
  20859. owner: {
  20860. required: true,
  20861. type: "string"
  20862. },
  20863. repo: {
  20864. required: true,
  20865. type: "string"
  20866. }
  20867. },
  20868. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20869. },
  20870. getArchiveLink: {
  20871. method: "GET",
  20872. params: {
  20873. archive_format: {
  20874. required: true,
  20875. type: "string"
  20876. },
  20877. owner: {
  20878. required: true,
  20879. type: "string"
  20880. },
  20881. ref: {
  20882. required: true,
  20883. type: "string"
  20884. },
  20885. repo: {
  20886. required: true,
  20887. type: "string"
  20888. }
  20889. },
  20890. url: "/repos/:owner/:repo/:archive_format/:ref"
  20891. },
  20892. getBranch: {
  20893. method: "GET",
  20894. params: {
  20895. branch: {
  20896. required: true,
  20897. type: "string"
  20898. },
  20899. owner: {
  20900. required: true,
  20901. type: "string"
  20902. },
  20903. repo: {
  20904. required: true,
  20905. type: "string"
  20906. }
  20907. },
  20908. url: "/repos/:owner/:repo/branches/:branch"
  20909. },
  20910. getBranchProtection: {
  20911. method: "GET",
  20912. params: {
  20913. branch: {
  20914. required: true,
  20915. type: "string"
  20916. },
  20917. owner: {
  20918. required: true,
  20919. type: "string"
  20920. },
  20921. repo: {
  20922. required: true,
  20923. type: "string"
  20924. }
  20925. },
  20926. url: "/repos/:owner/:repo/branches/:branch/protection"
  20927. },
  20928. getClones: {
  20929. method: "GET",
  20930. params: {
  20931. owner: {
  20932. required: true,
  20933. type: "string"
  20934. },
  20935. per: {
  20936. enum: ["day", "week"],
  20937. type: "string"
  20938. },
  20939. repo: {
  20940. required: true,
  20941. type: "string"
  20942. }
  20943. },
  20944. url: "/repos/:owner/:repo/traffic/clones"
  20945. },
  20946. getCodeFrequencyStats: {
  20947. method: "GET",
  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/stats/code_frequency"
  20959. },
  20960. getCollaboratorPermissionLevel: {
  20961. method: "GET",
  20962. params: {
  20963. owner: {
  20964. required: true,
  20965. type: "string"
  20966. },
  20967. repo: {
  20968. required: true,
  20969. type: "string"
  20970. },
  20971. username: {
  20972. required: true,
  20973. type: "string"
  20974. }
  20975. },
  20976. url: "/repos/:owner/:repo/collaborators/:username/permission"
  20977. },
  20978. getCombinedStatusForRef: {
  20979. method: "GET",
  20980. params: {
  20981. owner: {
  20982. required: true,
  20983. type: "string"
  20984. },
  20985. ref: {
  20986. required: true,
  20987. type: "string"
  20988. },
  20989. repo: {
  20990. required: true,
  20991. type: "string"
  20992. }
  20993. },
  20994. url: "/repos/:owner/:repo/commits/:ref/status"
  20995. },
  20996. getCommit: {
  20997. method: "GET",
  20998. params: {
  20999. commit_sha: {
  21000. alias: "ref",
  21001. deprecated: true,
  21002. type: "string"
  21003. },
  21004. owner: {
  21005. required: true,
  21006. type: "string"
  21007. },
  21008. ref: {
  21009. required: true,
  21010. type: "string"
  21011. },
  21012. repo: {
  21013. required: true,
  21014. type: "string"
  21015. },
  21016. sha: {
  21017. alias: "ref",
  21018. deprecated: true,
  21019. type: "string"
  21020. }
  21021. },
  21022. url: "/repos/:owner/:repo/commits/:ref"
  21023. },
  21024. getCommitActivityStats: {
  21025. method: "GET",
  21026. params: {
  21027. owner: {
  21028. required: true,
  21029. type: "string"
  21030. },
  21031. repo: {
  21032. required: true,
  21033. type: "string"
  21034. }
  21035. },
  21036. url: "/repos/:owner/:repo/stats/commit_activity"
  21037. },
  21038. getCommitComment: {
  21039. method: "GET",
  21040. params: {
  21041. comment_id: {
  21042. required: true,
  21043. type: "integer"
  21044. },
  21045. owner: {
  21046. required: true,
  21047. type: "string"
  21048. },
  21049. repo: {
  21050. required: true,
  21051. type: "string"
  21052. }
  21053. },
  21054. url: "/repos/:owner/:repo/comments/:comment_id"
  21055. },
  21056. getCommitRefSha: {
  21057. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21058. headers: {
  21059. accept: "application/vnd.github.v3.sha"
  21060. },
  21061. method: "GET",
  21062. params: {
  21063. owner: {
  21064. required: true,
  21065. type: "string"
  21066. },
  21067. ref: {
  21068. required: true,
  21069. type: "string"
  21070. },
  21071. repo: {
  21072. required: true,
  21073. type: "string"
  21074. }
  21075. },
  21076. url: "/repos/:owner/:repo/commits/:ref"
  21077. },
  21078. getContents: {
  21079. method: "GET",
  21080. params: {
  21081. owner: {
  21082. required: true,
  21083. type: "string"
  21084. },
  21085. path: {
  21086. required: true,
  21087. type: "string"
  21088. },
  21089. ref: {
  21090. type: "string"
  21091. },
  21092. repo: {
  21093. required: true,
  21094. type: "string"
  21095. }
  21096. },
  21097. url: "/repos/:owner/:repo/contents/:path"
  21098. },
  21099. getContributorsStats: {
  21100. method: "GET",
  21101. params: {
  21102. owner: {
  21103. required: true,
  21104. type: "string"
  21105. },
  21106. repo: {
  21107. required: true,
  21108. type: "string"
  21109. }
  21110. },
  21111. url: "/repos/:owner/:repo/stats/contributors"
  21112. },
  21113. getDeployKey: {
  21114. method: "GET",
  21115. params: {
  21116. key_id: {
  21117. required: true,
  21118. type: "integer"
  21119. },
  21120. owner: {
  21121. required: true,
  21122. type: "string"
  21123. },
  21124. repo: {
  21125. required: true,
  21126. type: "string"
  21127. }
  21128. },
  21129. url: "/repos/:owner/:repo/keys/:key_id"
  21130. },
  21131. getDeployment: {
  21132. method: "GET",
  21133. params: {
  21134. deployment_id: {
  21135. required: true,
  21136. type: "integer"
  21137. },
  21138. owner: {
  21139. required: true,
  21140. type: "string"
  21141. },
  21142. repo: {
  21143. required: true,
  21144. type: "string"
  21145. }
  21146. },
  21147. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21148. },
  21149. getDeploymentStatus: {
  21150. method: "GET",
  21151. params: {
  21152. deployment_id: {
  21153. required: true,
  21154. type: "integer"
  21155. },
  21156. owner: {
  21157. required: true,
  21158. type: "string"
  21159. },
  21160. repo: {
  21161. required: true,
  21162. type: "string"
  21163. },
  21164. status_id: {
  21165. required: true,
  21166. type: "integer"
  21167. }
  21168. },
  21169. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21170. },
  21171. getDownload: {
  21172. method: "GET",
  21173. params: {
  21174. download_id: {
  21175. required: true,
  21176. type: "integer"
  21177. },
  21178. owner: {
  21179. required: true,
  21180. type: "string"
  21181. },
  21182. repo: {
  21183. required: true,
  21184. type: "string"
  21185. }
  21186. },
  21187. url: "/repos/:owner/:repo/downloads/:download_id"
  21188. },
  21189. getHook: {
  21190. method: "GET",
  21191. params: {
  21192. hook_id: {
  21193. required: true,
  21194. type: "integer"
  21195. },
  21196. owner: {
  21197. required: true,
  21198. type: "string"
  21199. },
  21200. repo: {
  21201. required: true,
  21202. type: "string"
  21203. }
  21204. },
  21205. url: "/repos/:owner/:repo/hooks/:hook_id"
  21206. },
  21207. getLatestPagesBuild: {
  21208. method: "GET",
  21209. params: {
  21210. owner: {
  21211. required: true,
  21212. type: "string"
  21213. },
  21214. repo: {
  21215. required: true,
  21216. type: "string"
  21217. }
  21218. },
  21219. url: "/repos/:owner/:repo/pages/builds/latest"
  21220. },
  21221. getLatestRelease: {
  21222. method: "GET",
  21223. params: {
  21224. owner: {
  21225. required: true,
  21226. type: "string"
  21227. },
  21228. repo: {
  21229. required: true,
  21230. type: "string"
  21231. }
  21232. },
  21233. url: "/repos/:owner/:repo/releases/latest"
  21234. },
  21235. getPages: {
  21236. method: "GET",
  21237. params: {
  21238. owner: {
  21239. required: true,
  21240. type: "string"
  21241. },
  21242. repo: {
  21243. required: true,
  21244. type: "string"
  21245. }
  21246. },
  21247. url: "/repos/:owner/:repo/pages"
  21248. },
  21249. getPagesBuild: {
  21250. method: "GET",
  21251. params: {
  21252. build_id: {
  21253. required: true,
  21254. type: "integer"
  21255. },
  21256. owner: {
  21257. required: true,
  21258. type: "string"
  21259. },
  21260. repo: {
  21261. required: true,
  21262. type: "string"
  21263. }
  21264. },
  21265. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21266. },
  21267. getParticipationStats: {
  21268. method: "GET",
  21269. params: {
  21270. owner: {
  21271. required: true,
  21272. type: "string"
  21273. },
  21274. repo: {
  21275. required: true,
  21276. type: "string"
  21277. }
  21278. },
  21279. url: "/repos/:owner/:repo/stats/participation"
  21280. },
  21281. getProtectedBranchAdminEnforcement: {
  21282. method: "GET",
  21283. params: {
  21284. branch: {
  21285. required: true,
  21286. type: "string"
  21287. },
  21288. owner: {
  21289. required: true,
  21290. type: "string"
  21291. },
  21292. repo: {
  21293. required: true,
  21294. type: "string"
  21295. }
  21296. },
  21297. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21298. },
  21299. getProtectedBranchPullRequestReviewEnforcement: {
  21300. method: "GET",
  21301. params: {
  21302. branch: {
  21303. required: true,
  21304. type: "string"
  21305. },
  21306. owner: {
  21307. required: true,
  21308. type: "string"
  21309. },
  21310. repo: {
  21311. required: true,
  21312. type: "string"
  21313. }
  21314. },
  21315. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21316. },
  21317. getProtectedBranchRequiredSignatures: {
  21318. headers: {
  21319. accept: "application/vnd.github.zzzax-preview+json"
  21320. },
  21321. method: "GET",
  21322. params: {
  21323. branch: {
  21324. required: true,
  21325. type: "string"
  21326. },
  21327. owner: {
  21328. required: true,
  21329. type: "string"
  21330. },
  21331. repo: {
  21332. required: true,
  21333. type: "string"
  21334. }
  21335. },
  21336. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21337. },
  21338. getProtectedBranchRequiredStatusChecks: {
  21339. method: "GET",
  21340. params: {
  21341. branch: {
  21342. required: true,
  21343. type: "string"
  21344. },
  21345. owner: {
  21346. required: true,
  21347. type: "string"
  21348. },
  21349. repo: {
  21350. required: true,
  21351. type: "string"
  21352. }
  21353. },
  21354. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21355. },
  21356. getProtectedBranchRestrictions: {
  21357. method: "GET",
  21358. params: {
  21359. branch: {
  21360. required: true,
  21361. type: "string"
  21362. },
  21363. owner: {
  21364. required: true,
  21365. type: "string"
  21366. },
  21367. repo: {
  21368. required: true,
  21369. type: "string"
  21370. }
  21371. },
  21372. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21373. },
  21374. getPunchCardStats: {
  21375. method: "GET",
  21376. params: {
  21377. owner: {
  21378. required: true,
  21379. type: "string"
  21380. },
  21381. repo: {
  21382. required: true,
  21383. type: "string"
  21384. }
  21385. },
  21386. url: "/repos/:owner/:repo/stats/punch_card"
  21387. },
  21388. getReadme: {
  21389. method: "GET",
  21390. params: {
  21391. owner: {
  21392. required: true,
  21393. type: "string"
  21394. },
  21395. ref: {
  21396. type: "string"
  21397. },
  21398. repo: {
  21399. required: true,
  21400. type: "string"
  21401. }
  21402. },
  21403. url: "/repos/:owner/:repo/readme"
  21404. },
  21405. getRelease: {
  21406. method: "GET",
  21407. params: {
  21408. owner: {
  21409. required: true,
  21410. type: "string"
  21411. },
  21412. release_id: {
  21413. required: true,
  21414. type: "integer"
  21415. },
  21416. repo: {
  21417. required: true,
  21418. type: "string"
  21419. }
  21420. },
  21421. url: "/repos/:owner/:repo/releases/:release_id"
  21422. },
  21423. getReleaseAsset: {
  21424. method: "GET",
  21425. params: {
  21426. asset_id: {
  21427. required: true,
  21428. type: "integer"
  21429. },
  21430. owner: {
  21431. required: true,
  21432. type: "string"
  21433. },
  21434. repo: {
  21435. required: true,
  21436. type: "string"
  21437. }
  21438. },
  21439. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21440. },
  21441. getReleaseByTag: {
  21442. method: "GET",
  21443. params: {
  21444. owner: {
  21445. required: true,
  21446. type: "string"
  21447. },
  21448. repo: {
  21449. required: true,
  21450. type: "string"
  21451. },
  21452. tag: {
  21453. required: true,
  21454. type: "string"
  21455. }
  21456. },
  21457. url: "/repos/:owner/:repo/releases/tags/:tag"
  21458. },
  21459. getTeamsWithAccessToProtectedBranch: {
  21460. method: "GET",
  21461. params: {
  21462. branch: {
  21463. required: true,
  21464. type: "string"
  21465. },
  21466. owner: {
  21467. required: true,
  21468. type: "string"
  21469. },
  21470. repo: {
  21471. required: true,
  21472. type: "string"
  21473. }
  21474. },
  21475. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21476. },
  21477. getTopPaths: {
  21478. method: "GET",
  21479. params: {
  21480. owner: {
  21481. required: true,
  21482. type: "string"
  21483. },
  21484. repo: {
  21485. required: true,
  21486. type: "string"
  21487. }
  21488. },
  21489. url: "/repos/:owner/:repo/traffic/popular/paths"
  21490. },
  21491. getTopReferrers: {
  21492. method: "GET",
  21493. params: {
  21494. owner: {
  21495. required: true,
  21496. type: "string"
  21497. },
  21498. repo: {
  21499. required: true,
  21500. type: "string"
  21501. }
  21502. },
  21503. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21504. },
  21505. getUsersWithAccessToProtectedBranch: {
  21506. method: "GET",
  21507. params: {
  21508. branch: {
  21509. required: true,
  21510. type: "string"
  21511. },
  21512. owner: {
  21513. required: true,
  21514. type: "string"
  21515. },
  21516. repo: {
  21517. required: true,
  21518. type: "string"
  21519. }
  21520. },
  21521. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21522. },
  21523. getViews: {
  21524. method: "GET",
  21525. params: {
  21526. owner: {
  21527. required: true,
  21528. type: "string"
  21529. },
  21530. per: {
  21531. enum: ["day", "week"],
  21532. type: "string"
  21533. },
  21534. repo: {
  21535. required: true,
  21536. type: "string"
  21537. }
  21538. },
  21539. url: "/repos/:owner/:repo/traffic/views"
  21540. },
  21541. list: {
  21542. method: "GET",
  21543. params: {
  21544. affiliation: {
  21545. type: "string"
  21546. },
  21547. direction: {
  21548. enum: ["asc", "desc"],
  21549. type: "string"
  21550. },
  21551. page: {
  21552. type: "integer"
  21553. },
  21554. per_page: {
  21555. type: "integer"
  21556. },
  21557. sort: {
  21558. enum: ["created", "updated", "pushed", "full_name"],
  21559. type: "string"
  21560. },
  21561. type: {
  21562. enum: ["all", "owner", "public", "private", "member"],
  21563. type: "string"
  21564. },
  21565. visibility: {
  21566. enum: ["all", "public", "private"],
  21567. type: "string"
  21568. }
  21569. },
  21570. url: "/user/repos"
  21571. },
  21572. listAppsWithAccessToProtectedBranch: {
  21573. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  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/apps"
  21590. },
  21591. listAssetsForRelease: {
  21592. method: "GET",
  21593. params: {
  21594. owner: {
  21595. required: true,
  21596. type: "string"
  21597. },
  21598. page: {
  21599. type: "integer"
  21600. },
  21601. per_page: {
  21602. type: "integer"
  21603. },
  21604. release_id: {
  21605. required: true,
  21606. type: "integer"
  21607. },
  21608. repo: {
  21609. required: true,
  21610. type: "string"
  21611. }
  21612. },
  21613. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21614. },
  21615. listBranches: {
  21616. method: "GET",
  21617. params: {
  21618. owner: {
  21619. required: true,
  21620. type: "string"
  21621. },
  21622. page: {
  21623. type: "integer"
  21624. },
  21625. per_page: {
  21626. type: "integer"
  21627. },
  21628. protected: {
  21629. type: "boolean"
  21630. },
  21631. repo: {
  21632. required: true,
  21633. type: "string"
  21634. }
  21635. },
  21636. url: "/repos/:owner/:repo/branches"
  21637. },
  21638. listBranchesForHeadCommit: {
  21639. headers: {
  21640. accept: "application/vnd.github.groot-preview+json"
  21641. },
  21642. method: "GET",
  21643. params: {
  21644. commit_sha: {
  21645. required: true,
  21646. type: "string"
  21647. },
  21648. owner: {
  21649. required: true,
  21650. type: "string"
  21651. },
  21652. repo: {
  21653. required: true,
  21654. type: "string"
  21655. }
  21656. },
  21657. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21658. },
  21659. listCollaborators: {
  21660. method: "GET",
  21661. params: {
  21662. affiliation: {
  21663. enum: ["outside", "direct", "all"],
  21664. type: "string"
  21665. },
  21666. owner: {
  21667. required: true,
  21668. type: "string"
  21669. },
  21670. page: {
  21671. type: "integer"
  21672. },
  21673. per_page: {
  21674. type: "integer"
  21675. },
  21676. repo: {
  21677. required: true,
  21678. type: "string"
  21679. }
  21680. },
  21681. url: "/repos/:owner/:repo/collaborators"
  21682. },
  21683. listCommentsForCommit: {
  21684. method: "GET",
  21685. params: {
  21686. commit_sha: {
  21687. required: true,
  21688. type: "string"
  21689. },
  21690. owner: {
  21691. required: true,
  21692. type: "string"
  21693. },
  21694. page: {
  21695. type: "integer"
  21696. },
  21697. per_page: {
  21698. type: "integer"
  21699. },
  21700. ref: {
  21701. alias: "commit_sha",
  21702. deprecated: true,
  21703. type: "string"
  21704. },
  21705. repo: {
  21706. required: true,
  21707. type: "string"
  21708. }
  21709. },
  21710. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21711. },
  21712. listCommitComments: {
  21713. method: "GET",
  21714. params: {
  21715. owner: {
  21716. required: true,
  21717. type: "string"
  21718. },
  21719. page: {
  21720. type: "integer"
  21721. },
  21722. per_page: {
  21723. type: "integer"
  21724. },
  21725. repo: {
  21726. required: true,
  21727. type: "string"
  21728. }
  21729. },
  21730. url: "/repos/:owner/:repo/comments"
  21731. },
  21732. listCommits: {
  21733. method: "GET",
  21734. params: {
  21735. author: {
  21736. type: "string"
  21737. },
  21738. owner: {
  21739. required: true,
  21740. type: "string"
  21741. },
  21742. page: {
  21743. type: "integer"
  21744. },
  21745. path: {
  21746. type: "string"
  21747. },
  21748. per_page: {
  21749. type: "integer"
  21750. },
  21751. repo: {
  21752. required: true,
  21753. type: "string"
  21754. },
  21755. sha: {
  21756. type: "string"
  21757. },
  21758. since: {
  21759. type: "string"
  21760. },
  21761. until: {
  21762. type: "string"
  21763. }
  21764. },
  21765. url: "/repos/:owner/:repo/commits"
  21766. },
  21767. listContributors: {
  21768. method: "GET",
  21769. params: {
  21770. anon: {
  21771. type: "string"
  21772. },
  21773. owner: {
  21774. required: true,
  21775. type: "string"
  21776. },
  21777. page: {
  21778. type: "integer"
  21779. },
  21780. per_page: {
  21781. type: "integer"
  21782. },
  21783. repo: {
  21784. required: true,
  21785. type: "string"
  21786. }
  21787. },
  21788. url: "/repos/:owner/:repo/contributors"
  21789. },
  21790. listDeployKeys: {
  21791. method: "GET",
  21792. params: {
  21793. owner: {
  21794. required: true,
  21795. type: "string"
  21796. },
  21797. page: {
  21798. type: "integer"
  21799. },
  21800. per_page: {
  21801. type: "integer"
  21802. },
  21803. repo: {
  21804. required: true,
  21805. type: "string"
  21806. }
  21807. },
  21808. url: "/repos/:owner/:repo/keys"
  21809. },
  21810. listDeploymentStatuses: {
  21811. method: "GET",
  21812. params: {
  21813. deployment_id: {
  21814. required: true,
  21815. type: "integer"
  21816. },
  21817. owner: {
  21818. required: true,
  21819. type: "string"
  21820. },
  21821. page: {
  21822. type: "integer"
  21823. },
  21824. per_page: {
  21825. type: "integer"
  21826. },
  21827. repo: {
  21828. required: true,
  21829. type: "string"
  21830. }
  21831. },
  21832. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  21833. },
  21834. listDeployments: {
  21835. method: "GET",
  21836. params: {
  21837. environment: {
  21838. type: "string"
  21839. },
  21840. owner: {
  21841. required: true,
  21842. type: "string"
  21843. },
  21844. page: {
  21845. type: "integer"
  21846. },
  21847. per_page: {
  21848. type: "integer"
  21849. },
  21850. ref: {
  21851. type: "string"
  21852. },
  21853. repo: {
  21854. required: true,
  21855. type: "string"
  21856. },
  21857. sha: {
  21858. type: "string"
  21859. },
  21860. task: {
  21861. type: "string"
  21862. }
  21863. },
  21864. url: "/repos/:owner/:repo/deployments"
  21865. },
  21866. listDownloads: {
  21867. method: "GET",
  21868. params: {
  21869. owner: {
  21870. required: true,
  21871. type: "string"
  21872. },
  21873. page: {
  21874. type: "integer"
  21875. },
  21876. per_page: {
  21877. type: "integer"
  21878. },
  21879. repo: {
  21880. required: true,
  21881. type: "string"
  21882. }
  21883. },
  21884. url: "/repos/:owner/:repo/downloads"
  21885. },
  21886. listForOrg: {
  21887. method: "GET",
  21888. params: {
  21889. direction: {
  21890. enum: ["asc", "desc"],
  21891. type: "string"
  21892. },
  21893. org: {
  21894. required: true,
  21895. type: "string"
  21896. },
  21897. page: {
  21898. type: "integer"
  21899. },
  21900. per_page: {
  21901. type: "integer"
  21902. },
  21903. sort: {
  21904. enum: ["created", "updated", "pushed", "full_name"],
  21905. type: "string"
  21906. },
  21907. type: {
  21908. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  21909. type: "string"
  21910. }
  21911. },
  21912. url: "/orgs/:org/repos"
  21913. },
  21914. listForUser: {
  21915. method: "GET",
  21916. params: {
  21917. direction: {
  21918. enum: ["asc", "desc"],
  21919. type: "string"
  21920. },
  21921. page: {
  21922. type: "integer"
  21923. },
  21924. per_page: {
  21925. type: "integer"
  21926. },
  21927. sort: {
  21928. enum: ["created", "updated", "pushed", "full_name"],
  21929. type: "string"
  21930. },
  21931. type: {
  21932. enum: ["all", "owner", "member"],
  21933. type: "string"
  21934. },
  21935. username: {
  21936. required: true,
  21937. type: "string"
  21938. }
  21939. },
  21940. url: "/users/:username/repos"
  21941. },
  21942. listForks: {
  21943. method: "GET",
  21944. params: {
  21945. owner: {
  21946. required: true,
  21947. type: "string"
  21948. },
  21949. page: {
  21950. type: "integer"
  21951. },
  21952. per_page: {
  21953. type: "integer"
  21954. },
  21955. repo: {
  21956. required: true,
  21957. type: "string"
  21958. },
  21959. sort: {
  21960. enum: ["newest", "oldest", "stargazers"],
  21961. type: "string"
  21962. }
  21963. },
  21964. url: "/repos/:owner/:repo/forks"
  21965. },
  21966. listHooks: {
  21967. method: "GET",
  21968. params: {
  21969. owner: {
  21970. required: true,
  21971. type: "string"
  21972. },
  21973. page: {
  21974. type: "integer"
  21975. },
  21976. per_page: {
  21977. type: "integer"
  21978. },
  21979. repo: {
  21980. required: true,
  21981. type: "string"
  21982. }
  21983. },
  21984. url: "/repos/:owner/:repo/hooks"
  21985. },
  21986. listInvitations: {
  21987. method: "GET",
  21988. params: {
  21989. owner: {
  21990. required: true,
  21991. type: "string"
  21992. },
  21993. page: {
  21994. type: "integer"
  21995. },
  21996. per_page: {
  21997. type: "integer"
  21998. },
  21999. repo: {
  22000. required: true,
  22001. type: "string"
  22002. }
  22003. },
  22004. url: "/repos/:owner/:repo/invitations"
  22005. },
  22006. listInvitationsForAuthenticatedUser: {
  22007. method: "GET",
  22008. params: {
  22009. page: {
  22010. type: "integer"
  22011. },
  22012. per_page: {
  22013. type: "integer"
  22014. }
  22015. },
  22016. url: "/user/repository_invitations"
  22017. },
  22018. listLanguages: {
  22019. method: "GET",
  22020. params: {
  22021. owner: {
  22022. required: true,
  22023. type: "string"
  22024. },
  22025. repo: {
  22026. required: true,
  22027. type: "string"
  22028. }
  22029. },
  22030. url: "/repos/:owner/:repo/languages"
  22031. },
  22032. listPagesBuilds: {
  22033. method: "GET",
  22034. params: {
  22035. owner: {
  22036. required: true,
  22037. type: "string"
  22038. },
  22039. page: {
  22040. type: "integer"
  22041. },
  22042. per_page: {
  22043. type: "integer"
  22044. },
  22045. repo: {
  22046. required: true,
  22047. type: "string"
  22048. }
  22049. },
  22050. url: "/repos/:owner/:repo/pages/builds"
  22051. },
  22052. listProtectedBranchRequiredStatusChecksContexts: {
  22053. method: "GET",
  22054. params: {
  22055. branch: {
  22056. required: true,
  22057. type: "string"
  22058. },
  22059. owner: {
  22060. required: true,
  22061. type: "string"
  22062. },
  22063. repo: {
  22064. required: true,
  22065. type: "string"
  22066. }
  22067. },
  22068. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22069. },
  22070. listProtectedBranchTeamRestrictions: {
  22071. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22072. method: "GET",
  22073. params: {
  22074. branch: {
  22075. required: true,
  22076. type: "string"
  22077. },
  22078. owner: {
  22079. required: true,
  22080. type: "string"
  22081. },
  22082. repo: {
  22083. required: true,
  22084. type: "string"
  22085. }
  22086. },
  22087. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22088. },
  22089. listProtectedBranchUserRestrictions: {
  22090. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22091. method: "GET",
  22092. params: {
  22093. branch: {
  22094. required: true,
  22095. type: "string"
  22096. },
  22097. owner: {
  22098. required: true,
  22099. type: "string"
  22100. },
  22101. repo: {
  22102. required: true,
  22103. type: "string"
  22104. }
  22105. },
  22106. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22107. },
  22108. listPublic: {
  22109. method: "GET",
  22110. params: {
  22111. page: {
  22112. type: "integer"
  22113. },
  22114. per_page: {
  22115. type: "integer"
  22116. },
  22117. since: {
  22118. type: "integer"
  22119. }
  22120. },
  22121. url: "/repositories"
  22122. },
  22123. listPullRequestsAssociatedWithCommit: {
  22124. headers: {
  22125. accept: "application/vnd.github.groot-preview+json"
  22126. },
  22127. method: "GET",
  22128. params: {
  22129. commit_sha: {
  22130. required: true,
  22131. type: "string"
  22132. },
  22133. owner: {
  22134. required: true,
  22135. type: "string"
  22136. },
  22137. page: {
  22138. type: "integer"
  22139. },
  22140. per_page: {
  22141. type: "integer"
  22142. },
  22143. repo: {
  22144. required: true,
  22145. type: "string"
  22146. }
  22147. },
  22148. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22149. },
  22150. listReleases: {
  22151. method: "GET",
  22152. params: {
  22153. owner: {
  22154. required: true,
  22155. type: "string"
  22156. },
  22157. page: {
  22158. type: "integer"
  22159. },
  22160. per_page: {
  22161. type: "integer"
  22162. },
  22163. repo: {
  22164. required: true,
  22165. type: "string"
  22166. }
  22167. },
  22168. url: "/repos/:owner/:repo/releases"
  22169. },
  22170. listStatusesForRef: {
  22171. method: "GET",
  22172. params: {
  22173. owner: {
  22174. required: true,
  22175. type: "string"
  22176. },
  22177. page: {
  22178. type: "integer"
  22179. },
  22180. per_page: {
  22181. type: "integer"
  22182. },
  22183. ref: {
  22184. required: true,
  22185. type: "string"
  22186. },
  22187. repo: {
  22188. required: true,
  22189. type: "string"
  22190. }
  22191. },
  22192. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22193. },
  22194. listTags: {
  22195. method: "GET",
  22196. params: {
  22197. owner: {
  22198. required: true,
  22199. type: "string"
  22200. },
  22201. page: {
  22202. type: "integer"
  22203. },
  22204. per_page: {
  22205. type: "integer"
  22206. },
  22207. repo: {
  22208. required: true,
  22209. type: "string"
  22210. }
  22211. },
  22212. url: "/repos/:owner/:repo/tags"
  22213. },
  22214. listTeams: {
  22215. method: "GET",
  22216. params: {
  22217. owner: {
  22218. required: true,
  22219. type: "string"
  22220. },
  22221. page: {
  22222. type: "integer"
  22223. },
  22224. per_page: {
  22225. type: "integer"
  22226. },
  22227. repo: {
  22228. required: true,
  22229. type: "string"
  22230. }
  22231. },
  22232. url: "/repos/:owner/:repo/teams"
  22233. },
  22234. listTeamsWithAccessToProtectedBranch: {
  22235. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22236. method: "GET",
  22237. params: {
  22238. branch: {
  22239. required: true,
  22240. type: "string"
  22241. },
  22242. owner: {
  22243. required: true,
  22244. type: "string"
  22245. },
  22246. repo: {
  22247. required: true,
  22248. type: "string"
  22249. }
  22250. },
  22251. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22252. },
  22253. listTopics: {
  22254. headers: {
  22255. accept: "application/vnd.github.mercy-preview+json"
  22256. },
  22257. method: "GET",
  22258. params: {
  22259. owner: {
  22260. required: true,
  22261. type: "string"
  22262. },
  22263. repo: {
  22264. required: true,
  22265. type: "string"
  22266. }
  22267. },
  22268. url: "/repos/:owner/:repo/topics"
  22269. },
  22270. listUsersWithAccessToProtectedBranch: {
  22271. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22272. method: "GET",
  22273. params: {
  22274. branch: {
  22275. required: true,
  22276. type: "string"
  22277. },
  22278. owner: {
  22279. required: true,
  22280. type: "string"
  22281. },
  22282. repo: {
  22283. required: true,
  22284. type: "string"
  22285. }
  22286. },
  22287. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22288. },
  22289. merge: {
  22290. method: "POST",
  22291. params: {
  22292. base: {
  22293. required: true,
  22294. type: "string"
  22295. },
  22296. commit_message: {
  22297. type: "string"
  22298. },
  22299. head: {
  22300. required: true,
  22301. type: "string"
  22302. },
  22303. owner: {
  22304. required: true,
  22305. type: "string"
  22306. },
  22307. repo: {
  22308. required: true,
  22309. type: "string"
  22310. }
  22311. },
  22312. url: "/repos/:owner/:repo/merges"
  22313. },
  22314. pingHook: {
  22315. method: "POST",
  22316. params: {
  22317. hook_id: {
  22318. required: true,
  22319. type: "integer"
  22320. },
  22321. owner: {
  22322. required: true,
  22323. type: "string"
  22324. },
  22325. repo: {
  22326. required: true,
  22327. type: "string"
  22328. }
  22329. },
  22330. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22331. },
  22332. removeBranchProtection: {
  22333. method: "DELETE",
  22334. params: {
  22335. branch: {
  22336. required: true,
  22337. type: "string"
  22338. },
  22339. owner: {
  22340. required: true,
  22341. type: "string"
  22342. },
  22343. repo: {
  22344. required: true,
  22345. type: "string"
  22346. }
  22347. },
  22348. url: "/repos/:owner/:repo/branches/:branch/protection"
  22349. },
  22350. removeCollaborator: {
  22351. method: "DELETE",
  22352. params: {
  22353. owner: {
  22354. required: true,
  22355. type: "string"
  22356. },
  22357. repo: {
  22358. required: true,
  22359. type: "string"
  22360. },
  22361. username: {
  22362. required: true,
  22363. type: "string"
  22364. }
  22365. },
  22366. url: "/repos/:owner/:repo/collaborators/:username"
  22367. },
  22368. removeDeployKey: {
  22369. method: "DELETE",
  22370. params: {
  22371. key_id: {
  22372. required: true,
  22373. type: "integer"
  22374. },
  22375. owner: {
  22376. required: true,
  22377. type: "string"
  22378. },
  22379. repo: {
  22380. required: true,
  22381. type: "string"
  22382. }
  22383. },
  22384. url: "/repos/:owner/:repo/keys/:key_id"
  22385. },
  22386. removeProtectedBranchAdminEnforcement: {
  22387. method: "DELETE",
  22388. params: {
  22389. branch: {
  22390. required: true,
  22391. type: "string"
  22392. },
  22393. owner: {
  22394. required: true,
  22395. type: "string"
  22396. },
  22397. repo: {
  22398. required: true,
  22399. type: "string"
  22400. }
  22401. },
  22402. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22403. },
  22404. removeProtectedBranchAppRestrictions: {
  22405. method: "DELETE",
  22406. params: {
  22407. apps: {
  22408. mapTo: "data",
  22409. required: true,
  22410. type: "string[]"
  22411. },
  22412. branch: {
  22413. required: true,
  22414. type: "string"
  22415. },
  22416. owner: {
  22417. required: true,
  22418. type: "string"
  22419. },
  22420. repo: {
  22421. required: true,
  22422. type: "string"
  22423. }
  22424. },
  22425. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22426. },
  22427. removeProtectedBranchPullRequestReviewEnforcement: {
  22428. method: "DELETE",
  22429. params: {
  22430. branch: {
  22431. required: true,
  22432. type: "string"
  22433. },
  22434. owner: {
  22435. required: true,
  22436. type: "string"
  22437. },
  22438. repo: {
  22439. required: true,
  22440. type: "string"
  22441. }
  22442. },
  22443. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22444. },
  22445. removeProtectedBranchRequiredSignatures: {
  22446. headers: {
  22447. accept: "application/vnd.github.zzzax-preview+json"
  22448. },
  22449. method: "DELETE",
  22450. params: {
  22451. branch: {
  22452. required: true,
  22453. type: "string"
  22454. },
  22455. owner: {
  22456. required: true,
  22457. type: "string"
  22458. },
  22459. repo: {
  22460. required: true,
  22461. type: "string"
  22462. }
  22463. },
  22464. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22465. },
  22466. removeProtectedBranchRequiredStatusChecks: {
  22467. method: "DELETE",
  22468. params: {
  22469. branch: {
  22470. required: true,
  22471. type: "string"
  22472. },
  22473. owner: {
  22474. required: true,
  22475. type: "string"
  22476. },
  22477. repo: {
  22478. required: true,
  22479. type: "string"
  22480. }
  22481. },
  22482. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22483. },
  22484. removeProtectedBranchRequiredStatusChecksContexts: {
  22485. method: "DELETE",
  22486. params: {
  22487. branch: {
  22488. required: true,
  22489. type: "string"
  22490. },
  22491. contexts: {
  22492. mapTo: "data",
  22493. required: true,
  22494. type: "string[]"
  22495. },
  22496. owner: {
  22497. required: true,
  22498. type: "string"
  22499. },
  22500. repo: {
  22501. required: true,
  22502. type: "string"
  22503. }
  22504. },
  22505. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22506. },
  22507. removeProtectedBranchRestrictions: {
  22508. method: "DELETE",
  22509. params: {
  22510. branch: {
  22511. required: true,
  22512. type: "string"
  22513. },
  22514. owner: {
  22515. required: true,
  22516. type: "string"
  22517. },
  22518. repo: {
  22519. required: true,
  22520. type: "string"
  22521. }
  22522. },
  22523. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22524. },
  22525. removeProtectedBranchTeamRestrictions: {
  22526. method: "DELETE",
  22527. params: {
  22528. branch: {
  22529. required: true,
  22530. type: "string"
  22531. },
  22532. owner: {
  22533. required: true,
  22534. type: "string"
  22535. },
  22536. repo: {
  22537. required: true,
  22538. type: "string"
  22539. },
  22540. teams: {
  22541. mapTo: "data",
  22542. required: true,
  22543. type: "string[]"
  22544. }
  22545. },
  22546. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22547. },
  22548. removeProtectedBranchUserRestrictions: {
  22549. method: "DELETE",
  22550. params: {
  22551. branch: {
  22552. required: true,
  22553. type: "string"
  22554. },
  22555. owner: {
  22556. required: true,
  22557. type: "string"
  22558. },
  22559. repo: {
  22560. required: true,
  22561. type: "string"
  22562. },
  22563. users: {
  22564. mapTo: "data",
  22565. required: true,
  22566. type: "string[]"
  22567. }
  22568. },
  22569. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22570. },
  22571. replaceProtectedBranchAppRestrictions: {
  22572. method: "PUT",
  22573. params: {
  22574. apps: {
  22575. mapTo: "data",
  22576. required: true,
  22577. type: "string[]"
  22578. },
  22579. branch: {
  22580. required: true,
  22581. type: "string"
  22582. },
  22583. owner: {
  22584. required: true,
  22585. type: "string"
  22586. },
  22587. repo: {
  22588. required: true,
  22589. type: "string"
  22590. }
  22591. },
  22592. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22593. },
  22594. replaceProtectedBranchRequiredStatusChecksContexts: {
  22595. method: "PUT",
  22596. params: {
  22597. branch: {
  22598. required: true,
  22599. type: "string"
  22600. },
  22601. contexts: {
  22602. mapTo: "data",
  22603. required: true,
  22604. type: "string[]"
  22605. },
  22606. owner: {
  22607. required: true,
  22608. type: "string"
  22609. },
  22610. repo: {
  22611. required: true,
  22612. type: "string"
  22613. }
  22614. },
  22615. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22616. },
  22617. replaceProtectedBranchTeamRestrictions: {
  22618. method: "PUT",
  22619. params: {
  22620. branch: {
  22621. required: true,
  22622. type: "string"
  22623. },
  22624. owner: {
  22625. required: true,
  22626. type: "string"
  22627. },
  22628. repo: {
  22629. required: true,
  22630. type: "string"
  22631. },
  22632. teams: {
  22633. mapTo: "data",
  22634. required: true,
  22635. type: "string[]"
  22636. }
  22637. },
  22638. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22639. },
  22640. replaceProtectedBranchUserRestrictions: {
  22641. method: "PUT",
  22642. params: {
  22643. branch: {
  22644. required: true,
  22645. type: "string"
  22646. },
  22647. owner: {
  22648. required: true,
  22649. type: "string"
  22650. },
  22651. repo: {
  22652. required: true,
  22653. type: "string"
  22654. },
  22655. users: {
  22656. mapTo: "data",
  22657. required: true,
  22658. type: "string[]"
  22659. }
  22660. },
  22661. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22662. },
  22663. replaceTopics: {
  22664. headers: {
  22665. accept: "application/vnd.github.mercy-preview+json"
  22666. },
  22667. method: "PUT",
  22668. params: {
  22669. names: {
  22670. required: true,
  22671. type: "string[]"
  22672. },
  22673. owner: {
  22674. required: true,
  22675. type: "string"
  22676. },
  22677. repo: {
  22678. required: true,
  22679. type: "string"
  22680. }
  22681. },
  22682. url: "/repos/:owner/:repo/topics"
  22683. },
  22684. requestPageBuild: {
  22685. method: "POST",
  22686. params: {
  22687. owner: {
  22688. required: true,
  22689. type: "string"
  22690. },
  22691. repo: {
  22692. required: true,
  22693. type: "string"
  22694. }
  22695. },
  22696. url: "/repos/:owner/:repo/pages/builds"
  22697. },
  22698. retrieveCommunityProfileMetrics: {
  22699. method: "GET",
  22700. params: {
  22701. owner: {
  22702. required: true,
  22703. type: "string"
  22704. },
  22705. repo: {
  22706. required: true,
  22707. type: "string"
  22708. }
  22709. },
  22710. url: "/repos/:owner/:repo/community/profile"
  22711. },
  22712. testPushHook: {
  22713. method: "POST",
  22714. params: {
  22715. hook_id: {
  22716. required: true,
  22717. type: "integer"
  22718. },
  22719. owner: {
  22720. required: true,
  22721. type: "string"
  22722. },
  22723. repo: {
  22724. required: true,
  22725. type: "string"
  22726. }
  22727. },
  22728. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22729. },
  22730. transfer: {
  22731. method: "POST",
  22732. params: {
  22733. new_owner: {
  22734. type: "string"
  22735. },
  22736. owner: {
  22737. required: true,
  22738. type: "string"
  22739. },
  22740. repo: {
  22741. required: true,
  22742. type: "string"
  22743. },
  22744. team_ids: {
  22745. type: "integer[]"
  22746. }
  22747. },
  22748. url: "/repos/:owner/:repo/transfer"
  22749. },
  22750. update: {
  22751. method: "PATCH",
  22752. params: {
  22753. allow_merge_commit: {
  22754. type: "boolean"
  22755. },
  22756. allow_rebase_merge: {
  22757. type: "boolean"
  22758. },
  22759. allow_squash_merge: {
  22760. type: "boolean"
  22761. },
  22762. archived: {
  22763. type: "boolean"
  22764. },
  22765. default_branch: {
  22766. type: "string"
  22767. },
  22768. delete_branch_on_merge: {
  22769. type: "boolean"
  22770. },
  22771. description: {
  22772. type: "string"
  22773. },
  22774. has_issues: {
  22775. type: "boolean"
  22776. },
  22777. has_projects: {
  22778. type: "boolean"
  22779. },
  22780. has_wiki: {
  22781. type: "boolean"
  22782. },
  22783. homepage: {
  22784. type: "string"
  22785. },
  22786. is_template: {
  22787. type: "boolean"
  22788. },
  22789. name: {
  22790. type: "string"
  22791. },
  22792. owner: {
  22793. required: true,
  22794. type: "string"
  22795. },
  22796. private: {
  22797. type: "boolean"
  22798. },
  22799. repo: {
  22800. required: true,
  22801. type: "string"
  22802. },
  22803. visibility: {
  22804. enum: ["public", "private", "visibility", "internal"],
  22805. type: "string"
  22806. }
  22807. },
  22808. url: "/repos/:owner/:repo"
  22809. },
  22810. updateBranchProtection: {
  22811. method: "PUT",
  22812. params: {
  22813. allow_deletions: {
  22814. type: "boolean"
  22815. },
  22816. allow_force_pushes: {
  22817. allowNull: true,
  22818. type: "boolean"
  22819. },
  22820. branch: {
  22821. required: true,
  22822. type: "string"
  22823. },
  22824. enforce_admins: {
  22825. allowNull: true,
  22826. required: true,
  22827. type: "boolean"
  22828. },
  22829. owner: {
  22830. required: true,
  22831. type: "string"
  22832. },
  22833. repo: {
  22834. required: true,
  22835. type: "string"
  22836. },
  22837. required_linear_history: {
  22838. type: "boolean"
  22839. },
  22840. required_pull_request_reviews: {
  22841. allowNull: true,
  22842. required: true,
  22843. type: "object"
  22844. },
  22845. "required_pull_request_reviews.dismiss_stale_reviews": {
  22846. type: "boolean"
  22847. },
  22848. "required_pull_request_reviews.dismissal_restrictions": {
  22849. type: "object"
  22850. },
  22851. "required_pull_request_reviews.dismissal_restrictions.teams": {
  22852. type: "string[]"
  22853. },
  22854. "required_pull_request_reviews.dismissal_restrictions.users": {
  22855. type: "string[]"
  22856. },
  22857. "required_pull_request_reviews.require_code_owner_reviews": {
  22858. type: "boolean"
  22859. },
  22860. "required_pull_request_reviews.required_approving_review_count": {
  22861. type: "integer"
  22862. },
  22863. required_status_checks: {
  22864. allowNull: true,
  22865. required: true,
  22866. type: "object"
  22867. },
  22868. "required_status_checks.contexts": {
  22869. required: true,
  22870. type: "string[]"
  22871. },
  22872. "required_status_checks.strict": {
  22873. required: true,
  22874. type: "boolean"
  22875. },
  22876. restrictions: {
  22877. allowNull: true,
  22878. required: true,
  22879. type: "object"
  22880. },
  22881. "restrictions.apps": {
  22882. type: "string[]"
  22883. },
  22884. "restrictions.teams": {
  22885. required: true,
  22886. type: "string[]"
  22887. },
  22888. "restrictions.users": {
  22889. required: true,
  22890. type: "string[]"
  22891. }
  22892. },
  22893. url: "/repos/:owner/:repo/branches/:branch/protection"
  22894. },
  22895. updateCommitComment: {
  22896. method: "PATCH",
  22897. params: {
  22898. body: {
  22899. required: true,
  22900. type: "string"
  22901. },
  22902. comment_id: {
  22903. required: true,
  22904. type: "integer"
  22905. },
  22906. owner: {
  22907. required: true,
  22908. type: "string"
  22909. },
  22910. repo: {
  22911. required: true,
  22912. type: "string"
  22913. }
  22914. },
  22915. url: "/repos/:owner/:repo/comments/:comment_id"
  22916. },
  22917. updateFile: {
  22918. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  22919. method: "PUT",
  22920. params: {
  22921. author: {
  22922. type: "object"
  22923. },
  22924. "author.email": {
  22925. required: true,
  22926. type: "string"
  22927. },
  22928. "author.name": {
  22929. required: true,
  22930. type: "string"
  22931. },
  22932. branch: {
  22933. type: "string"
  22934. },
  22935. committer: {
  22936. type: "object"
  22937. },
  22938. "committer.email": {
  22939. required: true,
  22940. type: "string"
  22941. },
  22942. "committer.name": {
  22943. required: true,
  22944. type: "string"
  22945. },
  22946. content: {
  22947. required: true,
  22948. type: "string"
  22949. },
  22950. message: {
  22951. required: true,
  22952. type: "string"
  22953. },
  22954. owner: {
  22955. required: true,
  22956. type: "string"
  22957. },
  22958. path: {
  22959. required: true,
  22960. type: "string"
  22961. },
  22962. repo: {
  22963. required: true,
  22964. type: "string"
  22965. },
  22966. sha: {
  22967. type: "string"
  22968. }
  22969. },
  22970. url: "/repos/:owner/:repo/contents/:path"
  22971. },
  22972. updateHook: {
  22973. method: "PATCH",
  22974. params: {
  22975. active: {
  22976. type: "boolean"
  22977. },
  22978. add_events: {
  22979. type: "string[]"
  22980. },
  22981. config: {
  22982. type: "object"
  22983. },
  22984. "config.content_type": {
  22985. type: "string"
  22986. },
  22987. "config.insecure_ssl": {
  22988. type: "string"
  22989. },
  22990. "config.secret": {
  22991. type: "string"
  22992. },
  22993. "config.url": {
  22994. required: true,
  22995. type: "string"
  22996. },
  22997. events: {
  22998. type: "string[]"
  22999. },
  23000. hook_id: {
  23001. required: true,
  23002. type: "integer"
  23003. },
  23004. owner: {
  23005. required: true,
  23006. type: "string"
  23007. },
  23008. remove_events: {
  23009. type: "string[]"
  23010. },
  23011. repo: {
  23012. required: true,
  23013. type: "string"
  23014. }
  23015. },
  23016. url: "/repos/:owner/:repo/hooks/:hook_id"
  23017. },
  23018. updateInformationAboutPagesSite: {
  23019. method: "PUT",
  23020. params: {
  23021. cname: {
  23022. type: "string"
  23023. },
  23024. owner: {
  23025. required: true,
  23026. type: "string"
  23027. },
  23028. repo: {
  23029. required: true,
  23030. type: "string"
  23031. },
  23032. source: {
  23033. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23034. type: "string"
  23035. }
  23036. },
  23037. url: "/repos/:owner/:repo/pages"
  23038. },
  23039. updateInvitation: {
  23040. method: "PATCH",
  23041. params: {
  23042. invitation_id: {
  23043. required: true,
  23044. type: "integer"
  23045. },
  23046. owner: {
  23047. required: true,
  23048. type: "string"
  23049. },
  23050. permissions: {
  23051. enum: ["read", "write", "admin"],
  23052. type: "string"
  23053. },
  23054. repo: {
  23055. required: true,
  23056. type: "string"
  23057. }
  23058. },
  23059. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23060. },
  23061. updateProtectedBranchPullRequestReviewEnforcement: {
  23062. method: "PATCH",
  23063. params: {
  23064. branch: {
  23065. required: true,
  23066. type: "string"
  23067. },
  23068. dismiss_stale_reviews: {
  23069. type: "boolean"
  23070. },
  23071. dismissal_restrictions: {
  23072. type: "object"
  23073. },
  23074. "dismissal_restrictions.teams": {
  23075. type: "string[]"
  23076. },
  23077. "dismissal_restrictions.users": {
  23078. type: "string[]"
  23079. },
  23080. owner: {
  23081. required: true,
  23082. type: "string"
  23083. },
  23084. repo: {
  23085. required: true,
  23086. type: "string"
  23087. },
  23088. require_code_owner_reviews: {
  23089. type: "boolean"
  23090. },
  23091. required_approving_review_count: {
  23092. type: "integer"
  23093. }
  23094. },
  23095. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23096. },
  23097. updateProtectedBranchRequiredStatusChecks: {
  23098. method: "PATCH",
  23099. params: {
  23100. branch: {
  23101. required: true,
  23102. type: "string"
  23103. },
  23104. contexts: {
  23105. type: "string[]"
  23106. },
  23107. owner: {
  23108. required: true,
  23109. type: "string"
  23110. },
  23111. repo: {
  23112. required: true,
  23113. type: "string"
  23114. },
  23115. strict: {
  23116. type: "boolean"
  23117. }
  23118. },
  23119. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23120. },
  23121. updateRelease: {
  23122. method: "PATCH",
  23123. params: {
  23124. body: {
  23125. type: "string"
  23126. },
  23127. draft: {
  23128. type: "boolean"
  23129. },
  23130. name: {
  23131. type: "string"
  23132. },
  23133. owner: {
  23134. required: true,
  23135. type: "string"
  23136. },
  23137. prerelease: {
  23138. type: "boolean"
  23139. },
  23140. release_id: {
  23141. required: true,
  23142. type: "integer"
  23143. },
  23144. repo: {
  23145. required: true,
  23146. type: "string"
  23147. },
  23148. tag_name: {
  23149. type: "string"
  23150. },
  23151. target_commitish: {
  23152. type: "string"
  23153. }
  23154. },
  23155. url: "/repos/:owner/:repo/releases/:release_id"
  23156. },
  23157. updateReleaseAsset: {
  23158. method: "PATCH",
  23159. params: {
  23160. asset_id: {
  23161. required: true,
  23162. type: "integer"
  23163. },
  23164. label: {
  23165. type: "string"
  23166. },
  23167. name: {
  23168. type: "string"
  23169. },
  23170. owner: {
  23171. required: true,
  23172. type: "string"
  23173. },
  23174. repo: {
  23175. required: true,
  23176. type: "string"
  23177. }
  23178. },
  23179. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23180. },
  23181. uploadReleaseAsset: {
  23182. method: "POST",
  23183. params: {
  23184. data: {
  23185. mapTo: "data",
  23186. required: true,
  23187. type: "string | object"
  23188. },
  23189. file: {
  23190. alias: "data",
  23191. deprecated: true,
  23192. type: "string | object"
  23193. },
  23194. headers: {
  23195. required: true,
  23196. type: "object"
  23197. },
  23198. "headers.content-length": {
  23199. required: true,
  23200. type: "integer"
  23201. },
  23202. "headers.content-type": {
  23203. required: true,
  23204. type: "string"
  23205. },
  23206. label: {
  23207. type: "string"
  23208. },
  23209. name: {
  23210. required: true,
  23211. type: "string"
  23212. },
  23213. url: {
  23214. required: true,
  23215. type: "string"
  23216. }
  23217. },
  23218. url: ":url"
  23219. }
  23220. },
  23221. search: {
  23222. code: {
  23223. method: "GET",
  23224. params: {
  23225. order: {
  23226. enum: ["desc", "asc"],
  23227. type: "string"
  23228. },
  23229. page: {
  23230. type: "integer"
  23231. },
  23232. per_page: {
  23233. type: "integer"
  23234. },
  23235. q: {
  23236. required: true,
  23237. type: "string"
  23238. },
  23239. sort: {
  23240. enum: ["indexed"],
  23241. type: "string"
  23242. }
  23243. },
  23244. url: "/search/code"
  23245. },
  23246. commits: {
  23247. headers: {
  23248. accept: "application/vnd.github.cloak-preview+json"
  23249. },
  23250. method: "GET",
  23251. params: {
  23252. order: {
  23253. enum: ["desc", "asc"],
  23254. type: "string"
  23255. },
  23256. page: {
  23257. type: "integer"
  23258. },
  23259. per_page: {
  23260. type: "integer"
  23261. },
  23262. q: {
  23263. required: true,
  23264. type: "string"
  23265. },
  23266. sort: {
  23267. enum: ["author-date", "committer-date"],
  23268. type: "string"
  23269. }
  23270. },
  23271. url: "/search/commits"
  23272. },
  23273. issues: {
  23274. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23275. method: "GET",
  23276. params: {
  23277. order: {
  23278. enum: ["desc", "asc"],
  23279. type: "string"
  23280. },
  23281. page: {
  23282. type: "integer"
  23283. },
  23284. per_page: {
  23285. type: "integer"
  23286. },
  23287. q: {
  23288. required: true,
  23289. type: "string"
  23290. },
  23291. sort: {
  23292. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23293. type: "string"
  23294. }
  23295. },
  23296. url: "/search/issues"
  23297. },
  23298. issuesAndPullRequests: {
  23299. method: "GET",
  23300. params: {
  23301. order: {
  23302. enum: ["desc", "asc"],
  23303. type: "string"
  23304. },
  23305. page: {
  23306. type: "integer"
  23307. },
  23308. per_page: {
  23309. type: "integer"
  23310. },
  23311. q: {
  23312. required: true,
  23313. type: "string"
  23314. },
  23315. sort: {
  23316. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23317. type: "string"
  23318. }
  23319. },
  23320. url: "/search/issues"
  23321. },
  23322. labels: {
  23323. method: "GET",
  23324. params: {
  23325. order: {
  23326. enum: ["desc", "asc"],
  23327. type: "string"
  23328. },
  23329. q: {
  23330. required: true,
  23331. type: "string"
  23332. },
  23333. repository_id: {
  23334. required: true,
  23335. type: "integer"
  23336. },
  23337. sort: {
  23338. enum: ["created", "updated"],
  23339. type: "string"
  23340. }
  23341. },
  23342. url: "/search/labels"
  23343. },
  23344. repos: {
  23345. method: "GET",
  23346. params: {
  23347. order: {
  23348. enum: ["desc", "asc"],
  23349. type: "string"
  23350. },
  23351. page: {
  23352. type: "integer"
  23353. },
  23354. per_page: {
  23355. type: "integer"
  23356. },
  23357. q: {
  23358. required: true,
  23359. type: "string"
  23360. },
  23361. sort: {
  23362. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23363. type: "string"
  23364. }
  23365. },
  23366. url: "/search/repositories"
  23367. },
  23368. topics: {
  23369. method: "GET",
  23370. params: {
  23371. q: {
  23372. required: true,
  23373. type: "string"
  23374. }
  23375. },
  23376. url: "/search/topics"
  23377. },
  23378. users: {
  23379. method: "GET",
  23380. params: {
  23381. order: {
  23382. enum: ["desc", "asc"],
  23383. type: "string"
  23384. },
  23385. page: {
  23386. type: "integer"
  23387. },
  23388. per_page: {
  23389. type: "integer"
  23390. },
  23391. q: {
  23392. required: true,
  23393. type: "string"
  23394. },
  23395. sort: {
  23396. enum: ["followers", "repositories", "joined"],
  23397. type: "string"
  23398. }
  23399. },
  23400. url: "/search/users"
  23401. }
  23402. },
  23403. teams: {
  23404. addMember: {
  23405. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23406. method: "PUT",
  23407. params: {
  23408. team_id: {
  23409. required: true,
  23410. type: "integer"
  23411. },
  23412. username: {
  23413. required: true,
  23414. type: "string"
  23415. }
  23416. },
  23417. url: "/teams/:team_id/members/:username"
  23418. },
  23419. addMemberLegacy: {
  23420. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23421. method: "PUT",
  23422. params: {
  23423. team_id: {
  23424. required: true,
  23425. type: "integer"
  23426. },
  23427. username: {
  23428. required: true,
  23429. type: "string"
  23430. }
  23431. },
  23432. url: "/teams/:team_id/members/:username"
  23433. },
  23434. addOrUpdateMembership: {
  23435. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23436. method: "PUT",
  23437. params: {
  23438. role: {
  23439. enum: ["member", "maintainer"],
  23440. type: "string"
  23441. },
  23442. team_id: {
  23443. required: true,
  23444. type: "integer"
  23445. },
  23446. username: {
  23447. required: true,
  23448. type: "string"
  23449. }
  23450. },
  23451. url: "/teams/:team_id/memberships/:username"
  23452. },
  23453. addOrUpdateMembershipInOrg: {
  23454. method: "PUT",
  23455. params: {
  23456. org: {
  23457. required: true,
  23458. type: "string"
  23459. },
  23460. role: {
  23461. enum: ["member", "maintainer"],
  23462. type: "string"
  23463. },
  23464. team_slug: {
  23465. required: true,
  23466. type: "string"
  23467. },
  23468. username: {
  23469. required: true,
  23470. type: "string"
  23471. }
  23472. },
  23473. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23474. },
  23475. addOrUpdateMembershipLegacy: {
  23476. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23477. method: "PUT",
  23478. params: {
  23479. role: {
  23480. enum: ["member", "maintainer"],
  23481. type: "string"
  23482. },
  23483. team_id: {
  23484. required: true,
  23485. type: "integer"
  23486. },
  23487. username: {
  23488. required: true,
  23489. type: "string"
  23490. }
  23491. },
  23492. url: "/teams/:team_id/memberships/:username"
  23493. },
  23494. addOrUpdateProject: {
  23495. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23496. headers: {
  23497. accept: "application/vnd.github.inertia-preview+json"
  23498. },
  23499. method: "PUT",
  23500. params: {
  23501. permission: {
  23502. enum: ["read", "write", "admin"],
  23503. type: "string"
  23504. },
  23505. project_id: {
  23506. required: true,
  23507. type: "integer"
  23508. },
  23509. team_id: {
  23510. required: true,
  23511. type: "integer"
  23512. }
  23513. },
  23514. url: "/teams/:team_id/projects/:project_id"
  23515. },
  23516. addOrUpdateProjectInOrg: {
  23517. headers: {
  23518. accept: "application/vnd.github.inertia-preview+json"
  23519. },
  23520. method: "PUT",
  23521. params: {
  23522. org: {
  23523. required: true,
  23524. type: "string"
  23525. },
  23526. permission: {
  23527. enum: ["read", "write", "admin"],
  23528. type: "string"
  23529. },
  23530. project_id: {
  23531. required: true,
  23532. type: "integer"
  23533. },
  23534. team_slug: {
  23535. required: true,
  23536. type: "string"
  23537. }
  23538. },
  23539. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23540. },
  23541. addOrUpdateProjectLegacy: {
  23542. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23543. headers: {
  23544. accept: "application/vnd.github.inertia-preview+json"
  23545. },
  23546. method: "PUT",
  23547. params: {
  23548. permission: {
  23549. enum: ["read", "write", "admin"],
  23550. type: "string"
  23551. },
  23552. project_id: {
  23553. required: true,
  23554. type: "integer"
  23555. },
  23556. team_id: {
  23557. required: true,
  23558. type: "integer"
  23559. }
  23560. },
  23561. url: "/teams/:team_id/projects/:project_id"
  23562. },
  23563. addOrUpdateRepo: {
  23564. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23565. method: "PUT",
  23566. params: {
  23567. owner: {
  23568. required: true,
  23569. type: "string"
  23570. },
  23571. permission: {
  23572. enum: ["pull", "push", "admin"],
  23573. type: "string"
  23574. },
  23575. repo: {
  23576. required: true,
  23577. type: "string"
  23578. },
  23579. team_id: {
  23580. required: true,
  23581. type: "integer"
  23582. }
  23583. },
  23584. url: "/teams/:team_id/repos/:owner/:repo"
  23585. },
  23586. addOrUpdateRepoInOrg: {
  23587. method: "PUT",
  23588. params: {
  23589. org: {
  23590. required: true,
  23591. type: "string"
  23592. },
  23593. owner: {
  23594. required: true,
  23595. type: "string"
  23596. },
  23597. permission: {
  23598. enum: ["pull", "push", "admin"],
  23599. type: "string"
  23600. },
  23601. repo: {
  23602. required: true,
  23603. type: "string"
  23604. },
  23605. team_slug: {
  23606. required: true,
  23607. type: "string"
  23608. }
  23609. },
  23610. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23611. },
  23612. addOrUpdateRepoLegacy: {
  23613. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23614. method: "PUT",
  23615. params: {
  23616. owner: {
  23617. required: true,
  23618. type: "string"
  23619. },
  23620. permission: {
  23621. enum: ["pull", "push", "admin"],
  23622. type: "string"
  23623. },
  23624. repo: {
  23625. required: true,
  23626. type: "string"
  23627. },
  23628. team_id: {
  23629. required: true,
  23630. type: "integer"
  23631. }
  23632. },
  23633. url: "/teams/:team_id/repos/:owner/:repo"
  23634. },
  23635. checkManagesRepo: {
  23636. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23637. method: "GET",
  23638. params: {
  23639. owner: {
  23640. required: true,
  23641. type: "string"
  23642. },
  23643. repo: {
  23644. required: true,
  23645. type: "string"
  23646. },
  23647. team_id: {
  23648. required: true,
  23649. type: "integer"
  23650. }
  23651. },
  23652. url: "/teams/:team_id/repos/:owner/:repo"
  23653. },
  23654. checkManagesRepoInOrg: {
  23655. method: "GET",
  23656. params: {
  23657. org: {
  23658. required: true,
  23659. type: "string"
  23660. },
  23661. owner: {
  23662. required: true,
  23663. type: "string"
  23664. },
  23665. repo: {
  23666. required: true,
  23667. type: "string"
  23668. },
  23669. team_slug: {
  23670. required: true,
  23671. type: "string"
  23672. }
  23673. },
  23674. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23675. },
  23676. checkManagesRepoLegacy: {
  23677. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23678. method: "GET",
  23679. params: {
  23680. owner: {
  23681. required: true,
  23682. type: "string"
  23683. },
  23684. repo: {
  23685. required: true,
  23686. type: "string"
  23687. },
  23688. team_id: {
  23689. required: true,
  23690. type: "integer"
  23691. }
  23692. },
  23693. url: "/teams/:team_id/repos/:owner/:repo"
  23694. },
  23695. create: {
  23696. method: "POST",
  23697. params: {
  23698. description: {
  23699. type: "string"
  23700. },
  23701. maintainers: {
  23702. type: "string[]"
  23703. },
  23704. name: {
  23705. required: true,
  23706. type: "string"
  23707. },
  23708. org: {
  23709. required: true,
  23710. type: "string"
  23711. },
  23712. parent_team_id: {
  23713. type: "integer"
  23714. },
  23715. permission: {
  23716. enum: ["pull", "push", "admin"],
  23717. type: "string"
  23718. },
  23719. privacy: {
  23720. enum: ["secret", "closed"],
  23721. type: "string"
  23722. },
  23723. repo_names: {
  23724. type: "string[]"
  23725. }
  23726. },
  23727. url: "/orgs/:org/teams"
  23728. },
  23729. createDiscussion: {
  23730. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23731. method: "POST",
  23732. params: {
  23733. body: {
  23734. required: true,
  23735. type: "string"
  23736. },
  23737. private: {
  23738. type: "boolean"
  23739. },
  23740. team_id: {
  23741. required: true,
  23742. type: "integer"
  23743. },
  23744. title: {
  23745. required: true,
  23746. type: "string"
  23747. }
  23748. },
  23749. url: "/teams/:team_id/discussions"
  23750. },
  23751. createDiscussionComment: {
  23752. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  23753. method: "POST",
  23754. params: {
  23755. body: {
  23756. required: true,
  23757. type: "string"
  23758. },
  23759. discussion_number: {
  23760. required: true,
  23761. type: "integer"
  23762. },
  23763. team_id: {
  23764. required: true,
  23765. type: "integer"
  23766. }
  23767. },
  23768. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23769. },
  23770. createDiscussionCommentInOrg: {
  23771. method: "POST",
  23772. params: {
  23773. body: {
  23774. required: true,
  23775. type: "string"
  23776. },
  23777. discussion_number: {
  23778. required: true,
  23779. type: "integer"
  23780. },
  23781. org: {
  23782. required: true,
  23783. type: "string"
  23784. },
  23785. team_slug: {
  23786. required: true,
  23787. type: "string"
  23788. }
  23789. },
  23790. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  23791. },
  23792. createDiscussionCommentLegacy: {
  23793. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  23794. method: "POST",
  23795. params: {
  23796. body: {
  23797. required: true,
  23798. type: "string"
  23799. },
  23800. discussion_number: {
  23801. required: true,
  23802. type: "integer"
  23803. },
  23804. team_id: {
  23805. required: true,
  23806. type: "integer"
  23807. }
  23808. },
  23809. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23810. },
  23811. createDiscussionInOrg: {
  23812. method: "POST",
  23813. params: {
  23814. body: {
  23815. required: true,
  23816. type: "string"
  23817. },
  23818. org: {
  23819. required: true,
  23820. type: "string"
  23821. },
  23822. private: {
  23823. type: "boolean"
  23824. },
  23825. team_slug: {
  23826. required: true,
  23827. type: "string"
  23828. },
  23829. title: {
  23830. required: true,
  23831. type: "string"
  23832. }
  23833. },
  23834. url: "/orgs/:org/teams/:team_slug/discussions"
  23835. },
  23836. createDiscussionLegacy: {
  23837. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  23838. method: "POST",
  23839. params: {
  23840. body: {
  23841. required: true,
  23842. type: "string"
  23843. },
  23844. private: {
  23845. type: "boolean"
  23846. },
  23847. team_id: {
  23848. required: true,
  23849. type: "integer"
  23850. },
  23851. title: {
  23852. required: true,
  23853. type: "string"
  23854. }
  23855. },
  23856. url: "/teams/:team_id/discussions"
  23857. },
  23858. delete: {
  23859. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  23860. method: "DELETE",
  23861. params: {
  23862. team_id: {
  23863. required: true,
  23864. type: "integer"
  23865. }
  23866. },
  23867. url: "/teams/:team_id"
  23868. },
  23869. deleteDiscussion: {
  23870. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  23871. method: "DELETE",
  23872. params: {
  23873. discussion_number: {
  23874. required: true,
  23875. type: "integer"
  23876. },
  23877. team_id: {
  23878. required: true,
  23879. type: "integer"
  23880. }
  23881. },
  23882. url: "/teams/:team_id/discussions/:discussion_number"
  23883. },
  23884. deleteDiscussionComment: {
  23885. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  23886. method: "DELETE",
  23887. params: {
  23888. comment_number: {
  23889. required: true,
  23890. type: "integer"
  23891. },
  23892. discussion_number: {
  23893. required: true,
  23894. type: "integer"
  23895. },
  23896. team_id: {
  23897. required: true,
  23898. type: "integer"
  23899. }
  23900. },
  23901. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  23902. },
  23903. deleteDiscussionCommentInOrg: {
  23904. method: "DELETE",
  23905. params: {
  23906. comment_number: {
  23907. required: true,
  23908. type: "integer"
  23909. },
  23910. discussion_number: {
  23911. required: true,
  23912. type: "integer"
  23913. },
  23914. org: {
  23915. required: true,
  23916. type: "string"
  23917. },
  23918. team_slug: {
  23919. required: true,
  23920. type: "string"
  23921. }
  23922. },
  23923. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  23924. },
  23925. deleteDiscussionCommentLegacy: {
  23926. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  23927. method: "DELETE",
  23928. params: {
  23929. comment_number: {
  23930. required: true,
  23931. type: "integer"
  23932. },
  23933. discussion_number: {
  23934. required: true,
  23935. type: "integer"
  23936. },
  23937. team_id: {
  23938. required: true,
  23939. type: "integer"
  23940. }
  23941. },
  23942. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  23943. },
  23944. deleteDiscussionInOrg: {
  23945. method: "DELETE",
  23946. params: {
  23947. discussion_number: {
  23948. required: true,
  23949. type: "integer"
  23950. },
  23951. org: {
  23952. required: true,
  23953. type: "string"
  23954. },
  23955. team_slug: {
  23956. required: true,
  23957. type: "string"
  23958. }
  23959. },
  23960. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  23961. },
  23962. deleteDiscussionLegacy: {
  23963. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  23964. method: "DELETE",
  23965. params: {
  23966. discussion_number: {
  23967. required: true,
  23968. type: "integer"
  23969. },
  23970. team_id: {
  23971. required: true,
  23972. type: "integer"
  23973. }
  23974. },
  23975. url: "/teams/:team_id/discussions/:discussion_number"
  23976. },
  23977. deleteInOrg: {
  23978. method: "DELETE",
  23979. params: {
  23980. org: {
  23981. required: true,
  23982. type: "string"
  23983. },
  23984. team_slug: {
  23985. required: true,
  23986. type: "string"
  23987. }
  23988. },
  23989. url: "/orgs/:org/teams/:team_slug"
  23990. },
  23991. deleteLegacy: {
  23992. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  23993. method: "DELETE",
  23994. params: {
  23995. team_id: {
  23996. required: true,
  23997. type: "integer"
  23998. }
  23999. },
  24000. url: "/teams/:team_id"
  24001. },
  24002. get: {
  24003. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24004. method: "GET",
  24005. params: {
  24006. team_id: {
  24007. required: true,
  24008. type: "integer"
  24009. }
  24010. },
  24011. url: "/teams/:team_id"
  24012. },
  24013. getByName: {
  24014. method: "GET",
  24015. params: {
  24016. org: {
  24017. required: true,
  24018. type: "string"
  24019. },
  24020. team_slug: {
  24021. required: true,
  24022. type: "string"
  24023. }
  24024. },
  24025. url: "/orgs/:org/teams/:team_slug"
  24026. },
  24027. getDiscussion: {
  24028. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24029. method: "GET",
  24030. params: {
  24031. discussion_number: {
  24032. required: true,
  24033. type: "integer"
  24034. },
  24035. team_id: {
  24036. required: true,
  24037. type: "integer"
  24038. }
  24039. },
  24040. url: "/teams/:team_id/discussions/:discussion_number"
  24041. },
  24042. getDiscussionComment: {
  24043. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24044. method: "GET",
  24045. params: {
  24046. comment_number: {
  24047. required: true,
  24048. type: "integer"
  24049. },
  24050. discussion_number: {
  24051. required: true,
  24052. type: "integer"
  24053. },
  24054. team_id: {
  24055. required: true,
  24056. type: "integer"
  24057. }
  24058. },
  24059. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24060. },
  24061. getDiscussionCommentInOrg: {
  24062. method: "GET",
  24063. params: {
  24064. comment_number: {
  24065. required: true,
  24066. type: "integer"
  24067. },
  24068. discussion_number: {
  24069. required: true,
  24070. type: "integer"
  24071. },
  24072. org: {
  24073. required: true,
  24074. type: "string"
  24075. },
  24076. team_slug: {
  24077. required: true,
  24078. type: "string"
  24079. }
  24080. },
  24081. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24082. },
  24083. getDiscussionCommentLegacy: {
  24084. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24085. method: "GET",
  24086. params: {
  24087. comment_number: {
  24088. required: true,
  24089. type: "integer"
  24090. },
  24091. discussion_number: {
  24092. required: true,
  24093. type: "integer"
  24094. },
  24095. team_id: {
  24096. required: true,
  24097. type: "integer"
  24098. }
  24099. },
  24100. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24101. },
  24102. getDiscussionInOrg: {
  24103. method: "GET",
  24104. params: {
  24105. discussion_number: {
  24106. required: true,
  24107. type: "integer"
  24108. },
  24109. org: {
  24110. required: true,
  24111. type: "string"
  24112. },
  24113. team_slug: {
  24114. required: true,
  24115. type: "string"
  24116. }
  24117. },
  24118. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24119. },
  24120. getDiscussionLegacy: {
  24121. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24122. method: "GET",
  24123. params: {
  24124. discussion_number: {
  24125. required: true,
  24126. type: "integer"
  24127. },
  24128. team_id: {
  24129. required: true,
  24130. type: "integer"
  24131. }
  24132. },
  24133. url: "/teams/:team_id/discussions/:discussion_number"
  24134. },
  24135. getLegacy: {
  24136. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24137. method: "GET",
  24138. params: {
  24139. team_id: {
  24140. required: true,
  24141. type: "integer"
  24142. }
  24143. },
  24144. url: "/teams/:team_id"
  24145. },
  24146. getMember: {
  24147. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24148. method: "GET",
  24149. params: {
  24150. team_id: {
  24151. required: true,
  24152. type: "integer"
  24153. },
  24154. username: {
  24155. required: true,
  24156. type: "string"
  24157. }
  24158. },
  24159. url: "/teams/:team_id/members/:username"
  24160. },
  24161. getMemberLegacy: {
  24162. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24163. method: "GET",
  24164. params: {
  24165. team_id: {
  24166. required: true,
  24167. type: "integer"
  24168. },
  24169. username: {
  24170. required: true,
  24171. type: "string"
  24172. }
  24173. },
  24174. url: "/teams/:team_id/members/:username"
  24175. },
  24176. getMembership: {
  24177. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24178. method: "GET",
  24179. params: {
  24180. team_id: {
  24181. required: true,
  24182. type: "integer"
  24183. },
  24184. username: {
  24185. required: true,
  24186. type: "string"
  24187. }
  24188. },
  24189. url: "/teams/:team_id/memberships/:username"
  24190. },
  24191. getMembershipInOrg: {
  24192. method: "GET",
  24193. params: {
  24194. org: {
  24195. required: true,
  24196. type: "string"
  24197. },
  24198. team_slug: {
  24199. required: true,
  24200. type: "string"
  24201. },
  24202. username: {
  24203. required: true,
  24204. type: "string"
  24205. }
  24206. },
  24207. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24208. },
  24209. getMembershipLegacy: {
  24210. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24211. method: "GET",
  24212. params: {
  24213. team_id: {
  24214. required: true,
  24215. type: "integer"
  24216. },
  24217. username: {
  24218. required: true,
  24219. type: "string"
  24220. }
  24221. },
  24222. url: "/teams/:team_id/memberships/:username"
  24223. },
  24224. list: {
  24225. method: "GET",
  24226. params: {
  24227. org: {
  24228. required: true,
  24229. type: "string"
  24230. },
  24231. page: {
  24232. type: "integer"
  24233. },
  24234. per_page: {
  24235. type: "integer"
  24236. }
  24237. },
  24238. url: "/orgs/:org/teams"
  24239. },
  24240. listChild: {
  24241. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24242. method: "GET",
  24243. params: {
  24244. page: {
  24245. type: "integer"
  24246. },
  24247. per_page: {
  24248. type: "integer"
  24249. },
  24250. team_id: {
  24251. required: true,
  24252. type: "integer"
  24253. }
  24254. },
  24255. url: "/teams/:team_id/teams"
  24256. },
  24257. listChildInOrg: {
  24258. method: "GET",
  24259. params: {
  24260. org: {
  24261. required: true,
  24262. type: "string"
  24263. },
  24264. page: {
  24265. type: "integer"
  24266. },
  24267. per_page: {
  24268. type: "integer"
  24269. },
  24270. team_slug: {
  24271. required: true,
  24272. type: "string"
  24273. }
  24274. },
  24275. url: "/orgs/:org/teams/:team_slug/teams"
  24276. },
  24277. listChildLegacy: {
  24278. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24279. method: "GET",
  24280. params: {
  24281. page: {
  24282. type: "integer"
  24283. },
  24284. per_page: {
  24285. type: "integer"
  24286. },
  24287. team_id: {
  24288. required: true,
  24289. type: "integer"
  24290. }
  24291. },
  24292. url: "/teams/:team_id/teams"
  24293. },
  24294. listDiscussionComments: {
  24295. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24296. method: "GET",
  24297. params: {
  24298. direction: {
  24299. enum: ["asc", "desc"],
  24300. type: "string"
  24301. },
  24302. discussion_number: {
  24303. required: true,
  24304. type: "integer"
  24305. },
  24306. page: {
  24307. type: "integer"
  24308. },
  24309. per_page: {
  24310. type: "integer"
  24311. },
  24312. team_id: {
  24313. required: true,
  24314. type: "integer"
  24315. }
  24316. },
  24317. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24318. },
  24319. listDiscussionCommentsInOrg: {
  24320. method: "GET",
  24321. params: {
  24322. direction: {
  24323. enum: ["asc", "desc"],
  24324. type: "string"
  24325. },
  24326. discussion_number: {
  24327. required: true,
  24328. type: "integer"
  24329. },
  24330. org: {
  24331. required: true,
  24332. type: "string"
  24333. },
  24334. page: {
  24335. type: "integer"
  24336. },
  24337. per_page: {
  24338. type: "integer"
  24339. },
  24340. team_slug: {
  24341. required: true,
  24342. type: "string"
  24343. }
  24344. },
  24345. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24346. },
  24347. listDiscussionCommentsLegacy: {
  24348. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24349. method: "GET",
  24350. params: {
  24351. direction: {
  24352. enum: ["asc", "desc"],
  24353. type: "string"
  24354. },
  24355. discussion_number: {
  24356. required: true,
  24357. type: "integer"
  24358. },
  24359. page: {
  24360. type: "integer"
  24361. },
  24362. per_page: {
  24363. type: "integer"
  24364. },
  24365. team_id: {
  24366. required: true,
  24367. type: "integer"
  24368. }
  24369. },
  24370. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24371. },
  24372. listDiscussions: {
  24373. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24374. method: "GET",
  24375. params: {
  24376. direction: {
  24377. enum: ["asc", "desc"],
  24378. type: "string"
  24379. },
  24380. page: {
  24381. type: "integer"
  24382. },
  24383. per_page: {
  24384. type: "integer"
  24385. },
  24386. team_id: {
  24387. required: true,
  24388. type: "integer"
  24389. }
  24390. },
  24391. url: "/teams/:team_id/discussions"
  24392. },
  24393. listDiscussionsInOrg: {
  24394. method: "GET",
  24395. params: {
  24396. direction: {
  24397. enum: ["asc", "desc"],
  24398. type: "string"
  24399. },
  24400. org: {
  24401. required: true,
  24402. type: "string"
  24403. },
  24404. page: {
  24405. type: "integer"
  24406. },
  24407. per_page: {
  24408. type: "integer"
  24409. },
  24410. team_slug: {
  24411. required: true,
  24412. type: "string"
  24413. }
  24414. },
  24415. url: "/orgs/:org/teams/:team_slug/discussions"
  24416. },
  24417. listDiscussionsLegacy: {
  24418. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24419. method: "GET",
  24420. params: {
  24421. direction: {
  24422. enum: ["asc", "desc"],
  24423. type: "string"
  24424. },
  24425. page: {
  24426. type: "integer"
  24427. },
  24428. per_page: {
  24429. type: "integer"
  24430. },
  24431. team_id: {
  24432. required: true,
  24433. type: "integer"
  24434. }
  24435. },
  24436. url: "/teams/:team_id/discussions"
  24437. },
  24438. listForAuthenticatedUser: {
  24439. method: "GET",
  24440. params: {
  24441. page: {
  24442. type: "integer"
  24443. },
  24444. per_page: {
  24445. type: "integer"
  24446. }
  24447. },
  24448. url: "/user/teams"
  24449. },
  24450. listMembers: {
  24451. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24452. method: "GET",
  24453. params: {
  24454. page: {
  24455. type: "integer"
  24456. },
  24457. per_page: {
  24458. type: "integer"
  24459. },
  24460. role: {
  24461. enum: ["member", "maintainer", "all"],
  24462. type: "string"
  24463. },
  24464. team_id: {
  24465. required: true,
  24466. type: "integer"
  24467. }
  24468. },
  24469. url: "/teams/:team_id/members"
  24470. },
  24471. listMembersInOrg: {
  24472. method: "GET",
  24473. params: {
  24474. org: {
  24475. required: true,
  24476. type: "string"
  24477. },
  24478. page: {
  24479. type: "integer"
  24480. },
  24481. per_page: {
  24482. type: "integer"
  24483. },
  24484. role: {
  24485. enum: ["member", "maintainer", "all"],
  24486. type: "string"
  24487. },
  24488. team_slug: {
  24489. required: true,
  24490. type: "string"
  24491. }
  24492. },
  24493. url: "/orgs/:org/teams/:team_slug/members"
  24494. },
  24495. listMembersLegacy: {
  24496. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24497. method: "GET",
  24498. params: {
  24499. page: {
  24500. type: "integer"
  24501. },
  24502. per_page: {
  24503. type: "integer"
  24504. },
  24505. role: {
  24506. enum: ["member", "maintainer", "all"],
  24507. type: "string"
  24508. },
  24509. team_id: {
  24510. required: true,
  24511. type: "integer"
  24512. }
  24513. },
  24514. url: "/teams/:team_id/members"
  24515. },
  24516. listPendingInvitations: {
  24517. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24518. method: "GET",
  24519. params: {
  24520. page: {
  24521. type: "integer"
  24522. },
  24523. per_page: {
  24524. type: "integer"
  24525. },
  24526. team_id: {
  24527. required: true,
  24528. type: "integer"
  24529. }
  24530. },
  24531. url: "/teams/:team_id/invitations"
  24532. },
  24533. listPendingInvitationsInOrg: {
  24534. method: "GET",
  24535. params: {
  24536. org: {
  24537. required: true,
  24538. type: "string"
  24539. },
  24540. page: {
  24541. type: "integer"
  24542. },
  24543. per_page: {
  24544. type: "integer"
  24545. },
  24546. team_slug: {
  24547. required: true,
  24548. type: "string"
  24549. }
  24550. },
  24551. url: "/orgs/:org/teams/:team_slug/invitations"
  24552. },
  24553. listPendingInvitationsLegacy: {
  24554. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24555. method: "GET",
  24556. params: {
  24557. page: {
  24558. type: "integer"
  24559. },
  24560. per_page: {
  24561. type: "integer"
  24562. },
  24563. team_id: {
  24564. required: true,
  24565. type: "integer"
  24566. }
  24567. },
  24568. url: "/teams/:team_id/invitations"
  24569. },
  24570. listProjects: {
  24571. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24572. headers: {
  24573. accept: "application/vnd.github.inertia-preview+json"
  24574. },
  24575. method: "GET",
  24576. params: {
  24577. page: {
  24578. type: "integer"
  24579. },
  24580. per_page: {
  24581. type: "integer"
  24582. },
  24583. team_id: {
  24584. required: true,
  24585. type: "integer"
  24586. }
  24587. },
  24588. url: "/teams/:team_id/projects"
  24589. },
  24590. listProjectsInOrg: {
  24591. headers: {
  24592. accept: "application/vnd.github.inertia-preview+json"
  24593. },
  24594. method: "GET",
  24595. params: {
  24596. org: {
  24597. required: true,
  24598. type: "string"
  24599. },
  24600. page: {
  24601. type: "integer"
  24602. },
  24603. per_page: {
  24604. type: "integer"
  24605. },
  24606. team_slug: {
  24607. required: true,
  24608. type: "string"
  24609. }
  24610. },
  24611. url: "/orgs/:org/teams/:team_slug/projects"
  24612. },
  24613. listProjectsLegacy: {
  24614. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24615. headers: {
  24616. accept: "application/vnd.github.inertia-preview+json"
  24617. },
  24618. method: "GET",
  24619. params: {
  24620. page: {
  24621. type: "integer"
  24622. },
  24623. per_page: {
  24624. type: "integer"
  24625. },
  24626. team_id: {
  24627. required: true,
  24628. type: "integer"
  24629. }
  24630. },
  24631. url: "/teams/:team_id/projects"
  24632. },
  24633. listRepos: {
  24634. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24635. method: "GET",
  24636. params: {
  24637. page: {
  24638. type: "integer"
  24639. },
  24640. per_page: {
  24641. type: "integer"
  24642. },
  24643. team_id: {
  24644. required: true,
  24645. type: "integer"
  24646. }
  24647. },
  24648. url: "/teams/:team_id/repos"
  24649. },
  24650. listReposInOrg: {
  24651. method: "GET",
  24652. params: {
  24653. org: {
  24654. required: true,
  24655. type: "string"
  24656. },
  24657. page: {
  24658. type: "integer"
  24659. },
  24660. per_page: {
  24661. type: "integer"
  24662. },
  24663. team_slug: {
  24664. required: true,
  24665. type: "string"
  24666. }
  24667. },
  24668. url: "/orgs/:org/teams/:team_slug/repos"
  24669. },
  24670. listReposLegacy: {
  24671. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24672. method: "GET",
  24673. params: {
  24674. page: {
  24675. type: "integer"
  24676. },
  24677. per_page: {
  24678. type: "integer"
  24679. },
  24680. team_id: {
  24681. required: true,
  24682. type: "integer"
  24683. }
  24684. },
  24685. url: "/teams/:team_id/repos"
  24686. },
  24687. removeMember: {
  24688. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24689. method: "DELETE",
  24690. params: {
  24691. team_id: {
  24692. required: true,
  24693. type: "integer"
  24694. },
  24695. username: {
  24696. required: true,
  24697. type: "string"
  24698. }
  24699. },
  24700. url: "/teams/:team_id/members/:username"
  24701. },
  24702. removeMemberLegacy: {
  24703. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24704. method: "DELETE",
  24705. params: {
  24706. team_id: {
  24707. required: true,
  24708. type: "integer"
  24709. },
  24710. username: {
  24711. required: true,
  24712. type: "string"
  24713. }
  24714. },
  24715. url: "/teams/:team_id/members/:username"
  24716. },
  24717. removeMembership: {
  24718. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24719. method: "DELETE",
  24720. params: {
  24721. team_id: {
  24722. required: true,
  24723. type: "integer"
  24724. },
  24725. username: {
  24726. required: true,
  24727. type: "string"
  24728. }
  24729. },
  24730. url: "/teams/:team_id/memberships/:username"
  24731. },
  24732. removeMembershipInOrg: {
  24733. method: "DELETE",
  24734. params: {
  24735. org: {
  24736. required: true,
  24737. type: "string"
  24738. },
  24739. team_slug: {
  24740. required: true,
  24741. type: "string"
  24742. },
  24743. username: {
  24744. required: true,
  24745. type: "string"
  24746. }
  24747. },
  24748. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24749. },
  24750. removeMembershipLegacy: {
  24751. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  24752. method: "DELETE",
  24753. params: {
  24754. team_id: {
  24755. required: true,
  24756. type: "integer"
  24757. },
  24758. username: {
  24759. required: true,
  24760. type: "string"
  24761. }
  24762. },
  24763. url: "/teams/:team_id/memberships/:username"
  24764. },
  24765. removeProject: {
  24766. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  24767. method: "DELETE",
  24768. params: {
  24769. project_id: {
  24770. required: true,
  24771. type: "integer"
  24772. },
  24773. team_id: {
  24774. required: true,
  24775. type: "integer"
  24776. }
  24777. },
  24778. url: "/teams/:team_id/projects/:project_id"
  24779. },
  24780. removeProjectInOrg: {
  24781. method: "DELETE",
  24782. params: {
  24783. org: {
  24784. required: true,
  24785. type: "string"
  24786. },
  24787. project_id: {
  24788. required: true,
  24789. type: "integer"
  24790. },
  24791. team_slug: {
  24792. required: true,
  24793. type: "string"
  24794. }
  24795. },
  24796. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24797. },
  24798. removeProjectLegacy: {
  24799. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  24800. method: "DELETE",
  24801. params: {
  24802. project_id: {
  24803. required: true,
  24804. type: "integer"
  24805. },
  24806. team_id: {
  24807. required: true,
  24808. type: "integer"
  24809. }
  24810. },
  24811. url: "/teams/:team_id/projects/:project_id"
  24812. },
  24813. removeRepo: {
  24814. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  24815. method: "DELETE",
  24816. params: {
  24817. owner: {
  24818. required: true,
  24819. type: "string"
  24820. },
  24821. repo: {
  24822. required: true,
  24823. type: "string"
  24824. },
  24825. team_id: {
  24826. required: true,
  24827. type: "integer"
  24828. }
  24829. },
  24830. url: "/teams/:team_id/repos/:owner/:repo"
  24831. },
  24832. removeRepoInOrg: {
  24833. method: "DELETE",
  24834. params: {
  24835. org: {
  24836. required: true,
  24837. type: "string"
  24838. },
  24839. owner: {
  24840. required: true,
  24841. type: "string"
  24842. },
  24843. repo: {
  24844. required: true,
  24845. type: "string"
  24846. },
  24847. team_slug: {
  24848. required: true,
  24849. type: "string"
  24850. }
  24851. },
  24852. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24853. },
  24854. removeRepoLegacy: {
  24855. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  24856. method: "DELETE",
  24857. params: {
  24858. owner: {
  24859. required: true,
  24860. type: "string"
  24861. },
  24862. repo: {
  24863. required: true,
  24864. type: "string"
  24865. },
  24866. team_id: {
  24867. required: true,
  24868. type: "integer"
  24869. }
  24870. },
  24871. url: "/teams/:team_id/repos/:owner/:repo"
  24872. },
  24873. reviewProject: {
  24874. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  24875. headers: {
  24876. accept: "application/vnd.github.inertia-preview+json"
  24877. },
  24878. method: "GET",
  24879. params: {
  24880. project_id: {
  24881. required: true,
  24882. type: "integer"
  24883. },
  24884. team_id: {
  24885. required: true,
  24886. type: "integer"
  24887. }
  24888. },
  24889. url: "/teams/:team_id/projects/:project_id"
  24890. },
  24891. reviewProjectInOrg: {
  24892. headers: {
  24893. accept: "application/vnd.github.inertia-preview+json"
  24894. },
  24895. method: "GET",
  24896. params: {
  24897. org: {
  24898. required: true,
  24899. type: "string"
  24900. },
  24901. project_id: {
  24902. required: true,
  24903. type: "integer"
  24904. },
  24905. team_slug: {
  24906. required: true,
  24907. type: "string"
  24908. }
  24909. },
  24910. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24911. },
  24912. reviewProjectLegacy: {
  24913. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  24914. headers: {
  24915. accept: "application/vnd.github.inertia-preview+json"
  24916. },
  24917. method: "GET",
  24918. params: {
  24919. project_id: {
  24920. required: true,
  24921. type: "integer"
  24922. },
  24923. team_id: {
  24924. required: true,
  24925. type: "integer"
  24926. }
  24927. },
  24928. url: "/teams/:team_id/projects/:project_id"
  24929. },
  24930. update: {
  24931. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  24932. method: "PATCH",
  24933. params: {
  24934. description: {
  24935. type: "string"
  24936. },
  24937. name: {
  24938. required: true,
  24939. type: "string"
  24940. },
  24941. parent_team_id: {
  24942. type: "integer"
  24943. },
  24944. permission: {
  24945. enum: ["pull", "push", "admin"],
  24946. type: "string"
  24947. },
  24948. privacy: {
  24949. enum: ["secret", "closed"],
  24950. type: "string"
  24951. },
  24952. team_id: {
  24953. required: true,
  24954. type: "integer"
  24955. }
  24956. },
  24957. url: "/teams/:team_id"
  24958. },
  24959. updateDiscussion: {
  24960. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  24961. method: "PATCH",
  24962. params: {
  24963. body: {
  24964. type: "string"
  24965. },
  24966. discussion_number: {
  24967. required: true,
  24968. type: "integer"
  24969. },
  24970. team_id: {
  24971. required: true,
  24972. type: "integer"
  24973. },
  24974. title: {
  24975. type: "string"
  24976. }
  24977. },
  24978. url: "/teams/:team_id/discussions/:discussion_number"
  24979. },
  24980. updateDiscussionComment: {
  24981. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  24982. method: "PATCH",
  24983. params: {
  24984. body: {
  24985. required: true,
  24986. type: "string"
  24987. },
  24988. comment_number: {
  24989. required: true,
  24990. type: "integer"
  24991. },
  24992. discussion_number: {
  24993. required: true,
  24994. type: "integer"
  24995. },
  24996. team_id: {
  24997. required: true,
  24998. type: "integer"
  24999. }
  25000. },
  25001. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25002. },
  25003. updateDiscussionCommentInOrg: {
  25004. method: "PATCH",
  25005. params: {
  25006. body: {
  25007. required: true,
  25008. type: "string"
  25009. },
  25010. comment_number: {
  25011. required: true,
  25012. type: "integer"
  25013. },
  25014. discussion_number: {
  25015. required: true,
  25016. type: "integer"
  25017. },
  25018. org: {
  25019. required: true,
  25020. type: "string"
  25021. },
  25022. team_slug: {
  25023. required: true,
  25024. type: "string"
  25025. }
  25026. },
  25027. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25028. },
  25029. updateDiscussionCommentLegacy: {
  25030. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25031. method: "PATCH",
  25032. params: {
  25033. body: {
  25034. required: true,
  25035. type: "string"
  25036. },
  25037. comment_number: {
  25038. required: true,
  25039. type: "integer"
  25040. },
  25041. discussion_number: {
  25042. required: true,
  25043. type: "integer"
  25044. },
  25045. team_id: {
  25046. required: true,
  25047. type: "integer"
  25048. }
  25049. },
  25050. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25051. },
  25052. updateDiscussionInOrg: {
  25053. method: "PATCH",
  25054. params: {
  25055. body: {
  25056. type: "string"
  25057. },
  25058. discussion_number: {
  25059. required: true,
  25060. type: "integer"
  25061. },
  25062. org: {
  25063. required: true,
  25064. type: "string"
  25065. },
  25066. team_slug: {
  25067. required: true,
  25068. type: "string"
  25069. },
  25070. title: {
  25071. type: "string"
  25072. }
  25073. },
  25074. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25075. },
  25076. updateDiscussionLegacy: {
  25077. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25078. method: "PATCH",
  25079. params: {
  25080. body: {
  25081. type: "string"
  25082. },
  25083. discussion_number: {
  25084. required: true,
  25085. type: "integer"
  25086. },
  25087. team_id: {
  25088. required: true,
  25089. type: "integer"
  25090. },
  25091. title: {
  25092. type: "string"
  25093. }
  25094. },
  25095. url: "/teams/:team_id/discussions/:discussion_number"
  25096. },
  25097. updateInOrg: {
  25098. method: "PATCH",
  25099. params: {
  25100. description: {
  25101. type: "string"
  25102. },
  25103. name: {
  25104. required: true,
  25105. type: "string"
  25106. },
  25107. org: {
  25108. required: true,
  25109. type: "string"
  25110. },
  25111. parent_team_id: {
  25112. type: "integer"
  25113. },
  25114. permission: {
  25115. enum: ["pull", "push", "admin"],
  25116. type: "string"
  25117. },
  25118. privacy: {
  25119. enum: ["secret", "closed"],
  25120. type: "string"
  25121. },
  25122. team_slug: {
  25123. required: true,
  25124. type: "string"
  25125. }
  25126. },
  25127. url: "/orgs/:org/teams/:team_slug"
  25128. },
  25129. updateLegacy: {
  25130. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25131. method: "PATCH",
  25132. params: {
  25133. description: {
  25134. type: "string"
  25135. },
  25136. name: {
  25137. required: true,
  25138. type: "string"
  25139. },
  25140. parent_team_id: {
  25141. type: "integer"
  25142. },
  25143. permission: {
  25144. enum: ["pull", "push", "admin"],
  25145. type: "string"
  25146. },
  25147. privacy: {
  25148. enum: ["secret", "closed"],
  25149. type: "string"
  25150. },
  25151. team_id: {
  25152. required: true,
  25153. type: "integer"
  25154. }
  25155. },
  25156. url: "/teams/:team_id"
  25157. }
  25158. },
  25159. users: {
  25160. addEmails: {
  25161. method: "POST",
  25162. params: {
  25163. emails: {
  25164. required: true,
  25165. type: "string[]"
  25166. }
  25167. },
  25168. url: "/user/emails"
  25169. },
  25170. block: {
  25171. method: "PUT",
  25172. params: {
  25173. username: {
  25174. required: true,
  25175. type: "string"
  25176. }
  25177. },
  25178. url: "/user/blocks/:username"
  25179. },
  25180. checkBlocked: {
  25181. method: "GET",
  25182. params: {
  25183. username: {
  25184. required: true,
  25185. type: "string"
  25186. }
  25187. },
  25188. url: "/user/blocks/:username"
  25189. },
  25190. checkFollowing: {
  25191. method: "GET",
  25192. params: {
  25193. username: {
  25194. required: true,
  25195. type: "string"
  25196. }
  25197. },
  25198. url: "/user/following/:username"
  25199. },
  25200. checkFollowingForUser: {
  25201. method: "GET",
  25202. params: {
  25203. target_user: {
  25204. required: true,
  25205. type: "string"
  25206. },
  25207. username: {
  25208. required: true,
  25209. type: "string"
  25210. }
  25211. },
  25212. url: "/users/:username/following/:target_user"
  25213. },
  25214. createGpgKey: {
  25215. method: "POST",
  25216. params: {
  25217. armored_public_key: {
  25218. type: "string"
  25219. }
  25220. },
  25221. url: "/user/gpg_keys"
  25222. },
  25223. createPublicKey: {
  25224. method: "POST",
  25225. params: {
  25226. key: {
  25227. type: "string"
  25228. },
  25229. title: {
  25230. type: "string"
  25231. }
  25232. },
  25233. url: "/user/keys"
  25234. },
  25235. deleteEmails: {
  25236. method: "DELETE",
  25237. params: {
  25238. emails: {
  25239. required: true,
  25240. type: "string[]"
  25241. }
  25242. },
  25243. url: "/user/emails"
  25244. },
  25245. deleteGpgKey: {
  25246. method: "DELETE",
  25247. params: {
  25248. gpg_key_id: {
  25249. required: true,
  25250. type: "integer"
  25251. }
  25252. },
  25253. url: "/user/gpg_keys/:gpg_key_id"
  25254. },
  25255. deletePublicKey: {
  25256. method: "DELETE",
  25257. params: {
  25258. key_id: {
  25259. required: true,
  25260. type: "integer"
  25261. }
  25262. },
  25263. url: "/user/keys/:key_id"
  25264. },
  25265. follow: {
  25266. method: "PUT",
  25267. params: {
  25268. username: {
  25269. required: true,
  25270. type: "string"
  25271. }
  25272. },
  25273. url: "/user/following/:username"
  25274. },
  25275. getAuthenticated: {
  25276. method: "GET",
  25277. params: {},
  25278. url: "/user"
  25279. },
  25280. getByUsername: {
  25281. method: "GET",
  25282. params: {
  25283. username: {
  25284. required: true,
  25285. type: "string"
  25286. }
  25287. },
  25288. url: "/users/:username"
  25289. },
  25290. getContextForUser: {
  25291. method: "GET",
  25292. params: {
  25293. subject_id: {
  25294. type: "string"
  25295. },
  25296. subject_type: {
  25297. enum: ["organization", "repository", "issue", "pull_request"],
  25298. type: "string"
  25299. },
  25300. username: {
  25301. required: true,
  25302. type: "string"
  25303. }
  25304. },
  25305. url: "/users/:username/hovercard"
  25306. },
  25307. getGpgKey: {
  25308. method: "GET",
  25309. params: {
  25310. gpg_key_id: {
  25311. required: true,
  25312. type: "integer"
  25313. }
  25314. },
  25315. url: "/user/gpg_keys/:gpg_key_id"
  25316. },
  25317. getPublicKey: {
  25318. method: "GET",
  25319. params: {
  25320. key_id: {
  25321. required: true,
  25322. type: "integer"
  25323. }
  25324. },
  25325. url: "/user/keys/:key_id"
  25326. },
  25327. list: {
  25328. method: "GET",
  25329. params: {
  25330. page: {
  25331. type: "integer"
  25332. },
  25333. per_page: {
  25334. type: "integer"
  25335. },
  25336. since: {
  25337. type: "string"
  25338. }
  25339. },
  25340. url: "/users"
  25341. },
  25342. listBlocked: {
  25343. method: "GET",
  25344. params: {},
  25345. url: "/user/blocks"
  25346. },
  25347. listEmails: {
  25348. method: "GET",
  25349. params: {
  25350. page: {
  25351. type: "integer"
  25352. },
  25353. per_page: {
  25354. type: "integer"
  25355. }
  25356. },
  25357. url: "/user/emails"
  25358. },
  25359. listFollowersForAuthenticatedUser: {
  25360. method: "GET",
  25361. params: {
  25362. page: {
  25363. type: "integer"
  25364. },
  25365. per_page: {
  25366. type: "integer"
  25367. }
  25368. },
  25369. url: "/user/followers"
  25370. },
  25371. listFollowersForUser: {
  25372. method: "GET",
  25373. params: {
  25374. page: {
  25375. type: "integer"
  25376. },
  25377. per_page: {
  25378. type: "integer"
  25379. },
  25380. username: {
  25381. required: true,
  25382. type: "string"
  25383. }
  25384. },
  25385. url: "/users/:username/followers"
  25386. },
  25387. listFollowingForAuthenticatedUser: {
  25388. method: "GET",
  25389. params: {
  25390. page: {
  25391. type: "integer"
  25392. },
  25393. per_page: {
  25394. type: "integer"
  25395. }
  25396. },
  25397. url: "/user/following"
  25398. },
  25399. listFollowingForUser: {
  25400. method: "GET",
  25401. params: {
  25402. page: {
  25403. type: "integer"
  25404. },
  25405. per_page: {
  25406. type: "integer"
  25407. },
  25408. username: {
  25409. required: true,
  25410. type: "string"
  25411. }
  25412. },
  25413. url: "/users/:username/following"
  25414. },
  25415. listGpgKeys: {
  25416. method: "GET",
  25417. params: {
  25418. page: {
  25419. type: "integer"
  25420. },
  25421. per_page: {
  25422. type: "integer"
  25423. }
  25424. },
  25425. url: "/user/gpg_keys"
  25426. },
  25427. listGpgKeysForUser: {
  25428. method: "GET",
  25429. params: {
  25430. page: {
  25431. type: "integer"
  25432. },
  25433. per_page: {
  25434. type: "integer"
  25435. },
  25436. username: {
  25437. required: true,
  25438. type: "string"
  25439. }
  25440. },
  25441. url: "/users/:username/gpg_keys"
  25442. },
  25443. listPublicEmails: {
  25444. method: "GET",
  25445. params: {
  25446. page: {
  25447. type: "integer"
  25448. },
  25449. per_page: {
  25450. type: "integer"
  25451. }
  25452. },
  25453. url: "/user/public_emails"
  25454. },
  25455. listPublicKeys: {
  25456. method: "GET",
  25457. params: {
  25458. page: {
  25459. type: "integer"
  25460. },
  25461. per_page: {
  25462. type: "integer"
  25463. }
  25464. },
  25465. url: "/user/keys"
  25466. },
  25467. listPublicKeysForUser: {
  25468. method: "GET",
  25469. params: {
  25470. page: {
  25471. type: "integer"
  25472. },
  25473. per_page: {
  25474. type: "integer"
  25475. },
  25476. username: {
  25477. required: true,
  25478. type: "string"
  25479. }
  25480. },
  25481. url: "/users/:username/keys"
  25482. },
  25483. togglePrimaryEmailVisibility: {
  25484. method: "PATCH",
  25485. params: {
  25486. email: {
  25487. required: true,
  25488. type: "string"
  25489. },
  25490. visibility: {
  25491. required: true,
  25492. type: "string"
  25493. }
  25494. },
  25495. url: "/user/email/visibility"
  25496. },
  25497. unblock: {
  25498. method: "DELETE",
  25499. params: {
  25500. username: {
  25501. required: true,
  25502. type: "string"
  25503. }
  25504. },
  25505. url: "/user/blocks/:username"
  25506. },
  25507. unfollow: {
  25508. method: "DELETE",
  25509. params: {
  25510. username: {
  25511. required: true,
  25512. type: "string"
  25513. }
  25514. },
  25515. url: "/user/following/:username"
  25516. },
  25517. updateAuthenticated: {
  25518. method: "PATCH",
  25519. params: {
  25520. bio: {
  25521. type: "string"
  25522. },
  25523. blog: {
  25524. type: "string"
  25525. },
  25526. company: {
  25527. type: "string"
  25528. },
  25529. email: {
  25530. type: "string"
  25531. },
  25532. hireable: {
  25533. type: "boolean"
  25534. },
  25535. location: {
  25536. type: "string"
  25537. },
  25538. name: {
  25539. type: "string"
  25540. }
  25541. },
  25542. url: "/user"
  25543. }
  25544. }
  25545. };
  25546. const VERSION = "2.4.0";
  25547. function registerEndpoints(octokit, routes) {
  25548. Object.keys(routes).forEach(namespaceName => {
  25549. if (!octokit[namespaceName]) {
  25550. octokit[namespaceName] = {};
  25551. }
  25552. Object.keys(routes[namespaceName]).forEach(apiName => {
  25553. const apiOptions = routes[namespaceName][apiName];
  25554. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25555. if (typeof apiOptions[key] !== "undefined") {
  25556. map[key] = apiOptions[key];
  25557. }
  25558. return map;
  25559. }, {});
  25560. endpointDefaults.request = {
  25561. validate: apiOptions.params
  25562. };
  25563. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25564. // Not the most elegant solution, but we don’t want to move deprecation
  25565. // logic into octokit/endpoint.js as it’s out of scope
  25566. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25567. if (hasDeprecatedParam) {
  25568. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25569. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25570. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25571. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25572. }
  25573. if (apiOptions.deprecated) {
  25574. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25575. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25576. octokit[namespaceName][apiName] = request;
  25577. return request.apply(null, arguments);
  25578. }, request);
  25579. return;
  25580. }
  25581. octokit[namespaceName][apiName] = request;
  25582. });
  25583. });
  25584. }
  25585. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25586. const patchedMethod = options => {
  25587. options = Object.assign({}, options);
  25588. Object.keys(options).forEach(key => {
  25589. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25590. const aliasKey = apiOptions.params[key].alias;
  25591. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25592. if (!(aliasKey in options)) {
  25593. options[aliasKey] = options[key];
  25594. }
  25595. delete options[key];
  25596. }
  25597. });
  25598. return method(options);
  25599. };
  25600. Object.keys(method).forEach(key => {
  25601. patchedMethod[key] = method[key];
  25602. });
  25603. return patchedMethod;
  25604. }
  25605. /**
  25606. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25607. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25608. * done, we will remove the registerEndpoints methods and return the methods
  25609. * directly as with the other plugins. At that point we will also remove the
  25610. * legacy workarounds and deprecations.
  25611. *
  25612. * See the plan at
  25613. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25614. */
  25615. function restEndpointMethods(octokit) {
  25616. // @ts-ignore
  25617. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25618. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25619. // See https://github.com/octokit/rest.js/pull/1134
  25620. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25621. Object.defineProperty(octokit, deprecatedScope, {
  25622. get() {
  25623. octokit.log.warn( // @ts-ignore
  25624. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25625. return octokit[scope];
  25626. }
  25627. });
  25628. });
  25629. return {};
  25630. }
  25631. restEndpointMethods.VERSION = VERSION;
  25632. exports.restEndpointMethods = restEndpointMethods;
  25633. //# sourceMappingURL=index.js.map
  25634. /***/ }),
  25635. /***/ 850:
  25636. /***/ (function(module, __unusedexports, __webpack_require__) {
  25637. module.exports = paginationMethodsPlugin
  25638. function paginationMethodsPlugin (octokit) {
  25639. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25640. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25641. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25642. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25643. octokit.hasFirstPage = __webpack_require__(536)
  25644. octokit.hasLastPage = __webpack_require__(336)
  25645. octokit.hasNextPage = __webpack_require__(929)
  25646. octokit.hasPreviousPage = __webpack_require__(558)
  25647. }
  25648. /***/ }),
  25649. /***/ 854:
  25650. /***/ (function(module) {
  25651. /**
  25652. * lodash (Custom Build) <https://lodash.com/>
  25653. * Build: `lodash modularize exports="npm" -o ./`
  25654. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25655. * Released under MIT license <https://lodash.com/license>
  25656. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25657. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25658. */
  25659. /** Used as the `TypeError` message for "Functions" methods. */
  25660. var FUNC_ERROR_TEXT = 'Expected a function';
  25661. /** Used to stand-in for `undefined` hash values. */
  25662. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25663. /** Used as references for various `Number` constants. */
  25664. var INFINITY = 1 / 0;
  25665. /** `Object#toString` result references. */
  25666. var funcTag = '[object Function]',
  25667. genTag = '[object GeneratorFunction]',
  25668. symbolTag = '[object Symbol]';
  25669. /** Used to match property names within property paths. */
  25670. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25671. reIsPlainProp = /^\w*$/,
  25672. reLeadingDot = /^\./,
  25673. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25674. /**
  25675. * Used to match `RegExp`
  25676. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25677. */
  25678. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25679. /** Used to match backslashes in property paths. */
  25680. var reEscapeChar = /\\(\\)?/g;
  25681. /** Used to detect host constructors (Safari). */
  25682. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25683. /** Detect free variable `global` from Node.js. */
  25684. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25685. /** Detect free variable `self`. */
  25686. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25687. /** Used as a reference to the global object. */
  25688. var root = freeGlobal || freeSelf || Function('return this')();
  25689. /**
  25690. * Gets the value at `key` of `object`.
  25691. *
  25692. * @private
  25693. * @param {Object} [object] The object to query.
  25694. * @param {string} key The key of the property to get.
  25695. * @returns {*} Returns the property value.
  25696. */
  25697. function getValue(object, key) {
  25698. return object == null ? undefined : object[key];
  25699. }
  25700. /**
  25701. * Checks if `value` is a host object in IE < 9.
  25702. *
  25703. * @private
  25704. * @param {*} value The value to check.
  25705. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25706. */
  25707. function isHostObject(value) {
  25708. // Many host objects are `Object` objects that can coerce to strings
  25709. // despite having improperly defined `toString` methods.
  25710. var result = false;
  25711. if (value != null && typeof value.toString != 'function') {
  25712. try {
  25713. result = !!(value + '');
  25714. } catch (e) {}
  25715. }
  25716. return result;
  25717. }
  25718. /** Used for built-in method references. */
  25719. var arrayProto = Array.prototype,
  25720. funcProto = Function.prototype,
  25721. objectProto = Object.prototype;
  25722. /** Used to detect overreaching core-js shims. */
  25723. var coreJsData = root['__core-js_shared__'];
  25724. /** Used to detect methods masquerading as native. */
  25725. var maskSrcKey = (function() {
  25726. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25727. return uid ? ('Symbol(src)_1.' + uid) : '';
  25728. }());
  25729. /** Used to resolve the decompiled source of functions. */
  25730. var funcToString = funcProto.toString;
  25731. /** Used to check objects for own properties. */
  25732. var hasOwnProperty = objectProto.hasOwnProperty;
  25733. /**
  25734. * Used to resolve the
  25735. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25736. * of values.
  25737. */
  25738. var objectToString = objectProto.toString;
  25739. /** Used to detect if a method is native. */
  25740. var reIsNative = RegExp('^' +
  25741. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25742. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25743. );
  25744. /** Built-in value references. */
  25745. var Symbol = root.Symbol,
  25746. splice = arrayProto.splice;
  25747. /* Built-in method references that are verified to be native. */
  25748. var Map = getNative(root, 'Map'),
  25749. nativeCreate = getNative(Object, 'create');
  25750. /** Used to convert symbols to primitives and strings. */
  25751. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25752. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25753. /**
  25754. * Creates a hash object.
  25755. *
  25756. * @private
  25757. * @constructor
  25758. * @param {Array} [entries] The key-value pairs to cache.
  25759. */
  25760. function Hash(entries) {
  25761. var index = -1,
  25762. length = entries ? entries.length : 0;
  25763. this.clear();
  25764. while (++index < length) {
  25765. var entry = entries[index];
  25766. this.set(entry[0], entry[1]);
  25767. }
  25768. }
  25769. /**
  25770. * Removes all key-value entries from the hash.
  25771. *
  25772. * @private
  25773. * @name clear
  25774. * @memberOf Hash
  25775. */
  25776. function hashClear() {
  25777. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25778. }
  25779. /**
  25780. * Removes `key` and its value from the hash.
  25781. *
  25782. * @private
  25783. * @name delete
  25784. * @memberOf Hash
  25785. * @param {Object} hash The hash to modify.
  25786. * @param {string} key The key of the value to remove.
  25787. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25788. */
  25789. function hashDelete(key) {
  25790. return this.has(key) && delete this.__data__[key];
  25791. }
  25792. /**
  25793. * Gets the hash value for `key`.
  25794. *
  25795. * @private
  25796. * @name get
  25797. * @memberOf Hash
  25798. * @param {string} key The key of the value to get.
  25799. * @returns {*} Returns the entry value.
  25800. */
  25801. function hashGet(key) {
  25802. var data = this.__data__;
  25803. if (nativeCreate) {
  25804. var result = data[key];
  25805. return result === HASH_UNDEFINED ? undefined : result;
  25806. }
  25807. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  25808. }
  25809. /**
  25810. * Checks if a hash value for `key` exists.
  25811. *
  25812. * @private
  25813. * @name has
  25814. * @memberOf Hash
  25815. * @param {string} key The key of the entry to check.
  25816. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25817. */
  25818. function hashHas(key) {
  25819. var data = this.__data__;
  25820. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  25821. }
  25822. /**
  25823. * Sets the hash `key` to `value`.
  25824. *
  25825. * @private
  25826. * @name set
  25827. * @memberOf Hash
  25828. * @param {string} key The key of the value to set.
  25829. * @param {*} value The value to set.
  25830. * @returns {Object} Returns the hash instance.
  25831. */
  25832. function hashSet(key, value) {
  25833. var data = this.__data__;
  25834. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  25835. return this;
  25836. }
  25837. // Add methods to `Hash`.
  25838. Hash.prototype.clear = hashClear;
  25839. Hash.prototype['delete'] = hashDelete;
  25840. Hash.prototype.get = hashGet;
  25841. Hash.prototype.has = hashHas;
  25842. Hash.prototype.set = hashSet;
  25843. /**
  25844. * Creates an list cache object.
  25845. *
  25846. * @private
  25847. * @constructor
  25848. * @param {Array} [entries] The key-value pairs to cache.
  25849. */
  25850. function ListCache(entries) {
  25851. var index = -1,
  25852. length = entries ? entries.length : 0;
  25853. this.clear();
  25854. while (++index < length) {
  25855. var entry = entries[index];
  25856. this.set(entry[0], entry[1]);
  25857. }
  25858. }
  25859. /**
  25860. * Removes all key-value entries from the list cache.
  25861. *
  25862. * @private
  25863. * @name clear
  25864. * @memberOf ListCache
  25865. */
  25866. function listCacheClear() {
  25867. this.__data__ = [];
  25868. }
  25869. /**
  25870. * Removes `key` and its value from the list cache.
  25871. *
  25872. * @private
  25873. * @name delete
  25874. * @memberOf ListCache
  25875. * @param {string} key The key of the value to remove.
  25876. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25877. */
  25878. function listCacheDelete(key) {
  25879. var data = this.__data__,
  25880. index = assocIndexOf(data, key);
  25881. if (index < 0) {
  25882. return false;
  25883. }
  25884. var lastIndex = data.length - 1;
  25885. if (index == lastIndex) {
  25886. data.pop();
  25887. } else {
  25888. splice.call(data, index, 1);
  25889. }
  25890. return true;
  25891. }
  25892. /**
  25893. * Gets the list cache value for `key`.
  25894. *
  25895. * @private
  25896. * @name get
  25897. * @memberOf ListCache
  25898. * @param {string} key The key of the value to get.
  25899. * @returns {*} Returns the entry value.
  25900. */
  25901. function listCacheGet(key) {
  25902. var data = this.__data__,
  25903. index = assocIndexOf(data, key);
  25904. return index < 0 ? undefined : data[index][1];
  25905. }
  25906. /**
  25907. * Checks if a list cache value for `key` exists.
  25908. *
  25909. * @private
  25910. * @name has
  25911. * @memberOf ListCache
  25912. * @param {string} key The key of the entry to check.
  25913. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25914. */
  25915. function listCacheHas(key) {
  25916. return assocIndexOf(this.__data__, key) > -1;
  25917. }
  25918. /**
  25919. * Sets the list cache `key` to `value`.
  25920. *
  25921. * @private
  25922. * @name set
  25923. * @memberOf ListCache
  25924. * @param {string} key The key of the value to set.
  25925. * @param {*} value The value to set.
  25926. * @returns {Object} Returns the list cache instance.
  25927. */
  25928. function listCacheSet(key, value) {
  25929. var data = this.__data__,
  25930. index = assocIndexOf(data, key);
  25931. if (index < 0) {
  25932. data.push([key, value]);
  25933. } else {
  25934. data[index][1] = value;
  25935. }
  25936. return this;
  25937. }
  25938. // Add methods to `ListCache`.
  25939. ListCache.prototype.clear = listCacheClear;
  25940. ListCache.prototype['delete'] = listCacheDelete;
  25941. ListCache.prototype.get = listCacheGet;
  25942. ListCache.prototype.has = listCacheHas;
  25943. ListCache.prototype.set = listCacheSet;
  25944. /**
  25945. * Creates a map cache object to store key-value pairs.
  25946. *
  25947. * @private
  25948. * @constructor
  25949. * @param {Array} [entries] The key-value pairs to cache.
  25950. */
  25951. function MapCache(entries) {
  25952. var index = -1,
  25953. length = entries ? entries.length : 0;
  25954. this.clear();
  25955. while (++index < length) {
  25956. var entry = entries[index];
  25957. this.set(entry[0], entry[1]);
  25958. }
  25959. }
  25960. /**
  25961. * Removes all key-value entries from the map.
  25962. *
  25963. * @private
  25964. * @name clear
  25965. * @memberOf MapCache
  25966. */
  25967. function mapCacheClear() {
  25968. this.__data__ = {
  25969. 'hash': new Hash,
  25970. 'map': new (Map || ListCache),
  25971. 'string': new Hash
  25972. };
  25973. }
  25974. /**
  25975. * Removes `key` and its value from the map.
  25976. *
  25977. * @private
  25978. * @name delete
  25979. * @memberOf MapCache
  25980. * @param {string} key The key of the value to remove.
  25981. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25982. */
  25983. function mapCacheDelete(key) {
  25984. return getMapData(this, key)['delete'](key);
  25985. }
  25986. /**
  25987. * Gets the map value for `key`.
  25988. *
  25989. * @private
  25990. * @name get
  25991. * @memberOf MapCache
  25992. * @param {string} key The key of the value to get.
  25993. * @returns {*} Returns the entry value.
  25994. */
  25995. function mapCacheGet(key) {
  25996. return getMapData(this, key).get(key);
  25997. }
  25998. /**
  25999. * Checks if a map value for `key` exists.
  26000. *
  26001. * @private
  26002. * @name has
  26003. * @memberOf MapCache
  26004. * @param {string} key The key of the entry to check.
  26005. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26006. */
  26007. function mapCacheHas(key) {
  26008. return getMapData(this, key).has(key);
  26009. }
  26010. /**
  26011. * Sets the map `key` to `value`.
  26012. *
  26013. * @private
  26014. * @name set
  26015. * @memberOf MapCache
  26016. * @param {string} key The key of the value to set.
  26017. * @param {*} value The value to set.
  26018. * @returns {Object} Returns the map cache instance.
  26019. */
  26020. function mapCacheSet(key, value) {
  26021. getMapData(this, key).set(key, value);
  26022. return this;
  26023. }
  26024. // Add methods to `MapCache`.
  26025. MapCache.prototype.clear = mapCacheClear;
  26026. MapCache.prototype['delete'] = mapCacheDelete;
  26027. MapCache.prototype.get = mapCacheGet;
  26028. MapCache.prototype.has = mapCacheHas;
  26029. MapCache.prototype.set = mapCacheSet;
  26030. /**
  26031. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26032. *
  26033. * @private
  26034. * @param {Array} array The array to inspect.
  26035. * @param {*} key The key to search for.
  26036. * @returns {number} Returns the index of the matched value, else `-1`.
  26037. */
  26038. function assocIndexOf(array, key) {
  26039. var length = array.length;
  26040. while (length--) {
  26041. if (eq(array[length][0], key)) {
  26042. return length;
  26043. }
  26044. }
  26045. return -1;
  26046. }
  26047. /**
  26048. * The base implementation of `_.get` without support for default values.
  26049. *
  26050. * @private
  26051. * @param {Object} object The object to query.
  26052. * @param {Array|string} path The path of the property to get.
  26053. * @returns {*} Returns the resolved value.
  26054. */
  26055. function baseGet(object, path) {
  26056. path = isKey(path, object) ? [path] : castPath(path);
  26057. var index = 0,
  26058. length = path.length;
  26059. while (object != null && index < length) {
  26060. object = object[toKey(path[index++])];
  26061. }
  26062. return (index && index == length) ? object : undefined;
  26063. }
  26064. /**
  26065. * The base implementation of `_.isNative` without bad shim checks.
  26066. *
  26067. * @private
  26068. * @param {*} value The value to check.
  26069. * @returns {boolean} Returns `true` if `value` is a native function,
  26070. * else `false`.
  26071. */
  26072. function baseIsNative(value) {
  26073. if (!isObject(value) || isMasked(value)) {
  26074. return false;
  26075. }
  26076. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26077. return pattern.test(toSource(value));
  26078. }
  26079. /**
  26080. * The base implementation of `_.toString` which doesn't convert nullish
  26081. * values to empty strings.
  26082. *
  26083. * @private
  26084. * @param {*} value The value to process.
  26085. * @returns {string} Returns the string.
  26086. */
  26087. function baseToString(value) {
  26088. // Exit early for strings to avoid a performance hit in some environments.
  26089. if (typeof value == 'string') {
  26090. return value;
  26091. }
  26092. if (isSymbol(value)) {
  26093. return symbolToString ? symbolToString.call(value) : '';
  26094. }
  26095. var result = (value + '');
  26096. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26097. }
  26098. /**
  26099. * Casts `value` to a path array if it's not one.
  26100. *
  26101. * @private
  26102. * @param {*} value The value to inspect.
  26103. * @returns {Array} Returns the cast property path array.
  26104. */
  26105. function castPath(value) {
  26106. return isArray(value) ? value : stringToPath(value);
  26107. }
  26108. /**
  26109. * Gets the data for `map`.
  26110. *
  26111. * @private
  26112. * @param {Object} map The map to query.
  26113. * @param {string} key The reference key.
  26114. * @returns {*} Returns the map data.
  26115. */
  26116. function getMapData(map, key) {
  26117. var data = map.__data__;
  26118. return isKeyable(key)
  26119. ? data[typeof key == 'string' ? 'string' : 'hash']
  26120. : data.map;
  26121. }
  26122. /**
  26123. * Gets the native function at `key` of `object`.
  26124. *
  26125. * @private
  26126. * @param {Object} object The object to query.
  26127. * @param {string} key The key of the method to get.
  26128. * @returns {*} Returns the function if it's native, else `undefined`.
  26129. */
  26130. function getNative(object, key) {
  26131. var value = getValue(object, key);
  26132. return baseIsNative(value) ? value : undefined;
  26133. }
  26134. /**
  26135. * Checks if `value` is a property name and not a property path.
  26136. *
  26137. * @private
  26138. * @param {*} value The value to check.
  26139. * @param {Object} [object] The object to query keys on.
  26140. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26141. */
  26142. function isKey(value, object) {
  26143. if (isArray(value)) {
  26144. return false;
  26145. }
  26146. var type = typeof value;
  26147. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26148. value == null || isSymbol(value)) {
  26149. return true;
  26150. }
  26151. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26152. (object != null && value in Object(object));
  26153. }
  26154. /**
  26155. * Checks if `value` is suitable for use as unique object key.
  26156. *
  26157. * @private
  26158. * @param {*} value The value to check.
  26159. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26160. */
  26161. function isKeyable(value) {
  26162. var type = typeof value;
  26163. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26164. ? (value !== '__proto__')
  26165. : (value === null);
  26166. }
  26167. /**
  26168. * Checks if `func` has its source masked.
  26169. *
  26170. * @private
  26171. * @param {Function} func The function to check.
  26172. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26173. */
  26174. function isMasked(func) {
  26175. return !!maskSrcKey && (maskSrcKey in func);
  26176. }
  26177. /**
  26178. * Converts `string` to a property path array.
  26179. *
  26180. * @private
  26181. * @param {string} string The string to convert.
  26182. * @returns {Array} Returns the property path array.
  26183. */
  26184. var stringToPath = memoize(function(string) {
  26185. string = toString(string);
  26186. var result = [];
  26187. if (reLeadingDot.test(string)) {
  26188. result.push('');
  26189. }
  26190. string.replace(rePropName, function(match, number, quote, string) {
  26191. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26192. });
  26193. return result;
  26194. });
  26195. /**
  26196. * Converts `value` to a string key if it's not a string or symbol.
  26197. *
  26198. * @private
  26199. * @param {*} value The value to inspect.
  26200. * @returns {string|symbol} Returns the key.
  26201. */
  26202. function toKey(value) {
  26203. if (typeof value == 'string' || isSymbol(value)) {
  26204. return value;
  26205. }
  26206. var result = (value + '');
  26207. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26208. }
  26209. /**
  26210. * Converts `func` to its source code.
  26211. *
  26212. * @private
  26213. * @param {Function} func The function to process.
  26214. * @returns {string} Returns the source code.
  26215. */
  26216. function toSource(func) {
  26217. if (func != null) {
  26218. try {
  26219. return funcToString.call(func);
  26220. } catch (e) {}
  26221. try {
  26222. return (func + '');
  26223. } catch (e) {}
  26224. }
  26225. return '';
  26226. }
  26227. /**
  26228. * Creates a function that memoizes the result of `func`. If `resolver` is
  26229. * provided, it determines the cache key for storing the result based on the
  26230. * arguments provided to the memoized function. By default, the first argument
  26231. * provided to the memoized function is used as the map cache key. The `func`
  26232. * is invoked with the `this` binding of the memoized function.
  26233. *
  26234. * **Note:** The cache is exposed as the `cache` property on the memoized
  26235. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26236. * constructor with one whose instances implement the
  26237. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26238. * method interface of `delete`, `get`, `has`, and `set`.
  26239. *
  26240. * @static
  26241. * @memberOf _
  26242. * @since 0.1.0
  26243. * @category Function
  26244. * @param {Function} func The function to have its output memoized.
  26245. * @param {Function} [resolver] The function to resolve the cache key.
  26246. * @returns {Function} Returns the new memoized function.
  26247. * @example
  26248. *
  26249. * var object = { 'a': 1, 'b': 2 };
  26250. * var other = { 'c': 3, 'd': 4 };
  26251. *
  26252. * var values = _.memoize(_.values);
  26253. * values(object);
  26254. * // => [1, 2]
  26255. *
  26256. * values(other);
  26257. * // => [3, 4]
  26258. *
  26259. * object.a = 2;
  26260. * values(object);
  26261. * // => [1, 2]
  26262. *
  26263. * // Modify the result cache.
  26264. * values.cache.set(object, ['a', 'b']);
  26265. * values(object);
  26266. * // => ['a', 'b']
  26267. *
  26268. * // Replace `_.memoize.Cache`.
  26269. * _.memoize.Cache = WeakMap;
  26270. */
  26271. function memoize(func, resolver) {
  26272. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26273. throw new TypeError(FUNC_ERROR_TEXT);
  26274. }
  26275. var memoized = function() {
  26276. var args = arguments,
  26277. key = resolver ? resolver.apply(this, args) : args[0],
  26278. cache = memoized.cache;
  26279. if (cache.has(key)) {
  26280. return cache.get(key);
  26281. }
  26282. var result = func.apply(this, args);
  26283. memoized.cache = cache.set(key, result);
  26284. return result;
  26285. };
  26286. memoized.cache = new (memoize.Cache || MapCache);
  26287. return memoized;
  26288. }
  26289. // Assign cache to `_.memoize`.
  26290. memoize.Cache = MapCache;
  26291. /**
  26292. * Performs a
  26293. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26294. * comparison between two values to determine if they are equivalent.
  26295. *
  26296. * @static
  26297. * @memberOf _
  26298. * @since 4.0.0
  26299. * @category Lang
  26300. * @param {*} value The value to compare.
  26301. * @param {*} other The other value to compare.
  26302. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26303. * @example
  26304. *
  26305. * var object = { 'a': 1 };
  26306. * var other = { 'a': 1 };
  26307. *
  26308. * _.eq(object, object);
  26309. * // => true
  26310. *
  26311. * _.eq(object, other);
  26312. * // => false
  26313. *
  26314. * _.eq('a', 'a');
  26315. * // => true
  26316. *
  26317. * _.eq('a', Object('a'));
  26318. * // => false
  26319. *
  26320. * _.eq(NaN, NaN);
  26321. * // => true
  26322. */
  26323. function eq(value, other) {
  26324. return value === other || (value !== value && other !== other);
  26325. }
  26326. /**
  26327. * Checks if `value` is classified as an `Array` object.
  26328. *
  26329. * @static
  26330. * @memberOf _
  26331. * @since 0.1.0
  26332. * @category Lang
  26333. * @param {*} value The value to check.
  26334. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26335. * @example
  26336. *
  26337. * _.isArray([1, 2, 3]);
  26338. * // => true
  26339. *
  26340. * _.isArray(document.body.children);
  26341. * // => false
  26342. *
  26343. * _.isArray('abc');
  26344. * // => false
  26345. *
  26346. * _.isArray(_.noop);
  26347. * // => false
  26348. */
  26349. var isArray = Array.isArray;
  26350. /**
  26351. * Checks if `value` is classified as a `Function` object.
  26352. *
  26353. * @static
  26354. * @memberOf _
  26355. * @since 0.1.0
  26356. * @category Lang
  26357. * @param {*} value The value to check.
  26358. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26359. * @example
  26360. *
  26361. * _.isFunction(_);
  26362. * // => true
  26363. *
  26364. * _.isFunction(/abc/);
  26365. * // => false
  26366. */
  26367. function isFunction(value) {
  26368. // The use of `Object#toString` avoids issues with the `typeof` operator
  26369. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26370. var tag = isObject(value) ? objectToString.call(value) : '';
  26371. return tag == funcTag || tag == genTag;
  26372. }
  26373. /**
  26374. * Checks if `value` is the
  26375. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26376. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26377. *
  26378. * @static
  26379. * @memberOf _
  26380. * @since 0.1.0
  26381. * @category Lang
  26382. * @param {*} value The value to check.
  26383. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26384. * @example
  26385. *
  26386. * _.isObject({});
  26387. * // => true
  26388. *
  26389. * _.isObject([1, 2, 3]);
  26390. * // => true
  26391. *
  26392. * _.isObject(_.noop);
  26393. * // => true
  26394. *
  26395. * _.isObject(null);
  26396. * // => false
  26397. */
  26398. function isObject(value) {
  26399. var type = typeof value;
  26400. return !!value && (type == 'object' || type == 'function');
  26401. }
  26402. /**
  26403. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26404. * and has a `typeof` result of "object".
  26405. *
  26406. * @static
  26407. * @memberOf _
  26408. * @since 4.0.0
  26409. * @category Lang
  26410. * @param {*} value The value to check.
  26411. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26412. * @example
  26413. *
  26414. * _.isObjectLike({});
  26415. * // => true
  26416. *
  26417. * _.isObjectLike([1, 2, 3]);
  26418. * // => true
  26419. *
  26420. * _.isObjectLike(_.noop);
  26421. * // => false
  26422. *
  26423. * _.isObjectLike(null);
  26424. * // => false
  26425. */
  26426. function isObjectLike(value) {
  26427. return !!value && typeof value == 'object';
  26428. }
  26429. /**
  26430. * Checks if `value` is classified as a `Symbol` primitive or object.
  26431. *
  26432. * @static
  26433. * @memberOf _
  26434. * @since 4.0.0
  26435. * @category Lang
  26436. * @param {*} value The value to check.
  26437. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26438. * @example
  26439. *
  26440. * _.isSymbol(Symbol.iterator);
  26441. * // => true
  26442. *
  26443. * _.isSymbol('abc');
  26444. * // => false
  26445. */
  26446. function isSymbol(value) {
  26447. return typeof value == 'symbol' ||
  26448. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26449. }
  26450. /**
  26451. * Converts `value` to a string. An empty string is returned for `null`
  26452. * and `undefined` values. The sign of `-0` is preserved.
  26453. *
  26454. * @static
  26455. * @memberOf _
  26456. * @since 4.0.0
  26457. * @category Lang
  26458. * @param {*} value The value to process.
  26459. * @returns {string} Returns the string.
  26460. * @example
  26461. *
  26462. * _.toString(null);
  26463. * // => ''
  26464. *
  26465. * _.toString(-0);
  26466. * // => '-0'
  26467. *
  26468. * _.toString([1, 2, 3]);
  26469. * // => '1,2,3'
  26470. */
  26471. function toString(value) {
  26472. return value == null ? '' : baseToString(value);
  26473. }
  26474. /**
  26475. * Gets the value at `path` of `object`. If the resolved value is
  26476. * `undefined`, the `defaultValue` is returned in its place.
  26477. *
  26478. * @static
  26479. * @memberOf _
  26480. * @since 3.7.0
  26481. * @category Object
  26482. * @param {Object} object The object to query.
  26483. * @param {Array|string} path The path of the property to get.
  26484. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26485. * @returns {*} Returns the resolved value.
  26486. * @example
  26487. *
  26488. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26489. *
  26490. * _.get(object, 'a[0].b.c');
  26491. * // => 3
  26492. *
  26493. * _.get(object, ['a', '0', 'b', 'c']);
  26494. * // => 3
  26495. *
  26496. * _.get(object, 'a.b.c', 'default');
  26497. * // => 'default'
  26498. */
  26499. function get(object, path, defaultValue) {
  26500. var result = object == null ? undefined : baseGet(object, path);
  26501. return result === undefined ? defaultValue : result;
  26502. }
  26503. module.exports = get;
  26504. /***/ }),
  26505. /***/ 855:
  26506. /***/ (function(module, __unusedexports, __webpack_require__) {
  26507. module.exports = registerPlugin;
  26508. const factory = __webpack_require__(47);
  26509. function registerPlugin(plugins, pluginFunction) {
  26510. return factory(
  26511. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26512. );
  26513. }
  26514. /***/ }),
  26515. /***/ 856:
  26516. /***/ (function(module, __unusedexports, __webpack_require__) {
  26517. module.exports = __webpack_require__(141);
  26518. /***/ }),
  26519. /***/ 863:
  26520. /***/ (function(module, __unusedexports, __webpack_require__) {
  26521. module.exports = authenticationBeforeRequest;
  26522. const btoa = __webpack_require__(675);
  26523. const withAuthorizationPrefix = __webpack_require__(143);
  26524. function authenticationBeforeRequest(state, options) {
  26525. if (typeof state.auth === "string") {
  26526. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26527. return;
  26528. }
  26529. if (state.auth.username) {
  26530. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26531. options.headers.authorization = `Basic ${hash}`;
  26532. if (state.otp) {
  26533. options.headers["x-github-otp"] = state.otp;
  26534. }
  26535. return;
  26536. }
  26537. if (state.auth.clientId) {
  26538. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26539. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26540. // URL though: `/applications/:client_id/tokens/:access_token`.
  26541. //
  26542. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26543. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26544. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26545. //
  26546. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26547. // as well as "/applications/123/tokens/token456"
  26548. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26549. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26550. options.headers.authorization = `Basic ${hash}`;
  26551. return;
  26552. }
  26553. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26554. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26555. return;
  26556. }
  26557. return Promise.resolve()
  26558. .then(() => {
  26559. return state.auth();
  26560. })
  26561. .then(authorization => {
  26562. options.headers.authorization = withAuthorizationPrefix(authorization);
  26563. });
  26564. }
  26565. /***/ }),
  26566. /***/ 866:
  26567. /***/ (function(module, __unusedexports, __webpack_require__) {
  26568. "use strict";
  26569. var shebangRegex = __webpack_require__(816);
  26570. module.exports = function (str) {
  26571. var match = str.match(shebangRegex);
  26572. if (!match) {
  26573. return null;
  26574. }
  26575. var arr = match[0].replace(/#! ?/, '').split(' ');
  26576. var bin = arr[0].split('/').pop();
  26577. var arg = arr[1];
  26578. return (bin === 'env' ?
  26579. arg :
  26580. bin + (arg ? ' ' + arg : '')
  26581. );
  26582. };
  26583. /***/ }),
  26584. /***/ 874:
  26585. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26586. "use strict";
  26587. // Copyright (c) Microsoft. All rights reserved.
  26588. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26589. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26590. return new (P || (P = Promise))(function (resolve, reject) {
  26591. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26592. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26593. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26594. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26595. });
  26596. };
  26597. Object.defineProperty(exports, "__esModule", { value: true });
  26598. const url = __webpack_require__(835);
  26599. const http = __webpack_require__(605);
  26600. const https = __webpack_require__(34);
  26601. let fs;
  26602. let tunnel;
  26603. var HttpCodes;
  26604. (function (HttpCodes) {
  26605. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26606. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26607. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26608. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26609. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26610. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26611. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26612. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26613. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26614. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26615. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26616. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26617. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26618. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26619. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26620. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26621. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26622. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26623. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26624. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26625. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26626. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26627. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26628. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26629. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26630. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26631. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26632. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26633. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26634. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26635. const ExponentialBackoffCeiling = 10;
  26636. const ExponentialBackoffTimeSlice = 5;
  26637. class HttpClientResponse {
  26638. constructor(message) {
  26639. this.message = message;
  26640. }
  26641. readBody() {
  26642. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26643. let output = '';
  26644. this.message.on('data', (chunk) => {
  26645. output += chunk;
  26646. });
  26647. this.message.on('end', () => {
  26648. resolve(output);
  26649. });
  26650. }));
  26651. }
  26652. }
  26653. exports.HttpClientResponse = HttpClientResponse;
  26654. function isHttps(requestUrl) {
  26655. let parsedUrl = url.parse(requestUrl);
  26656. return parsedUrl.protocol === 'https:';
  26657. }
  26658. exports.isHttps = isHttps;
  26659. var EnvironmentVariables;
  26660. (function (EnvironmentVariables) {
  26661. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26662. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26663. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26664. class HttpClient {
  26665. constructor(userAgent, handlers, requestOptions) {
  26666. this._ignoreSslError = false;
  26667. this._allowRedirects = true;
  26668. this._maxRedirects = 50;
  26669. this._allowRetries = false;
  26670. this._maxRetries = 1;
  26671. this._keepAlive = false;
  26672. this._disposed = false;
  26673. this.userAgent = userAgent;
  26674. this.handlers = handlers || [];
  26675. this.requestOptions = requestOptions;
  26676. if (requestOptions) {
  26677. if (requestOptions.ignoreSslError != null) {
  26678. this._ignoreSslError = requestOptions.ignoreSslError;
  26679. }
  26680. this._socketTimeout = requestOptions.socketTimeout;
  26681. this._httpProxy = requestOptions.proxy;
  26682. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26683. this._httpProxyBypassHosts = [];
  26684. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26685. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26686. });
  26687. }
  26688. this._certConfig = requestOptions.cert;
  26689. if (this._certConfig) {
  26690. // If using cert, need fs
  26691. fs = __webpack_require__(747);
  26692. // cache the cert content into memory, so we don't have to read it from disk every time
  26693. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26694. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26695. }
  26696. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26697. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26698. }
  26699. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26700. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26701. }
  26702. }
  26703. if (requestOptions.allowRedirects != null) {
  26704. this._allowRedirects = requestOptions.allowRedirects;
  26705. }
  26706. if (requestOptions.maxRedirects != null) {
  26707. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26708. }
  26709. if (requestOptions.keepAlive != null) {
  26710. this._keepAlive = requestOptions.keepAlive;
  26711. }
  26712. if (requestOptions.allowRetries != null) {
  26713. this._allowRetries = requestOptions.allowRetries;
  26714. }
  26715. if (requestOptions.maxRetries != null) {
  26716. this._maxRetries = requestOptions.maxRetries;
  26717. }
  26718. }
  26719. }
  26720. options(requestUrl, additionalHeaders) {
  26721. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26722. }
  26723. get(requestUrl, additionalHeaders) {
  26724. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26725. }
  26726. del(requestUrl, additionalHeaders) {
  26727. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26728. }
  26729. post(requestUrl, data, additionalHeaders) {
  26730. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26731. }
  26732. patch(requestUrl, data, additionalHeaders) {
  26733. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26734. }
  26735. put(requestUrl, data, additionalHeaders) {
  26736. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  26737. }
  26738. head(requestUrl, additionalHeaders) {
  26739. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  26740. }
  26741. sendStream(verb, requestUrl, stream, additionalHeaders) {
  26742. return this.request(verb, requestUrl, stream, additionalHeaders);
  26743. }
  26744. /**
  26745. * Makes a raw http request.
  26746. * All other methods such as get, post, patch, and request ultimately call this.
  26747. * Prefer get, del, post and patch
  26748. */
  26749. request(verb, requestUrl, data, headers) {
  26750. return __awaiter(this, void 0, void 0, function* () {
  26751. if (this._disposed) {
  26752. throw new Error("Client has already been disposed.");
  26753. }
  26754. let info = this._prepareRequest(verb, requestUrl, headers);
  26755. // Only perform retries on reads since writes may not be idempotent.
  26756. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  26757. let numTries = 0;
  26758. let response;
  26759. while (numTries < maxTries) {
  26760. response = yield this.requestRaw(info, data);
  26761. // Check if it's an authentication challenge
  26762. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  26763. let authenticationHandler;
  26764. for (let i = 0; i < this.handlers.length; i++) {
  26765. if (this.handlers[i].canHandleAuthentication(response)) {
  26766. authenticationHandler = this.handlers[i];
  26767. break;
  26768. }
  26769. }
  26770. if (authenticationHandler) {
  26771. return authenticationHandler.handleAuthentication(this, info, data);
  26772. }
  26773. else {
  26774. // We have received an unauthorized response but have no handlers to handle it.
  26775. // Let the response return to the caller.
  26776. return response;
  26777. }
  26778. }
  26779. let redirectsRemaining = this._maxRedirects;
  26780. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  26781. && this._allowRedirects
  26782. && redirectsRemaining > 0) {
  26783. const redirectUrl = response.message.headers["location"];
  26784. if (!redirectUrl) {
  26785. // if there's no location to redirect to, we won't
  26786. break;
  26787. }
  26788. // we need to finish reading the response before reassigning response
  26789. // which will leak the open socket.
  26790. yield response.readBody();
  26791. // let's make the request with the new redirectUrl
  26792. info = this._prepareRequest(verb, redirectUrl, headers);
  26793. response = yield this.requestRaw(info, data);
  26794. redirectsRemaining--;
  26795. }
  26796. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  26797. // If not a retry code, return immediately instead of retrying
  26798. return response;
  26799. }
  26800. numTries += 1;
  26801. if (numTries < maxTries) {
  26802. yield response.readBody();
  26803. yield this._performExponentialBackoff(numTries);
  26804. }
  26805. }
  26806. return response;
  26807. });
  26808. }
  26809. /**
  26810. * Needs to be called if keepAlive is set to true in request options.
  26811. */
  26812. dispose() {
  26813. if (this._agent) {
  26814. this._agent.destroy();
  26815. }
  26816. this._disposed = true;
  26817. }
  26818. /**
  26819. * Raw request.
  26820. * @param info
  26821. * @param data
  26822. */
  26823. requestRaw(info, data) {
  26824. return new Promise((resolve, reject) => {
  26825. let callbackForResult = function (err, res) {
  26826. if (err) {
  26827. reject(err);
  26828. }
  26829. resolve(res);
  26830. };
  26831. this.requestRawWithCallback(info, data, callbackForResult);
  26832. });
  26833. }
  26834. /**
  26835. * Raw request with callback.
  26836. * @param info
  26837. * @param data
  26838. * @param onResult
  26839. */
  26840. requestRawWithCallback(info, data, onResult) {
  26841. let socket;
  26842. let isDataString = typeof (data) === 'string';
  26843. if (typeof (data) === 'string') {
  26844. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  26845. }
  26846. let callbackCalled = false;
  26847. let handleResult = (err, res) => {
  26848. if (!callbackCalled) {
  26849. callbackCalled = true;
  26850. onResult(err, res);
  26851. }
  26852. };
  26853. let req = info.httpModule.request(info.options, (msg) => {
  26854. let res = new HttpClientResponse(msg);
  26855. handleResult(null, res);
  26856. });
  26857. req.on('socket', (sock) => {
  26858. socket = sock;
  26859. });
  26860. // If we ever get disconnected, we want the socket to timeout eventually
  26861. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  26862. if (socket) {
  26863. socket.end();
  26864. }
  26865. handleResult(new Error('Request timeout: ' + info.options.path), null);
  26866. });
  26867. req.on('error', function (err) {
  26868. // err has statusCode property
  26869. // res should have headers
  26870. handleResult(err, null);
  26871. });
  26872. if (data && typeof (data) === 'string') {
  26873. req.write(data, 'utf8');
  26874. }
  26875. if (data && typeof (data) !== 'string') {
  26876. data.on('close', function () {
  26877. req.end();
  26878. });
  26879. data.pipe(req);
  26880. }
  26881. else {
  26882. req.end();
  26883. }
  26884. }
  26885. _prepareRequest(method, requestUrl, headers) {
  26886. const info = {};
  26887. info.parsedUrl = url.parse(requestUrl);
  26888. const usingSsl = info.parsedUrl.protocol === 'https:';
  26889. info.httpModule = usingSsl ? https : http;
  26890. const defaultPort = usingSsl ? 443 : 80;
  26891. info.options = {};
  26892. info.options.host = info.parsedUrl.hostname;
  26893. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  26894. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  26895. info.options.method = method;
  26896. info.options.headers = this._mergeHeaders(headers);
  26897. info.options.headers["user-agent"] = this.userAgent;
  26898. info.options.agent = this._getAgent(requestUrl);
  26899. // gives handlers an opportunity to participate
  26900. if (this.handlers && !this._isPresigned(requestUrl)) {
  26901. this.handlers.forEach((handler) => {
  26902. handler.prepareRequest(info.options);
  26903. });
  26904. }
  26905. return info;
  26906. }
  26907. _isPresigned(requestUrl) {
  26908. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  26909. const patterns = this.requestOptions.presignedUrlPatterns;
  26910. for (let i = 0; i < patterns.length; i++) {
  26911. if (requestUrl.match(patterns[i])) {
  26912. return true;
  26913. }
  26914. }
  26915. }
  26916. return false;
  26917. }
  26918. _mergeHeaders(headers) {
  26919. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  26920. if (this.requestOptions && this.requestOptions.headers) {
  26921. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  26922. }
  26923. return lowercaseKeys(headers || {});
  26924. }
  26925. _getAgent(requestUrl) {
  26926. let agent;
  26927. let proxy = this._getProxy(requestUrl);
  26928. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  26929. if (this._keepAlive && useProxy) {
  26930. agent = this._proxyAgent;
  26931. }
  26932. if (this._keepAlive && !useProxy) {
  26933. agent = this._agent;
  26934. }
  26935. // if agent is already assigned use that agent.
  26936. if (!!agent) {
  26937. return agent;
  26938. }
  26939. let parsedUrl = url.parse(requestUrl);
  26940. const usingSsl = parsedUrl.protocol === 'https:';
  26941. let maxSockets = 100;
  26942. if (!!this.requestOptions) {
  26943. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  26944. }
  26945. if (useProxy) {
  26946. // If using proxy, need tunnel
  26947. if (!tunnel) {
  26948. tunnel = __webpack_require__(856);
  26949. }
  26950. const agentOptions = {
  26951. maxSockets: maxSockets,
  26952. keepAlive: this._keepAlive,
  26953. proxy: {
  26954. proxyAuth: proxy.proxyAuth,
  26955. host: proxy.proxyUrl.hostname,
  26956. port: proxy.proxyUrl.port
  26957. },
  26958. };
  26959. let tunnelAgent;
  26960. const overHttps = proxy.proxyUrl.protocol === 'https:';
  26961. if (usingSsl) {
  26962. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  26963. }
  26964. else {
  26965. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  26966. }
  26967. agent = tunnelAgent(agentOptions);
  26968. this._proxyAgent = agent;
  26969. }
  26970. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  26971. if (this._keepAlive && !agent) {
  26972. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  26973. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  26974. this._agent = agent;
  26975. }
  26976. // if not using private agent and tunnel agent isn't setup then use global agent
  26977. if (!agent) {
  26978. agent = usingSsl ? https.globalAgent : http.globalAgent;
  26979. }
  26980. if (usingSsl && this._ignoreSslError) {
  26981. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  26982. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  26983. // we have to cast it to any and change it directly
  26984. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  26985. }
  26986. if (usingSsl && this._certConfig) {
  26987. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  26988. }
  26989. return agent;
  26990. }
  26991. _getProxy(requestUrl) {
  26992. const parsedUrl = url.parse(requestUrl);
  26993. let usingSsl = parsedUrl.protocol === 'https:';
  26994. let proxyConfig = this._httpProxy;
  26995. // fallback to http_proxy and https_proxy env
  26996. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  26997. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  26998. if (!proxyConfig) {
  26999. if (https_proxy && usingSsl) {
  27000. proxyConfig = {
  27001. proxyUrl: https_proxy
  27002. };
  27003. }
  27004. else if (http_proxy) {
  27005. proxyConfig = {
  27006. proxyUrl: http_proxy
  27007. };
  27008. }
  27009. }
  27010. let proxyUrl;
  27011. let proxyAuth;
  27012. if (proxyConfig) {
  27013. if (proxyConfig.proxyUrl.length > 0) {
  27014. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27015. }
  27016. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27017. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27018. }
  27019. }
  27020. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27021. }
  27022. _isBypassProxy(requestUrl) {
  27023. if (!this._httpProxyBypassHosts) {
  27024. return false;
  27025. }
  27026. let bypass = false;
  27027. this._httpProxyBypassHosts.forEach(bypassHost => {
  27028. if (bypassHost.test(requestUrl)) {
  27029. bypass = true;
  27030. }
  27031. });
  27032. return bypass;
  27033. }
  27034. _performExponentialBackoff(retryNumber) {
  27035. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27036. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27037. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27038. }
  27039. }
  27040. exports.HttpClient = HttpClient;
  27041. /***/ }),
  27042. /***/ 881:
  27043. /***/ (function(module) {
  27044. "use strict";
  27045. const isWin = process.platform === 'win32';
  27046. function notFoundError(original, syscall) {
  27047. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27048. code: 'ENOENT',
  27049. errno: 'ENOENT',
  27050. syscall: `${syscall} ${original.command}`,
  27051. path: original.command,
  27052. spawnargs: original.args,
  27053. });
  27054. }
  27055. function hookChildProcess(cp, parsed) {
  27056. if (!isWin) {
  27057. return;
  27058. }
  27059. const originalEmit = cp.emit;
  27060. cp.emit = function (name, arg1) {
  27061. // If emitting "exit" event and exit code is 1, we need to check if
  27062. // the command exists and emit an "error" instead
  27063. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27064. if (name === 'exit') {
  27065. const err = verifyENOENT(arg1, parsed, 'spawn');
  27066. if (err) {
  27067. return originalEmit.call(cp, 'error', err);
  27068. }
  27069. }
  27070. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27071. };
  27072. }
  27073. function verifyENOENT(status, parsed) {
  27074. if (isWin && status === 1 && !parsed.file) {
  27075. return notFoundError(parsed.original, 'spawn');
  27076. }
  27077. return null;
  27078. }
  27079. function verifyENOENTSync(status, parsed) {
  27080. if (isWin && status === 1 && !parsed.file) {
  27081. return notFoundError(parsed.original, 'spawnSync');
  27082. }
  27083. return null;
  27084. }
  27085. module.exports = {
  27086. hookChildProcess,
  27087. verifyENOENT,
  27088. verifyENOENTSync,
  27089. notFoundError,
  27090. };
  27091. /***/ }),
  27092. /***/ 883:
  27093. /***/ (function(module) {
  27094. /**
  27095. * lodash (Custom Build) <https://lodash.com/>
  27096. * Build: `lodash modularize exports="npm" -o ./`
  27097. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27098. * Released under MIT license <https://lodash.com/license>
  27099. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27100. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27101. */
  27102. /** Used as the `TypeError` message for "Functions" methods. */
  27103. var FUNC_ERROR_TEXT = 'Expected a function';
  27104. /** Used to stand-in for `undefined` hash values. */
  27105. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27106. /** Used as references for various `Number` constants. */
  27107. var INFINITY = 1 / 0,
  27108. MAX_SAFE_INTEGER = 9007199254740991;
  27109. /** `Object#toString` result references. */
  27110. var funcTag = '[object Function]',
  27111. genTag = '[object GeneratorFunction]',
  27112. symbolTag = '[object Symbol]';
  27113. /** Used to match property names within property paths. */
  27114. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27115. reIsPlainProp = /^\w*$/,
  27116. reLeadingDot = /^\./,
  27117. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27118. /**
  27119. * Used to match `RegExp`
  27120. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27121. */
  27122. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27123. /** Used to match backslashes in property paths. */
  27124. var reEscapeChar = /\\(\\)?/g;
  27125. /** Used to detect host constructors (Safari). */
  27126. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27127. /** Used to detect unsigned integer values. */
  27128. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27129. /** Detect free variable `global` from Node.js. */
  27130. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27131. /** Detect free variable `self`. */
  27132. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27133. /** Used as a reference to the global object. */
  27134. var root = freeGlobal || freeSelf || Function('return this')();
  27135. /**
  27136. * Gets the value at `key` of `object`.
  27137. *
  27138. * @private
  27139. * @param {Object} [object] The object to query.
  27140. * @param {string} key The key of the property to get.
  27141. * @returns {*} Returns the property value.
  27142. */
  27143. function getValue(object, key) {
  27144. return object == null ? undefined : object[key];
  27145. }
  27146. /**
  27147. * Checks if `value` is a host object in IE < 9.
  27148. *
  27149. * @private
  27150. * @param {*} value The value to check.
  27151. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27152. */
  27153. function isHostObject(value) {
  27154. // Many host objects are `Object` objects that can coerce to strings
  27155. // despite having improperly defined `toString` methods.
  27156. var result = false;
  27157. if (value != null && typeof value.toString != 'function') {
  27158. try {
  27159. result = !!(value + '');
  27160. } catch (e) {}
  27161. }
  27162. return result;
  27163. }
  27164. /** Used for built-in method references. */
  27165. var arrayProto = Array.prototype,
  27166. funcProto = Function.prototype,
  27167. objectProto = Object.prototype;
  27168. /** Used to detect overreaching core-js shims. */
  27169. var coreJsData = root['__core-js_shared__'];
  27170. /** Used to detect methods masquerading as native. */
  27171. var maskSrcKey = (function() {
  27172. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27173. return uid ? ('Symbol(src)_1.' + uid) : '';
  27174. }());
  27175. /** Used to resolve the decompiled source of functions. */
  27176. var funcToString = funcProto.toString;
  27177. /** Used to check objects for own properties. */
  27178. var hasOwnProperty = objectProto.hasOwnProperty;
  27179. /**
  27180. * Used to resolve the
  27181. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27182. * of values.
  27183. */
  27184. var objectToString = objectProto.toString;
  27185. /** Used to detect if a method is native. */
  27186. var reIsNative = RegExp('^' +
  27187. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27188. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27189. );
  27190. /** Built-in value references. */
  27191. var Symbol = root.Symbol,
  27192. splice = arrayProto.splice;
  27193. /* Built-in method references that are verified to be native. */
  27194. var Map = getNative(root, 'Map'),
  27195. nativeCreate = getNative(Object, 'create');
  27196. /** Used to convert symbols to primitives and strings. */
  27197. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27198. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27199. /**
  27200. * Creates a hash object.
  27201. *
  27202. * @private
  27203. * @constructor
  27204. * @param {Array} [entries] The key-value pairs to cache.
  27205. */
  27206. function Hash(entries) {
  27207. var index = -1,
  27208. length = entries ? entries.length : 0;
  27209. this.clear();
  27210. while (++index < length) {
  27211. var entry = entries[index];
  27212. this.set(entry[0], entry[1]);
  27213. }
  27214. }
  27215. /**
  27216. * Removes all key-value entries from the hash.
  27217. *
  27218. * @private
  27219. * @name clear
  27220. * @memberOf Hash
  27221. */
  27222. function hashClear() {
  27223. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27224. }
  27225. /**
  27226. * Removes `key` and its value from the hash.
  27227. *
  27228. * @private
  27229. * @name delete
  27230. * @memberOf Hash
  27231. * @param {Object} hash The hash to modify.
  27232. * @param {string} key The key of the value to remove.
  27233. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27234. */
  27235. function hashDelete(key) {
  27236. return this.has(key) && delete this.__data__[key];
  27237. }
  27238. /**
  27239. * Gets the hash value for `key`.
  27240. *
  27241. * @private
  27242. * @name get
  27243. * @memberOf Hash
  27244. * @param {string} key The key of the value to get.
  27245. * @returns {*} Returns the entry value.
  27246. */
  27247. function hashGet(key) {
  27248. var data = this.__data__;
  27249. if (nativeCreate) {
  27250. var result = data[key];
  27251. return result === HASH_UNDEFINED ? undefined : result;
  27252. }
  27253. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27254. }
  27255. /**
  27256. * Checks if a hash value for `key` exists.
  27257. *
  27258. * @private
  27259. * @name has
  27260. * @memberOf Hash
  27261. * @param {string} key The key of the entry to check.
  27262. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27263. */
  27264. function hashHas(key) {
  27265. var data = this.__data__;
  27266. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27267. }
  27268. /**
  27269. * Sets the hash `key` to `value`.
  27270. *
  27271. * @private
  27272. * @name set
  27273. * @memberOf Hash
  27274. * @param {string} key The key of the value to set.
  27275. * @param {*} value The value to set.
  27276. * @returns {Object} Returns the hash instance.
  27277. */
  27278. function hashSet(key, value) {
  27279. var data = this.__data__;
  27280. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27281. return this;
  27282. }
  27283. // Add methods to `Hash`.
  27284. Hash.prototype.clear = hashClear;
  27285. Hash.prototype['delete'] = hashDelete;
  27286. Hash.prototype.get = hashGet;
  27287. Hash.prototype.has = hashHas;
  27288. Hash.prototype.set = hashSet;
  27289. /**
  27290. * Creates an list cache object.
  27291. *
  27292. * @private
  27293. * @constructor
  27294. * @param {Array} [entries] The key-value pairs to cache.
  27295. */
  27296. function ListCache(entries) {
  27297. var index = -1,
  27298. length = entries ? entries.length : 0;
  27299. this.clear();
  27300. while (++index < length) {
  27301. var entry = entries[index];
  27302. this.set(entry[0], entry[1]);
  27303. }
  27304. }
  27305. /**
  27306. * Removes all key-value entries from the list cache.
  27307. *
  27308. * @private
  27309. * @name clear
  27310. * @memberOf ListCache
  27311. */
  27312. function listCacheClear() {
  27313. this.__data__ = [];
  27314. }
  27315. /**
  27316. * Removes `key` and its value from the list cache.
  27317. *
  27318. * @private
  27319. * @name delete
  27320. * @memberOf ListCache
  27321. * @param {string} key The key of the value to remove.
  27322. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27323. */
  27324. function listCacheDelete(key) {
  27325. var data = this.__data__,
  27326. index = assocIndexOf(data, key);
  27327. if (index < 0) {
  27328. return false;
  27329. }
  27330. var lastIndex = data.length - 1;
  27331. if (index == lastIndex) {
  27332. data.pop();
  27333. } else {
  27334. splice.call(data, index, 1);
  27335. }
  27336. return true;
  27337. }
  27338. /**
  27339. * Gets the list cache value for `key`.
  27340. *
  27341. * @private
  27342. * @name get
  27343. * @memberOf ListCache
  27344. * @param {string} key The key of the value to get.
  27345. * @returns {*} Returns the entry value.
  27346. */
  27347. function listCacheGet(key) {
  27348. var data = this.__data__,
  27349. index = assocIndexOf(data, key);
  27350. return index < 0 ? undefined : data[index][1];
  27351. }
  27352. /**
  27353. * Checks if a list cache value for `key` exists.
  27354. *
  27355. * @private
  27356. * @name has
  27357. * @memberOf ListCache
  27358. * @param {string} key The key of the entry to check.
  27359. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27360. */
  27361. function listCacheHas(key) {
  27362. return assocIndexOf(this.__data__, key) > -1;
  27363. }
  27364. /**
  27365. * Sets the list cache `key` to `value`.
  27366. *
  27367. * @private
  27368. * @name set
  27369. * @memberOf ListCache
  27370. * @param {string} key The key of the value to set.
  27371. * @param {*} value The value to set.
  27372. * @returns {Object} Returns the list cache instance.
  27373. */
  27374. function listCacheSet(key, value) {
  27375. var data = this.__data__,
  27376. index = assocIndexOf(data, key);
  27377. if (index < 0) {
  27378. data.push([key, value]);
  27379. } else {
  27380. data[index][1] = value;
  27381. }
  27382. return this;
  27383. }
  27384. // Add methods to `ListCache`.
  27385. ListCache.prototype.clear = listCacheClear;
  27386. ListCache.prototype['delete'] = listCacheDelete;
  27387. ListCache.prototype.get = listCacheGet;
  27388. ListCache.prototype.has = listCacheHas;
  27389. ListCache.prototype.set = listCacheSet;
  27390. /**
  27391. * Creates a map cache object to store key-value pairs.
  27392. *
  27393. * @private
  27394. * @constructor
  27395. * @param {Array} [entries] The key-value pairs to cache.
  27396. */
  27397. function MapCache(entries) {
  27398. var index = -1,
  27399. length = entries ? entries.length : 0;
  27400. this.clear();
  27401. while (++index < length) {
  27402. var entry = entries[index];
  27403. this.set(entry[0], entry[1]);
  27404. }
  27405. }
  27406. /**
  27407. * Removes all key-value entries from the map.
  27408. *
  27409. * @private
  27410. * @name clear
  27411. * @memberOf MapCache
  27412. */
  27413. function mapCacheClear() {
  27414. this.__data__ = {
  27415. 'hash': new Hash,
  27416. 'map': new (Map || ListCache),
  27417. 'string': new Hash
  27418. };
  27419. }
  27420. /**
  27421. * Removes `key` and its value from the map.
  27422. *
  27423. * @private
  27424. * @name delete
  27425. * @memberOf MapCache
  27426. * @param {string} key The key of the value to remove.
  27427. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27428. */
  27429. function mapCacheDelete(key) {
  27430. return getMapData(this, key)['delete'](key);
  27431. }
  27432. /**
  27433. * Gets the map value for `key`.
  27434. *
  27435. * @private
  27436. * @name get
  27437. * @memberOf MapCache
  27438. * @param {string} key The key of the value to get.
  27439. * @returns {*} Returns the entry value.
  27440. */
  27441. function mapCacheGet(key) {
  27442. return getMapData(this, key).get(key);
  27443. }
  27444. /**
  27445. * Checks if a map value for `key` exists.
  27446. *
  27447. * @private
  27448. * @name has
  27449. * @memberOf MapCache
  27450. * @param {string} key The key of the entry to check.
  27451. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27452. */
  27453. function mapCacheHas(key) {
  27454. return getMapData(this, key).has(key);
  27455. }
  27456. /**
  27457. * Sets the map `key` to `value`.
  27458. *
  27459. * @private
  27460. * @name set
  27461. * @memberOf MapCache
  27462. * @param {string} key The key of the value to set.
  27463. * @param {*} value The value to set.
  27464. * @returns {Object} Returns the map cache instance.
  27465. */
  27466. function mapCacheSet(key, value) {
  27467. getMapData(this, key).set(key, value);
  27468. return this;
  27469. }
  27470. // Add methods to `MapCache`.
  27471. MapCache.prototype.clear = mapCacheClear;
  27472. MapCache.prototype['delete'] = mapCacheDelete;
  27473. MapCache.prototype.get = mapCacheGet;
  27474. MapCache.prototype.has = mapCacheHas;
  27475. MapCache.prototype.set = mapCacheSet;
  27476. /**
  27477. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27478. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27479. * for equality comparisons.
  27480. *
  27481. * @private
  27482. * @param {Object} object The object to modify.
  27483. * @param {string} key The key of the property to assign.
  27484. * @param {*} value The value to assign.
  27485. */
  27486. function assignValue(object, key, value) {
  27487. var objValue = object[key];
  27488. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27489. (value === undefined && !(key in object))) {
  27490. object[key] = value;
  27491. }
  27492. }
  27493. /**
  27494. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27495. *
  27496. * @private
  27497. * @param {Array} array The array to inspect.
  27498. * @param {*} key The key to search for.
  27499. * @returns {number} Returns the index of the matched value, else `-1`.
  27500. */
  27501. function assocIndexOf(array, key) {
  27502. var length = array.length;
  27503. while (length--) {
  27504. if (eq(array[length][0], key)) {
  27505. return length;
  27506. }
  27507. }
  27508. return -1;
  27509. }
  27510. /**
  27511. * The base implementation of `_.isNative` without bad shim checks.
  27512. *
  27513. * @private
  27514. * @param {*} value The value to check.
  27515. * @returns {boolean} Returns `true` if `value` is a native function,
  27516. * else `false`.
  27517. */
  27518. function baseIsNative(value) {
  27519. if (!isObject(value) || isMasked(value)) {
  27520. return false;
  27521. }
  27522. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27523. return pattern.test(toSource(value));
  27524. }
  27525. /**
  27526. * The base implementation of `_.set`.
  27527. *
  27528. * @private
  27529. * @param {Object} object The object to modify.
  27530. * @param {Array|string} path The path of the property to set.
  27531. * @param {*} value The value to set.
  27532. * @param {Function} [customizer] The function to customize path creation.
  27533. * @returns {Object} Returns `object`.
  27534. */
  27535. function baseSet(object, path, value, customizer) {
  27536. if (!isObject(object)) {
  27537. return object;
  27538. }
  27539. path = isKey(path, object) ? [path] : castPath(path);
  27540. var index = -1,
  27541. length = path.length,
  27542. lastIndex = length - 1,
  27543. nested = object;
  27544. while (nested != null && ++index < length) {
  27545. var key = toKey(path[index]),
  27546. newValue = value;
  27547. if (index != lastIndex) {
  27548. var objValue = nested[key];
  27549. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27550. if (newValue === undefined) {
  27551. newValue = isObject(objValue)
  27552. ? objValue
  27553. : (isIndex(path[index + 1]) ? [] : {});
  27554. }
  27555. }
  27556. assignValue(nested, key, newValue);
  27557. nested = nested[key];
  27558. }
  27559. return object;
  27560. }
  27561. /**
  27562. * The base implementation of `_.toString` which doesn't convert nullish
  27563. * values to empty strings.
  27564. *
  27565. * @private
  27566. * @param {*} value The value to process.
  27567. * @returns {string} Returns the string.
  27568. */
  27569. function baseToString(value) {
  27570. // Exit early for strings to avoid a performance hit in some environments.
  27571. if (typeof value == 'string') {
  27572. return value;
  27573. }
  27574. if (isSymbol(value)) {
  27575. return symbolToString ? symbolToString.call(value) : '';
  27576. }
  27577. var result = (value + '');
  27578. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27579. }
  27580. /**
  27581. * Casts `value` to a path array if it's not one.
  27582. *
  27583. * @private
  27584. * @param {*} value The value to inspect.
  27585. * @returns {Array} Returns the cast property path array.
  27586. */
  27587. function castPath(value) {
  27588. return isArray(value) ? value : stringToPath(value);
  27589. }
  27590. /**
  27591. * Gets the data for `map`.
  27592. *
  27593. * @private
  27594. * @param {Object} map The map to query.
  27595. * @param {string} key The reference key.
  27596. * @returns {*} Returns the map data.
  27597. */
  27598. function getMapData(map, key) {
  27599. var data = map.__data__;
  27600. return isKeyable(key)
  27601. ? data[typeof key == 'string' ? 'string' : 'hash']
  27602. : data.map;
  27603. }
  27604. /**
  27605. * Gets the native function at `key` of `object`.
  27606. *
  27607. * @private
  27608. * @param {Object} object The object to query.
  27609. * @param {string} key The key of the method to get.
  27610. * @returns {*} Returns the function if it's native, else `undefined`.
  27611. */
  27612. function getNative(object, key) {
  27613. var value = getValue(object, key);
  27614. return baseIsNative(value) ? value : undefined;
  27615. }
  27616. /**
  27617. * Checks if `value` is a valid array-like index.
  27618. *
  27619. * @private
  27620. * @param {*} value The value to check.
  27621. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27622. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27623. */
  27624. function isIndex(value, length) {
  27625. length = length == null ? MAX_SAFE_INTEGER : length;
  27626. return !!length &&
  27627. (typeof value == 'number' || reIsUint.test(value)) &&
  27628. (value > -1 && value % 1 == 0 && value < length);
  27629. }
  27630. /**
  27631. * Checks if `value` is a property name and not a property path.
  27632. *
  27633. * @private
  27634. * @param {*} value The value to check.
  27635. * @param {Object} [object] The object to query keys on.
  27636. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27637. */
  27638. function isKey(value, object) {
  27639. if (isArray(value)) {
  27640. return false;
  27641. }
  27642. var type = typeof value;
  27643. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27644. value == null || isSymbol(value)) {
  27645. return true;
  27646. }
  27647. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27648. (object != null && value in Object(object));
  27649. }
  27650. /**
  27651. * Checks if `value` is suitable for use as unique object key.
  27652. *
  27653. * @private
  27654. * @param {*} value The value to check.
  27655. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27656. */
  27657. function isKeyable(value) {
  27658. var type = typeof value;
  27659. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27660. ? (value !== '__proto__')
  27661. : (value === null);
  27662. }
  27663. /**
  27664. * Checks if `func` has its source masked.
  27665. *
  27666. * @private
  27667. * @param {Function} func The function to check.
  27668. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27669. */
  27670. function isMasked(func) {
  27671. return !!maskSrcKey && (maskSrcKey in func);
  27672. }
  27673. /**
  27674. * Converts `string` to a property path array.
  27675. *
  27676. * @private
  27677. * @param {string} string The string to convert.
  27678. * @returns {Array} Returns the property path array.
  27679. */
  27680. var stringToPath = memoize(function(string) {
  27681. string = toString(string);
  27682. var result = [];
  27683. if (reLeadingDot.test(string)) {
  27684. result.push('');
  27685. }
  27686. string.replace(rePropName, function(match, number, quote, string) {
  27687. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27688. });
  27689. return result;
  27690. });
  27691. /**
  27692. * Converts `value` to a string key if it's not a string or symbol.
  27693. *
  27694. * @private
  27695. * @param {*} value The value to inspect.
  27696. * @returns {string|symbol} Returns the key.
  27697. */
  27698. function toKey(value) {
  27699. if (typeof value == 'string' || isSymbol(value)) {
  27700. return value;
  27701. }
  27702. var result = (value + '');
  27703. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27704. }
  27705. /**
  27706. * Converts `func` to its source code.
  27707. *
  27708. * @private
  27709. * @param {Function} func The function to process.
  27710. * @returns {string} Returns the source code.
  27711. */
  27712. function toSource(func) {
  27713. if (func != null) {
  27714. try {
  27715. return funcToString.call(func);
  27716. } catch (e) {}
  27717. try {
  27718. return (func + '');
  27719. } catch (e) {}
  27720. }
  27721. return '';
  27722. }
  27723. /**
  27724. * Creates a function that memoizes the result of `func`. If `resolver` is
  27725. * provided, it determines the cache key for storing the result based on the
  27726. * arguments provided to the memoized function. By default, the first argument
  27727. * provided to the memoized function is used as the map cache key. The `func`
  27728. * is invoked with the `this` binding of the memoized function.
  27729. *
  27730. * **Note:** The cache is exposed as the `cache` property on the memoized
  27731. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27732. * constructor with one whose instances implement the
  27733. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27734. * method interface of `delete`, `get`, `has`, and `set`.
  27735. *
  27736. * @static
  27737. * @memberOf _
  27738. * @since 0.1.0
  27739. * @category Function
  27740. * @param {Function} func The function to have its output memoized.
  27741. * @param {Function} [resolver] The function to resolve the cache key.
  27742. * @returns {Function} Returns the new memoized function.
  27743. * @example
  27744. *
  27745. * var object = { 'a': 1, 'b': 2 };
  27746. * var other = { 'c': 3, 'd': 4 };
  27747. *
  27748. * var values = _.memoize(_.values);
  27749. * values(object);
  27750. * // => [1, 2]
  27751. *
  27752. * values(other);
  27753. * // => [3, 4]
  27754. *
  27755. * object.a = 2;
  27756. * values(object);
  27757. * // => [1, 2]
  27758. *
  27759. * // Modify the result cache.
  27760. * values.cache.set(object, ['a', 'b']);
  27761. * values(object);
  27762. * // => ['a', 'b']
  27763. *
  27764. * // Replace `_.memoize.Cache`.
  27765. * _.memoize.Cache = WeakMap;
  27766. */
  27767. function memoize(func, resolver) {
  27768. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  27769. throw new TypeError(FUNC_ERROR_TEXT);
  27770. }
  27771. var memoized = function() {
  27772. var args = arguments,
  27773. key = resolver ? resolver.apply(this, args) : args[0],
  27774. cache = memoized.cache;
  27775. if (cache.has(key)) {
  27776. return cache.get(key);
  27777. }
  27778. var result = func.apply(this, args);
  27779. memoized.cache = cache.set(key, result);
  27780. return result;
  27781. };
  27782. memoized.cache = new (memoize.Cache || MapCache);
  27783. return memoized;
  27784. }
  27785. // Assign cache to `_.memoize`.
  27786. memoize.Cache = MapCache;
  27787. /**
  27788. * Performs a
  27789. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27790. * comparison between two values to determine if they are equivalent.
  27791. *
  27792. * @static
  27793. * @memberOf _
  27794. * @since 4.0.0
  27795. * @category Lang
  27796. * @param {*} value The value to compare.
  27797. * @param {*} other The other value to compare.
  27798. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  27799. * @example
  27800. *
  27801. * var object = { 'a': 1 };
  27802. * var other = { 'a': 1 };
  27803. *
  27804. * _.eq(object, object);
  27805. * // => true
  27806. *
  27807. * _.eq(object, other);
  27808. * // => false
  27809. *
  27810. * _.eq('a', 'a');
  27811. * // => true
  27812. *
  27813. * _.eq('a', Object('a'));
  27814. * // => false
  27815. *
  27816. * _.eq(NaN, NaN);
  27817. * // => true
  27818. */
  27819. function eq(value, other) {
  27820. return value === other || (value !== value && other !== other);
  27821. }
  27822. /**
  27823. * Checks if `value` is classified as an `Array` object.
  27824. *
  27825. * @static
  27826. * @memberOf _
  27827. * @since 0.1.0
  27828. * @category Lang
  27829. * @param {*} value The value to check.
  27830. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  27831. * @example
  27832. *
  27833. * _.isArray([1, 2, 3]);
  27834. * // => true
  27835. *
  27836. * _.isArray(document.body.children);
  27837. * // => false
  27838. *
  27839. * _.isArray('abc');
  27840. * // => false
  27841. *
  27842. * _.isArray(_.noop);
  27843. * // => false
  27844. */
  27845. var isArray = Array.isArray;
  27846. /**
  27847. * Checks if `value` is classified as a `Function` object.
  27848. *
  27849. * @static
  27850. * @memberOf _
  27851. * @since 0.1.0
  27852. * @category Lang
  27853. * @param {*} value The value to check.
  27854. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  27855. * @example
  27856. *
  27857. * _.isFunction(_);
  27858. * // => true
  27859. *
  27860. * _.isFunction(/abc/);
  27861. * // => false
  27862. */
  27863. function isFunction(value) {
  27864. // The use of `Object#toString` avoids issues with the `typeof` operator
  27865. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  27866. var tag = isObject(value) ? objectToString.call(value) : '';
  27867. return tag == funcTag || tag == genTag;
  27868. }
  27869. /**
  27870. * Checks if `value` is the
  27871. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  27872. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  27873. *
  27874. * @static
  27875. * @memberOf _
  27876. * @since 0.1.0
  27877. * @category Lang
  27878. * @param {*} value The value to check.
  27879. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  27880. * @example
  27881. *
  27882. * _.isObject({});
  27883. * // => true
  27884. *
  27885. * _.isObject([1, 2, 3]);
  27886. * // => true
  27887. *
  27888. * _.isObject(_.noop);
  27889. * // => true
  27890. *
  27891. * _.isObject(null);
  27892. * // => false
  27893. */
  27894. function isObject(value) {
  27895. var type = typeof value;
  27896. return !!value && (type == 'object' || type == 'function');
  27897. }
  27898. /**
  27899. * Checks if `value` is object-like. A value is object-like if it's not `null`
  27900. * and has a `typeof` result of "object".
  27901. *
  27902. * @static
  27903. * @memberOf _
  27904. * @since 4.0.0
  27905. * @category Lang
  27906. * @param {*} value The value to check.
  27907. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  27908. * @example
  27909. *
  27910. * _.isObjectLike({});
  27911. * // => true
  27912. *
  27913. * _.isObjectLike([1, 2, 3]);
  27914. * // => true
  27915. *
  27916. * _.isObjectLike(_.noop);
  27917. * // => false
  27918. *
  27919. * _.isObjectLike(null);
  27920. * // => false
  27921. */
  27922. function isObjectLike(value) {
  27923. return !!value && typeof value == 'object';
  27924. }
  27925. /**
  27926. * Checks if `value` is classified as a `Symbol` primitive or object.
  27927. *
  27928. * @static
  27929. * @memberOf _
  27930. * @since 4.0.0
  27931. * @category Lang
  27932. * @param {*} value The value to check.
  27933. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  27934. * @example
  27935. *
  27936. * _.isSymbol(Symbol.iterator);
  27937. * // => true
  27938. *
  27939. * _.isSymbol('abc');
  27940. * // => false
  27941. */
  27942. function isSymbol(value) {
  27943. return typeof value == 'symbol' ||
  27944. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  27945. }
  27946. /**
  27947. * Converts `value` to a string. An empty string is returned for `null`
  27948. * and `undefined` values. The sign of `-0` is preserved.
  27949. *
  27950. * @static
  27951. * @memberOf _
  27952. * @since 4.0.0
  27953. * @category Lang
  27954. * @param {*} value The value to process.
  27955. * @returns {string} Returns the string.
  27956. * @example
  27957. *
  27958. * _.toString(null);
  27959. * // => ''
  27960. *
  27961. * _.toString(-0);
  27962. * // => '-0'
  27963. *
  27964. * _.toString([1, 2, 3]);
  27965. * // => '1,2,3'
  27966. */
  27967. function toString(value) {
  27968. return value == null ? '' : baseToString(value);
  27969. }
  27970. /**
  27971. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  27972. * it's created. Arrays are created for missing index properties while objects
  27973. * are created for all other missing properties. Use `_.setWith` to customize
  27974. * `path` creation.
  27975. *
  27976. * **Note:** This method mutates `object`.
  27977. *
  27978. * @static
  27979. * @memberOf _
  27980. * @since 3.7.0
  27981. * @category Object
  27982. * @param {Object} object The object to modify.
  27983. * @param {Array|string} path The path of the property to set.
  27984. * @param {*} value The value to set.
  27985. * @returns {Object} Returns `object`.
  27986. * @example
  27987. *
  27988. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  27989. *
  27990. * _.set(object, 'a[0].b.c', 4);
  27991. * console.log(object.a[0].b.c);
  27992. * // => 4
  27993. *
  27994. * _.set(object, ['x', '0', 'y', 'z'], 5);
  27995. * console.log(object.x[0].y.z);
  27996. * // => 5
  27997. */
  27998. function set(object, path, value) {
  27999. return object == null ? object : baseSet(object, path, value);
  28000. }
  28001. module.exports = set;
  28002. /***/ }),
  28003. /***/ 898:
  28004. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28005. "use strict";
  28006. Object.defineProperty(exports, '__esModule', { value: true });
  28007. var request = __webpack_require__(753);
  28008. var universalUserAgent = __webpack_require__(796);
  28009. const VERSION = "4.3.1";
  28010. class GraphqlError extends Error {
  28011. constructor(request, response) {
  28012. const message = response.data.errors[0].message;
  28013. super(message);
  28014. Object.assign(this, response.data);
  28015. this.name = "GraphqlError";
  28016. this.request = request; // Maintains proper stack trace (only available on V8)
  28017. /* istanbul ignore next */
  28018. if (Error.captureStackTrace) {
  28019. Error.captureStackTrace(this, this.constructor);
  28020. }
  28021. }
  28022. }
  28023. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28024. function graphql(request, query, options) {
  28025. options = typeof query === "string" ? options = Object.assign({
  28026. query
  28027. }, options) : options = query;
  28028. const requestOptions = Object.keys(options).reduce((result, key) => {
  28029. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28030. result[key] = options[key];
  28031. return result;
  28032. }
  28033. if (!result.variables) {
  28034. result.variables = {};
  28035. }
  28036. result.variables[key] = options[key];
  28037. return result;
  28038. }, {});
  28039. return request(requestOptions).then(response => {
  28040. if (response.data.errors) {
  28041. throw new GraphqlError(requestOptions, {
  28042. data: response.data
  28043. });
  28044. }
  28045. return response.data.data;
  28046. });
  28047. }
  28048. function withDefaults(request$1, newDefaults) {
  28049. const newRequest = request$1.defaults(newDefaults);
  28050. const newApi = (query, options) => {
  28051. return graphql(newRequest, query, options);
  28052. };
  28053. return Object.assign(newApi, {
  28054. defaults: withDefaults.bind(null, newRequest),
  28055. endpoint: request.request.endpoint
  28056. });
  28057. }
  28058. const graphql$1 = withDefaults(request.request, {
  28059. headers: {
  28060. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28061. },
  28062. method: "POST",
  28063. url: "/graphql"
  28064. });
  28065. function withCustomRequest(customRequest) {
  28066. return withDefaults(customRequest, {
  28067. method: "POST",
  28068. url: "/graphql"
  28069. });
  28070. }
  28071. exports.graphql = graphql$1;
  28072. exports.withCustomRequest = withCustomRequest;
  28073. //# sourceMappingURL=index.js.map
  28074. /***/ }),
  28075. /***/ 916:
  28076. /***/ (function(__unusedmodule, exports) {
  28077. "use strict";
  28078. Object.defineProperty(exports, '__esModule', { value: true });
  28079. const VERSION = "1.0.0";
  28080. /**
  28081. * @param octokit Octokit instance
  28082. * @param options Options passed to Octokit constructor
  28083. */
  28084. function requestLog(octokit) {
  28085. octokit.hook.wrap("request", (request, options) => {
  28086. octokit.log.debug("request", options);
  28087. const start = Date.now();
  28088. const requestOptions = octokit.request.endpoint.parse(options);
  28089. const path = requestOptions.url.replace(options.baseUrl, "");
  28090. return request(options).then(response => {
  28091. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28092. return response;
  28093. }).catch(error => {
  28094. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28095. throw error;
  28096. });
  28097. });
  28098. }
  28099. requestLog.VERSION = VERSION;
  28100. exports.requestLog = requestLog;
  28101. //# sourceMappingURL=index.js.map
  28102. /***/ }),
  28103. /***/ 929:
  28104. /***/ (function(module, __unusedexports, __webpack_require__) {
  28105. module.exports = hasNextPage
  28106. const deprecate = __webpack_require__(370)
  28107. const getPageLinks = __webpack_require__(577)
  28108. function hasNextPage (link) {
  28109. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28110. return getPageLinks(link).next
  28111. }
  28112. /***/ }),
  28113. /***/ 948:
  28114. /***/ (function(module) {
  28115. "use strict";
  28116. /**
  28117. * Tries to execute a function and discards any error that occurs.
  28118. * @param {Function} fn - Function that might or might not throw an error.
  28119. * @returns {?*} Return-value of the function when no error occurred.
  28120. */
  28121. module.exports = function(fn) {
  28122. try { return fn() } catch (e) {}
  28123. }
  28124. /***/ }),
  28125. /***/ 950:
  28126. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28127. "use strict";
  28128. Object.defineProperty(exports, "__esModule", { value: true });
  28129. const url = __webpack_require__(835);
  28130. function getProxyUrl(reqUrl) {
  28131. let usingSsl = reqUrl.protocol === 'https:';
  28132. let proxyUrl;
  28133. if (checkBypass(reqUrl)) {
  28134. return proxyUrl;
  28135. }
  28136. let proxyVar;
  28137. if (usingSsl) {
  28138. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28139. }
  28140. else {
  28141. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28142. }
  28143. if (proxyVar) {
  28144. proxyUrl = url.parse(proxyVar);
  28145. }
  28146. return proxyUrl;
  28147. }
  28148. exports.getProxyUrl = getProxyUrl;
  28149. function checkBypass(reqUrl) {
  28150. if (!reqUrl.hostname) {
  28151. return false;
  28152. }
  28153. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28154. if (!noProxy) {
  28155. return false;
  28156. }
  28157. // Determine the request port
  28158. let reqPort;
  28159. if (reqUrl.port) {
  28160. reqPort = Number(reqUrl.port);
  28161. }
  28162. else if (reqUrl.protocol === 'http:') {
  28163. reqPort = 80;
  28164. }
  28165. else if (reqUrl.protocol === 'https:') {
  28166. reqPort = 443;
  28167. }
  28168. // Format the request hostname and hostname with port
  28169. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28170. if (typeof reqPort === 'number') {
  28171. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28172. }
  28173. // Compare request host against noproxy
  28174. for (let upperNoProxyItem of noProxy
  28175. .split(',')
  28176. .map(x => x.trim().toUpperCase())
  28177. .filter(x => x)) {
  28178. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28179. return true;
  28180. }
  28181. }
  28182. return false;
  28183. }
  28184. exports.checkBypass = checkBypass;
  28185. /***/ }),
  28186. /***/ 954:
  28187. /***/ (function(module) {
  28188. module.exports = validateAuth;
  28189. function validateAuth(auth) {
  28190. if (typeof auth === "string") {
  28191. return;
  28192. }
  28193. if (typeof auth === "function") {
  28194. return;
  28195. }
  28196. if (auth.username && auth.password) {
  28197. return;
  28198. }
  28199. if (auth.clientId && auth.clientSecret) {
  28200. return;
  28201. }
  28202. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28203. }
  28204. /***/ }),
  28205. /***/ 955:
  28206. /***/ (function(module, __unusedexports, __webpack_require__) {
  28207. "use strict";
  28208. const path = __webpack_require__(622);
  28209. const childProcess = __webpack_require__(129);
  28210. const crossSpawn = __webpack_require__(20);
  28211. const stripEof = __webpack_require__(768);
  28212. const npmRunPath = __webpack_require__(621);
  28213. const isStream = __webpack_require__(323);
  28214. const _getStream = __webpack_require__(145);
  28215. const pFinally = __webpack_require__(697);
  28216. const onExit = __webpack_require__(260);
  28217. const errname = __webpack_require__(427);
  28218. const stdio = __webpack_require__(168);
  28219. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28220. function handleArgs(cmd, args, opts) {
  28221. let parsed;
  28222. opts = Object.assign({
  28223. extendEnv: true,
  28224. env: {}
  28225. }, opts);
  28226. if (opts.extendEnv) {
  28227. opts.env = Object.assign({}, process.env, opts.env);
  28228. }
  28229. if (opts.__winShell === true) {
  28230. delete opts.__winShell;
  28231. parsed = {
  28232. command: cmd,
  28233. args,
  28234. options: opts,
  28235. file: cmd,
  28236. original: {
  28237. cmd,
  28238. args
  28239. }
  28240. };
  28241. } else {
  28242. parsed = crossSpawn._parse(cmd, args, opts);
  28243. }
  28244. opts = Object.assign({
  28245. maxBuffer: TEN_MEGABYTES,
  28246. buffer: true,
  28247. stripEof: true,
  28248. preferLocal: true,
  28249. localDir: parsed.options.cwd || process.cwd(),
  28250. encoding: 'utf8',
  28251. reject: true,
  28252. cleanup: true
  28253. }, parsed.options);
  28254. opts.stdio = stdio(opts);
  28255. if (opts.preferLocal) {
  28256. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28257. }
  28258. if (opts.detached) {
  28259. // #115
  28260. opts.cleanup = false;
  28261. }
  28262. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28263. // #116
  28264. parsed.args.unshift('/q');
  28265. }
  28266. return {
  28267. cmd: parsed.command,
  28268. args: parsed.args,
  28269. opts,
  28270. parsed
  28271. };
  28272. }
  28273. function handleInput(spawned, input) {
  28274. if (input === null || input === undefined) {
  28275. return;
  28276. }
  28277. if (isStream(input)) {
  28278. input.pipe(spawned.stdin);
  28279. } else {
  28280. spawned.stdin.end(input);
  28281. }
  28282. }
  28283. function handleOutput(opts, val) {
  28284. if (val && opts.stripEof) {
  28285. val = stripEof(val);
  28286. }
  28287. return val;
  28288. }
  28289. function handleShell(fn, cmd, opts) {
  28290. let file = '/bin/sh';
  28291. let args = ['-c', cmd];
  28292. opts = Object.assign({}, opts);
  28293. if (process.platform === 'win32') {
  28294. opts.__winShell = true;
  28295. file = process.env.comspec || 'cmd.exe';
  28296. args = ['/s', '/c', `"${cmd}"`];
  28297. opts.windowsVerbatimArguments = true;
  28298. }
  28299. if (opts.shell) {
  28300. file = opts.shell;
  28301. delete opts.shell;
  28302. }
  28303. return fn(file, args, opts);
  28304. }
  28305. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28306. if (!process[stream]) {
  28307. return null;
  28308. }
  28309. let ret;
  28310. if (!buffer) {
  28311. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28312. ret = new Promise((resolve, reject) => {
  28313. process[stream]
  28314. .once('end', resolve)
  28315. .once('error', reject);
  28316. });
  28317. } else if (encoding) {
  28318. ret = _getStream(process[stream], {
  28319. encoding,
  28320. maxBuffer
  28321. });
  28322. } else {
  28323. ret = _getStream.buffer(process[stream], {maxBuffer});
  28324. }
  28325. return ret.catch(err => {
  28326. err.stream = stream;
  28327. err.message = `${stream} ${err.message}`;
  28328. throw err;
  28329. });
  28330. }
  28331. function makeError(result, options) {
  28332. const {stdout, stderr} = result;
  28333. let err = result.error;
  28334. const {code, signal} = result;
  28335. const {parsed, joinedCmd} = options;
  28336. const timedOut = options.timedOut || false;
  28337. if (!err) {
  28338. let output = '';
  28339. if (Array.isArray(parsed.opts.stdio)) {
  28340. if (parsed.opts.stdio[2] !== 'inherit') {
  28341. output += output.length > 0 ? stderr : `\n${stderr}`;
  28342. }
  28343. if (parsed.opts.stdio[1] !== 'inherit') {
  28344. output += `\n${stdout}`;
  28345. }
  28346. } else if (parsed.opts.stdio !== 'inherit') {
  28347. output = `\n${stderr}${stdout}`;
  28348. }
  28349. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28350. err.code = code < 0 ? errname(code) : code;
  28351. }
  28352. err.stdout = stdout;
  28353. err.stderr = stderr;
  28354. err.failed = true;
  28355. err.signal = signal || null;
  28356. err.cmd = joinedCmd;
  28357. err.timedOut = timedOut;
  28358. return err;
  28359. }
  28360. function joinCmd(cmd, args) {
  28361. let joinedCmd = cmd;
  28362. if (Array.isArray(args) && args.length > 0) {
  28363. joinedCmd += ' ' + args.join(' ');
  28364. }
  28365. return joinedCmd;
  28366. }
  28367. module.exports = (cmd, args, opts) => {
  28368. const parsed = handleArgs(cmd, args, opts);
  28369. const {encoding, buffer, maxBuffer} = parsed.opts;
  28370. const joinedCmd = joinCmd(cmd, args);
  28371. let spawned;
  28372. try {
  28373. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28374. } catch (err) {
  28375. return Promise.reject(err);
  28376. }
  28377. let removeExitHandler;
  28378. if (parsed.opts.cleanup) {
  28379. removeExitHandler = onExit(() => {
  28380. spawned.kill();
  28381. });
  28382. }
  28383. let timeoutId = null;
  28384. let timedOut = false;
  28385. const cleanup = () => {
  28386. if (timeoutId) {
  28387. clearTimeout(timeoutId);
  28388. timeoutId = null;
  28389. }
  28390. if (removeExitHandler) {
  28391. removeExitHandler();
  28392. }
  28393. };
  28394. if (parsed.opts.timeout > 0) {
  28395. timeoutId = setTimeout(() => {
  28396. timeoutId = null;
  28397. timedOut = true;
  28398. spawned.kill(parsed.opts.killSignal);
  28399. }, parsed.opts.timeout);
  28400. }
  28401. const processDone = new Promise(resolve => {
  28402. spawned.on('exit', (code, signal) => {
  28403. cleanup();
  28404. resolve({code, signal});
  28405. });
  28406. spawned.on('error', err => {
  28407. cleanup();
  28408. resolve({error: err});
  28409. });
  28410. if (spawned.stdin) {
  28411. spawned.stdin.on('error', err => {
  28412. cleanup();
  28413. resolve({error: err});
  28414. });
  28415. }
  28416. });
  28417. function destroy() {
  28418. if (spawned.stdout) {
  28419. spawned.stdout.destroy();
  28420. }
  28421. if (spawned.stderr) {
  28422. spawned.stderr.destroy();
  28423. }
  28424. }
  28425. const handlePromise = () => pFinally(Promise.all([
  28426. processDone,
  28427. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28428. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28429. ]).then(arr => {
  28430. const result = arr[0];
  28431. result.stdout = arr[1];
  28432. result.stderr = arr[2];
  28433. if (result.error || result.code !== 0 || result.signal !== null) {
  28434. const err = makeError(result, {
  28435. joinedCmd,
  28436. parsed,
  28437. timedOut
  28438. });
  28439. // TODO: missing some timeout logic for killed
  28440. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28441. // err.killed = spawned.killed || killed;
  28442. err.killed = err.killed || spawned.killed;
  28443. if (!parsed.opts.reject) {
  28444. return err;
  28445. }
  28446. throw err;
  28447. }
  28448. return {
  28449. stdout: handleOutput(parsed.opts, result.stdout),
  28450. stderr: handleOutput(parsed.opts, result.stderr),
  28451. code: 0,
  28452. failed: false,
  28453. killed: false,
  28454. signal: null,
  28455. cmd: joinedCmd,
  28456. timedOut: false
  28457. };
  28458. }), destroy);
  28459. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28460. handleInput(spawned, parsed.opts.input);
  28461. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28462. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28463. return spawned;
  28464. };
  28465. // TODO: set `stderr: 'ignore'` when that option is implemented
  28466. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28467. // TODO: set `stdout: 'ignore'` when that option is implemented
  28468. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28469. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28470. module.exports.sync = (cmd, args, opts) => {
  28471. const parsed = handleArgs(cmd, args, opts);
  28472. const joinedCmd = joinCmd(cmd, args);
  28473. if (isStream(parsed.opts.input)) {
  28474. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28475. }
  28476. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28477. result.code = result.status;
  28478. if (result.error || result.status !== 0 || result.signal !== null) {
  28479. const err = makeError(result, {
  28480. joinedCmd,
  28481. parsed
  28482. });
  28483. if (!parsed.opts.reject) {
  28484. return err;
  28485. }
  28486. throw err;
  28487. }
  28488. return {
  28489. stdout: handleOutput(parsed.opts, result.stdout),
  28490. stderr: handleOutput(parsed.opts, result.stderr),
  28491. code: 0,
  28492. failed: false,
  28493. signal: null,
  28494. cmd: joinedCmd,
  28495. timedOut: false
  28496. };
  28497. };
  28498. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28499. /***/ }),
  28500. /***/ 966:
  28501. /***/ (function(module, __unusedexports, __webpack_require__) {
  28502. "use strict";
  28503. const {PassThrough} = __webpack_require__(413);
  28504. module.exports = options => {
  28505. options = Object.assign({}, options);
  28506. const {array} = options;
  28507. let {encoding} = options;
  28508. const buffer = encoding === 'buffer';
  28509. let objectMode = false;
  28510. if (array) {
  28511. objectMode = !(encoding || buffer);
  28512. } else {
  28513. encoding = encoding || 'utf8';
  28514. }
  28515. if (buffer) {
  28516. encoding = null;
  28517. }
  28518. let len = 0;
  28519. const ret = [];
  28520. const stream = new PassThrough({objectMode});
  28521. if (encoding) {
  28522. stream.setEncoding(encoding);
  28523. }
  28524. stream.on('data', chunk => {
  28525. ret.push(chunk);
  28526. if (objectMode) {
  28527. len = ret.length;
  28528. } else {
  28529. len += chunk.length;
  28530. }
  28531. });
  28532. stream.getBufferedValue = () => {
  28533. if (array) {
  28534. return ret;
  28535. }
  28536. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28537. };
  28538. stream.getBufferedLength = () => len;
  28539. return stream;
  28540. };
  28541. /***/ }),
  28542. /***/ 969:
  28543. /***/ (function(module, __unusedexports, __webpack_require__) {
  28544. var wrappy = __webpack_require__(11)
  28545. module.exports = wrappy(once)
  28546. module.exports.strict = wrappy(onceStrict)
  28547. once.proto = once(function () {
  28548. Object.defineProperty(Function.prototype, 'once', {
  28549. value: function () {
  28550. return once(this)
  28551. },
  28552. configurable: true
  28553. })
  28554. Object.defineProperty(Function.prototype, 'onceStrict', {
  28555. value: function () {
  28556. return onceStrict(this)
  28557. },
  28558. configurable: true
  28559. })
  28560. })
  28561. function once (fn) {
  28562. var f = function () {
  28563. if (f.called) return f.value
  28564. f.called = true
  28565. return f.value = fn.apply(this, arguments)
  28566. }
  28567. f.called = false
  28568. return f
  28569. }
  28570. function onceStrict (fn) {
  28571. var f = function () {
  28572. if (f.called)
  28573. throw new Error(f.onceError)
  28574. f.called = true
  28575. return f.value = fn.apply(this, arguments)
  28576. }
  28577. var name = fn.name || 'Function wrapped with `once`'
  28578. f.onceError = name + " shouldn't be called more than once"
  28579. f.called = false
  28580. return f
  28581. }
  28582. /***/ }),
  28583. /***/ 986:
  28584. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28585. "use strict";
  28586. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28587. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28588. return new (P || (P = Promise))(function (resolve, reject) {
  28589. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28590. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28591. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28592. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28593. });
  28594. };
  28595. Object.defineProperty(exports, "__esModule", { value: true });
  28596. const tr = __webpack_require__(9);
  28597. /**
  28598. * Exec a command.
  28599. * Output will be streamed to the live console.
  28600. * Returns promise with return code
  28601. *
  28602. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28603. * @param args optional arguments for tool. Escaping is handled by the lib.
  28604. * @param options optional exec options. See ExecOptions
  28605. * @returns Promise<number> exit code
  28606. */
  28607. function exec(commandLine, args, options) {
  28608. return __awaiter(this, void 0, void 0, function* () {
  28609. const commandArgs = tr.argStringToArray(commandLine);
  28610. if (commandArgs.length === 0) {
  28611. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28612. }
  28613. // Path to tool to execute should be first arg
  28614. const toolPath = commandArgs[0];
  28615. args = commandArgs.slice(1).concat(args || []);
  28616. const runner = new tr.ToolRunner(toolPath, args, options);
  28617. return runner.exec();
  28618. });
  28619. }
  28620. exports.exec = exec;
  28621. //# sourceMappingURL=exec.js.map
  28622. /***/ }),
  28623. /***/ 991:
  28624. /***/ (function(module, __unusedexports, __webpack_require__) {
  28625. module.exports = authenticationRequestError;
  28626. const { RequestError } = __webpack_require__(497);
  28627. function authenticationRequestError(state, error, options) {
  28628. if (!error.headers) throw error;
  28629. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28630. // handle "2FA required" error only
  28631. if (error.status !== 401 || !otpRequired) {
  28632. throw error;
  28633. }
  28634. if (
  28635. error.status === 401 &&
  28636. otpRequired &&
  28637. error.request &&
  28638. error.request.headers["x-github-otp"]
  28639. ) {
  28640. if (state.otp) {
  28641. delete state.otp; // no longer valid, request again
  28642. } else {
  28643. throw new RequestError(
  28644. "Invalid one-time password for two-factor authentication",
  28645. 401,
  28646. {
  28647. headers: error.headers,
  28648. request: options
  28649. }
  28650. );
  28651. }
  28652. }
  28653. if (typeof state.auth.on2fa !== "function") {
  28654. throw new RequestError(
  28655. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28656. 401,
  28657. {
  28658. headers: error.headers,
  28659. request: options
  28660. }
  28661. );
  28662. }
  28663. return Promise.resolve()
  28664. .then(() => {
  28665. return state.auth.on2fa();
  28666. })
  28667. .then(oneTimePassword => {
  28668. const newOptions = Object.assign(options, {
  28669. headers: Object.assign(options.headers, {
  28670. "x-github-otp": oneTimePassword
  28671. })
  28672. });
  28673. return state.octokit.request(newOptions).then(response => {
  28674. // If OTP still valid, then persist it for following requests
  28675. state.otp = oneTimePassword;
  28676. return response;
  28677. });
  28678. });
  28679. }
  28680. /***/ })
  28681. /******/ });