index.js 798 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026
  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. return new url_1.URL(process.env['GITHUB_URL'] || 'https://github.com');
  1272. }
  1273. exports.getServerUrl = getServerUrl;
  1274. /***/ }),
  1275. /***/ 87:
  1276. /***/ (function(module) {
  1277. module.exports = require("os");
  1278. /***/ }),
  1279. /***/ 118:
  1280. /***/ (function(module, __unusedexports, __webpack_require__) {
  1281. "use strict";
  1282. const os = __webpack_require__(87);
  1283. const nameMap = new Map([
  1284. [19, 'Catalina'],
  1285. [18, 'Mojave'],
  1286. [17, 'High Sierra'],
  1287. [16, 'Sierra'],
  1288. [15, 'El Capitan'],
  1289. [14, 'Yosemite'],
  1290. [13, 'Mavericks'],
  1291. [12, 'Mountain Lion'],
  1292. [11, 'Lion'],
  1293. [10, 'Snow Leopard'],
  1294. [9, 'Leopard'],
  1295. [8, 'Tiger'],
  1296. [7, 'Panther'],
  1297. [6, 'Jaguar'],
  1298. [5, 'Puma']
  1299. ]);
  1300. const macosRelease = release => {
  1301. release = Number((release || os.release()).split('.')[0]);
  1302. return {
  1303. name: nameMap.get(release),
  1304. version: '10.' + (release - 4)
  1305. };
  1306. };
  1307. module.exports = macosRelease;
  1308. // TODO: remove this in the next major version
  1309. module.exports.default = macosRelease;
  1310. /***/ }),
  1311. /***/ 126:
  1312. /***/ (function(module) {
  1313. /**
  1314. * lodash (Custom Build) <https://lodash.com/>
  1315. * Build: `lodash modularize exports="npm" -o ./`
  1316. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1317. * Released under MIT license <https://lodash.com/license>
  1318. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1319. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1320. */
  1321. /** Used as the size to enable large array optimizations. */
  1322. var LARGE_ARRAY_SIZE = 200;
  1323. /** Used to stand-in for `undefined` hash values. */
  1324. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1325. /** Used as references for various `Number` constants. */
  1326. var INFINITY = 1 / 0;
  1327. /** `Object#toString` result references. */
  1328. var funcTag = '[object Function]',
  1329. genTag = '[object GeneratorFunction]';
  1330. /**
  1331. * Used to match `RegExp`
  1332. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1333. */
  1334. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1335. /** Used to detect host constructors (Safari). */
  1336. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1337. /** Detect free variable `global` from Node.js. */
  1338. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1339. /** Detect free variable `self`. */
  1340. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1341. /** Used as a reference to the global object. */
  1342. var root = freeGlobal || freeSelf || Function('return this')();
  1343. /**
  1344. * A specialized version of `_.includes` for arrays without support for
  1345. * specifying an index to search from.
  1346. *
  1347. * @private
  1348. * @param {Array} [array] The array to inspect.
  1349. * @param {*} target The value to search for.
  1350. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1351. */
  1352. function arrayIncludes(array, value) {
  1353. var length = array ? array.length : 0;
  1354. return !!length && baseIndexOf(array, value, 0) > -1;
  1355. }
  1356. /**
  1357. * This function is like `arrayIncludes` except that it accepts a comparator.
  1358. *
  1359. * @private
  1360. * @param {Array} [array] The array to inspect.
  1361. * @param {*} target The value to search for.
  1362. * @param {Function} comparator The comparator invoked per element.
  1363. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1364. */
  1365. function arrayIncludesWith(array, value, comparator) {
  1366. var index = -1,
  1367. length = array ? array.length : 0;
  1368. while (++index < length) {
  1369. if (comparator(value, array[index])) {
  1370. return true;
  1371. }
  1372. }
  1373. return false;
  1374. }
  1375. /**
  1376. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1377. * support for iteratee shorthands.
  1378. *
  1379. * @private
  1380. * @param {Array} array The array to inspect.
  1381. * @param {Function} predicate The function invoked per iteration.
  1382. * @param {number} fromIndex The index to search from.
  1383. * @param {boolean} [fromRight] Specify iterating from right to left.
  1384. * @returns {number} Returns the index of the matched value, else `-1`.
  1385. */
  1386. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1387. var length = array.length,
  1388. index = fromIndex + (fromRight ? 1 : -1);
  1389. while ((fromRight ? index-- : ++index < length)) {
  1390. if (predicate(array[index], index, array)) {
  1391. return index;
  1392. }
  1393. }
  1394. return -1;
  1395. }
  1396. /**
  1397. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1398. *
  1399. * @private
  1400. * @param {Array} array The array to inspect.
  1401. * @param {*} value The value to search for.
  1402. * @param {number} fromIndex The index to search from.
  1403. * @returns {number} Returns the index of the matched value, else `-1`.
  1404. */
  1405. function baseIndexOf(array, value, fromIndex) {
  1406. if (value !== value) {
  1407. return baseFindIndex(array, baseIsNaN, fromIndex);
  1408. }
  1409. var index = fromIndex - 1,
  1410. length = array.length;
  1411. while (++index < length) {
  1412. if (array[index] === value) {
  1413. return index;
  1414. }
  1415. }
  1416. return -1;
  1417. }
  1418. /**
  1419. * The base implementation of `_.isNaN` without support for number objects.
  1420. *
  1421. * @private
  1422. * @param {*} value The value to check.
  1423. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1424. */
  1425. function baseIsNaN(value) {
  1426. return value !== value;
  1427. }
  1428. /**
  1429. * Checks if a cache value for `key` exists.
  1430. *
  1431. * @private
  1432. * @param {Object} cache The cache to query.
  1433. * @param {string} key The key of the entry to check.
  1434. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1435. */
  1436. function cacheHas(cache, key) {
  1437. return cache.has(key);
  1438. }
  1439. /**
  1440. * Gets the value at `key` of `object`.
  1441. *
  1442. * @private
  1443. * @param {Object} [object] The object to query.
  1444. * @param {string} key The key of the property to get.
  1445. * @returns {*} Returns the property value.
  1446. */
  1447. function getValue(object, key) {
  1448. return object == null ? undefined : object[key];
  1449. }
  1450. /**
  1451. * Checks if `value` is a host object in IE < 9.
  1452. *
  1453. * @private
  1454. * @param {*} value The value to check.
  1455. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1456. */
  1457. function isHostObject(value) {
  1458. // Many host objects are `Object` objects that can coerce to strings
  1459. // despite having improperly defined `toString` methods.
  1460. var result = false;
  1461. if (value != null && typeof value.toString != 'function') {
  1462. try {
  1463. result = !!(value + '');
  1464. } catch (e) {}
  1465. }
  1466. return result;
  1467. }
  1468. /**
  1469. * Converts `set` to an array of its values.
  1470. *
  1471. * @private
  1472. * @param {Object} set The set to convert.
  1473. * @returns {Array} Returns the values.
  1474. */
  1475. function setToArray(set) {
  1476. var index = -1,
  1477. result = Array(set.size);
  1478. set.forEach(function(value) {
  1479. result[++index] = value;
  1480. });
  1481. return result;
  1482. }
  1483. /** Used for built-in method references. */
  1484. var arrayProto = Array.prototype,
  1485. funcProto = Function.prototype,
  1486. objectProto = Object.prototype;
  1487. /** Used to detect overreaching core-js shims. */
  1488. var coreJsData = root['__core-js_shared__'];
  1489. /** Used to detect methods masquerading as native. */
  1490. var maskSrcKey = (function() {
  1491. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1492. return uid ? ('Symbol(src)_1.' + uid) : '';
  1493. }());
  1494. /** Used to resolve the decompiled source of functions. */
  1495. var funcToString = funcProto.toString;
  1496. /** Used to check objects for own properties. */
  1497. var hasOwnProperty = objectProto.hasOwnProperty;
  1498. /**
  1499. * Used to resolve the
  1500. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1501. * of values.
  1502. */
  1503. var objectToString = objectProto.toString;
  1504. /** Used to detect if a method is native. */
  1505. var reIsNative = RegExp('^' +
  1506. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1507. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1508. );
  1509. /** Built-in value references. */
  1510. var splice = arrayProto.splice;
  1511. /* Built-in method references that are verified to be native. */
  1512. var Map = getNative(root, 'Map'),
  1513. Set = getNative(root, 'Set'),
  1514. nativeCreate = getNative(Object, 'create');
  1515. /**
  1516. * Creates a hash object.
  1517. *
  1518. * @private
  1519. * @constructor
  1520. * @param {Array} [entries] The key-value pairs to cache.
  1521. */
  1522. function Hash(entries) {
  1523. var index = -1,
  1524. length = entries ? entries.length : 0;
  1525. this.clear();
  1526. while (++index < length) {
  1527. var entry = entries[index];
  1528. this.set(entry[0], entry[1]);
  1529. }
  1530. }
  1531. /**
  1532. * Removes all key-value entries from the hash.
  1533. *
  1534. * @private
  1535. * @name clear
  1536. * @memberOf Hash
  1537. */
  1538. function hashClear() {
  1539. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1540. }
  1541. /**
  1542. * Removes `key` and its value from the hash.
  1543. *
  1544. * @private
  1545. * @name delete
  1546. * @memberOf Hash
  1547. * @param {Object} hash The hash to modify.
  1548. * @param {string} key The key of the value to remove.
  1549. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1550. */
  1551. function hashDelete(key) {
  1552. return this.has(key) && delete this.__data__[key];
  1553. }
  1554. /**
  1555. * Gets the hash value for `key`.
  1556. *
  1557. * @private
  1558. * @name get
  1559. * @memberOf Hash
  1560. * @param {string} key The key of the value to get.
  1561. * @returns {*} Returns the entry value.
  1562. */
  1563. function hashGet(key) {
  1564. var data = this.__data__;
  1565. if (nativeCreate) {
  1566. var result = data[key];
  1567. return result === HASH_UNDEFINED ? undefined : result;
  1568. }
  1569. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1570. }
  1571. /**
  1572. * Checks if a hash value for `key` exists.
  1573. *
  1574. * @private
  1575. * @name has
  1576. * @memberOf Hash
  1577. * @param {string} key The key of the entry to check.
  1578. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1579. */
  1580. function hashHas(key) {
  1581. var data = this.__data__;
  1582. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1583. }
  1584. /**
  1585. * Sets the hash `key` to `value`.
  1586. *
  1587. * @private
  1588. * @name set
  1589. * @memberOf Hash
  1590. * @param {string} key The key of the value to set.
  1591. * @param {*} value The value to set.
  1592. * @returns {Object} Returns the hash instance.
  1593. */
  1594. function hashSet(key, value) {
  1595. var data = this.__data__;
  1596. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1597. return this;
  1598. }
  1599. // Add methods to `Hash`.
  1600. Hash.prototype.clear = hashClear;
  1601. Hash.prototype['delete'] = hashDelete;
  1602. Hash.prototype.get = hashGet;
  1603. Hash.prototype.has = hashHas;
  1604. Hash.prototype.set = hashSet;
  1605. /**
  1606. * Creates an list cache object.
  1607. *
  1608. * @private
  1609. * @constructor
  1610. * @param {Array} [entries] The key-value pairs to cache.
  1611. */
  1612. function ListCache(entries) {
  1613. var index = -1,
  1614. length = entries ? entries.length : 0;
  1615. this.clear();
  1616. while (++index < length) {
  1617. var entry = entries[index];
  1618. this.set(entry[0], entry[1]);
  1619. }
  1620. }
  1621. /**
  1622. * Removes all key-value entries from the list cache.
  1623. *
  1624. * @private
  1625. * @name clear
  1626. * @memberOf ListCache
  1627. */
  1628. function listCacheClear() {
  1629. this.__data__ = [];
  1630. }
  1631. /**
  1632. * Removes `key` and its value from the list cache.
  1633. *
  1634. * @private
  1635. * @name delete
  1636. * @memberOf ListCache
  1637. * @param {string} key The key of the value to remove.
  1638. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1639. */
  1640. function listCacheDelete(key) {
  1641. var data = this.__data__,
  1642. index = assocIndexOf(data, key);
  1643. if (index < 0) {
  1644. return false;
  1645. }
  1646. var lastIndex = data.length - 1;
  1647. if (index == lastIndex) {
  1648. data.pop();
  1649. } else {
  1650. splice.call(data, index, 1);
  1651. }
  1652. return true;
  1653. }
  1654. /**
  1655. * Gets the list cache value for `key`.
  1656. *
  1657. * @private
  1658. * @name get
  1659. * @memberOf ListCache
  1660. * @param {string} key The key of the value to get.
  1661. * @returns {*} Returns the entry value.
  1662. */
  1663. function listCacheGet(key) {
  1664. var data = this.__data__,
  1665. index = assocIndexOf(data, key);
  1666. return index < 0 ? undefined : data[index][1];
  1667. }
  1668. /**
  1669. * Checks if a list cache value for `key` exists.
  1670. *
  1671. * @private
  1672. * @name has
  1673. * @memberOf ListCache
  1674. * @param {string} key The key of the entry to check.
  1675. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1676. */
  1677. function listCacheHas(key) {
  1678. return assocIndexOf(this.__data__, key) > -1;
  1679. }
  1680. /**
  1681. * Sets the list cache `key` to `value`.
  1682. *
  1683. * @private
  1684. * @name set
  1685. * @memberOf ListCache
  1686. * @param {string} key The key of the value to set.
  1687. * @param {*} value The value to set.
  1688. * @returns {Object} Returns the list cache instance.
  1689. */
  1690. function listCacheSet(key, value) {
  1691. var data = this.__data__,
  1692. index = assocIndexOf(data, key);
  1693. if (index < 0) {
  1694. data.push([key, value]);
  1695. } else {
  1696. data[index][1] = value;
  1697. }
  1698. return this;
  1699. }
  1700. // Add methods to `ListCache`.
  1701. ListCache.prototype.clear = listCacheClear;
  1702. ListCache.prototype['delete'] = listCacheDelete;
  1703. ListCache.prototype.get = listCacheGet;
  1704. ListCache.prototype.has = listCacheHas;
  1705. ListCache.prototype.set = listCacheSet;
  1706. /**
  1707. * Creates a map cache object to store key-value pairs.
  1708. *
  1709. * @private
  1710. * @constructor
  1711. * @param {Array} [entries] The key-value pairs to cache.
  1712. */
  1713. function MapCache(entries) {
  1714. var index = -1,
  1715. length = entries ? entries.length : 0;
  1716. this.clear();
  1717. while (++index < length) {
  1718. var entry = entries[index];
  1719. this.set(entry[0], entry[1]);
  1720. }
  1721. }
  1722. /**
  1723. * Removes all key-value entries from the map.
  1724. *
  1725. * @private
  1726. * @name clear
  1727. * @memberOf MapCache
  1728. */
  1729. function mapCacheClear() {
  1730. this.__data__ = {
  1731. 'hash': new Hash,
  1732. 'map': new (Map || ListCache),
  1733. 'string': new Hash
  1734. };
  1735. }
  1736. /**
  1737. * Removes `key` and its value from the map.
  1738. *
  1739. * @private
  1740. * @name delete
  1741. * @memberOf MapCache
  1742. * @param {string} key The key of the value to remove.
  1743. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1744. */
  1745. function mapCacheDelete(key) {
  1746. return getMapData(this, key)['delete'](key);
  1747. }
  1748. /**
  1749. * Gets the map value for `key`.
  1750. *
  1751. * @private
  1752. * @name get
  1753. * @memberOf MapCache
  1754. * @param {string} key The key of the value to get.
  1755. * @returns {*} Returns the entry value.
  1756. */
  1757. function mapCacheGet(key) {
  1758. return getMapData(this, key).get(key);
  1759. }
  1760. /**
  1761. * Checks if a map value for `key` exists.
  1762. *
  1763. * @private
  1764. * @name has
  1765. * @memberOf MapCache
  1766. * @param {string} key The key of the entry to check.
  1767. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1768. */
  1769. function mapCacheHas(key) {
  1770. return getMapData(this, key).has(key);
  1771. }
  1772. /**
  1773. * Sets the map `key` to `value`.
  1774. *
  1775. * @private
  1776. * @name set
  1777. * @memberOf MapCache
  1778. * @param {string} key The key of the value to set.
  1779. * @param {*} value The value to set.
  1780. * @returns {Object} Returns the map cache instance.
  1781. */
  1782. function mapCacheSet(key, value) {
  1783. getMapData(this, key).set(key, value);
  1784. return this;
  1785. }
  1786. // Add methods to `MapCache`.
  1787. MapCache.prototype.clear = mapCacheClear;
  1788. MapCache.prototype['delete'] = mapCacheDelete;
  1789. MapCache.prototype.get = mapCacheGet;
  1790. MapCache.prototype.has = mapCacheHas;
  1791. MapCache.prototype.set = mapCacheSet;
  1792. /**
  1793. *
  1794. * Creates an array cache object to store unique values.
  1795. *
  1796. * @private
  1797. * @constructor
  1798. * @param {Array} [values] The values to cache.
  1799. */
  1800. function SetCache(values) {
  1801. var index = -1,
  1802. length = values ? values.length : 0;
  1803. this.__data__ = new MapCache;
  1804. while (++index < length) {
  1805. this.add(values[index]);
  1806. }
  1807. }
  1808. /**
  1809. * Adds `value` to the array cache.
  1810. *
  1811. * @private
  1812. * @name add
  1813. * @memberOf SetCache
  1814. * @alias push
  1815. * @param {*} value The value to cache.
  1816. * @returns {Object} Returns the cache instance.
  1817. */
  1818. function setCacheAdd(value) {
  1819. this.__data__.set(value, HASH_UNDEFINED);
  1820. return this;
  1821. }
  1822. /**
  1823. * Checks if `value` is in the array cache.
  1824. *
  1825. * @private
  1826. * @name has
  1827. * @memberOf SetCache
  1828. * @param {*} value The value to search for.
  1829. * @returns {number} Returns `true` if `value` is found, else `false`.
  1830. */
  1831. function setCacheHas(value) {
  1832. return this.__data__.has(value);
  1833. }
  1834. // Add methods to `SetCache`.
  1835. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1836. SetCache.prototype.has = setCacheHas;
  1837. /**
  1838. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1839. *
  1840. * @private
  1841. * @param {Array} array The array to inspect.
  1842. * @param {*} key The key to search for.
  1843. * @returns {number} Returns the index of the matched value, else `-1`.
  1844. */
  1845. function assocIndexOf(array, key) {
  1846. var length = array.length;
  1847. while (length--) {
  1848. if (eq(array[length][0], key)) {
  1849. return length;
  1850. }
  1851. }
  1852. return -1;
  1853. }
  1854. /**
  1855. * The base implementation of `_.isNative` without bad shim checks.
  1856. *
  1857. * @private
  1858. * @param {*} value The value to check.
  1859. * @returns {boolean} Returns `true` if `value` is a native function,
  1860. * else `false`.
  1861. */
  1862. function baseIsNative(value) {
  1863. if (!isObject(value) || isMasked(value)) {
  1864. return false;
  1865. }
  1866. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1867. return pattern.test(toSource(value));
  1868. }
  1869. /**
  1870. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1871. *
  1872. * @private
  1873. * @param {Array} array The array to inspect.
  1874. * @param {Function} [iteratee] The iteratee invoked per element.
  1875. * @param {Function} [comparator] The comparator invoked per element.
  1876. * @returns {Array} Returns the new duplicate free array.
  1877. */
  1878. function baseUniq(array, iteratee, comparator) {
  1879. var index = -1,
  1880. includes = arrayIncludes,
  1881. length = array.length,
  1882. isCommon = true,
  1883. result = [],
  1884. seen = result;
  1885. if (comparator) {
  1886. isCommon = false;
  1887. includes = arrayIncludesWith;
  1888. }
  1889. else if (length >= LARGE_ARRAY_SIZE) {
  1890. var set = iteratee ? null : createSet(array);
  1891. if (set) {
  1892. return setToArray(set);
  1893. }
  1894. isCommon = false;
  1895. includes = cacheHas;
  1896. seen = new SetCache;
  1897. }
  1898. else {
  1899. seen = iteratee ? [] : result;
  1900. }
  1901. outer:
  1902. while (++index < length) {
  1903. var value = array[index],
  1904. computed = iteratee ? iteratee(value) : value;
  1905. value = (comparator || value !== 0) ? value : 0;
  1906. if (isCommon && computed === computed) {
  1907. var seenIndex = seen.length;
  1908. while (seenIndex--) {
  1909. if (seen[seenIndex] === computed) {
  1910. continue outer;
  1911. }
  1912. }
  1913. if (iteratee) {
  1914. seen.push(computed);
  1915. }
  1916. result.push(value);
  1917. }
  1918. else if (!includes(seen, computed, comparator)) {
  1919. if (seen !== result) {
  1920. seen.push(computed);
  1921. }
  1922. result.push(value);
  1923. }
  1924. }
  1925. return result;
  1926. }
  1927. /**
  1928. * Creates a set object of `values`.
  1929. *
  1930. * @private
  1931. * @param {Array} values The values to add to the set.
  1932. * @returns {Object} Returns the new set.
  1933. */
  1934. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1935. return new Set(values);
  1936. };
  1937. /**
  1938. * Gets the data for `map`.
  1939. *
  1940. * @private
  1941. * @param {Object} map The map to query.
  1942. * @param {string} key The reference key.
  1943. * @returns {*} Returns the map data.
  1944. */
  1945. function getMapData(map, key) {
  1946. var data = map.__data__;
  1947. return isKeyable(key)
  1948. ? data[typeof key == 'string' ? 'string' : 'hash']
  1949. : data.map;
  1950. }
  1951. /**
  1952. * Gets the native function at `key` of `object`.
  1953. *
  1954. * @private
  1955. * @param {Object} object The object to query.
  1956. * @param {string} key The key of the method to get.
  1957. * @returns {*} Returns the function if it's native, else `undefined`.
  1958. */
  1959. function getNative(object, key) {
  1960. var value = getValue(object, key);
  1961. return baseIsNative(value) ? value : undefined;
  1962. }
  1963. /**
  1964. * Checks if `value` is suitable for use as unique object key.
  1965. *
  1966. * @private
  1967. * @param {*} value The value to check.
  1968. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1969. */
  1970. function isKeyable(value) {
  1971. var type = typeof value;
  1972. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1973. ? (value !== '__proto__')
  1974. : (value === null);
  1975. }
  1976. /**
  1977. * Checks if `func` has its source masked.
  1978. *
  1979. * @private
  1980. * @param {Function} func The function to check.
  1981. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1982. */
  1983. function isMasked(func) {
  1984. return !!maskSrcKey && (maskSrcKey in func);
  1985. }
  1986. /**
  1987. * Converts `func` to its source code.
  1988. *
  1989. * @private
  1990. * @param {Function} func The function to process.
  1991. * @returns {string} Returns the source code.
  1992. */
  1993. function toSource(func) {
  1994. if (func != null) {
  1995. try {
  1996. return funcToString.call(func);
  1997. } catch (e) {}
  1998. try {
  1999. return (func + '');
  2000. } catch (e) {}
  2001. }
  2002. return '';
  2003. }
  2004. /**
  2005. * Creates a duplicate-free version of an array, using
  2006. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2007. * for equality comparisons, in which only the first occurrence of each
  2008. * element is kept.
  2009. *
  2010. * @static
  2011. * @memberOf _
  2012. * @since 0.1.0
  2013. * @category Array
  2014. * @param {Array} array The array to inspect.
  2015. * @returns {Array} Returns the new duplicate free array.
  2016. * @example
  2017. *
  2018. * _.uniq([2, 1, 2]);
  2019. * // => [2, 1]
  2020. */
  2021. function uniq(array) {
  2022. return (array && array.length)
  2023. ? baseUniq(array)
  2024. : [];
  2025. }
  2026. /**
  2027. * Performs a
  2028. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2029. * comparison between two values to determine if they are equivalent.
  2030. *
  2031. * @static
  2032. * @memberOf _
  2033. * @since 4.0.0
  2034. * @category Lang
  2035. * @param {*} value The value to compare.
  2036. * @param {*} other The other value to compare.
  2037. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2038. * @example
  2039. *
  2040. * var object = { 'a': 1 };
  2041. * var other = { 'a': 1 };
  2042. *
  2043. * _.eq(object, object);
  2044. * // => true
  2045. *
  2046. * _.eq(object, other);
  2047. * // => false
  2048. *
  2049. * _.eq('a', 'a');
  2050. * // => true
  2051. *
  2052. * _.eq('a', Object('a'));
  2053. * // => false
  2054. *
  2055. * _.eq(NaN, NaN);
  2056. * // => true
  2057. */
  2058. function eq(value, other) {
  2059. return value === other || (value !== value && other !== other);
  2060. }
  2061. /**
  2062. * Checks if `value` is classified as a `Function` object.
  2063. *
  2064. * @static
  2065. * @memberOf _
  2066. * @since 0.1.0
  2067. * @category Lang
  2068. * @param {*} value The value to check.
  2069. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2070. * @example
  2071. *
  2072. * _.isFunction(_);
  2073. * // => true
  2074. *
  2075. * _.isFunction(/abc/);
  2076. * // => false
  2077. */
  2078. function isFunction(value) {
  2079. // The use of `Object#toString` avoids issues with the `typeof` operator
  2080. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2081. var tag = isObject(value) ? objectToString.call(value) : '';
  2082. return tag == funcTag || tag == genTag;
  2083. }
  2084. /**
  2085. * Checks if `value` is the
  2086. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2087. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2088. *
  2089. * @static
  2090. * @memberOf _
  2091. * @since 0.1.0
  2092. * @category Lang
  2093. * @param {*} value The value to check.
  2094. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2095. * @example
  2096. *
  2097. * _.isObject({});
  2098. * // => true
  2099. *
  2100. * _.isObject([1, 2, 3]);
  2101. * // => true
  2102. *
  2103. * _.isObject(_.noop);
  2104. * // => true
  2105. *
  2106. * _.isObject(null);
  2107. * // => false
  2108. */
  2109. function isObject(value) {
  2110. var type = typeof value;
  2111. return !!value && (type == 'object' || type == 'function');
  2112. }
  2113. /**
  2114. * This method returns `undefined`.
  2115. *
  2116. * @static
  2117. * @memberOf _
  2118. * @since 2.3.0
  2119. * @category Util
  2120. * @example
  2121. *
  2122. * _.times(2, _.noop);
  2123. * // => [undefined, undefined]
  2124. */
  2125. function noop() {
  2126. // No operation performed.
  2127. }
  2128. module.exports = uniq;
  2129. /***/ }),
  2130. /***/ 129:
  2131. /***/ (function(module) {
  2132. module.exports = require("child_process");
  2133. /***/ }),
  2134. /***/ 139:
  2135. /***/ (function(module, __unusedexports, __webpack_require__) {
  2136. // Unique ID creation requires a high quality random # generator. In node.js
  2137. // this is pretty straight-forward - we use the crypto API.
  2138. var crypto = __webpack_require__(417);
  2139. module.exports = function nodeRNG() {
  2140. return crypto.randomBytes(16);
  2141. };
  2142. /***/ }),
  2143. /***/ 141:
  2144. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2145. "use strict";
  2146. var net = __webpack_require__(631);
  2147. var tls = __webpack_require__(16);
  2148. var http = __webpack_require__(605);
  2149. var https = __webpack_require__(34);
  2150. var events = __webpack_require__(614);
  2151. var assert = __webpack_require__(357);
  2152. var util = __webpack_require__(669);
  2153. exports.httpOverHttp = httpOverHttp;
  2154. exports.httpsOverHttp = httpsOverHttp;
  2155. exports.httpOverHttps = httpOverHttps;
  2156. exports.httpsOverHttps = httpsOverHttps;
  2157. function httpOverHttp(options) {
  2158. var agent = new TunnelingAgent(options);
  2159. agent.request = http.request;
  2160. return agent;
  2161. }
  2162. function httpsOverHttp(options) {
  2163. var agent = new TunnelingAgent(options);
  2164. agent.request = http.request;
  2165. agent.createSocket = createSecureSocket;
  2166. return agent;
  2167. }
  2168. function httpOverHttps(options) {
  2169. var agent = new TunnelingAgent(options);
  2170. agent.request = https.request;
  2171. return agent;
  2172. }
  2173. function httpsOverHttps(options) {
  2174. var agent = new TunnelingAgent(options);
  2175. agent.request = https.request;
  2176. agent.createSocket = createSecureSocket;
  2177. return agent;
  2178. }
  2179. function TunnelingAgent(options) {
  2180. var self = this;
  2181. self.options = options || {};
  2182. self.proxyOptions = self.options.proxy || {};
  2183. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2184. self.requests = [];
  2185. self.sockets = [];
  2186. self.on('free', function onFree(socket, host, port, localAddress) {
  2187. var options = toOptions(host, port, localAddress);
  2188. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2189. var pending = self.requests[i];
  2190. if (pending.host === options.host && pending.port === options.port) {
  2191. // Detect the request to connect same origin server,
  2192. // reuse the connection.
  2193. self.requests.splice(i, 1);
  2194. pending.request.onSocket(socket);
  2195. return;
  2196. }
  2197. }
  2198. socket.destroy();
  2199. self.removeSocket(socket);
  2200. });
  2201. }
  2202. util.inherits(TunnelingAgent, events.EventEmitter);
  2203. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2204. var self = this;
  2205. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2206. if (self.sockets.length >= this.maxSockets) {
  2207. // We are over limit so we'll add it to the queue.
  2208. self.requests.push(options);
  2209. return;
  2210. }
  2211. // If we are under maxSockets create a new one.
  2212. self.createSocket(options, function(socket) {
  2213. socket.on('free', onFree);
  2214. socket.on('close', onCloseOrRemove);
  2215. socket.on('agentRemove', onCloseOrRemove);
  2216. req.onSocket(socket);
  2217. function onFree() {
  2218. self.emit('free', socket, options);
  2219. }
  2220. function onCloseOrRemove(err) {
  2221. self.removeSocket(socket);
  2222. socket.removeListener('free', onFree);
  2223. socket.removeListener('close', onCloseOrRemove);
  2224. socket.removeListener('agentRemove', onCloseOrRemove);
  2225. }
  2226. });
  2227. };
  2228. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2229. var self = this;
  2230. var placeholder = {};
  2231. self.sockets.push(placeholder);
  2232. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2233. method: 'CONNECT',
  2234. path: options.host + ':' + options.port,
  2235. agent: false
  2236. });
  2237. if (connectOptions.proxyAuth) {
  2238. connectOptions.headers = connectOptions.headers || {};
  2239. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2240. new Buffer(connectOptions.proxyAuth).toString('base64');
  2241. }
  2242. debug('making CONNECT request');
  2243. var connectReq = self.request(connectOptions);
  2244. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2245. connectReq.once('response', onResponse); // for v0.6
  2246. connectReq.once('upgrade', onUpgrade); // for v0.6
  2247. connectReq.once('connect', onConnect); // for v0.7 or later
  2248. connectReq.once('error', onError);
  2249. connectReq.end();
  2250. function onResponse(res) {
  2251. // Very hacky. This is necessary to avoid http-parser leaks.
  2252. res.upgrade = true;
  2253. }
  2254. function onUpgrade(res, socket, head) {
  2255. // Hacky.
  2256. process.nextTick(function() {
  2257. onConnect(res, socket, head);
  2258. });
  2259. }
  2260. function onConnect(res, socket, head) {
  2261. connectReq.removeAllListeners();
  2262. socket.removeAllListeners();
  2263. if (res.statusCode === 200) {
  2264. assert.equal(head.length, 0);
  2265. debug('tunneling connection has established');
  2266. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2267. cb(socket);
  2268. } else {
  2269. debug('tunneling socket could not be established, statusCode=%d',
  2270. res.statusCode);
  2271. var error = new Error('tunneling socket could not be established, ' +
  2272. 'statusCode=' + res.statusCode);
  2273. error.code = 'ECONNRESET';
  2274. options.request.emit('error', error);
  2275. self.removeSocket(placeholder);
  2276. }
  2277. }
  2278. function onError(cause) {
  2279. connectReq.removeAllListeners();
  2280. debug('tunneling socket could not be established, cause=%s\n',
  2281. cause.message, cause.stack);
  2282. var error = new Error('tunneling socket could not be established, ' +
  2283. 'cause=' + cause.message);
  2284. error.code = 'ECONNRESET';
  2285. options.request.emit('error', error);
  2286. self.removeSocket(placeholder);
  2287. }
  2288. };
  2289. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2290. var pos = this.sockets.indexOf(socket)
  2291. if (pos === -1) {
  2292. return;
  2293. }
  2294. this.sockets.splice(pos, 1);
  2295. var pending = this.requests.shift();
  2296. if (pending) {
  2297. // If we have pending requests and a socket gets closed a new one
  2298. // needs to be created to take over in the pool for the one that closed.
  2299. this.createSocket(pending, function(socket) {
  2300. pending.request.onSocket(socket);
  2301. });
  2302. }
  2303. };
  2304. function createSecureSocket(options, cb) {
  2305. var self = this;
  2306. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2307. var hostHeader = options.request.getHeader('host');
  2308. var tlsOptions = mergeOptions({}, self.options, {
  2309. socket: socket,
  2310. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2311. });
  2312. // 0 is dummy port for v0.6
  2313. var secureSocket = tls.connect(0, tlsOptions);
  2314. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2315. cb(secureSocket);
  2316. });
  2317. }
  2318. function toOptions(host, port, localAddress) {
  2319. if (typeof host === 'string') { // since v0.10
  2320. return {
  2321. host: host,
  2322. port: port,
  2323. localAddress: localAddress
  2324. };
  2325. }
  2326. return host; // for v0.11 or later
  2327. }
  2328. function mergeOptions(target) {
  2329. for (var i = 1, len = arguments.length; i < len; ++i) {
  2330. var overrides = arguments[i];
  2331. if (typeof overrides === 'object') {
  2332. var keys = Object.keys(overrides);
  2333. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2334. var k = keys[j];
  2335. if (overrides[k] !== undefined) {
  2336. target[k] = overrides[k];
  2337. }
  2338. }
  2339. }
  2340. }
  2341. return target;
  2342. }
  2343. var debug;
  2344. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2345. debug = function() {
  2346. var args = Array.prototype.slice.call(arguments);
  2347. if (typeof args[0] === 'string') {
  2348. args[0] = 'TUNNEL: ' + args[0];
  2349. } else {
  2350. args.unshift('TUNNEL:');
  2351. }
  2352. console.error.apply(console, args);
  2353. }
  2354. } else {
  2355. debug = function() {};
  2356. }
  2357. exports.debug = debug; // for test
  2358. /***/ }),
  2359. /***/ 143:
  2360. /***/ (function(module, __unusedexports, __webpack_require__) {
  2361. module.exports = withAuthorizationPrefix;
  2362. const atob = __webpack_require__(368);
  2363. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2364. function withAuthorizationPrefix(authorization) {
  2365. if (/^(basic|bearer|token) /i.test(authorization)) {
  2366. return authorization;
  2367. }
  2368. try {
  2369. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2370. return `basic ${authorization}`;
  2371. }
  2372. } catch (error) {}
  2373. if (authorization.split(/\./).length === 3) {
  2374. return `bearer ${authorization}`;
  2375. }
  2376. return `token ${authorization}`;
  2377. }
  2378. /***/ }),
  2379. /***/ 145:
  2380. /***/ (function(module, __unusedexports, __webpack_require__) {
  2381. "use strict";
  2382. const pump = __webpack_require__(453);
  2383. const bufferStream = __webpack_require__(966);
  2384. class MaxBufferError extends Error {
  2385. constructor() {
  2386. super('maxBuffer exceeded');
  2387. this.name = 'MaxBufferError';
  2388. }
  2389. }
  2390. function getStream(inputStream, options) {
  2391. if (!inputStream) {
  2392. return Promise.reject(new Error('Expected a stream'));
  2393. }
  2394. options = Object.assign({maxBuffer: Infinity}, options);
  2395. const {maxBuffer} = options;
  2396. let stream;
  2397. return new Promise((resolve, reject) => {
  2398. const rejectPromise = error => {
  2399. if (error) { // A null check
  2400. error.bufferedData = stream.getBufferedValue();
  2401. }
  2402. reject(error);
  2403. };
  2404. stream = pump(inputStream, bufferStream(options), error => {
  2405. if (error) {
  2406. rejectPromise(error);
  2407. return;
  2408. }
  2409. resolve();
  2410. });
  2411. stream.on('data', () => {
  2412. if (stream.getBufferedLength() > maxBuffer) {
  2413. rejectPromise(new MaxBufferError());
  2414. }
  2415. });
  2416. }).then(() => stream.getBufferedValue());
  2417. }
  2418. module.exports = getStream;
  2419. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2420. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2421. module.exports.MaxBufferError = MaxBufferError;
  2422. /***/ }),
  2423. /***/ 148:
  2424. /***/ (function(module, __unusedexports, __webpack_require__) {
  2425. module.exports = paginatePlugin;
  2426. const { paginateRest } = __webpack_require__(299);
  2427. function paginatePlugin(octokit) {
  2428. Object.assign(octokit, paginateRest(octokit));
  2429. }
  2430. /***/ }),
  2431. /***/ 153:
  2432. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2433. "use strict";
  2434. var __importStar = (this && this.__importStar) || function (mod) {
  2435. if (mod && mod.__esModule) return mod;
  2436. var result = {};
  2437. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2438. result["default"] = mod;
  2439. return result;
  2440. };
  2441. Object.defineProperty(exports, "__esModule", { value: true });
  2442. const coreCommand = __importStar(__webpack_require__(431));
  2443. /**
  2444. * Indicates whether the POST action is running
  2445. */
  2446. exports.IsPost = !!process.env['STATE_isPost'];
  2447. /**
  2448. * The repository path for the POST action. The value is empty during the MAIN action.
  2449. */
  2450. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2451. /**
  2452. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2453. */
  2454. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2455. /**
  2456. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2457. */
  2458. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2459. /**
  2460. * Save the repository path so the POST action can retrieve the value.
  2461. */
  2462. function setRepositoryPath(repositoryPath) {
  2463. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2464. }
  2465. exports.setRepositoryPath = setRepositoryPath;
  2466. /**
  2467. * Save the SSH key path so the POST action can retrieve the value.
  2468. */
  2469. function setSshKeyPath(sshKeyPath) {
  2470. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2471. }
  2472. exports.setSshKeyPath = setSshKeyPath;
  2473. /**
  2474. * Save the SSH known hosts path so the POST action can retrieve the value.
  2475. */
  2476. function setSshKnownHostsPath(sshKnownHostsPath) {
  2477. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2478. }
  2479. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2480. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2481. // This is necessary since we don't have a separate entry point.
  2482. if (!exports.IsPost) {
  2483. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2484. }
  2485. /***/ }),
  2486. /***/ 168:
  2487. /***/ (function(module) {
  2488. "use strict";
  2489. const alias = ['stdin', 'stdout', 'stderr'];
  2490. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2491. module.exports = opts => {
  2492. if (!opts) {
  2493. return null;
  2494. }
  2495. if (opts.stdio && hasAlias(opts)) {
  2496. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2497. }
  2498. if (typeof opts.stdio === 'string') {
  2499. return opts.stdio;
  2500. }
  2501. const stdio = opts.stdio || [];
  2502. if (!Array.isArray(stdio)) {
  2503. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2504. }
  2505. const result = [];
  2506. const len = Math.max(stdio.length, alias.length);
  2507. for (let i = 0; i < len; i++) {
  2508. let value = null;
  2509. if (stdio[i] !== undefined) {
  2510. value = stdio[i];
  2511. } else if (opts[alias[i]] !== undefined) {
  2512. value = opts[alias[i]];
  2513. }
  2514. result[i] = value;
  2515. }
  2516. return result;
  2517. };
  2518. /***/ }),
  2519. /***/ 179:
  2520. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2521. "use strict";
  2522. var net = __webpack_require__(631);
  2523. var tls = __webpack_require__(16);
  2524. var http = __webpack_require__(605);
  2525. var https = __webpack_require__(34);
  2526. var events = __webpack_require__(614);
  2527. var assert = __webpack_require__(357);
  2528. var util = __webpack_require__(669);
  2529. exports.httpOverHttp = httpOverHttp;
  2530. exports.httpsOverHttp = httpsOverHttp;
  2531. exports.httpOverHttps = httpOverHttps;
  2532. exports.httpsOverHttps = httpsOverHttps;
  2533. function httpOverHttp(options) {
  2534. var agent = new TunnelingAgent(options);
  2535. agent.request = http.request;
  2536. return agent;
  2537. }
  2538. function httpsOverHttp(options) {
  2539. var agent = new TunnelingAgent(options);
  2540. agent.request = http.request;
  2541. agent.createSocket = createSecureSocket;
  2542. agent.defaultPort = 443;
  2543. return agent;
  2544. }
  2545. function httpOverHttps(options) {
  2546. var agent = new TunnelingAgent(options);
  2547. agent.request = https.request;
  2548. return agent;
  2549. }
  2550. function httpsOverHttps(options) {
  2551. var agent = new TunnelingAgent(options);
  2552. agent.request = https.request;
  2553. agent.createSocket = createSecureSocket;
  2554. agent.defaultPort = 443;
  2555. return agent;
  2556. }
  2557. function TunnelingAgent(options) {
  2558. var self = this;
  2559. self.options = options || {};
  2560. self.proxyOptions = self.options.proxy || {};
  2561. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2562. self.requests = [];
  2563. self.sockets = [];
  2564. self.on('free', function onFree(socket, host, port, localAddress) {
  2565. var options = toOptions(host, port, localAddress);
  2566. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2567. var pending = self.requests[i];
  2568. if (pending.host === options.host && pending.port === options.port) {
  2569. // Detect the request to connect same origin server,
  2570. // reuse the connection.
  2571. self.requests.splice(i, 1);
  2572. pending.request.onSocket(socket);
  2573. return;
  2574. }
  2575. }
  2576. socket.destroy();
  2577. self.removeSocket(socket);
  2578. });
  2579. }
  2580. util.inherits(TunnelingAgent, events.EventEmitter);
  2581. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2582. var self = this;
  2583. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2584. if (self.sockets.length >= this.maxSockets) {
  2585. // We are over limit so we'll add it to the queue.
  2586. self.requests.push(options);
  2587. return;
  2588. }
  2589. // If we are under maxSockets create a new one.
  2590. self.createSocket(options, function(socket) {
  2591. socket.on('free', onFree);
  2592. socket.on('close', onCloseOrRemove);
  2593. socket.on('agentRemove', onCloseOrRemove);
  2594. req.onSocket(socket);
  2595. function onFree() {
  2596. self.emit('free', socket, options);
  2597. }
  2598. function onCloseOrRemove(err) {
  2599. self.removeSocket(socket);
  2600. socket.removeListener('free', onFree);
  2601. socket.removeListener('close', onCloseOrRemove);
  2602. socket.removeListener('agentRemove', onCloseOrRemove);
  2603. }
  2604. });
  2605. };
  2606. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2607. var self = this;
  2608. var placeholder = {};
  2609. self.sockets.push(placeholder);
  2610. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2611. method: 'CONNECT',
  2612. path: options.host + ':' + options.port,
  2613. agent: false,
  2614. headers: {
  2615. host: options.host + ':' + options.port
  2616. }
  2617. });
  2618. if (options.localAddress) {
  2619. connectOptions.localAddress = options.localAddress;
  2620. }
  2621. if (connectOptions.proxyAuth) {
  2622. connectOptions.headers = connectOptions.headers || {};
  2623. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2624. new Buffer(connectOptions.proxyAuth).toString('base64');
  2625. }
  2626. debug('making CONNECT request');
  2627. var connectReq = self.request(connectOptions);
  2628. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2629. connectReq.once('response', onResponse); // for v0.6
  2630. connectReq.once('upgrade', onUpgrade); // for v0.6
  2631. connectReq.once('connect', onConnect); // for v0.7 or later
  2632. connectReq.once('error', onError);
  2633. connectReq.end();
  2634. function onResponse(res) {
  2635. // Very hacky. This is necessary to avoid http-parser leaks.
  2636. res.upgrade = true;
  2637. }
  2638. function onUpgrade(res, socket, head) {
  2639. // Hacky.
  2640. process.nextTick(function() {
  2641. onConnect(res, socket, head);
  2642. });
  2643. }
  2644. function onConnect(res, socket, head) {
  2645. connectReq.removeAllListeners();
  2646. socket.removeAllListeners();
  2647. if (res.statusCode !== 200) {
  2648. debug('tunneling socket could not be established, statusCode=%d',
  2649. res.statusCode);
  2650. socket.destroy();
  2651. var error = new Error('tunneling socket could not be established, ' +
  2652. 'statusCode=' + res.statusCode);
  2653. error.code = 'ECONNRESET';
  2654. options.request.emit('error', error);
  2655. self.removeSocket(placeholder);
  2656. return;
  2657. }
  2658. if (head.length > 0) {
  2659. debug('got illegal response body from proxy');
  2660. socket.destroy();
  2661. var error = new Error('got illegal response body from proxy');
  2662. error.code = 'ECONNRESET';
  2663. options.request.emit('error', error);
  2664. self.removeSocket(placeholder);
  2665. return;
  2666. }
  2667. debug('tunneling connection has established');
  2668. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2669. return cb(socket);
  2670. }
  2671. function onError(cause) {
  2672. connectReq.removeAllListeners();
  2673. debug('tunneling socket could not be established, cause=%s\n',
  2674. cause.message, cause.stack);
  2675. var error = new Error('tunneling socket could not be established, ' +
  2676. 'cause=' + cause.message);
  2677. error.code = 'ECONNRESET';
  2678. options.request.emit('error', error);
  2679. self.removeSocket(placeholder);
  2680. }
  2681. };
  2682. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2683. var pos = this.sockets.indexOf(socket)
  2684. if (pos === -1) {
  2685. return;
  2686. }
  2687. this.sockets.splice(pos, 1);
  2688. var pending = this.requests.shift();
  2689. if (pending) {
  2690. // If we have pending requests and a socket gets closed a new one
  2691. // needs to be created to take over in the pool for the one that closed.
  2692. this.createSocket(pending, function(socket) {
  2693. pending.request.onSocket(socket);
  2694. });
  2695. }
  2696. };
  2697. function createSecureSocket(options, cb) {
  2698. var self = this;
  2699. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2700. var hostHeader = options.request.getHeader('host');
  2701. var tlsOptions = mergeOptions({}, self.options, {
  2702. socket: socket,
  2703. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2704. });
  2705. // 0 is dummy port for v0.6
  2706. var secureSocket = tls.connect(0, tlsOptions);
  2707. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2708. cb(secureSocket);
  2709. });
  2710. }
  2711. function toOptions(host, port, localAddress) {
  2712. if (typeof host === 'string') { // since v0.10
  2713. return {
  2714. host: host,
  2715. port: port,
  2716. localAddress: localAddress
  2717. };
  2718. }
  2719. return host; // for v0.11 or later
  2720. }
  2721. function mergeOptions(target) {
  2722. for (var i = 1, len = arguments.length; i < len; ++i) {
  2723. var overrides = arguments[i];
  2724. if (typeof overrides === 'object') {
  2725. var keys = Object.keys(overrides);
  2726. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2727. var k = keys[j];
  2728. if (overrides[k] !== undefined) {
  2729. target[k] = overrides[k];
  2730. }
  2731. }
  2732. }
  2733. }
  2734. return target;
  2735. }
  2736. var debug;
  2737. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2738. debug = function() {
  2739. var args = Array.prototype.slice.call(arguments);
  2740. if (typeof args[0] === 'string') {
  2741. args[0] = 'TUNNEL: ' + args[0];
  2742. } else {
  2743. args.unshift('TUNNEL:');
  2744. }
  2745. console.error.apply(console, args);
  2746. }
  2747. } else {
  2748. debug = function() {};
  2749. }
  2750. exports.debug = debug; // for test
  2751. /***/ }),
  2752. /***/ 190:
  2753. /***/ (function(module, __unusedexports, __webpack_require__) {
  2754. module.exports = authenticationPlugin;
  2755. const { createTokenAuth } = __webpack_require__(813);
  2756. const { Deprecation } = __webpack_require__(692);
  2757. const once = __webpack_require__(969);
  2758. const beforeRequest = __webpack_require__(863);
  2759. const requestError = __webpack_require__(991);
  2760. const validate = __webpack_require__(954);
  2761. const withAuthorizationPrefix = __webpack_require__(143);
  2762. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2763. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2764. function authenticationPlugin(octokit, options) {
  2765. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2766. if (options.authStrategy) {
  2767. const auth = options.authStrategy(options.auth);
  2768. octokit.hook.wrap("request", auth.hook);
  2769. octokit.auth = auth;
  2770. return;
  2771. }
  2772. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2773. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2774. if (!options.auth) {
  2775. octokit.auth = () =>
  2776. Promise.resolve({
  2777. type: "unauthenticated"
  2778. });
  2779. return;
  2780. }
  2781. const isBasicAuthString =
  2782. typeof options.auth === "string" &&
  2783. /^basic/.test(withAuthorizationPrefix(options.auth));
  2784. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2785. if (typeof options.auth === "string" && !isBasicAuthString) {
  2786. const auth = createTokenAuth(options.auth);
  2787. octokit.hook.wrap("request", auth.hook);
  2788. octokit.auth = auth;
  2789. return;
  2790. }
  2791. // Otherwise log a deprecation message
  2792. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2793. ? [
  2794. deprecateAuthBasic,
  2795. '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)'
  2796. ]
  2797. : [
  2798. deprecateAuthObject,
  2799. '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)'
  2800. ];
  2801. deprecationMethod(
  2802. octokit.log,
  2803. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2804. );
  2805. octokit.auth = () =>
  2806. Promise.resolve({
  2807. type: "deprecated",
  2808. message: deprecationMessapge
  2809. });
  2810. validate(options.auth);
  2811. const state = {
  2812. octokit,
  2813. auth: options.auth
  2814. };
  2815. octokit.hook.before("request", beforeRequest.bind(null, state));
  2816. octokit.hook.error("request", requestError.bind(null, state));
  2817. }
  2818. /***/ }),
  2819. /***/ 197:
  2820. /***/ (function(module, __unusedexports, __webpack_require__) {
  2821. module.exports = isexe
  2822. isexe.sync = sync
  2823. var fs = __webpack_require__(747)
  2824. function isexe (path, options, cb) {
  2825. fs.stat(path, function (er, stat) {
  2826. cb(er, er ? false : checkStat(stat, options))
  2827. })
  2828. }
  2829. function sync (path, options) {
  2830. return checkStat(fs.statSync(path), options)
  2831. }
  2832. function checkStat (stat, options) {
  2833. return stat.isFile() && checkMode(stat, options)
  2834. }
  2835. function checkMode (stat, options) {
  2836. var mod = stat.mode
  2837. var uid = stat.uid
  2838. var gid = stat.gid
  2839. var myUid = options.uid !== undefined ?
  2840. options.uid : process.getuid && process.getuid()
  2841. var myGid = options.gid !== undefined ?
  2842. options.gid : process.getgid && process.getgid()
  2843. var u = parseInt('100', 8)
  2844. var g = parseInt('010', 8)
  2845. var o = parseInt('001', 8)
  2846. var ug = u | g
  2847. var ret = (mod & o) ||
  2848. (mod & g) && gid === myGid ||
  2849. (mod & u) && uid === myUid ||
  2850. (mod & ug) && myUid === 0
  2851. return ret
  2852. }
  2853. /***/ }),
  2854. /***/ 198:
  2855. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2856. "use strict";
  2857. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2858. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2859. return new (P || (P = Promise))(function (resolve, reject) {
  2860. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2861. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2862. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2863. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2864. });
  2865. };
  2866. var __importStar = (this && this.__importStar) || function (mod) {
  2867. if (mod && mod.__esModule) return mod;
  2868. var result = {};
  2869. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2870. result["default"] = mod;
  2871. return result;
  2872. };
  2873. Object.defineProperty(exports, "__esModule", { value: true });
  2874. const core = __importStar(__webpack_require__(470));
  2875. const coreCommand = __importStar(__webpack_require__(431));
  2876. const gitSourceProvider = __importStar(__webpack_require__(293));
  2877. const inputHelper = __importStar(__webpack_require__(821));
  2878. const path = __importStar(__webpack_require__(622));
  2879. const stateHelper = __importStar(__webpack_require__(153));
  2880. function run() {
  2881. return __awaiter(this, void 0, void 0, function* () {
  2882. try {
  2883. const sourceSettings = inputHelper.getInputs();
  2884. try {
  2885. // Register problem matcher
  2886. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2887. // Get sources
  2888. yield gitSourceProvider.getSource(sourceSettings);
  2889. }
  2890. finally {
  2891. // Unregister problem matcher
  2892. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2893. }
  2894. }
  2895. catch (error) {
  2896. core.setFailed(error.message);
  2897. }
  2898. });
  2899. }
  2900. function cleanup() {
  2901. return __awaiter(this, void 0, void 0, function* () {
  2902. try {
  2903. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2904. }
  2905. catch (error) {
  2906. core.warning(error.message);
  2907. }
  2908. });
  2909. }
  2910. // Main
  2911. if (!stateHelper.IsPost) {
  2912. run();
  2913. }
  2914. // Post
  2915. else {
  2916. cleanup();
  2917. }
  2918. /***/ }),
  2919. /***/ 211:
  2920. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2921. "use strict";
  2922. Object.defineProperty(exports, '__esModule', { value: true });
  2923. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2924. var osName = _interopDefault(__webpack_require__(2));
  2925. function getUserAgent() {
  2926. try {
  2927. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2928. } catch (error) {
  2929. if (/wmic os get Caption/.test(error.message)) {
  2930. return "Windows <version undetectable>";
  2931. }
  2932. return "<environment undetectable>";
  2933. }
  2934. }
  2935. exports.getUserAgent = getUserAgent;
  2936. //# sourceMappingURL=index.js.map
  2937. /***/ }),
  2938. /***/ 215:
  2939. /***/ (function(module) {
  2940. 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"};
  2941. /***/ }),
  2942. /***/ 227:
  2943. /***/ (function(__unusedmodule, exports) {
  2944. "use strict";
  2945. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2946. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2947. return new (P || (P = Promise))(function (resolve, reject) {
  2948. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2949. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2950. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2951. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2952. });
  2953. };
  2954. Object.defineProperty(exports, "__esModule", { value: true });
  2955. function getCheckoutInfo(git, ref, commit) {
  2956. return __awaiter(this, void 0, void 0, function* () {
  2957. if (!git) {
  2958. throw new Error('Arg git cannot be empty');
  2959. }
  2960. if (!ref && !commit) {
  2961. throw new Error('Args ref and commit cannot both be empty');
  2962. }
  2963. const result = {};
  2964. const upperRef = (ref || '').toUpperCase();
  2965. // SHA only
  2966. if (!ref) {
  2967. result.ref = commit;
  2968. }
  2969. // refs/heads/
  2970. else if (upperRef.startsWith('REFS/HEADS/')) {
  2971. const branch = ref.substring('refs/heads/'.length);
  2972. result.ref = branch;
  2973. result.startPoint = `refs/remotes/origin/${branch}`;
  2974. }
  2975. // refs/pull/
  2976. else if (upperRef.startsWith('REFS/PULL/')) {
  2977. const branch = ref.substring('refs/pull/'.length);
  2978. result.ref = `refs/remotes/pull/${branch}`;
  2979. }
  2980. // refs/tags/
  2981. else if (upperRef.startsWith('REFS/')) {
  2982. result.ref = ref;
  2983. }
  2984. // Unqualified ref, check for a matching branch or tag
  2985. else {
  2986. if (yield git.branchExists(true, `origin/${ref}`)) {
  2987. result.ref = ref;
  2988. result.startPoint = `refs/remotes/origin/${ref}`;
  2989. }
  2990. else if (yield git.tagExists(`${ref}`)) {
  2991. result.ref = `refs/tags/${ref}`;
  2992. }
  2993. else {
  2994. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2995. }
  2996. }
  2997. return result;
  2998. });
  2999. }
  3000. exports.getCheckoutInfo = getCheckoutInfo;
  3001. function getRefSpec(ref, commit) {
  3002. if (!ref && !commit) {
  3003. throw new Error('Args ref and commit cannot both be empty');
  3004. }
  3005. const upperRef = (ref || '').toUpperCase();
  3006. // SHA
  3007. if (commit) {
  3008. // refs/heads
  3009. if (upperRef.startsWith('REFS/HEADS/')) {
  3010. const branch = ref.substring('refs/heads/'.length);
  3011. return [`+${commit}:refs/remotes/origin/${branch}`];
  3012. }
  3013. // refs/pull/
  3014. else if (upperRef.startsWith('REFS/PULL/')) {
  3015. const branch = ref.substring('refs/pull/'.length);
  3016. return [`+${commit}:refs/remotes/pull/${branch}`];
  3017. }
  3018. // refs/tags/
  3019. else if (upperRef.startsWith('REFS/TAGS/')) {
  3020. return [`+${commit}:${ref}`];
  3021. }
  3022. // Otherwise no destination ref
  3023. else {
  3024. return [commit];
  3025. }
  3026. }
  3027. // Unqualified ref, check for a matching branch or tag
  3028. else if (!upperRef.startsWith('REFS/')) {
  3029. return [
  3030. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3031. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3032. ];
  3033. }
  3034. // refs/heads/
  3035. else if (upperRef.startsWith('REFS/HEADS/')) {
  3036. const branch = ref.substring('refs/heads/'.length);
  3037. return [`+${ref}:refs/remotes/origin/${branch}`];
  3038. }
  3039. // refs/pull/
  3040. else if (upperRef.startsWith('REFS/PULL/')) {
  3041. const branch = ref.substring('refs/pull/'.length);
  3042. return [`+${ref}:refs/remotes/pull/${branch}`];
  3043. }
  3044. // refs/tags/
  3045. else {
  3046. return [`+${ref}:${ref}`];
  3047. }
  3048. }
  3049. exports.getRefSpec = getRefSpec;
  3050. /***/ }),
  3051. /***/ 260:
  3052. /***/ (function(module, __unusedexports, __webpack_require__) {
  3053. // Note: since nyc uses this module to output coverage, any lines
  3054. // that are in the direct sync flow of nyc's outputCoverage are
  3055. // ignored, since we can never get coverage for them.
  3056. var assert = __webpack_require__(357)
  3057. var signals = __webpack_require__(654)
  3058. var EE = __webpack_require__(614)
  3059. /* istanbul ignore if */
  3060. if (typeof EE !== 'function') {
  3061. EE = EE.EventEmitter
  3062. }
  3063. var emitter
  3064. if (process.__signal_exit_emitter__) {
  3065. emitter = process.__signal_exit_emitter__
  3066. } else {
  3067. emitter = process.__signal_exit_emitter__ = new EE()
  3068. emitter.count = 0
  3069. emitter.emitted = {}
  3070. }
  3071. // Because this emitter is a global, we have to check to see if a
  3072. // previous version of this library failed to enable infinite listeners.
  3073. // I know what you're about to say. But literally everything about
  3074. // signal-exit is a compromise with evil. Get used to it.
  3075. if (!emitter.infinite) {
  3076. emitter.setMaxListeners(Infinity)
  3077. emitter.infinite = true
  3078. }
  3079. module.exports = function (cb, opts) {
  3080. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3081. if (loaded === false) {
  3082. load()
  3083. }
  3084. var ev = 'exit'
  3085. if (opts && opts.alwaysLast) {
  3086. ev = 'afterexit'
  3087. }
  3088. var remove = function () {
  3089. emitter.removeListener(ev, cb)
  3090. if (emitter.listeners('exit').length === 0 &&
  3091. emitter.listeners('afterexit').length === 0) {
  3092. unload()
  3093. }
  3094. }
  3095. emitter.on(ev, cb)
  3096. return remove
  3097. }
  3098. module.exports.unload = unload
  3099. function unload () {
  3100. if (!loaded) {
  3101. return
  3102. }
  3103. loaded = false
  3104. signals.forEach(function (sig) {
  3105. try {
  3106. process.removeListener(sig, sigListeners[sig])
  3107. } catch (er) {}
  3108. })
  3109. process.emit = originalProcessEmit
  3110. process.reallyExit = originalProcessReallyExit
  3111. emitter.count -= 1
  3112. }
  3113. function emit (event, code, signal) {
  3114. if (emitter.emitted[event]) {
  3115. return
  3116. }
  3117. emitter.emitted[event] = true
  3118. emitter.emit(event, code, signal)
  3119. }
  3120. // { <signal>: <listener fn>, ... }
  3121. var sigListeners = {}
  3122. signals.forEach(function (sig) {
  3123. sigListeners[sig] = function listener () {
  3124. // If there are no other listeners, an exit is coming!
  3125. // Simplest way: remove us and then re-send the signal.
  3126. // We know that this will kill the process, so we can
  3127. // safely emit now.
  3128. var listeners = process.listeners(sig)
  3129. if (listeners.length === emitter.count) {
  3130. unload()
  3131. emit('exit', null, sig)
  3132. /* istanbul ignore next */
  3133. emit('afterexit', null, sig)
  3134. /* istanbul ignore next */
  3135. process.kill(process.pid, sig)
  3136. }
  3137. }
  3138. })
  3139. module.exports.signals = function () {
  3140. return signals
  3141. }
  3142. module.exports.load = load
  3143. var loaded = false
  3144. function load () {
  3145. if (loaded) {
  3146. return
  3147. }
  3148. loaded = true
  3149. // This is the number of onSignalExit's that are in play.
  3150. // It's important so that we can count the correct number of
  3151. // listeners on signals, and don't wait for the other one to
  3152. // handle it instead of us.
  3153. emitter.count += 1
  3154. signals = signals.filter(function (sig) {
  3155. try {
  3156. process.on(sig, sigListeners[sig])
  3157. return true
  3158. } catch (er) {
  3159. return false
  3160. }
  3161. })
  3162. process.emit = processEmit
  3163. process.reallyExit = processReallyExit
  3164. }
  3165. var originalProcessReallyExit = process.reallyExit
  3166. function processReallyExit (code) {
  3167. process.exitCode = code || 0
  3168. emit('exit', process.exitCode, null)
  3169. /* istanbul ignore next */
  3170. emit('afterexit', process.exitCode, null)
  3171. /* istanbul ignore next */
  3172. originalProcessReallyExit.call(process, process.exitCode)
  3173. }
  3174. var originalProcessEmit = process.emit
  3175. function processEmit (ev, arg) {
  3176. if (ev === 'exit') {
  3177. if (arg !== undefined) {
  3178. process.exitCode = arg
  3179. }
  3180. var ret = originalProcessEmit.apply(this, arguments)
  3181. emit('exit', process.exitCode, null)
  3182. /* istanbul ignore next */
  3183. emit('afterexit', process.exitCode, null)
  3184. return ret
  3185. } else {
  3186. return originalProcessEmit.apply(this, arguments)
  3187. }
  3188. }
  3189. /***/ }),
  3190. /***/ 262:
  3191. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3192. "use strict";
  3193. Object.defineProperty(exports, "__esModule", { value: true });
  3194. const fs_1 = __webpack_require__(747);
  3195. const os_1 = __webpack_require__(87);
  3196. class Context {
  3197. /**
  3198. * Hydrate the context from the environment
  3199. */
  3200. constructor() {
  3201. this.payload = {};
  3202. if (process.env.GITHUB_EVENT_PATH) {
  3203. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3204. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3205. }
  3206. else {
  3207. const path = process.env.GITHUB_EVENT_PATH;
  3208. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3209. }
  3210. }
  3211. this.eventName = process.env.GITHUB_EVENT_NAME;
  3212. this.sha = process.env.GITHUB_SHA;
  3213. this.ref = process.env.GITHUB_REF;
  3214. this.workflow = process.env.GITHUB_WORKFLOW;
  3215. this.action = process.env.GITHUB_ACTION;
  3216. this.actor = process.env.GITHUB_ACTOR;
  3217. }
  3218. get issue() {
  3219. const payload = this.payload;
  3220. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3221. }
  3222. get repo() {
  3223. if (process.env.GITHUB_REPOSITORY) {
  3224. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3225. return { owner, repo };
  3226. }
  3227. if (this.payload.repository) {
  3228. return {
  3229. owner: this.payload.repository.owner.login,
  3230. repo: this.payload.repository.name
  3231. };
  3232. }
  3233. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3234. }
  3235. }
  3236. exports.Context = Context;
  3237. //# sourceMappingURL=context.js.map
  3238. /***/ }),
  3239. /***/ 265:
  3240. /***/ (function(module, __unusedexports, __webpack_require__) {
  3241. module.exports = getPage
  3242. const deprecate = __webpack_require__(370)
  3243. const getPageLinks = __webpack_require__(577)
  3244. const HttpError = __webpack_require__(297)
  3245. function getPage (octokit, link, which, headers) {
  3246. 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.`)
  3247. const url = getPageLinks(link)[which]
  3248. if (!url) {
  3249. const urlError = new HttpError(`No ${which} page found`, 404)
  3250. return Promise.reject(urlError)
  3251. }
  3252. const requestOptions = {
  3253. url,
  3254. headers: applyAcceptHeader(link, headers)
  3255. }
  3256. const promise = octokit.request(requestOptions)
  3257. return promise
  3258. }
  3259. function applyAcceptHeader (res, headers) {
  3260. const previous = res.headers && res.headers['x-github-media-type']
  3261. if (!previous || (headers && headers.accept)) {
  3262. return headers
  3263. }
  3264. headers = headers || {}
  3265. headers.accept = 'application/vnd.' + previous
  3266. .replace('; param=', '.')
  3267. .replace('; format=', '+')
  3268. return headers
  3269. }
  3270. /***/ }),
  3271. /***/ 280:
  3272. /***/ (function(module, exports) {
  3273. exports = module.exports = SemVer
  3274. var debug
  3275. /* istanbul ignore next */
  3276. if (typeof process === 'object' &&
  3277. process.env &&
  3278. process.env.NODE_DEBUG &&
  3279. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3280. debug = function () {
  3281. var args = Array.prototype.slice.call(arguments, 0)
  3282. args.unshift('SEMVER')
  3283. console.log.apply(console, args)
  3284. }
  3285. } else {
  3286. debug = function () {}
  3287. }
  3288. // Note: this is the semver.org version of the spec that it implements
  3289. // Not necessarily the package version of this code.
  3290. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3291. var MAX_LENGTH = 256
  3292. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3293. /* istanbul ignore next */ 9007199254740991
  3294. // Max safe segment length for coercion.
  3295. var MAX_SAFE_COMPONENT_LENGTH = 16
  3296. // The actual regexps go on exports.re
  3297. var re = exports.re = []
  3298. var src = exports.src = []
  3299. var R = 0
  3300. // The following Regular Expressions can be used for tokenizing,
  3301. // validating, and parsing SemVer version strings.
  3302. // ## Numeric Identifier
  3303. // A single `0`, or a non-zero digit followed by zero or more digits.
  3304. var NUMERICIDENTIFIER = R++
  3305. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3306. var NUMERICIDENTIFIERLOOSE = R++
  3307. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3308. // ## Non-numeric Identifier
  3309. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3310. // more letters, digits, or hyphens.
  3311. var NONNUMERICIDENTIFIER = R++
  3312. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3313. // ## Main Version
  3314. // Three dot-separated numeric identifiers.
  3315. var MAINVERSION = R++
  3316. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3317. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3318. '(' + src[NUMERICIDENTIFIER] + ')'
  3319. var MAINVERSIONLOOSE = R++
  3320. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3321. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3322. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3323. // ## Pre-release Version Identifier
  3324. // A numeric identifier, or a non-numeric identifier.
  3325. var PRERELEASEIDENTIFIER = R++
  3326. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3327. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3328. var PRERELEASEIDENTIFIERLOOSE = R++
  3329. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3330. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3331. // ## Pre-release Version
  3332. // Hyphen, followed by one or more dot-separated pre-release version
  3333. // identifiers.
  3334. var PRERELEASE = R++
  3335. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3336. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3337. var PRERELEASELOOSE = R++
  3338. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3339. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3340. // ## Build Metadata Identifier
  3341. // Any combination of digits, letters, or hyphens.
  3342. var BUILDIDENTIFIER = R++
  3343. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3344. // ## Build Metadata
  3345. // Plus sign, followed by one or more period-separated build metadata
  3346. // identifiers.
  3347. var BUILD = R++
  3348. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3349. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3350. // ## Full Version String
  3351. // A main version, followed optionally by a pre-release version and
  3352. // build metadata.
  3353. // Note that the only major, minor, patch, and pre-release sections of
  3354. // the version string are capturing groups. The build metadata is not a
  3355. // capturing group, because it should not ever be used in version
  3356. // comparison.
  3357. var FULL = R++
  3358. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3359. src[PRERELEASE] + '?' +
  3360. src[BUILD] + '?'
  3361. src[FULL] = '^' + FULLPLAIN + '$'
  3362. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3363. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3364. // common in the npm registry.
  3365. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3366. src[PRERELEASELOOSE] + '?' +
  3367. src[BUILD] + '?'
  3368. var LOOSE = R++
  3369. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3370. var GTLT = R++
  3371. src[GTLT] = '((?:<|>)?=?)'
  3372. // Something like "2.*" or "1.2.x".
  3373. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3374. // Only the first item is strictly required.
  3375. var XRANGEIDENTIFIERLOOSE = R++
  3376. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3377. var XRANGEIDENTIFIER = R++
  3378. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3379. var XRANGEPLAIN = R++
  3380. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3381. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3382. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3383. '(?:' + src[PRERELEASE] + ')?' +
  3384. src[BUILD] + '?' +
  3385. ')?)?'
  3386. var XRANGEPLAINLOOSE = R++
  3387. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3388. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3389. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3390. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3391. src[BUILD] + '?' +
  3392. ')?)?'
  3393. var XRANGE = R++
  3394. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3395. var XRANGELOOSE = R++
  3396. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3397. // Coercion.
  3398. // Extract anything that could conceivably be a part of a valid semver
  3399. var COERCE = R++
  3400. src[COERCE] = '(?:^|[^\\d])' +
  3401. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3402. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3403. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3404. '(?:$|[^\\d])'
  3405. // Tilde ranges.
  3406. // Meaning is "reasonably at or greater than"
  3407. var LONETILDE = R++
  3408. src[LONETILDE] = '(?:~>?)'
  3409. var TILDETRIM = R++
  3410. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3411. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3412. var tildeTrimReplace = '$1~'
  3413. var TILDE = R++
  3414. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3415. var TILDELOOSE = R++
  3416. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3417. // Caret ranges.
  3418. // Meaning is "at least and backwards compatible with"
  3419. var LONECARET = R++
  3420. src[LONECARET] = '(?:\\^)'
  3421. var CARETTRIM = R++
  3422. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3423. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3424. var caretTrimReplace = '$1^'
  3425. var CARET = R++
  3426. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3427. var CARETLOOSE = R++
  3428. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3429. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3430. var COMPARATORLOOSE = R++
  3431. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3432. var COMPARATOR = R++
  3433. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3434. // An expression to strip any whitespace between the gtlt and the thing
  3435. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3436. var COMPARATORTRIM = R++
  3437. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3438. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3439. // this one has to use the /g flag
  3440. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3441. var comparatorTrimReplace = '$1$2$3'
  3442. // Something like `1.2.3 - 1.2.4`
  3443. // Note that these all use the loose form, because they'll be
  3444. // checked against either the strict or loose comparator form
  3445. // later.
  3446. var HYPHENRANGE = R++
  3447. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3448. '\\s+-\\s+' +
  3449. '(' + src[XRANGEPLAIN] + ')' +
  3450. '\\s*$'
  3451. var HYPHENRANGELOOSE = R++
  3452. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3453. '\\s+-\\s+' +
  3454. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3455. '\\s*$'
  3456. // Star ranges basically just allow anything at all.
  3457. var STAR = R++
  3458. src[STAR] = '(<|>)?=?\\s*\\*'
  3459. // Compile to actual regexp objects.
  3460. // All are flag-free, unless they were created above with a flag.
  3461. for (var i = 0; i < R; i++) {
  3462. debug(i, src[i])
  3463. if (!re[i]) {
  3464. re[i] = new RegExp(src[i])
  3465. }
  3466. }
  3467. exports.parse = parse
  3468. function parse (version, options) {
  3469. if (!options || typeof options !== 'object') {
  3470. options = {
  3471. loose: !!options,
  3472. includePrerelease: false
  3473. }
  3474. }
  3475. if (version instanceof SemVer) {
  3476. return version
  3477. }
  3478. if (typeof version !== 'string') {
  3479. return null
  3480. }
  3481. if (version.length > MAX_LENGTH) {
  3482. return null
  3483. }
  3484. var r = options.loose ? re[LOOSE] : re[FULL]
  3485. if (!r.test(version)) {
  3486. return null
  3487. }
  3488. try {
  3489. return new SemVer(version, options)
  3490. } catch (er) {
  3491. return null
  3492. }
  3493. }
  3494. exports.valid = valid
  3495. function valid (version, options) {
  3496. var v = parse(version, options)
  3497. return v ? v.version : null
  3498. }
  3499. exports.clean = clean
  3500. function clean (version, options) {
  3501. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3502. return s ? s.version : null
  3503. }
  3504. exports.SemVer = SemVer
  3505. function SemVer (version, options) {
  3506. if (!options || typeof options !== 'object') {
  3507. options = {
  3508. loose: !!options,
  3509. includePrerelease: false
  3510. }
  3511. }
  3512. if (version instanceof SemVer) {
  3513. if (version.loose === options.loose) {
  3514. return version
  3515. } else {
  3516. version = version.version
  3517. }
  3518. } else if (typeof version !== 'string') {
  3519. throw new TypeError('Invalid Version: ' + version)
  3520. }
  3521. if (version.length > MAX_LENGTH) {
  3522. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3523. }
  3524. if (!(this instanceof SemVer)) {
  3525. return new SemVer(version, options)
  3526. }
  3527. debug('SemVer', version, options)
  3528. this.options = options
  3529. this.loose = !!options.loose
  3530. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3531. if (!m) {
  3532. throw new TypeError('Invalid Version: ' + version)
  3533. }
  3534. this.raw = version
  3535. // these are actually numbers
  3536. this.major = +m[1]
  3537. this.minor = +m[2]
  3538. this.patch = +m[3]
  3539. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3540. throw new TypeError('Invalid major version')
  3541. }
  3542. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3543. throw new TypeError('Invalid minor version')
  3544. }
  3545. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3546. throw new TypeError('Invalid patch version')
  3547. }
  3548. // numberify any prerelease numeric ids
  3549. if (!m[4]) {
  3550. this.prerelease = []
  3551. } else {
  3552. this.prerelease = m[4].split('.').map(function (id) {
  3553. if (/^[0-9]+$/.test(id)) {
  3554. var num = +id
  3555. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3556. return num
  3557. }
  3558. }
  3559. return id
  3560. })
  3561. }
  3562. this.build = m[5] ? m[5].split('.') : []
  3563. this.format()
  3564. }
  3565. SemVer.prototype.format = function () {
  3566. this.version = this.major + '.' + this.minor + '.' + this.patch
  3567. if (this.prerelease.length) {
  3568. this.version += '-' + this.prerelease.join('.')
  3569. }
  3570. return this.version
  3571. }
  3572. SemVer.prototype.toString = function () {
  3573. return this.version
  3574. }
  3575. SemVer.prototype.compare = function (other) {
  3576. debug('SemVer.compare', this.version, this.options, other)
  3577. if (!(other instanceof SemVer)) {
  3578. other = new SemVer(other, this.options)
  3579. }
  3580. return this.compareMain(other) || this.comparePre(other)
  3581. }
  3582. SemVer.prototype.compareMain = function (other) {
  3583. if (!(other instanceof SemVer)) {
  3584. other = new SemVer(other, this.options)
  3585. }
  3586. return compareIdentifiers(this.major, other.major) ||
  3587. compareIdentifiers(this.minor, other.minor) ||
  3588. compareIdentifiers(this.patch, other.patch)
  3589. }
  3590. SemVer.prototype.comparePre = function (other) {
  3591. if (!(other instanceof SemVer)) {
  3592. other = new SemVer(other, this.options)
  3593. }
  3594. // NOT having a prerelease is > having one
  3595. if (this.prerelease.length && !other.prerelease.length) {
  3596. return -1
  3597. } else if (!this.prerelease.length && other.prerelease.length) {
  3598. return 1
  3599. } else if (!this.prerelease.length && !other.prerelease.length) {
  3600. return 0
  3601. }
  3602. var i = 0
  3603. do {
  3604. var a = this.prerelease[i]
  3605. var b = other.prerelease[i]
  3606. debug('prerelease compare', i, a, b)
  3607. if (a === undefined && b === undefined) {
  3608. return 0
  3609. } else if (b === undefined) {
  3610. return 1
  3611. } else if (a === undefined) {
  3612. return -1
  3613. } else if (a === b) {
  3614. continue
  3615. } else {
  3616. return compareIdentifiers(a, b)
  3617. }
  3618. } while (++i)
  3619. }
  3620. // preminor will bump the version up to the next minor release, and immediately
  3621. // down to pre-release. premajor and prepatch work the same way.
  3622. SemVer.prototype.inc = function (release, identifier) {
  3623. switch (release) {
  3624. case 'premajor':
  3625. this.prerelease.length = 0
  3626. this.patch = 0
  3627. this.minor = 0
  3628. this.major++
  3629. this.inc('pre', identifier)
  3630. break
  3631. case 'preminor':
  3632. this.prerelease.length = 0
  3633. this.patch = 0
  3634. this.minor++
  3635. this.inc('pre', identifier)
  3636. break
  3637. case 'prepatch':
  3638. // If this is already a prerelease, it will bump to the next version
  3639. // drop any prereleases that might already exist, since they are not
  3640. // relevant at this point.
  3641. this.prerelease.length = 0
  3642. this.inc('patch', identifier)
  3643. this.inc('pre', identifier)
  3644. break
  3645. // If the input is a non-prerelease version, this acts the same as
  3646. // prepatch.
  3647. case 'prerelease':
  3648. if (this.prerelease.length === 0) {
  3649. this.inc('patch', identifier)
  3650. }
  3651. this.inc('pre', identifier)
  3652. break
  3653. case 'major':
  3654. // If this is a pre-major version, bump up to the same major version.
  3655. // Otherwise increment major.
  3656. // 1.0.0-5 bumps to 1.0.0
  3657. // 1.1.0 bumps to 2.0.0
  3658. if (this.minor !== 0 ||
  3659. this.patch !== 0 ||
  3660. this.prerelease.length === 0) {
  3661. this.major++
  3662. }
  3663. this.minor = 0
  3664. this.patch = 0
  3665. this.prerelease = []
  3666. break
  3667. case 'minor':
  3668. // If this is a pre-minor version, bump up to the same minor version.
  3669. // Otherwise increment minor.
  3670. // 1.2.0-5 bumps to 1.2.0
  3671. // 1.2.1 bumps to 1.3.0
  3672. if (this.patch !== 0 || this.prerelease.length === 0) {
  3673. this.minor++
  3674. }
  3675. this.patch = 0
  3676. this.prerelease = []
  3677. break
  3678. case 'patch':
  3679. // If this is not a pre-release version, it will increment the patch.
  3680. // If it is a pre-release it will bump up to the same patch version.
  3681. // 1.2.0-5 patches to 1.2.0
  3682. // 1.2.0 patches to 1.2.1
  3683. if (this.prerelease.length === 0) {
  3684. this.patch++
  3685. }
  3686. this.prerelease = []
  3687. break
  3688. // This probably shouldn't be used publicly.
  3689. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3690. case 'pre':
  3691. if (this.prerelease.length === 0) {
  3692. this.prerelease = [0]
  3693. } else {
  3694. var i = this.prerelease.length
  3695. while (--i >= 0) {
  3696. if (typeof this.prerelease[i] === 'number') {
  3697. this.prerelease[i]++
  3698. i = -2
  3699. }
  3700. }
  3701. if (i === -1) {
  3702. // didn't increment anything
  3703. this.prerelease.push(0)
  3704. }
  3705. }
  3706. if (identifier) {
  3707. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3708. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3709. if (this.prerelease[0] === identifier) {
  3710. if (isNaN(this.prerelease[1])) {
  3711. this.prerelease = [identifier, 0]
  3712. }
  3713. } else {
  3714. this.prerelease = [identifier, 0]
  3715. }
  3716. }
  3717. break
  3718. default:
  3719. throw new Error('invalid increment argument: ' + release)
  3720. }
  3721. this.format()
  3722. this.raw = this.version
  3723. return this
  3724. }
  3725. exports.inc = inc
  3726. function inc (version, release, loose, identifier) {
  3727. if (typeof (loose) === 'string') {
  3728. identifier = loose
  3729. loose = undefined
  3730. }
  3731. try {
  3732. return new SemVer(version, loose).inc(release, identifier).version
  3733. } catch (er) {
  3734. return null
  3735. }
  3736. }
  3737. exports.diff = diff
  3738. function diff (version1, version2) {
  3739. if (eq(version1, version2)) {
  3740. return null
  3741. } else {
  3742. var v1 = parse(version1)
  3743. var v2 = parse(version2)
  3744. var prefix = ''
  3745. if (v1.prerelease.length || v2.prerelease.length) {
  3746. prefix = 'pre'
  3747. var defaultResult = 'prerelease'
  3748. }
  3749. for (var key in v1) {
  3750. if (key === 'major' || key === 'minor' || key === 'patch') {
  3751. if (v1[key] !== v2[key]) {
  3752. return prefix + key
  3753. }
  3754. }
  3755. }
  3756. return defaultResult // may be undefined
  3757. }
  3758. }
  3759. exports.compareIdentifiers = compareIdentifiers
  3760. var numeric = /^[0-9]+$/
  3761. function compareIdentifiers (a, b) {
  3762. var anum = numeric.test(a)
  3763. var bnum = numeric.test(b)
  3764. if (anum && bnum) {
  3765. a = +a
  3766. b = +b
  3767. }
  3768. return a === b ? 0
  3769. : (anum && !bnum) ? -1
  3770. : (bnum && !anum) ? 1
  3771. : a < b ? -1
  3772. : 1
  3773. }
  3774. exports.rcompareIdentifiers = rcompareIdentifiers
  3775. function rcompareIdentifiers (a, b) {
  3776. return compareIdentifiers(b, a)
  3777. }
  3778. exports.major = major
  3779. function major (a, loose) {
  3780. return new SemVer(a, loose).major
  3781. }
  3782. exports.minor = minor
  3783. function minor (a, loose) {
  3784. return new SemVer(a, loose).minor
  3785. }
  3786. exports.patch = patch
  3787. function patch (a, loose) {
  3788. return new SemVer(a, loose).patch
  3789. }
  3790. exports.compare = compare
  3791. function compare (a, b, loose) {
  3792. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3793. }
  3794. exports.compareLoose = compareLoose
  3795. function compareLoose (a, b) {
  3796. return compare(a, b, true)
  3797. }
  3798. exports.rcompare = rcompare
  3799. function rcompare (a, b, loose) {
  3800. return compare(b, a, loose)
  3801. }
  3802. exports.sort = sort
  3803. function sort (list, loose) {
  3804. return list.sort(function (a, b) {
  3805. return exports.compare(a, b, loose)
  3806. })
  3807. }
  3808. exports.rsort = rsort
  3809. function rsort (list, loose) {
  3810. return list.sort(function (a, b) {
  3811. return exports.rcompare(a, b, loose)
  3812. })
  3813. }
  3814. exports.gt = gt
  3815. function gt (a, b, loose) {
  3816. return compare(a, b, loose) > 0
  3817. }
  3818. exports.lt = lt
  3819. function lt (a, b, loose) {
  3820. return compare(a, b, loose) < 0
  3821. }
  3822. exports.eq = eq
  3823. function eq (a, b, loose) {
  3824. return compare(a, b, loose) === 0
  3825. }
  3826. exports.neq = neq
  3827. function neq (a, b, loose) {
  3828. return compare(a, b, loose) !== 0
  3829. }
  3830. exports.gte = gte
  3831. function gte (a, b, loose) {
  3832. return compare(a, b, loose) >= 0
  3833. }
  3834. exports.lte = lte
  3835. function lte (a, b, loose) {
  3836. return compare(a, b, loose) <= 0
  3837. }
  3838. exports.cmp = cmp
  3839. function cmp (a, op, b, loose) {
  3840. switch (op) {
  3841. case '===':
  3842. if (typeof a === 'object')
  3843. a = a.version
  3844. if (typeof b === 'object')
  3845. b = b.version
  3846. return a === b
  3847. case '!==':
  3848. if (typeof a === 'object')
  3849. a = a.version
  3850. if (typeof b === 'object')
  3851. b = b.version
  3852. return a !== b
  3853. case '':
  3854. case '=':
  3855. case '==':
  3856. return eq(a, b, loose)
  3857. case '!=':
  3858. return neq(a, b, loose)
  3859. case '>':
  3860. return gt(a, b, loose)
  3861. case '>=':
  3862. return gte(a, b, loose)
  3863. case '<':
  3864. return lt(a, b, loose)
  3865. case '<=':
  3866. return lte(a, b, loose)
  3867. default:
  3868. throw new TypeError('Invalid operator: ' + op)
  3869. }
  3870. }
  3871. exports.Comparator = Comparator
  3872. function Comparator (comp, options) {
  3873. if (!options || typeof options !== 'object') {
  3874. options = {
  3875. loose: !!options,
  3876. includePrerelease: false
  3877. }
  3878. }
  3879. if (comp instanceof Comparator) {
  3880. if (comp.loose === !!options.loose) {
  3881. return comp
  3882. } else {
  3883. comp = comp.value
  3884. }
  3885. }
  3886. if (!(this instanceof Comparator)) {
  3887. return new Comparator(comp, options)
  3888. }
  3889. debug('comparator', comp, options)
  3890. this.options = options
  3891. this.loose = !!options.loose
  3892. this.parse(comp)
  3893. if (this.semver === ANY) {
  3894. this.value = ''
  3895. } else {
  3896. this.value = this.operator + this.semver.version
  3897. }
  3898. debug('comp', this)
  3899. }
  3900. var ANY = {}
  3901. Comparator.prototype.parse = function (comp) {
  3902. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3903. var m = comp.match(r)
  3904. if (!m) {
  3905. throw new TypeError('Invalid comparator: ' + comp)
  3906. }
  3907. this.operator = m[1]
  3908. if (this.operator === '=') {
  3909. this.operator = ''
  3910. }
  3911. // if it literally is just '>' or '' then allow anything.
  3912. if (!m[2]) {
  3913. this.semver = ANY
  3914. } else {
  3915. this.semver = new SemVer(m[2], this.options.loose)
  3916. }
  3917. }
  3918. Comparator.prototype.toString = function () {
  3919. return this.value
  3920. }
  3921. Comparator.prototype.test = function (version) {
  3922. debug('Comparator.test', version, this.options.loose)
  3923. if (this.semver === ANY) {
  3924. return true
  3925. }
  3926. if (typeof version === 'string') {
  3927. version = new SemVer(version, this.options)
  3928. }
  3929. return cmp(version, this.operator, this.semver, this.options)
  3930. }
  3931. Comparator.prototype.intersects = function (comp, options) {
  3932. if (!(comp instanceof Comparator)) {
  3933. throw new TypeError('a Comparator is required')
  3934. }
  3935. if (!options || typeof options !== 'object') {
  3936. options = {
  3937. loose: !!options,
  3938. includePrerelease: false
  3939. }
  3940. }
  3941. var rangeTmp
  3942. if (this.operator === '') {
  3943. rangeTmp = new Range(comp.value, options)
  3944. return satisfies(this.value, rangeTmp, options)
  3945. } else if (comp.operator === '') {
  3946. rangeTmp = new Range(this.value, options)
  3947. return satisfies(comp.semver, rangeTmp, options)
  3948. }
  3949. var sameDirectionIncreasing =
  3950. (this.operator === '>=' || this.operator === '>') &&
  3951. (comp.operator === '>=' || comp.operator === '>')
  3952. var sameDirectionDecreasing =
  3953. (this.operator === '<=' || this.operator === '<') &&
  3954. (comp.operator === '<=' || comp.operator === '<')
  3955. var sameSemVer = this.semver.version === comp.semver.version
  3956. var differentDirectionsInclusive =
  3957. (this.operator === '>=' || this.operator === '<=') &&
  3958. (comp.operator === '>=' || comp.operator === '<=')
  3959. var oppositeDirectionsLessThan =
  3960. cmp(this.semver, '<', comp.semver, options) &&
  3961. ((this.operator === '>=' || this.operator === '>') &&
  3962. (comp.operator === '<=' || comp.operator === '<'))
  3963. var oppositeDirectionsGreaterThan =
  3964. cmp(this.semver, '>', comp.semver, options) &&
  3965. ((this.operator === '<=' || this.operator === '<') &&
  3966. (comp.operator === '>=' || comp.operator === '>'))
  3967. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3968. (sameSemVer && differentDirectionsInclusive) ||
  3969. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3970. }
  3971. exports.Range = Range
  3972. function Range (range, options) {
  3973. if (!options || typeof options !== 'object') {
  3974. options = {
  3975. loose: !!options,
  3976. includePrerelease: false
  3977. }
  3978. }
  3979. if (range instanceof Range) {
  3980. if (range.loose === !!options.loose &&
  3981. range.includePrerelease === !!options.includePrerelease) {
  3982. return range
  3983. } else {
  3984. return new Range(range.raw, options)
  3985. }
  3986. }
  3987. if (range instanceof Comparator) {
  3988. return new Range(range.value, options)
  3989. }
  3990. if (!(this instanceof Range)) {
  3991. return new Range(range, options)
  3992. }
  3993. this.options = options
  3994. this.loose = !!options.loose
  3995. this.includePrerelease = !!options.includePrerelease
  3996. // First, split based on boolean or ||
  3997. this.raw = range
  3998. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3999. return this.parseRange(range.trim())
  4000. }, this).filter(function (c) {
  4001. // throw out any that are not relevant for whatever reason
  4002. return c.length
  4003. })
  4004. if (!this.set.length) {
  4005. throw new TypeError('Invalid SemVer Range: ' + range)
  4006. }
  4007. this.format()
  4008. }
  4009. Range.prototype.format = function () {
  4010. this.range = this.set.map(function (comps) {
  4011. return comps.join(' ').trim()
  4012. }).join('||').trim()
  4013. return this.range
  4014. }
  4015. Range.prototype.toString = function () {
  4016. return this.range
  4017. }
  4018. Range.prototype.parseRange = function (range) {
  4019. var loose = this.options.loose
  4020. range = range.trim()
  4021. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4022. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4023. range = range.replace(hr, hyphenReplace)
  4024. debug('hyphen replace', range)
  4025. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4026. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4027. debug('comparator trim', range, re[COMPARATORTRIM])
  4028. // `~ 1.2.3` => `~1.2.3`
  4029. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4030. // `^ 1.2.3` => `^1.2.3`
  4031. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4032. // normalize spaces
  4033. range = range.split(/\s+/).join(' ')
  4034. // At this point, the range is completely trimmed and
  4035. // ready to be split into comparators.
  4036. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4037. var set = range.split(' ').map(function (comp) {
  4038. return parseComparator(comp, this.options)
  4039. }, this).join(' ').split(/\s+/)
  4040. if (this.options.loose) {
  4041. // in loose mode, throw out any that are not valid comparators
  4042. set = set.filter(function (comp) {
  4043. return !!comp.match(compRe)
  4044. })
  4045. }
  4046. set = set.map(function (comp) {
  4047. return new Comparator(comp, this.options)
  4048. }, this)
  4049. return set
  4050. }
  4051. Range.prototype.intersects = function (range, options) {
  4052. if (!(range instanceof Range)) {
  4053. throw new TypeError('a Range is required')
  4054. }
  4055. return this.set.some(function (thisComparators) {
  4056. return thisComparators.every(function (thisComparator) {
  4057. return range.set.some(function (rangeComparators) {
  4058. return rangeComparators.every(function (rangeComparator) {
  4059. return thisComparator.intersects(rangeComparator, options)
  4060. })
  4061. })
  4062. })
  4063. })
  4064. }
  4065. // Mostly just for testing and legacy API reasons
  4066. exports.toComparators = toComparators
  4067. function toComparators (range, options) {
  4068. return new Range(range, options).set.map(function (comp) {
  4069. return comp.map(function (c) {
  4070. return c.value
  4071. }).join(' ').trim().split(' ')
  4072. })
  4073. }
  4074. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4075. // already replaced the hyphen ranges
  4076. // turn into a set of JUST comparators.
  4077. function parseComparator (comp, options) {
  4078. debug('comp', comp, options)
  4079. comp = replaceCarets(comp, options)
  4080. debug('caret', comp)
  4081. comp = replaceTildes(comp, options)
  4082. debug('tildes', comp)
  4083. comp = replaceXRanges(comp, options)
  4084. debug('xrange', comp)
  4085. comp = replaceStars(comp, options)
  4086. debug('stars', comp)
  4087. return comp
  4088. }
  4089. function isX (id) {
  4090. return !id || id.toLowerCase() === 'x' || id === '*'
  4091. }
  4092. // ~, ~> --> * (any, kinda silly)
  4093. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4094. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4095. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4096. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4097. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4098. function replaceTildes (comp, options) {
  4099. return comp.trim().split(/\s+/).map(function (comp) {
  4100. return replaceTilde(comp, options)
  4101. }).join(' ')
  4102. }
  4103. function replaceTilde (comp, options) {
  4104. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4105. return comp.replace(r, function (_, M, m, p, pr) {
  4106. debug('tilde', comp, _, M, m, p, pr)
  4107. var ret
  4108. if (isX(M)) {
  4109. ret = ''
  4110. } else if (isX(m)) {
  4111. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4112. } else if (isX(p)) {
  4113. // ~1.2 == >=1.2.0 <1.3.0
  4114. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4115. } else if (pr) {
  4116. debug('replaceTilde pr', pr)
  4117. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4118. ' <' + M + '.' + (+m + 1) + '.0'
  4119. } else {
  4120. // ~1.2.3 == >=1.2.3 <1.3.0
  4121. ret = '>=' + M + '.' + m + '.' + p +
  4122. ' <' + M + '.' + (+m + 1) + '.0'
  4123. }
  4124. debug('tilde return', ret)
  4125. return ret
  4126. })
  4127. }
  4128. // ^ --> * (any, kinda silly)
  4129. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4130. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4131. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4132. // ^1.2.3 --> >=1.2.3 <2.0.0
  4133. // ^1.2.0 --> >=1.2.0 <2.0.0
  4134. function replaceCarets (comp, options) {
  4135. return comp.trim().split(/\s+/).map(function (comp) {
  4136. return replaceCaret(comp, options)
  4137. }).join(' ')
  4138. }
  4139. function replaceCaret (comp, options) {
  4140. debug('caret', comp, options)
  4141. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4142. return comp.replace(r, function (_, M, m, p, pr) {
  4143. debug('caret', comp, _, M, m, p, pr)
  4144. var ret
  4145. if (isX(M)) {
  4146. ret = ''
  4147. } else if (isX(m)) {
  4148. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4149. } else if (isX(p)) {
  4150. if (M === '0') {
  4151. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4152. } else {
  4153. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4154. }
  4155. } else if (pr) {
  4156. debug('replaceCaret pr', pr)
  4157. if (M === '0') {
  4158. if (m === '0') {
  4159. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4160. ' <' + M + '.' + m + '.' + (+p + 1)
  4161. } else {
  4162. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4163. ' <' + M + '.' + (+m + 1) + '.0'
  4164. }
  4165. } else {
  4166. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4167. ' <' + (+M + 1) + '.0.0'
  4168. }
  4169. } else {
  4170. debug('no pr')
  4171. if (M === '0') {
  4172. if (m === '0') {
  4173. ret = '>=' + M + '.' + m + '.' + p +
  4174. ' <' + M + '.' + m + '.' + (+p + 1)
  4175. } else {
  4176. ret = '>=' + M + '.' + m + '.' + p +
  4177. ' <' + M + '.' + (+m + 1) + '.0'
  4178. }
  4179. } else {
  4180. ret = '>=' + M + '.' + m + '.' + p +
  4181. ' <' + (+M + 1) + '.0.0'
  4182. }
  4183. }
  4184. debug('caret return', ret)
  4185. return ret
  4186. })
  4187. }
  4188. function replaceXRanges (comp, options) {
  4189. debug('replaceXRanges', comp, options)
  4190. return comp.split(/\s+/).map(function (comp) {
  4191. return replaceXRange(comp, options)
  4192. }).join(' ')
  4193. }
  4194. function replaceXRange (comp, options) {
  4195. comp = comp.trim()
  4196. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4197. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4198. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4199. var xM = isX(M)
  4200. var xm = xM || isX(m)
  4201. var xp = xm || isX(p)
  4202. var anyX = xp
  4203. if (gtlt === '=' && anyX) {
  4204. gtlt = ''
  4205. }
  4206. if (xM) {
  4207. if (gtlt === '>' || gtlt === '<') {
  4208. // nothing is allowed
  4209. ret = '<0.0.0'
  4210. } else {
  4211. // nothing is forbidden
  4212. ret = '*'
  4213. }
  4214. } else if (gtlt && anyX) {
  4215. // we know patch is an x, because we have any x at all.
  4216. // replace X with 0
  4217. if (xm) {
  4218. m = 0
  4219. }
  4220. p = 0
  4221. if (gtlt === '>') {
  4222. // >1 => >=2.0.0
  4223. // >1.2 => >=1.3.0
  4224. // >1.2.3 => >= 1.2.4
  4225. gtlt = '>='
  4226. if (xm) {
  4227. M = +M + 1
  4228. m = 0
  4229. p = 0
  4230. } else {
  4231. m = +m + 1
  4232. p = 0
  4233. }
  4234. } else if (gtlt === '<=') {
  4235. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4236. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4237. gtlt = '<'
  4238. if (xm) {
  4239. M = +M + 1
  4240. } else {
  4241. m = +m + 1
  4242. }
  4243. }
  4244. ret = gtlt + M + '.' + m + '.' + p
  4245. } else if (xm) {
  4246. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4247. } else if (xp) {
  4248. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4249. }
  4250. debug('xRange return', ret)
  4251. return ret
  4252. })
  4253. }
  4254. // Because * is AND-ed with everything else in the comparator,
  4255. // and '' means "any version", just remove the *s entirely.
  4256. function replaceStars (comp, options) {
  4257. debug('replaceStars', comp, options)
  4258. // Looseness is ignored here. star is always as loose as it gets!
  4259. return comp.trim().replace(re[STAR], '')
  4260. }
  4261. // This function is passed to string.replace(re[HYPHENRANGE])
  4262. // M, m, patch, prerelease, build
  4263. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4264. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4265. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4266. function hyphenReplace ($0,
  4267. from, fM, fm, fp, fpr, fb,
  4268. to, tM, tm, tp, tpr, tb) {
  4269. if (isX(fM)) {
  4270. from = ''
  4271. } else if (isX(fm)) {
  4272. from = '>=' + fM + '.0.0'
  4273. } else if (isX(fp)) {
  4274. from = '>=' + fM + '.' + fm + '.0'
  4275. } else {
  4276. from = '>=' + from
  4277. }
  4278. if (isX(tM)) {
  4279. to = ''
  4280. } else if (isX(tm)) {
  4281. to = '<' + (+tM + 1) + '.0.0'
  4282. } else if (isX(tp)) {
  4283. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4284. } else if (tpr) {
  4285. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4286. } else {
  4287. to = '<=' + to
  4288. }
  4289. return (from + ' ' + to).trim()
  4290. }
  4291. // if ANY of the sets match ALL of its comparators, then pass
  4292. Range.prototype.test = function (version) {
  4293. if (!version) {
  4294. return false
  4295. }
  4296. if (typeof version === 'string') {
  4297. version = new SemVer(version, this.options)
  4298. }
  4299. for (var i = 0; i < this.set.length; i++) {
  4300. if (testSet(this.set[i], version, this.options)) {
  4301. return true
  4302. }
  4303. }
  4304. return false
  4305. }
  4306. function testSet (set, version, options) {
  4307. for (var i = 0; i < set.length; i++) {
  4308. if (!set[i].test(version)) {
  4309. return false
  4310. }
  4311. }
  4312. if (version.prerelease.length && !options.includePrerelease) {
  4313. // Find the set of versions that are allowed to have prereleases
  4314. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4315. // That should allow `1.2.3-pr.2` to pass.
  4316. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4317. // even though it's within the range set by the comparators.
  4318. for (i = 0; i < set.length; i++) {
  4319. debug(set[i].semver)
  4320. if (set[i].semver === ANY) {
  4321. continue
  4322. }
  4323. if (set[i].semver.prerelease.length > 0) {
  4324. var allowed = set[i].semver
  4325. if (allowed.major === version.major &&
  4326. allowed.minor === version.minor &&
  4327. allowed.patch === version.patch) {
  4328. return true
  4329. }
  4330. }
  4331. }
  4332. // Version has a -pre, but it's not one of the ones we like.
  4333. return false
  4334. }
  4335. return true
  4336. }
  4337. exports.satisfies = satisfies
  4338. function satisfies (version, range, options) {
  4339. try {
  4340. range = new Range(range, options)
  4341. } catch (er) {
  4342. return false
  4343. }
  4344. return range.test(version)
  4345. }
  4346. exports.maxSatisfying = maxSatisfying
  4347. function maxSatisfying (versions, range, options) {
  4348. var max = null
  4349. var maxSV = null
  4350. try {
  4351. var rangeObj = new Range(range, options)
  4352. } catch (er) {
  4353. return null
  4354. }
  4355. versions.forEach(function (v) {
  4356. if (rangeObj.test(v)) {
  4357. // satisfies(v, range, options)
  4358. if (!max || maxSV.compare(v) === -1) {
  4359. // compare(max, v, true)
  4360. max = v
  4361. maxSV = new SemVer(max, options)
  4362. }
  4363. }
  4364. })
  4365. return max
  4366. }
  4367. exports.minSatisfying = minSatisfying
  4368. function minSatisfying (versions, range, options) {
  4369. var min = null
  4370. var minSV = null
  4371. try {
  4372. var rangeObj = new Range(range, options)
  4373. } catch (er) {
  4374. return null
  4375. }
  4376. versions.forEach(function (v) {
  4377. if (rangeObj.test(v)) {
  4378. // satisfies(v, range, options)
  4379. if (!min || minSV.compare(v) === 1) {
  4380. // compare(min, v, true)
  4381. min = v
  4382. minSV = new SemVer(min, options)
  4383. }
  4384. }
  4385. })
  4386. return min
  4387. }
  4388. exports.minVersion = minVersion
  4389. function minVersion (range, loose) {
  4390. range = new Range(range, loose)
  4391. var minver = new SemVer('0.0.0')
  4392. if (range.test(minver)) {
  4393. return minver
  4394. }
  4395. minver = new SemVer('0.0.0-0')
  4396. if (range.test(minver)) {
  4397. return minver
  4398. }
  4399. minver = null
  4400. for (var i = 0; i < range.set.length; ++i) {
  4401. var comparators = range.set[i]
  4402. comparators.forEach(function (comparator) {
  4403. // Clone to avoid manipulating the comparator's semver object.
  4404. var compver = new SemVer(comparator.semver.version)
  4405. switch (comparator.operator) {
  4406. case '>':
  4407. if (compver.prerelease.length === 0) {
  4408. compver.patch++
  4409. } else {
  4410. compver.prerelease.push(0)
  4411. }
  4412. compver.raw = compver.format()
  4413. /* fallthrough */
  4414. case '':
  4415. case '>=':
  4416. if (!minver || gt(minver, compver)) {
  4417. minver = compver
  4418. }
  4419. break
  4420. case '<':
  4421. case '<=':
  4422. /* Ignore maximum versions */
  4423. break
  4424. /* istanbul ignore next */
  4425. default:
  4426. throw new Error('Unexpected operation: ' + comparator.operator)
  4427. }
  4428. })
  4429. }
  4430. if (minver && range.test(minver)) {
  4431. return minver
  4432. }
  4433. return null
  4434. }
  4435. exports.validRange = validRange
  4436. function validRange (range, options) {
  4437. try {
  4438. // Return '*' instead of '' so that truthiness works.
  4439. // This will throw if it's invalid anyway
  4440. return new Range(range, options).range || '*'
  4441. } catch (er) {
  4442. return null
  4443. }
  4444. }
  4445. // Determine if version is less than all the versions possible in the range
  4446. exports.ltr = ltr
  4447. function ltr (version, range, options) {
  4448. return outside(version, range, '<', options)
  4449. }
  4450. // Determine if version is greater than all the versions possible in the range.
  4451. exports.gtr = gtr
  4452. function gtr (version, range, options) {
  4453. return outside(version, range, '>', options)
  4454. }
  4455. exports.outside = outside
  4456. function outside (version, range, hilo, options) {
  4457. version = new SemVer(version, options)
  4458. range = new Range(range, options)
  4459. var gtfn, ltefn, ltfn, comp, ecomp
  4460. switch (hilo) {
  4461. case '>':
  4462. gtfn = gt
  4463. ltefn = lte
  4464. ltfn = lt
  4465. comp = '>'
  4466. ecomp = '>='
  4467. break
  4468. case '<':
  4469. gtfn = lt
  4470. ltefn = gte
  4471. ltfn = gt
  4472. comp = '<'
  4473. ecomp = '<='
  4474. break
  4475. default:
  4476. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4477. }
  4478. // If it satisifes the range it is not outside
  4479. if (satisfies(version, range, options)) {
  4480. return false
  4481. }
  4482. // From now on, variable terms are as if we're in "gtr" mode.
  4483. // but note that everything is flipped for the "ltr" function.
  4484. for (var i = 0; i < range.set.length; ++i) {
  4485. var comparators = range.set[i]
  4486. var high = null
  4487. var low = null
  4488. comparators.forEach(function (comparator) {
  4489. if (comparator.semver === ANY) {
  4490. comparator = new Comparator('>=0.0.0')
  4491. }
  4492. high = high || comparator
  4493. low = low || comparator
  4494. if (gtfn(comparator.semver, high.semver, options)) {
  4495. high = comparator
  4496. } else if (ltfn(comparator.semver, low.semver, options)) {
  4497. low = comparator
  4498. }
  4499. })
  4500. // If the edge version comparator has a operator then our version
  4501. // isn't outside it
  4502. if (high.operator === comp || high.operator === ecomp) {
  4503. return false
  4504. }
  4505. // If the lowest version comparator has an operator and our version
  4506. // is less than it then it isn't higher than the range
  4507. if ((!low.operator || low.operator === comp) &&
  4508. ltefn(version, low.semver)) {
  4509. return false
  4510. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4511. return false
  4512. }
  4513. }
  4514. return true
  4515. }
  4516. exports.prerelease = prerelease
  4517. function prerelease (version, options) {
  4518. var parsed = parse(version, options)
  4519. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4520. }
  4521. exports.intersects = intersects
  4522. function intersects (r1, r2, options) {
  4523. r1 = new Range(r1, options)
  4524. r2 = new Range(r2, options)
  4525. return r1.intersects(r2)
  4526. }
  4527. exports.coerce = coerce
  4528. function coerce (version) {
  4529. if (version instanceof SemVer) {
  4530. return version
  4531. }
  4532. if (typeof version !== 'string') {
  4533. return null
  4534. }
  4535. var match = version.match(re[COERCE])
  4536. if (match == null) {
  4537. return null
  4538. }
  4539. return parse(match[1] +
  4540. '.' + (match[2] || '0') +
  4541. '.' + (match[3] || '0'))
  4542. }
  4543. /***/ }),
  4544. /***/ 287:
  4545. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4546. "use strict";
  4547. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4548. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4549. return new (P || (P = Promise))(function (resolve, reject) {
  4550. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4551. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4552. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4553. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4554. });
  4555. };
  4556. var __importStar = (this && this.__importStar) || function (mod) {
  4557. if (mod && mod.__esModule) return mod;
  4558. var result = {};
  4559. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4560. result["default"] = mod;
  4561. return result;
  4562. };
  4563. var __importDefault = (this && this.__importDefault) || function (mod) {
  4564. return (mod && mod.__esModule) ? mod : { "default": mod };
  4565. };
  4566. Object.defineProperty(exports, "__esModule", { value: true });
  4567. const assert = __importStar(__webpack_require__(357));
  4568. const core = __importStar(__webpack_require__(470));
  4569. const exec = __importStar(__webpack_require__(986));
  4570. const fs = __importStar(__webpack_require__(747));
  4571. const io = __importStar(__webpack_require__(1));
  4572. const os = __importStar(__webpack_require__(87));
  4573. const path = __importStar(__webpack_require__(622));
  4574. const regexpHelper = __importStar(__webpack_require__(528));
  4575. const stateHelper = __importStar(__webpack_require__(153));
  4576. const urlHelper = __importStar(__webpack_require__(81));
  4577. const v4_1 = __importDefault(__webpack_require__(826));
  4578. const IS_WINDOWS = process.platform === 'win32';
  4579. const SSH_COMMAND_KEY = 'core.sshCommand';
  4580. function createAuthHelper(git, settings) {
  4581. return new GitAuthHelper(git, settings);
  4582. }
  4583. exports.createAuthHelper = createAuthHelper;
  4584. class GitAuthHelper {
  4585. constructor(gitCommandManager, gitSourceSettings) {
  4586. this.sshCommand = '';
  4587. this.sshKeyPath = '';
  4588. this.sshKnownHostsPath = '';
  4589. this.temporaryHomePath = '';
  4590. this.git = gitCommandManager;
  4591. this.settings = gitSourceSettings || {};
  4592. // Token auth header
  4593. const serverUrl = urlHelper.getServerUrl();
  4594. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4595. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4596. core.setSecret(basicCredential);
  4597. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4598. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4599. // Instead of SSH URL
  4600. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4601. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4602. }
  4603. configureAuth() {
  4604. return __awaiter(this, void 0, void 0, function* () {
  4605. // Remove possible previous values
  4606. yield this.removeAuth();
  4607. // Configure new values
  4608. yield this.configureSsh();
  4609. yield this.configureToken();
  4610. });
  4611. }
  4612. configureGlobalAuth() {
  4613. return __awaiter(this, void 0, void 0, function* () {
  4614. // Create a temp home directory
  4615. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4616. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4617. const uniqueId = v4_1.default();
  4618. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4619. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4620. // Copy the global git config
  4621. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4622. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4623. let configExists = false;
  4624. try {
  4625. yield fs.promises.stat(gitConfigPath);
  4626. configExists = true;
  4627. }
  4628. catch (err) {
  4629. if (err.code !== 'ENOENT') {
  4630. throw err;
  4631. }
  4632. }
  4633. if (configExists) {
  4634. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4635. yield io.cp(gitConfigPath, newGitConfigPath);
  4636. }
  4637. else {
  4638. yield fs.promises.writeFile(newGitConfigPath, '');
  4639. }
  4640. try {
  4641. // Override HOME
  4642. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4643. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4644. // Configure the token
  4645. yield this.configureToken(newGitConfigPath, true);
  4646. // Configure HTTPS instead of SSH
  4647. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4648. if (!this.settings.sshKey) {
  4649. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4650. }
  4651. }
  4652. catch (err) {
  4653. // Unset in case somehow written to the real global config
  4654. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4655. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4656. throw err;
  4657. }
  4658. });
  4659. }
  4660. configureSubmoduleAuth() {
  4661. return __awaiter(this, void 0, void 0, function* () {
  4662. // Remove possible previous HTTPS instead of SSH
  4663. yield this.removeGitConfig(this.insteadOfKey, true);
  4664. if (this.settings.persistCredentials) {
  4665. // Configure a placeholder value. This approach avoids the credential being captured
  4666. // by process creation audit events, which are commonly logged. For more information,
  4667. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4668. 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);
  4669. // Replace the placeholder
  4670. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4671. for (const configPath of configPaths) {
  4672. core.debug(`Replacing token placeholder in '${configPath}'`);
  4673. this.replaceTokenPlaceholder(configPath);
  4674. }
  4675. if (this.settings.sshKey) {
  4676. // Configure core.sshCommand
  4677. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4678. }
  4679. else {
  4680. // Configure HTTPS instead of SSH
  4681. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4682. }
  4683. }
  4684. });
  4685. }
  4686. removeAuth() {
  4687. return __awaiter(this, void 0, void 0, function* () {
  4688. yield this.removeSsh();
  4689. yield this.removeToken();
  4690. });
  4691. }
  4692. removeGlobalAuth() {
  4693. return __awaiter(this, void 0, void 0, function* () {
  4694. core.debug(`Unsetting HOME override`);
  4695. this.git.removeEnvironmentVariable('HOME');
  4696. yield io.rmRF(this.temporaryHomePath);
  4697. });
  4698. }
  4699. configureSsh() {
  4700. return __awaiter(this, void 0, void 0, function* () {
  4701. if (!this.settings.sshKey) {
  4702. return;
  4703. }
  4704. // Write key
  4705. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4706. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4707. const uniqueId = v4_1.default();
  4708. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4709. stateHelper.setSshKeyPath(this.sshKeyPath);
  4710. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4711. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4712. // Remove inherited permissions on Windows
  4713. if (IS_WINDOWS) {
  4714. const icacls = yield io.which('icacls.exe');
  4715. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4716. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4717. }
  4718. // Write known hosts
  4719. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4720. let userKnownHosts = '';
  4721. try {
  4722. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4723. }
  4724. catch (err) {
  4725. if (err.code !== 'ENOENT') {
  4726. throw err;
  4727. }
  4728. }
  4729. let knownHosts = '';
  4730. if (userKnownHosts) {
  4731. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4732. }
  4733. if (this.settings.sshKnownHosts) {
  4734. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4735. }
  4736. 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`;
  4737. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4738. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4739. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4740. // Configure GIT_SSH_COMMAND
  4741. const sshPath = yield io.which('ssh', true);
  4742. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4743. if (this.settings.sshStrict) {
  4744. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4745. }
  4746. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4747. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4748. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4749. // Configure core.sshCommand
  4750. if (this.settings.persistCredentials) {
  4751. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4752. }
  4753. });
  4754. }
  4755. configureToken(configPath, globalConfig) {
  4756. return __awaiter(this, void 0, void 0, function* () {
  4757. // Validate args
  4758. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4759. // Default config path
  4760. if (!configPath && !globalConfig) {
  4761. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4762. }
  4763. // Configure a placeholder value. This approach avoids the credential being captured
  4764. // by process creation audit events, which are commonly logged. For more information,
  4765. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4766. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4767. // Replace the placeholder
  4768. yield this.replaceTokenPlaceholder(configPath || '');
  4769. });
  4770. }
  4771. replaceTokenPlaceholder(configPath) {
  4772. return __awaiter(this, void 0, void 0, function* () {
  4773. assert.ok(configPath, 'configPath is not defined');
  4774. let content = (yield fs.promises.readFile(configPath)).toString();
  4775. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4776. if (placeholderIndex < 0 ||
  4777. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4778. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4779. }
  4780. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4781. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4782. yield fs.promises.writeFile(configPath, content);
  4783. });
  4784. }
  4785. removeSsh() {
  4786. return __awaiter(this, void 0, void 0, function* () {
  4787. // SSH key
  4788. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4789. if (keyPath) {
  4790. try {
  4791. yield io.rmRF(keyPath);
  4792. }
  4793. catch (err) {
  4794. core.debug(err.message);
  4795. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4796. }
  4797. }
  4798. // SSH known hosts
  4799. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4800. if (knownHostsPath) {
  4801. try {
  4802. yield io.rmRF(knownHostsPath);
  4803. }
  4804. catch (_a) {
  4805. // Intentionally empty
  4806. }
  4807. }
  4808. // SSH command
  4809. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4810. });
  4811. }
  4812. removeToken() {
  4813. return __awaiter(this, void 0, void 0, function* () {
  4814. // HTTP extra header
  4815. yield this.removeGitConfig(this.tokenConfigKey);
  4816. });
  4817. }
  4818. removeGitConfig(configKey, submoduleOnly = false) {
  4819. return __awaiter(this, void 0, void 0, function* () {
  4820. if (!submoduleOnly) {
  4821. if ((yield this.git.configExists(configKey)) &&
  4822. !(yield this.git.tryConfigUnset(configKey))) {
  4823. // Load the config contents
  4824. core.warning(`Failed to remove '${configKey}' from the git config`);
  4825. }
  4826. }
  4827. const pattern = regexpHelper.escape(configKey);
  4828. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4829. });
  4830. }
  4831. }
  4832. /***/ }),
  4833. /***/ 289:
  4834. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4835. "use strict";
  4836. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4837. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4838. return new (P || (P = Promise))(function (resolve, reject) {
  4839. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4840. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4841. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4842. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4843. });
  4844. };
  4845. var __importStar = (this && this.__importStar) || function (mod) {
  4846. if (mod && mod.__esModule) return mod;
  4847. var result = {};
  4848. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4849. result["default"] = mod;
  4850. return result;
  4851. };
  4852. Object.defineProperty(exports, "__esModule", { value: true });
  4853. const core = __importStar(__webpack_require__(470));
  4854. const exec = __importStar(__webpack_require__(986));
  4855. const fshelper = __importStar(__webpack_require__(618));
  4856. const io = __importStar(__webpack_require__(1));
  4857. const path = __importStar(__webpack_require__(622));
  4858. const regexpHelper = __importStar(__webpack_require__(528));
  4859. const retryHelper = __importStar(__webpack_require__(587));
  4860. const git_version_1 = __webpack_require__(559);
  4861. // Auth header not supported before 2.9
  4862. // Wire protocol v2 not supported before 2.18
  4863. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4864. function createCommandManager(workingDirectory, lfs) {
  4865. return __awaiter(this, void 0, void 0, function* () {
  4866. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4867. });
  4868. }
  4869. exports.createCommandManager = createCommandManager;
  4870. class GitCommandManager {
  4871. // Private constructor; use createCommandManager()
  4872. constructor() {
  4873. this.gitEnv = {
  4874. GIT_TERMINAL_PROMPT: '0',
  4875. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4876. };
  4877. this.gitPath = '';
  4878. this.lfs = false;
  4879. this.workingDirectory = '';
  4880. }
  4881. branchDelete(remote, branch) {
  4882. return __awaiter(this, void 0, void 0, function* () {
  4883. const args = ['branch', '--delete', '--force'];
  4884. if (remote) {
  4885. args.push('--remote');
  4886. }
  4887. args.push(branch);
  4888. yield this.execGit(args);
  4889. });
  4890. }
  4891. branchExists(remote, pattern) {
  4892. return __awaiter(this, void 0, void 0, function* () {
  4893. const args = ['branch', '--list'];
  4894. if (remote) {
  4895. args.push('--remote');
  4896. }
  4897. args.push(pattern);
  4898. const output = yield this.execGit(args);
  4899. return !!output.stdout.trim();
  4900. });
  4901. }
  4902. branchList(remote) {
  4903. return __awaiter(this, void 0, void 0, function* () {
  4904. const result = [];
  4905. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4906. // "branch --list" is more difficult when in a detached HEAD state.
  4907. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4908. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4909. const args = ['rev-parse', '--symbolic-full-name'];
  4910. if (remote) {
  4911. args.push('--remotes=origin');
  4912. }
  4913. else {
  4914. args.push('--branches');
  4915. }
  4916. const output = yield this.execGit(args);
  4917. for (let branch of output.stdout.trim().split('\n')) {
  4918. branch = branch.trim();
  4919. if (branch) {
  4920. if (branch.startsWith('refs/heads/')) {
  4921. branch = branch.substr('refs/heads/'.length);
  4922. }
  4923. else if (branch.startsWith('refs/remotes/')) {
  4924. branch = branch.substr('refs/remotes/'.length);
  4925. }
  4926. result.push(branch);
  4927. }
  4928. }
  4929. return result;
  4930. });
  4931. }
  4932. checkout(ref, startPoint) {
  4933. return __awaiter(this, void 0, void 0, function* () {
  4934. const args = ['checkout', '--progress', '--force'];
  4935. if (startPoint) {
  4936. args.push('-B', ref, startPoint);
  4937. }
  4938. else {
  4939. args.push(ref);
  4940. }
  4941. yield this.execGit(args);
  4942. });
  4943. }
  4944. checkoutDetach() {
  4945. return __awaiter(this, void 0, void 0, function* () {
  4946. const args = ['checkout', '--detach'];
  4947. yield this.execGit(args);
  4948. });
  4949. }
  4950. config(configKey, configValue, globalConfig) {
  4951. return __awaiter(this, void 0, void 0, function* () {
  4952. yield this.execGit([
  4953. 'config',
  4954. globalConfig ? '--global' : '--local',
  4955. configKey,
  4956. configValue
  4957. ]);
  4958. });
  4959. }
  4960. configExists(configKey, globalConfig) {
  4961. return __awaiter(this, void 0, void 0, function* () {
  4962. const pattern = regexpHelper.escape(configKey);
  4963. const output = yield this.execGit([
  4964. 'config',
  4965. globalConfig ? '--global' : '--local',
  4966. '--name-only',
  4967. '--get-regexp',
  4968. pattern
  4969. ], true);
  4970. return output.exitCode === 0;
  4971. });
  4972. }
  4973. fetch(fetchDepth, refSpec) {
  4974. return __awaiter(this, void 0, void 0, function* () {
  4975. const args = [
  4976. '-c',
  4977. 'protocol.version=2',
  4978. 'fetch',
  4979. '--no-tags',
  4980. '--prune',
  4981. '--progress',
  4982. '--no-recurse-submodules'
  4983. ];
  4984. if (fetchDepth > 0) {
  4985. args.push(`--depth=${fetchDepth}`);
  4986. }
  4987. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4988. args.push('--unshallow');
  4989. }
  4990. args.push('origin');
  4991. for (const arg of refSpec) {
  4992. args.push(arg);
  4993. }
  4994. const that = this;
  4995. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4996. yield that.execGit(args);
  4997. }));
  4998. });
  4999. }
  5000. getWorkingDirectory() {
  5001. return this.workingDirectory;
  5002. }
  5003. init() {
  5004. return __awaiter(this, void 0, void 0, function* () {
  5005. yield this.execGit(['init', this.workingDirectory]);
  5006. });
  5007. }
  5008. isDetached() {
  5009. return __awaiter(this, void 0, void 0, function* () {
  5010. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5011. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5012. return !output.stdout.trim().startsWith('refs/heads/');
  5013. });
  5014. }
  5015. lfsFetch(ref) {
  5016. return __awaiter(this, void 0, void 0, function* () {
  5017. const args = ['lfs', 'fetch', 'origin', ref];
  5018. const that = this;
  5019. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5020. yield that.execGit(args);
  5021. }));
  5022. });
  5023. }
  5024. lfsInstall() {
  5025. return __awaiter(this, void 0, void 0, function* () {
  5026. yield this.execGit(['lfs', 'install', '--local']);
  5027. });
  5028. }
  5029. log1() {
  5030. return __awaiter(this, void 0, void 0, function* () {
  5031. yield this.execGit(['log', '-1']);
  5032. });
  5033. }
  5034. remoteAdd(remoteName, remoteUrl) {
  5035. return __awaiter(this, void 0, void 0, function* () {
  5036. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5037. });
  5038. }
  5039. removeEnvironmentVariable(name) {
  5040. delete this.gitEnv[name];
  5041. }
  5042. setEnvironmentVariable(name, value) {
  5043. this.gitEnv[name] = value;
  5044. }
  5045. submoduleForeach(command, recursive) {
  5046. return __awaiter(this, void 0, void 0, function* () {
  5047. const args = ['submodule', 'foreach'];
  5048. if (recursive) {
  5049. args.push('--recursive');
  5050. }
  5051. args.push(command);
  5052. const output = yield this.execGit(args);
  5053. return output.stdout;
  5054. });
  5055. }
  5056. submoduleSync(recursive) {
  5057. return __awaiter(this, void 0, void 0, function* () {
  5058. const args = ['submodule', 'sync'];
  5059. if (recursive) {
  5060. args.push('--recursive');
  5061. }
  5062. yield this.execGit(args);
  5063. });
  5064. }
  5065. submoduleUpdate(fetchDepth, recursive) {
  5066. return __awaiter(this, void 0, void 0, function* () {
  5067. const args = ['-c', 'protocol.version=2'];
  5068. args.push('submodule', 'update', '--init', '--force');
  5069. if (fetchDepth > 0) {
  5070. args.push(`--depth=${fetchDepth}`);
  5071. }
  5072. if (recursive) {
  5073. args.push('--recursive');
  5074. }
  5075. yield this.execGit(args);
  5076. });
  5077. }
  5078. tagExists(pattern) {
  5079. return __awaiter(this, void 0, void 0, function* () {
  5080. const output = yield this.execGit(['tag', '--list', pattern]);
  5081. return !!output.stdout.trim();
  5082. });
  5083. }
  5084. tryClean() {
  5085. return __awaiter(this, void 0, void 0, function* () {
  5086. const output = yield this.execGit(['clean', '-ffdx'], true);
  5087. return output.exitCode === 0;
  5088. });
  5089. }
  5090. tryConfigUnset(configKey, globalConfig) {
  5091. return __awaiter(this, void 0, void 0, function* () {
  5092. const output = yield this.execGit([
  5093. 'config',
  5094. globalConfig ? '--global' : '--local',
  5095. '--unset-all',
  5096. configKey
  5097. ], true);
  5098. return output.exitCode === 0;
  5099. });
  5100. }
  5101. tryDisableAutomaticGarbageCollection() {
  5102. return __awaiter(this, void 0, void 0, function* () {
  5103. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5104. return output.exitCode === 0;
  5105. });
  5106. }
  5107. tryGetFetchUrl() {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5110. if (output.exitCode !== 0) {
  5111. return '';
  5112. }
  5113. const stdout = output.stdout.trim();
  5114. if (stdout.includes('\n')) {
  5115. return '';
  5116. }
  5117. return stdout;
  5118. });
  5119. }
  5120. tryReset() {
  5121. return __awaiter(this, void 0, void 0, function* () {
  5122. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5123. return output.exitCode === 0;
  5124. });
  5125. }
  5126. static createCommandManager(workingDirectory, lfs) {
  5127. return __awaiter(this, void 0, void 0, function* () {
  5128. const result = new GitCommandManager();
  5129. yield result.initializeCommandManager(workingDirectory, lfs);
  5130. return result;
  5131. });
  5132. }
  5133. execGit(args, allowAllExitCodes = false) {
  5134. return __awaiter(this, void 0, void 0, function* () {
  5135. fshelper.directoryExistsSync(this.workingDirectory, true);
  5136. const result = new GitOutput();
  5137. const env = {};
  5138. for (const key of Object.keys(process.env)) {
  5139. env[key] = process.env[key];
  5140. }
  5141. for (const key of Object.keys(this.gitEnv)) {
  5142. env[key] = this.gitEnv[key];
  5143. }
  5144. const stdout = [];
  5145. const options = {
  5146. cwd: this.workingDirectory,
  5147. env,
  5148. ignoreReturnCode: allowAllExitCodes,
  5149. listeners: {
  5150. stdout: (data) => {
  5151. stdout.push(data.toString());
  5152. }
  5153. }
  5154. };
  5155. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5156. result.stdout = stdout.join('');
  5157. return result;
  5158. });
  5159. }
  5160. initializeCommandManager(workingDirectory, lfs) {
  5161. return __awaiter(this, void 0, void 0, function* () {
  5162. this.workingDirectory = workingDirectory;
  5163. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5164. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5165. this.lfs = lfs;
  5166. if (!this.lfs) {
  5167. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5168. }
  5169. this.gitPath = yield io.which('git', true);
  5170. // Git version
  5171. core.debug('Getting git version');
  5172. let gitVersion = new git_version_1.GitVersion();
  5173. let gitOutput = yield this.execGit(['version']);
  5174. let stdout = gitOutput.stdout.trim();
  5175. if (!stdout.includes('\n')) {
  5176. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5177. if (match) {
  5178. gitVersion = new git_version_1.GitVersion(match[0]);
  5179. }
  5180. }
  5181. if (!gitVersion.isValid()) {
  5182. throw new Error('Unable to determine git version');
  5183. }
  5184. // Minimum git version
  5185. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5186. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5187. }
  5188. if (this.lfs) {
  5189. // Git-lfs version
  5190. core.debug('Getting git-lfs version');
  5191. let gitLfsVersion = new git_version_1.GitVersion();
  5192. const gitLfsPath = yield io.which('git-lfs', true);
  5193. gitOutput = yield this.execGit(['lfs', 'version']);
  5194. stdout = gitOutput.stdout.trim();
  5195. if (!stdout.includes('\n')) {
  5196. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5197. if (match) {
  5198. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5199. }
  5200. }
  5201. if (!gitLfsVersion.isValid()) {
  5202. throw new Error('Unable to determine git-lfs version');
  5203. }
  5204. // Minimum git-lfs version
  5205. // Note:
  5206. // - Auth header not supported before 2.1
  5207. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5208. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5209. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5210. }
  5211. }
  5212. // Set the user agent
  5213. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5214. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5215. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5216. });
  5217. }
  5218. }
  5219. class GitOutput {
  5220. constructor() {
  5221. this.stdout = '';
  5222. this.exitCode = 0;
  5223. }
  5224. }
  5225. /***/ }),
  5226. /***/ 293:
  5227. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5228. "use strict";
  5229. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5230. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5231. return new (P || (P = Promise))(function (resolve, reject) {
  5232. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5233. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5234. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5235. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5236. });
  5237. };
  5238. var __importStar = (this && this.__importStar) || function (mod) {
  5239. if (mod && mod.__esModule) return mod;
  5240. var result = {};
  5241. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5242. result["default"] = mod;
  5243. return result;
  5244. };
  5245. Object.defineProperty(exports, "__esModule", { value: true });
  5246. const core = __importStar(__webpack_require__(470));
  5247. const fsHelper = __importStar(__webpack_require__(618));
  5248. const gitAuthHelper = __importStar(__webpack_require__(287));
  5249. const gitCommandManager = __importStar(__webpack_require__(289));
  5250. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5251. const githubApiHelper = __importStar(__webpack_require__(464));
  5252. const io = __importStar(__webpack_require__(1));
  5253. const path = __importStar(__webpack_require__(622));
  5254. const refHelper = __importStar(__webpack_require__(227));
  5255. const stateHelper = __importStar(__webpack_require__(153));
  5256. const urlHelper = __importStar(__webpack_require__(81));
  5257. function getSource(settings) {
  5258. return __awaiter(this, void 0, void 0, function* () {
  5259. // Repository URL
  5260. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5261. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5262. // Remove conflicting file path
  5263. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5264. yield io.rmRF(settings.repositoryPath);
  5265. }
  5266. // Create directory
  5267. let isExisting = true;
  5268. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5269. isExisting = false;
  5270. yield io.mkdirP(settings.repositoryPath);
  5271. }
  5272. // Git command manager
  5273. core.startGroup('Getting Git version info');
  5274. const git = yield getGitCommandManager(settings);
  5275. core.endGroup();
  5276. // Prepare existing directory, otherwise recreate
  5277. if (isExisting) {
  5278. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5279. }
  5280. if (!git) {
  5281. // Downloading using REST API
  5282. core.info(`The repository will be downloaded using the GitHub REST API`);
  5283. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5284. if (settings.submodules) {
  5285. 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.`);
  5286. }
  5287. else if (settings.sshKey) {
  5288. 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.`);
  5289. }
  5290. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5291. return;
  5292. }
  5293. // Save state for POST action
  5294. stateHelper.setRepositoryPath(settings.repositoryPath);
  5295. // Initialize the repository
  5296. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5297. core.startGroup('Initializing the repository');
  5298. yield git.init();
  5299. yield git.remoteAdd('origin', repositoryUrl);
  5300. core.endGroup();
  5301. }
  5302. // Disable automatic garbage collection
  5303. core.startGroup('Disabling automatic garbage collection');
  5304. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5305. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5306. }
  5307. core.endGroup();
  5308. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5309. try {
  5310. // Configure auth
  5311. core.startGroup('Setting up auth');
  5312. yield authHelper.configureAuth();
  5313. core.endGroup();
  5314. // LFS install
  5315. if (settings.lfs) {
  5316. yield git.lfsInstall();
  5317. }
  5318. // Fetch
  5319. core.startGroup('Fetching the repository');
  5320. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5321. yield git.fetch(settings.fetchDepth, refSpec);
  5322. core.endGroup();
  5323. // Checkout info
  5324. core.startGroup('Determining the checkout info');
  5325. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5326. core.endGroup();
  5327. // LFS fetch
  5328. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5329. // Explicit lfs fetch will fetch lfs objects in parallel.
  5330. if (settings.lfs) {
  5331. core.startGroup('Fetching LFS objects');
  5332. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5333. core.endGroup();
  5334. }
  5335. // Checkout
  5336. core.startGroup('Checking out the ref');
  5337. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5338. core.endGroup();
  5339. // Submodules
  5340. if (settings.submodules) {
  5341. try {
  5342. // Temporarily override global config
  5343. core.startGroup('Setting up auth for fetching submodules');
  5344. yield authHelper.configureGlobalAuth();
  5345. core.endGroup();
  5346. // Checkout submodules
  5347. core.startGroup('Fetching submodules');
  5348. yield git.submoduleSync(settings.nestedSubmodules);
  5349. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5350. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5351. core.endGroup();
  5352. // Persist credentials
  5353. if (settings.persistCredentials) {
  5354. core.startGroup('Persisting credentials for submodules');
  5355. yield authHelper.configureSubmoduleAuth();
  5356. core.endGroup();
  5357. }
  5358. }
  5359. finally {
  5360. // Remove temporary global config override
  5361. yield authHelper.removeGlobalAuth();
  5362. }
  5363. }
  5364. // Dump some info about the checked out commit
  5365. yield git.log1();
  5366. }
  5367. finally {
  5368. // Remove auth
  5369. if (!settings.persistCredentials) {
  5370. core.startGroup('Removing auth');
  5371. yield authHelper.removeAuth();
  5372. core.endGroup();
  5373. }
  5374. }
  5375. });
  5376. }
  5377. exports.getSource = getSource;
  5378. function cleanup(repositoryPath) {
  5379. return __awaiter(this, void 0, void 0, function* () {
  5380. // Repo exists?
  5381. if (!repositoryPath ||
  5382. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5383. return;
  5384. }
  5385. let git;
  5386. try {
  5387. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5388. }
  5389. catch (_a) {
  5390. return;
  5391. }
  5392. // Remove auth
  5393. const authHelper = gitAuthHelper.createAuthHelper(git);
  5394. yield authHelper.removeAuth();
  5395. });
  5396. }
  5397. exports.cleanup = cleanup;
  5398. function getGitCommandManager(settings) {
  5399. return __awaiter(this, void 0, void 0, function* () {
  5400. core.info(`Working directory is '${settings.repositoryPath}'`);
  5401. try {
  5402. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5403. }
  5404. catch (err) {
  5405. // Git is required for LFS
  5406. if (settings.lfs) {
  5407. throw err;
  5408. }
  5409. // Otherwise fallback to REST API
  5410. return undefined;
  5411. }
  5412. });
  5413. }
  5414. /***/ }),
  5415. /***/ 294:
  5416. /***/ (function(module, __unusedexports, __webpack_require__) {
  5417. module.exports = parseOptions;
  5418. const { Deprecation } = __webpack_require__(692);
  5419. const { getUserAgent } = __webpack_require__(796);
  5420. const once = __webpack_require__(969);
  5421. const pkg = __webpack_require__(215);
  5422. const deprecateOptionsTimeout = once((log, deprecation) =>
  5423. log.warn(deprecation)
  5424. );
  5425. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5426. const deprecateOptionsHeaders = once((log, deprecation) =>
  5427. log.warn(deprecation)
  5428. );
  5429. function parseOptions(options, log, hook) {
  5430. if (options.headers) {
  5431. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5432. newObj[key.toLowerCase()] = options.headers[key];
  5433. return newObj;
  5434. }, {});
  5435. }
  5436. const clientDefaults = {
  5437. headers: options.headers || {},
  5438. request: options.request || {},
  5439. mediaType: {
  5440. previews: [],
  5441. format: ""
  5442. }
  5443. };
  5444. if (options.baseUrl) {
  5445. clientDefaults.baseUrl = options.baseUrl;
  5446. }
  5447. if (options.userAgent) {
  5448. clientDefaults.headers["user-agent"] = options.userAgent;
  5449. }
  5450. if (options.previews) {
  5451. clientDefaults.mediaType.previews = options.previews;
  5452. }
  5453. if (options.timeZone) {
  5454. clientDefaults.headers["time-zone"] = options.timeZone;
  5455. }
  5456. if (options.timeout) {
  5457. deprecateOptionsTimeout(
  5458. log,
  5459. new Deprecation(
  5460. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5461. )
  5462. );
  5463. clientDefaults.request.timeout = options.timeout;
  5464. }
  5465. if (options.agent) {
  5466. deprecateOptionsAgent(
  5467. log,
  5468. new Deprecation(
  5469. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5470. )
  5471. );
  5472. clientDefaults.request.agent = options.agent;
  5473. }
  5474. if (options.headers) {
  5475. deprecateOptionsHeaders(
  5476. log,
  5477. new Deprecation(
  5478. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5479. )
  5480. );
  5481. }
  5482. const userAgentOption = clientDefaults.headers["user-agent"];
  5483. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5484. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5485. .filter(Boolean)
  5486. .join(" ");
  5487. clientDefaults.request.hook = hook.bind(null, "request");
  5488. return clientDefaults;
  5489. }
  5490. /***/ }),
  5491. /***/ 297:
  5492. /***/ (function(module) {
  5493. module.exports = class HttpError extends Error {
  5494. constructor (message, code, headers) {
  5495. super(message)
  5496. // Maintains proper stack trace (only available on V8)
  5497. /* istanbul ignore next */
  5498. if (Error.captureStackTrace) {
  5499. Error.captureStackTrace(this, this.constructor)
  5500. }
  5501. this.name = 'HttpError'
  5502. this.code = code
  5503. this.headers = headers
  5504. }
  5505. }
  5506. /***/ }),
  5507. /***/ 299:
  5508. /***/ (function(__unusedmodule, exports) {
  5509. "use strict";
  5510. Object.defineProperty(exports, '__esModule', { value: true });
  5511. const VERSION = "1.1.2";
  5512. /**
  5513. * Some “list” response that can be paginated have a different response structure
  5514. *
  5515. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5516. * /installation/repositories also has `repository_selection`), as well as a key with
  5517. * the list of the items which name varies from endpoint to endpoint:
  5518. *
  5519. * - https://developer.github.com/v3/search/#example (key `items`)
  5520. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5521. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5522. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5523. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5524. *
  5525. * Octokit normalizes these responses so that paginated results are always returned following
  5526. * the same structure. One challenge is that if the list response has only one page, no Link
  5527. * header is provided, so this header alone is not sufficient to check wether a response is
  5528. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5529. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5530. * property because it also exists in the response of Get the combined status for a specific ref.
  5531. */
  5532. 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))?([^/]|$)/];
  5533. function normalizePaginatedListResponse(octokit, url, response) {
  5534. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5535. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5536. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5537. // to retrieve the same information.
  5538. const incompleteResults = response.data.incomplete_results;
  5539. const repositorySelection = response.data.repository_selection;
  5540. const totalCount = response.data.total_count;
  5541. delete response.data.incomplete_results;
  5542. delete response.data.repository_selection;
  5543. delete response.data.total_count;
  5544. const namespaceKey = Object.keys(response.data)[0];
  5545. const data = response.data[namespaceKey];
  5546. response.data = data;
  5547. if (typeof incompleteResults !== "undefined") {
  5548. response.data.incomplete_results = incompleteResults;
  5549. }
  5550. if (typeof repositorySelection !== "undefined") {
  5551. response.data.repository_selection = repositorySelection;
  5552. }
  5553. response.data.total_count = totalCount;
  5554. Object.defineProperty(response.data, namespaceKey, {
  5555. get() {
  5556. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5557. return Array.from(data);
  5558. }
  5559. });
  5560. }
  5561. function iterator(octokit, route, parameters) {
  5562. const options = octokit.request.endpoint(route, parameters);
  5563. const method = options.method;
  5564. const headers = options.headers;
  5565. let url = options.url;
  5566. return {
  5567. [Symbol.asyncIterator]: () => ({
  5568. next() {
  5569. if (!url) {
  5570. return Promise.resolve({
  5571. done: true
  5572. });
  5573. }
  5574. return octokit.request({
  5575. method,
  5576. url,
  5577. headers
  5578. }).then(response => {
  5579. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5580. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5581. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5582. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5583. return {
  5584. value: response
  5585. };
  5586. });
  5587. }
  5588. })
  5589. };
  5590. }
  5591. function paginate(octokit, route, parameters, mapFn) {
  5592. if (typeof parameters === "function") {
  5593. mapFn = parameters;
  5594. parameters = undefined;
  5595. }
  5596. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5597. }
  5598. function gather(octokit, results, iterator, mapFn) {
  5599. return iterator.next().then(result => {
  5600. if (result.done) {
  5601. return results;
  5602. }
  5603. let earlyExit = false;
  5604. function done() {
  5605. earlyExit = true;
  5606. }
  5607. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5608. if (earlyExit) {
  5609. return results;
  5610. }
  5611. return gather(octokit, results, iterator, mapFn);
  5612. });
  5613. }
  5614. /**
  5615. * @param octokit Octokit instance
  5616. * @param options Options passed to Octokit constructor
  5617. */
  5618. function paginateRest(octokit) {
  5619. return {
  5620. paginate: Object.assign(paginate.bind(null, octokit), {
  5621. iterator: iterator.bind(null, octokit)
  5622. })
  5623. };
  5624. }
  5625. paginateRest.VERSION = VERSION;
  5626. exports.paginateRest = paginateRest;
  5627. //# sourceMappingURL=index.js.map
  5628. /***/ }),
  5629. /***/ 323:
  5630. /***/ (function(module) {
  5631. "use strict";
  5632. var isStream = module.exports = function (stream) {
  5633. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5634. };
  5635. isStream.writable = function (stream) {
  5636. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5637. };
  5638. isStream.readable = function (stream) {
  5639. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5640. };
  5641. isStream.duplex = function (stream) {
  5642. return isStream.writable(stream) && isStream.readable(stream);
  5643. };
  5644. isStream.transform = function (stream) {
  5645. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5646. };
  5647. /***/ }),
  5648. /***/ 335:
  5649. /***/ (function(module, __unusedexports, __webpack_require__) {
  5650. module.exports = __webpack_require__(179);
  5651. /***/ }),
  5652. /***/ 336:
  5653. /***/ (function(module, __unusedexports, __webpack_require__) {
  5654. module.exports = hasLastPage
  5655. const deprecate = __webpack_require__(370)
  5656. const getPageLinks = __webpack_require__(577)
  5657. function hasLastPage (link) {
  5658. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5659. return getPageLinks(link).last
  5660. }
  5661. /***/ }),
  5662. /***/ 348:
  5663. /***/ (function(module, __unusedexports, __webpack_require__) {
  5664. "use strict";
  5665. module.exports = validate;
  5666. const { RequestError } = __webpack_require__(497);
  5667. const get = __webpack_require__(854);
  5668. const set = __webpack_require__(883);
  5669. function validate(octokit, options) {
  5670. if (!options.request.validate) {
  5671. return;
  5672. }
  5673. const { validate: params } = options.request;
  5674. Object.keys(params).forEach(parameterName => {
  5675. const parameter = get(params, parameterName);
  5676. const expectedType = parameter.type;
  5677. let parentParameterName;
  5678. let parentValue;
  5679. let parentParamIsPresent = true;
  5680. let parentParameterIsArray = false;
  5681. if (/\./.test(parameterName)) {
  5682. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5683. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5684. if (parentParameterIsArray) {
  5685. parentParameterName = parentParameterName.slice(0, -2);
  5686. }
  5687. parentValue = get(options, parentParameterName);
  5688. parentParamIsPresent =
  5689. parentParameterName === "headers" ||
  5690. (typeof parentValue === "object" && parentValue !== null);
  5691. }
  5692. const values = parentParameterIsArray
  5693. ? (get(options, parentParameterName) || []).map(
  5694. value => value[parameterName.split(/\./).pop()]
  5695. )
  5696. : [get(options, parameterName)];
  5697. values.forEach((value, i) => {
  5698. const valueIsPresent = typeof value !== "undefined";
  5699. const valueIsNull = value === null;
  5700. const currentParameterName = parentParameterIsArray
  5701. ? parameterName.replace(/\[\]/, `[${i}]`)
  5702. : parameterName;
  5703. if (!parameter.required && !valueIsPresent) {
  5704. return;
  5705. }
  5706. // if the parent parameter is of type object but allows null
  5707. // then the child parameters can be ignored
  5708. if (!parentParamIsPresent) {
  5709. return;
  5710. }
  5711. if (parameter.allowNull && valueIsNull) {
  5712. return;
  5713. }
  5714. if (!parameter.allowNull && valueIsNull) {
  5715. throw new RequestError(
  5716. `'${currentParameterName}' cannot be null`,
  5717. 400,
  5718. {
  5719. request: options
  5720. }
  5721. );
  5722. }
  5723. if (parameter.required && !valueIsPresent) {
  5724. throw new RequestError(
  5725. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5726. value
  5727. )}`,
  5728. 400,
  5729. {
  5730. request: options
  5731. }
  5732. );
  5733. }
  5734. // parse to integer before checking for enum
  5735. // so that string "1" will match enum with number 1
  5736. if (expectedType === "integer") {
  5737. const unparsedValue = value;
  5738. value = parseInt(value, 10);
  5739. if (isNaN(value)) {
  5740. throw new RequestError(
  5741. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5742. unparsedValue
  5743. )} is NaN`,
  5744. 400,
  5745. {
  5746. request: options
  5747. }
  5748. );
  5749. }
  5750. }
  5751. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5752. throw new RequestError(
  5753. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5754. value
  5755. )}`,
  5756. 400,
  5757. {
  5758. request: options
  5759. }
  5760. );
  5761. }
  5762. if (parameter.validation) {
  5763. const regex = new RegExp(parameter.validation);
  5764. if (!regex.test(value)) {
  5765. throw new RequestError(
  5766. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5767. value
  5768. )}`,
  5769. 400,
  5770. {
  5771. request: options
  5772. }
  5773. );
  5774. }
  5775. }
  5776. if (expectedType === "object" && typeof value === "string") {
  5777. try {
  5778. value = JSON.parse(value);
  5779. } catch (exception) {
  5780. throw new RequestError(
  5781. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5782. value
  5783. )}`,
  5784. 400,
  5785. {
  5786. request: options
  5787. }
  5788. );
  5789. }
  5790. }
  5791. set(options, parameter.mapTo || currentParameterName, value);
  5792. });
  5793. });
  5794. return options;
  5795. }
  5796. /***/ }),
  5797. /***/ 349:
  5798. /***/ (function(module, __unusedexports, __webpack_require__) {
  5799. module.exports = authenticationRequestError;
  5800. const { RequestError } = __webpack_require__(497);
  5801. function authenticationRequestError(state, error, options) {
  5802. /* istanbul ignore next */
  5803. if (!error.headers) throw error;
  5804. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5805. // handle "2FA required" error only
  5806. if (error.status !== 401 || !otpRequired) {
  5807. throw error;
  5808. }
  5809. if (
  5810. error.status === 401 &&
  5811. otpRequired &&
  5812. error.request &&
  5813. error.request.headers["x-github-otp"]
  5814. ) {
  5815. throw new RequestError(
  5816. "Invalid one-time password for two-factor authentication",
  5817. 401,
  5818. {
  5819. headers: error.headers,
  5820. request: options
  5821. }
  5822. );
  5823. }
  5824. if (typeof state.auth.on2fa !== "function") {
  5825. throw new RequestError(
  5826. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5827. 401,
  5828. {
  5829. headers: error.headers,
  5830. request: options
  5831. }
  5832. );
  5833. }
  5834. return Promise.resolve()
  5835. .then(() => {
  5836. return state.auth.on2fa();
  5837. })
  5838. .then(oneTimePassword => {
  5839. const newOptions = Object.assign(options, {
  5840. headers: Object.assign(
  5841. { "x-github-otp": oneTimePassword },
  5842. options.headers
  5843. )
  5844. });
  5845. return state.octokit.request(newOptions);
  5846. });
  5847. }
  5848. /***/ }),
  5849. /***/ 357:
  5850. /***/ (function(module) {
  5851. module.exports = require("assert");
  5852. /***/ }),
  5853. /***/ 363:
  5854. /***/ (function(module) {
  5855. module.exports = register
  5856. function register (state, name, method, options) {
  5857. if (typeof method !== 'function') {
  5858. throw new Error('method for before hook must be a function')
  5859. }
  5860. if (!options) {
  5861. options = {}
  5862. }
  5863. if (Array.isArray(name)) {
  5864. return name.reverse().reduce(function (callback, name) {
  5865. return register.bind(null, state, name, callback, options)
  5866. }, method)()
  5867. }
  5868. return Promise.resolve()
  5869. .then(function () {
  5870. if (!state.registry[name]) {
  5871. return method(options)
  5872. }
  5873. return (state.registry[name]).reduce(function (method, registered) {
  5874. return registered.hook.bind(null, method, options)
  5875. }, method)()
  5876. })
  5877. }
  5878. /***/ }),
  5879. /***/ 368:
  5880. /***/ (function(module) {
  5881. module.exports = function atob(str) {
  5882. return Buffer.from(str, 'base64').toString('binary')
  5883. }
  5884. /***/ }),
  5885. /***/ 370:
  5886. /***/ (function(module) {
  5887. module.exports = deprecate
  5888. const loggedMessages = {}
  5889. function deprecate (message) {
  5890. if (loggedMessages[message]) {
  5891. return
  5892. }
  5893. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5894. loggedMessages[message] = 1
  5895. }
  5896. /***/ }),
  5897. /***/ 385:
  5898. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5899. "use strict";
  5900. Object.defineProperty(exports, '__esModule', { value: true });
  5901. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5902. var isPlainObject = _interopDefault(__webpack_require__(696));
  5903. var universalUserAgent = __webpack_require__(562);
  5904. function lowercaseKeys(object) {
  5905. if (!object) {
  5906. return {};
  5907. }
  5908. return Object.keys(object).reduce((newObj, key) => {
  5909. newObj[key.toLowerCase()] = object[key];
  5910. return newObj;
  5911. }, {});
  5912. }
  5913. function mergeDeep(defaults, options) {
  5914. const result = Object.assign({}, defaults);
  5915. Object.keys(options).forEach(key => {
  5916. if (isPlainObject(options[key])) {
  5917. if (!(key in defaults)) Object.assign(result, {
  5918. [key]: options[key]
  5919. });else result[key] = mergeDeep(defaults[key], options[key]);
  5920. } else {
  5921. Object.assign(result, {
  5922. [key]: options[key]
  5923. });
  5924. }
  5925. });
  5926. return result;
  5927. }
  5928. function merge(defaults, route, options) {
  5929. if (typeof route === "string") {
  5930. let [method, url] = route.split(" ");
  5931. options = Object.assign(url ? {
  5932. method,
  5933. url
  5934. } : {
  5935. url: method
  5936. }, options);
  5937. } else {
  5938. options = Object.assign({}, route);
  5939. } // lowercase header names before merging with defaults to avoid duplicates
  5940. options.headers = lowercaseKeys(options.headers);
  5941. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5942. if (defaults && defaults.mediaType.previews.length) {
  5943. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5944. }
  5945. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5946. return mergedOptions;
  5947. }
  5948. function addQueryParameters(url, parameters) {
  5949. const separator = /\?/.test(url) ? "&" : "?";
  5950. const names = Object.keys(parameters);
  5951. if (names.length === 0) {
  5952. return url;
  5953. }
  5954. return url + separator + names.map(name => {
  5955. if (name === "q") {
  5956. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5957. }
  5958. return `${name}=${encodeURIComponent(parameters[name])}`;
  5959. }).join("&");
  5960. }
  5961. const urlVariableRegex = /\{[^}]+\}/g;
  5962. function removeNonChars(variableName) {
  5963. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5964. }
  5965. function extractUrlVariableNames(url) {
  5966. const matches = url.match(urlVariableRegex);
  5967. if (!matches) {
  5968. return [];
  5969. }
  5970. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5971. }
  5972. function omit(object, keysToOmit) {
  5973. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5974. obj[key] = object[key];
  5975. return obj;
  5976. }, {});
  5977. }
  5978. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5979. // TODO: create separate package.
  5980. //
  5981. // Copyright (c) 2012-2014, Bram Stein
  5982. // All rights reserved.
  5983. // Redistribution and use in source and binary forms, with or without
  5984. // modification, are permitted provided that the following conditions
  5985. // are met:
  5986. // 1. Redistributions of source code must retain the above copyright
  5987. // notice, this list of conditions and the following disclaimer.
  5988. // 2. Redistributions in binary form must reproduce the above copyright
  5989. // notice, this list of conditions and the following disclaimer in the
  5990. // documentation and/or other materials provided with the distribution.
  5991. // 3. The name of the author may not be used to endorse or promote products
  5992. // derived from this software without specific prior written permission.
  5993. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5994. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5995. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5996. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5997. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5998. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5999. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6000. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6001. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6002. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6003. /* istanbul ignore file */
  6004. function encodeReserved(str) {
  6005. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6006. if (!/%[0-9A-Fa-f]/.test(part)) {
  6007. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6008. }
  6009. return part;
  6010. }).join("");
  6011. }
  6012. function encodeUnreserved(str) {
  6013. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6014. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6015. });
  6016. }
  6017. function encodeValue(operator, value, key) {
  6018. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6019. if (key) {
  6020. return encodeUnreserved(key) + "=" + value;
  6021. } else {
  6022. return value;
  6023. }
  6024. }
  6025. function isDefined(value) {
  6026. return value !== undefined && value !== null;
  6027. }
  6028. function isKeyOperator(operator) {
  6029. return operator === ";" || operator === "&" || operator === "?";
  6030. }
  6031. function getValues(context, operator, key, modifier) {
  6032. var value = context[key],
  6033. result = [];
  6034. if (isDefined(value) && value !== "") {
  6035. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6036. value = value.toString();
  6037. if (modifier && modifier !== "*") {
  6038. value = value.substring(0, parseInt(modifier, 10));
  6039. }
  6040. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6041. } else {
  6042. if (modifier === "*") {
  6043. if (Array.isArray(value)) {
  6044. value.filter(isDefined).forEach(function (value) {
  6045. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6046. });
  6047. } else {
  6048. Object.keys(value).forEach(function (k) {
  6049. if (isDefined(value[k])) {
  6050. result.push(encodeValue(operator, value[k], k));
  6051. }
  6052. });
  6053. }
  6054. } else {
  6055. const tmp = [];
  6056. if (Array.isArray(value)) {
  6057. value.filter(isDefined).forEach(function (value) {
  6058. tmp.push(encodeValue(operator, value));
  6059. });
  6060. } else {
  6061. Object.keys(value).forEach(function (k) {
  6062. if (isDefined(value[k])) {
  6063. tmp.push(encodeUnreserved(k));
  6064. tmp.push(encodeValue(operator, value[k].toString()));
  6065. }
  6066. });
  6067. }
  6068. if (isKeyOperator(operator)) {
  6069. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6070. } else if (tmp.length !== 0) {
  6071. result.push(tmp.join(","));
  6072. }
  6073. }
  6074. }
  6075. } else {
  6076. if (operator === ";") {
  6077. if (isDefined(value)) {
  6078. result.push(encodeUnreserved(key));
  6079. }
  6080. } else if (value === "" && (operator === "&" || operator === "?")) {
  6081. result.push(encodeUnreserved(key) + "=");
  6082. } else if (value === "") {
  6083. result.push("");
  6084. }
  6085. }
  6086. return result;
  6087. }
  6088. function parseUrl(template) {
  6089. return {
  6090. expand: expand.bind(null, template)
  6091. };
  6092. }
  6093. function expand(template, context) {
  6094. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6095. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6096. if (expression) {
  6097. let operator = "";
  6098. const values = [];
  6099. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6100. operator = expression.charAt(0);
  6101. expression = expression.substr(1);
  6102. }
  6103. expression.split(/,/g).forEach(function (variable) {
  6104. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6105. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6106. });
  6107. if (operator && operator !== "+") {
  6108. var separator = ",";
  6109. if (operator === "?") {
  6110. separator = "&";
  6111. } else if (operator !== "#") {
  6112. separator = operator;
  6113. }
  6114. return (values.length !== 0 ? operator : "") + values.join(separator);
  6115. } else {
  6116. return values.join(",");
  6117. }
  6118. } else {
  6119. return encodeReserved(literal);
  6120. }
  6121. });
  6122. }
  6123. function parse(options) {
  6124. // https://fetch.spec.whatwg.org/#methods
  6125. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6126. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6127. let headers = Object.assign({}, options.headers);
  6128. let body;
  6129. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6130. const urlVariableNames = extractUrlVariableNames(url);
  6131. url = parseUrl(url).expand(parameters);
  6132. if (!/^http/.test(url)) {
  6133. url = options.baseUrl + url;
  6134. }
  6135. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6136. const remainingParameters = omit(parameters, omittedParameters);
  6137. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6138. if (!isBinaryRequset) {
  6139. if (options.mediaType.format) {
  6140. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6141. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6142. }
  6143. if (options.mediaType.previews.length) {
  6144. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6145. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6146. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6147. return `application/vnd.github.${preview}-preview${format}`;
  6148. }).join(",");
  6149. }
  6150. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6151. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6152. if (["GET", "HEAD"].includes(method)) {
  6153. url = addQueryParameters(url, remainingParameters);
  6154. } else {
  6155. if ("data" in remainingParameters) {
  6156. body = remainingParameters.data;
  6157. } else {
  6158. if (Object.keys(remainingParameters).length) {
  6159. body = remainingParameters;
  6160. } else {
  6161. headers["content-length"] = 0;
  6162. }
  6163. }
  6164. } // default content-type for JSON if body is set
  6165. if (!headers["content-type"] && typeof body !== "undefined") {
  6166. headers["content-type"] = "application/json; charset=utf-8";
  6167. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6168. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6169. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6170. body = "";
  6171. } // Only return body/request keys if present
  6172. return Object.assign({
  6173. method,
  6174. url,
  6175. headers
  6176. }, typeof body !== "undefined" ? {
  6177. body
  6178. } : null, options.request ? {
  6179. request: options.request
  6180. } : null);
  6181. }
  6182. function endpointWithDefaults(defaults, route, options) {
  6183. return parse(merge(defaults, route, options));
  6184. }
  6185. function withDefaults(oldDefaults, newDefaults) {
  6186. const DEFAULTS = merge(oldDefaults, newDefaults);
  6187. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6188. return Object.assign(endpoint, {
  6189. DEFAULTS,
  6190. defaults: withDefaults.bind(null, DEFAULTS),
  6191. merge: merge.bind(null, DEFAULTS),
  6192. parse
  6193. });
  6194. }
  6195. const VERSION = "6.0.1";
  6196. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6197. // So we use RequestParameters and add method as additional required property.
  6198. const DEFAULTS = {
  6199. method: "GET",
  6200. baseUrl: "https://api.github.com",
  6201. headers: {
  6202. accept: "application/vnd.github.v3+json",
  6203. "user-agent": userAgent
  6204. },
  6205. mediaType: {
  6206. format: "",
  6207. previews: []
  6208. }
  6209. };
  6210. const endpoint = withDefaults(null, DEFAULTS);
  6211. exports.endpoint = endpoint;
  6212. //# sourceMappingURL=index.js.map
  6213. /***/ }),
  6214. /***/ 389:
  6215. /***/ (function(module, __unusedexports, __webpack_require__) {
  6216. "use strict";
  6217. const fs = __webpack_require__(747);
  6218. const shebangCommand = __webpack_require__(866);
  6219. function readShebang(command) {
  6220. // Read the first 150 bytes from the file
  6221. const size = 150;
  6222. let buffer;
  6223. if (Buffer.alloc) {
  6224. // Node.js v4.5+ / v5.10+
  6225. buffer = Buffer.alloc(size);
  6226. } else {
  6227. // Old Node.js API
  6228. buffer = new Buffer(size);
  6229. buffer.fill(0); // zero-fill
  6230. }
  6231. let fd;
  6232. try {
  6233. fd = fs.openSync(command, 'r');
  6234. fs.readSync(fd, buffer, 0, size, 0);
  6235. fs.closeSync(fd);
  6236. } catch (e) { /* Empty */ }
  6237. // Attempt to extract shebang (null is returned if not a shebang)
  6238. return shebangCommand(buffer.toString());
  6239. }
  6240. module.exports = readShebang;
  6241. /***/ }),
  6242. /***/ 402:
  6243. /***/ (function(module, __unusedexports, __webpack_require__) {
  6244. module.exports = Octokit;
  6245. const { request } = __webpack_require__(753);
  6246. const Hook = __webpack_require__(523);
  6247. const parseClientOptions = __webpack_require__(294);
  6248. function Octokit(plugins, options) {
  6249. options = options || {};
  6250. const hook = new Hook.Collection();
  6251. const log = Object.assign(
  6252. {
  6253. debug: () => {},
  6254. info: () => {},
  6255. warn: console.warn,
  6256. error: console.error
  6257. },
  6258. options && options.log
  6259. );
  6260. const api = {
  6261. hook,
  6262. log,
  6263. request: request.defaults(parseClientOptions(options, log, hook))
  6264. };
  6265. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6266. return api;
  6267. }
  6268. /***/ }),
  6269. /***/ 413:
  6270. /***/ (function(module) {
  6271. module.exports = require("stream");
  6272. /***/ }),
  6273. /***/ 417:
  6274. /***/ (function(module) {
  6275. module.exports = require("crypto");
  6276. /***/ }),
  6277. /***/ 427:
  6278. /***/ (function(module, __unusedexports, __webpack_require__) {
  6279. "use strict";
  6280. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6281. // In that case, fall back to a deprecated internal.
  6282. const util = __webpack_require__(669);
  6283. let uv;
  6284. if (typeof util.getSystemErrorName === 'function') {
  6285. module.exports = util.getSystemErrorName;
  6286. } else {
  6287. try {
  6288. uv = process.binding('uv');
  6289. if (typeof uv.errname !== 'function') {
  6290. throw new TypeError('uv.errname is not a function');
  6291. }
  6292. } catch (err) {
  6293. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6294. uv = null;
  6295. }
  6296. module.exports = code => errname(uv, code);
  6297. }
  6298. // Used for testing the fallback behavior
  6299. module.exports.__test__ = errname;
  6300. function errname(uv, code) {
  6301. if (uv) {
  6302. return uv.errname(code);
  6303. }
  6304. if (!(code < 0)) {
  6305. throw new Error('err >= 0');
  6306. }
  6307. return `Unknown system error ${code}`;
  6308. }
  6309. /***/ }),
  6310. /***/ 430:
  6311. /***/ (function(module, __unusedexports, __webpack_require__) {
  6312. module.exports = octokitValidate;
  6313. const validate = __webpack_require__(348);
  6314. function octokitValidate(octokit) {
  6315. octokit.hook.before("request", validate.bind(null, octokit));
  6316. }
  6317. /***/ }),
  6318. /***/ 431:
  6319. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6320. "use strict";
  6321. Object.defineProperty(exports, "__esModule", { value: true });
  6322. const os = __webpack_require__(87);
  6323. /**
  6324. * Commands
  6325. *
  6326. * Command Format:
  6327. * ##[name key=value;key=value]message
  6328. *
  6329. * Examples:
  6330. * ##[warning]This is the user warning message
  6331. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6332. */
  6333. function issueCommand(command, properties, message) {
  6334. const cmd = new Command(command, properties, message);
  6335. process.stdout.write(cmd.toString() + os.EOL);
  6336. }
  6337. exports.issueCommand = issueCommand;
  6338. function issue(name, message = '') {
  6339. issueCommand(name, {}, message);
  6340. }
  6341. exports.issue = issue;
  6342. const CMD_STRING = '::';
  6343. class Command {
  6344. constructor(command, properties, message) {
  6345. if (!command) {
  6346. command = 'missing.command';
  6347. }
  6348. this.command = command;
  6349. this.properties = properties;
  6350. this.message = message;
  6351. }
  6352. toString() {
  6353. let cmdStr = CMD_STRING + this.command;
  6354. if (this.properties && Object.keys(this.properties).length > 0) {
  6355. cmdStr += ' ';
  6356. for (const key in this.properties) {
  6357. if (this.properties.hasOwnProperty(key)) {
  6358. const val = this.properties[key];
  6359. if (val) {
  6360. // safely append the val - avoid blowing up when attempting to
  6361. // call .replace() if message is not a string for some reason
  6362. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6363. }
  6364. }
  6365. }
  6366. }
  6367. cmdStr += CMD_STRING;
  6368. // safely append the message - avoid blowing up when attempting to
  6369. // call .replace() if message is not a string for some reason
  6370. const message = `${this.message || ''}`;
  6371. cmdStr += escapeData(message);
  6372. return cmdStr;
  6373. }
  6374. }
  6375. function escapeData(s) {
  6376. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6377. }
  6378. function escape(s) {
  6379. return s
  6380. .replace(/\r/g, '%0D')
  6381. .replace(/\n/g, '%0A')
  6382. .replace(/]/g, '%5D')
  6383. .replace(/;/g, '%3B');
  6384. }
  6385. //# sourceMappingURL=command.js.map
  6386. /***/ }),
  6387. /***/ 438:
  6388. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6389. "use strict";
  6390. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6391. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6392. return new (P || (P = Promise))(function (resolve, reject) {
  6393. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6394. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6395. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6396. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6397. });
  6398. };
  6399. var __importStar = (this && this.__importStar) || function (mod) {
  6400. if (mod && mod.__esModule) return mod;
  6401. var result = {};
  6402. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6403. result["default"] = mod;
  6404. return result;
  6405. };
  6406. Object.defineProperty(exports, "__esModule", { value: true });
  6407. const assert = __importStar(__webpack_require__(357));
  6408. const core = __importStar(__webpack_require__(470));
  6409. const fs = __importStar(__webpack_require__(747));
  6410. const fsHelper = __importStar(__webpack_require__(618));
  6411. const io = __importStar(__webpack_require__(1));
  6412. const path = __importStar(__webpack_require__(622));
  6413. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6414. return __awaiter(this, void 0, void 0, function* () {
  6415. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6416. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6417. // Indicates whether to delete the directory contents
  6418. let remove = false;
  6419. // Check whether using git or REST API
  6420. if (!git) {
  6421. remove = true;
  6422. }
  6423. // Fetch URL does not match
  6424. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6425. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6426. remove = true;
  6427. }
  6428. else {
  6429. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6430. const lockPaths = [
  6431. path.join(repositoryPath, '.git', 'index.lock'),
  6432. path.join(repositoryPath, '.git', 'shallow.lock')
  6433. ];
  6434. for (const lockPath of lockPaths) {
  6435. try {
  6436. yield io.rmRF(lockPath);
  6437. }
  6438. catch (error) {
  6439. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6440. }
  6441. }
  6442. try {
  6443. core.startGroup('Removing previously created refs, to avoid conflicts');
  6444. // Checkout detached HEAD
  6445. if (!(yield git.isDetached())) {
  6446. yield git.checkoutDetach();
  6447. }
  6448. // Remove all refs/heads/*
  6449. let branches = yield git.branchList(false);
  6450. for (const branch of branches) {
  6451. yield git.branchDelete(false, branch);
  6452. }
  6453. // Remove all refs/remotes/origin/* to avoid conflicts
  6454. branches = yield git.branchList(true);
  6455. for (const branch of branches) {
  6456. yield git.branchDelete(true, branch);
  6457. }
  6458. core.endGroup();
  6459. // Clean
  6460. if (clean) {
  6461. core.startGroup('Cleaning the repository');
  6462. if (!(yield git.tryClean())) {
  6463. 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}'.`);
  6464. remove = true;
  6465. }
  6466. else if (!(yield git.tryReset())) {
  6467. remove = true;
  6468. }
  6469. core.endGroup();
  6470. if (remove) {
  6471. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6472. }
  6473. }
  6474. }
  6475. catch (error) {
  6476. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6477. remove = true;
  6478. }
  6479. }
  6480. if (remove) {
  6481. // Delete the contents of the directory. Don't delete the directory itself
  6482. // since it might be the current working directory.
  6483. core.info(`Deleting the contents of '${repositoryPath}'`);
  6484. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6485. yield io.rmRF(path.join(repositoryPath, file));
  6486. }
  6487. }
  6488. });
  6489. }
  6490. exports.prepareExistingDirectory = prepareExistingDirectory;
  6491. /***/ }),
  6492. /***/ 453:
  6493. /***/ (function(module, __unusedexports, __webpack_require__) {
  6494. var once = __webpack_require__(969)
  6495. var eos = __webpack_require__(3)
  6496. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6497. var noop = function () {}
  6498. var ancient = /^v?\.0/.test(process.version)
  6499. var isFn = function (fn) {
  6500. return typeof fn === 'function'
  6501. }
  6502. var isFS = function (stream) {
  6503. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6504. if (!fs) return false // browser
  6505. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6506. }
  6507. var isRequest = function (stream) {
  6508. return stream.setHeader && isFn(stream.abort)
  6509. }
  6510. var destroyer = function (stream, reading, writing, callback) {
  6511. callback = once(callback)
  6512. var closed = false
  6513. stream.on('close', function () {
  6514. closed = true
  6515. })
  6516. eos(stream, {readable: reading, writable: writing}, function (err) {
  6517. if (err) return callback(err)
  6518. closed = true
  6519. callback()
  6520. })
  6521. var destroyed = false
  6522. return function (err) {
  6523. if (closed) return
  6524. if (destroyed) return
  6525. destroyed = true
  6526. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6527. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6528. if (isFn(stream.destroy)) return stream.destroy()
  6529. callback(err || new Error('stream was destroyed'))
  6530. }
  6531. }
  6532. var call = function (fn) {
  6533. fn()
  6534. }
  6535. var pipe = function (from, to) {
  6536. return from.pipe(to)
  6537. }
  6538. var pump = function () {
  6539. var streams = Array.prototype.slice.call(arguments)
  6540. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6541. if (Array.isArray(streams[0])) streams = streams[0]
  6542. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6543. var error
  6544. var destroys = streams.map(function (stream, i) {
  6545. var reading = i < streams.length - 1
  6546. var writing = i > 0
  6547. return destroyer(stream, reading, writing, function (err) {
  6548. if (!error) error = err
  6549. if (err) destroys.forEach(call)
  6550. if (reading) return
  6551. destroys.forEach(call)
  6552. callback(error)
  6553. })
  6554. })
  6555. return streams.reduce(pipe)
  6556. }
  6557. module.exports = pump
  6558. /***/ }),
  6559. /***/ 454:
  6560. /***/ (function(module, exports, __webpack_require__) {
  6561. "use strict";
  6562. Object.defineProperty(exports, '__esModule', { value: true });
  6563. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6564. var Stream = _interopDefault(__webpack_require__(413));
  6565. var http = _interopDefault(__webpack_require__(605));
  6566. var Url = _interopDefault(__webpack_require__(835));
  6567. var https = _interopDefault(__webpack_require__(34));
  6568. var zlib = _interopDefault(__webpack_require__(761));
  6569. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6570. // fix for "Readable" isn't a named export issue
  6571. const Readable = Stream.Readable;
  6572. const BUFFER = Symbol('buffer');
  6573. const TYPE = Symbol('type');
  6574. class Blob {
  6575. constructor() {
  6576. this[TYPE] = '';
  6577. const blobParts = arguments[0];
  6578. const options = arguments[1];
  6579. const buffers = [];
  6580. let size = 0;
  6581. if (blobParts) {
  6582. const a = blobParts;
  6583. const length = Number(a.length);
  6584. for (let i = 0; i < length; i++) {
  6585. const element = a[i];
  6586. let buffer;
  6587. if (element instanceof Buffer) {
  6588. buffer = element;
  6589. } else if (ArrayBuffer.isView(element)) {
  6590. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6591. } else if (element instanceof ArrayBuffer) {
  6592. buffer = Buffer.from(element);
  6593. } else if (element instanceof Blob) {
  6594. buffer = element[BUFFER];
  6595. } else {
  6596. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6597. }
  6598. size += buffer.length;
  6599. buffers.push(buffer);
  6600. }
  6601. }
  6602. this[BUFFER] = Buffer.concat(buffers);
  6603. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6604. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6605. this[TYPE] = type;
  6606. }
  6607. }
  6608. get size() {
  6609. return this[BUFFER].length;
  6610. }
  6611. get type() {
  6612. return this[TYPE];
  6613. }
  6614. text() {
  6615. return Promise.resolve(this[BUFFER].toString());
  6616. }
  6617. arrayBuffer() {
  6618. const buf = this[BUFFER];
  6619. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6620. return Promise.resolve(ab);
  6621. }
  6622. stream() {
  6623. const readable = new Readable();
  6624. readable._read = function () {};
  6625. readable.push(this[BUFFER]);
  6626. readable.push(null);
  6627. return readable;
  6628. }
  6629. toString() {
  6630. return '[object Blob]';
  6631. }
  6632. slice() {
  6633. const size = this.size;
  6634. const start = arguments[0];
  6635. const end = arguments[1];
  6636. let relativeStart, relativeEnd;
  6637. if (start === undefined) {
  6638. relativeStart = 0;
  6639. } else if (start < 0) {
  6640. relativeStart = Math.max(size + start, 0);
  6641. } else {
  6642. relativeStart = Math.min(start, size);
  6643. }
  6644. if (end === undefined) {
  6645. relativeEnd = size;
  6646. } else if (end < 0) {
  6647. relativeEnd = Math.max(size + end, 0);
  6648. } else {
  6649. relativeEnd = Math.min(end, size);
  6650. }
  6651. const span = Math.max(relativeEnd - relativeStart, 0);
  6652. const buffer = this[BUFFER];
  6653. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6654. const blob = new Blob([], { type: arguments[2] });
  6655. blob[BUFFER] = slicedBuffer;
  6656. return blob;
  6657. }
  6658. }
  6659. Object.defineProperties(Blob.prototype, {
  6660. size: { enumerable: true },
  6661. type: { enumerable: true },
  6662. slice: { enumerable: true }
  6663. });
  6664. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6665. value: 'Blob',
  6666. writable: false,
  6667. enumerable: false,
  6668. configurable: true
  6669. });
  6670. /**
  6671. * fetch-error.js
  6672. *
  6673. * FetchError interface for operational errors
  6674. */
  6675. /**
  6676. * Create FetchError instance
  6677. *
  6678. * @param String message Error message for human
  6679. * @param String type Error type for machine
  6680. * @param String systemError For Node.js system error
  6681. * @return FetchError
  6682. */
  6683. function FetchError(message, type, systemError) {
  6684. Error.call(this, message);
  6685. this.message = message;
  6686. this.type = type;
  6687. // when err.type is `system`, err.code contains system error code
  6688. if (systemError) {
  6689. this.code = this.errno = systemError.code;
  6690. }
  6691. // hide custom error implementation details from end-users
  6692. Error.captureStackTrace(this, this.constructor);
  6693. }
  6694. FetchError.prototype = Object.create(Error.prototype);
  6695. FetchError.prototype.constructor = FetchError;
  6696. FetchError.prototype.name = 'FetchError';
  6697. let convert;
  6698. try {
  6699. convert = __webpack_require__(18).convert;
  6700. } catch (e) {}
  6701. const INTERNALS = Symbol('Body internals');
  6702. // fix an issue where "PassThrough" isn't a named export for node <10
  6703. const PassThrough = Stream.PassThrough;
  6704. /**
  6705. * Body mixin
  6706. *
  6707. * Ref: https://fetch.spec.whatwg.org/#body
  6708. *
  6709. * @param Stream body Readable stream
  6710. * @param Object opts Response options
  6711. * @return Void
  6712. */
  6713. function Body(body) {
  6714. var _this = this;
  6715. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6716. _ref$size = _ref.size;
  6717. let size = _ref$size === undefined ? 0 : _ref$size;
  6718. var _ref$timeout = _ref.timeout;
  6719. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6720. if (body == null) {
  6721. // body is undefined or null
  6722. body = null;
  6723. } else if (isURLSearchParams(body)) {
  6724. // body is a URLSearchParams
  6725. body = Buffer.from(body.toString());
  6726. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6727. // body is ArrayBuffer
  6728. body = Buffer.from(body);
  6729. } else if (ArrayBuffer.isView(body)) {
  6730. // body is ArrayBufferView
  6731. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6732. } else if (body instanceof Stream) ; else {
  6733. // none of the above
  6734. // coerce to string then buffer
  6735. body = Buffer.from(String(body));
  6736. }
  6737. this[INTERNALS] = {
  6738. body,
  6739. disturbed: false,
  6740. error: null
  6741. };
  6742. this.size = size;
  6743. this.timeout = timeout;
  6744. if (body instanceof Stream) {
  6745. body.on('error', function (err) {
  6746. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6747. _this[INTERNALS].error = error;
  6748. });
  6749. }
  6750. }
  6751. Body.prototype = {
  6752. get body() {
  6753. return this[INTERNALS].body;
  6754. },
  6755. get bodyUsed() {
  6756. return this[INTERNALS].disturbed;
  6757. },
  6758. /**
  6759. * Decode response as ArrayBuffer
  6760. *
  6761. * @return Promise
  6762. */
  6763. arrayBuffer() {
  6764. return consumeBody.call(this).then(function (buf) {
  6765. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6766. });
  6767. },
  6768. /**
  6769. * Return raw response as Blob
  6770. *
  6771. * @return Promise
  6772. */
  6773. blob() {
  6774. let ct = this.headers && this.headers.get('content-type') || '';
  6775. return consumeBody.call(this).then(function (buf) {
  6776. return Object.assign(
  6777. // Prevent copying
  6778. new Blob([], {
  6779. type: ct.toLowerCase()
  6780. }), {
  6781. [BUFFER]: buf
  6782. });
  6783. });
  6784. },
  6785. /**
  6786. * Decode response as json
  6787. *
  6788. * @return Promise
  6789. */
  6790. json() {
  6791. var _this2 = this;
  6792. return consumeBody.call(this).then(function (buffer) {
  6793. try {
  6794. return JSON.parse(buffer.toString());
  6795. } catch (err) {
  6796. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6797. }
  6798. });
  6799. },
  6800. /**
  6801. * Decode response as text
  6802. *
  6803. * @return Promise
  6804. */
  6805. text() {
  6806. return consumeBody.call(this).then(function (buffer) {
  6807. return buffer.toString();
  6808. });
  6809. },
  6810. /**
  6811. * Decode response as buffer (non-spec api)
  6812. *
  6813. * @return Promise
  6814. */
  6815. buffer() {
  6816. return consumeBody.call(this);
  6817. },
  6818. /**
  6819. * Decode response as text, while automatically detecting the encoding and
  6820. * trying to decode to UTF-8 (non-spec api)
  6821. *
  6822. * @return Promise
  6823. */
  6824. textConverted() {
  6825. var _this3 = this;
  6826. return consumeBody.call(this).then(function (buffer) {
  6827. return convertBody(buffer, _this3.headers);
  6828. });
  6829. }
  6830. };
  6831. // In browsers, all properties are enumerable.
  6832. Object.defineProperties(Body.prototype, {
  6833. body: { enumerable: true },
  6834. bodyUsed: { enumerable: true },
  6835. arrayBuffer: { enumerable: true },
  6836. blob: { enumerable: true },
  6837. json: { enumerable: true },
  6838. text: { enumerable: true }
  6839. });
  6840. Body.mixIn = function (proto) {
  6841. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6842. // istanbul ignore else: future proof
  6843. if (!(name in proto)) {
  6844. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6845. Object.defineProperty(proto, name, desc);
  6846. }
  6847. }
  6848. };
  6849. /**
  6850. * Consume and convert an entire Body to a Buffer.
  6851. *
  6852. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6853. *
  6854. * @return Promise
  6855. */
  6856. function consumeBody() {
  6857. var _this4 = this;
  6858. if (this[INTERNALS].disturbed) {
  6859. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6860. }
  6861. this[INTERNALS].disturbed = true;
  6862. if (this[INTERNALS].error) {
  6863. return Body.Promise.reject(this[INTERNALS].error);
  6864. }
  6865. let body = this.body;
  6866. // body is null
  6867. if (body === null) {
  6868. return Body.Promise.resolve(Buffer.alloc(0));
  6869. }
  6870. // body is blob
  6871. if (isBlob(body)) {
  6872. body = body.stream();
  6873. }
  6874. // body is buffer
  6875. if (Buffer.isBuffer(body)) {
  6876. return Body.Promise.resolve(body);
  6877. }
  6878. // istanbul ignore if: should never happen
  6879. if (!(body instanceof Stream)) {
  6880. return Body.Promise.resolve(Buffer.alloc(0));
  6881. }
  6882. // body is stream
  6883. // get ready to actually consume the body
  6884. let accum = [];
  6885. let accumBytes = 0;
  6886. let abort = false;
  6887. return new Body.Promise(function (resolve, reject) {
  6888. let resTimeout;
  6889. // allow timeout on slow response body
  6890. if (_this4.timeout) {
  6891. resTimeout = setTimeout(function () {
  6892. abort = true;
  6893. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6894. }, _this4.timeout);
  6895. }
  6896. // handle stream errors
  6897. body.on('error', function (err) {
  6898. if (err.name === 'AbortError') {
  6899. // if the request was aborted, reject with this Error
  6900. abort = true;
  6901. reject(err);
  6902. } else {
  6903. // other errors, such as incorrect content-encoding
  6904. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6905. }
  6906. });
  6907. body.on('data', function (chunk) {
  6908. if (abort || chunk === null) {
  6909. return;
  6910. }
  6911. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6912. abort = true;
  6913. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6914. return;
  6915. }
  6916. accumBytes += chunk.length;
  6917. accum.push(chunk);
  6918. });
  6919. body.on('end', function () {
  6920. if (abort) {
  6921. return;
  6922. }
  6923. clearTimeout(resTimeout);
  6924. try {
  6925. resolve(Buffer.concat(accum, accumBytes));
  6926. } catch (err) {
  6927. // handle streams that have accumulated too much data (issue #414)
  6928. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6929. }
  6930. });
  6931. });
  6932. }
  6933. /**
  6934. * Detect buffer encoding and convert to target encoding
  6935. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6936. *
  6937. * @param Buffer buffer Incoming buffer
  6938. * @param String encoding Target encoding
  6939. * @return String
  6940. */
  6941. function convertBody(buffer, headers) {
  6942. if (typeof convert !== 'function') {
  6943. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6944. }
  6945. const ct = headers.get('content-type');
  6946. let charset = 'utf-8';
  6947. let res, str;
  6948. // header
  6949. if (ct) {
  6950. res = /charset=([^;]*)/i.exec(ct);
  6951. }
  6952. // no charset in content type, peek at response body for at most 1024 bytes
  6953. str = buffer.slice(0, 1024).toString();
  6954. // html5
  6955. if (!res && str) {
  6956. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6957. }
  6958. // html4
  6959. if (!res && str) {
  6960. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6961. if (res) {
  6962. res = /charset=(.*)/i.exec(res.pop());
  6963. }
  6964. }
  6965. // xml
  6966. if (!res && str) {
  6967. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6968. }
  6969. // found charset
  6970. if (res) {
  6971. charset = res.pop();
  6972. // prevent decode issues when sites use incorrect encoding
  6973. // ref: https://hsivonen.fi/encoding-menu/
  6974. if (charset === 'gb2312' || charset === 'gbk') {
  6975. charset = 'gb18030';
  6976. }
  6977. }
  6978. // turn raw buffers into a single utf-8 buffer
  6979. return convert(buffer, 'UTF-8', charset).toString();
  6980. }
  6981. /**
  6982. * Detect a URLSearchParams object
  6983. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6984. *
  6985. * @param Object obj Object to detect by type or brand
  6986. * @return String
  6987. */
  6988. function isURLSearchParams(obj) {
  6989. // Duck-typing as a necessary condition.
  6990. 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') {
  6991. return false;
  6992. }
  6993. // Brand-checking and more duck-typing as optional condition.
  6994. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6995. }
  6996. /**
  6997. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6998. * @param {*} obj
  6999. * @return {boolean}
  7000. */
  7001. function isBlob(obj) {
  7002. 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]);
  7003. }
  7004. /**
  7005. * Clone body given Res/Req instance
  7006. *
  7007. * @param Mixed instance Response or Request instance
  7008. * @return Mixed
  7009. */
  7010. function clone(instance) {
  7011. let p1, p2;
  7012. let body = instance.body;
  7013. // don't allow cloning a used body
  7014. if (instance.bodyUsed) {
  7015. throw new Error('cannot clone body after it is used');
  7016. }
  7017. // check that body is a stream and not form-data object
  7018. // note: we can't clone the form-data object without having it as a dependency
  7019. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7020. // tee instance body
  7021. p1 = new PassThrough();
  7022. p2 = new PassThrough();
  7023. body.pipe(p1);
  7024. body.pipe(p2);
  7025. // set instance body to teed body and return the other teed body
  7026. instance[INTERNALS].body = p1;
  7027. body = p2;
  7028. }
  7029. return body;
  7030. }
  7031. /**
  7032. * Performs the operation "extract a `Content-Type` value from |object|" as
  7033. * specified in the specification:
  7034. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7035. *
  7036. * This function assumes that instance.body is present.
  7037. *
  7038. * @param Mixed instance Any options.body input
  7039. */
  7040. function extractContentType(body) {
  7041. if (body === null) {
  7042. // body is null
  7043. return null;
  7044. } else if (typeof body === 'string') {
  7045. // body is string
  7046. return 'text/plain;charset=UTF-8';
  7047. } else if (isURLSearchParams(body)) {
  7048. // body is a URLSearchParams
  7049. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7050. } else if (isBlob(body)) {
  7051. // body is blob
  7052. return body.type || null;
  7053. } else if (Buffer.isBuffer(body)) {
  7054. // body is buffer
  7055. return null;
  7056. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7057. // body is ArrayBuffer
  7058. return null;
  7059. } else if (ArrayBuffer.isView(body)) {
  7060. // body is ArrayBufferView
  7061. return null;
  7062. } else if (typeof body.getBoundary === 'function') {
  7063. // detect form data input from form-data module
  7064. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7065. } else if (body instanceof Stream) {
  7066. // body is stream
  7067. // can't really do much about this
  7068. return null;
  7069. } else {
  7070. // Body constructor defaults other things to string
  7071. return 'text/plain;charset=UTF-8';
  7072. }
  7073. }
  7074. /**
  7075. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7076. * For us, we have to explicitly get it with a function.
  7077. *
  7078. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7079. *
  7080. * @param Body instance Instance of Body
  7081. * @return Number? Number of bytes, or null if not possible
  7082. */
  7083. function getTotalBytes(instance) {
  7084. const body = instance.body;
  7085. if (body === null) {
  7086. // body is null
  7087. return 0;
  7088. } else if (isBlob(body)) {
  7089. return body.size;
  7090. } else if (Buffer.isBuffer(body)) {
  7091. // body is buffer
  7092. return body.length;
  7093. } else if (body && typeof body.getLengthSync === 'function') {
  7094. // detect form data input from form-data module
  7095. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7096. body.hasKnownLength && body.hasKnownLength()) {
  7097. // 2.x
  7098. return body.getLengthSync();
  7099. }
  7100. return null;
  7101. } else {
  7102. // body is stream
  7103. return null;
  7104. }
  7105. }
  7106. /**
  7107. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7108. *
  7109. * @param Body instance Instance of Body
  7110. * @return Void
  7111. */
  7112. function writeToStream(dest, instance) {
  7113. const body = instance.body;
  7114. if (body === null) {
  7115. // body is null
  7116. dest.end();
  7117. } else if (isBlob(body)) {
  7118. body.stream().pipe(dest);
  7119. } else if (Buffer.isBuffer(body)) {
  7120. // body is buffer
  7121. dest.write(body);
  7122. dest.end();
  7123. } else {
  7124. // body is stream
  7125. body.pipe(dest);
  7126. }
  7127. }
  7128. // expose Promise
  7129. Body.Promise = global.Promise;
  7130. /**
  7131. * headers.js
  7132. *
  7133. * Headers class offers convenient helpers
  7134. */
  7135. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7136. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7137. function validateName(name) {
  7138. name = `${name}`;
  7139. if (invalidTokenRegex.test(name) || name === '') {
  7140. throw new TypeError(`${name} is not a legal HTTP header name`);
  7141. }
  7142. }
  7143. function validateValue(value) {
  7144. value = `${value}`;
  7145. if (invalidHeaderCharRegex.test(value)) {
  7146. throw new TypeError(`${value} is not a legal HTTP header value`);
  7147. }
  7148. }
  7149. /**
  7150. * Find the key in the map object given a header name.
  7151. *
  7152. * Returns undefined if not found.
  7153. *
  7154. * @param String name Header name
  7155. * @return String|Undefined
  7156. */
  7157. function find(map, name) {
  7158. name = name.toLowerCase();
  7159. for (const key in map) {
  7160. if (key.toLowerCase() === name) {
  7161. return key;
  7162. }
  7163. }
  7164. return undefined;
  7165. }
  7166. const MAP = Symbol('map');
  7167. class Headers {
  7168. /**
  7169. * Headers class
  7170. *
  7171. * @param Object headers Response headers
  7172. * @return Void
  7173. */
  7174. constructor() {
  7175. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7176. this[MAP] = Object.create(null);
  7177. if (init instanceof Headers) {
  7178. const rawHeaders = init.raw();
  7179. const headerNames = Object.keys(rawHeaders);
  7180. for (const headerName of headerNames) {
  7181. for (const value of rawHeaders[headerName]) {
  7182. this.append(headerName, value);
  7183. }
  7184. }
  7185. return;
  7186. }
  7187. // We don't worry about converting prop to ByteString here as append()
  7188. // will handle it.
  7189. if (init == null) ; else if (typeof init === 'object') {
  7190. const method = init[Symbol.iterator];
  7191. if (method != null) {
  7192. if (typeof method !== 'function') {
  7193. throw new TypeError('Header pairs must be iterable');
  7194. }
  7195. // sequence<sequence<ByteString>>
  7196. // Note: per spec we have to first exhaust the lists then process them
  7197. const pairs = [];
  7198. for (const pair of init) {
  7199. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7200. throw new TypeError('Each header pair must be iterable');
  7201. }
  7202. pairs.push(Array.from(pair));
  7203. }
  7204. for (const pair of pairs) {
  7205. if (pair.length !== 2) {
  7206. throw new TypeError('Each header pair must be a name/value tuple');
  7207. }
  7208. this.append(pair[0], pair[1]);
  7209. }
  7210. } else {
  7211. // record<ByteString, ByteString>
  7212. for (const key of Object.keys(init)) {
  7213. const value = init[key];
  7214. this.append(key, value);
  7215. }
  7216. }
  7217. } else {
  7218. throw new TypeError('Provided initializer must be an object');
  7219. }
  7220. }
  7221. /**
  7222. * Return combined header value given name
  7223. *
  7224. * @param String name Header name
  7225. * @return Mixed
  7226. */
  7227. get(name) {
  7228. name = `${name}`;
  7229. validateName(name);
  7230. const key = find(this[MAP], name);
  7231. if (key === undefined) {
  7232. return null;
  7233. }
  7234. return this[MAP][key].join(', ');
  7235. }
  7236. /**
  7237. * Iterate over all headers
  7238. *
  7239. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7240. * @param Boolean thisArg `this` context for callback function
  7241. * @return Void
  7242. */
  7243. forEach(callback) {
  7244. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7245. let pairs = getHeaders(this);
  7246. let i = 0;
  7247. while (i < pairs.length) {
  7248. var _pairs$i = pairs[i];
  7249. const name = _pairs$i[0],
  7250. value = _pairs$i[1];
  7251. callback.call(thisArg, value, name, this);
  7252. pairs = getHeaders(this);
  7253. i++;
  7254. }
  7255. }
  7256. /**
  7257. * Overwrite header values given name
  7258. *
  7259. * @param String name Header name
  7260. * @param String value Header value
  7261. * @return Void
  7262. */
  7263. set(name, value) {
  7264. name = `${name}`;
  7265. value = `${value}`;
  7266. validateName(name);
  7267. validateValue(value);
  7268. const key = find(this[MAP], name);
  7269. this[MAP][key !== undefined ? key : name] = [value];
  7270. }
  7271. /**
  7272. * Append a value onto existing header
  7273. *
  7274. * @param String name Header name
  7275. * @param String value Header value
  7276. * @return Void
  7277. */
  7278. append(name, value) {
  7279. name = `${name}`;
  7280. value = `${value}`;
  7281. validateName(name);
  7282. validateValue(value);
  7283. const key = find(this[MAP], name);
  7284. if (key !== undefined) {
  7285. this[MAP][key].push(value);
  7286. } else {
  7287. this[MAP][name] = [value];
  7288. }
  7289. }
  7290. /**
  7291. * Check for header name existence
  7292. *
  7293. * @param String name Header name
  7294. * @return Boolean
  7295. */
  7296. has(name) {
  7297. name = `${name}`;
  7298. validateName(name);
  7299. return find(this[MAP], name) !== undefined;
  7300. }
  7301. /**
  7302. * Delete all header values given name
  7303. *
  7304. * @param String name Header name
  7305. * @return Void
  7306. */
  7307. delete(name) {
  7308. name = `${name}`;
  7309. validateName(name);
  7310. const key = find(this[MAP], name);
  7311. if (key !== undefined) {
  7312. delete this[MAP][key];
  7313. }
  7314. }
  7315. /**
  7316. * Return raw headers (non-spec api)
  7317. *
  7318. * @return Object
  7319. */
  7320. raw() {
  7321. return this[MAP];
  7322. }
  7323. /**
  7324. * Get an iterator on keys.
  7325. *
  7326. * @return Iterator
  7327. */
  7328. keys() {
  7329. return createHeadersIterator(this, 'key');
  7330. }
  7331. /**
  7332. * Get an iterator on values.
  7333. *
  7334. * @return Iterator
  7335. */
  7336. values() {
  7337. return createHeadersIterator(this, 'value');
  7338. }
  7339. /**
  7340. * Get an iterator on entries.
  7341. *
  7342. * This is the default iterator of the Headers object.
  7343. *
  7344. * @return Iterator
  7345. */
  7346. [Symbol.iterator]() {
  7347. return createHeadersIterator(this, 'key+value');
  7348. }
  7349. }
  7350. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7351. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7352. value: 'Headers',
  7353. writable: false,
  7354. enumerable: false,
  7355. configurable: true
  7356. });
  7357. Object.defineProperties(Headers.prototype, {
  7358. get: { enumerable: true },
  7359. forEach: { enumerable: true },
  7360. set: { enumerable: true },
  7361. append: { enumerable: true },
  7362. has: { enumerable: true },
  7363. delete: { enumerable: true },
  7364. keys: { enumerable: true },
  7365. values: { enumerable: true },
  7366. entries: { enumerable: true }
  7367. });
  7368. function getHeaders(headers) {
  7369. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7370. const keys = Object.keys(headers[MAP]).sort();
  7371. return keys.map(kind === 'key' ? function (k) {
  7372. return k.toLowerCase();
  7373. } : kind === 'value' ? function (k) {
  7374. return headers[MAP][k].join(', ');
  7375. } : function (k) {
  7376. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7377. });
  7378. }
  7379. const INTERNAL = Symbol('internal');
  7380. function createHeadersIterator(target, kind) {
  7381. const iterator = Object.create(HeadersIteratorPrototype);
  7382. iterator[INTERNAL] = {
  7383. target,
  7384. kind,
  7385. index: 0
  7386. };
  7387. return iterator;
  7388. }
  7389. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7390. next() {
  7391. // istanbul ignore if
  7392. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7393. throw new TypeError('Value of `this` is not a HeadersIterator');
  7394. }
  7395. var _INTERNAL = this[INTERNAL];
  7396. const target = _INTERNAL.target,
  7397. kind = _INTERNAL.kind,
  7398. index = _INTERNAL.index;
  7399. const values = getHeaders(target, kind);
  7400. const len = values.length;
  7401. if (index >= len) {
  7402. return {
  7403. value: undefined,
  7404. done: true
  7405. };
  7406. }
  7407. this[INTERNAL].index = index + 1;
  7408. return {
  7409. value: values[index],
  7410. done: false
  7411. };
  7412. }
  7413. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7414. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7415. value: 'HeadersIterator',
  7416. writable: false,
  7417. enumerable: false,
  7418. configurable: true
  7419. });
  7420. /**
  7421. * Export the Headers object in a form that Node.js can consume.
  7422. *
  7423. * @param Headers headers
  7424. * @return Object
  7425. */
  7426. function exportNodeCompatibleHeaders(headers) {
  7427. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7428. // http.request() only supports string as Host header. This hack makes
  7429. // specifying custom Host header possible.
  7430. const hostHeaderKey = find(headers[MAP], 'Host');
  7431. if (hostHeaderKey !== undefined) {
  7432. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7433. }
  7434. return obj;
  7435. }
  7436. /**
  7437. * Create a Headers object from an object of headers, ignoring those that do
  7438. * not conform to HTTP grammar productions.
  7439. *
  7440. * @param Object obj Object of headers
  7441. * @return Headers
  7442. */
  7443. function createHeadersLenient(obj) {
  7444. const headers = new Headers();
  7445. for (const name of Object.keys(obj)) {
  7446. if (invalidTokenRegex.test(name)) {
  7447. continue;
  7448. }
  7449. if (Array.isArray(obj[name])) {
  7450. for (const val of obj[name]) {
  7451. if (invalidHeaderCharRegex.test(val)) {
  7452. continue;
  7453. }
  7454. if (headers[MAP][name] === undefined) {
  7455. headers[MAP][name] = [val];
  7456. } else {
  7457. headers[MAP][name].push(val);
  7458. }
  7459. }
  7460. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7461. headers[MAP][name] = [obj[name]];
  7462. }
  7463. }
  7464. return headers;
  7465. }
  7466. const INTERNALS$1 = Symbol('Response internals');
  7467. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7468. const STATUS_CODES = http.STATUS_CODES;
  7469. /**
  7470. * Response class
  7471. *
  7472. * @param Stream body Readable stream
  7473. * @param Object opts Response options
  7474. * @return Void
  7475. */
  7476. class Response {
  7477. constructor() {
  7478. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7479. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7480. Body.call(this, body, opts);
  7481. const status = opts.status || 200;
  7482. const headers = new Headers(opts.headers);
  7483. if (body != null && !headers.has('Content-Type')) {
  7484. const contentType = extractContentType(body);
  7485. if (contentType) {
  7486. headers.append('Content-Type', contentType);
  7487. }
  7488. }
  7489. this[INTERNALS$1] = {
  7490. url: opts.url,
  7491. status,
  7492. statusText: opts.statusText || STATUS_CODES[status],
  7493. headers,
  7494. counter: opts.counter
  7495. };
  7496. }
  7497. get url() {
  7498. return this[INTERNALS$1].url || '';
  7499. }
  7500. get status() {
  7501. return this[INTERNALS$1].status;
  7502. }
  7503. /**
  7504. * Convenience property representing if the request ended normally
  7505. */
  7506. get ok() {
  7507. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7508. }
  7509. get redirected() {
  7510. return this[INTERNALS$1].counter > 0;
  7511. }
  7512. get statusText() {
  7513. return this[INTERNALS$1].statusText;
  7514. }
  7515. get headers() {
  7516. return this[INTERNALS$1].headers;
  7517. }
  7518. /**
  7519. * Clone this response
  7520. *
  7521. * @return Response
  7522. */
  7523. clone() {
  7524. return new Response(clone(this), {
  7525. url: this.url,
  7526. status: this.status,
  7527. statusText: this.statusText,
  7528. headers: this.headers,
  7529. ok: this.ok,
  7530. redirected: this.redirected
  7531. });
  7532. }
  7533. }
  7534. Body.mixIn(Response.prototype);
  7535. Object.defineProperties(Response.prototype, {
  7536. url: { enumerable: true },
  7537. status: { enumerable: true },
  7538. ok: { enumerable: true },
  7539. redirected: { enumerable: true },
  7540. statusText: { enumerable: true },
  7541. headers: { enumerable: true },
  7542. clone: { enumerable: true }
  7543. });
  7544. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7545. value: 'Response',
  7546. writable: false,
  7547. enumerable: false,
  7548. configurable: true
  7549. });
  7550. const INTERNALS$2 = Symbol('Request internals');
  7551. // fix an issue where "format", "parse" aren't a named export for node <10
  7552. const parse_url = Url.parse;
  7553. const format_url = Url.format;
  7554. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7555. /**
  7556. * Check if a value is an instance of Request.
  7557. *
  7558. * @param Mixed input
  7559. * @return Boolean
  7560. */
  7561. function isRequest(input) {
  7562. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7563. }
  7564. function isAbortSignal(signal) {
  7565. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7566. return !!(proto && proto.constructor.name === 'AbortSignal');
  7567. }
  7568. /**
  7569. * Request class
  7570. *
  7571. * @param Mixed input Url or Request instance
  7572. * @param Object init Custom options
  7573. * @return Void
  7574. */
  7575. class Request {
  7576. constructor(input) {
  7577. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7578. let parsedURL;
  7579. // normalize input
  7580. if (!isRequest(input)) {
  7581. if (input && input.href) {
  7582. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7583. // will fall into this branch also (since their `toString()` will return
  7584. // `href` property anyway)
  7585. parsedURL = parse_url(input.href);
  7586. } else {
  7587. // coerce input to a string before attempting to parse
  7588. parsedURL = parse_url(`${input}`);
  7589. }
  7590. input = {};
  7591. } else {
  7592. parsedURL = parse_url(input.url);
  7593. }
  7594. let method = init.method || input.method || 'GET';
  7595. method = method.toUpperCase();
  7596. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7597. throw new TypeError('Request with GET/HEAD method cannot have body');
  7598. }
  7599. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7600. Body.call(this, inputBody, {
  7601. timeout: init.timeout || input.timeout || 0,
  7602. size: init.size || input.size || 0
  7603. });
  7604. const headers = new Headers(init.headers || input.headers || {});
  7605. if (inputBody != null && !headers.has('Content-Type')) {
  7606. const contentType = extractContentType(inputBody);
  7607. if (contentType) {
  7608. headers.append('Content-Type', contentType);
  7609. }
  7610. }
  7611. let signal = isRequest(input) ? input.signal : null;
  7612. if ('signal' in init) signal = init.signal;
  7613. if (signal != null && !isAbortSignal(signal)) {
  7614. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7615. }
  7616. this[INTERNALS$2] = {
  7617. method,
  7618. redirect: init.redirect || input.redirect || 'follow',
  7619. headers,
  7620. parsedURL,
  7621. signal
  7622. };
  7623. // node-fetch-only options
  7624. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7625. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7626. this.counter = init.counter || input.counter || 0;
  7627. this.agent = init.agent || input.agent;
  7628. }
  7629. get method() {
  7630. return this[INTERNALS$2].method;
  7631. }
  7632. get url() {
  7633. return format_url(this[INTERNALS$2].parsedURL);
  7634. }
  7635. get headers() {
  7636. return this[INTERNALS$2].headers;
  7637. }
  7638. get redirect() {
  7639. return this[INTERNALS$2].redirect;
  7640. }
  7641. get signal() {
  7642. return this[INTERNALS$2].signal;
  7643. }
  7644. /**
  7645. * Clone this request
  7646. *
  7647. * @return Request
  7648. */
  7649. clone() {
  7650. return new Request(this);
  7651. }
  7652. }
  7653. Body.mixIn(Request.prototype);
  7654. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7655. value: 'Request',
  7656. writable: false,
  7657. enumerable: false,
  7658. configurable: true
  7659. });
  7660. Object.defineProperties(Request.prototype, {
  7661. method: { enumerable: true },
  7662. url: { enumerable: true },
  7663. headers: { enumerable: true },
  7664. redirect: { enumerable: true },
  7665. clone: { enumerable: true },
  7666. signal: { enumerable: true }
  7667. });
  7668. /**
  7669. * Convert a Request to Node.js http request options.
  7670. *
  7671. * @param Request A Request instance
  7672. * @return Object The options object to be passed to http.request
  7673. */
  7674. function getNodeRequestOptions(request) {
  7675. const parsedURL = request[INTERNALS$2].parsedURL;
  7676. const headers = new Headers(request[INTERNALS$2].headers);
  7677. // fetch step 1.3
  7678. if (!headers.has('Accept')) {
  7679. headers.set('Accept', '*/*');
  7680. }
  7681. // Basic fetch
  7682. if (!parsedURL.protocol || !parsedURL.hostname) {
  7683. throw new TypeError('Only absolute URLs are supported');
  7684. }
  7685. if (!/^https?:$/.test(parsedURL.protocol)) {
  7686. throw new TypeError('Only HTTP(S) protocols are supported');
  7687. }
  7688. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7689. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7690. }
  7691. // HTTP-network-or-cache fetch steps 2.4-2.7
  7692. let contentLengthValue = null;
  7693. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7694. contentLengthValue = '0';
  7695. }
  7696. if (request.body != null) {
  7697. const totalBytes = getTotalBytes(request);
  7698. if (typeof totalBytes === 'number') {
  7699. contentLengthValue = String(totalBytes);
  7700. }
  7701. }
  7702. if (contentLengthValue) {
  7703. headers.set('Content-Length', contentLengthValue);
  7704. }
  7705. // HTTP-network-or-cache fetch step 2.11
  7706. if (!headers.has('User-Agent')) {
  7707. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7708. }
  7709. // HTTP-network-or-cache fetch step 2.15
  7710. if (request.compress && !headers.has('Accept-Encoding')) {
  7711. headers.set('Accept-Encoding', 'gzip,deflate');
  7712. }
  7713. let agent = request.agent;
  7714. if (typeof agent === 'function') {
  7715. agent = agent(parsedURL);
  7716. }
  7717. if (!headers.has('Connection') && !agent) {
  7718. headers.set('Connection', 'close');
  7719. }
  7720. // HTTP-network fetch step 4.2
  7721. // chunked encoding is handled by Node.js
  7722. return Object.assign({}, parsedURL, {
  7723. method: request.method,
  7724. headers: exportNodeCompatibleHeaders(headers),
  7725. agent
  7726. });
  7727. }
  7728. /**
  7729. * abort-error.js
  7730. *
  7731. * AbortError interface for cancelled requests
  7732. */
  7733. /**
  7734. * Create AbortError instance
  7735. *
  7736. * @param String message Error message for human
  7737. * @return AbortError
  7738. */
  7739. function AbortError(message) {
  7740. Error.call(this, message);
  7741. this.type = 'aborted';
  7742. this.message = message;
  7743. // hide custom error implementation details from end-users
  7744. Error.captureStackTrace(this, this.constructor);
  7745. }
  7746. AbortError.prototype = Object.create(Error.prototype);
  7747. AbortError.prototype.constructor = AbortError;
  7748. AbortError.prototype.name = 'AbortError';
  7749. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7750. const PassThrough$1 = Stream.PassThrough;
  7751. const resolve_url = Url.resolve;
  7752. /**
  7753. * Fetch function
  7754. *
  7755. * @param Mixed url Absolute url or Request instance
  7756. * @param Object opts Fetch options
  7757. * @return Promise
  7758. */
  7759. function fetch(url, opts) {
  7760. // allow custom promise
  7761. if (!fetch.Promise) {
  7762. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7763. }
  7764. Body.Promise = fetch.Promise;
  7765. // wrap http.request into fetch
  7766. return new fetch.Promise(function (resolve, reject) {
  7767. // build request object
  7768. const request = new Request(url, opts);
  7769. const options = getNodeRequestOptions(request);
  7770. const send = (options.protocol === 'https:' ? https : http).request;
  7771. const signal = request.signal;
  7772. let response = null;
  7773. const abort = function abort() {
  7774. let error = new AbortError('The user aborted a request.');
  7775. reject(error);
  7776. if (request.body && request.body instanceof Stream.Readable) {
  7777. request.body.destroy(error);
  7778. }
  7779. if (!response || !response.body) return;
  7780. response.body.emit('error', error);
  7781. };
  7782. if (signal && signal.aborted) {
  7783. abort();
  7784. return;
  7785. }
  7786. const abortAndFinalize = function abortAndFinalize() {
  7787. abort();
  7788. finalize();
  7789. };
  7790. // send request
  7791. const req = send(options);
  7792. let reqTimeout;
  7793. if (signal) {
  7794. signal.addEventListener('abort', abortAndFinalize);
  7795. }
  7796. function finalize() {
  7797. req.abort();
  7798. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7799. clearTimeout(reqTimeout);
  7800. }
  7801. if (request.timeout) {
  7802. req.once('socket', function (socket) {
  7803. reqTimeout = setTimeout(function () {
  7804. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7805. finalize();
  7806. }, request.timeout);
  7807. });
  7808. }
  7809. req.on('error', function (err) {
  7810. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7811. finalize();
  7812. });
  7813. req.on('response', function (res) {
  7814. clearTimeout(reqTimeout);
  7815. const headers = createHeadersLenient(res.headers);
  7816. // HTTP fetch step 5
  7817. if (fetch.isRedirect(res.statusCode)) {
  7818. // HTTP fetch step 5.2
  7819. const location = headers.get('Location');
  7820. // HTTP fetch step 5.3
  7821. const locationURL = location === null ? null : resolve_url(request.url, location);
  7822. // HTTP fetch step 5.5
  7823. switch (request.redirect) {
  7824. case 'error':
  7825. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7826. finalize();
  7827. return;
  7828. case 'manual':
  7829. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7830. if (locationURL !== null) {
  7831. // handle corrupted header
  7832. try {
  7833. headers.set('Location', locationURL);
  7834. } catch (err) {
  7835. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7836. reject(err);
  7837. }
  7838. }
  7839. break;
  7840. case 'follow':
  7841. // HTTP-redirect fetch step 2
  7842. if (locationURL === null) {
  7843. break;
  7844. }
  7845. // HTTP-redirect fetch step 5
  7846. if (request.counter >= request.follow) {
  7847. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7848. finalize();
  7849. return;
  7850. }
  7851. // HTTP-redirect fetch step 6 (counter increment)
  7852. // Create a new Request object.
  7853. const requestOpts = {
  7854. headers: new Headers(request.headers),
  7855. follow: request.follow,
  7856. counter: request.counter + 1,
  7857. agent: request.agent,
  7858. compress: request.compress,
  7859. method: request.method,
  7860. body: request.body,
  7861. signal: request.signal,
  7862. timeout: request.timeout
  7863. };
  7864. // HTTP-redirect fetch step 9
  7865. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7866. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7867. finalize();
  7868. return;
  7869. }
  7870. // HTTP-redirect fetch step 11
  7871. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7872. requestOpts.method = 'GET';
  7873. requestOpts.body = undefined;
  7874. requestOpts.headers.delete('content-length');
  7875. }
  7876. // HTTP-redirect fetch step 15
  7877. resolve(fetch(new Request(locationURL, requestOpts)));
  7878. finalize();
  7879. return;
  7880. }
  7881. }
  7882. // prepare response
  7883. res.once('end', function () {
  7884. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7885. });
  7886. let body = res.pipe(new PassThrough$1());
  7887. const response_options = {
  7888. url: request.url,
  7889. status: res.statusCode,
  7890. statusText: res.statusMessage,
  7891. headers: headers,
  7892. size: request.size,
  7893. timeout: request.timeout,
  7894. counter: request.counter
  7895. };
  7896. // HTTP-network fetch step 12.1.1.3
  7897. const codings = headers.get('Content-Encoding');
  7898. // HTTP-network fetch step 12.1.1.4: handle content codings
  7899. // in following scenarios we ignore compression support
  7900. // 1. compression support is disabled
  7901. // 2. HEAD request
  7902. // 3. no Content-Encoding header
  7903. // 4. no content response (204)
  7904. // 5. content not modified response (304)
  7905. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7906. response = new Response(body, response_options);
  7907. resolve(response);
  7908. return;
  7909. }
  7910. // For Node v6+
  7911. // Be less strict when decoding compressed responses, since sometimes
  7912. // servers send slightly invalid responses that are still accepted
  7913. // by common browsers.
  7914. // Always using Z_SYNC_FLUSH is what cURL does.
  7915. const zlibOptions = {
  7916. flush: zlib.Z_SYNC_FLUSH,
  7917. finishFlush: zlib.Z_SYNC_FLUSH
  7918. };
  7919. // for gzip
  7920. if (codings == 'gzip' || codings == 'x-gzip') {
  7921. body = body.pipe(zlib.createGunzip(zlibOptions));
  7922. response = new Response(body, response_options);
  7923. resolve(response);
  7924. return;
  7925. }
  7926. // for deflate
  7927. if (codings == 'deflate' || codings == 'x-deflate') {
  7928. // handle the infamous raw deflate response from old servers
  7929. // a hack for old IIS and Apache servers
  7930. const raw = res.pipe(new PassThrough$1());
  7931. raw.once('data', function (chunk) {
  7932. // see http://stackoverflow.com/questions/37519828
  7933. if ((chunk[0] & 0x0F) === 0x08) {
  7934. body = body.pipe(zlib.createInflate());
  7935. } else {
  7936. body = body.pipe(zlib.createInflateRaw());
  7937. }
  7938. response = new Response(body, response_options);
  7939. resolve(response);
  7940. });
  7941. return;
  7942. }
  7943. // for br
  7944. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7945. body = body.pipe(zlib.createBrotliDecompress());
  7946. response = new Response(body, response_options);
  7947. resolve(response);
  7948. return;
  7949. }
  7950. // otherwise, use response as-is
  7951. response = new Response(body, response_options);
  7952. resolve(response);
  7953. });
  7954. writeToStream(req, request);
  7955. });
  7956. }
  7957. /**
  7958. * Redirect code matching
  7959. *
  7960. * @param Number code Status code
  7961. * @return Boolean
  7962. */
  7963. fetch.isRedirect = function (code) {
  7964. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7965. };
  7966. // expose Promise
  7967. fetch.Promise = global.Promise;
  7968. module.exports = exports = fetch;
  7969. Object.defineProperty(exports, "__esModule", { value: true });
  7970. exports.default = exports;
  7971. exports.Headers = Headers;
  7972. exports.Request = Request;
  7973. exports.Response = Response;
  7974. exports.FetchError = FetchError;
  7975. /***/ }),
  7976. /***/ 462:
  7977. /***/ (function(module) {
  7978. "use strict";
  7979. // See http://www.robvanderwoude.com/escapechars.php
  7980. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7981. function escapeCommand(arg) {
  7982. // Escape meta chars
  7983. arg = arg.replace(metaCharsRegExp, '^$1');
  7984. return arg;
  7985. }
  7986. function escapeArgument(arg, doubleEscapeMetaChars) {
  7987. // Convert to string
  7988. arg = `${arg}`;
  7989. // Algorithm below is based on https://qntm.org/cmd
  7990. // Sequence of backslashes followed by a double quote:
  7991. // double up all the backslashes and escape the double quote
  7992. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7993. // Sequence of backslashes followed by the end of the string
  7994. // (which will become a double quote later):
  7995. // double up all the backslashes
  7996. arg = arg.replace(/(\\*)$/, '$1$1');
  7997. // All other backslashes occur literally
  7998. // Quote the whole thing:
  7999. arg = `"${arg}"`;
  8000. // Escape meta chars
  8001. arg = arg.replace(metaCharsRegExp, '^$1');
  8002. // Double escape meta chars if necessary
  8003. if (doubleEscapeMetaChars) {
  8004. arg = arg.replace(metaCharsRegExp, '^$1');
  8005. }
  8006. return arg;
  8007. }
  8008. module.exports.command = escapeCommand;
  8009. module.exports.argument = escapeArgument;
  8010. /***/ }),
  8011. /***/ 463:
  8012. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8013. "use strict";
  8014. Object.defineProperty(exports, '__esModule', { value: true });
  8015. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8016. var deprecation = __webpack_require__(692);
  8017. var once = _interopDefault(__webpack_require__(969));
  8018. const logOnce = once(deprecation => console.warn(deprecation));
  8019. /**
  8020. * Error with extra properties to help with debugging
  8021. */
  8022. class RequestError extends Error {
  8023. constructor(message, statusCode, options) {
  8024. super(message); // Maintains proper stack trace (only available on V8)
  8025. /* istanbul ignore next */
  8026. if (Error.captureStackTrace) {
  8027. Error.captureStackTrace(this, this.constructor);
  8028. }
  8029. this.name = "HttpError";
  8030. this.status = statusCode;
  8031. Object.defineProperty(this, "code", {
  8032. get() {
  8033. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8034. return statusCode;
  8035. }
  8036. });
  8037. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8038. const requestCopy = Object.assign({}, options.request);
  8039. if (options.request.headers.authorization) {
  8040. requestCopy.headers = Object.assign({}, options.request.headers, {
  8041. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8042. });
  8043. }
  8044. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8045. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8046. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8047. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8048. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8049. this.request = requestCopy;
  8050. }
  8051. }
  8052. exports.RequestError = RequestError;
  8053. //# sourceMappingURL=index.js.map
  8054. /***/ }),
  8055. /***/ 464:
  8056. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8057. "use strict";
  8058. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8059. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8060. return new (P || (P = Promise))(function (resolve, reject) {
  8061. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8062. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8063. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8064. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8065. });
  8066. };
  8067. var __importStar = (this && this.__importStar) || function (mod) {
  8068. if (mod && mod.__esModule) return mod;
  8069. var result = {};
  8070. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8071. result["default"] = mod;
  8072. return result;
  8073. };
  8074. var __importDefault = (this && this.__importDefault) || function (mod) {
  8075. return (mod && mod.__esModule) ? mod : { "default": mod };
  8076. };
  8077. Object.defineProperty(exports, "__esModule", { value: true });
  8078. const assert = __importStar(__webpack_require__(357));
  8079. const core = __importStar(__webpack_require__(470));
  8080. const fs = __importStar(__webpack_require__(747));
  8081. const github = __importStar(__webpack_require__(469));
  8082. const io = __importStar(__webpack_require__(1));
  8083. const path = __importStar(__webpack_require__(622));
  8084. const retryHelper = __importStar(__webpack_require__(587));
  8085. const toolCache = __importStar(__webpack_require__(533));
  8086. const v4_1 = __importDefault(__webpack_require__(826));
  8087. const IS_WINDOWS = process.platform === 'win32';
  8088. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8089. return __awaiter(this, void 0, void 0, function* () {
  8090. // Download the archive
  8091. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8092. core.info('Downloading the archive');
  8093. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8094. }));
  8095. // Write archive to disk
  8096. core.info('Writing archive to disk');
  8097. const uniqueId = v4_1.default();
  8098. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8099. yield fs.promises.writeFile(archivePath, archiveData);
  8100. archiveData = Buffer.from(''); // Free memory
  8101. // Extract archive
  8102. core.info('Extracting the archive');
  8103. const extractPath = path.join(repositoryPath, uniqueId);
  8104. yield io.mkdirP(extractPath);
  8105. if (IS_WINDOWS) {
  8106. yield toolCache.extractZip(archivePath, extractPath);
  8107. }
  8108. else {
  8109. yield toolCache.extractTar(archivePath, extractPath);
  8110. }
  8111. io.rmRF(archivePath);
  8112. // Determine the path of the repository content. The archive contains
  8113. // a top-level folder and the repository content is inside.
  8114. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8115. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8116. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8117. core.info(`Resolved version ${archiveVersion}`);
  8118. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8119. // Move the files
  8120. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8121. const sourcePath = path.join(tempRepositoryPath, fileName);
  8122. const targetPath = path.join(repositoryPath, fileName);
  8123. if (IS_WINDOWS) {
  8124. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8125. }
  8126. else {
  8127. yield io.mv(sourcePath, targetPath);
  8128. }
  8129. }
  8130. io.rmRF(extractPath);
  8131. });
  8132. }
  8133. exports.downloadRepository = downloadRepository;
  8134. function downloadArchive(authToken, owner, repo, ref, commit) {
  8135. return __awaiter(this, void 0, void 0, function* () {
  8136. const octokit = new github.GitHub(authToken);
  8137. const params = {
  8138. owner: owner,
  8139. repo: repo,
  8140. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8141. ref: commit || ref
  8142. };
  8143. const response = yield octokit.repos.getArchiveLink(params);
  8144. if (response.status != 200) {
  8145. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8146. }
  8147. return Buffer.from(response.data); // response.data is ArrayBuffer
  8148. });
  8149. }
  8150. /***/ }),
  8151. /***/ 469:
  8152. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8153. "use strict";
  8154. var __importStar = (this && this.__importStar) || function (mod) {
  8155. if (mod && mod.__esModule) return mod;
  8156. var result = {};
  8157. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8158. result["default"] = mod;
  8159. return result;
  8160. };
  8161. Object.defineProperty(exports, "__esModule", { value: true });
  8162. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8163. const graphql_1 = __webpack_require__(898);
  8164. const rest_1 = __webpack_require__(0);
  8165. const Context = __importStar(__webpack_require__(262));
  8166. const httpClient = __importStar(__webpack_require__(539));
  8167. // We need this in order to extend Octokit
  8168. rest_1.Octokit.prototype = new rest_1.Octokit();
  8169. exports.context = new Context.Context();
  8170. class GitHub extends rest_1.Octokit {
  8171. constructor(token, opts) {
  8172. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8173. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8174. }
  8175. /**
  8176. * Disambiguates the constructor overload parameters
  8177. */
  8178. static disambiguate(token, opts) {
  8179. return [
  8180. typeof token === 'string' ? token : '',
  8181. typeof token === 'object' ? token : opts || {}
  8182. ];
  8183. }
  8184. static getOctokitOptions(args) {
  8185. const token = args[0];
  8186. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8187. // Base URL - GHES or Dotcom
  8188. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8189. // Auth
  8190. const auth = GitHub.getAuthString(token, options);
  8191. if (auth) {
  8192. options.auth = auth;
  8193. }
  8194. // Proxy
  8195. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8196. if (agent) {
  8197. // Shallow clone - don't mutate the object provided by the caller
  8198. options.request = options.request ? Object.assign({}, options.request) : {};
  8199. // Set the agent
  8200. options.request.agent = agent;
  8201. }
  8202. return options;
  8203. }
  8204. static getGraphQL(args) {
  8205. const defaults = {};
  8206. defaults.baseUrl = this.getGraphQLBaseUrl();
  8207. const token = args[0];
  8208. const options = args[1];
  8209. // Authorization
  8210. const auth = this.getAuthString(token, options);
  8211. if (auth) {
  8212. defaults.headers = {
  8213. authorization: auth
  8214. };
  8215. }
  8216. // Proxy
  8217. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8218. if (agent) {
  8219. defaults.request = { agent };
  8220. }
  8221. return graphql_1.graphql.defaults(defaults);
  8222. }
  8223. static getAuthString(token, options) {
  8224. // Validate args
  8225. if (!token && !options.auth) {
  8226. throw new Error('Parameter token or opts.auth is required');
  8227. }
  8228. else if (token && options.auth) {
  8229. throw new Error('Parameters token and opts.auth may not both be specified');
  8230. }
  8231. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8232. }
  8233. static getProxyAgent(destinationUrl, options) {
  8234. var _a;
  8235. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8236. if (httpClient.getProxyUrl(destinationUrl)) {
  8237. const hc = new httpClient.HttpClient();
  8238. return hc.getAgent(destinationUrl);
  8239. }
  8240. }
  8241. return undefined;
  8242. }
  8243. static getApiBaseUrl() {
  8244. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8245. }
  8246. static getGraphQLBaseUrl() {
  8247. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8248. // Shouldn't be a trailing slash, but remove if so
  8249. if (url.endsWith('/')) {
  8250. url = url.substr(0, url.length - 1);
  8251. }
  8252. // Remove trailing "/graphql"
  8253. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8254. url = url.substr(0, url.length - '/graphql'.length);
  8255. }
  8256. return url;
  8257. }
  8258. }
  8259. exports.GitHub = GitHub;
  8260. //# sourceMappingURL=github.js.map
  8261. /***/ }),
  8262. /***/ 470:
  8263. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8264. "use strict";
  8265. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8266. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8267. return new (P || (P = Promise))(function (resolve, reject) {
  8268. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8269. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8270. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8271. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8272. });
  8273. };
  8274. Object.defineProperty(exports, "__esModule", { value: true });
  8275. const command_1 = __webpack_require__(431);
  8276. const os = __webpack_require__(87);
  8277. const path = __webpack_require__(622);
  8278. /**
  8279. * The code to exit an action
  8280. */
  8281. var ExitCode;
  8282. (function (ExitCode) {
  8283. /**
  8284. * A code indicating that the action was successful
  8285. */
  8286. ExitCode[ExitCode["Success"] = 0] = "Success";
  8287. /**
  8288. * A code indicating that the action was a failure
  8289. */
  8290. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8291. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8292. //-----------------------------------------------------------------------
  8293. // Variables
  8294. //-----------------------------------------------------------------------
  8295. /**
  8296. * Sets env variable for this action and future actions in the job
  8297. * @param name the name of the variable to set
  8298. * @param val the value of the variable
  8299. */
  8300. function exportVariable(name, val) {
  8301. process.env[name] = val;
  8302. command_1.issueCommand('set-env', { name }, val);
  8303. }
  8304. exports.exportVariable = exportVariable;
  8305. /**
  8306. * Registers a secret which will get masked from logs
  8307. * @param secret value of the secret
  8308. */
  8309. function setSecret(secret) {
  8310. command_1.issueCommand('add-mask', {}, secret);
  8311. }
  8312. exports.setSecret = setSecret;
  8313. /**
  8314. * Prepends inputPath to the PATH (for this action and future actions)
  8315. * @param inputPath
  8316. */
  8317. function addPath(inputPath) {
  8318. command_1.issueCommand('add-path', {}, inputPath);
  8319. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8320. }
  8321. exports.addPath = addPath;
  8322. /**
  8323. * Gets the value of an input. The value is also trimmed.
  8324. *
  8325. * @param name name of the input to get
  8326. * @param options optional. See InputOptions.
  8327. * @returns string
  8328. */
  8329. function getInput(name, options) {
  8330. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8331. if (options && options.required && !val) {
  8332. throw new Error(`Input required and not supplied: ${name}`);
  8333. }
  8334. return val.trim();
  8335. }
  8336. exports.getInput = getInput;
  8337. /**
  8338. * Sets the value of an output.
  8339. *
  8340. * @param name name of the output to set
  8341. * @param value value to store
  8342. */
  8343. function setOutput(name, value) {
  8344. command_1.issueCommand('set-output', { name }, value);
  8345. }
  8346. exports.setOutput = setOutput;
  8347. //-----------------------------------------------------------------------
  8348. // Results
  8349. //-----------------------------------------------------------------------
  8350. /**
  8351. * Sets the action status to failed.
  8352. * When the action exits it will be with an exit code of 1
  8353. * @param message add error issue message
  8354. */
  8355. function setFailed(message) {
  8356. process.exitCode = ExitCode.Failure;
  8357. error(message);
  8358. }
  8359. exports.setFailed = setFailed;
  8360. //-----------------------------------------------------------------------
  8361. // Logging Commands
  8362. //-----------------------------------------------------------------------
  8363. /**
  8364. * Writes debug message to user log
  8365. * @param message debug message
  8366. */
  8367. function debug(message) {
  8368. command_1.issueCommand('debug', {}, message);
  8369. }
  8370. exports.debug = debug;
  8371. /**
  8372. * Adds an error issue
  8373. * @param message error issue message
  8374. */
  8375. function error(message) {
  8376. command_1.issue('error', message);
  8377. }
  8378. exports.error = error;
  8379. /**
  8380. * Adds an warning issue
  8381. * @param message warning issue message
  8382. */
  8383. function warning(message) {
  8384. command_1.issue('warning', message);
  8385. }
  8386. exports.warning = warning;
  8387. /**
  8388. * Writes info to log with console.log.
  8389. * @param message info message
  8390. */
  8391. function info(message) {
  8392. process.stdout.write(message + os.EOL);
  8393. }
  8394. exports.info = info;
  8395. /**
  8396. * Begin an output group.
  8397. *
  8398. * Output until the next `groupEnd` will be foldable in this group
  8399. *
  8400. * @param name The name of the output group
  8401. */
  8402. function startGroup(name) {
  8403. command_1.issue('group', name);
  8404. }
  8405. exports.startGroup = startGroup;
  8406. /**
  8407. * End an output group.
  8408. */
  8409. function endGroup() {
  8410. command_1.issue('endgroup');
  8411. }
  8412. exports.endGroup = endGroup;
  8413. /**
  8414. * Wrap an asynchronous function call in a group.
  8415. *
  8416. * Returns the same type as the function itself.
  8417. *
  8418. * @param name The name of the group
  8419. * @param fn The function to wrap in the group
  8420. */
  8421. function group(name, fn) {
  8422. return __awaiter(this, void 0, void 0, function* () {
  8423. startGroup(name);
  8424. let result;
  8425. try {
  8426. result = yield fn();
  8427. }
  8428. finally {
  8429. endGroup();
  8430. }
  8431. return result;
  8432. });
  8433. }
  8434. exports.group = group;
  8435. //# sourceMappingURL=core.js.map
  8436. /***/ }),
  8437. /***/ 471:
  8438. /***/ (function(module, __unusedexports, __webpack_require__) {
  8439. module.exports = authenticationBeforeRequest;
  8440. const btoa = __webpack_require__(675);
  8441. const uniq = __webpack_require__(126);
  8442. function authenticationBeforeRequest(state, options) {
  8443. if (!state.auth.type) {
  8444. return;
  8445. }
  8446. if (state.auth.type === "basic") {
  8447. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8448. options.headers.authorization = `Basic ${hash}`;
  8449. return;
  8450. }
  8451. if (state.auth.type === "token") {
  8452. options.headers.authorization = `token ${state.auth.token}`;
  8453. return;
  8454. }
  8455. if (state.auth.type === "app") {
  8456. options.headers.authorization = `Bearer ${state.auth.token}`;
  8457. const acceptHeaders = options.headers.accept
  8458. .split(",")
  8459. .concat("application/vnd.github.machine-man-preview+json");
  8460. options.headers.accept = uniq(acceptHeaders)
  8461. .filter(Boolean)
  8462. .join(",");
  8463. return;
  8464. }
  8465. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8466. if (state.auth.token) {
  8467. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8468. return;
  8469. }
  8470. const key = encodeURIComponent(state.auth.key);
  8471. const secret = encodeURIComponent(state.auth.secret);
  8472. options.url += `client_id=${key}&client_secret=${secret}`;
  8473. }
  8474. /***/ }),
  8475. /***/ 489:
  8476. /***/ (function(module, __unusedexports, __webpack_require__) {
  8477. "use strict";
  8478. const path = __webpack_require__(622);
  8479. const which = __webpack_require__(814);
  8480. const pathKey = __webpack_require__(39)();
  8481. function resolveCommandAttempt(parsed, withoutPathExt) {
  8482. const cwd = process.cwd();
  8483. const hasCustomCwd = parsed.options.cwd != null;
  8484. // If a custom `cwd` was specified, we need to change the process cwd
  8485. // because `which` will do stat calls but does not support a custom cwd
  8486. if (hasCustomCwd) {
  8487. try {
  8488. process.chdir(parsed.options.cwd);
  8489. } catch (err) {
  8490. /* Empty */
  8491. }
  8492. }
  8493. let resolved;
  8494. try {
  8495. resolved = which.sync(parsed.command, {
  8496. path: (parsed.options.env || process.env)[pathKey],
  8497. pathExt: withoutPathExt ? path.delimiter : undefined,
  8498. });
  8499. } catch (e) {
  8500. /* Empty */
  8501. } finally {
  8502. process.chdir(cwd);
  8503. }
  8504. // If we successfully resolved, ensure that an absolute path is returned
  8505. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8506. if (resolved) {
  8507. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8508. }
  8509. return resolved;
  8510. }
  8511. function resolveCommand(parsed) {
  8512. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8513. }
  8514. module.exports = resolveCommand;
  8515. /***/ }),
  8516. /***/ 497:
  8517. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8518. "use strict";
  8519. Object.defineProperty(exports, '__esModule', { value: true });
  8520. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8521. var deprecation = __webpack_require__(692);
  8522. var once = _interopDefault(__webpack_require__(969));
  8523. const logOnce = once(deprecation => console.warn(deprecation));
  8524. /**
  8525. * Error with extra properties to help with debugging
  8526. */
  8527. class RequestError extends Error {
  8528. constructor(message, statusCode, options) {
  8529. super(message); // Maintains proper stack trace (only available on V8)
  8530. /* istanbul ignore next */
  8531. if (Error.captureStackTrace) {
  8532. Error.captureStackTrace(this, this.constructor);
  8533. }
  8534. this.name = "HttpError";
  8535. this.status = statusCode;
  8536. Object.defineProperty(this, "code", {
  8537. get() {
  8538. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8539. return statusCode;
  8540. }
  8541. });
  8542. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8543. const requestCopy = Object.assign({}, options.request);
  8544. if (options.request.headers.authorization) {
  8545. requestCopy.headers = Object.assign({}, options.request.headers, {
  8546. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8547. });
  8548. }
  8549. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8550. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8551. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8552. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8553. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8554. this.request = requestCopy;
  8555. }
  8556. }
  8557. exports.RequestError = RequestError;
  8558. //# sourceMappingURL=index.js.map
  8559. /***/ }),
  8560. /***/ 510:
  8561. /***/ (function(module) {
  8562. module.exports = addHook
  8563. function addHook (state, kind, name, hook) {
  8564. var orig = hook
  8565. if (!state.registry[name]) {
  8566. state.registry[name] = []
  8567. }
  8568. if (kind === 'before') {
  8569. hook = function (method, options) {
  8570. return Promise.resolve()
  8571. .then(orig.bind(null, options))
  8572. .then(method.bind(null, options))
  8573. }
  8574. }
  8575. if (kind === 'after') {
  8576. hook = function (method, options) {
  8577. var result
  8578. return Promise.resolve()
  8579. .then(method.bind(null, options))
  8580. .then(function (result_) {
  8581. result = result_
  8582. return orig(result, options)
  8583. })
  8584. .then(function () {
  8585. return result
  8586. })
  8587. }
  8588. }
  8589. if (kind === 'error') {
  8590. hook = function (method, options) {
  8591. return Promise.resolve()
  8592. .then(method.bind(null, options))
  8593. .catch(function (error) {
  8594. return orig(error, options)
  8595. })
  8596. }
  8597. }
  8598. state.registry[name].push({
  8599. hook: hook,
  8600. orig: orig
  8601. })
  8602. }
  8603. /***/ }),
  8604. /***/ 523:
  8605. /***/ (function(module, __unusedexports, __webpack_require__) {
  8606. var register = __webpack_require__(363)
  8607. var addHook = __webpack_require__(510)
  8608. var removeHook = __webpack_require__(763)
  8609. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8610. var bind = Function.bind
  8611. var bindable = bind.bind(bind)
  8612. function bindApi (hook, state, name) {
  8613. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8614. hook.api = { remove: removeHookRef }
  8615. hook.remove = removeHookRef
  8616. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8617. var args = name ? [state, kind, name] : [state, kind]
  8618. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8619. })
  8620. }
  8621. function HookSingular () {
  8622. var singularHookName = 'h'
  8623. var singularHookState = {
  8624. registry: {}
  8625. }
  8626. var singularHook = register.bind(null, singularHookState, singularHookName)
  8627. bindApi(singularHook, singularHookState, singularHookName)
  8628. return singularHook
  8629. }
  8630. function HookCollection () {
  8631. var state = {
  8632. registry: {}
  8633. }
  8634. var hook = register.bind(null, state)
  8635. bindApi(hook, state)
  8636. return hook
  8637. }
  8638. var collectionHookDeprecationMessageDisplayed = false
  8639. function Hook () {
  8640. if (!collectionHookDeprecationMessageDisplayed) {
  8641. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8642. collectionHookDeprecationMessageDisplayed = true
  8643. }
  8644. return HookCollection()
  8645. }
  8646. Hook.Singular = HookSingular.bind()
  8647. Hook.Collection = HookCollection.bind()
  8648. module.exports = Hook
  8649. // expose constructors as a named property for TypeScript
  8650. module.exports.Hook = Hook
  8651. module.exports.Singular = Hook.Singular
  8652. module.exports.Collection = Hook.Collection
  8653. /***/ }),
  8654. /***/ 528:
  8655. /***/ (function(__unusedmodule, exports) {
  8656. "use strict";
  8657. Object.defineProperty(exports, "__esModule", { value: true });
  8658. function escape(value) {
  8659. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8660. return `\\${x}`;
  8661. });
  8662. }
  8663. exports.escape = escape;
  8664. /***/ }),
  8665. /***/ 529:
  8666. /***/ (function(module, __unusedexports, __webpack_require__) {
  8667. const factory = __webpack_require__(47);
  8668. module.exports = factory();
  8669. /***/ }),
  8670. /***/ 533:
  8671. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8672. "use strict";
  8673. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8674. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8675. return new (P || (P = Promise))(function (resolve, reject) {
  8676. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8677. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8678. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8679. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8680. });
  8681. };
  8682. Object.defineProperty(exports, "__esModule", { value: true });
  8683. const core = __webpack_require__(470);
  8684. const io = __webpack_require__(1);
  8685. const fs = __webpack_require__(747);
  8686. const os = __webpack_require__(87);
  8687. const path = __webpack_require__(622);
  8688. const httpm = __webpack_require__(874);
  8689. const semver = __webpack_require__(656);
  8690. const uuidV4 = __webpack_require__(826);
  8691. const exec_1 = __webpack_require__(986);
  8692. const assert_1 = __webpack_require__(357);
  8693. class HTTPError extends Error {
  8694. constructor(httpStatusCode) {
  8695. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8696. this.httpStatusCode = httpStatusCode;
  8697. Object.setPrototypeOf(this, new.target.prototype);
  8698. }
  8699. }
  8700. exports.HTTPError = HTTPError;
  8701. const IS_WINDOWS = process.platform === 'win32';
  8702. const userAgent = 'actions/tool-cache';
  8703. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8704. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8705. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8706. // If directories not found, place them in common temp locations
  8707. if (!tempDirectory || !cacheRoot) {
  8708. let baseLocation;
  8709. if (IS_WINDOWS) {
  8710. // On windows use the USERPROFILE env variable
  8711. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8712. }
  8713. else {
  8714. if (process.platform === 'darwin') {
  8715. baseLocation = '/Users';
  8716. }
  8717. else {
  8718. baseLocation = '/home';
  8719. }
  8720. }
  8721. if (!tempDirectory) {
  8722. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8723. }
  8724. if (!cacheRoot) {
  8725. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8726. }
  8727. }
  8728. /**
  8729. * Download a tool from an url and stream it into a file
  8730. *
  8731. * @param url url of tool to download
  8732. * @returns path to downloaded tool
  8733. */
  8734. function downloadTool(url) {
  8735. return __awaiter(this, void 0, void 0, function* () {
  8736. // Wrap in a promise so that we can resolve from within stream callbacks
  8737. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8738. try {
  8739. const http = new httpm.HttpClient(userAgent, [], {
  8740. allowRetries: true,
  8741. maxRetries: 3
  8742. });
  8743. const destPath = path.join(tempDirectory, uuidV4());
  8744. yield io.mkdirP(tempDirectory);
  8745. core.debug(`Downloading ${url}`);
  8746. core.debug(`Downloading ${destPath}`);
  8747. if (fs.existsSync(destPath)) {
  8748. throw new Error(`Destination file path ${destPath} already exists`);
  8749. }
  8750. const response = yield http.get(url);
  8751. if (response.message.statusCode !== 200) {
  8752. const err = new HTTPError(response.message.statusCode);
  8753. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8754. throw err;
  8755. }
  8756. const file = fs.createWriteStream(destPath);
  8757. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8758. try {
  8759. const stream = response.message.pipe(file);
  8760. stream.on('close', () => {
  8761. core.debug('download complete');
  8762. resolve(destPath);
  8763. });
  8764. }
  8765. catch (err) {
  8766. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8767. reject(err);
  8768. }
  8769. }));
  8770. file.on('error', err => {
  8771. file.end();
  8772. reject(err);
  8773. });
  8774. }
  8775. catch (err) {
  8776. reject(err);
  8777. }
  8778. }));
  8779. });
  8780. }
  8781. exports.downloadTool = downloadTool;
  8782. /**
  8783. * Extract a .7z file
  8784. *
  8785. * @param file path to the .7z file
  8786. * @param dest destination directory. Optional.
  8787. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8788. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8789. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8790. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8791. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8792. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8793. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8794. * to 7zr.exe can be pass to this function.
  8795. * @returns path to the destination directory
  8796. */
  8797. function extract7z(file, dest, _7zPath) {
  8798. return __awaiter(this, void 0, void 0, function* () {
  8799. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8800. assert_1.ok(file, 'parameter "file" is required');
  8801. dest = dest || (yield _createExtractFolder(dest));
  8802. const originalCwd = process.cwd();
  8803. process.chdir(dest);
  8804. if (_7zPath) {
  8805. try {
  8806. const args = [
  8807. 'x',
  8808. '-bb1',
  8809. '-bd',
  8810. '-sccUTF-8',
  8811. file
  8812. ];
  8813. const options = {
  8814. silent: true
  8815. };
  8816. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8817. }
  8818. finally {
  8819. process.chdir(originalCwd);
  8820. }
  8821. }
  8822. else {
  8823. const escapedScript = path
  8824. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8825. .replace(/'/g, "''")
  8826. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8827. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8828. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8829. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8830. const args = [
  8831. '-NoLogo',
  8832. '-Sta',
  8833. '-NoProfile',
  8834. '-NonInteractive',
  8835. '-ExecutionPolicy',
  8836. 'Unrestricted',
  8837. '-Command',
  8838. command
  8839. ];
  8840. const options = {
  8841. silent: true
  8842. };
  8843. try {
  8844. const powershellPath = yield io.which('powershell', true);
  8845. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8846. }
  8847. finally {
  8848. process.chdir(originalCwd);
  8849. }
  8850. }
  8851. return dest;
  8852. });
  8853. }
  8854. exports.extract7z = extract7z;
  8855. /**
  8856. * Extract a tar
  8857. *
  8858. * @param file path to the tar
  8859. * @param dest destination directory. Optional.
  8860. * @param flags flags for the tar. Optional.
  8861. * @returns path to the destination directory
  8862. */
  8863. function extractTar(file, dest, flags = 'xz') {
  8864. return __awaiter(this, void 0, void 0, function* () {
  8865. if (!file) {
  8866. throw new Error("parameter 'file' is required");
  8867. }
  8868. dest = dest || (yield _createExtractFolder(dest));
  8869. const tarPath = yield io.which('tar', true);
  8870. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8871. return dest;
  8872. });
  8873. }
  8874. exports.extractTar = extractTar;
  8875. /**
  8876. * Extract a zip
  8877. *
  8878. * @param file path to the zip
  8879. * @param dest destination directory. Optional.
  8880. * @returns path to the destination directory
  8881. */
  8882. function extractZip(file, dest) {
  8883. return __awaiter(this, void 0, void 0, function* () {
  8884. if (!file) {
  8885. throw new Error("parameter 'file' is required");
  8886. }
  8887. dest = dest || (yield _createExtractFolder(dest));
  8888. if (IS_WINDOWS) {
  8889. yield extractZipWin(file, dest);
  8890. }
  8891. else {
  8892. yield extractZipNix(file, dest);
  8893. }
  8894. return dest;
  8895. });
  8896. }
  8897. exports.extractZip = extractZip;
  8898. function extractZipWin(file, dest) {
  8899. return __awaiter(this, void 0, void 0, function* () {
  8900. // build the powershell command
  8901. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8902. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8903. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8904. // run powershell
  8905. const powershellPath = yield io.which('powershell');
  8906. const args = [
  8907. '-NoLogo',
  8908. '-Sta',
  8909. '-NoProfile',
  8910. '-NonInteractive',
  8911. '-ExecutionPolicy',
  8912. 'Unrestricted',
  8913. '-Command',
  8914. command
  8915. ];
  8916. yield exec_1.exec(`"${powershellPath}"`, args);
  8917. });
  8918. }
  8919. function extractZipNix(file, dest) {
  8920. return __awaiter(this, void 0, void 0, function* () {
  8921. const unzipPath = yield io.which('unzip');
  8922. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8923. });
  8924. }
  8925. /**
  8926. * Caches a directory and installs it into the tool cacheDir
  8927. *
  8928. * @param sourceDir the directory to cache into tools
  8929. * @param tool tool name
  8930. * @param version version of the tool. semver format
  8931. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8932. */
  8933. function cacheDir(sourceDir, tool, version, arch) {
  8934. return __awaiter(this, void 0, void 0, function* () {
  8935. version = semver.clean(version) || version;
  8936. arch = arch || os.arch();
  8937. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8938. core.debug(`source dir: ${sourceDir}`);
  8939. if (!fs.statSync(sourceDir).isDirectory()) {
  8940. throw new Error('sourceDir is not a directory');
  8941. }
  8942. // Create the tool dir
  8943. const destPath = yield _createToolPath(tool, version, arch);
  8944. // copy each child item. do not move. move can fail on Windows
  8945. // due to anti-virus software having an open handle on a file.
  8946. for (const itemName of fs.readdirSync(sourceDir)) {
  8947. const s = path.join(sourceDir, itemName);
  8948. yield io.cp(s, destPath, { recursive: true });
  8949. }
  8950. // write .complete
  8951. _completeToolPath(tool, version, arch);
  8952. return destPath;
  8953. });
  8954. }
  8955. exports.cacheDir = cacheDir;
  8956. /**
  8957. * Caches a downloaded file (GUID) and installs it
  8958. * into the tool cache with a given targetName
  8959. *
  8960. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8961. * @param targetFile the name of the file name in the tools directory
  8962. * @param tool tool name
  8963. * @param version version of the tool. semver format
  8964. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8965. */
  8966. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8967. return __awaiter(this, void 0, void 0, function* () {
  8968. version = semver.clean(version) || version;
  8969. arch = arch || os.arch();
  8970. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8971. core.debug(`source file: ${sourceFile}`);
  8972. if (!fs.statSync(sourceFile).isFile()) {
  8973. throw new Error('sourceFile is not a file');
  8974. }
  8975. // create the tool dir
  8976. const destFolder = yield _createToolPath(tool, version, arch);
  8977. // copy instead of move. move can fail on Windows due to
  8978. // anti-virus software having an open handle on a file.
  8979. const destPath = path.join(destFolder, targetFile);
  8980. core.debug(`destination file ${destPath}`);
  8981. yield io.cp(sourceFile, destPath);
  8982. // write .complete
  8983. _completeToolPath(tool, version, arch);
  8984. return destFolder;
  8985. });
  8986. }
  8987. exports.cacheFile = cacheFile;
  8988. /**
  8989. * Finds the path to a tool version in the local installed tool cache
  8990. *
  8991. * @param toolName name of the tool
  8992. * @param versionSpec version of the tool
  8993. * @param arch optional arch. defaults to arch of computer
  8994. */
  8995. function find(toolName, versionSpec, arch) {
  8996. if (!toolName) {
  8997. throw new Error('toolName parameter is required');
  8998. }
  8999. if (!versionSpec) {
  9000. throw new Error('versionSpec parameter is required');
  9001. }
  9002. arch = arch || os.arch();
  9003. // attempt to resolve an explicit version
  9004. if (!_isExplicitVersion(versionSpec)) {
  9005. const localVersions = findAllVersions(toolName, arch);
  9006. const match = _evaluateVersions(localVersions, versionSpec);
  9007. versionSpec = match;
  9008. }
  9009. // check for the explicit version in the cache
  9010. let toolPath = '';
  9011. if (versionSpec) {
  9012. versionSpec = semver.clean(versionSpec) || '';
  9013. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9014. core.debug(`checking cache: ${cachePath}`);
  9015. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9016. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9017. toolPath = cachePath;
  9018. }
  9019. else {
  9020. core.debug('not found');
  9021. }
  9022. }
  9023. return toolPath;
  9024. }
  9025. exports.find = find;
  9026. /**
  9027. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9028. *
  9029. * @param toolName name of the tool
  9030. * @param arch optional arch. defaults to arch of computer
  9031. */
  9032. function findAllVersions(toolName, arch) {
  9033. const versions = [];
  9034. arch = arch || os.arch();
  9035. const toolPath = path.join(cacheRoot, toolName);
  9036. if (fs.existsSync(toolPath)) {
  9037. const children = fs.readdirSync(toolPath);
  9038. for (const child of children) {
  9039. if (_isExplicitVersion(child)) {
  9040. const fullPath = path.join(toolPath, child, arch || '');
  9041. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9042. versions.push(child);
  9043. }
  9044. }
  9045. }
  9046. }
  9047. return versions;
  9048. }
  9049. exports.findAllVersions = findAllVersions;
  9050. function _createExtractFolder(dest) {
  9051. return __awaiter(this, void 0, void 0, function* () {
  9052. if (!dest) {
  9053. // create a temp dir
  9054. dest = path.join(tempDirectory, uuidV4());
  9055. }
  9056. yield io.mkdirP(dest);
  9057. return dest;
  9058. });
  9059. }
  9060. function _createToolPath(tool, version, arch) {
  9061. return __awaiter(this, void 0, void 0, function* () {
  9062. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9063. core.debug(`destination ${folderPath}`);
  9064. const markerPath = `${folderPath}.complete`;
  9065. yield io.rmRF(folderPath);
  9066. yield io.rmRF(markerPath);
  9067. yield io.mkdirP(folderPath);
  9068. return folderPath;
  9069. });
  9070. }
  9071. function _completeToolPath(tool, version, arch) {
  9072. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9073. const markerPath = `${folderPath}.complete`;
  9074. fs.writeFileSync(markerPath, '');
  9075. core.debug('finished caching tool');
  9076. }
  9077. function _isExplicitVersion(versionSpec) {
  9078. const c = semver.clean(versionSpec) || '';
  9079. core.debug(`isExplicit: ${c}`);
  9080. const valid = semver.valid(c) != null;
  9081. core.debug(`explicit? ${valid}`);
  9082. return valid;
  9083. }
  9084. function _evaluateVersions(versions, versionSpec) {
  9085. let version = '';
  9086. core.debug(`evaluating ${versions.length} versions`);
  9087. versions = versions.sort((a, b) => {
  9088. if (semver.gt(a, b)) {
  9089. return 1;
  9090. }
  9091. return -1;
  9092. });
  9093. for (let i = versions.length - 1; i >= 0; i--) {
  9094. const potential = versions[i];
  9095. const satisfied = semver.satisfies(potential, versionSpec);
  9096. if (satisfied) {
  9097. version = potential;
  9098. break;
  9099. }
  9100. }
  9101. if (version) {
  9102. core.debug(`matched: ${version}`);
  9103. }
  9104. else {
  9105. core.debug('match not found');
  9106. }
  9107. return version;
  9108. }
  9109. //# sourceMappingURL=tool-cache.js.map
  9110. /***/ }),
  9111. /***/ 536:
  9112. /***/ (function(module, __unusedexports, __webpack_require__) {
  9113. module.exports = hasFirstPage
  9114. const deprecate = __webpack_require__(370)
  9115. const getPageLinks = __webpack_require__(577)
  9116. function hasFirstPage (link) {
  9117. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9118. return getPageLinks(link).first
  9119. }
  9120. /***/ }),
  9121. /***/ 539:
  9122. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9123. "use strict";
  9124. Object.defineProperty(exports, "__esModule", { value: true });
  9125. const url = __webpack_require__(835);
  9126. const http = __webpack_require__(605);
  9127. const https = __webpack_require__(34);
  9128. const pm = __webpack_require__(950);
  9129. let tunnel;
  9130. var HttpCodes;
  9131. (function (HttpCodes) {
  9132. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9133. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9134. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9135. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9136. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9137. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9138. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9139. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9140. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9141. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9142. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9143. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9144. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9145. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9146. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9147. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9148. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9149. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9150. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9151. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9152. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9153. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9154. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9155. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9156. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9157. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9158. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9159. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9160. var Headers;
  9161. (function (Headers) {
  9162. Headers["Accept"] = "accept";
  9163. Headers["ContentType"] = "content-type";
  9164. })(Headers = exports.Headers || (exports.Headers = {}));
  9165. var MediaTypes;
  9166. (function (MediaTypes) {
  9167. MediaTypes["ApplicationJson"] = "application/json";
  9168. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9169. /**
  9170. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9171. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9172. */
  9173. function getProxyUrl(serverUrl) {
  9174. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9175. return proxyUrl ? proxyUrl.href : '';
  9176. }
  9177. exports.getProxyUrl = getProxyUrl;
  9178. const HttpRedirectCodes = [
  9179. HttpCodes.MovedPermanently,
  9180. HttpCodes.ResourceMoved,
  9181. HttpCodes.SeeOther,
  9182. HttpCodes.TemporaryRedirect,
  9183. HttpCodes.PermanentRedirect
  9184. ];
  9185. const HttpResponseRetryCodes = [
  9186. HttpCodes.BadGateway,
  9187. HttpCodes.ServiceUnavailable,
  9188. HttpCodes.GatewayTimeout
  9189. ];
  9190. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9191. const ExponentialBackoffCeiling = 10;
  9192. const ExponentialBackoffTimeSlice = 5;
  9193. class HttpClientResponse {
  9194. constructor(message) {
  9195. this.message = message;
  9196. }
  9197. readBody() {
  9198. return new Promise(async (resolve, reject) => {
  9199. let output = Buffer.alloc(0);
  9200. this.message.on('data', (chunk) => {
  9201. output = Buffer.concat([output, chunk]);
  9202. });
  9203. this.message.on('end', () => {
  9204. resolve(output.toString());
  9205. });
  9206. });
  9207. }
  9208. }
  9209. exports.HttpClientResponse = HttpClientResponse;
  9210. function isHttps(requestUrl) {
  9211. let parsedUrl = url.parse(requestUrl);
  9212. return parsedUrl.protocol === 'https:';
  9213. }
  9214. exports.isHttps = isHttps;
  9215. class HttpClient {
  9216. constructor(userAgent, handlers, requestOptions) {
  9217. this._ignoreSslError = false;
  9218. this._allowRedirects = true;
  9219. this._allowRedirectDowngrade = false;
  9220. this._maxRedirects = 50;
  9221. this._allowRetries = false;
  9222. this._maxRetries = 1;
  9223. this._keepAlive = false;
  9224. this._disposed = false;
  9225. this.userAgent = userAgent;
  9226. this.handlers = handlers || [];
  9227. this.requestOptions = requestOptions;
  9228. if (requestOptions) {
  9229. if (requestOptions.ignoreSslError != null) {
  9230. this._ignoreSslError = requestOptions.ignoreSslError;
  9231. }
  9232. this._socketTimeout = requestOptions.socketTimeout;
  9233. if (requestOptions.allowRedirects != null) {
  9234. this._allowRedirects = requestOptions.allowRedirects;
  9235. }
  9236. if (requestOptions.allowRedirectDowngrade != null) {
  9237. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9238. }
  9239. if (requestOptions.maxRedirects != null) {
  9240. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9241. }
  9242. if (requestOptions.keepAlive != null) {
  9243. this._keepAlive = requestOptions.keepAlive;
  9244. }
  9245. if (requestOptions.allowRetries != null) {
  9246. this._allowRetries = requestOptions.allowRetries;
  9247. }
  9248. if (requestOptions.maxRetries != null) {
  9249. this._maxRetries = requestOptions.maxRetries;
  9250. }
  9251. }
  9252. }
  9253. options(requestUrl, additionalHeaders) {
  9254. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9255. }
  9256. get(requestUrl, additionalHeaders) {
  9257. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9258. }
  9259. del(requestUrl, additionalHeaders) {
  9260. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9261. }
  9262. post(requestUrl, data, additionalHeaders) {
  9263. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9264. }
  9265. patch(requestUrl, data, additionalHeaders) {
  9266. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9267. }
  9268. put(requestUrl, data, additionalHeaders) {
  9269. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9270. }
  9271. head(requestUrl, additionalHeaders) {
  9272. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9273. }
  9274. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9275. return this.request(verb, requestUrl, stream, additionalHeaders);
  9276. }
  9277. /**
  9278. * Gets a typed object from an endpoint
  9279. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9280. */
  9281. async getJson(requestUrl, additionalHeaders = {}) {
  9282. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9283. let res = await this.get(requestUrl, additionalHeaders);
  9284. return this._processResponse(res, this.requestOptions);
  9285. }
  9286. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9287. let data = JSON.stringify(obj, null, 2);
  9288. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9289. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9290. let res = await this.post(requestUrl, data, additionalHeaders);
  9291. return this._processResponse(res, this.requestOptions);
  9292. }
  9293. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9294. let data = JSON.stringify(obj, null, 2);
  9295. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9296. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9297. let res = await this.put(requestUrl, data, additionalHeaders);
  9298. return this._processResponse(res, this.requestOptions);
  9299. }
  9300. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9301. let data = JSON.stringify(obj, null, 2);
  9302. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9303. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9304. let res = await this.patch(requestUrl, data, additionalHeaders);
  9305. return this._processResponse(res, this.requestOptions);
  9306. }
  9307. /**
  9308. * Makes a raw http request.
  9309. * All other methods such as get, post, patch, and request ultimately call this.
  9310. * Prefer get, del, post and patch
  9311. */
  9312. async request(verb, requestUrl, data, headers) {
  9313. if (this._disposed) {
  9314. throw new Error('Client has already been disposed.');
  9315. }
  9316. let parsedUrl = url.parse(requestUrl);
  9317. let info = this._prepareRequest(verb, parsedUrl, headers);
  9318. // Only perform retries on reads since writes may not be idempotent.
  9319. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9320. ? this._maxRetries + 1
  9321. : 1;
  9322. let numTries = 0;
  9323. let response;
  9324. while (numTries < maxTries) {
  9325. response = await this.requestRaw(info, data);
  9326. // Check if it's an authentication challenge
  9327. if (response &&
  9328. response.message &&
  9329. response.message.statusCode === HttpCodes.Unauthorized) {
  9330. let authenticationHandler;
  9331. for (let i = 0; i < this.handlers.length; i++) {
  9332. if (this.handlers[i].canHandleAuthentication(response)) {
  9333. authenticationHandler = this.handlers[i];
  9334. break;
  9335. }
  9336. }
  9337. if (authenticationHandler) {
  9338. return authenticationHandler.handleAuthentication(this, info, data);
  9339. }
  9340. else {
  9341. // We have received an unauthorized response but have no handlers to handle it.
  9342. // Let the response return to the caller.
  9343. return response;
  9344. }
  9345. }
  9346. let redirectsRemaining = this._maxRedirects;
  9347. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9348. this._allowRedirects &&
  9349. redirectsRemaining > 0) {
  9350. const redirectUrl = response.message.headers['location'];
  9351. if (!redirectUrl) {
  9352. // if there's no location to redirect to, we won't
  9353. break;
  9354. }
  9355. let parsedRedirectUrl = url.parse(redirectUrl);
  9356. if (parsedUrl.protocol == 'https:' &&
  9357. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9358. !this._allowRedirectDowngrade) {
  9359. 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.');
  9360. }
  9361. // we need to finish reading the response before reassigning response
  9362. // which will leak the open socket.
  9363. await response.readBody();
  9364. // strip authorization header if redirected to a different hostname
  9365. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9366. for (let header in headers) {
  9367. // header names are case insensitive
  9368. if (header.toLowerCase() === 'authorization') {
  9369. delete headers[header];
  9370. }
  9371. }
  9372. }
  9373. // let's make the request with the new redirectUrl
  9374. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9375. response = await this.requestRaw(info, data);
  9376. redirectsRemaining--;
  9377. }
  9378. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9379. // If not a retry code, return immediately instead of retrying
  9380. return response;
  9381. }
  9382. numTries += 1;
  9383. if (numTries < maxTries) {
  9384. await response.readBody();
  9385. await this._performExponentialBackoff(numTries);
  9386. }
  9387. }
  9388. return response;
  9389. }
  9390. /**
  9391. * Needs to be called if keepAlive is set to true in request options.
  9392. */
  9393. dispose() {
  9394. if (this._agent) {
  9395. this._agent.destroy();
  9396. }
  9397. this._disposed = true;
  9398. }
  9399. /**
  9400. * Raw request.
  9401. * @param info
  9402. * @param data
  9403. */
  9404. requestRaw(info, data) {
  9405. return new Promise((resolve, reject) => {
  9406. let callbackForResult = function (err, res) {
  9407. if (err) {
  9408. reject(err);
  9409. }
  9410. resolve(res);
  9411. };
  9412. this.requestRawWithCallback(info, data, callbackForResult);
  9413. });
  9414. }
  9415. /**
  9416. * Raw request with callback.
  9417. * @param info
  9418. * @param data
  9419. * @param onResult
  9420. */
  9421. requestRawWithCallback(info, data, onResult) {
  9422. let socket;
  9423. if (typeof data === 'string') {
  9424. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9425. }
  9426. let callbackCalled = false;
  9427. let handleResult = (err, res) => {
  9428. if (!callbackCalled) {
  9429. callbackCalled = true;
  9430. onResult(err, res);
  9431. }
  9432. };
  9433. let req = info.httpModule.request(info.options, (msg) => {
  9434. let res = new HttpClientResponse(msg);
  9435. handleResult(null, res);
  9436. });
  9437. req.on('socket', sock => {
  9438. socket = sock;
  9439. });
  9440. // If we ever get disconnected, we want the socket to timeout eventually
  9441. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9442. if (socket) {
  9443. socket.end();
  9444. }
  9445. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9446. });
  9447. req.on('error', function (err) {
  9448. // err has statusCode property
  9449. // res should have headers
  9450. handleResult(err, null);
  9451. });
  9452. if (data && typeof data === 'string') {
  9453. req.write(data, 'utf8');
  9454. }
  9455. if (data && typeof data !== 'string') {
  9456. data.on('close', function () {
  9457. req.end();
  9458. });
  9459. data.pipe(req);
  9460. }
  9461. else {
  9462. req.end();
  9463. }
  9464. }
  9465. /**
  9466. * Gets an http agent. This function is useful when you need an http agent that handles
  9467. * routing through a proxy server - depending upon the url and proxy environment variables.
  9468. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9469. */
  9470. getAgent(serverUrl) {
  9471. let parsedUrl = url.parse(serverUrl);
  9472. return this._getAgent(parsedUrl);
  9473. }
  9474. _prepareRequest(method, requestUrl, headers) {
  9475. const info = {};
  9476. info.parsedUrl = requestUrl;
  9477. const usingSsl = info.parsedUrl.protocol === 'https:';
  9478. info.httpModule = usingSsl ? https : http;
  9479. const defaultPort = usingSsl ? 443 : 80;
  9480. info.options = {};
  9481. info.options.host = info.parsedUrl.hostname;
  9482. info.options.port = info.parsedUrl.port
  9483. ? parseInt(info.parsedUrl.port)
  9484. : defaultPort;
  9485. info.options.path =
  9486. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9487. info.options.method = method;
  9488. info.options.headers = this._mergeHeaders(headers);
  9489. if (this.userAgent != null) {
  9490. info.options.headers['user-agent'] = this.userAgent;
  9491. }
  9492. info.options.agent = this._getAgent(info.parsedUrl);
  9493. // gives handlers an opportunity to participate
  9494. if (this.handlers) {
  9495. this.handlers.forEach(handler => {
  9496. handler.prepareRequest(info.options);
  9497. });
  9498. }
  9499. return info;
  9500. }
  9501. _mergeHeaders(headers) {
  9502. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9503. if (this.requestOptions && this.requestOptions.headers) {
  9504. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9505. }
  9506. return lowercaseKeys(headers || {});
  9507. }
  9508. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9509. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9510. let clientHeader;
  9511. if (this.requestOptions && this.requestOptions.headers) {
  9512. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9513. }
  9514. return additionalHeaders[header] || clientHeader || _default;
  9515. }
  9516. _getAgent(parsedUrl) {
  9517. let agent;
  9518. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9519. let useProxy = proxyUrl && proxyUrl.hostname;
  9520. if (this._keepAlive && useProxy) {
  9521. agent = this._proxyAgent;
  9522. }
  9523. if (this._keepAlive && !useProxy) {
  9524. agent = this._agent;
  9525. }
  9526. // if agent is already assigned use that agent.
  9527. if (!!agent) {
  9528. return agent;
  9529. }
  9530. const usingSsl = parsedUrl.protocol === 'https:';
  9531. let maxSockets = 100;
  9532. if (!!this.requestOptions) {
  9533. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9534. }
  9535. if (useProxy) {
  9536. // If using proxy, need tunnel
  9537. if (!tunnel) {
  9538. tunnel = __webpack_require__(335);
  9539. }
  9540. const agentOptions = {
  9541. maxSockets: maxSockets,
  9542. keepAlive: this._keepAlive,
  9543. proxy: {
  9544. proxyAuth: proxyUrl.auth,
  9545. host: proxyUrl.hostname,
  9546. port: proxyUrl.port
  9547. }
  9548. };
  9549. let tunnelAgent;
  9550. const overHttps = proxyUrl.protocol === 'https:';
  9551. if (usingSsl) {
  9552. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9553. }
  9554. else {
  9555. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9556. }
  9557. agent = tunnelAgent(agentOptions);
  9558. this._proxyAgent = agent;
  9559. }
  9560. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9561. if (this._keepAlive && !agent) {
  9562. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9563. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9564. this._agent = agent;
  9565. }
  9566. // if not using private agent and tunnel agent isn't setup then use global agent
  9567. if (!agent) {
  9568. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9569. }
  9570. if (usingSsl && this._ignoreSslError) {
  9571. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9572. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9573. // we have to cast it to any and change it directly
  9574. agent.options = Object.assign(agent.options || {}, {
  9575. rejectUnauthorized: false
  9576. });
  9577. }
  9578. return agent;
  9579. }
  9580. _performExponentialBackoff(retryNumber) {
  9581. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9582. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9583. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9584. }
  9585. static dateTimeDeserializer(key, value) {
  9586. if (typeof value === 'string') {
  9587. let a = new Date(value);
  9588. if (!isNaN(a.valueOf())) {
  9589. return a;
  9590. }
  9591. }
  9592. return value;
  9593. }
  9594. async _processResponse(res, options) {
  9595. return new Promise(async (resolve, reject) => {
  9596. const statusCode = res.message.statusCode;
  9597. const response = {
  9598. statusCode: statusCode,
  9599. result: null,
  9600. headers: {}
  9601. };
  9602. // not found leads to null obj returned
  9603. if (statusCode == HttpCodes.NotFound) {
  9604. resolve(response);
  9605. }
  9606. let obj;
  9607. let contents;
  9608. // get the result from the body
  9609. try {
  9610. contents = await res.readBody();
  9611. if (contents && contents.length > 0) {
  9612. if (options && options.deserializeDates) {
  9613. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9614. }
  9615. else {
  9616. obj = JSON.parse(contents);
  9617. }
  9618. response.result = obj;
  9619. }
  9620. response.headers = res.message.headers;
  9621. }
  9622. catch (err) {
  9623. // Invalid resource (contents not json); leaving result obj null
  9624. }
  9625. // note that 3xx redirects are handled by the http layer.
  9626. if (statusCode > 299) {
  9627. let msg;
  9628. // if exception/error in body, attempt to get better error
  9629. if (obj && obj.message) {
  9630. msg = obj.message;
  9631. }
  9632. else if (contents && contents.length > 0) {
  9633. // it may be the case that the exception is in the body message as string
  9634. msg = contents;
  9635. }
  9636. else {
  9637. msg = 'Failed request: (' + statusCode + ')';
  9638. }
  9639. let err = new Error(msg);
  9640. // attach statusCode and body obj (if available) to the error object
  9641. err['statusCode'] = statusCode;
  9642. if (response.result) {
  9643. err['result'] = response.result;
  9644. }
  9645. reject(err);
  9646. }
  9647. else {
  9648. resolve(response);
  9649. }
  9650. });
  9651. }
  9652. }
  9653. exports.HttpClient = HttpClient;
  9654. /***/ }),
  9655. /***/ 550:
  9656. /***/ (function(module, __unusedexports, __webpack_require__) {
  9657. module.exports = getNextPage
  9658. const getPage = __webpack_require__(265)
  9659. function getNextPage (octokit, link, headers) {
  9660. return getPage(octokit, link, 'next', headers)
  9661. }
  9662. /***/ }),
  9663. /***/ 558:
  9664. /***/ (function(module, __unusedexports, __webpack_require__) {
  9665. module.exports = hasPreviousPage
  9666. const deprecate = __webpack_require__(370)
  9667. const getPageLinks = __webpack_require__(577)
  9668. function hasPreviousPage (link) {
  9669. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9670. return getPageLinks(link).prev
  9671. }
  9672. /***/ }),
  9673. /***/ 559:
  9674. /***/ (function(__unusedmodule, exports) {
  9675. "use strict";
  9676. Object.defineProperty(exports, "__esModule", { value: true });
  9677. class GitVersion {
  9678. /**
  9679. * Used for comparing the version of git and git-lfs against the minimum required version
  9680. * @param version the version string, e.g. 1.2 or 1.2.3
  9681. */
  9682. constructor(version) {
  9683. this.major = NaN;
  9684. this.minor = NaN;
  9685. this.patch = NaN;
  9686. if (version) {
  9687. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9688. if (match) {
  9689. this.major = Number(match[1]);
  9690. this.minor = Number(match[2]);
  9691. if (match[4]) {
  9692. this.patch = Number(match[4]);
  9693. }
  9694. }
  9695. }
  9696. }
  9697. /**
  9698. * Compares the instance against a minimum required version
  9699. * @param minimum Minimum version
  9700. */
  9701. checkMinimum(minimum) {
  9702. if (!minimum.isValid()) {
  9703. throw new Error('Arg minimum is not a valid version');
  9704. }
  9705. // Major is insufficient
  9706. if (this.major < minimum.major) {
  9707. return false;
  9708. }
  9709. // Major is equal
  9710. if (this.major === minimum.major) {
  9711. // Minor is insufficient
  9712. if (this.minor < minimum.minor) {
  9713. return false;
  9714. }
  9715. // Minor is equal
  9716. if (this.minor === minimum.minor) {
  9717. // Patch is insufficient
  9718. if (this.patch && this.patch < (minimum.patch || 0)) {
  9719. return false;
  9720. }
  9721. }
  9722. }
  9723. return true;
  9724. }
  9725. /**
  9726. * Indicates whether the instance was constructed from a valid version string
  9727. */
  9728. isValid() {
  9729. return !isNaN(this.major);
  9730. }
  9731. /**
  9732. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9733. */
  9734. toString() {
  9735. let result = '';
  9736. if (this.isValid()) {
  9737. result = `${this.major}.${this.minor}`;
  9738. if (!isNaN(this.patch)) {
  9739. result += `.${this.patch}`;
  9740. }
  9741. }
  9742. return result;
  9743. }
  9744. }
  9745. exports.GitVersion = GitVersion;
  9746. /***/ }),
  9747. /***/ 562:
  9748. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9749. "use strict";
  9750. Object.defineProperty(exports, '__esModule', { value: true });
  9751. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9752. var osName = _interopDefault(__webpack_require__(2));
  9753. function getUserAgent() {
  9754. try {
  9755. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  9756. } catch (error) {
  9757. if (/wmic os get Caption/.test(error.message)) {
  9758. return "Windows <version undetectable>";
  9759. }
  9760. return "<environment undetectable>";
  9761. }
  9762. }
  9763. exports.getUserAgent = getUserAgent;
  9764. //# sourceMappingURL=index.js.map
  9765. /***/ }),
  9766. /***/ 563:
  9767. /***/ (function(module, __unusedexports, __webpack_require__) {
  9768. module.exports = getPreviousPage
  9769. const getPage = __webpack_require__(265)
  9770. function getPreviousPage (octokit, link, headers) {
  9771. return getPage(octokit, link, 'prev', headers)
  9772. }
  9773. /***/ }),
  9774. /***/ 568:
  9775. /***/ (function(module, __unusedexports, __webpack_require__) {
  9776. "use strict";
  9777. const path = __webpack_require__(622);
  9778. const niceTry = __webpack_require__(948);
  9779. const resolveCommand = __webpack_require__(489);
  9780. const escape = __webpack_require__(462);
  9781. const readShebang = __webpack_require__(389);
  9782. const semver = __webpack_require__(280);
  9783. const isWin = process.platform === 'win32';
  9784. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9785. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9786. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9787. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9788. function detectShebang(parsed) {
  9789. parsed.file = resolveCommand(parsed);
  9790. const shebang = parsed.file && readShebang(parsed.file);
  9791. if (shebang) {
  9792. parsed.args.unshift(parsed.file);
  9793. parsed.command = shebang;
  9794. return resolveCommand(parsed);
  9795. }
  9796. return parsed.file;
  9797. }
  9798. function parseNonShell(parsed) {
  9799. if (!isWin) {
  9800. return parsed;
  9801. }
  9802. // Detect & add support for shebangs
  9803. const commandFile = detectShebang(parsed);
  9804. // We don't need a shell if the command filename is an executable
  9805. const needsShell = !isExecutableRegExp.test(commandFile);
  9806. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9807. // Note that `forceShell` is an hidden option used only in tests
  9808. if (parsed.options.forceShell || needsShell) {
  9809. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9810. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9811. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9812. // we need to double escape them
  9813. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9814. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9815. // This is necessary otherwise it will always fail with ENOENT in those cases
  9816. parsed.command = path.normalize(parsed.command);
  9817. // Escape command & arguments
  9818. parsed.command = escape.command(parsed.command);
  9819. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9820. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9821. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9822. parsed.command = process.env.comspec || 'cmd.exe';
  9823. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9824. }
  9825. return parsed;
  9826. }
  9827. function parseShell(parsed) {
  9828. // If node supports the shell option, there's no need to mimic its behavior
  9829. if (supportsShellOption) {
  9830. return parsed;
  9831. }
  9832. // Mimic node shell option
  9833. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9834. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9835. if (isWin) {
  9836. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9837. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9838. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9839. } else {
  9840. if (typeof parsed.options.shell === 'string') {
  9841. parsed.command = parsed.options.shell;
  9842. } else if (process.platform === 'android') {
  9843. parsed.command = '/system/bin/sh';
  9844. } else {
  9845. parsed.command = '/bin/sh';
  9846. }
  9847. parsed.args = ['-c', shellCommand];
  9848. }
  9849. return parsed;
  9850. }
  9851. function parse(command, args, options) {
  9852. // Normalize arguments, similar to nodejs
  9853. if (args && !Array.isArray(args)) {
  9854. options = args;
  9855. args = null;
  9856. }
  9857. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9858. options = Object.assign({}, options); // Clone object to avoid changing the original
  9859. // Build our parsed object
  9860. const parsed = {
  9861. command,
  9862. args,
  9863. options,
  9864. file: undefined,
  9865. original: {
  9866. command,
  9867. args,
  9868. },
  9869. };
  9870. // Delegate further parsing to shell or non-shell
  9871. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9872. }
  9873. module.exports = parse;
  9874. /***/ }),
  9875. /***/ 577:
  9876. /***/ (function(module) {
  9877. module.exports = getPageLinks
  9878. function getPageLinks (link) {
  9879. link = link.link || link.headers.link || ''
  9880. const links = {}
  9881. // link format:
  9882. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9883. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9884. links[type] = uri
  9885. })
  9886. return links
  9887. }
  9888. /***/ }),
  9889. /***/ 587:
  9890. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9891. "use strict";
  9892. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9893. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9894. return new (P || (P = Promise))(function (resolve, reject) {
  9895. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9896. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9897. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9898. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9899. });
  9900. };
  9901. var __importStar = (this && this.__importStar) || function (mod) {
  9902. if (mod && mod.__esModule) return mod;
  9903. var result = {};
  9904. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9905. result["default"] = mod;
  9906. return result;
  9907. };
  9908. Object.defineProperty(exports, "__esModule", { value: true });
  9909. const core = __importStar(__webpack_require__(470));
  9910. const defaultMaxAttempts = 3;
  9911. const defaultMinSeconds = 10;
  9912. const defaultMaxSeconds = 20;
  9913. class RetryHelper {
  9914. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9915. this.maxAttempts = maxAttempts;
  9916. this.minSeconds = Math.floor(minSeconds);
  9917. this.maxSeconds = Math.floor(maxSeconds);
  9918. if (this.minSeconds > this.maxSeconds) {
  9919. throw new Error('min seconds should be less than or equal to max seconds');
  9920. }
  9921. }
  9922. execute(action) {
  9923. return __awaiter(this, void 0, void 0, function* () {
  9924. let attempt = 1;
  9925. while (attempt < this.maxAttempts) {
  9926. // Try
  9927. try {
  9928. return yield action();
  9929. }
  9930. catch (err) {
  9931. core.info(err.message);
  9932. }
  9933. // Sleep
  9934. const seconds = this.getSleepAmount();
  9935. core.info(`Waiting ${seconds} seconds before trying again`);
  9936. yield this.sleep(seconds);
  9937. attempt++;
  9938. }
  9939. // Last attempt
  9940. return yield action();
  9941. });
  9942. }
  9943. getSleepAmount() {
  9944. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9945. this.minSeconds);
  9946. }
  9947. sleep(seconds) {
  9948. return __awaiter(this, void 0, void 0, function* () {
  9949. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9950. });
  9951. }
  9952. }
  9953. exports.RetryHelper = RetryHelper;
  9954. function execute(action) {
  9955. return __awaiter(this, void 0, void 0, function* () {
  9956. const retryHelper = new RetryHelper();
  9957. return yield retryHelper.execute(action);
  9958. });
  9959. }
  9960. exports.execute = execute;
  9961. /***/ }),
  9962. /***/ 605:
  9963. /***/ (function(module) {
  9964. module.exports = require("http");
  9965. /***/ }),
  9966. /***/ 614:
  9967. /***/ (function(module) {
  9968. module.exports = require("events");
  9969. /***/ }),
  9970. /***/ 618:
  9971. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9972. "use strict";
  9973. var __importStar = (this && this.__importStar) || function (mod) {
  9974. if (mod && mod.__esModule) return mod;
  9975. var result = {};
  9976. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9977. result["default"] = mod;
  9978. return result;
  9979. };
  9980. Object.defineProperty(exports, "__esModule", { value: true });
  9981. const fs = __importStar(__webpack_require__(747));
  9982. function directoryExistsSync(path, required) {
  9983. if (!path) {
  9984. throw new Error("Arg 'path' must not be empty");
  9985. }
  9986. let stats;
  9987. try {
  9988. stats = fs.statSync(path);
  9989. }
  9990. catch (error) {
  9991. if (error.code === 'ENOENT') {
  9992. if (!required) {
  9993. return false;
  9994. }
  9995. throw new Error(`Directory '${path}' does not exist`);
  9996. }
  9997. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9998. }
  9999. if (stats.isDirectory()) {
  10000. return true;
  10001. }
  10002. else if (!required) {
  10003. return false;
  10004. }
  10005. throw new Error(`Directory '${path}' does not exist`);
  10006. }
  10007. exports.directoryExistsSync = directoryExistsSync;
  10008. function existsSync(path) {
  10009. if (!path) {
  10010. throw new Error("Arg 'path' must not be empty");
  10011. }
  10012. try {
  10013. fs.statSync(path);
  10014. }
  10015. catch (error) {
  10016. if (error.code === 'ENOENT') {
  10017. return false;
  10018. }
  10019. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10020. }
  10021. return true;
  10022. }
  10023. exports.existsSync = existsSync;
  10024. function fileExistsSync(path) {
  10025. if (!path) {
  10026. throw new Error("Arg 'path' must not be empty");
  10027. }
  10028. let stats;
  10029. try {
  10030. stats = fs.statSync(path);
  10031. }
  10032. catch (error) {
  10033. if (error.code === 'ENOENT') {
  10034. return false;
  10035. }
  10036. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10037. }
  10038. if (!stats.isDirectory()) {
  10039. return true;
  10040. }
  10041. return false;
  10042. }
  10043. exports.fileExistsSync = fileExistsSync;
  10044. /***/ }),
  10045. /***/ 621:
  10046. /***/ (function(module, __unusedexports, __webpack_require__) {
  10047. "use strict";
  10048. const path = __webpack_require__(622);
  10049. const pathKey = __webpack_require__(39);
  10050. module.exports = opts => {
  10051. opts = Object.assign({
  10052. cwd: process.cwd(),
  10053. path: process.env[pathKey()]
  10054. }, opts);
  10055. let prev;
  10056. let pth = path.resolve(opts.cwd);
  10057. const ret = [];
  10058. while (prev !== pth) {
  10059. ret.push(path.join(pth, 'node_modules/.bin'));
  10060. prev = pth;
  10061. pth = path.resolve(pth, '..');
  10062. }
  10063. // ensure the running `node` binary is used
  10064. ret.push(path.dirname(process.execPath));
  10065. return ret.concat(opts.path).join(path.delimiter);
  10066. };
  10067. module.exports.env = opts => {
  10068. opts = Object.assign({
  10069. env: process.env
  10070. }, opts);
  10071. const env = Object.assign({}, opts.env);
  10072. const path = pathKey({env});
  10073. opts.path = env[path];
  10074. env[path] = module.exports(opts);
  10075. return env;
  10076. };
  10077. /***/ }),
  10078. /***/ 622:
  10079. /***/ (function(module) {
  10080. module.exports = require("path");
  10081. /***/ }),
  10082. /***/ 631:
  10083. /***/ (function(module) {
  10084. module.exports = require("net");
  10085. /***/ }),
  10086. /***/ 649:
  10087. /***/ (function(module, __unusedexports, __webpack_require__) {
  10088. module.exports = getLastPage
  10089. const getPage = __webpack_require__(265)
  10090. function getLastPage (octokit, link, headers) {
  10091. return getPage(octokit, link, 'last', headers)
  10092. }
  10093. /***/ }),
  10094. /***/ 654:
  10095. /***/ (function(module) {
  10096. // This is not the set of all possible signals.
  10097. //
  10098. // It IS, however, the set of all signals that trigger
  10099. // an exit on either Linux or BSD systems. Linux is a
  10100. // superset of the signal names supported on BSD, and
  10101. // the unknown signals just fail to register, so we can
  10102. // catch that easily enough.
  10103. //
  10104. // Don't bother with SIGKILL. It's uncatchable, which
  10105. // means that we can't fire any callbacks anyway.
  10106. //
  10107. // If a user does happen to register a handler on a non-
  10108. // fatal signal like SIGWINCH or something, and then
  10109. // exit, it'll end up firing `process.emit('exit')`, so
  10110. // the handler will be fired anyway.
  10111. //
  10112. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10113. // artificially, inherently leave the process in a
  10114. // state from which it is not safe to try and enter JS
  10115. // listeners.
  10116. module.exports = [
  10117. 'SIGABRT',
  10118. 'SIGALRM',
  10119. 'SIGHUP',
  10120. 'SIGINT',
  10121. 'SIGTERM'
  10122. ]
  10123. if (process.platform !== 'win32') {
  10124. module.exports.push(
  10125. 'SIGVTALRM',
  10126. 'SIGXCPU',
  10127. 'SIGXFSZ',
  10128. 'SIGUSR2',
  10129. 'SIGTRAP',
  10130. 'SIGSYS',
  10131. 'SIGQUIT',
  10132. 'SIGIOT'
  10133. // should detect profiler and enable/disable accordingly.
  10134. // see #21
  10135. // 'SIGPROF'
  10136. )
  10137. }
  10138. if (process.platform === 'linux') {
  10139. module.exports.push(
  10140. 'SIGIO',
  10141. 'SIGPOLL',
  10142. 'SIGPWR',
  10143. 'SIGSTKFLT',
  10144. 'SIGUNUSED'
  10145. )
  10146. }
  10147. /***/ }),
  10148. /***/ 656:
  10149. /***/ (function(module, exports) {
  10150. exports = module.exports = SemVer
  10151. var debug
  10152. /* istanbul ignore next */
  10153. if (typeof process === 'object' &&
  10154. process.env &&
  10155. process.env.NODE_DEBUG &&
  10156. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10157. debug = function () {
  10158. var args = Array.prototype.slice.call(arguments, 0)
  10159. args.unshift('SEMVER')
  10160. console.log.apply(console, args)
  10161. }
  10162. } else {
  10163. debug = function () {}
  10164. }
  10165. // Note: this is the semver.org version of the spec that it implements
  10166. // Not necessarily the package version of this code.
  10167. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10168. var MAX_LENGTH = 256
  10169. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10170. /* istanbul ignore next */ 9007199254740991
  10171. // Max safe segment length for coercion.
  10172. var MAX_SAFE_COMPONENT_LENGTH = 16
  10173. // The actual regexps go on exports.re
  10174. var re = exports.re = []
  10175. var src = exports.src = []
  10176. var t = exports.tokens = {}
  10177. var R = 0
  10178. function tok (n) {
  10179. t[n] = R++
  10180. }
  10181. // The following Regular Expressions can be used for tokenizing,
  10182. // validating, and parsing SemVer version strings.
  10183. // ## Numeric Identifier
  10184. // A single `0`, or a non-zero digit followed by zero or more digits.
  10185. tok('NUMERICIDENTIFIER')
  10186. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10187. tok('NUMERICIDENTIFIERLOOSE')
  10188. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10189. // ## Non-numeric Identifier
  10190. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10191. // more letters, digits, or hyphens.
  10192. tok('NONNUMERICIDENTIFIER')
  10193. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10194. // ## Main Version
  10195. // Three dot-separated numeric identifiers.
  10196. tok('MAINVERSION')
  10197. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10198. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10199. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10200. tok('MAINVERSIONLOOSE')
  10201. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10202. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10203. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10204. // ## Pre-release Version Identifier
  10205. // A numeric identifier, or a non-numeric identifier.
  10206. tok('PRERELEASEIDENTIFIER')
  10207. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10208. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10209. tok('PRERELEASEIDENTIFIERLOOSE')
  10210. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10211. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10212. // ## Pre-release Version
  10213. // Hyphen, followed by one or more dot-separated pre-release version
  10214. // identifiers.
  10215. tok('PRERELEASE')
  10216. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10217. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10218. tok('PRERELEASELOOSE')
  10219. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10220. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10221. // ## Build Metadata Identifier
  10222. // Any combination of digits, letters, or hyphens.
  10223. tok('BUILDIDENTIFIER')
  10224. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10225. // ## Build Metadata
  10226. // Plus sign, followed by one or more period-separated build metadata
  10227. // identifiers.
  10228. tok('BUILD')
  10229. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10230. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10231. // ## Full Version String
  10232. // A main version, followed optionally by a pre-release version and
  10233. // build metadata.
  10234. // Note that the only major, minor, patch, and pre-release sections of
  10235. // the version string are capturing groups. The build metadata is not a
  10236. // capturing group, because it should not ever be used in version
  10237. // comparison.
  10238. tok('FULL')
  10239. tok('FULLPLAIN')
  10240. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10241. src[t.PRERELEASE] + '?' +
  10242. src[t.BUILD] + '?'
  10243. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10244. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10245. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10246. // common in the npm registry.
  10247. tok('LOOSEPLAIN')
  10248. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10249. src[t.PRERELEASELOOSE] + '?' +
  10250. src[t.BUILD] + '?'
  10251. tok('LOOSE')
  10252. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10253. tok('GTLT')
  10254. src[t.GTLT] = '((?:<|>)?=?)'
  10255. // Something like "2.*" or "1.2.x".
  10256. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10257. // Only the first item is strictly required.
  10258. tok('XRANGEIDENTIFIERLOOSE')
  10259. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10260. tok('XRANGEIDENTIFIER')
  10261. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10262. tok('XRANGEPLAIN')
  10263. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10264. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10265. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10266. '(?:' + src[t.PRERELEASE] + ')?' +
  10267. src[t.BUILD] + '?' +
  10268. ')?)?'
  10269. tok('XRANGEPLAINLOOSE')
  10270. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10271. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10272. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10273. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10274. src[t.BUILD] + '?' +
  10275. ')?)?'
  10276. tok('XRANGE')
  10277. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10278. tok('XRANGELOOSE')
  10279. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10280. // Coercion.
  10281. // Extract anything that could conceivably be a part of a valid semver
  10282. tok('COERCE')
  10283. src[t.COERCE] = '(^|[^\\d])' +
  10284. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10285. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10286. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10287. '(?:$|[^\\d])'
  10288. tok('COERCERTL')
  10289. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10290. // Tilde ranges.
  10291. // Meaning is "reasonably at or greater than"
  10292. tok('LONETILDE')
  10293. src[t.LONETILDE] = '(?:~>?)'
  10294. tok('TILDETRIM')
  10295. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10296. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10297. var tildeTrimReplace = '$1~'
  10298. tok('TILDE')
  10299. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10300. tok('TILDELOOSE')
  10301. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10302. // Caret ranges.
  10303. // Meaning is "at least and backwards compatible with"
  10304. tok('LONECARET')
  10305. src[t.LONECARET] = '(?:\\^)'
  10306. tok('CARETTRIM')
  10307. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10308. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10309. var caretTrimReplace = '$1^'
  10310. tok('CARET')
  10311. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10312. tok('CARETLOOSE')
  10313. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10314. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10315. tok('COMPARATORLOOSE')
  10316. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10317. tok('COMPARATOR')
  10318. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10319. // An expression to strip any whitespace between the gtlt and the thing
  10320. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10321. tok('COMPARATORTRIM')
  10322. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10323. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10324. // this one has to use the /g flag
  10325. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10326. var comparatorTrimReplace = '$1$2$3'
  10327. // Something like `1.2.3 - 1.2.4`
  10328. // Note that these all use the loose form, because they'll be
  10329. // checked against either the strict or loose comparator form
  10330. // later.
  10331. tok('HYPHENRANGE')
  10332. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10333. '\\s+-\\s+' +
  10334. '(' + src[t.XRANGEPLAIN] + ')' +
  10335. '\\s*$'
  10336. tok('HYPHENRANGELOOSE')
  10337. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10338. '\\s+-\\s+' +
  10339. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10340. '\\s*$'
  10341. // Star ranges basically just allow anything at all.
  10342. tok('STAR')
  10343. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10344. // Compile to actual regexp objects.
  10345. // All are flag-free, unless they were created above with a flag.
  10346. for (var i = 0; i < R; i++) {
  10347. debug(i, src[i])
  10348. if (!re[i]) {
  10349. re[i] = new RegExp(src[i])
  10350. }
  10351. }
  10352. exports.parse = parse
  10353. function parse (version, options) {
  10354. if (!options || typeof options !== 'object') {
  10355. options = {
  10356. loose: !!options,
  10357. includePrerelease: false
  10358. }
  10359. }
  10360. if (version instanceof SemVer) {
  10361. return version
  10362. }
  10363. if (typeof version !== 'string') {
  10364. return null
  10365. }
  10366. if (version.length > MAX_LENGTH) {
  10367. return null
  10368. }
  10369. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10370. if (!r.test(version)) {
  10371. return null
  10372. }
  10373. try {
  10374. return new SemVer(version, options)
  10375. } catch (er) {
  10376. return null
  10377. }
  10378. }
  10379. exports.valid = valid
  10380. function valid (version, options) {
  10381. var v = parse(version, options)
  10382. return v ? v.version : null
  10383. }
  10384. exports.clean = clean
  10385. function clean (version, options) {
  10386. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10387. return s ? s.version : null
  10388. }
  10389. exports.SemVer = SemVer
  10390. function SemVer (version, options) {
  10391. if (!options || typeof options !== 'object') {
  10392. options = {
  10393. loose: !!options,
  10394. includePrerelease: false
  10395. }
  10396. }
  10397. if (version instanceof SemVer) {
  10398. if (version.loose === options.loose) {
  10399. return version
  10400. } else {
  10401. version = version.version
  10402. }
  10403. } else if (typeof version !== 'string') {
  10404. throw new TypeError('Invalid Version: ' + version)
  10405. }
  10406. if (version.length > MAX_LENGTH) {
  10407. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10408. }
  10409. if (!(this instanceof SemVer)) {
  10410. return new SemVer(version, options)
  10411. }
  10412. debug('SemVer', version, options)
  10413. this.options = options
  10414. this.loose = !!options.loose
  10415. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10416. if (!m) {
  10417. throw new TypeError('Invalid Version: ' + version)
  10418. }
  10419. this.raw = version
  10420. // these are actually numbers
  10421. this.major = +m[1]
  10422. this.minor = +m[2]
  10423. this.patch = +m[3]
  10424. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10425. throw new TypeError('Invalid major version')
  10426. }
  10427. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10428. throw new TypeError('Invalid minor version')
  10429. }
  10430. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10431. throw new TypeError('Invalid patch version')
  10432. }
  10433. // numberify any prerelease numeric ids
  10434. if (!m[4]) {
  10435. this.prerelease = []
  10436. } else {
  10437. this.prerelease = m[4].split('.').map(function (id) {
  10438. if (/^[0-9]+$/.test(id)) {
  10439. var num = +id
  10440. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10441. return num
  10442. }
  10443. }
  10444. return id
  10445. })
  10446. }
  10447. this.build = m[5] ? m[5].split('.') : []
  10448. this.format()
  10449. }
  10450. SemVer.prototype.format = function () {
  10451. this.version = this.major + '.' + this.minor + '.' + this.patch
  10452. if (this.prerelease.length) {
  10453. this.version += '-' + this.prerelease.join('.')
  10454. }
  10455. return this.version
  10456. }
  10457. SemVer.prototype.toString = function () {
  10458. return this.version
  10459. }
  10460. SemVer.prototype.compare = function (other) {
  10461. debug('SemVer.compare', this.version, this.options, other)
  10462. if (!(other instanceof SemVer)) {
  10463. other = new SemVer(other, this.options)
  10464. }
  10465. return this.compareMain(other) || this.comparePre(other)
  10466. }
  10467. SemVer.prototype.compareMain = function (other) {
  10468. if (!(other instanceof SemVer)) {
  10469. other = new SemVer(other, this.options)
  10470. }
  10471. return compareIdentifiers(this.major, other.major) ||
  10472. compareIdentifiers(this.minor, other.minor) ||
  10473. compareIdentifiers(this.patch, other.patch)
  10474. }
  10475. SemVer.prototype.comparePre = function (other) {
  10476. if (!(other instanceof SemVer)) {
  10477. other = new SemVer(other, this.options)
  10478. }
  10479. // NOT having a prerelease is > having one
  10480. if (this.prerelease.length && !other.prerelease.length) {
  10481. return -1
  10482. } else if (!this.prerelease.length && other.prerelease.length) {
  10483. return 1
  10484. } else if (!this.prerelease.length && !other.prerelease.length) {
  10485. return 0
  10486. }
  10487. var i = 0
  10488. do {
  10489. var a = this.prerelease[i]
  10490. var b = other.prerelease[i]
  10491. debug('prerelease compare', i, a, b)
  10492. if (a === undefined && b === undefined) {
  10493. return 0
  10494. } else if (b === undefined) {
  10495. return 1
  10496. } else if (a === undefined) {
  10497. return -1
  10498. } else if (a === b) {
  10499. continue
  10500. } else {
  10501. return compareIdentifiers(a, b)
  10502. }
  10503. } while (++i)
  10504. }
  10505. SemVer.prototype.compareBuild = function (other) {
  10506. if (!(other instanceof SemVer)) {
  10507. other = new SemVer(other, this.options)
  10508. }
  10509. var i = 0
  10510. do {
  10511. var a = this.build[i]
  10512. var b = other.build[i]
  10513. debug('prerelease compare', i, a, b)
  10514. if (a === undefined && b === undefined) {
  10515. return 0
  10516. } else if (b === undefined) {
  10517. return 1
  10518. } else if (a === undefined) {
  10519. return -1
  10520. } else if (a === b) {
  10521. continue
  10522. } else {
  10523. return compareIdentifiers(a, b)
  10524. }
  10525. } while (++i)
  10526. }
  10527. // preminor will bump the version up to the next minor release, and immediately
  10528. // down to pre-release. premajor and prepatch work the same way.
  10529. SemVer.prototype.inc = function (release, identifier) {
  10530. switch (release) {
  10531. case 'premajor':
  10532. this.prerelease.length = 0
  10533. this.patch = 0
  10534. this.minor = 0
  10535. this.major++
  10536. this.inc('pre', identifier)
  10537. break
  10538. case 'preminor':
  10539. this.prerelease.length = 0
  10540. this.patch = 0
  10541. this.minor++
  10542. this.inc('pre', identifier)
  10543. break
  10544. case 'prepatch':
  10545. // If this is already a prerelease, it will bump to the next version
  10546. // drop any prereleases that might already exist, since they are not
  10547. // relevant at this point.
  10548. this.prerelease.length = 0
  10549. this.inc('patch', identifier)
  10550. this.inc('pre', identifier)
  10551. break
  10552. // If the input is a non-prerelease version, this acts the same as
  10553. // prepatch.
  10554. case 'prerelease':
  10555. if (this.prerelease.length === 0) {
  10556. this.inc('patch', identifier)
  10557. }
  10558. this.inc('pre', identifier)
  10559. break
  10560. case 'major':
  10561. // If this is a pre-major version, bump up to the same major version.
  10562. // Otherwise increment major.
  10563. // 1.0.0-5 bumps to 1.0.0
  10564. // 1.1.0 bumps to 2.0.0
  10565. if (this.minor !== 0 ||
  10566. this.patch !== 0 ||
  10567. this.prerelease.length === 0) {
  10568. this.major++
  10569. }
  10570. this.minor = 0
  10571. this.patch = 0
  10572. this.prerelease = []
  10573. break
  10574. case 'minor':
  10575. // If this is a pre-minor version, bump up to the same minor version.
  10576. // Otherwise increment minor.
  10577. // 1.2.0-5 bumps to 1.2.0
  10578. // 1.2.1 bumps to 1.3.0
  10579. if (this.patch !== 0 || this.prerelease.length === 0) {
  10580. this.minor++
  10581. }
  10582. this.patch = 0
  10583. this.prerelease = []
  10584. break
  10585. case 'patch':
  10586. // If this is not a pre-release version, it will increment the patch.
  10587. // If it is a pre-release it will bump up to the same patch version.
  10588. // 1.2.0-5 patches to 1.2.0
  10589. // 1.2.0 patches to 1.2.1
  10590. if (this.prerelease.length === 0) {
  10591. this.patch++
  10592. }
  10593. this.prerelease = []
  10594. break
  10595. // This probably shouldn't be used publicly.
  10596. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10597. case 'pre':
  10598. if (this.prerelease.length === 0) {
  10599. this.prerelease = [0]
  10600. } else {
  10601. var i = this.prerelease.length
  10602. while (--i >= 0) {
  10603. if (typeof this.prerelease[i] === 'number') {
  10604. this.prerelease[i]++
  10605. i = -2
  10606. }
  10607. }
  10608. if (i === -1) {
  10609. // didn't increment anything
  10610. this.prerelease.push(0)
  10611. }
  10612. }
  10613. if (identifier) {
  10614. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10615. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10616. if (this.prerelease[0] === identifier) {
  10617. if (isNaN(this.prerelease[1])) {
  10618. this.prerelease = [identifier, 0]
  10619. }
  10620. } else {
  10621. this.prerelease = [identifier, 0]
  10622. }
  10623. }
  10624. break
  10625. default:
  10626. throw new Error('invalid increment argument: ' + release)
  10627. }
  10628. this.format()
  10629. this.raw = this.version
  10630. return this
  10631. }
  10632. exports.inc = inc
  10633. function inc (version, release, loose, identifier) {
  10634. if (typeof (loose) === 'string') {
  10635. identifier = loose
  10636. loose = undefined
  10637. }
  10638. try {
  10639. return new SemVer(version, loose).inc(release, identifier).version
  10640. } catch (er) {
  10641. return null
  10642. }
  10643. }
  10644. exports.diff = diff
  10645. function diff (version1, version2) {
  10646. if (eq(version1, version2)) {
  10647. return null
  10648. } else {
  10649. var v1 = parse(version1)
  10650. var v2 = parse(version2)
  10651. var prefix = ''
  10652. if (v1.prerelease.length || v2.prerelease.length) {
  10653. prefix = 'pre'
  10654. var defaultResult = 'prerelease'
  10655. }
  10656. for (var key in v1) {
  10657. if (key === 'major' || key === 'minor' || key === 'patch') {
  10658. if (v1[key] !== v2[key]) {
  10659. return prefix + key
  10660. }
  10661. }
  10662. }
  10663. return defaultResult // may be undefined
  10664. }
  10665. }
  10666. exports.compareIdentifiers = compareIdentifiers
  10667. var numeric = /^[0-9]+$/
  10668. function compareIdentifiers (a, b) {
  10669. var anum = numeric.test(a)
  10670. var bnum = numeric.test(b)
  10671. if (anum && bnum) {
  10672. a = +a
  10673. b = +b
  10674. }
  10675. return a === b ? 0
  10676. : (anum && !bnum) ? -1
  10677. : (bnum && !anum) ? 1
  10678. : a < b ? -1
  10679. : 1
  10680. }
  10681. exports.rcompareIdentifiers = rcompareIdentifiers
  10682. function rcompareIdentifiers (a, b) {
  10683. return compareIdentifiers(b, a)
  10684. }
  10685. exports.major = major
  10686. function major (a, loose) {
  10687. return new SemVer(a, loose).major
  10688. }
  10689. exports.minor = minor
  10690. function minor (a, loose) {
  10691. return new SemVer(a, loose).minor
  10692. }
  10693. exports.patch = patch
  10694. function patch (a, loose) {
  10695. return new SemVer(a, loose).patch
  10696. }
  10697. exports.compare = compare
  10698. function compare (a, b, loose) {
  10699. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10700. }
  10701. exports.compareLoose = compareLoose
  10702. function compareLoose (a, b) {
  10703. return compare(a, b, true)
  10704. }
  10705. exports.compareBuild = compareBuild
  10706. function compareBuild (a, b, loose) {
  10707. var versionA = new SemVer(a, loose)
  10708. var versionB = new SemVer(b, loose)
  10709. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10710. }
  10711. exports.rcompare = rcompare
  10712. function rcompare (a, b, loose) {
  10713. return compare(b, a, loose)
  10714. }
  10715. exports.sort = sort
  10716. function sort (list, loose) {
  10717. return list.sort(function (a, b) {
  10718. return exports.compareBuild(a, b, loose)
  10719. })
  10720. }
  10721. exports.rsort = rsort
  10722. function rsort (list, loose) {
  10723. return list.sort(function (a, b) {
  10724. return exports.compareBuild(b, a, loose)
  10725. })
  10726. }
  10727. exports.gt = gt
  10728. function gt (a, b, loose) {
  10729. return compare(a, b, loose) > 0
  10730. }
  10731. exports.lt = lt
  10732. function lt (a, b, loose) {
  10733. return compare(a, b, loose) < 0
  10734. }
  10735. exports.eq = eq
  10736. function eq (a, b, loose) {
  10737. return compare(a, b, loose) === 0
  10738. }
  10739. exports.neq = neq
  10740. function neq (a, b, loose) {
  10741. return compare(a, b, loose) !== 0
  10742. }
  10743. exports.gte = gte
  10744. function gte (a, b, loose) {
  10745. return compare(a, b, loose) >= 0
  10746. }
  10747. exports.lte = lte
  10748. function lte (a, b, loose) {
  10749. return compare(a, b, loose) <= 0
  10750. }
  10751. exports.cmp = cmp
  10752. function cmp (a, op, b, loose) {
  10753. switch (op) {
  10754. case '===':
  10755. if (typeof a === 'object')
  10756. a = a.version
  10757. if (typeof b === 'object')
  10758. b = b.version
  10759. return a === b
  10760. case '!==':
  10761. if (typeof a === 'object')
  10762. a = a.version
  10763. if (typeof b === 'object')
  10764. b = b.version
  10765. return a !== b
  10766. case '':
  10767. case '=':
  10768. case '==':
  10769. return eq(a, b, loose)
  10770. case '!=':
  10771. return neq(a, b, loose)
  10772. case '>':
  10773. return gt(a, b, loose)
  10774. case '>=':
  10775. return gte(a, b, loose)
  10776. case '<':
  10777. return lt(a, b, loose)
  10778. case '<=':
  10779. return lte(a, b, loose)
  10780. default:
  10781. throw new TypeError('Invalid operator: ' + op)
  10782. }
  10783. }
  10784. exports.Comparator = Comparator
  10785. function Comparator (comp, options) {
  10786. if (!options || typeof options !== 'object') {
  10787. options = {
  10788. loose: !!options,
  10789. includePrerelease: false
  10790. }
  10791. }
  10792. if (comp instanceof Comparator) {
  10793. if (comp.loose === !!options.loose) {
  10794. return comp
  10795. } else {
  10796. comp = comp.value
  10797. }
  10798. }
  10799. if (!(this instanceof Comparator)) {
  10800. return new Comparator(comp, options)
  10801. }
  10802. debug('comparator', comp, options)
  10803. this.options = options
  10804. this.loose = !!options.loose
  10805. this.parse(comp)
  10806. if (this.semver === ANY) {
  10807. this.value = ''
  10808. } else {
  10809. this.value = this.operator + this.semver.version
  10810. }
  10811. debug('comp', this)
  10812. }
  10813. var ANY = {}
  10814. Comparator.prototype.parse = function (comp) {
  10815. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10816. var m = comp.match(r)
  10817. if (!m) {
  10818. throw new TypeError('Invalid comparator: ' + comp)
  10819. }
  10820. this.operator = m[1] !== undefined ? m[1] : ''
  10821. if (this.operator === '=') {
  10822. this.operator = ''
  10823. }
  10824. // if it literally is just '>' or '' then allow anything.
  10825. if (!m[2]) {
  10826. this.semver = ANY
  10827. } else {
  10828. this.semver = new SemVer(m[2], this.options.loose)
  10829. }
  10830. }
  10831. Comparator.prototype.toString = function () {
  10832. return this.value
  10833. }
  10834. Comparator.prototype.test = function (version) {
  10835. debug('Comparator.test', version, this.options.loose)
  10836. if (this.semver === ANY || version === ANY) {
  10837. return true
  10838. }
  10839. if (typeof version === 'string') {
  10840. try {
  10841. version = new SemVer(version, this.options)
  10842. } catch (er) {
  10843. return false
  10844. }
  10845. }
  10846. return cmp(version, this.operator, this.semver, this.options)
  10847. }
  10848. Comparator.prototype.intersects = function (comp, options) {
  10849. if (!(comp instanceof Comparator)) {
  10850. throw new TypeError('a Comparator is required')
  10851. }
  10852. if (!options || typeof options !== 'object') {
  10853. options = {
  10854. loose: !!options,
  10855. includePrerelease: false
  10856. }
  10857. }
  10858. var rangeTmp
  10859. if (this.operator === '') {
  10860. if (this.value === '') {
  10861. return true
  10862. }
  10863. rangeTmp = new Range(comp.value, options)
  10864. return satisfies(this.value, rangeTmp, options)
  10865. } else if (comp.operator === '') {
  10866. if (comp.value === '') {
  10867. return true
  10868. }
  10869. rangeTmp = new Range(this.value, options)
  10870. return satisfies(comp.semver, rangeTmp, options)
  10871. }
  10872. var sameDirectionIncreasing =
  10873. (this.operator === '>=' || this.operator === '>') &&
  10874. (comp.operator === '>=' || comp.operator === '>')
  10875. var sameDirectionDecreasing =
  10876. (this.operator === '<=' || this.operator === '<') &&
  10877. (comp.operator === '<=' || comp.operator === '<')
  10878. var sameSemVer = this.semver.version === comp.semver.version
  10879. var differentDirectionsInclusive =
  10880. (this.operator === '>=' || this.operator === '<=') &&
  10881. (comp.operator === '>=' || comp.operator === '<=')
  10882. var oppositeDirectionsLessThan =
  10883. cmp(this.semver, '<', comp.semver, options) &&
  10884. ((this.operator === '>=' || this.operator === '>') &&
  10885. (comp.operator === '<=' || comp.operator === '<'))
  10886. var oppositeDirectionsGreaterThan =
  10887. cmp(this.semver, '>', comp.semver, options) &&
  10888. ((this.operator === '<=' || this.operator === '<') &&
  10889. (comp.operator === '>=' || comp.operator === '>'))
  10890. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10891. (sameSemVer && differentDirectionsInclusive) ||
  10892. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10893. }
  10894. exports.Range = Range
  10895. function Range (range, options) {
  10896. if (!options || typeof options !== 'object') {
  10897. options = {
  10898. loose: !!options,
  10899. includePrerelease: false
  10900. }
  10901. }
  10902. if (range instanceof Range) {
  10903. if (range.loose === !!options.loose &&
  10904. range.includePrerelease === !!options.includePrerelease) {
  10905. return range
  10906. } else {
  10907. return new Range(range.raw, options)
  10908. }
  10909. }
  10910. if (range instanceof Comparator) {
  10911. return new Range(range.value, options)
  10912. }
  10913. if (!(this instanceof Range)) {
  10914. return new Range(range, options)
  10915. }
  10916. this.options = options
  10917. this.loose = !!options.loose
  10918. this.includePrerelease = !!options.includePrerelease
  10919. // First, split based on boolean or ||
  10920. this.raw = range
  10921. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10922. return this.parseRange(range.trim())
  10923. }, this).filter(function (c) {
  10924. // throw out any that are not relevant for whatever reason
  10925. return c.length
  10926. })
  10927. if (!this.set.length) {
  10928. throw new TypeError('Invalid SemVer Range: ' + range)
  10929. }
  10930. this.format()
  10931. }
  10932. Range.prototype.format = function () {
  10933. this.range = this.set.map(function (comps) {
  10934. return comps.join(' ').trim()
  10935. }).join('||').trim()
  10936. return this.range
  10937. }
  10938. Range.prototype.toString = function () {
  10939. return this.range
  10940. }
  10941. Range.prototype.parseRange = function (range) {
  10942. var loose = this.options.loose
  10943. range = range.trim()
  10944. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10945. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10946. range = range.replace(hr, hyphenReplace)
  10947. debug('hyphen replace', range)
  10948. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10949. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10950. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10951. // `~ 1.2.3` => `~1.2.3`
  10952. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10953. // `^ 1.2.3` => `^1.2.3`
  10954. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10955. // normalize spaces
  10956. range = range.split(/\s+/).join(' ')
  10957. // At this point, the range is completely trimmed and
  10958. // ready to be split into comparators.
  10959. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10960. var set = range.split(' ').map(function (comp) {
  10961. return parseComparator(comp, this.options)
  10962. }, this).join(' ').split(/\s+/)
  10963. if (this.options.loose) {
  10964. // in loose mode, throw out any that are not valid comparators
  10965. set = set.filter(function (comp) {
  10966. return !!comp.match(compRe)
  10967. })
  10968. }
  10969. set = set.map(function (comp) {
  10970. return new Comparator(comp, this.options)
  10971. }, this)
  10972. return set
  10973. }
  10974. Range.prototype.intersects = function (range, options) {
  10975. if (!(range instanceof Range)) {
  10976. throw new TypeError('a Range is required')
  10977. }
  10978. return this.set.some(function (thisComparators) {
  10979. return (
  10980. isSatisfiable(thisComparators, options) &&
  10981. range.set.some(function (rangeComparators) {
  10982. return (
  10983. isSatisfiable(rangeComparators, options) &&
  10984. thisComparators.every(function (thisComparator) {
  10985. return rangeComparators.every(function (rangeComparator) {
  10986. return thisComparator.intersects(rangeComparator, options)
  10987. })
  10988. })
  10989. )
  10990. })
  10991. )
  10992. })
  10993. }
  10994. // take a set of comparators and determine whether there
  10995. // exists a version which can satisfy it
  10996. function isSatisfiable (comparators, options) {
  10997. var result = true
  10998. var remainingComparators = comparators.slice()
  10999. var testComparator = remainingComparators.pop()
  11000. while (result && remainingComparators.length) {
  11001. result = remainingComparators.every(function (otherComparator) {
  11002. return testComparator.intersects(otherComparator, options)
  11003. })
  11004. testComparator = remainingComparators.pop()
  11005. }
  11006. return result
  11007. }
  11008. // Mostly just for testing and legacy API reasons
  11009. exports.toComparators = toComparators
  11010. function toComparators (range, options) {
  11011. return new Range(range, options).set.map(function (comp) {
  11012. return comp.map(function (c) {
  11013. return c.value
  11014. }).join(' ').trim().split(' ')
  11015. })
  11016. }
  11017. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11018. // already replaced the hyphen ranges
  11019. // turn into a set of JUST comparators.
  11020. function parseComparator (comp, options) {
  11021. debug('comp', comp, options)
  11022. comp = replaceCarets(comp, options)
  11023. debug('caret', comp)
  11024. comp = replaceTildes(comp, options)
  11025. debug('tildes', comp)
  11026. comp = replaceXRanges(comp, options)
  11027. debug('xrange', comp)
  11028. comp = replaceStars(comp, options)
  11029. debug('stars', comp)
  11030. return comp
  11031. }
  11032. function isX (id) {
  11033. return !id || id.toLowerCase() === 'x' || id === '*'
  11034. }
  11035. // ~, ~> --> * (any, kinda silly)
  11036. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11037. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11038. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11039. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11040. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11041. function replaceTildes (comp, options) {
  11042. return comp.trim().split(/\s+/).map(function (comp) {
  11043. return replaceTilde(comp, options)
  11044. }).join(' ')
  11045. }
  11046. function replaceTilde (comp, options) {
  11047. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11048. return comp.replace(r, function (_, M, m, p, pr) {
  11049. debug('tilde', comp, _, M, m, p, pr)
  11050. var ret
  11051. if (isX(M)) {
  11052. ret = ''
  11053. } else if (isX(m)) {
  11054. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11055. } else if (isX(p)) {
  11056. // ~1.2 == >=1.2.0 <1.3.0
  11057. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11058. } else if (pr) {
  11059. debug('replaceTilde pr', pr)
  11060. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11061. ' <' + M + '.' + (+m + 1) + '.0'
  11062. } else {
  11063. // ~1.2.3 == >=1.2.3 <1.3.0
  11064. ret = '>=' + M + '.' + m + '.' + p +
  11065. ' <' + M + '.' + (+m + 1) + '.0'
  11066. }
  11067. debug('tilde return', ret)
  11068. return ret
  11069. })
  11070. }
  11071. // ^ --> * (any, kinda silly)
  11072. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11073. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11074. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11075. // ^1.2.3 --> >=1.2.3 <2.0.0
  11076. // ^1.2.0 --> >=1.2.0 <2.0.0
  11077. function replaceCarets (comp, options) {
  11078. return comp.trim().split(/\s+/).map(function (comp) {
  11079. return replaceCaret(comp, options)
  11080. }).join(' ')
  11081. }
  11082. function replaceCaret (comp, options) {
  11083. debug('caret', comp, options)
  11084. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11085. return comp.replace(r, function (_, M, m, p, pr) {
  11086. debug('caret', comp, _, M, m, p, pr)
  11087. var ret
  11088. if (isX(M)) {
  11089. ret = ''
  11090. } else if (isX(m)) {
  11091. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11092. } else if (isX(p)) {
  11093. if (M === '0') {
  11094. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11095. } else {
  11096. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11097. }
  11098. } else if (pr) {
  11099. debug('replaceCaret pr', pr)
  11100. if (M === '0') {
  11101. if (m === '0') {
  11102. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11103. ' <' + M + '.' + m + '.' + (+p + 1)
  11104. } else {
  11105. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11106. ' <' + M + '.' + (+m + 1) + '.0'
  11107. }
  11108. } else {
  11109. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11110. ' <' + (+M + 1) + '.0.0'
  11111. }
  11112. } else {
  11113. debug('no pr')
  11114. if (M === '0') {
  11115. if (m === '0') {
  11116. ret = '>=' + M + '.' + m + '.' + p +
  11117. ' <' + M + '.' + m + '.' + (+p + 1)
  11118. } else {
  11119. ret = '>=' + M + '.' + m + '.' + p +
  11120. ' <' + M + '.' + (+m + 1) + '.0'
  11121. }
  11122. } else {
  11123. ret = '>=' + M + '.' + m + '.' + p +
  11124. ' <' + (+M + 1) + '.0.0'
  11125. }
  11126. }
  11127. debug('caret return', ret)
  11128. return ret
  11129. })
  11130. }
  11131. function replaceXRanges (comp, options) {
  11132. debug('replaceXRanges', comp, options)
  11133. return comp.split(/\s+/).map(function (comp) {
  11134. return replaceXRange(comp, options)
  11135. }).join(' ')
  11136. }
  11137. function replaceXRange (comp, options) {
  11138. comp = comp.trim()
  11139. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11140. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11141. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11142. var xM = isX(M)
  11143. var xm = xM || isX(m)
  11144. var xp = xm || isX(p)
  11145. var anyX = xp
  11146. if (gtlt === '=' && anyX) {
  11147. gtlt = ''
  11148. }
  11149. // if we're including prereleases in the match, then we need
  11150. // to fix this to -0, the lowest possible prerelease value
  11151. pr = options.includePrerelease ? '-0' : ''
  11152. if (xM) {
  11153. if (gtlt === '>' || gtlt === '<') {
  11154. // nothing is allowed
  11155. ret = '<0.0.0-0'
  11156. } else {
  11157. // nothing is forbidden
  11158. ret = '*'
  11159. }
  11160. } else if (gtlt && anyX) {
  11161. // we know patch is an x, because we have any x at all.
  11162. // replace X with 0
  11163. if (xm) {
  11164. m = 0
  11165. }
  11166. p = 0
  11167. if (gtlt === '>') {
  11168. // >1 => >=2.0.0
  11169. // >1.2 => >=1.3.0
  11170. // >1.2.3 => >= 1.2.4
  11171. gtlt = '>='
  11172. if (xm) {
  11173. M = +M + 1
  11174. m = 0
  11175. p = 0
  11176. } else {
  11177. m = +m + 1
  11178. p = 0
  11179. }
  11180. } else if (gtlt === '<=') {
  11181. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11182. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11183. gtlt = '<'
  11184. if (xm) {
  11185. M = +M + 1
  11186. } else {
  11187. m = +m + 1
  11188. }
  11189. }
  11190. ret = gtlt + M + '.' + m + '.' + p + pr
  11191. } else if (xm) {
  11192. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11193. } else if (xp) {
  11194. ret = '>=' + M + '.' + m + '.0' + pr +
  11195. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11196. }
  11197. debug('xRange return', ret)
  11198. return ret
  11199. })
  11200. }
  11201. // Because * is AND-ed with everything else in the comparator,
  11202. // and '' means "any version", just remove the *s entirely.
  11203. function replaceStars (comp, options) {
  11204. debug('replaceStars', comp, options)
  11205. // Looseness is ignored here. star is always as loose as it gets!
  11206. return comp.trim().replace(re[t.STAR], '')
  11207. }
  11208. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11209. // M, m, patch, prerelease, build
  11210. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11211. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11212. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11213. function hyphenReplace ($0,
  11214. from, fM, fm, fp, fpr, fb,
  11215. to, tM, tm, tp, tpr, tb) {
  11216. if (isX(fM)) {
  11217. from = ''
  11218. } else if (isX(fm)) {
  11219. from = '>=' + fM + '.0.0'
  11220. } else if (isX(fp)) {
  11221. from = '>=' + fM + '.' + fm + '.0'
  11222. } else {
  11223. from = '>=' + from
  11224. }
  11225. if (isX(tM)) {
  11226. to = ''
  11227. } else if (isX(tm)) {
  11228. to = '<' + (+tM + 1) + '.0.0'
  11229. } else if (isX(tp)) {
  11230. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11231. } else if (tpr) {
  11232. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11233. } else {
  11234. to = '<=' + to
  11235. }
  11236. return (from + ' ' + to).trim()
  11237. }
  11238. // if ANY of the sets match ALL of its comparators, then pass
  11239. Range.prototype.test = function (version) {
  11240. if (!version) {
  11241. return false
  11242. }
  11243. if (typeof version === 'string') {
  11244. try {
  11245. version = new SemVer(version, this.options)
  11246. } catch (er) {
  11247. return false
  11248. }
  11249. }
  11250. for (var i = 0; i < this.set.length; i++) {
  11251. if (testSet(this.set[i], version, this.options)) {
  11252. return true
  11253. }
  11254. }
  11255. return false
  11256. }
  11257. function testSet (set, version, options) {
  11258. for (var i = 0; i < set.length; i++) {
  11259. if (!set[i].test(version)) {
  11260. return false
  11261. }
  11262. }
  11263. if (version.prerelease.length && !options.includePrerelease) {
  11264. // Find the set of versions that are allowed to have prereleases
  11265. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11266. // That should allow `1.2.3-pr.2` to pass.
  11267. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11268. // even though it's within the range set by the comparators.
  11269. for (i = 0; i < set.length; i++) {
  11270. debug(set[i].semver)
  11271. if (set[i].semver === ANY) {
  11272. continue
  11273. }
  11274. if (set[i].semver.prerelease.length > 0) {
  11275. var allowed = set[i].semver
  11276. if (allowed.major === version.major &&
  11277. allowed.minor === version.minor &&
  11278. allowed.patch === version.patch) {
  11279. return true
  11280. }
  11281. }
  11282. }
  11283. // Version has a -pre, but it's not one of the ones we like.
  11284. return false
  11285. }
  11286. return true
  11287. }
  11288. exports.satisfies = satisfies
  11289. function satisfies (version, range, options) {
  11290. try {
  11291. range = new Range(range, options)
  11292. } catch (er) {
  11293. return false
  11294. }
  11295. return range.test(version)
  11296. }
  11297. exports.maxSatisfying = maxSatisfying
  11298. function maxSatisfying (versions, range, options) {
  11299. var max = null
  11300. var maxSV = null
  11301. try {
  11302. var rangeObj = new Range(range, options)
  11303. } catch (er) {
  11304. return null
  11305. }
  11306. versions.forEach(function (v) {
  11307. if (rangeObj.test(v)) {
  11308. // satisfies(v, range, options)
  11309. if (!max || maxSV.compare(v) === -1) {
  11310. // compare(max, v, true)
  11311. max = v
  11312. maxSV = new SemVer(max, options)
  11313. }
  11314. }
  11315. })
  11316. return max
  11317. }
  11318. exports.minSatisfying = minSatisfying
  11319. function minSatisfying (versions, range, options) {
  11320. var min = null
  11321. var minSV = null
  11322. try {
  11323. var rangeObj = new Range(range, options)
  11324. } catch (er) {
  11325. return null
  11326. }
  11327. versions.forEach(function (v) {
  11328. if (rangeObj.test(v)) {
  11329. // satisfies(v, range, options)
  11330. if (!min || minSV.compare(v) === 1) {
  11331. // compare(min, v, true)
  11332. min = v
  11333. minSV = new SemVer(min, options)
  11334. }
  11335. }
  11336. })
  11337. return min
  11338. }
  11339. exports.minVersion = minVersion
  11340. function minVersion (range, loose) {
  11341. range = new Range(range, loose)
  11342. var minver = new SemVer('0.0.0')
  11343. if (range.test(minver)) {
  11344. return minver
  11345. }
  11346. minver = new SemVer('0.0.0-0')
  11347. if (range.test(minver)) {
  11348. return minver
  11349. }
  11350. minver = null
  11351. for (var i = 0; i < range.set.length; ++i) {
  11352. var comparators = range.set[i]
  11353. comparators.forEach(function (comparator) {
  11354. // Clone to avoid manipulating the comparator's semver object.
  11355. var compver = new SemVer(comparator.semver.version)
  11356. switch (comparator.operator) {
  11357. case '>':
  11358. if (compver.prerelease.length === 0) {
  11359. compver.patch++
  11360. } else {
  11361. compver.prerelease.push(0)
  11362. }
  11363. compver.raw = compver.format()
  11364. /* fallthrough */
  11365. case '':
  11366. case '>=':
  11367. if (!minver || gt(minver, compver)) {
  11368. minver = compver
  11369. }
  11370. break
  11371. case '<':
  11372. case '<=':
  11373. /* Ignore maximum versions */
  11374. break
  11375. /* istanbul ignore next */
  11376. default:
  11377. throw new Error('Unexpected operation: ' + comparator.operator)
  11378. }
  11379. })
  11380. }
  11381. if (minver && range.test(minver)) {
  11382. return minver
  11383. }
  11384. return null
  11385. }
  11386. exports.validRange = validRange
  11387. function validRange (range, options) {
  11388. try {
  11389. // Return '*' instead of '' so that truthiness works.
  11390. // This will throw if it's invalid anyway
  11391. return new Range(range, options).range || '*'
  11392. } catch (er) {
  11393. return null
  11394. }
  11395. }
  11396. // Determine if version is less than all the versions possible in the range
  11397. exports.ltr = ltr
  11398. function ltr (version, range, options) {
  11399. return outside(version, range, '<', options)
  11400. }
  11401. // Determine if version is greater than all the versions possible in the range.
  11402. exports.gtr = gtr
  11403. function gtr (version, range, options) {
  11404. return outside(version, range, '>', options)
  11405. }
  11406. exports.outside = outside
  11407. function outside (version, range, hilo, options) {
  11408. version = new SemVer(version, options)
  11409. range = new Range(range, options)
  11410. var gtfn, ltefn, ltfn, comp, ecomp
  11411. switch (hilo) {
  11412. case '>':
  11413. gtfn = gt
  11414. ltefn = lte
  11415. ltfn = lt
  11416. comp = '>'
  11417. ecomp = '>='
  11418. break
  11419. case '<':
  11420. gtfn = lt
  11421. ltefn = gte
  11422. ltfn = gt
  11423. comp = '<'
  11424. ecomp = '<='
  11425. break
  11426. default:
  11427. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11428. }
  11429. // If it satisifes the range it is not outside
  11430. if (satisfies(version, range, options)) {
  11431. return false
  11432. }
  11433. // From now on, variable terms are as if we're in "gtr" mode.
  11434. // but note that everything is flipped for the "ltr" function.
  11435. for (var i = 0; i < range.set.length; ++i) {
  11436. var comparators = range.set[i]
  11437. var high = null
  11438. var low = null
  11439. comparators.forEach(function (comparator) {
  11440. if (comparator.semver === ANY) {
  11441. comparator = new Comparator('>=0.0.0')
  11442. }
  11443. high = high || comparator
  11444. low = low || comparator
  11445. if (gtfn(comparator.semver, high.semver, options)) {
  11446. high = comparator
  11447. } else if (ltfn(comparator.semver, low.semver, options)) {
  11448. low = comparator
  11449. }
  11450. })
  11451. // If the edge version comparator has a operator then our version
  11452. // isn't outside it
  11453. if (high.operator === comp || high.operator === ecomp) {
  11454. return false
  11455. }
  11456. // If the lowest version comparator has an operator and our version
  11457. // is less than it then it isn't higher than the range
  11458. if ((!low.operator || low.operator === comp) &&
  11459. ltefn(version, low.semver)) {
  11460. return false
  11461. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11462. return false
  11463. }
  11464. }
  11465. return true
  11466. }
  11467. exports.prerelease = prerelease
  11468. function prerelease (version, options) {
  11469. var parsed = parse(version, options)
  11470. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11471. }
  11472. exports.intersects = intersects
  11473. function intersects (r1, r2, options) {
  11474. r1 = new Range(r1, options)
  11475. r2 = new Range(r2, options)
  11476. return r1.intersects(r2)
  11477. }
  11478. exports.coerce = coerce
  11479. function coerce (version, options) {
  11480. if (version instanceof SemVer) {
  11481. return version
  11482. }
  11483. if (typeof version === 'number') {
  11484. version = String(version)
  11485. }
  11486. if (typeof version !== 'string') {
  11487. return null
  11488. }
  11489. options = options || {}
  11490. var match = null
  11491. if (!options.rtl) {
  11492. match = version.match(re[t.COERCE])
  11493. } else {
  11494. // Find the right-most coercible string that does not share
  11495. // a terminus with a more left-ward coercible string.
  11496. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11497. //
  11498. // Walk through the string checking with a /g regexp
  11499. // Manually set the index so as to pick up overlapping matches.
  11500. // Stop when we get a match that ends at the string end, since no
  11501. // coercible string can be more right-ward without the same terminus.
  11502. var next
  11503. while ((next = re[t.COERCERTL].exec(version)) &&
  11504. (!match || match.index + match[0].length !== version.length)
  11505. ) {
  11506. if (!match ||
  11507. next.index + next[0].length !== match.index + match[0].length) {
  11508. match = next
  11509. }
  11510. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11511. }
  11512. // leave it in a clean state
  11513. re[t.COERCERTL].lastIndex = -1
  11514. }
  11515. if (match === null) {
  11516. return null
  11517. }
  11518. return parse(match[2] +
  11519. '.' + (match[3] || '0') +
  11520. '.' + (match[4] || '0'), options)
  11521. }
  11522. /***/ }),
  11523. /***/ 669:
  11524. /***/ (function(module) {
  11525. module.exports = require("util");
  11526. /***/ }),
  11527. /***/ 672:
  11528. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11529. "use strict";
  11530. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11531. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11532. return new (P || (P = Promise))(function (resolve, reject) {
  11533. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11534. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11535. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11536. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11537. });
  11538. };
  11539. var _a;
  11540. Object.defineProperty(exports, "__esModule", { value: true });
  11541. const assert_1 = __webpack_require__(357);
  11542. const fs = __webpack_require__(747);
  11543. const path = __webpack_require__(622);
  11544. _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;
  11545. exports.IS_WINDOWS = process.platform === 'win32';
  11546. function exists(fsPath) {
  11547. return __awaiter(this, void 0, void 0, function* () {
  11548. try {
  11549. yield exports.stat(fsPath);
  11550. }
  11551. catch (err) {
  11552. if (err.code === 'ENOENT') {
  11553. return false;
  11554. }
  11555. throw err;
  11556. }
  11557. return true;
  11558. });
  11559. }
  11560. exports.exists = exists;
  11561. function isDirectory(fsPath, useStat = false) {
  11562. return __awaiter(this, void 0, void 0, function* () {
  11563. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11564. return stats.isDirectory();
  11565. });
  11566. }
  11567. exports.isDirectory = isDirectory;
  11568. /**
  11569. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11570. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11571. */
  11572. function isRooted(p) {
  11573. p = normalizeSeparators(p);
  11574. if (!p) {
  11575. throw new Error('isRooted() parameter "p" cannot be empty');
  11576. }
  11577. if (exports.IS_WINDOWS) {
  11578. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11579. ); // e.g. C: or C:\hello
  11580. }
  11581. return p.startsWith('/');
  11582. }
  11583. exports.isRooted = isRooted;
  11584. /**
  11585. * Recursively create a directory at `fsPath`.
  11586. *
  11587. * This implementation is optimistic, meaning it attempts to create the full
  11588. * path first, and backs up the path stack from there.
  11589. *
  11590. * @param fsPath The path to create
  11591. * @param maxDepth The maximum recursion depth
  11592. * @param depth The current recursion depth
  11593. */
  11594. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11595. return __awaiter(this, void 0, void 0, function* () {
  11596. assert_1.ok(fsPath, 'a path argument must be provided');
  11597. fsPath = path.resolve(fsPath);
  11598. if (depth >= maxDepth)
  11599. return exports.mkdir(fsPath);
  11600. try {
  11601. yield exports.mkdir(fsPath);
  11602. return;
  11603. }
  11604. catch (err) {
  11605. switch (err.code) {
  11606. case 'ENOENT': {
  11607. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11608. yield exports.mkdir(fsPath);
  11609. return;
  11610. }
  11611. default: {
  11612. let stats;
  11613. try {
  11614. stats = yield exports.stat(fsPath);
  11615. }
  11616. catch (err2) {
  11617. throw err;
  11618. }
  11619. if (!stats.isDirectory())
  11620. throw err;
  11621. }
  11622. }
  11623. }
  11624. });
  11625. }
  11626. exports.mkdirP = mkdirP;
  11627. /**
  11628. * Best effort attempt to determine whether a file exists and is executable.
  11629. * @param filePath file path to check
  11630. * @param extensions additional file extensions to try
  11631. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11632. */
  11633. function tryGetExecutablePath(filePath, extensions) {
  11634. return __awaiter(this, void 0, void 0, function* () {
  11635. let stats = undefined;
  11636. try {
  11637. // test file exists
  11638. stats = yield exports.stat(filePath);
  11639. }
  11640. catch (err) {
  11641. if (err.code !== 'ENOENT') {
  11642. // eslint-disable-next-line no-console
  11643. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11644. }
  11645. }
  11646. if (stats && stats.isFile()) {
  11647. if (exports.IS_WINDOWS) {
  11648. // on Windows, test for valid extension
  11649. const upperExt = path.extname(filePath).toUpperCase();
  11650. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11651. return filePath;
  11652. }
  11653. }
  11654. else {
  11655. if (isUnixExecutable(stats)) {
  11656. return filePath;
  11657. }
  11658. }
  11659. }
  11660. // try each extension
  11661. const originalFilePath = filePath;
  11662. for (const extension of extensions) {
  11663. filePath = originalFilePath + extension;
  11664. stats = undefined;
  11665. try {
  11666. stats = yield exports.stat(filePath);
  11667. }
  11668. catch (err) {
  11669. if (err.code !== 'ENOENT') {
  11670. // eslint-disable-next-line no-console
  11671. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11672. }
  11673. }
  11674. if (stats && stats.isFile()) {
  11675. if (exports.IS_WINDOWS) {
  11676. // preserve the case of the actual file (since an extension was appended)
  11677. try {
  11678. const directory = path.dirname(filePath);
  11679. const upperName = path.basename(filePath).toUpperCase();
  11680. for (const actualName of yield exports.readdir(directory)) {
  11681. if (upperName === actualName.toUpperCase()) {
  11682. filePath = path.join(directory, actualName);
  11683. break;
  11684. }
  11685. }
  11686. }
  11687. catch (err) {
  11688. // eslint-disable-next-line no-console
  11689. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11690. }
  11691. return filePath;
  11692. }
  11693. else {
  11694. if (isUnixExecutable(stats)) {
  11695. return filePath;
  11696. }
  11697. }
  11698. }
  11699. }
  11700. return '';
  11701. });
  11702. }
  11703. exports.tryGetExecutablePath = tryGetExecutablePath;
  11704. function normalizeSeparators(p) {
  11705. p = p || '';
  11706. if (exports.IS_WINDOWS) {
  11707. // convert slashes on Windows
  11708. p = p.replace(/\//g, '\\');
  11709. // remove redundant slashes
  11710. return p.replace(/\\\\+/g, '\\');
  11711. }
  11712. // remove redundant slashes
  11713. return p.replace(/\/\/+/g, '/');
  11714. }
  11715. // on Mac/Linux, test the execute bit
  11716. // R W X R W X R W X
  11717. // 256 128 64 32 16 8 4 2 1
  11718. function isUnixExecutable(stats) {
  11719. return ((stats.mode & 1) > 0 ||
  11720. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11721. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11722. }
  11723. //# sourceMappingURL=io-util.js.map
  11724. /***/ }),
  11725. /***/ 674:
  11726. /***/ (function(module, __unusedexports, __webpack_require__) {
  11727. module.exports = authenticate;
  11728. const { Deprecation } = __webpack_require__(692);
  11729. const once = __webpack_require__(969);
  11730. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11731. function authenticate(state, options) {
  11732. deprecateAuthenticate(
  11733. state.octokit.log,
  11734. new Deprecation(
  11735. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11736. )
  11737. );
  11738. if (!options) {
  11739. state.auth = false;
  11740. return;
  11741. }
  11742. switch (options.type) {
  11743. case "basic":
  11744. if (!options.username || !options.password) {
  11745. throw new Error(
  11746. "Basic authentication requires both a username and password to be set"
  11747. );
  11748. }
  11749. break;
  11750. case "oauth":
  11751. if (!options.token && !(options.key && options.secret)) {
  11752. throw new Error(
  11753. "OAuth2 authentication requires a token or key & secret to be set"
  11754. );
  11755. }
  11756. break;
  11757. case "token":
  11758. case "app":
  11759. if (!options.token) {
  11760. throw new Error("Token authentication requires a token to be set");
  11761. }
  11762. break;
  11763. default:
  11764. throw new Error(
  11765. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11766. );
  11767. }
  11768. state.auth = options;
  11769. }
  11770. /***/ }),
  11771. /***/ 675:
  11772. /***/ (function(module) {
  11773. module.exports = function btoa(str) {
  11774. return new Buffer(str).toString('base64')
  11775. }
  11776. /***/ }),
  11777. /***/ 692:
  11778. /***/ (function(__unusedmodule, exports) {
  11779. "use strict";
  11780. Object.defineProperty(exports, '__esModule', { value: true });
  11781. class Deprecation extends Error {
  11782. constructor(message) {
  11783. super(message); // Maintains proper stack trace (only available on V8)
  11784. /* istanbul ignore next */
  11785. if (Error.captureStackTrace) {
  11786. Error.captureStackTrace(this, this.constructor);
  11787. }
  11788. this.name = 'Deprecation';
  11789. }
  11790. }
  11791. exports.Deprecation = Deprecation;
  11792. /***/ }),
  11793. /***/ 696:
  11794. /***/ (function(module) {
  11795. "use strict";
  11796. /*!
  11797. * isobject <https://github.com/jonschlinkert/isobject>
  11798. *
  11799. * Copyright (c) 2014-2017, Jon Schlinkert.
  11800. * Released under the MIT License.
  11801. */
  11802. function isObject(val) {
  11803. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11804. }
  11805. /*!
  11806. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11807. *
  11808. * Copyright (c) 2014-2017, Jon Schlinkert.
  11809. * Released under the MIT License.
  11810. */
  11811. function isObjectObject(o) {
  11812. return isObject(o) === true
  11813. && Object.prototype.toString.call(o) === '[object Object]';
  11814. }
  11815. function isPlainObject(o) {
  11816. var ctor,prot;
  11817. if (isObjectObject(o) === false) return false;
  11818. // If has modified constructor
  11819. ctor = o.constructor;
  11820. if (typeof ctor !== 'function') return false;
  11821. // If has modified prototype
  11822. prot = ctor.prototype;
  11823. if (isObjectObject(prot) === false) return false;
  11824. // If constructor does not have an Object-specific method
  11825. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11826. return false;
  11827. }
  11828. // Most likely a plain Object
  11829. return true;
  11830. }
  11831. module.exports = isPlainObject;
  11832. /***/ }),
  11833. /***/ 697:
  11834. /***/ (function(module) {
  11835. "use strict";
  11836. module.exports = (promise, onFinally) => {
  11837. onFinally = onFinally || (() => {});
  11838. return promise.then(
  11839. val => new Promise(resolve => {
  11840. resolve(onFinally());
  11841. }).then(() => val),
  11842. err => new Promise(resolve => {
  11843. resolve(onFinally());
  11844. }).then(() => {
  11845. throw err;
  11846. })
  11847. );
  11848. };
  11849. /***/ }),
  11850. /***/ 722:
  11851. /***/ (function(module) {
  11852. /**
  11853. * Convert array of 16 byte values to UUID string format of the form:
  11854. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11855. */
  11856. var byteToHex = [];
  11857. for (var i = 0; i < 256; ++i) {
  11858. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11859. }
  11860. function bytesToUuid(buf, offset) {
  11861. var i = offset || 0;
  11862. var bth = byteToHex;
  11863. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11864. return ([bth[buf[i++]], bth[buf[i++]],
  11865. bth[buf[i++]], bth[buf[i++]], '-',
  11866. bth[buf[i++]], bth[buf[i++]], '-',
  11867. 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++]]]).join('');
  11872. }
  11873. module.exports = bytesToUuid;
  11874. /***/ }),
  11875. /***/ 742:
  11876. /***/ (function(module, __unusedexports, __webpack_require__) {
  11877. var fs = __webpack_require__(747)
  11878. var core
  11879. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11880. core = __webpack_require__(818)
  11881. } else {
  11882. core = __webpack_require__(197)
  11883. }
  11884. module.exports = isexe
  11885. isexe.sync = sync
  11886. function isexe (path, options, cb) {
  11887. if (typeof options === 'function') {
  11888. cb = options
  11889. options = {}
  11890. }
  11891. if (!cb) {
  11892. if (typeof Promise !== 'function') {
  11893. throw new TypeError('callback not provided')
  11894. }
  11895. return new Promise(function (resolve, reject) {
  11896. isexe(path, options || {}, function (er, is) {
  11897. if (er) {
  11898. reject(er)
  11899. } else {
  11900. resolve(is)
  11901. }
  11902. })
  11903. })
  11904. }
  11905. core(path, options || {}, function (er, is) {
  11906. // ignore EACCES because that just means we aren't allowed to run it
  11907. if (er) {
  11908. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11909. er = null
  11910. is = false
  11911. }
  11912. }
  11913. cb(er, is)
  11914. })
  11915. }
  11916. function sync (path, options) {
  11917. // my kingdom for a filtered catch
  11918. try {
  11919. return core.sync(path, options || {})
  11920. } catch (er) {
  11921. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11922. return false
  11923. } else {
  11924. throw er
  11925. }
  11926. }
  11927. }
  11928. /***/ }),
  11929. /***/ 747:
  11930. /***/ (function(module) {
  11931. module.exports = require("fs");
  11932. /***/ }),
  11933. /***/ 753:
  11934. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11935. "use strict";
  11936. Object.defineProperty(exports, '__esModule', { value: true });
  11937. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11938. var endpoint = __webpack_require__(385);
  11939. var universalUserAgent = __webpack_require__(211);
  11940. var isPlainObject = _interopDefault(__webpack_require__(696));
  11941. var nodeFetch = _interopDefault(__webpack_require__(454));
  11942. var requestError = __webpack_require__(463);
  11943. const VERSION = "5.4.2";
  11944. function getBufferResponse(response) {
  11945. return response.arrayBuffer();
  11946. }
  11947. function fetchWrapper(requestOptions) {
  11948. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11949. requestOptions.body = JSON.stringify(requestOptions.body);
  11950. }
  11951. let headers = {};
  11952. let status;
  11953. let url;
  11954. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11955. return fetch(requestOptions.url, Object.assign({
  11956. method: requestOptions.method,
  11957. body: requestOptions.body,
  11958. headers: requestOptions.headers,
  11959. redirect: requestOptions.redirect
  11960. }, requestOptions.request)).then(response => {
  11961. url = response.url;
  11962. status = response.status;
  11963. for (const keyAndValue of response.headers) {
  11964. headers[keyAndValue[0]] = keyAndValue[1];
  11965. }
  11966. if (status === 204 || status === 205) {
  11967. return;
  11968. } // GitHub API returns 200 for HEAD requests
  11969. if (requestOptions.method === "HEAD") {
  11970. if (status < 400) {
  11971. return;
  11972. }
  11973. throw new requestError.RequestError(response.statusText, status, {
  11974. headers,
  11975. request: requestOptions
  11976. });
  11977. }
  11978. if (status === 304) {
  11979. throw new requestError.RequestError("Not modified", status, {
  11980. headers,
  11981. request: requestOptions
  11982. });
  11983. }
  11984. if (status >= 400) {
  11985. return response.text().then(message => {
  11986. const error = new requestError.RequestError(message, status, {
  11987. headers,
  11988. request: requestOptions
  11989. });
  11990. try {
  11991. let responseBody = JSON.parse(error.message);
  11992. Object.assign(error, responseBody);
  11993. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  11994. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11995. } catch (e) {// ignore, see octokit/rest.js#684
  11996. }
  11997. throw error;
  11998. });
  11999. }
  12000. const contentType = response.headers.get("content-type");
  12001. if (/application\/json/.test(contentType)) {
  12002. return response.json();
  12003. }
  12004. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12005. return response.text();
  12006. }
  12007. return getBufferResponse(response);
  12008. }).then(data => {
  12009. return {
  12010. status,
  12011. url,
  12012. headers,
  12013. data
  12014. };
  12015. }).catch(error => {
  12016. if (error instanceof requestError.RequestError) {
  12017. throw error;
  12018. }
  12019. throw new requestError.RequestError(error.message, 500, {
  12020. headers,
  12021. request: requestOptions
  12022. });
  12023. });
  12024. }
  12025. function withDefaults(oldEndpoint, newDefaults) {
  12026. const endpoint = oldEndpoint.defaults(newDefaults);
  12027. const newApi = function (route, parameters) {
  12028. const endpointOptions = endpoint.merge(route, parameters);
  12029. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12030. return fetchWrapper(endpoint.parse(endpointOptions));
  12031. }
  12032. const request = (route, parameters) => {
  12033. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12034. };
  12035. Object.assign(request, {
  12036. endpoint,
  12037. defaults: withDefaults.bind(null, endpoint)
  12038. });
  12039. return endpointOptions.request.hook(request, endpointOptions);
  12040. };
  12041. return Object.assign(newApi, {
  12042. endpoint,
  12043. defaults: withDefaults.bind(null, endpoint)
  12044. });
  12045. }
  12046. const request = withDefaults(endpoint.endpoint, {
  12047. headers: {
  12048. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12049. }
  12050. });
  12051. exports.request = request;
  12052. //# sourceMappingURL=index.js.map
  12053. /***/ }),
  12054. /***/ 761:
  12055. /***/ (function(module) {
  12056. module.exports = require("zlib");
  12057. /***/ }),
  12058. /***/ 763:
  12059. /***/ (function(module) {
  12060. module.exports = removeHook
  12061. function removeHook (state, name, method) {
  12062. if (!state.registry[name]) {
  12063. return
  12064. }
  12065. var index = state.registry[name]
  12066. .map(function (registered) { return registered.orig })
  12067. .indexOf(method)
  12068. if (index === -1) {
  12069. return
  12070. }
  12071. state.registry[name].splice(index, 1)
  12072. }
  12073. /***/ }),
  12074. /***/ 768:
  12075. /***/ (function(module) {
  12076. "use strict";
  12077. module.exports = function (x) {
  12078. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12079. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12080. if (x[x.length - 1] === lf) {
  12081. x = x.slice(0, x.length - 1);
  12082. }
  12083. if (x[x.length - 1] === cr) {
  12084. x = x.slice(0, x.length - 1);
  12085. }
  12086. return x;
  12087. };
  12088. /***/ }),
  12089. /***/ 777:
  12090. /***/ (function(module, __unusedexports, __webpack_require__) {
  12091. module.exports = getFirstPage
  12092. const getPage = __webpack_require__(265)
  12093. function getFirstPage (octokit, link, headers) {
  12094. return getPage(octokit, link, 'first', headers)
  12095. }
  12096. /***/ }),
  12097. /***/ 796:
  12098. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12099. "use strict";
  12100. Object.defineProperty(exports, '__esModule', { value: true });
  12101. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12102. var osName = _interopDefault(__webpack_require__(2));
  12103. function getUserAgent() {
  12104. try {
  12105. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12106. } catch (error) {
  12107. if (/wmic os get Caption/.test(error.message)) {
  12108. return "Windows <version undetectable>";
  12109. }
  12110. throw error;
  12111. }
  12112. }
  12113. exports.getUserAgent = getUserAgent;
  12114. //# sourceMappingURL=index.js.map
  12115. /***/ }),
  12116. /***/ 813:
  12117. /***/ (function(__unusedmodule, exports) {
  12118. "use strict";
  12119. Object.defineProperty(exports, '__esModule', { value: true });
  12120. async function auth(token) {
  12121. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12122. return {
  12123. type: "token",
  12124. token: token,
  12125. tokenType
  12126. };
  12127. }
  12128. /**
  12129. * Prefix token for usage in the Authorization header
  12130. *
  12131. * @param token OAuth token or JSON Web Token
  12132. */
  12133. function withAuthorizationPrefix(token) {
  12134. if (token.split(/\./).length === 3) {
  12135. return `bearer ${token}`;
  12136. }
  12137. return `token ${token}`;
  12138. }
  12139. async function hook(token, request, route, parameters) {
  12140. const endpoint = request.endpoint.merge(route, parameters);
  12141. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12142. return request(endpoint);
  12143. }
  12144. const createTokenAuth = function createTokenAuth(token) {
  12145. if (!token) {
  12146. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12147. }
  12148. if (typeof token !== "string") {
  12149. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12150. }
  12151. token = token.replace(/^(token|bearer) +/i, "");
  12152. return Object.assign(auth.bind(null, token), {
  12153. hook: hook.bind(null, token)
  12154. });
  12155. };
  12156. exports.createTokenAuth = createTokenAuth;
  12157. //# sourceMappingURL=index.js.map
  12158. /***/ }),
  12159. /***/ 814:
  12160. /***/ (function(module, __unusedexports, __webpack_require__) {
  12161. module.exports = which
  12162. which.sync = whichSync
  12163. var isWindows = process.platform === 'win32' ||
  12164. process.env.OSTYPE === 'cygwin' ||
  12165. process.env.OSTYPE === 'msys'
  12166. var path = __webpack_require__(622)
  12167. var COLON = isWindows ? ';' : ':'
  12168. var isexe = __webpack_require__(742)
  12169. function getNotFoundError (cmd) {
  12170. var er = new Error('not found: ' + cmd)
  12171. er.code = 'ENOENT'
  12172. return er
  12173. }
  12174. function getPathInfo (cmd, opt) {
  12175. var colon = opt.colon || COLON
  12176. var pathEnv = opt.path || process.env.PATH || ''
  12177. var pathExt = ['']
  12178. pathEnv = pathEnv.split(colon)
  12179. var pathExtExe = ''
  12180. if (isWindows) {
  12181. pathEnv.unshift(process.cwd())
  12182. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12183. pathExt = pathExtExe.split(colon)
  12184. // Always test the cmd itself first. isexe will check to make sure
  12185. // it's found in the pathExt set.
  12186. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12187. pathExt.unshift('')
  12188. }
  12189. // If it has a slash, then we don't bother searching the pathenv.
  12190. // just check the file itself, and that's it.
  12191. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12192. pathEnv = ['']
  12193. return {
  12194. env: pathEnv,
  12195. ext: pathExt,
  12196. extExe: pathExtExe
  12197. }
  12198. }
  12199. function which (cmd, opt, cb) {
  12200. if (typeof opt === 'function') {
  12201. cb = opt
  12202. opt = {}
  12203. }
  12204. var info = getPathInfo(cmd, opt)
  12205. var pathEnv = info.env
  12206. var pathExt = info.ext
  12207. var pathExtExe = info.extExe
  12208. var found = []
  12209. ;(function F (i, l) {
  12210. if (i === l) {
  12211. if (opt.all && found.length)
  12212. return cb(null, found)
  12213. else
  12214. return cb(getNotFoundError(cmd))
  12215. }
  12216. var pathPart = pathEnv[i]
  12217. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12218. pathPart = pathPart.slice(1, -1)
  12219. var p = path.join(pathPart, cmd)
  12220. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12221. p = cmd.slice(0, 2) + p
  12222. }
  12223. ;(function E (ii, ll) {
  12224. if (ii === ll) return F(i + 1, l)
  12225. var ext = pathExt[ii]
  12226. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12227. if (!er && is) {
  12228. if (opt.all)
  12229. found.push(p + ext)
  12230. else
  12231. return cb(null, p + ext)
  12232. }
  12233. return E(ii + 1, ll)
  12234. })
  12235. })(0, pathExt.length)
  12236. })(0, pathEnv.length)
  12237. }
  12238. function whichSync (cmd, opt) {
  12239. opt = opt || {}
  12240. var info = getPathInfo(cmd, opt)
  12241. var pathEnv = info.env
  12242. var pathExt = info.ext
  12243. var pathExtExe = info.extExe
  12244. var found = []
  12245. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12246. var pathPart = pathEnv[i]
  12247. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12248. pathPart = pathPart.slice(1, -1)
  12249. var p = path.join(pathPart, cmd)
  12250. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12251. p = cmd.slice(0, 2) + p
  12252. }
  12253. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12254. var cur = p + pathExt[j]
  12255. var is
  12256. try {
  12257. is = isexe.sync(cur, { pathExt: pathExtExe })
  12258. if (is) {
  12259. if (opt.all)
  12260. found.push(cur)
  12261. else
  12262. return cur
  12263. }
  12264. } catch (ex) {}
  12265. }
  12266. }
  12267. if (opt.all && found.length)
  12268. return found
  12269. if (opt.nothrow)
  12270. return null
  12271. throw getNotFoundError(cmd)
  12272. }
  12273. /***/ }),
  12274. /***/ 816:
  12275. /***/ (function(module) {
  12276. "use strict";
  12277. module.exports = /^#!.*/;
  12278. /***/ }),
  12279. /***/ 818:
  12280. /***/ (function(module, __unusedexports, __webpack_require__) {
  12281. module.exports = isexe
  12282. isexe.sync = sync
  12283. var fs = __webpack_require__(747)
  12284. function checkPathExt (path, options) {
  12285. var pathext = options.pathExt !== undefined ?
  12286. options.pathExt : process.env.PATHEXT
  12287. if (!pathext) {
  12288. return true
  12289. }
  12290. pathext = pathext.split(';')
  12291. if (pathext.indexOf('') !== -1) {
  12292. return true
  12293. }
  12294. for (var i = 0; i < pathext.length; i++) {
  12295. var p = pathext[i].toLowerCase()
  12296. if (p && path.substr(-p.length).toLowerCase() === p) {
  12297. return true
  12298. }
  12299. }
  12300. return false
  12301. }
  12302. function checkStat (stat, path, options) {
  12303. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12304. return false
  12305. }
  12306. return checkPathExt(path, options)
  12307. }
  12308. function isexe (path, options, cb) {
  12309. fs.stat(path, function (er, stat) {
  12310. cb(er, er ? false : checkStat(stat, path, options))
  12311. })
  12312. }
  12313. function sync (path, options) {
  12314. return checkStat(fs.statSync(path), path, options)
  12315. }
  12316. /***/ }),
  12317. /***/ 821:
  12318. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12319. "use strict";
  12320. var __importStar = (this && this.__importStar) || function (mod) {
  12321. if (mod && mod.__esModule) return mod;
  12322. var result = {};
  12323. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12324. result["default"] = mod;
  12325. return result;
  12326. };
  12327. Object.defineProperty(exports, "__esModule", { value: true });
  12328. const core = __importStar(__webpack_require__(470));
  12329. const fsHelper = __importStar(__webpack_require__(618));
  12330. const github = __importStar(__webpack_require__(469));
  12331. const path = __importStar(__webpack_require__(622));
  12332. function getInputs() {
  12333. const result = {};
  12334. // GitHub workspace
  12335. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12336. if (!githubWorkspacePath) {
  12337. throw new Error('GITHUB_WORKSPACE not defined');
  12338. }
  12339. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12340. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12341. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12342. // Qualified repository
  12343. const qualifiedRepository = core.getInput('repository') ||
  12344. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12345. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12346. const splitRepository = qualifiedRepository.split('/');
  12347. if (splitRepository.length !== 2 ||
  12348. !splitRepository[0] ||
  12349. !splitRepository[1]) {
  12350. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12351. }
  12352. result.repositoryOwner = splitRepository[0];
  12353. result.repositoryName = splitRepository[1];
  12354. // Repository path
  12355. result.repositoryPath = core.getInput('path') || '.';
  12356. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12357. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12358. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12359. }
  12360. // Workflow repository?
  12361. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12362. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12363. // Source branch, source version
  12364. result.ref = core.getInput('ref');
  12365. if (!result.ref) {
  12366. if (isWorkflowRepository) {
  12367. result.ref = github.context.ref;
  12368. result.commit = github.context.sha;
  12369. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12370. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12371. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12372. result.ref = `refs/heads/${result.ref}`;
  12373. }
  12374. }
  12375. if (!result.ref && !result.commit) {
  12376. result.ref = 'refs/heads/master';
  12377. }
  12378. }
  12379. // SHA?
  12380. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12381. result.commit = result.ref;
  12382. result.ref = '';
  12383. }
  12384. core.debug(`ref = '${result.ref}'`);
  12385. core.debug(`commit = '${result.commit}'`);
  12386. // Clean
  12387. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12388. core.debug(`clean = ${result.clean}`);
  12389. // Fetch depth
  12390. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12391. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12392. result.fetchDepth = 0;
  12393. }
  12394. core.debug(`fetch depth = ${result.fetchDepth}`);
  12395. // LFS
  12396. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12397. core.debug(`lfs = ${result.lfs}`);
  12398. // Submodules
  12399. result.submodules = false;
  12400. result.nestedSubmodules = false;
  12401. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12402. if (submodulesString == 'RECURSIVE') {
  12403. result.submodules = true;
  12404. result.nestedSubmodules = true;
  12405. }
  12406. else if (submodulesString == 'TRUE') {
  12407. result.submodules = true;
  12408. }
  12409. core.debug(`submodules = ${result.submodules}`);
  12410. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12411. // Auth token
  12412. result.authToken = core.getInput('token');
  12413. // SSH
  12414. result.sshKey = core.getInput('ssh-key');
  12415. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12416. result.sshStrict =
  12417. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12418. // Persist credentials
  12419. result.persistCredentials =
  12420. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12421. return result;
  12422. }
  12423. exports.getInputs = getInputs;
  12424. /***/ }),
  12425. /***/ 826:
  12426. /***/ (function(module, __unusedexports, __webpack_require__) {
  12427. var rng = __webpack_require__(139);
  12428. var bytesToUuid = __webpack_require__(722);
  12429. function v4(options, buf, offset) {
  12430. var i = buf && offset || 0;
  12431. if (typeof(options) == 'string') {
  12432. buf = options === 'binary' ? new Array(16) : null;
  12433. options = null;
  12434. }
  12435. options = options || {};
  12436. var rnds = options.random || (options.rng || rng)();
  12437. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12438. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12439. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12440. // Copy bytes to buffer, if provided
  12441. if (buf) {
  12442. for (var ii = 0; ii < 16; ++ii) {
  12443. buf[i + ii] = rnds[ii];
  12444. }
  12445. }
  12446. return buf || bytesToUuid(rnds);
  12447. }
  12448. module.exports = v4;
  12449. /***/ }),
  12450. /***/ 835:
  12451. /***/ (function(module) {
  12452. module.exports = require("url");
  12453. /***/ }),
  12454. /***/ 842:
  12455. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12456. "use strict";
  12457. Object.defineProperty(exports, '__esModule', { value: true });
  12458. var deprecation = __webpack_require__(692);
  12459. var endpointsByScope = {
  12460. actions: {
  12461. cancelWorkflowRun: {
  12462. method: "POST",
  12463. params: {
  12464. owner: {
  12465. required: true,
  12466. type: "string"
  12467. },
  12468. repo: {
  12469. required: true,
  12470. type: "string"
  12471. },
  12472. run_id: {
  12473. required: true,
  12474. type: "integer"
  12475. }
  12476. },
  12477. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12478. },
  12479. createOrUpdateSecretForRepo: {
  12480. method: "PUT",
  12481. params: {
  12482. encrypted_value: {
  12483. type: "string"
  12484. },
  12485. key_id: {
  12486. type: "string"
  12487. },
  12488. name: {
  12489. required: true,
  12490. type: "string"
  12491. },
  12492. owner: {
  12493. required: true,
  12494. type: "string"
  12495. },
  12496. repo: {
  12497. required: true,
  12498. type: "string"
  12499. }
  12500. },
  12501. url: "/repos/:owner/:repo/actions/secrets/:name"
  12502. },
  12503. createRegistrationToken: {
  12504. method: "POST",
  12505. params: {
  12506. owner: {
  12507. required: true,
  12508. type: "string"
  12509. },
  12510. repo: {
  12511. required: true,
  12512. type: "string"
  12513. }
  12514. },
  12515. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12516. },
  12517. createRemoveToken: {
  12518. method: "POST",
  12519. params: {
  12520. owner: {
  12521. required: true,
  12522. type: "string"
  12523. },
  12524. repo: {
  12525. required: true,
  12526. type: "string"
  12527. }
  12528. },
  12529. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12530. },
  12531. deleteArtifact: {
  12532. method: "DELETE",
  12533. params: {
  12534. artifact_id: {
  12535. required: true,
  12536. type: "integer"
  12537. },
  12538. owner: {
  12539. required: true,
  12540. type: "string"
  12541. },
  12542. repo: {
  12543. required: true,
  12544. type: "string"
  12545. }
  12546. },
  12547. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12548. },
  12549. deleteSecretFromRepo: {
  12550. method: "DELETE",
  12551. params: {
  12552. name: {
  12553. required: true,
  12554. type: "string"
  12555. },
  12556. owner: {
  12557. required: true,
  12558. type: "string"
  12559. },
  12560. repo: {
  12561. required: true,
  12562. type: "string"
  12563. }
  12564. },
  12565. url: "/repos/:owner/:repo/actions/secrets/:name"
  12566. },
  12567. downloadArtifact: {
  12568. method: "GET",
  12569. params: {
  12570. archive_format: {
  12571. required: true,
  12572. type: "string"
  12573. },
  12574. artifact_id: {
  12575. required: true,
  12576. type: "integer"
  12577. },
  12578. owner: {
  12579. required: true,
  12580. type: "string"
  12581. },
  12582. repo: {
  12583. required: true,
  12584. type: "string"
  12585. }
  12586. },
  12587. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12588. },
  12589. getArtifact: {
  12590. method: "GET",
  12591. params: {
  12592. artifact_id: {
  12593. required: true,
  12594. type: "integer"
  12595. },
  12596. owner: {
  12597. required: true,
  12598. type: "string"
  12599. },
  12600. repo: {
  12601. required: true,
  12602. type: "string"
  12603. }
  12604. },
  12605. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12606. },
  12607. getPublicKey: {
  12608. method: "GET",
  12609. params: {
  12610. owner: {
  12611. required: true,
  12612. type: "string"
  12613. },
  12614. repo: {
  12615. required: true,
  12616. type: "string"
  12617. }
  12618. },
  12619. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12620. },
  12621. getSecret: {
  12622. method: "GET",
  12623. params: {
  12624. name: {
  12625. required: true,
  12626. type: "string"
  12627. },
  12628. owner: {
  12629. required: true,
  12630. type: "string"
  12631. },
  12632. page: {
  12633. type: "integer"
  12634. },
  12635. per_page: {
  12636. type: "integer"
  12637. },
  12638. repo: {
  12639. required: true,
  12640. type: "string"
  12641. }
  12642. },
  12643. url: "/repos/:owner/:repo/actions/secrets/:name"
  12644. },
  12645. getSelfHostedRunner: {
  12646. method: "GET",
  12647. params: {
  12648. owner: {
  12649. required: true,
  12650. type: "string"
  12651. },
  12652. repo: {
  12653. required: true,
  12654. type: "string"
  12655. },
  12656. runner_id: {
  12657. required: true,
  12658. type: "integer"
  12659. }
  12660. },
  12661. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12662. },
  12663. getWorkflow: {
  12664. method: "GET",
  12665. params: {
  12666. owner: {
  12667. required: true,
  12668. type: "string"
  12669. },
  12670. repo: {
  12671. required: true,
  12672. type: "string"
  12673. },
  12674. workflow_id: {
  12675. required: true,
  12676. type: "integer"
  12677. }
  12678. },
  12679. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12680. },
  12681. getWorkflowJob: {
  12682. method: "GET",
  12683. params: {
  12684. job_id: {
  12685. required: true,
  12686. type: "integer"
  12687. },
  12688. owner: {
  12689. required: true,
  12690. type: "string"
  12691. },
  12692. repo: {
  12693. required: true,
  12694. type: "string"
  12695. }
  12696. },
  12697. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12698. },
  12699. getWorkflowRun: {
  12700. method: "GET",
  12701. params: {
  12702. owner: {
  12703. required: true,
  12704. type: "string"
  12705. },
  12706. repo: {
  12707. required: true,
  12708. type: "string"
  12709. },
  12710. run_id: {
  12711. required: true,
  12712. type: "integer"
  12713. }
  12714. },
  12715. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12716. },
  12717. listDownloadsForSelfHostedRunnerApplication: {
  12718. method: "GET",
  12719. params: {
  12720. owner: {
  12721. required: true,
  12722. type: "string"
  12723. },
  12724. repo: {
  12725. required: true,
  12726. type: "string"
  12727. }
  12728. },
  12729. url: "/repos/:owner/:repo/actions/runners/downloads"
  12730. },
  12731. listJobsForWorkflowRun: {
  12732. method: "GET",
  12733. params: {
  12734. owner: {
  12735. required: true,
  12736. type: "string"
  12737. },
  12738. page: {
  12739. type: "integer"
  12740. },
  12741. per_page: {
  12742. type: "integer"
  12743. },
  12744. repo: {
  12745. required: true,
  12746. type: "string"
  12747. },
  12748. run_id: {
  12749. required: true,
  12750. type: "integer"
  12751. }
  12752. },
  12753. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  12754. },
  12755. listRepoWorkflowRuns: {
  12756. method: "GET",
  12757. params: {
  12758. actor: {
  12759. type: "string"
  12760. },
  12761. branch: {
  12762. type: "string"
  12763. },
  12764. event: {
  12765. type: "string"
  12766. },
  12767. owner: {
  12768. required: true,
  12769. type: "string"
  12770. },
  12771. page: {
  12772. type: "integer"
  12773. },
  12774. per_page: {
  12775. type: "integer"
  12776. },
  12777. repo: {
  12778. required: true,
  12779. type: "string"
  12780. },
  12781. status: {
  12782. enum: ["completed", "status", "conclusion"],
  12783. type: "string"
  12784. }
  12785. },
  12786. url: "/repos/:owner/:repo/actions/runs"
  12787. },
  12788. listRepoWorkflows: {
  12789. method: "GET",
  12790. params: {
  12791. owner: {
  12792. required: true,
  12793. type: "string"
  12794. },
  12795. page: {
  12796. type: "integer"
  12797. },
  12798. per_page: {
  12799. type: "integer"
  12800. },
  12801. repo: {
  12802. required: true,
  12803. type: "string"
  12804. }
  12805. },
  12806. url: "/repos/:owner/:repo/actions/workflows"
  12807. },
  12808. listSecretsForRepo: {
  12809. method: "GET",
  12810. params: {
  12811. owner: {
  12812. required: true,
  12813. type: "string"
  12814. },
  12815. page: {
  12816. type: "integer"
  12817. },
  12818. per_page: {
  12819. type: "integer"
  12820. },
  12821. repo: {
  12822. required: true,
  12823. type: "string"
  12824. }
  12825. },
  12826. url: "/repos/:owner/:repo/actions/secrets"
  12827. },
  12828. listSelfHostedRunnersForRepo: {
  12829. method: "GET",
  12830. params: {
  12831. owner: {
  12832. required: true,
  12833. type: "string"
  12834. },
  12835. page: {
  12836. type: "integer"
  12837. },
  12838. per_page: {
  12839. type: "integer"
  12840. },
  12841. repo: {
  12842. required: true,
  12843. type: "string"
  12844. }
  12845. },
  12846. url: "/repos/:owner/:repo/actions/runners"
  12847. },
  12848. listWorkflowJobLogs: {
  12849. method: "GET",
  12850. params: {
  12851. job_id: {
  12852. required: true,
  12853. type: "integer"
  12854. },
  12855. owner: {
  12856. required: true,
  12857. type: "string"
  12858. },
  12859. page: {
  12860. type: "integer"
  12861. },
  12862. per_page: {
  12863. type: "integer"
  12864. },
  12865. repo: {
  12866. required: true,
  12867. type: "string"
  12868. }
  12869. },
  12870. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  12871. },
  12872. listWorkflowRunArtifacts: {
  12873. method: "GET",
  12874. params: {
  12875. owner: {
  12876. required: true,
  12877. type: "string"
  12878. },
  12879. page: {
  12880. type: "integer"
  12881. },
  12882. per_page: {
  12883. type: "integer"
  12884. },
  12885. repo: {
  12886. required: true,
  12887. type: "string"
  12888. },
  12889. run_id: {
  12890. required: true,
  12891. type: "integer"
  12892. }
  12893. },
  12894. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  12895. },
  12896. listWorkflowRunLogs: {
  12897. method: "GET",
  12898. params: {
  12899. owner: {
  12900. required: true,
  12901. type: "string"
  12902. },
  12903. page: {
  12904. type: "integer"
  12905. },
  12906. per_page: {
  12907. type: "integer"
  12908. },
  12909. repo: {
  12910. required: true,
  12911. type: "string"
  12912. },
  12913. run_id: {
  12914. required: true,
  12915. type: "integer"
  12916. }
  12917. },
  12918. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  12919. },
  12920. listWorkflowRuns: {
  12921. method: "GET",
  12922. params: {
  12923. actor: {
  12924. type: "string"
  12925. },
  12926. branch: {
  12927. type: "string"
  12928. },
  12929. event: {
  12930. type: "string"
  12931. },
  12932. owner: {
  12933. required: true,
  12934. type: "string"
  12935. },
  12936. page: {
  12937. type: "integer"
  12938. },
  12939. per_page: {
  12940. type: "integer"
  12941. },
  12942. repo: {
  12943. required: true,
  12944. type: "string"
  12945. },
  12946. status: {
  12947. enum: ["completed", "status", "conclusion"],
  12948. type: "string"
  12949. },
  12950. workflow_id: {
  12951. required: true,
  12952. type: "integer"
  12953. }
  12954. },
  12955. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  12956. },
  12957. reRunWorkflow: {
  12958. method: "POST",
  12959. params: {
  12960. owner: {
  12961. required: true,
  12962. type: "string"
  12963. },
  12964. repo: {
  12965. required: true,
  12966. type: "string"
  12967. },
  12968. run_id: {
  12969. required: true,
  12970. type: "integer"
  12971. }
  12972. },
  12973. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  12974. },
  12975. removeSelfHostedRunner: {
  12976. method: "DELETE",
  12977. params: {
  12978. owner: {
  12979. required: true,
  12980. type: "string"
  12981. },
  12982. repo: {
  12983. required: true,
  12984. type: "string"
  12985. },
  12986. runner_id: {
  12987. required: true,
  12988. type: "integer"
  12989. }
  12990. },
  12991. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12992. }
  12993. },
  12994. activity: {
  12995. checkStarringRepo: {
  12996. method: "GET",
  12997. params: {
  12998. owner: {
  12999. required: true,
  13000. type: "string"
  13001. },
  13002. repo: {
  13003. required: true,
  13004. type: "string"
  13005. }
  13006. },
  13007. url: "/user/starred/:owner/:repo"
  13008. },
  13009. deleteRepoSubscription: {
  13010. method: "DELETE",
  13011. params: {
  13012. owner: {
  13013. required: true,
  13014. type: "string"
  13015. },
  13016. repo: {
  13017. required: true,
  13018. type: "string"
  13019. }
  13020. },
  13021. url: "/repos/:owner/:repo/subscription"
  13022. },
  13023. deleteThreadSubscription: {
  13024. method: "DELETE",
  13025. params: {
  13026. thread_id: {
  13027. required: true,
  13028. type: "integer"
  13029. }
  13030. },
  13031. url: "/notifications/threads/:thread_id/subscription"
  13032. },
  13033. getRepoSubscription: {
  13034. method: "GET",
  13035. params: {
  13036. owner: {
  13037. required: true,
  13038. type: "string"
  13039. },
  13040. repo: {
  13041. required: true,
  13042. type: "string"
  13043. }
  13044. },
  13045. url: "/repos/:owner/:repo/subscription"
  13046. },
  13047. getThread: {
  13048. method: "GET",
  13049. params: {
  13050. thread_id: {
  13051. required: true,
  13052. type: "integer"
  13053. }
  13054. },
  13055. url: "/notifications/threads/:thread_id"
  13056. },
  13057. getThreadSubscription: {
  13058. method: "GET",
  13059. params: {
  13060. thread_id: {
  13061. required: true,
  13062. type: "integer"
  13063. }
  13064. },
  13065. url: "/notifications/threads/:thread_id/subscription"
  13066. },
  13067. listEventsForOrg: {
  13068. method: "GET",
  13069. params: {
  13070. org: {
  13071. required: true,
  13072. type: "string"
  13073. },
  13074. page: {
  13075. type: "integer"
  13076. },
  13077. per_page: {
  13078. type: "integer"
  13079. },
  13080. username: {
  13081. required: true,
  13082. type: "string"
  13083. }
  13084. },
  13085. url: "/users/:username/events/orgs/:org"
  13086. },
  13087. listEventsForUser: {
  13088. method: "GET",
  13089. params: {
  13090. page: {
  13091. type: "integer"
  13092. },
  13093. per_page: {
  13094. type: "integer"
  13095. },
  13096. username: {
  13097. required: true,
  13098. type: "string"
  13099. }
  13100. },
  13101. url: "/users/:username/events"
  13102. },
  13103. listFeeds: {
  13104. method: "GET",
  13105. params: {},
  13106. url: "/feeds"
  13107. },
  13108. listNotifications: {
  13109. method: "GET",
  13110. params: {
  13111. all: {
  13112. type: "boolean"
  13113. },
  13114. before: {
  13115. type: "string"
  13116. },
  13117. page: {
  13118. type: "integer"
  13119. },
  13120. participating: {
  13121. type: "boolean"
  13122. },
  13123. per_page: {
  13124. type: "integer"
  13125. },
  13126. since: {
  13127. type: "string"
  13128. }
  13129. },
  13130. url: "/notifications"
  13131. },
  13132. listNotificationsForRepo: {
  13133. method: "GET",
  13134. params: {
  13135. all: {
  13136. type: "boolean"
  13137. },
  13138. before: {
  13139. type: "string"
  13140. },
  13141. owner: {
  13142. required: true,
  13143. type: "string"
  13144. },
  13145. page: {
  13146. type: "integer"
  13147. },
  13148. participating: {
  13149. type: "boolean"
  13150. },
  13151. per_page: {
  13152. type: "integer"
  13153. },
  13154. repo: {
  13155. required: true,
  13156. type: "string"
  13157. },
  13158. since: {
  13159. type: "string"
  13160. }
  13161. },
  13162. url: "/repos/:owner/:repo/notifications"
  13163. },
  13164. listPublicEvents: {
  13165. method: "GET",
  13166. params: {
  13167. page: {
  13168. type: "integer"
  13169. },
  13170. per_page: {
  13171. type: "integer"
  13172. }
  13173. },
  13174. url: "/events"
  13175. },
  13176. listPublicEventsForOrg: {
  13177. method: "GET",
  13178. params: {
  13179. org: {
  13180. required: true,
  13181. type: "string"
  13182. },
  13183. page: {
  13184. type: "integer"
  13185. },
  13186. per_page: {
  13187. type: "integer"
  13188. }
  13189. },
  13190. url: "/orgs/:org/events"
  13191. },
  13192. listPublicEventsForRepoNetwork: {
  13193. method: "GET",
  13194. params: {
  13195. owner: {
  13196. required: true,
  13197. type: "string"
  13198. },
  13199. page: {
  13200. type: "integer"
  13201. },
  13202. per_page: {
  13203. type: "integer"
  13204. },
  13205. repo: {
  13206. required: true,
  13207. type: "string"
  13208. }
  13209. },
  13210. url: "/networks/:owner/:repo/events"
  13211. },
  13212. listPublicEventsForUser: {
  13213. method: "GET",
  13214. params: {
  13215. page: {
  13216. type: "integer"
  13217. },
  13218. per_page: {
  13219. type: "integer"
  13220. },
  13221. username: {
  13222. required: true,
  13223. type: "string"
  13224. }
  13225. },
  13226. url: "/users/:username/events/public"
  13227. },
  13228. listReceivedEventsForUser: {
  13229. method: "GET",
  13230. params: {
  13231. page: {
  13232. type: "integer"
  13233. },
  13234. per_page: {
  13235. type: "integer"
  13236. },
  13237. username: {
  13238. required: true,
  13239. type: "string"
  13240. }
  13241. },
  13242. url: "/users/:username/received_events"
  13243. },
  13244. listReceivedPublicEventsForUser: {
  13245. method: "GET",
  13246. params: {
  13247. page: {
  13248. type: "integer"
  13249. },
  13250. per_page: {
  13251. type: "integer"
  13252. },
  13253. username: {
  13254. required: true,
  13255. type: "string"
  13256. }
  13257. },
  13258. url: "/users/:username/received_events/public"
  13259. },
  13260. listRepoEvents: {
  13261. method: "GET",
  13262. params: {
  13263. owner: {
  13264. required: true,
  13265. type: "string"
  13266. },
  13267. page: {
  13268. type: "integer"
  13269. },
  13270. per_page: {
  13271. type: "integer"
  13272. },
  13273. repo: {
  13274. required: true,
  13275. type: "string"
  13276. }
  13277. },
  13278. url: "/repos/:owner/:repo/events"
  13279. },
  13280. listReposStarredByAuthenticatedUser: {
  13281. method: "GET",
  13282. params: {
  13283. direction: {
  13284. enum: ["asc", "desc"],
  13285. type: "string"
  13286. },
  13287. page: {
  13288. type: "integer"
  13289. },
  13290. per_page: {
  13291. type: "integer"
  13292. },
  13293. sort: {
  13294. enum: ["created", "updated"],
  13295. type: "string"
  13296. }
  13297. },
  13298. url: "/user/starred"
  13299. },
  13300. listReposStarredByUser: {
  13301. method: "GET",
  13302. params: {
  13303. direction: {
  13304. enum: ["asc", "desc"],
  13305. type: "string"
  13306. },
  13307. page: {
  13308. type: "integer"
  13309. },
  13310. per_page: {
  13311. type: "integer"
  13312. },
  13313. sort: {
  13314. enum: ["created", "updated"],
  13315. type: "string"
  13316. },
  13317. username: {
  13318. required: true,
  13319. type: "string"
  13320. }
  13321. },
  13322. url: "/users/:username/starred"
  13323. },
  13324. listReposWatchedByUser: {
  13325. method: "GET",
  13326. params: {
  13327. page: {
  13328. type: "integer"
  13329. },
  13330. per_page: {
  13331. type: "integer"
  13332. },
  13333. username: {
  13334. required: true,
  13335. type: "string"
  13336. }
  13337. },
  13338. url: "/users/:username/subscriptions"
  13339. },
  13340. listStargazersForRepo: {
  13341. method: "GET",
  13342. params: {
  13343. owner: {
  13344. required: true,
  13345. type: "string"
  13346. },
  13347. page: {
  13348. type: "integer"
  13349. },
  13350. per_page: {
  13351. type: "integer"
  13352. },
  13353. repo: {
  13354. required: true,
  13355. type: "string"
  13356. }
  13357. },
  13358. url: "/repos/:owner/:repo/stargazers"
  13359. },
  13360. listWatchedReposForAuthenticatedUser: {
  13361. method: "GET",
  13362. params: {
  13363. page: {
  13364. type: "integer"
  13365. },
  13366. per_page: {
  13367. type: "integer"
  13368. }
  13369. },
  13370. url: "/user/subscriptions"
  13371. },
  13372. listWatchersForRepo: {
  13373. method: "GET",
  13374. params: {
  13375. owner: {
  13376. required: true,
  13377. type: "string"
  13378. },
  13379. page: {
  13380. type: "integer"
  13381. },
  13382. per_page: {
  13383. type: "integer"
  13384. },
  13385. repo: {
  13386. required: true,
  13387. type: "string"
  13388. }
  13389. },
  13390. url: "/repos/:owner/:repo/subscribers"
  13391. },
  13392. markAsRead: {
  13393. method: "PUT",
  13394. params: {
  13395. last_read_at: {
  13396. type: "string"
  13397. }
  13398. },
  13399. url: "/notifications"
  13400. },
  13401. markNotificationsAsReadForRepo: {
  13402. method: "PUT",
  13403. params: {
  13404. last_read_at: {
  13405. type: "string"
  13406. },
  13407. owner: {
  13408. required: true,
  13409. type: "string"
  13410. },
  13411. repo: {
  13412. required: true,
  13413. type: "string"
  13414. }
  13415. },
  13416. url: "/repos/:owner/:repo/notifications"
  13417. },
  13418. markThreadAsRead: {
  13419. method: "PATCH",
  13420. params: {
  13421. thread_id: {
  13422. required: true,
  13423. type: "integer"
  13424. }
  13425. },
  13426. url: "/notifications/threads/:thread_id"
  13427. },
  13428. setRepoSubscription: {
  13429. method: "PUT",
  13430. params: {
  13431. ignored: {
  13432. type: "boolean"
  13433. },
  13434. owner: {
  13435. required: true,
  13436. type: "string"
  13437. },
  13438. repo: {
  13439. required: true,
  13440. type: "string"
  13441. },
  13442. subscribed: {
  13443. type: "boolean"
  13444. }
  13445. },
  13446. url: "/repos/:owner/:repo/subscription"
  13447. },
  13448. setThreadSubscription: {
  13449. method: "PUT",
  13450. params: {
  13451. ignored: {
  13452. type: "boolean"
  13453. },
  13454. thread_id: {
  13455. required: true,
  13456. type: "integer"
  13457. }
  13458. },
  13459. url: "/notifications/threads/:thread_id/subscription"
  13460. },
  13461. starRepo: {
  13462. method: "PUT",
  13463. params: {
  13464. owner: {
  13465. required: true,
  13466. type: "string"
  13467. },
  13468. repo: {
  13469. required: true,
  13470. type: "string"
  13471. }
  13472. },
  13473. url: "/user/starred/:owner/:repo"
  13474. },
  13475. unstarRepo: {
  13476. method: "DELETE",
  13477. params: {
  13478. owner: {
  13479. required: true,
  13480. type: "string"
  13481. },
  13482. repo: {
  13483. required: true,
  13484. type: "string"
  13485. }
  13486. },
  13487. url: "/user/starred/:owner/:repo"
  13488. }
  13489. },
  13490. apps: {
  13491. addRepoToInstallation: {
  13492. headers: {
  13493. accept: "application/vnd.github.machine-man-preview+json"
  13494. },
  13495. method: "PUT",
  13496. params: {
  13497. installation_id: {
  13498. required: true,
  13499. type: "integer"
  13500. },
  13501. repository_id: {
  13502. required: true,
  13503. type: "integer"
  13504. }
  13505. },
  13506. url: "/user/installations/:installation_id/repositories/:repository_id"
  13507. },
  13508. checkAccountIsAssociatedWithAny: {
  13509. method: "GET",
  13510. params: {
  13511. account_id: {
  13512. required: true,
  13513. type: "integer"
  13514. }
  13515. },
  13516. url: "/marketplace_listing/accounts/:account_id"
  13517. },
  13518. checkAccountIsAssociatedWithAnyStubbed: {
  13519. method: "GET",
  13520. params: {
  13521. account_id: {
  13522. required: true,
  13523. type: "integer"
  13524. }
  13525. },
  13526. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13527. },
  13528. checkAuthorization: {
  13529. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13530. method: "GET",
  13531. params: {
  13532. access_token: {
  13533. required: true,
  13534. type: "string"
  13535. },
  13536. client_id: {
  13537. required: true,
  13538. type: "string"
  13539. }
  13540. },
  13541. url: "/applications/:client_id/tokens/:access_token"
  13542. },
  13543. checkToken: {
  13544. headers: {
  13545. accept: "application/vnd.github.doctor-strange-preview+json"
  13546. },
  13547. method: "POST",
  13548. params: {
  13549. access_token: {
  13550. type: "string"
  13551. },
  13552. client_id: {
  13553. required: true,
  13554. type: "string"
  13555. }
  13556. },
  13557. url: "/applications/:client_id/token"
  13558. },
  13559. createContentAttachment: {
  13560. headers: {
  13561. accept: "application/vnd.github.corsair-preview+json"
  13562. },
  13563. method: "POST",
  13564. params: {
  13565. body: {
  13566. required: true,
  13567. type: "string"
  13568. },
  13569. content_reference_id: {
  13570. required: true,
  13571. type: "integer"
  13572. },
  13573. title: {
  13574. required: true,
  13575. type: "string"
  13576. }
  13577. },
  13578. url: "/content_references/:content_reference_id/attachments"
  13579. },
  13580. createFromManifest: {
  13581. headers: {
  13582. accept: "application/vnd.github.fury-preview+json"
  13583. },
  13584. method: "POST",
  13585. params: {
  13586. code: {
  13587. required: true,
  13588. type: "string"
  13589. }
  13590. },
  13591. url: "/app-manifests/:code/conversions"
  13592. },
  13593. createInstallationToken: {
  13594. headers: {
  13595. accept: "application/vnd.github.machine-man-preview+json"
  13596. },
  13597. method: "POST",
  13598. params: {
  13599. installation_id: {
  13600. required: true,
  13601. type: "integer"
  13602. },
  13603. permissions: {
  13604. type: "object"
  13605. },
  13606. repository_ids: {
  13607. type: "integer[]"
  13608. }
  13609. },
  13610. url: "/app/installations/:installation_id/access_tokens"
  13611. },
  13612. deleteAuthorization: {
  13613. headers: {
  13614. accept: "application/vnd.github.doctor-strange-preview+json"
  13615. },
  13616. method: "DELETE",
  13617. params: {
  13618. access_token: {
  13619. type: "string"
  13620. },
  13621. client_id: {
  13622. required: true,
  13623. type: "string"
  13624. }
  13625. },
  13626. url: "/applications/:client_id/grant"
  13627. },
  13628. deleteInstallation: {
  13629. headers: {
  13630. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13631. },
  13632. method: "DELETE",
  13633. params: {
  13634. installation_id: {
  13635. required: true,
  13636. type: "integer"
  13637. }
  13638. },
  13639. url: "/app/installations/:installation_id"
  13640. },
  13641. deleteToken: {
  13642. headers: {
  13643. accept: "application/vnd.github.doctor-strange-preview+json"
  13644. },
  13645. method: "DELETE",
  13646. params: {
  13647. access_token: {
  13648. type: "string"
  13649. },
  13650. client_id: {
  13651. required: true,
  13652. type: "string"
  13653. }
  13654. },
  13655. url: "/applications/:client_id/token"
  13656. },
  13657. findOrgInstallation: {
  13658. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13659. headers: {
  13660. accept: "application/vnd.github.machine-man-preview+json"
  13661. },
  13662. method: "GET",
  13663. params: {
  13664. org: {
  13665. required: true,
  13666. type: "string"
  13667. }
  13668. },
  13669. url: "/orgs/:org/installation"
  13670. },
  13671. findRepoInstallation: {
  13672. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13673. headers: {
  13674. accept: "application/vnd.github.machine-man-preview+json"
  13675. },
  13676. method: "GET",
  13677. params: {
  13678. owner: {
  13679. required: true,
  13680. type: "string"
  13681. },
  13682. repo: {
  13683. required: true,
  13684. type: "string"
  13685. }
  13686. },
  13687. url: "/repos/:owner/:repo/installation"
  13688. },
  13689. findUserInstallation: {
  13690. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13691. headers: {
  13692. accept: "application/vnd.github.machine-man-preview+json"
  13693. },
  13694. method: "GET",
  13695. params: {
  13696. username: {
  13697. required: true,
  13698. type: "string"
  13699. }
  13700. },
  13701. url: "/users/:username/installation"
  13702. },
  13703. getAuthenticated: {
  13704. headers: {
  13705. accept: "application/vnd.github.machine-man-preview+json"
  13706. },
  13707. method: "GET",
  13708. params: {},
  13709. url: "/app"
  13710. },
  13711. getBySlug: {
  13712. headers: {
  13713. accept: "application/vnd.github.machine-man-preview+json"
  13714. },
  13715. method: "GET",
  13716. params: {
  13717. app_slug: {
  13718. required: true,
  13719. type: "string"
  13720. }
  13721. },
  13722. url: "/apps/:app_slug"
  13723. },
  13724. getInstallation: {
  13725. headers: {
  13726. accept: "application/vnd.github.machine-man-preview+json"
  13727. },
  13728. method: "GET",
  13729. params: {
  13730. installation_id: {
  13731. required: true,
  13732. type: "integer"
  13733. }
  13734. },
  13735. url: "/app/installations/:installation_id"
  13736. },
  13737. getOrgInstallation: {
  13738. headers: {
  13739. accept: "application/vnd.github.machine-man-preview+json"
  13740. },
  13741. method: "GET",
  13742. params: {
  13743. org: {
  13744. required: true,
  13745. type: "string"
  13746. }
  13747. },
  13748. url: "/orgs/:org/installation"
  13749. },
  13750. getRepoInstallation: {
  13751. headers: {
  13752. accept: "application/vnd.github.machine-man-preview+json"
  13753. },
  13754. method: "GET",
  13755. params: {
  13756. owner: {
  13757. required: true,
  13758. type: "string"
  13759. },
  13760. repo: {
  13761. required: true,
  13762. type: "string"
  13763. }
  13764. },
  13765. url: "/repos/:owner/:repo/installation"
  13766. },
  13767. getUserInstallation: {
  13768. headers: {
  13769. accept: "application/vnd.github.machine-man-preview+json"
  13770. },
  13771. method: "GET",
  13772. params: {
  13773. username: {
  13774. required: true,
  13775. type: "string"
  13776. }
  13777. },
  13778. url: "/users/:username/installation"
  13779. },
  13780. listAccountsUserOrOrgOnPlan: {
  13781. method: "GET",
  13782. params: {
  13783. direction: {
  13784. enum: ["asc", "desc"],
  13785. type: "string"
  13786. },
  13787. page: {
  13788. type: "integer"
  13789. },
  13790. per_page: {
  13791. type: "integer"
  13792. },
  13793. plan_id: {
  13794. required: true,
  13795. type: "integer"
  13796. },
  13797. sort: {
  13798. enum: ["created", "updated"],
  13799. type: "string"
  13800. }
  13801. },
  13802. url: "/marketplace_listing/plans/:plan_id/accounts"
  13803. },
  13804. listAccountsUserOrOrgOnPlanStubbed: {
  13805. method: "GET",
  13806. params: {
  13807. direction: {
  13808. enum: ["asc", "desc"],
  13809. type: "string"
  13810. },
  13811. page: {
  13812. type: "integer"
  13813. },
  13814. per_page: {
  13815. type: "integer"
  13816. },
  13817. plan_id: {
  13818. required: true,
  13819. type: "integer"
  13820. },
  13821. sort: {
  13822. enum: ["created", "updated"],
  13823. type: "string"
  13824. }
  13825. },
  13826. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  13827. },
  13828. listInstallationReposForAuthenticatedUser: {
  13829. headers: {
  13830. accept: "application/vnd.github.machine-man-preview+json"
  13831. },
  13832. method: "GET",
  13833. params: {
  13834. installation_id: {
  13835. required: true,
  13836. type: "integer"
  13837. },
  13838. page: {
  13839. type: "integer"
  13840. },
  13841. per_page: {
  13842. type: "integer"
  13843. }
  13844. },
  13845. url: "/user/installations/:installation_id/repositories"
  13846. },
  13847. listInstallations: {
  13848. headers: {
  13849. accept: "application/vnd.github.machine-man-preview+json"
  13850. },
  13851. method: "GET",
  13852. params: {
  13853. page: {
  13854. type: "integer"
  13855. },
  13856. per_page: {
  13857. type: "integer"
  13858. }
  13859. },
  13860. url: "/app/installations"
  13861. },
  13862. listInstallationsForAuthenticatedUser: {
  13863. headers: {
  13864. accept: "application/vnd.github.machine-man-preview+json"
  13865. },
  13866. method: "GET",
  13867. params: {
  13868. page: {
  13869. type: "integer"
  13870. },
  13871. per_page: {
  13872. type: "integer"
  13873. }
  13874. },
  13875. url: "/user/installations"
  13876. },
  13877. listMarketplacePurchasesForAuthenticatedUser: {
  13878. method: "GET",
  13879. params: {
  13880. page: {
  13881. type: "integer"
  13882. },
  13883. per_page: {
  13884. type: "integer"
  13885. }
  13886. },
  13887. url: "/user/marketplace_purchases"
  13888. },
  13889. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  13890. method: "GET",
  13891. params: {
  13892. page: {
  13893. type: "integer"
  13894. },
  13895. per_page: {
  13896. type: "integer"
  13897. }
  13898. },
  13899. url: "/user/marketplace_purchases/stubbed"
  13900. },
  13901. listPlans: {
  13902. method: "GET",
  13903. params: {
  13904. page: {
  13905. type: "integer"
  13906. },
  13907. per_page: {
  13908. type: "integer"
  13909. }
  13910. },
  13911. url: "/marketplace_listing/plans"
  13912. },
  13913. listPlansStubbed: {
  13914. method: "GET",
  13915. params: {
  13916. page: {
  13917. type: "integer"
  13918. },
  13919. per_page: {
  13920. type: "integer"
  13921. }
  13922. },
  13923. url: "/marketplace_listing/stubbed/plans"
  13924. },
  13925. listRepos: {
  13926. headers: {
  13927. accept: "application/vnd.github.machine-man-preview+json"
  13928. },
  13929. method: "GET",
  13930. params: {
  13931. page: {
  13932. type: "integer"
  13933. },
  13934. per_page: {
  13935. type: "integer"
  13936. }
  13937. },
  13938. url: "/installation/repositories"
  13939. },
  13940. removeRepoFromInstallation: {
  13941. headers: {
  13942. accept: "application/vnd.github.machine-man-preview+json"
  13943. },
  13944. method: "DELETE",
  13945. params: {
  13946. installation_id: {
  13947. required: true,
  13948. type: "integer"
  13949. },
  13950. repository_id: {
  13951. required: true,
  13952. type: "integer"
  13953. }
  13954. },
  13955. url: "/user/installations/:installation_id/repositories/:repository_id"
  13956. },
  13957. resetAuthorization: {
  13958. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  13959. method: "POST",
  13960. params: {
  13961. access_token: {
  13962. required: true,
  13963. type: "string"
  13964. },
  13965. client_id: {
  13966. required: true,
  13967. type: "string"
  13968. }
  13969. },
  13970. url: "/applications/:client_id/tokens/:access_token"
  13971. },
  13972. resetToken: {
  13973. headers: {
  13974. accept: "application/vnd.github.doctor-strange-preview+json"
  13975. },
  13976. method: "PATCH",
  13977. params: {
  13978. access_token: {
  13979. type: "string"
  13980. },
  13981. client_id: {
  13982. required: true,
  13983. type: "string"
  13984. }
  13985. },
  13986. url: "/applications/:client_id/token"
  13987. },
  13988. revokeAuthorizationForApplication: {
  13989. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  13990. method: "DELETE",
  13991. params: {
  13992. access_token: {
  13993. required: true,
  13994. type: "string"
  13995. },
  13996. client_id: {
  13997. required: true,
  13998. type: "string"
  13999. }
  14000. },
  14001. url: "/applications/:client_id/tokens/:access_token"
  14002. },
  14003. revokeGrantForApplication: {
  14004. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14005. method: "DELETE",
  14006. params: {
  14007. access_token: {
  14008. required: true,
  14009. type: "string"
  14010. },
  14011. client_id: {
  14012. required: true,
  14013. type: "string"
  14014. }
  14015. },
  14016. url: "/applications/:client_id/grants/:access_token"
  14017. },
  14018. revokeInstallationToken: {
  14019. headers: {
  14020. accept: "application/vnd.github.gambit-preview+json"
  14021. },
  14022. method: "DELETE",
  14023. params: {},
  14024. url: "/installation/token"
  14025. }
  14026. },
  14027. checks: {
  14028. create: {
  14029. headers: {
  14030. accept: "application/vnd.github.antiope-preview+json"
  14031. },
  14032. method: "POST",
  14033. params: {
  14034. actions: {
  14035. type: "object[]"
  14036. },
  14037. "actions[].description": {
  14038. required: true,
  14039. type: "string"
  14040. },
  14041. "actions[].identifier": {
  14042. required: true,
  14043. type: "string"
  14044. },
  14045. "actions[].label": {
  14046. required: true,
  14047. type: "string"
  14048. },
  14049. completed_at: {
  14050. type: "string"
  14051. },
  14052. conclusion: {
  14053. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14054. type: "string"
  14055. },
  14056. details_url: {
  14057. type: "string"
  14058. },
  14059. external_id: {
  14060. type: "string"
  14061. },
  14062. head_sha: {
  14063. required: true,
  14064. type: "string"
  14065. },
  14066. name: {
  14067. required: true,
  14068. type: "string"
  14069. },
  14070. output: {
  14071. type: "object"
  14072. },
  14073. "output.annotations": {
  14074. type: "object[]"
  14075. },
  14076. "output.annotations[].annotation_level": {
  14077. enum: ["notice", "warning", "failure"],
  14078. required: true,
  14079. type: "string"
  14080. },
  14081. "output.annotations[].end_column": {
  14082. type: "integer"
  14083. },
  14084. "output.annotations[].end_line": {
  14085. required: true,
  14086. type: "integer"
  14087. },
  14088. "output.annotations[].message": {
  14089. required: true,
  14090. type: "string"
  14091. },
  14092. "output.annotations[].path": {
  14093. required: true,
  14094. type: "string"
  14095. },
  14096. "output.annotations[].raw_details": {
  14097. type: "string"
  14098. },
  14099. "output.annotations[].start_column": {
  14100. type: "integer"
  14101. },
  14102. "output.annotations[].start_line": {
  14103. required: true,
  14104. type: "integer"
  14105. },
  14106. "output.annotations[].title": {
  14107. type: "string"
  14108. },
  14109. "output.images": {
  14110. type: "object[]"
  14111. },
  14112. "output.images[].alt": {
  14113. required: true,
  14114. type: "string"
  14115. },
  14116. "output.images[].caption": {
  14117. type: "string"
  14118. },
  14119. "output.images[].image_url": {
  14120. required: true,
  14121. type: "string"
  14122. },
  14123. "output.summary": {
  14124. required: true,
  14125. type: "string"
  14126. },
  14127. "output.text": {
  14128. type: "string"
  14129. },
  14130. "output.title": {
  14131. required: true,
  14132. type: "string"
  14133. },
  14134. owner: {
  14135. required: true,
  14136. type: "string"
  14137. },
  14138. repo: {
  14139. required: true,
  14140. type: "string"
  14141. },
  14142. started_at: {
  14143. type: "string"
  14144. },
  14145. status: {
  14146. enum: ["queued", "in_progress", "completed"],
  14147. type: "string"
  14148. }
  14149. },
  14150. url: "/repos/:owner/:repo/check-runs"
  14151. },
  14152. createSuite: {
  14153. headers: {
  14154. accept: "application/vnd.github.antiope-preview+json"
  14155. },
  14156. method: "POST",
  14157. params: {
  14158. head_sha: {
  14159. required: true,
  14160. type: "string"
  14161. },
  14162. owner: {
  14163. required: true,
  14164. type: "string"
  14165. },
  14166. repo: {
  14167. required: true,
  14168. type: "string"
  14169. }
  14170. },
  14171. url: "/repos/:owner/:repo/check-suites"
  14172. },
  14173. get: {
  14174. headers: {
  14175. accept: "application/vnd.github.antiope-preview+json"
  14176. },
  14177. method: "GET",
  14178. params: {
  14179. check_run_id: {
  14180. required: true,
  14181. type: "integer"
  14182. },
  14183. owner: {
  14184. required: true,
  14185. type: "string"
  14186. },
  14187. repo: {
  14188. required: true,
  14189. type: "string"
  14190. }
  14191. },
  14192. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14193. },
  14194. getSuite: {
  14195. headers: {
  14196. accept: "application/vnd.github.antiope-preview+json"
  14197. },
  14198. method: "GET",
  14199. params: {
  14200. check_suite_id: {
  14201. required: true,
  14202. type: "integer"
  14203. },
  14204. owner: {
  14205. required: true,
  14206. type: "string"
  14207. },
  14208. repo: {
  14209. required: true,
  14210. type: "string"
  14211. }
  14212. },
  14213. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14214. },
  14215. listAnnotations: {
  14216. headers: {
  14217. accept: "application/vnd.github.antiope-preview+json"
  14218. },
  14219. method: "GET",
  14220. params: {
  14221. check_run_id: {
  14222. required: true,
  14223. type: "integer"
  14224. },
  14225. owner: {
  14226. required: true,
  14227. type: "string"
  14228. },
  14229. page: {
  14230. type: "integer"
  14231. },
  14232. per_page: {
  14233. type: "integer"
  14234. },
  14235. repo: {
  14236. required: true,
  14237. type: "string"
  14238. }
  14239. },
  14240. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14241. },
  14242. listForRef: {
  14243. headers: {
  14244. accept: "application/vnd.github.antiope-preview+json"
  14245. },
  14246. method: "GET",
  14247. params: {
  14248. check_name: {
  14249. type: "string"
  14250. },
  14251. filter: {
  14252. enum: ["latest", "all"],
  14253. type: "string"
  14254. },
  14255. owner: {
  14256. required: true,
  14257. type: "string"
  14258. },
  14259. page: {
  14260. type: "integer"
  14261. },
  14262. per_page: {
  14263. type: "integer"
  14264. },
  14265. ref: {
  14266. required: true,
  14267. type: "string"
  14268. },
  14269. repo: {
  14270. required: true,
  14271. type: "string"
  14272. },
  14273. status: {
  14274. enum: ["queued", "in_progress", "completed"],
  14275. type: "string"
  14276. }
  14277. },
  14278. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14279. },
  14280. listForSuite: {
  14281. headers: {
  14282. accept: "application/vnd.github.antiope-preview+json"
  14283. },
  14284. method: "GET",
  14285. params: {
  14286. check_name: {
  14287. type: "string"
  14288. },
  14289. check_suite_id: {
  14290. required: true,
  14291. type: "integer"
  14292. },
  14293. filter: {
  14294. enum: ["latest", "all"],
  14295. type: "string"
  14296. },
  14297. owner: {
  14298. required: true,
  14299. type: "string"
  14300. },
  14301. page: {
  14302. type: "integer"
  14303. },
  14304. per_page: {
  14305. type: "integer"
  14306. },
  14307. repo: {
  14308. required: true,
  14309. type: "string"
  14310. },
  14311. status: {
  14312. enum: ["queued", "in_progress", "completed"],
  14313. type: "string"
  14314. }
  14315. },
  14316. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14317. },
  14318. listSuitesForRef: {
  14319. headers: {
  14320. accept: "application/vnd.github.antiope-preview+json"
  14321. },
  14322. method: "GET",
  14323. params: {
  14324. app_id: {
  14325. type: "integer"
  14326. },
  14327. check_name: {
  14328. type: "string"
  14329. },
  14330. owner: {
  14331. required: true,
  14332. type: "string"
  14333. },
  14334. page: {
  14335. type: "integer"
  14336. },
  14337. per_page: {
  14338. type: "integer"
  14339. },
  14340. ref: {
  14341. required: true,
  14342. type: "string"
  14343. },
  14344. repo: {
  14345. required: true,
  14346. type: "string"
  14347. }
  14348. },
  14349. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14350. },
  14351. rerequestSuite: {
  14352. headers: {
  14353. accept: "application/vnd.github.antiope-preview+json"
  14354. },
  14355. method: "POST",
  14356. params: {
  14357. check_suite_id: {
  14358. required: true,
  14359. type: "integer"
  14360. },
  14361. owner: {
  14362. required: true,
  14363. type: "string"
  14364. },
  14365. repo: {
  14366. required: true,
  14367. type: "string"
  14368. }
  14369. },
  14370. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14371. },
  14372. setSuitesPreferences: {
  14373. headers: {
  14374. accept: "application/vnd.github.antiope-preview+json"
  14375. },
  14376. method: "PATCH",
  14377. params: {
  14378. auto_trigger_checks: {
  14379. type: "object[]"
  14380. },
  14381. "auto_trigger_checks[].app_id": {
  14382. required: true,
  14383. type: "integer"
  14384. },
  14385. "auto_trigger_checks[].setting": {
  14386. required: true,
  14387. type: "boolean"
  14388. },
  14389. owner: {
  14390. required: true,
  14391. type: "string"
  14392. },
  14393. repo: {
  14394. required: true,
  14395. type: "string"
  14396. }
  14397. },
  14398. url: "/repos/:owner/:repo/check-suites/preferences"
  14399. },
  14400. update: {
  14401. headers: {
  14402. accept: "application/vnd.github.antiope-preview+json"
  14403. },
  14404. method: "PATCH",
  14405. params: {
  14406. actions: {
  14407. type: "object[]"
  14408. },
  14409. "actions[].description": {
  14410. required: true,
  14411. type: "string"
  14412. },
  14413. "actions[].identifier": {
  14414. required: true,
  14415. type: "string"
  14416. },
  14417. "actions[].label": {
  14418. required: true,
  14419. type: "string"
  14420. },
  14421. check_run_id: {
  14422. required: true,
  14423. type: "integer"
  14424. },
  14425. completed_at: {
  14426. type: "string"
  14427. },
  14428. conclusion: {
  14429. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14430. type: "string"
  14431. },
  14432. details_url: {
  14433. type: "string"
  14434. },
  14435. external_id: {
  14436. type: "string"
  14437. },
  14438. name: {
  14439. type: "string"
  14440. },
  14441. output: {
  14442. type: "object"
  14443. },
  14444. "output.annotations": {
  14445. type: "object[]"
  14446. },
  14447. "output.annotations[].annotation_level": {
  14448. enum: ["notice", "warning", "failure"],
  14449. required: true,
  14450. type: "string"
  14451. },
  14452. "output.annotations[].end_column": {
  14453. type: "integer"
  14454. },
  14455. "output.annotations[].end_line": {
  14456. required: true,
  14457. type: "integer"
  14458. },
  14459. "output.annotations[].message": {
  14460. required: true,
  14461. type: "string"
  14462. },
  14463. "output.annotations[].path": {
  14464. required: true,
  14465. type: "string"
  14466. },
  14467. "output.annotations[].raw_details": {
  14468. type: "string"
  14469. },
  14470. "output.annotations[].start_column": {
  14471. type: "integer"
  14472. },
  14473. "output.annotations[].start_line": {
  14474. required: true,
  14475. type: "integer"
  14476. },
  14477. "output.annotations[].title": {
  14478. type: "string"
  14479. },
  14480. "output.images": {
  14481. type: "object[]"
  14482. },
  14483. "output.images[].alt": {
  14484. required: true,
  14485. type: "string"
  14486. },
  14487. "output.images[].caption": {
  14488. type: "string"
  14489. },
  14490. "output.images[].image_url": {
  14491. required: true,
  14492. type: "string"
  14493. },
  14494. "output.summary": {
  14495. required: true,
  14496. type: "string"
  14497. },
  14498. "output.text": {
  14499. type: "string"
  14500. },
  14501. "output.title": {
  14502. type: "string"
  14503. },
  14504. owner: {
  14505. required: true,
  14506. type: "string"
  14507. },
  14508. repo: {
  14509. required: true,
  14510. type: "string"
  14511. },
  14512. started_at: {
  14513. type: "string"
  14514. },
  14515. status: {
  14516. enum: ["queued", "in_progress", "completed"],
  14517. type: "string"
  14518. }
  14519. },
  14520. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14521. }
  14522. },
  14523. codesOfConduct: {
  14524. getConductCode: {
  14525. headers: {
  14526. accept: "application/vnd.github.scarlet-witch-preview+json"
  14527. },
  14528. method: "GET",
  14529. params: {
  14530. key: {
  14531. required: true,
  14532. type: "string"
  14533. }
  14534. },
  14535. url: "/codes_of_conduct/:key"
  14536. },
  14537. getForRepo: {
  14538. headers: {
  14539. accept: "application/vnd.github.scarlet-witch-preview+json"
  14540. },
  14541. method: "GET",
  14542. params: {
  14543. owner: {
  14544. required: true,
  14545. type: "string"
  14546. },
  14547. repo: {
  14548. required: true,
  14549. type: "string"
  14550. }
  14551. },
  14552. url: "/repos/:owner/:repo/community/code_of_conduct"
  14553. },
  14554. listConductCodes: {
  14555. headers: {
  14556. accept: "application/vnd.github.scarlet-witch-preview+json"
  14557. },
  14558. method: "GET",
  14559. params: {},
  14560. url: "/codes_of_conduct"
  14561. }
  14562. },
  14563. emojis: {
  14564. get: {
  14565. method: "GET",
  14566. params: {},
  14567. url: "/emojis"
  14568. }
  14569. },
  14570. gists: {
  14571. checkIsStarred: {
  14572. method: "GET",
  14573. params: {
  14574. gist_id: {
  14575. required: true,
  14576. type: "string"
  14577. }
  14578. },
  14579. url: "/gists/:gist_id/star"
  14580. },
  14581. create: {
  14582. method: "POST",
  14583. params: {
  14584. description: {
  14585. type: "string"
  14586. },
  14587. files: {
  14588. required: true,
  14589. type: "object"
  14590. },
  14591. "files.content": {
  14592. type: "string"
  14593. },
  14594. public: {
  14595. type: "boolean"
  14596. }
  14597. },
  14598. url: "/gists"
  14599. },
  14600. createComment: {
  14601. method: "POST",
  14602. params: {
  14603. body: {
  14604. required: true,
  14605. type: "string"
  14606. },
  14607. gist_id: {
  14608. required: true,
  14609. type: "string"
  14610. }
  14611. },
  14612. url: "/gists/:gist_id/comments"
  14613. },
  14614. delete: {
  14615. method: "DELETE",
  14616. params: {
  14617. gist_id: {
  14618. required: true,
  14619. type: "string"
  14620. }
  14621. },
  14622. url: "/gists/:gist_id"
  14623. },
  14624. deleteComment: {
  14625. method: "DELETE",
  14626. params: {
  14627. comment_id: {
  14628. required: true,
  14629. type: "integer"
  14630. },
  14631. gist_id: {
  14632. required: true,
  14633. type: "string"
  14634. }
  14635. },
  14636. url: "/gists/:gist_id/comments/:comment_id"
  14637. },
  14638. fork: {
  14639. method: "POST",
  14640. params: {
  14641. gist_id: {
  14642. required: true,
  14643. type: "string"
  14644. }
  14645. },
  14646. url: "/gists/:gist_id/forks"
  14647. },
  14648. get: {
  14649. method: "GET",
  14650. params: {
  14651. gist_id: {
  14652. required: true,
  14653. type: "string"
  14654. }
  14655. },
  14656. url: "/gists/:gist_id"
  14657. },
  14658. getComment: {
  14659. method: "GET",
  14660. params: {
  14661. comment_id: {
  14662. required: true,
  14663. type: "integer"
  14664. },
  14665. gist_id: {
  14666. required: true,
  14667. type: "string"
  14668. }
  14669. },
  14670. url: "/gists/:gist_id/comments/:comment_id"
  14671. },
  14672. getRevision: {
  14673. method: "GET",
  14674. params: {
  14675. gist_id: {
  14676. required: true,
  14677. type: "string"
  14678. },
  14679. sha: {
  14680. required: true,
  14681. type: "string"
  14682. }
  14683. },
  14684. url: "/gists/:gist_id/:sha"
  14685. },
  14686. list: {
  14687. method: "GET",
  14688. params: {
  14689. page: {
  14690. type: "integer"
  14691. },
  14692. per_page: {
  14693. type: "integer"
  14694. },
  14695. since: {
  14696. type: "string"
  14697. }
  14698. },
  14699. url: "/gists"
  14700. },
  14701. listComments: {
  14702. method: "GET",
  14703. params: {
  14704. gist_id: {
  14705. required: true,
  14706. type: "string"
  14707. },
  14708. page: {
  14709. type: "integer"
  14710. },
  14711. per_page: {
  14712. type: "integer"
  14713. }
  14714. },
  14715. url: "/gists/:gist_id/comments"
  14716. },
  14717. listCommits: {
  14718. method: "GET",
  14719. params: {
  14720. gist_id: {
  14721. required: true,
  14722. type: "string"
  14723. },
  14724. page: {
  14725. type: "integer"
  14726. },
  14727. per_page: {
  14728. type: "integer"
  14729. }
  14730. },
  14731. url: "/gists/:gist_id/commits"
  14732. },
  14733. listForks: {
  14734. method: "GET",
  14735. params: {
  14736. gist_id: {
  14737. required: true,
  14738. type: "string"
  14739. },
  14740. page: {
  14741. type: "integer"
  14742. },
  14743. per_page: {
  14744. type: "integer"
  14745. }
  14746. },
  14747. url: "/gists/:gist_id/forks"
  14748. },
  14749. listPublic: {
  14750. method: "GET",
  14751. params: {
  14752. page: {
  14753. type: "integer"
  14754. },
  14755. per_page: {
  14756. type: "integer"
  14757. },
  14758. since: {
  14759. type: "string"
  14760. }
  14761. },
  14762. url: "/gists/public"
  14763. },
  14764. listPublicForUser: {
  14765. method: "GET",
  14766. params: {
  14767. page: {
  14768. type: "integer"
  14769. },
  14770. per_page: {
  14771. type: "integer"
  14772. },
  14773. since: {
  14774. type: "string"
  14775. },
  14776. username: {
  14777. required: true,
  14778. type: "string"
  14779. }
  14780. },
  14781. url: "/users/:username/gists"
  14782. },
  14783. listStarred: {
  14784. method: "GET",
  14785. params: {
  14786. page: {
  14787. type: "integer"
  14788. },
  14789. per_page: {
  14790. type: "integer"
  14791. },
  14792. since: {
  14793. type: "string"
  14794. }
  14795. },
  14796. url: "/gists/starred"
  14797. },
  14798. star: {
  14799. method: "PUT",
  14800. params: {
  14801. gist_id: {
  14802. required: true,
  14803. type: "string"
  14804. }
  14805. },
  14806. url: "/gists/:gist_id/star"
  14807. },
  14808. unstar: {
  14809. method: "DELETE",
  14810. params: {
  14811. gist_id: {
  14812. required: true,
  14813. type: "string"
  14814. }
  14815. },
  14816. url: "/gists/:gist_id/star"
  14817. },
  14818. update: {
  14819. method: "PATCH",
  14820. params: {
  14821. description: {
  14822. type: "string"
  14823. },
  14824. files: {
  14825. type: "object"
  14826. },
  14827. "files.content": {
  14828. type: "string"
  14829. },
  14830. "files.filename": {
  14831. type: "string"
  14832. },
  14833. gist_id: {
  14834. required: true,
  14835. type: "string"
  14836. }
  14837. },
  14838. url: "/gists/:gist_id"
  14839. },
  14840. updateComment: {
  14841. method: "PATCH",
  14842. params: {
  14843. body: {
  14844. required: true,
  14845. type: "string"
  14846. },
  14847. comment_id: {
  14848. required: true,
  14849. type: "integer"
  14850. },
  14851. gist_id: {
  14852. required: true,
  14853. type: "string"
  14854. }
  14855. },
  14856. url: "/gists/:gist_id/comments/:comment_id"
  14857. }
  14858. },
  14859. git: {
  14860. createBlob: {
  14861. method: "POST",
  14862. params: {
  14863. content: {
  14864. required: true,
  14865. type: "string"
  14866. },
  14867. encoding: {
  14868. type: "string"
  14869. },
  14870. owner: {
  14871. required: true,
  14872. type: "string"
  14873. },
  14874. repo: {
  14875. required: true,
  14876. type: "string"
  14877. }
  14878. },
  14879. url: "/repos/:owner/:repo/git/blobs"
  14880. },
  14881. createCommit: {
  14882. method: "POST",
  14883. params: {
  14884. author: {
  14885. type: "object"
  14886. },
  14887. "author.date": {
  14888. type: "string"
  14889. },
  14890. "author.email": {
  14891. type: "string"
  14892. },
  14893. "author.name": {
  14894. type: "string"
  14895. },
  14896. committer: {
  14897. type: "object"
  14898. },
  14899. "committer.date": {
  14900. type: "string"
  14901. },
  14902. "committer.email": {
  14903. type: "string"
  14904. },
  14905. "committer.name": {
  14906. type: "string"
  14907. },
  14908. message: {
  14909. required: true,
  14910. type: "string"
  14911. },
  14912. owner: {
  14913. required: true,
  14914. type: "string"
  14915. },
  14916. parents: {
  14917. required: true,
  14918. type: "string[]"
  14919. },
  14920. repo: {
  14921. required: true,
  14922. type: "string"
  14923. },
  14924. signature: {
  14925. type: "string"
  14926. },
  14927. tree: {
  14928. required: true,
  14929. type: "string"
  14930. }
  14931. },
  14932. url: "/repos/:owner/:repo/git/commits"
  14933. },
  14934. createRef: {
  14935. method: "POST",
  14936. params: {
  14937. owner: {
  14938. required: true,
  14939. type: "string"
  14940. },
  14941. ref: {
  14942. required: true,
  14943. type: "string"
  14944. },
  14945. repo: {
  14946. required: true,
  14947. type: "string"
  14948. },
  14949. sha: {
  14950. required: true,
  14951. type: "string"
  14952. }
  14953. },
  14954. url: "/repos/:owner/:repo/git/refs"
  14955. },
  14956. createTag: {
  14957. method: "POST",
  14958. params: {
  14959. message: {
  14960. required: true,
  14961. type: "string"
  14962. },
  14963. object: {
  14964. required: true,
  14965. type: "string"
  14966. },
  14967. owner: {
  14968. required: true,
  14969. type: "string"
  14970. },
  14971. repo: {
  14972. required: true,
  14973. type: "string"
  14974. },
  14975. tag: {
  14976. required: true,
  14977. type: "string"
  14978. },
  14979. tagger: {
  14980. type: "object"
  14981. },
  14982. "tagger.date": {
  14983. type: "string"
  14984. },
  14985. "tagger.email": {
  14986. type: "string"
  14987. },
  14988. "tagger.name": {
  14989. type: "string"
  14990. },
  14991. type: {
  14992. enum: ["commit", "tree", "blob"],
  14993. required: true,
  14994. type: "string"
  14995. }
  14996. },
  14997. url: "/repos/:owner/:repo/git/tags"
  14998. },
  14999. createTree: {
  15000. method: "POST",
  15001. params: {
  15002. base_tree: {
  15003. type: "string"
  15004. },
  15005. owner: {
  15006. required: true,
  15007. type: "string"
  15008. },
  15009. repo: {
  15010. required: true,
  15011. type: "string"
  15012. },
  15013. tree: {
  15014. required: true,
  15015. type: "object[]"
  15016. },
  15017. "tree[].content": {
  15018. type: "string"
  15019. },
  15020. "tree[].mode": {
  15021. enum: ["100644", "100755", "040000", "160000", "120000"],
  15022. type: "string"
  15023. },
  15024. "tree[].path": {
  15025. type: "string"
  15026. },
  15027. "tree[].sha": {
  15028. allowNull: true,
  15029. type: "string"
  15030. },
  15031. "tree[].type": {
  15032. enum: ["blob", "tree", "commit"],
  15033. type: "string"
  15034. }
  15035. },
  15036. url: "/repos/:owner/:repo/git/trees"
  15037. },
  15038. deleteRef: {
  15039. method: "DELETE",
  15040. params: {
  15041. owner: {
  15042. required: true,
  15043. type: "string"
  15044. },
  15045. ref: {
  15046. required: true,
  15047. type: "string"
  15048. },
  15049. repo: {
  15050. required: true,
  15051. type: "string"
  15052. }
  15053. },
  15054. url: "/repos/:owner/:repo/git/refs/:ref"
  15055. },
  15056. getBlob: {
  15057. method: "GET",
  15058. params: {
  15059. file_sha: {
  15060. required: true,
  15061. type: "string"
  15062. },
  15063. owner: {
  15064. required: true,
  15065. type: "string"
  15066. },
  15067. repo: {
  15068. required: true,
  15069. type: "string"
  15070. }
  15071. },
  15072. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15073. },
  15074. getCommit: {
  15075. method: "GET",
  15076. params: {
  15077. commit_sha: {
  15078. required: true,
  15079. type: "string"
  15080. },
  15081. owner: {
  15082. required: true,
  15083. type: "string"
  15084. },
  15085. repo: {
  15086. required: true,
  15087. type: "string"
  15088. }
  15089. },
  15090. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15091. },
  15092. getRef: {
  15093. method: "GET",
  15094. params: {
  15095. owner: {
  15096. required: true,
  15097. type: "string"
  15098. },
  15099. ref: {
  15100. required: true,
  15101. type: "string"
  15102. },
  15103. repo: {
  15104. required: true,
  15105. type: "string"
  15106. }
  15107. },
  15108. url: "/repos/:owner/:repo/git/ref/:ref"
  15109. },
  15110. getTag: {
  15111. method: "GET",
  15112. params: {
  15113. owner: {
  15114. required: true,
  15115. type: "string"
  15116. },
  15117. repo: {
  15118. required: true,
  15119. type: "string"
  15120. },
  15121. tag_sha: {
  15122. required: true,
  15123. type: "string"
  15124. }
  15125. },
  15126. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15127. },
  15128. getTree: {
  15129. method: "GET",
  15130. params: {
  15131. owner: {
  15132. required: true,
  15133. type: "string"
  15134. },
  15135. recursive: {
  15136. enum: ["1"],
  15137. type: "integer"
  15138. },
  15139. repo: {
  15140. required: true,
  15141. type: "string"
  15142. },
  15143. tree_sha: {
  15144. required: true,
  15145. type: "string"
  15146. }
  15147. },
  15148. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15149. },
  15150. listMatchingRefs: {
  15151. method: "GET",
  15152. params: {
  15153. owner: {
  15154. required: true,
  15155. type: "string"
  15156. },
  15157. page: {
  15158. type: "integer"
  15159. },
  15160. per_page: {
  15161. type: "integer"
  15162. },
  15163. ref: {
  15164. required: true,
  15165. type: "string"
  15166. },
  15167. repo: {
  15168. required: true,
  15169. type: "string"
  15170. }
  15171. },
  15172. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15173. },
  15174. listRefs: {
  15175. method: "GET",
  15176. params: {
  15177. namespace: {
  15178. type: "string"
  15179. },
  15180. owner: {
  15181. required: true,
  15182. type: "string"
  15183. },
  15184. page: {
  15185. type: "integer"
  15186. },
  15187. per_page: {
  15188. type: "integer"
  15189. },
  15190. repo: {
  15191. required: true,
  15192. type: "string"
  15193. }
  15194. },
  15195. url: "/repos/:owner/:repo/git/refs/:namespace"
  15196. },
  15197. updateRef: {
  15198. method: "PATCH",
  15199. params: {
  15200. force: {
  15201. type: "boolean"
  15202. },
  15203. owner: {
  15204. required: true,
  15205. type: "string"
  15206. },
  15207. ref: {
  15208. required: true,
  15209. type: "string"
  15210. },
  15211. repo: {
  15212. required: true,
  15213. type: "string"
  15214. },
  15215. sha: {
  15216. required: true,
  15217. type: "string"
  15218. }
  15219. },
  15220. url: "/repos/:owner/:repo/git/refs/:ref"
  15221. }
  15222. },
  15223. gitignore: {
  15224. getTemplate: {
  15225. method: "GET",
  15226. params: {
  15227. name: {
  15228. required: true,
  15229. type: "string"
  15230. }
  15231. },
  15232. url: "/gitignore/templates/:name"
  15233. },
  15234. listTemplates: {
  15235. method: "GET",
  15236. params: {},
  15237. url: "/gitignore/templates"
  15238. }
  15239. },
  15240. interactions: {
  15241. addOrUpdateRestrictionsForOrg: {
  15242. headers: {
  15243. accept: "application/vnd.github.sombra-preview+json"
  15244. },
  15245. method: "PUT",
  15246. params: {
  15247. limit: {
  15248. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15249. required: true,
  15250. type: "string"
  15251. },
  15252. org: {
  15253. required: true,
  15254. type: "string"
  15255. }
  15256. },
  15257. url: "/orgs/:org/interaction-limits"
  15258. },
  15259. addOrUpdateRestrictionsForRepo: {
  15260. headers: {
  15261. accept: "application/vnd.github.sombra-preview+json"
  15262. },
  15263. method: "PUT",
  15264. params: {
  15265. limit: {
  15266. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15267. required: true,
  15268. type: "string"
  15269. },
  15270. owner: {
  15271. required: true,
  15272. type: "string"
  15273. },
  15274. repo: {
  15275. required: true,
  15276. type: "string"
  15277. }
  15278. },
  15279. url: "/repos/:owner/:repo/interaction-limits"
  15280. },
  15281. getRestrictionsForOrg: {
  15282. headers: {
  15283. accept: "application/vnd.github.sombra-preview+json"
  15284. },
  15285. method: "GET",
  15286. params: {
  15287. org: {
  15288. required: true,
  15289. type: "string"
  15290. }
  15291. },
  15292. url: "/orgs/:org/interaction-limits"
  15293. },
  15294. getRestrictionsForRepo: {
  15295. headers: {
  15296. accept: "application/vnd.github.sombra-preview+json"
  15297. },
  15298. method: "GET",
  15299. params: {
  15300. owner: {
  15301. required: true,
  15302. type: "string"
  15303. },
  15304. repo: {
  15305. required: true,
  15306. type: "string"
  15307. }
  15308. },
  15309. url: "/repos/:owner/:repo/interaction-limits"
  15310. },
  15311. removeRestrictionsForOrg: {
  15312. headers: {
  15313. accept: "application/vnd.github.sombra-preview+json"
  15314. },
  15315. method: "DELETE",
  15316. params: {
  15317. org: {
  15318. required: true,
  15319. type: "string"
  15320. }
  15321. },
  15322. url: "/orgs/:org/interaction-limits"
  15323. },
  15324. removeRestrictionsForRepo: {
  15325. headers: {
  15326. accept: "application/vnd.github.sombra-preview+json"
  15327. },
  15328. method: "DELETE",
  15329. params: {
  15330. owner: {
  15331. required: true,
  15332. type: "string"
  15333. },
  15334. repo: {
  15335. required: true,
  15336. type: "string"
  15337. }
  15338. },
  15339. url: "/repos/:owner/:repo/interaction-limits"
  15340. }
  15341. },
  15342. issues: {
  15343. addAssignees: {
  15344. method: "POST",
  15345. params: {
  15346. assignees: {
  15347. type: "string[]"
  15348. },
  15349. issue_number: {
  15350. required: true,
  15351. type: "integer"
  15352. },
  15353. number: {
  15354. alias: "issue_number",
  15355. deprecated: true,
  15356. type: "integer"
  15357. },
  15358. owner: {
  15359. required: true,
  15360. type: "string"
  15361. },
  15362. repo: {
  15363. required: true,
  15364. type: "string"
  15365. }
  15366. },
  15367. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15368. },
  15369. addLabels: {
  15370. method: "POST",
  15371. params: {
  15372. issue_number: {
  15373. required: true,
  15374. type: "integer"
  15375. },
  15376. labels: {
  15377. required: true,
  15378. type: "string[]"
  15379. },
  15380. number: {
  15381. alias: "issue_number",
  15382. deprecated: true,
  15383. type: "integer"
  15384. },
  15385. owner: {
  15386. required: true,
  15387. type: "string"
  15388. },
  15389. repo: {
  15390. required: true,
  15391. type: "string"
  15392. }
  15393. },
  15394. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15395. },
  15396. checkAssignee: {
  15397. method: "GET",
  15398. params: {
  15399. assignee: {
  15400. required: true,
  15401. type: "string"
  15402. },
  15403. owner: {
  15404. required: true,
  15405. type: "string"
  15406. },
  15407. repo: {
  15408. required: true,
  15409. type: "string"
  15410. }
  15411. },
  15412. url: "/repos/:owner/:repo/assignees/:assignee"
  15413. },
  15414. create: {
  15415. method: "POST",
  15416. params: {
  15417. assignee: {
  15418. type: "string"
  15419. },
  15420. assignees: {
  15421. type: "string[]"
  15422. },
  15423. body: {
  15424. type: "string"
  15425. },
  15426. labels: {
  15427. type: "string[]"
  15428. },
  15429. milestone: {
  15430. type: "integer"
  15431. },
  15432. owner: {
  15433. required: true,
  15434. type: "string"
  15435. },
  15436. repo: {
  15437. required: true,
  15438. type: "string"
  15439. },
  15440. title: {
  15441. required: true,
  15442. type: "string"
  15443. }
  15444. },
  15445. url: "/repos/:owner/:repo/issues"
  15446. },
  15447. createComment: {
  15448. method: "POST",
  15449. params: {
  15450. body: {
  15451. required: true,
  15452. type: "string"
  15453. },
  15454. issue_number: {
  15455. required: true,
  15456. type: "integer"
  15457. },
  15458. number: {
  15459. alias: "issue_number",
  15460. deprecated: true,
  15461. type: "integer"
  15462. },
  15463. owner: {
  15464. required: true,
  15465. type: "string"
  15466. },
  15467. repo: {
  15468. required: true,
  15469. type: "string"
  15470. }
  15471. },
  15472. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15473. },
  15474. createLabel: {
  15475. method: "POST",
  15476. params: {
  15477. color: {
  15478. required: true,
  15479. type: "string"
  15480. },
  15481. description: {
  15482. type: "string"
  15483. },
  15484. name: {
  15485. required: true,
  15486. type: "string"
  15487. },
  15488. owner: {
  15489. required: true,
  15490. type: "string"
  15491. },
  15492. repo: {
  15493. required: true,
  15494. type: "string"
  15495. }
  15496. },
  15497. url: "/repos/:owner/:repo/labels"
  15498. },
  15499. createMilestone: {
  15500. method: "POST",
  15501. params: {
  15502. description: {
  15503. type: "string"
  15504. },
  15505. due_on: {
  15506. type: "string"
  15507. },
  15508. owner: {
  15509. required: true,
  15510. type: "string"
  15511. },
  15512. repo: {
  15513. required: true,
  15514. type: "string"
  15515. },
  15516. state: {
  15517. enum: ["open", "closed"],
  15518. type: "string"
  15519. },
  15520. title: {
  15521. required: true,
  15522. type: "string"
  15523. }
  15524. },
  15525. url: "/repos/:owner/:repo/milestones"
  15526. },
  15527. deleteComment: {
  15528. method: "DELETE",
  15529. params: {
  15530. comment_id: {
  15531. required: true,
  15532. type: "integer"
  15533. },
  15534. owner: {
  15535. required: true,
  15536. type: "string"
  15537. },
  15538. repo: {
  15539. required: true,
  15540. type: "string"
  15541. }
  15542. },
  15543. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15544. },
  15545. deleteLabel: {
  15546. method: "DELETE",
  15547. params: {
  15548. name: {
  15549. required: true,
  15550. type: "string"
  15551. },
  15552. owner: {
  15553. required: true,
  15554. type: "string"
  15555. },
  15556. repo: {
  15557. required: true,
  15558. type: "string"
  15559. }
  15560. },
  15561. url: "/repos/:owner/:repo/labels/:name"
  15562. },
  15563. deleteMilestone: {
  15564. method: "DELETE",
  15565. params: {
  15566. milestone_number: {
  15567. required: true,
  15568. type: "integer"
  15569. },
  15570. number: {
  15571. alias: "milestone_number",
  15572. deprecated: true,
  15573. type: "integer"
  15574. },
  15575. owner: {
  15576. required: true,
  15577. type: "string"
  15578. },
  15579. repo: {
  15580. required: true,
  15581. type: "string"
  15582. }
  15583. },
  15584. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15585. },
  15586. get: {
  15587. method: "GET",
  15588. params: {
  15589. issue_number: {
  15590. required: true,
  15591. type: "integer"
  15592. },
  15593. number: {
  15594. alias: "issue_number",
  15595. deprecated: true,
  15596. type: "integer"
  15597. },
  15598. owner: {
  15599. required: true,
  15600. type: "string"
  15601. },
  15602. repo: {
  15603. required: true,
  15604. type: "string"
  15605. }
  15606. },
  15607. url: "/repos/:owner/:repo/issues/:issue_number"
  15608. },
  15609. getComment: {
  15610. method: "GET",
  15611. params: {
  15612. comment_id: {
  15613. required: true,
  15614. type: "integer"
  15615. },
  15616. owner: {
  15617. required: true,
  15618. type: "string"
  15619. },
  15620. repo: {
  15621. required: true,
  15622. type: "string"
  15623. }
  15624. },
  15625. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15626. },
  15627. getEvent: {
  15628. method: "GET",
  15629. params: {
  15630. event_id: {
  15631. required: true,
  15632. type: "integer"
  15633. },
  15634. owner: {
  15635. required: true,
  15636. type: "string"
  15637. },
  15638. repo: {
  15639. required: true,
  15640. type: "string"
  15641. }
  15642. },
  15643. url: "/repos/:owner/:repo/issues/events/:event_id"
  15644. },
  15645. getLabel: {
  15646. method: "GET",
  15647. params: {
  15648. name: {
  15649. required: true,
  15650. type: "string"
  15651. },
  15652. owner: {
  15653. required: true,
  15654. type: "string"
  15655. },
  15656. repo: {
  15657. required: true,
  15658. type: "string"
  15659. }
  15660. },
  15661. url: "/repos/:owner/:repo/labels/:name"
  15662. },
  15663. getMilestone: {
  15664. method: "GET",
  15665. params: {
  15666. milestone_number: {
  15667. required: true,
  15668. type: "integer"
  15669. },
  15670. number: {
  15671. alias: "milestone_number",
  15672. deprecated: true,
  15673. type: "integer"
  15674. },
  15675. owner: {
  15676. required: true,
  15677. type: "string"
  15678. },
  15679. repo: {
  15680. required: true,
  15681. type: "string"
  15682. }
  15683. },
  15684. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15685. },
  15686. list: {
  15687. method: "GET",
  15688. params: {
  15689. direction: {
  15690. enum: ["asc", "desc"],
  15691. type: "string"
  15692. },
  15693. filter: {
  15694. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15695. type: "string"
  15696. },
  15697. labels: {
  15698. type: "string"
  15699. },
  15700. page: {
  15701. type: "integer"
  15702. },
  15703. per_page: {
  15704. type: "integer"
  15705. },
  15706. since: {
  15707. type: "string"
  15708. },
  15709. sort: {
  15710. enum: ["created", "updated", "comments"],
  15711. type: "string"
  15712. },
  15713. state: {
  15714. enum: ["open", "closed", "all"],
  15715. type: "string"
  15716. }
  15717. },
  15718. url: "/issues"
  15719. },
  15720. listAssignees: {
  15721. method: "GET",
  15722. params: {
  15723. owner: {
  15724. required: true,
  15725. type: "string"
  15726. },
  15727. page: {
  15728. type: "integer"
  15729. },
  15730. per_page: {
  15731. type: "integer"
  15732. },
  15733. repo: {
  15734. required: true,
  15735. type: "string"
  15736. }
  15737. },
  15738. url: "/repos/:owner/:repo/assignees"
  15739. },
  15740. listComments: {
  15741. method: "GET",
  15742. params: {
  15743. issue_number: {
  15744. required: true,
  15745. type: "integer"
  15746. },
  15747. number: {
  15748. alias: "issue_number",
  15749. deprecated: true,
  15750. type: "integer"
  15751. },
  15752. owner: {
  15753. required: true,
  15754. type: "string"
  15755. },
  15756. page: {
  15757. type: "integer"
  15758. },
  15759. per_page: {
  15760. type: "integer"
  15761. },
  15762. repo: {
  15763. required: true,
  15764. type: "string"
  15765. },
  15766. since: {
  15767. type: "string"
  15768. }
  15769. },
  15770. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15771. },
  15772. listCommentsForRepo: {
  15773. method: "GET",
  15774. params: {
  15775. direction: {
  15776. enum: ["asc", "desc"],
  15777. type: "string"
  15778. },
  15779. owner: {
  15780. required: true,
  15781. type: "string"
  15782. },
  15783. repo: {
  15784. required: true,
  15785. type: "string"
  15786. },
  15787. since: {
  15788. type: "string"
  15789. },
  15790. sort: {
  15791. enum: ["created", "updated"],
  15792. type: "string"
  15793. }
  15794. },
  15795. url: "/repos/:owner/:repo/issues/comments"
  15796. },
  15797. listEvents: {
  15798. method: "GET",
  15799. params: {
  15800. issue_number: {
  15801. required: true,
  15802. type: "integer"
  15803. },
  15804. number: {
  15805. alias: "issue_number",
  15806. deprecated: true,
  15807. type: "integer"
  15808. },
  15809. owner: {
  15810. required: true,
  15811. type: "string"
  15812. },
  15813. page: {
  15814. type: "integer"
  15815. },
  15816. per_page: {
  15817. type: "integer"
  15818. },
  15819. repo: {
  15820. required: true,
  15821. type: "string"
  15822. }
  15823. },
  15824. url: "/repos/:owner/:repo/issues/:issue_number/events"
  15825. },
  15826. listEventsForRepo: {
  15827. method: "GET",
  15828. params: {
  15829. owner: {
  15830. required: true,
  15831. type: "string"
  15832. },
  15833. page: {
  15834. type: "integer"
  15835. },
  15836. per_page: {
  15837. type: "integer"
  15838. },
  15839. repo: {
  15840. required: true,
  15841. type: "string"
  15842. }
  15843. },
  15844. url: "/repos/:owner/:repo/issues/events"
  15845. },
  15846. listEventsForTimeline: {
  15847. headers: {
  15848. accept: "application/vnd.github.mockingbird-preview+json"
  15849. },
  15850. method: "GET",
  15851. params: {
  15852. issue_number: {
  15853. required: true,
  15854. type: "integer"
  15855. },
  15856. number: {
  15857. alias: "issue_number",
  15858. deprecated: true,
  15859. type: "integer"
  15860. },
  15861. owner: {
  15862. required: true,
  15863. type: "string"
  15864. },
  15865. page: {
  15866. type: "integer"
  15867. },
  15868. per_page: {
  15869. type: "integer"
  15870. },
  15871. repo: {
  15872. required: true,
  15873. type: "string"
  15874. }
  15875. },
  15876. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  15877. },
  15878. listForAuthenticatedUser: {
  15879. method: "GET",
  15880. params: {
  15881. direction: {
  15882. enum: ["asc", "desc"],
  15883. type: "string"
  15884. },
  15885. filter: {
  15886. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15887. type: "string"
  15888. },
  15889. labels: {
  15890. type: "string"
  15891. },
  15892. page: {
  15893. type: "integer"
  15894. },
  15895. per_page: {
  15896. type: "integer"
  15897. },
  15898. since: {
  15899. type: "string"
  15900. },
  15901. sort: {
  15902. enum: ["created", "updated", "comments"],
  15903. type: "string"
  15904. },
  15905. state: {
  15906. enum: ["open", "closed", "all"],
  15907. type: "string"
  15908. }
  15909. },
  15910. url: "/user/issues"
  15911. },
  15912. listForOrg: {
  15913. method: "GET",
  15914. params: {
  15915. direction: {
  15916. enum: ["asc", "desc"],
  15917. type: "string"
  15918. },
  15919. filter: {
  15920. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15921. type: "string"
  15922. },
  15923. labels: {
  15924. type: "string"
  15925. },
  15926. org: {
  15927. required: true,
  15928. type: "string"
  15929. },
  15930. page: {
  15931. type: "integer"
  15932. },
  15933. per_page: {
  15934. type: "integer"
  15935. },
  15936. since: {
  15937. type: "string"
  15938. },
  15939. sort: {
  15940. enum: ["created", "updated", "comments"],
  15941. type: "string"
  15942. },
  15943. state: {
  15944. enum: ["open", "closed", "all"],
  15945. type: "string"
  15946. }
  15947. },
  15948. url: "/orgs/:org/issues"
  15949. },
  15950. listForRepo: {
  15951. method: "GET",
  15952. params: {
  15953. assignee: {
  15954. type: "string"
  15955. },
  15956. creator: {
  15957. type: "string"
  15958. },
  15959. direction: {
  15960. enum: ["asc", "desc"],
  15961. type: "string"
  15962. },
  15963. labels: {
  15964. type: "string"
  15965. },
  15966. mentioned: {
  15967. type: "string"
  15968. },
  15969. milestone: {
  15970. type: "string"
  15971. },
  15972. owner: {
  15973. required: true,
  15974. type: "string"
  15975. },
  15976. page: {
  15977. type: "integer"
  15978. },
  15979. per_page: {
  15980. type: "integer"
  15981. },
  15982. repo: {
  15983. required: true,
  15984. type: "string"
  15985. },
  15986. since: {
  15987. type: "string"
  15988. },
  15989. sort: {
  15990. enum: ["created", "updated", "comments"],
  15991. type: "string"
  15992. },
  15993. state: {
  15994. enum: ["open", "closed", "all"],
  15995. type: "string"
  15996. }
  15997. },
  15998. url: "/repos/:owner/:repo/issues"
  15999. },
  16000. listLabelsForMilestone: {
  16001. method: "GET",
  16002. params: {
  16003. milestone_number: {
  16004. required: true,
  16005. type: "integer"
  16006. },
  16007. number: {
  16008. alias: "milestone_number",
  16009. deprecated: true,
  16010. type: "integer"
  16011. },
  16012. owner: {
  16013. required: true,
  16014. type: "string"
  16015. },
  16016. page: {
  16017. type: "integer"
  16018. },
  16019. per_page: {
  16020. type: "integer"
  16021. },
  16022. repo: {
  16023. required: true,
  16024. type: "string"
  16025. }
  16026. },
  16027. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16028. },
  16029. listLabelsForRepo: {
  16030. method: "GET",
  16031. params: {
  16032. owner: {
  16033. required: true,
  16034. type: "string"
  16035. },
  16036. page: {
  16037. type: "integer"
  16038. },
  16039. per_page: {
  16040. type: "integer"
  16041. },
  16042. repo: {
  16043. required: true,
  16044. type: "string"
  16045. }
  16046. },
  16047. url: "/repos/:owner/:repo/labels"
  16048. },
  16049. listLabelsOnIssue: {
  16050. method: "GET",
  16051. params: {
  16052. issue_number: {
  16053. required: true,
  16054. type: "integer"
  16055. },
  16056. number: {
  16057. alias: "issue_number",
  16058. deprecated: true,
  16059. type: "integer"
  16060. },
  16061. owner: {
  16062. required: true,
  16063. type: "string"
  16064. },
  16065. page: {
  16066. type: "integer"
  16067. },
  16068. per_page: {
  16069. type: "integer"
  16070. },
  16071. repo: {
  16072. required: true,
  16073. type: "string"
  16074. }
  16075. },
  16076. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16077. },
  16078. listMilestonesForRepo: {
  16079. method: "GET",
  16080. params: {
  16081. direction: {
  16082. enum: ["asc", "desc"],
  16083. type: "string"
  16084. },
  16085. owner: {
  16086. required: true,
  16087. type: "string"
  16088. },
  16089. page: {
  16090. type: "integer"
  16091. },
  16092. per_page: {
  16093. type: "integer"
  16094. },
  16095. repo: {
  16096. required: true,
  16097. type: "string"
  16098. },
  16099. sort: {
  16100. enum: ["due_on", "completeness"],
  16101. type: "string"
  16102. },
  16103. state: {
  16104. enum: ["open", "closed", "all"],
  16105. type: "string"
  16106. }
  16107. },
  16108. url: "/repos/:owner/:repo/milestones"
  16109. },
  16110. lock: {
  16111. method: "PUT",
  16112. params: {
  16113. issue_number: {
  16114. required: true,
  16115. type: "integer"
  16116. },
  16117. lock_reason: {
  16118. enum: ["off-topic", "too heated", "resolved", "spam"],
  16119. type: "string"
  16120. },
  16121. number: {
  16122. alias: "issue_number",
  16123. deprecated: true,
  16124. type: "integer"
  16125. },
  16126. owner: {
  16127. required: true,
  16128. type: "string"
  16129. },
  16130. repo: {
  16131. required: true,
  16132. type: "string"
  16133. }
  16134. },
  16135. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16136. },
  16137. removeAssignees: {
  16138. method: "DELETE",
  16139. params: {
  16140. assignees: {
  16141. type: "string[]"
  16142. },
  16143. issue_number: {
  16144. required: true,
  16145. type: "integer"
  16146. },
  16147. number: {
  16148. alias: "issue_number",
  16149. deprecated: true,
  16150. type: "integer"
  16151. },
  16152. owner: {
  16153. required: true,
  16154. type: "string"
  16155. },
  16156. repo: {
  16157. required: true,
  16158. type: "string"
  16159. }
  16160. },
  16161. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16162. },
  16163. removeLabel: {
  16164. method: "DELETE",
  16165. params: {
  16166. issue_number: {
  16167. required: true,
  16168. type: "integer"
  16169. },
  16170. name: {
  16171. required: true,
  16172. type: "string"
  16173. },
  16174. number: {
  16175. alias: "issue_number",
  16176. deprecated: true,
  16177. type: "integer"
  16178. },
  16179. owner: {
  16180. required: true,
  16181. type: "string"
  16182. },
  16183. repo: {
  16184. required: true,
  16185. type: "string"
  16186. }
  16187. },
  16188. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16189. },
  16190. removeLabels: {
  16191. method: "DELETE",
  16192. params: {
  16193. issue_number: {
  16194. required: true,
  16195. type: "integer"
  16196. },
  16197. number: {
  16198. alias: "issue_number",
  16199. deprecated: true,
  16200. type: "integer"
  16201. },
  16202. owner: {
  16203. required: true,
  16204. type: "string"
  16205. },
  16206. repo: {
  16207. required: true,
  16208. type: "string"
  16209. }
  16210. },
  16211. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16212. },
  16213. replaceLabels: {
  16214. method: "PUT",
  16215. params: {
  16216. issue_number: {
  16217. required: true,
  16218. type: "integer"
  16219. },
  16220. labels: {
  16221. type: "string[]"
  16222. },
  16223. number: {
  16224. alias: "issue_number",
  16225. deprecated: true,
  16226. type: "integer"
  16227. },
  16228. owner: {
  16229. required: true,
  16230. type: "string"
  16231. },
  16232. repo: {
  16233. required: true,
  16234. type: "string"
  16235. }
  16236. },
  16237. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16238. },
  16239. unlock: {
  16240. method: "DELETE",
  16241. params: {
  16242. issue_number: {
  16243. required: true,
  16244. type: "integer"
  16245. },
  16246. number: {
  16247. alias: "issue_number",
  16248. deprecated: true,
  16249. type: "integer"
  16250. },
  16251. owner: {
  16252. required: true,
  16253. type: "string"
  16254. },
  16255. repo: {
  16256. required: true,
  16257. type: "string"
  16258. }
  16259. },
  16260. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16261. },
  16262. update: {
  16263. method: "PATCH",
  16264. params: {
  16265. assignee: {
  16266. type: "string"
  16267. },
  16268. assignees: {
  16269. type: "string[]"
  16270. },
  16271. body: {
  16272. type: "string"
  16273. },
  16274. issue_number: {
  16275. required: true,
  16276. type: "integer"
  16277. },
  16278. labels: {
  16279. type: "string[]"
  16280. },
  16281. milestone: {
  16282. allowNull: true,
  16283. type: "integer"
  16284. },
  16285. number: {
  16286. alias: "issue_number",
  16287. deprecated: true,
  16288. type: "integer"
  16289. },
  16290. owner: {
  16291. required: true,
  16292. type: "string"
  16293. },
  16294. repo: {
  16295. required: true,
  16296. type: "string"
  16297. },
  16298. state: {
  16299. enum: ["open", "closed"],
  16300. type: "string"
  16301. },
  16302. title: {
  16303. type: "string"
  16304. }
  16305. },
  16306. url: "/repos/:owner/:repo/issues/:issue_number"
  16307. },
  16308. updateComment: {
  16309. method: "PATCH",
  16310. params: {
  16311. body: {
  16312. required: true,
  16313. type: "string"
  16314. },
  16315. comment_id: {
  16316. required: true,
  16317. type: "integer"
  16318. },
  16319. owner: {
  16320. required: true,
  16321. type: "string"
  16322. },
  16323. repo: {
  16324. required: true,
  16325. type: "string"
  16326. }
  16327. },
  16328. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16329. },
  16330. updateLabel: {
  16331. method: "PATCH",
  16332. params: {
  16333. color: {
  16334. type: "string"
  16335. },
  16336. current_name: {
  16337. required: true,
  16338. type: "string"
  16339. },
  16340. description: {
  16341. type: "string"
  16342. },
  16343. name: {
  16344. type: "string"
  16345. },
  16346. owner: {
  16347. required: true,
  16348. type: "string"
  16349. },
  16350. repo: {
  16351. required: true,
  16352. type: "string"
  16353. }
  16354. },
  16355. url: "/repos/:owner/:repo/labels/:current_name"
  16356. },
  16357. updateMilestone: {
  16358. method: "PATCH",
  16359. params: {
  16360. description: {
  16361. type: "string"
  16362. },
  16363. due_on: {
  16364. type: "string"
  16365. },
  16366. milestone_number: {
  16367. required: true,
  16368. type: "integer"
  16369. },
  16370. number: {
  16371. alias: "milestone_number",
  16372. deprecated: true,
  16373. type: "integer"
  16374. },
  16375. owner: {
  16376. required: true,
  16377. type: "string"
  16378. },
  16379. repo: {
  16380. required: true,
  16381. type: "string"
  16382. },
  16383. state: {
  16384. enum: ["open", "closed"],
  16385. type: "string"
  16386. },
  16387. title: {
  16388. type: "string"
  16389. }
  16390. },
  16391. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16392. }
  16393. },
  16394. licenses: {
  16395. get: {
  16396. method: "GET",
  16397. params: {
  16398. license: {
  16399. required: true,
  16400. type: "string"
  16401. }
  16402. },
  16403. url: "/licenses/:license"
  16404. },
  16405. getForRepo: {
  16406. method: "GET",
  16407. params: {
  16408. owner: {
  16409. required: true,
  16410. type: "string"
  16411. },
  16412. repo: {
  16413. required: true,
  16414. type: "string"
  16415. }
  16416. },
  16417. url: "/repos/:owner/:repo/license"
  16418. },
  16419. list: {
  16420. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16421. method: "GET",
  16422. params: {},
  16423. url: "/licenses"
  16424. },
  16425. listCommonlyUsed: {
  16426. method: "GET",
  16427. params: {},
  16428. url: "/licenses"
  16429. }
  16430. },
  16431. markdown: {
  16432. render: {
  16433. method: "POST",
  16434. params: {
  16435. context: {
  16436. type: "string"
  16437. },
  16438. mode: {
  16439. enum: ["markdown", "gfm"],
  16440. type: "string"
  16441. },
  16442. text: {
  16443. required: true,
  16444. type: "string"
  16445. }
  16446. },
  16447. url: "/markdown"
  16448. },
  16449. renderRaw: {
  16450. headers: {
  16451. "content-type": "text/plain; charset=utf-8"
  16452. },
  16453. method: "POST",
  16454. params: {
  16455. data: {
  16456. mapTo: "data",
  16457. required: true,
  16458. type: "string"
  16459. }
  16460. },
  16461. url: "/markdown/raw"
  16462. }
  16463. },
  16464. meta: {
  16465. get: {
  16466. method: "GET",
  16467. params: {},
  16468. url: "/meta"
  16469. }
  16470. },
  16471. migrations: {
  16472. cancelImport: {
  16473. method: "DELETE",
  16474. params: {
  16475. owner: {
  16476. required: true,
  16477. type: "string"
  16478. },
  16479. repo: {
  16480. required: true,
  16481. type: "string"
  16482. }
  16483. },
  16484. url: "/repos/:owner/:repo/import"
  16485. },
  16486. deleteArchiveForAuthenticatedUser: {
  16487. headers: {
  16488. accept: "application/vnd.github.wyandotte-preview+json"
  16489. },
  16490. method: "DELETE",
  16491. params: {
  16492. migration_id: {
  16493. required: true,
  16494. type: "integer"
  16495. }
  16496. },
  16497. url: "/user/migrations/:migration_id/archive"
  16498. },
  16499. deleteArchiveForOrg: {
  16500. headers: {
  16501. accept: "application/vnd.github.wyandotte-preview+json"
  16502. },
  16503. method: "DELETE",
  16504. params: {
  16505. migration_id: {
  16506. required: true,
  16507. type: "integer"
  16508. },
  16509. org: {
  16510. required: true,
  16511. type: "string"
  16512. }
  16513. },
  16514. url: "/orgs/:org/migrations/:migration_id/archive"
  16515. },
  16516. downloadArchiveForOrg: {
  16517. headers: {
  16518. accept: "application/vnd.github.wyandotte-preview+json"
  16519. },
  16520. method: "GET",
  16521. params: {
  16522. migration_id: {
  16523. required: true,
  16524. type: "integer"
  16525. },
  16526. org: {
  16527. required: true,
  16528. type: "string"
  16529. }
  16530. },
  16531. url: "/orgs/:org/migrations/:migration_id/archive"
  16532. },
  16533. getArchiveForAuthenticatedUser: {
  16534. headers: {
  16535. accept: "application/vnd.github.wyandotte-preview+json"
  16536. },
  16537. method: "GET",
  16538. params: {
  16539. migration_id: {
  16540. required: true,
  16541. type: "integer"
  16542. }
  16543. },
  16544. url: "/user/migrations/:migration_id/archive"
  16545. },
  16546. getArchiveForOrg: {
  16547. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16548. headers: {
  16549. accept: "application/vnd.github.wyandotte-preview+json"
  16550. },
  16551. method: "GET",
  16552. params: {
  16553. migration_id: {
  16554. required: true,
  16555. type: "integer"
  16556. },
  16557. org: {
  16558. required: true,
  16559. type: "string"
  16560. }
  16561. },
  16562. url: "/orgs/:org/migrations/:migration_id/archive"
  16563. },
  16564. getCommitAuthors: {
  16565. method: "GET",
  16566. params: {
  16567. owner: {
  16568. required: true,
  16569. type: "string"
  16570. },
  16571. repo: {
  16572. required: true,
  16573. type: "string"
  16574. },
  16575. since: {
  16576. type: "string"
  16577. }
  16578. },
  16579. url: "/repos/:owner/:repo/import/authors"
  16580. },
  16581. getImportProgress: {
  16582. method: "GET",
  16583. params: {
  16584. owner: {
  16585. required: true,
  16586. type: "string"
  16587. },
  16588. repo: {
  16589. required: true,
  16590. type: "string"
  16591. }
  16592. },
  16593. url: "/repos/:owner/:repo/import"
  16594. },
  16595. getLargeFiles: {
  16596. method: "GET",
  16597. params: {
  16598. owner: {
  16599. required: true,
  16600. type: "string"
  16601. },
  16602. repo: {
  16603. required: true,
  16604. type: "string"
  16605. }
  16606. },
  16607. url: "/repos/:owner/:repo/import/large_files"
  16608. },
  16609. getStatusForAuthenticatedUser: {
  16610. headers: {
  16611. accept: "application/vnd.github.wyandotte-preview+json"
  16612. },
  16613. method: "GET",
  16614. params: {
  16615. migration_id: {
  16616. required: true,
  16617. type: "integer"
  16618. }
  16619. },
  16620. url: "/user/migrations/:migration_id"
  16621. },
  16622. getStatusForOrg: {
  16623. headers: {
  16624. accept: "application/vnd.github.wyandotte-preview+json"
  16625. },
  16626. method: "GET",
  16627. params: {
  16628. migration_id: {
  16629. required: true,
  16630. type: "integer"
  16631. },
  16632. org: {
  16633. required: true,
  16634. type: "string"
  16635. }
  16636. },
  16637. url: "/orgs/:org/migrations/:migration_id"
  16638. },
  16639. listForAuthenticatedUser: {
  16640. headers: {
  16641. accept: "application/vnd.github.wyandotte-preview+json"
  16642. },
  16643. method: "GET",
  16644. params: {
  16645. page: {
  16646. type: "integer"
  16647. },
  16648. per_page: {
  16649. type: "integer"
  16650. }
  16651. },
  16652. url: "/user/migrations"
  16653. },
  16654. listForOrg: {
  16655. headers: {
  16656. accept: "application/vnd.github.wyandotte-preview+json"
  16657. },
  16658. method: "GET",
  16659. params: {
  16660. org: {
  16661. required: true,
  16662. type: "string"
  16663. },
  16664. page: {
  16665. type: "integer"
  16666. },
  16667. per_page: {
  16668. type: "integer"
  16669. }
  16670. },
  16671. url: "/orgs/:org/migrations"
  16672. },
  16673. listReposForOrg: {
  16674. headers: {
  16675. accept: "application/vnd.github.wyandotte-preview+json"
  16676. },
  16677. method: "GET",
  16678. params: {
  16679. migration_id: {
  16680. required: true,
  16681. type: "integer"
  16682. },
  16683. org: {
  16684. required: true,
  16685. type: "string"
  16686. },
  16687. page: {
  16688. type: "integer"
  16689. },
  16690. per_page: {
  16691. type: "integer"
  16692. }
  16693. },
  16694. url: "/orgs/:org/migrations/:migration_id/repositories"
  16695. },
  16696. listReposForUser: {
  16697. headers: {
  16698. accept: "application/vnd.github.wyandotte-preview+json"
  16699. },
  16700. method: "GET",
  16701. params: {
  16702. migration_id: {
  16703. required: true,
  16704. type: "integer"
  16705. },
  16706. page: {
  16707. type: "integer"
  16708. },
  16709. per_page: {
  16710. type: "integer"
  16711. }
  16712. },
  16713. url: "/user/:migration_id/repositories"
  16714. },
  16715. mapCommitAuthor: {
  16716. method: "PATCH",
  16717. params: {
  16718. author_id: {
  16719. required: true,
  16720. type: "integer"
  16721. },
  16722. email: {
  16723. type: "string"
  16724. },
  16725. name: {
  16726. type: "string"
  16727. },
  16728. owner: {
  16729. required: true,
  16730. type: "string"
  16731. },
  16732. repo: {
  16733. required: true,
  16734. type: "string"
  16735. }
  16736. },
  16737. url: "/repos/:owner/:repo/import/authors/:author_id"
  16738. },
  16739. setLfsPreference: {
  16740. method: "PATCH",
  16741. params: {
  16742. owner: {
  16743. required: true,
  16744. type: "string"
  16745. },
  16746. repo: {
  16747. required: true,
  16748. type: "string"
  16749. },
  16750. use_lfs: {
  16751. enum: ["opt_in", "opt_out"],
  16752. required: true,
  16753. type: "string"
  16754. }
  16755. },
  16756. url: "/repos/:owner/:repo/import/lfs"
  16757. },
  16758. startForAuthenticatedUser: {
  16759. method: "POST",
  16760. params: {
  16761. exclude_attachments: {
  16762. type: "boolean"
  16763. },
  16764. lock_repositories: {
  16765. type: "boolean"
  16766. },
  16767. repositories: {
  16768. required: true,
  16769. type: "string[]"
  16770. }
  16771. },
  16772. url: "/user/migrations"
  16773. },
  16774. startForOrg: {
  16775. method: "POST",
  16776. params: {
  16777. exclude_attachments: {
  16778. type: "boolean"
  16779. },
  16780. lock_repositories: {
  16781. type: "boolean"
  16782. },
  16783. org: {
  16784. required: true,
  16785. type: "string"
  16786. },
  16787. repositories: {
  16788. required: true,
  16789. type: "string[]"
  16790. }
  16791. },
  16792. url: "/orgs/:org/migrations"
  16793. },
  16794. startImport: {
  16795. method: "PUT",
  16796. params: {
  16797. owner: {
  16798. required: true,
  16799. type: "string"
  16800. },
  16801. repo: {
  16802. required: true,
  16803. type: "string"
  16804. },
  16805. tfvc_project: {
  16806. type: "string"
  16807. },
  16808. vcs: {
  16809. enum: ["subversion", "git", "mercurial", "tfvc"],
  16810. type: "string"
  16811. },
  16812. vcs_password: {
  16813. type: "string"
  16814. },
  16815. vcs_url: {
  16816. required: true,
  16817. type: "string"
  16818. },
  16819. vcs_username: {
  16820. type: "string"
  16821. }
  16822. },
  16823. url: "/repos/:owner/:repo/import"
  16824. },
  16825. unlockRepoForAuthenticatedUser: {
  16826. headers: {
  16827. accept: "application/vnd.github.wyandotte-preview+json"
  16828. },
  16829. method: "DELETE",
  16830. params: {
  16831. migration_id: {
  16832. required: true,
  16833. type: "integer"
  16834. },
  16835. repo_name: {
  16836. required: true,
  16837. type: "string"
  16838. }
  16839. },
  16840. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  16841. },
  16842. unlockRepoForOrg: {
  16843. headers: {
  16844. accept: "application/vnd.github.wyandotte-preview+json"
  16845. },
  16846. method: "DELETE",
  16847. params: {
  16848. migration_id: {
  16849. required: true,
  16850. type: "integer"
  16851. },
  16852. org: {
  16853. required: true,
  16854. type: "string"
  16855. },
  16856. repo_name: {
  16857. required: true,
  16858. type: "string"
  16859. }
  16860. },
  16861. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  16862. },
  16863. updateImport: {
  16864. method: "PATCH",
  16865. params: {
  16866. owner: {
  16867. required: true,
  16868. type: "string"
  16869. },
  16870. repo: {
  16871. required: true,
  16872. type: "string"
  16873. },
  16874. vcs_password: {
  16875. type: "string"
  16876. },
  16877. vcs_username: {
  16878. type: "string"
  16879. }
  16880. },
  16881. url: "/repos/:owner/:repo/import"
  16882. }
  16883. },
  16884. oauthAuthorizations: {
  16885. checkAuthorization: {
  16886. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  16887. method: "GET",
  16888. params: {
  16889. access_token: {
  16890. required: true,
  16891. type: "string"
  16892. },
  16893. client_id: {
  16894. required: true,
  16895. type: "string"
  16896. }
  16897. },
  16898. url: "/applications/:client_id/tokens/:access_token"
  16899. },
  16900. createAuthorization: {
  16901. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  16902. method: "POST",
  16903. params: {
  16904. client_id: {
  16905. type: "string"
  16906. },
  16907. client_secret: {
  16908. type: "string"
  16909. },
  16910. fingerprint: {
  16911. type: "string"
  16912. },
  16913. note: {
  16914. required: true,
  16915. type: "string"
  16916. },
  16917. note_url: {
  16918. type: "string"
  16919. },
  16920. scopes: {
  16921. type: "string[]"
  16922. }
  16923. },
  16924. url: "/authorizations"
  16925. },
  16926. deleteAuthorization: {
  16927. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  16928. method: "DELETE",
  16929. params: {
  16930. authorization_id: {
  16931. required: true,
  16932. type: "integer"
  16933. }
  16934. },
  16935. url: "/authorizations/:authorization_id"
  16936. },
  16937. deleteGrant: {
  16938. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  16939. method: "DELETE",
  16940. params: {
  16941. grant_id: {
  16942. required: true,
  16943. type: "integer"
  16944. }
  16945. },
  16946. url: "/applications/grants/:grant_id"
  16947. },
  16948. getAuthorization: {
  16949. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  16950. method: "GET",
  16951. params: {
  16952. authorization_id: {
  16953. required: true,
  16954. type: "integer"
  16955. }
  16956. },
  16957. url: "/authorizations/:authorization_id"
  16958. },
  16959. getGrant: {
  16960. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  16961. method: "GET",
  16962. params: {
  16963. grant_id: {
  16964. required: true,
  16965. type: "integer"
  16966. }
  16967. },
  16968. url: "/applications/grants/:grant_id"
  16969. },
  16970. getOrCreateAuthorizationForApp: {
  16971. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  16972. method: "PUT",
  16973. params: {
  16974. client_id: {
  16975. required: true,
  16976. type: "string"
  16977. },
  16978. client_secret: {
  16979. required: true,
  16980. type: "string"
  16981. },
  16982. fingerprint: {
  16983. type: "string"
  16984. },
  16985. note: {
  16986. type: "string"
  16987. },
  16988. note_url: {
  16989. type: "string"
  16990. },
  16991. scopes: {
  16992. type: "string[]"
  16993. }
  16994. },
  16995. url: "/authorizations/clients/:client_id"
  16996. },
  16997. getOrCreateAuthorizationForAppAndFingerprint: {
  16998. 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",
  16999. method: "PUT",
  17000. params: {
  17001. client_id: {
  17002. required: true,
  17003. type: "string"
  17004. },
  17005. client_secret: {
  17006. required: true,
  17007. type: "string"
  17008. },
  17009. fingerprint: {
  17010. required: true,
  17011. type: "string"
  17012. },
  17013. note: {
  17014. type: "string"
  17015. },
  17016. note_url: {
  17017. type: "string"
  17018. },
  17019. scopes: {
  17020. type: "string[]"
  17021. }
  17022. },
  17023. url: "/authorizations/clients/:client_id/:fingerprint"
  17024. },
  17025. getOrCreateAuthorizationForAppFingerprint: {
  17026. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17027. method: "PUT",
  17028. params: {
  17029. client_id: {
  17030. required: true,
  17031. type: "string"
  17032. },
  17033. client_secret: {
  17034. required: true,
  17035. type: "string"
  17036. },
  17037. fingerprint: {
  17038. required: true,
  17039. type: "string"
  17040. },
  17041. note: {
  17042. type: "string"
  17043. },
  17044. note_url: {
  17045. type: "string"
  17046. },
  17047. scopes: {
  17048. type: "string[]"
  17049. }
  17050. },
  17051. url: "/authorizations/clients/:client_id/:fingerprint"
  17052. },
  17053. listAuthorizations: {
  17054. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17055. method: "GET",
  17056. params: {
  17057. page: {
  17058. type: "integer"
  17059. },
  17060. per_page: {
  17061. type: "integer"
  17062. }
  17063. },
  17064. url: "/authorizations"
  17065. },
  17066. listGrants: {
  17067. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17068. method: "GET",
  17069. params: {
  17070. page: {
  17071. type: "integer"
  17072. },
  17073. per_page: {
  17074. type: "integer"
  17075. }
  17076. },
  17077. url: "/applications/grants"
  17078. },
  17079. resetAuthorization: {
  17080. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17081. method: "POST",
  17082. params: {
  17083. access_token: {
  17084. required: true,
  17085. type: "string"
  17086. },
  17087. client_id: {
  17088. required: true,
  17089. type: "string"
  17090. }
  17091. },
  17092. url: "/applications/:client_id/tokens/:access_token"
  17093. },
  17094. revokeAuthorizationForApplication: {
  17095. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17096. method: "DELETE",
  17097. params: {
  17098. access_token: {
  17099. required: true,
  17100. type: "string"
  17101. },
  17102. client_id: {
  17103. required: true,
  17104. type: "string"
  17105. }
  17106. },
  17107. url: "/applications/:client_id/tokens/:access_token"
  17108. },
  17109. revokeGrantForApplication: {
  17110. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17111. method: "DELETE",
  17112. params: {
  17113. access_token: {
  17114. required: true,
  17115. type: "string"
  17116. },
  17117. client_id: {
  17118. required: true,
  17119. type: "string"
  17120. }
  17121. },
  17122. url: "/applications/:client_id/grants/:access_token"
  17123. },
  17124. updateAuthorization: {
  17125. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17126. method: "PATCH",
  17127. params: {
  17128. add_scopes: {
  17129. type: "string[]"
  17130. },
  17131. authorization_id: {
  17132. required: true,
  17133. type: "integer"
  17134. },
  17135. fingerprint: {
  17136. type: "string"
  17137. },
  17138. note: {
  17139. type: "string"
  17140. },
  17141. note_url: {
  17142. type: "string"
  17143. },
  17144. remove_scopes: {
  17145. type: "string[]"
  17146. },
  17147. scopes: {
  17148. type: "string[]"
  17149. }
  17150. },
  17151. url: "/authorizations/:authorization_id"
  17152. }
  17153. },
  17154. orgs: {
  17155. addOrUpdateMembership: {
  17156. method: "PUT",
  17157. params: {
  17158. org: {
  17159. required: true,
  17160. type: "string"
  17161. },
  17162. role: {
  17163. enum: ["admin", "member"],
  17164. type: "string"
  17165. },
  17166. username: {
  17167. required: true,
  17168. type: "string"
  17169. }
  17170. },
  17171. url: "/orgs/:org/memberships/:username"
  17172. },
  17173. blockUser: {
  17174. method: "PUT",
  17175. params: {
  17176. org: {
  17177. required: true,
  17178. type: "string"
  17179. },
  17180. username: {
  17181. required: true,
  17182. type: "string"
  17183. }
  17184. },
  17185. url: "/orgs/:org/blocks/:username"
  17186. },
  17187. checkBlockedUser: {
  17188. method: "GET",
  17189. params: {
  17190. org: {
  17191. required: true,
  17192. type: "string"
  17193. },
  17194. username: {
  17195. required: true,
  17196. type: "string"
  17197. }
  17198. },
  17199. url: "/orgs/:org/blocks/:username"
  17200. },
  17201. checkMembership: {
  17202. method: "GET",
  17203. params: {
  17204. org: {
  17205. required: true,
  17206. type: "string"
  17207. },
  17208. username: {
  17209. required: true,
  17210. type: "string"
  17211. }
  17212. },
  17213. url: "/orgs/:org/members/:username"
  17214. },
  17215. checkPublicMembership: {
  17216. method: "GET",
  17217. params: {
  17218. org: {
  17219. required: true,
  17220. type: "string"
  17221. },
  17222. username: {
  17223. required: true,
  17224. type: "string"
  17225. }
  17226. },
  17227. url: "/orgs/:org/public_members/:username"
  17228. },
  17229. concealMembership: {
  17230. method: "DELETE",
  17231. params: {
  17232. org: {
  17233. required: true,
  17234. type: "string"
  17235. },
  17236. username: {
  17237. required: true,
  17238. type: "string"
  17239. }
  17240. },
  17241. url: "/orgs/:org/public_members/:username"
  17242. },
  17243. convertMemberToOutsideCollaborator: {
  17244. method: "PUT",
  17245. params: {
  17246. org: {
  17247. required: true,
  17248. type: "string"
  17249. },
  17250. username: {
  17251. required: true,
  17252. type: "string"
  17253. }
  17254. },
  17255. url: "/orgs/:org/outside_collaborators/:username"
  17256. },
  17257. createHook: {
  17258. method: "POST",
  17259. params: {
  17260. active: {
  17261. type: "boolean"
  17262. },
  17263. config: {
  17264. required: true,
  17265. type: "object"
  17266. },
  17267. "config.content_type": {
  17268. type: "string"
  17269. },
  17270. "config.insecure_ssl": {
  17271. type: "string"
  17272. },
  17273. "config.secret": {
  17274. type: "string"
  17275. },
  17276. "config.url": {
  17277. required: true,
  17278. type: "string"
  17279. },
  17280. events: {
  17281. type: "string[]"
  17282. },
  17283. name: {
  17284. required: true,
  17285. type: "string"
  17286. },
  17287. org: {
  17288. required: true,
  17289. type: "string"
  17290. }
  17291. },
  17292. url: "/orgs/:org/hooks"
  17293. },
  17294. createInvitation: {
  17295. method: "POST",
  17296. params: {
  17297. email: {
  17298. type: "string"
  17299. },
  17300. invitee_id: {
  17301. type: "integer"
  17302. },
  17303. org: {
  17304. required: true,
  17305. type: "string"
  17306. },
  17307. role: {
  17308. enum: ["admin", "direct_member", "billing_manager"],
  17309. type: "string"
  17310. },
  17311. team_ids: {
  17312. type: "integer[]"
  17313. }
  17314. },
  17315. url: "/orgs/:org/invitations"
  17316. },
  17317. deleteHook: {
  17318. method: "DELETE",
  17319. params: {
  17320. hook_id: {
  17321. required: true,
  17322. type: "integer"
  17323. },
  17324. org: {
  17325. required: true,
  17326. type: "string"
  17327. }
  17328. },
  17329. url: "/orgs/:org/hooks/:hook_id"
  17330. },
  17331. get: {
  17332. method: "GET",
  17333. params: {
  17334. org: {
  17335. required: true,
  17336. type: "string"
  17337. }
  17338. },
  17339. url: "/orgs/:org"
  17340. },
  17341. getHook: {
  17342. method: "GET",
  17343. params: {
  17344. hook_id: {
  17345. required: true,
  17346. type: "integer"
  17347. },
  17348. org: {
  17349. required: true,
  17350. type: "string"
  17351. }
  17352. },
  17353. url: "/orgs/:org/hooks/:hook_id"
  17354. },
  17355. getMembership: {
  17356. method: "GET",
  17357. params: {
  17358. org: {
  17359. required: true,
  17360. type: "string"
  17361. },
  17362. username: {
  17363. required: true,
  17364. type: "string"
  17365. }
  17366. },
  17367. url: "/orgs/:org/memberships/:username"
  17368. },
  17369. getMembershipForAuthenticatedUser: {
  17370. method: "GET",
  17371. params: {
  17372. org: {
  17373. required: true,
  17374. type: "string"
  17375. }
  17376. },
  17377. url: "/user/memberships/orgs/:org"
  17378. },
  17379. list: {
  17380. method: "GET",
  17381. params: {
  17382. page: {
  17383. type: "integer"
  17384. },
  17385. per_page: {
  17386. type: "integer"
  17387. },
  17388. since: {
  17389. type: "integer"
  17390. }
  17391. },
  17392. url: "/organizations"
  17393. },
  17394. listBlockedUsers: {
  17395. method: "GET",
  17396. params: {
  17397. org: {
  17398. required: true,
  17399. type: "string"
  17400. }
  17401. },
  17402. url: "/orgs/:org/blocks"
  17403. },
  17404. listForAuthenticatedUser: {
  17405. method: "GET",
  17406. params: {
  17407. page: {
  17408. type: "integer"
  17409. },
  17410. per_page: {
  17411. type: "integer"
  17412. }
  17413. },
  17414. url: "/user/orgs"
  17415. },
  17416. listForUser: {
  17417. method: "GET",
  17418. params: {
  17419. page: {
  17420. type: "integer"
  17421. },
  17422. per_page: {
  17423. type: "integer"
  17424. },
  17425. username: {
  17426. required: true,
  17427. type: "string"
  17428. }
  17429. },
  17430. url: "/users/:username/orgs"
  17431. },
  17432. listHooks: {
  17433. method: "GET",
  17434. params: {
  17435. org: {
  17436. required: true,
  17437. type: "string"
  17438. },
  17439. page: {
  17440. type: "integer"
  17441. },
  17442. per_page: {
  17443. type: "integer"
  17444. }
  17445. },
  17446. url: "/orgs/:org/hooks"
  17447. },
  17448. listInstallations: {
  17449. headers: {
  17450. accept: "application/vnd.github.machine-man-preview+json"
  17451. },
  17452. method: "GET",
  17453. params: {
  17454. org: {
  17455. required: true,
  17456. type: "string"
  17457. },
  17458. page: {
  17459. type: "integer"
  17460. },
  17461. per_page: {
  17462. type: "integer"
  17463. }
  17464. },
  17465. url: "/orgs/:org/installations"
  17466. },
  17467. listInvitationTeams: {
  17468. method: "GET",
  17469. params: {
  17470. invitation_id: {
  17471. required: true,
  17472. type: "integer"
  17473. },
  17474. org: {
  17475. required: true,
  17476. type: "string"
  17477. },
  17478. page: {
  17479. type: "integer"
  17480. },
  17481. per_page: {
  17482. type: "integer"
  17483. }
  17484. },
  17485. url: "/orgs/:org/invitations/:invitation_id/teams"
  17486. },
  17487. listMembers: {
  17488. method: "GET",
  17489. params: {
  17490. filter: {
  17491. enum: ["2fa_disabled", "all"],
  17492. type: "string"
  17493. },
  17494. org: {
  17495. required: true,
  17496. type: "string"
  17497. },
  17498. page: {
  17499. type: "integer"
  17500. },
  17501. per_page: {
  17502. type: "integer"
  17503. },
  17504. role: {
  17505. enum: ["all", "admin", "member"],
  17506. type: "string"
  17507. }
  17508. },
  17509. url: "/orgs/:org/members"
  17510. },
  17511. listMemberships: {
  17512. method: "GET",
  17513. params: {
  17514. page: {
  17515. type: "integer"
  17516. },
  17517. per_page: {
  17518. type: "integer"
  17519. },
  17520. state: {
  17521. enum: ["active", "pending"],
  17522. type: "string"
  17523. }
  17524. },
  17525. url: "/user/memberships/orgs"
  17526. },
  17527. listOutsideCollaborators: {
  17528. method: "GET",
  17529. params: {
  17530. filter: {
  17531. enum: ["2fa_disabled", "all"],
  17532. type: "string"
  17533. },
  17534. org: {
  17535. required: true,
  17536. type: "string"
  17537. },
  17538. page: {
  17539. type: "integer"
  17540. },
  17541. per_page: {
  17542. type: "integer"
  17543. }
  17544. },
  17545. url: "/orgs/:org/outside_collaborators"
  17546. },
  17547. listPendingInvitations: {
  17548. method: "GET",
  17549. params: {
  17550. org: {
  17551. required: true,
  17552. type: "string"
  17553. },
  17554. page: {
  17555. type: "integer"
  17556. },
  17557. per_page: {
  17558. type: "integer"
  17559. }
  17560. },
  17561. url: "/orgs/:org/invitations"
  17562. },
  17563. listPublicMembers: {
  17564. method: "GET",
  17565. params: {
  17566. org: {
  17567. required: true,
  17568. type: "string"
  17569. },
  17570. page: {
  17571. type: "integer"
  17572. },
  17573. per_page: {
  17574. type: "integer"
  17575. }
  17576. },
  17577. url: "/orgs/:org/public_members"
  17578. },
  17579. pingHook: {
  17580. method: "POST",
  17581. params: {
  17582. hook_id: {
  17583. required: true,
  17584. type: "integer"
  17585. },
  17586. org: {
  17587. required: true,
  17588. type: "string"
  17589. }
  17590. },
  17591. url: "/orgs/:org/hooks/:hook_id/pings"
  17592. },
  17593. publicizeMembership: {
  17594. method: "PUT",
  17595. params: {
  17596. org: {
  17597. required: true,
  17598. type: "string"
  17599. },
  17600. username: {
  17601. required: true,
  17602. type: "string"
  17603. }
  17604. },
  17605. url: "/orgs/:org/public_members/:username"
  17606. },
  17607. removeMember: {
  17608. method: "DELETE",
  17609. params: {
  17610. org: {
  17611. required: true,
  17612. type: "string"
  17613. },
  17614. username: {
  17615. required: true,
  17616. type: "string"
  17617. }
  17618. },
  17619. url: "/orgs/:org/members/:username"
  17620. },
  17621. removeMembership: {
  17622. method: "DELETE",
  17623. params: {
  17624. org: {
  17625. required: true,
  17626. type: "string"
  17627. },
  17628. username: {
  17629. required: true,
  17630. type: "string"
  17631. }
  17632. },
  17633. url: "/orgs/:org/memberships/:username"
  17634. },
  17635. removeOutsideCollaborator: {
  17636. method: "DELETE",
  17637. params: {
  17638. org: {
  17639. required: true,
  17640. type: "string"
  17641. },
  17642. username: {
  17643. required: true,
  17644. type: "string"
  17645. }
  17646. },
  17647. url: "/orgs/:org/outside_collaborators/:username"
  17648. },
  17649. unblockUser: {
  17650. method: "DELETE",
  17651. params: {
  17652. org: {
  17653. required: true,
  17654. type: "string"
  17655. },
  17656. username: {
  17657. required: true,
  17658. type: "string"
  17659. }
  17660. },
  17661. url: "/orgs/:org/blocks/:username"
  17662. },
  17663. update: {
  17664. method: "PATCH",
  17665. params: {
  17666. billing_email: {
  17667. type: "string"
  17668. },
  17669. company: {
  17670. type: "string"
  17671. },
  17672. default_repository_permission: {
  17673. enum: ["read", "write", "admin", "none"],
  17674. type: "string"
  17675. },
  17676. description: {
  17677. type: "string"
  17678. },
  17679. email: {
  17680. type: "string"
  17681. },
  17682. has_organization_projects: {
  17683. type: "boolean"
  17684. },
  17685. has_repository_projects: {
  17686. type: "boolean"
  17687. },
  17688. location: {
  17689. type: "string"
  17690. },
  17691. members_allowed_repository_creation_type: {
  17692. enum: ["all", "private", "none"],
  17693. type: "string"
  17694. },
  17695. members_can_create_internal_repositories: {
  17696. type: "boolean"
  17697. },
  17698. members_can_create_private_repositories: {
  17699. type: "boolean"
  17700. },
  17701. members_can_create_public_repositories: {
  17702. type: "boolean"
  17703. },
  17704. members_can_create_repositories: {
  17705. type: "boolean"
  17706. },
  17707. name: {
  17708. type: "string"
  17709. },
  17710. org: {
  17711. required: true,
  17712. type: "string"
  17713. }
  17714. },
  17715. url: "/orgs/:org"
  17716. },
  17717. updateHook: {
  17718. method: "PATCH",
  17719. params: {
  17720. active: {
  17721. type: "boolean"
  17722. },
  17723. config: {
  17724. type: "object"
  17725. },
  17726. "config.content_type": {
  17727. type: "string"
  17728. },
  17729. "config.insecure_ssl": {
  17730. type: "string"
  17731. },
  17732. "config.secret": {
  17733. type: "string"
  17734. },
  17735. "config.url": {
  17736. required: true,
  17737. type: "string"
  17738. },
  17739. events: {
  17740. type: "string[]"
  17741. },
  17742. hook_id: {
  17743. required: true,
  17744. type: "integer"
  17745. },
  17746. org: {
  17747. required: true,
  17748. type: "string"
  17749. }
  17750. },
  17751. url: "/orgs/:org/hooks/:hook_id"
  17752. },
  17753. updateMembership: {
  17754. method: "PATCH",
  17755. params: {
  17756. org: {
  17757. required: true,
  17758. type: "string"
  17759. },
  17760. state: {
  17761. enum: ["active"],
  17762. required: true,
  17763. type: "string"
  17764. }
  17765. },
  17766. url: "/user/memberships/orgs/:org"
  17767. }
  17768. },
  17769. projects: {
  17770. addCollaborator: {
  17771. headers: {
  17772. accept: "application/vnd.github.inertia-preview+json"
  17773. },
  17774. method: "PUT",
  17775. params: {
  17776. permission: {
  17777. enum: ["read", "write", "admin"],
  17778. type: "string"
  17779. },
  17780. project_id: {
  17781. required: true,
  17782. type: "integer"
  17783. },
  17784. username: {
  17785. required: true,
  17786. type: "string"
  17787. }
  17788. },
  17789. url: "/projects/:project_id/collaborators/:username"
  17790. },
  17791. createCard: {
  17792. headers: {
  17793. accept: "application/vnd.github.inertia-preview+json"
  17794. },
  17795. method: "POST",
  17796. params: {
  17797. column_id: {
  17798. required: true,
  17799. type: "integer"
  17800. },
  17801. content_id: {
  17802. type: "integer"
  17803. },
  17804. content_type: {
  17805. type: "string"
  17806. },
  17807. note: {
  17808. type: "string"
  17809. }
  17810. },
  17811. url: "/projects/columns/:column_id/cards"
  17812. },
  17813. createColumn: {
  17814. headers: {
  17815. accept: "application/vnd.github.inertia-preview+json"
  17816. },
  17817. method: "POST",
  17818. params: {
  17819. name: {
  17820. required: true,
  17821. type: "string"
  17822. },
  17823. project_id: {
  17824. required: true,
  17825. type: "integer"
  17826. }
  17827. },
  17828. url: "/projects/:project_id/columns"
  17829. },
  17830. createForAuthenticatedUser: {
  17831. headers: {
  17832. accept: "application/vnd.github.inertia-preview+json"
  17833. },
  17834. method: "POST",
  17835. params: {
  17836. body: {
  17837. type: "string"
  17838. },
  17839. name: {
  17840. required: true,
  17841. type: "string"
  17842. }
  17843. },
  17844. url: "/user/projects"
  17845. },
  17846. createForOrg: {
  17847. headers: {
  17848. accept: "application/vnd.github.inertia-preview+json"
  17849. },
  17850. method: "POST",
  17851. params: {
  17852. body: {
  17853. type: "string"
  17854. },
  17855. name: {
  17856. required: true,
  17857. type: "string"
  17858. },
  17859. org: {
  17860. required: true,
  17861. type: "string"
  17862. }
  17863. },
  17864. url: "/orgs/:org/projects"
  17865. },
  17866. createForRepo: {
  17867. headers: {
  17868. accept: "application/vnd.github.inertia-preview+json"
  17869. },
  17870. method: "POST",
  17871. params: {
  17872. body: {
  17873. type: "string"
  17874. },
  17875. name: {
  17876. required: true,
  17877. type: "string"
  17878. },
  17879. owner: {
  17880. required: true,
  17881. type: "string"
  17882. },
  17883. repo: {
  17884. required: true,
  17885. type: "string"
  17886. }
  17887. },
  17888. url: "/repos/:owner/:repo/projects"
  17889. },
  17890. delete: {
  17891. headers: {
  17892. accept: "application/vnd.github.inertia-preview+json"
  17893. },
  17894. method: "DELETE",
  17895. params: {
  17896. project_id: {
  17897. required: true,
  17898. type: "integer"
  17899. }
  17900. },
  17901. url: "/projects/:project_id"
  17902. },
  17903. deleteCard: {
  17904. headers: {
  17905. accept: "application/vnd.github.inertia-preview+json"
  17906. },
  17907. method: "DELETE",
  17908. params: {
  17909. card_id: {
  17910. required: true,
  17911. type: "integer"
  17912. }
  17913. },
  17914. url: "/projects/columns/cards/:card_id"
  17915. },
  17916. deleteColumn: {
  17917. headers: {
  17918. accept: "application/vnd.github.inertia-preview+json"
  17919. },
  17920. method: "DELETE",
  17921. params: {
  17922. column_id: {
  17923. required: true,
  17924. type: "integer"
  17925. }
  17926. },
  17927. url: "/projects/columns/:column_id"
  17928. },
  17929. get: {
  17930. headers: {
  17931. accept: "application/vnd.github.inertia-preview+json"
  17932. },
  17933. method: "GET",
  17934. params: {
  17935. project_id: {
  17936. required: true,
  17937. type: "integer"
  17938. }
  17939. },
  17940. url: "/projects/:project_id"
  17941. },
  17942. getCard: {
  17943. headers: {
  17944. accept: "application/vnd.github.inertia-preview+json"
  17945. },
  17946. method: "GET",
  17947. params: {
  17948. card_id: {
  17949. required: true,
  17950. type: "integer"
  17951. }
  17952. },
  17953. url: "/projects/columns/cards/:card_id"
  17954. },
  17955. getColumn: {
  17956. headers: {
  17957. accept: "application/vnd.github.inertia-preview+json"
  17958. },
  17959. method: "GET",
  17960. params: {
  17961. column_id: {
  17962. required: true,
  17963. type: "integer"
  17964. }
  17965. },
  17966. url: "/projects/columns/:column_id"
  17967. },
  17968. listCards: {
  17969. headers: {
  17970. accept: "application/vnd.github.inertia-preview+json"
  17971. },
  17972. method: "GET",
  17973. params: {
  17974. archived_state: {
  17975. enum: ["all", "archived", "not_archived"],
  17976. type: "string"
  17977. },
  17978. column_id: {
  17979. required: true,
  17980. type: "integer"
  17981. },
  17982. page: {
  17983. type: "integer"
  17984. },
  17985. per_page: {
  17986. type: "integer"
  17987. }
  17988. },
  17989. url: "/projects/columns/:column_id/cards"
  17990. },
  17991. listCollaborators: {
  17992. headers: {
  17993. accept: "application/vnd.github.inertia-preview+json"
  17994. },
  17995. method: "GET",
  17996. params: {
  17997. affiliation: {
  17998. enum: ["outside", "direct", "all"],
  17999. type: "string"
  18000. },
  18001. page: {
  18002. type: "integer"
  18003. },
  18004. per_page: {
  18005. type: "integer"
  18006. },
  18007. project_id: {
  18008. required: true,
  18009. type: "integer"
  18010. }
  18011. },
  18012. url: "/projects/:project_id/collaborators"
  18013. },
  18014. listColumns: {
  18015. headers: {
  18016. accept: "application/vnd.github.inertia-preview+json"
  18017. },
  18018. method: "GET",
  18019. params: {
  18020. page: {
  18021. type: "integer"
  18022. },
  18023. per_page: {
  18024. type: "integer"
  18025. },
  18026. project_id: {
  18027. required: true,
  18028. type: "integer"
  18029. }
  18030. },
  18031. url: "/projects/:project_id/columns"
  18032. },
  18033. listForOrg: {
  18034. headers: {
  18035. accept: "application/vnd.github.inertia-preview+json"
  18036. },
  18037. method: "GET",
  18038. params: {
  18039. org: {
  18040. required: true,
  18041. type: "string"
  18042. },
  18043. page: {
  18044. type: "integer"
  18045. },
  18046. per_page: {
  18047. type: "integer"
  18048. },
  18049. state: {
  18050. enum: ["open", "closed", "all"],
  18051. type: "string"
  18052. }
  18053. },
  18054. url: "/orgs/:org/projects"
  18055. },
  18056. listForRepo: {
  18057. headers: {
  18058. accept: "application/vnd.github.inertia-preview+json"
  18059. },
  18060. method: "GET",
  18061. params: {
  18062. owner: {
  18063. required: true,
  18064. type: "string"
  18065. },
  18066. page: {
  18067. type: "integer"
  18068. },
  18069. per_page: {
  18070. type: "integer"
  18071. },
  18072. repo: {
  18073. required: true,
  18074. type: "string"
  18075. },
  18076. state: {
  18077. enum: ["open", "closed", "all"],
  18078. type: "string"
  18079. }
  18080. },
  18081. url: "/repos/:owner/:repo/projects"
  18082. },
  18083. listForUser: {
  18084. headers: {
  18085. accept: "application/vnd.github.inertia-preview+json"
  18086. },
  18087. method: "GET",
  18088. params: {
  18089. page: {
  18090. type: "integer"
  18091. },
  18092. per_page: {
  18093. type: "integer"
  18094. },
  18095. state: {
  18096. enum: ["open", "closed", "all"],
  18097. type: "string"
  18098. },
  18099. username: {
  18100. required: true,
  18101. type: "string"
  18102. }
  18103. },
  18104. url: "/users/:username/projects"
  18105. },
  18106. moveCard: {
  18107. headers: {
  18108. accept: "application/vnd.github.inertia-preview+json"
  18109. },
  18110. method: "POST",
  18111. params: {
  18112. card_id: {
  18113. required: true,
  18114. type: "integer"
  18115. },
  18116. column_id: {
  18117. type: "integer"
  18118. },
  18119. position: {
  18120. required: true,
  18121. type: "string",
  18122. validation: "^(top|bottom|after:\\d+)$"
  18123. }
  18124. },
  18125. url: "/projects/columns/cards/:card_id/moves"
  18126. },
  18127. moveColumn: {
  18128. headers: {
  18129. accept: "application/vnd.github.inertia-preview+json"
  18130. },
  18131. method: "POST",
  18132. params: {
  18133. column_id: {
  18134. required: true,
  18135. type: "integer"
  18136. },
  18137. position: {
  18138. required: true,
  18139. type: "string",
  18140. validation: "^(first|last|after:\\d+)$"
  18141. }
  18142. },
  18143. url: "/projects/columns/:column_id/moves"
  18144. },
  18145. removeCollaborator: {
  18146. headers: {
  18147. accept: "application/vnd.github.inertia-preview+json"
  18148. },
  18149. method: "DELETE",
  18150. params: {
  18151. project_id: {
  18152. required: true,
  18153. type: "integer"
  18154. },
  18155. username: {
  18156. required: true,
  18157. type: "string"
  18158. }
  18159. },
  18160. url: "/projects/:project_id/collaborators/:username"
  18161. },
  18162. reviewUserPermissionLevel: {
  18163. headers: {
  18164. accept: "application/vnd.github.inertia-preview+json"
  18165. },
  18166. method: "GET",
  18167. params: {
  18168. project_id: {
  18169. required: true,
  18170. type: "integer"
  18171. },
  18172. username: {
  18173. required: true,
  18174. type: "string"
  18175. }
  18176. },
  18177. url: "/projects/:project_id/collaborators/:username/permission"
  18178. },
  18179. update: {
  18180. headers: {
  18181. accept: "application/vnd.github.inertia-preview+json"
  18182. },
  18183. method: "PATCH",
  18184. params: {
  18185. body: {
  18186. type: "string"
  18187. },
  18188. name: {
  18189. type: "string"
  18190. },
  18191. organization_permission: {
  18192. type: "string"
  18193. },
  18194. private: {
  18195. type: "boolean"
  18196. },
  18197. project_id: {
  18198. required: true,
  18199. type: "integer"
  18200. },
  18201. state: {
  18202. enum: ["open", "closed"],
  18203. type: "string"
  18204. }
  18205. },
  18206. url: "/projects/:project_id"
  18207. },
  18208. updateCard: {
  18209. headers: {
  18210. accept: "application/vnd.github.inertia-preview+json"
  18211. },
  18212. method: "PATCH",
  18213. params: {
  18214. archived: {
  18215. type: "boolean"
  18216. },
  18217. card_id: {
  18218. required: true,
  18219. type: "integer"
  18220. },
  18221. note: {
  18222. type: "string"
  18223. }
  18224. },
  18225. url: "/projects/columns/cards/:card_id"
  18226. },
  18227. updateColumn: {
  18228. headers: {
  18229. accept: "application/vnd.github.inertia-preview+json"
  18230. },
  18231. method: "PATCH",
  18232. params: {
  18233. column_id: {
  18234. required: true,
  18235. type: "integer"
  18236. },
  18237. name: {
  18238. required: true,
  18239. type: "string"
  18240. }
  18241. },
  18242. url: "/projects/columns/:column_id"
  18243. }
  18244. },
  18245. pulls: {
  18246. checkIfMerged: {
  18247. method: "GET",
  18248. params: {
  18249. number: {
  18250. alias: "pull_number",
  18251. deprecated: true,
  18252. type: "integer"
  18253. },
  18254. owner: {
  18255. required: true,
  18256. type: "string"
  18257. },
  18258. pull_number: {
  18259. required: true,
  18260. type: "integer"
  18261. },
  18262. repo: {
  18263. required: true,
  18264. type: "string"
  18265. }
  18266. },
  18267. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18268. },
  18269. create: {
  18270. method: "POST",
  18271. params: {
  18272. base: {
  18273. required: true,
  18274. type: "string"
  18275. },
  18276. body: {
  18277. type: "string"
  18278. },
  18279. draft: {
  18280. type: "boolean"
  18281. },
  18282. head: {
  18283. required: true,
  18284. type: "string"
  18285. },
  18286. maintainer_can_modify: {
  18287. type: "boolean"
  18288. },
  18289. owner: {
  18290. required: true,
  18291. type: "string"
  18292. },
  18293. repo: {
  18294. required: true,
  18295. type: "string"
  18296. },
  18297. title: {
  18298. required: true,
  18299. type: "string"
  18300. }
  18301. },
  18302. url: "/repos/:owner/:repo/pulls"
  18303. },
  18304. createComment: {
  18305. method: "POST",
  18306. params: {
  18307. body: {
  18308. required: true,
  18309. type: "string"
  18310. },
  18311. commit_id: {
  18312. required: true,
  18313. type: "string"
  18314. },
  18315. in_reply_to: {
  18316. deprecated: true,
  18317. 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.",
  18318. type: "integer"
  18319. },
  18320. line: {
  18321. type: "integer"
  18322. },
  18323. number: {
  18324. alias: "pull_number",
  18325. deprecated: true,
  18326. type: "integer"
  18327. },
  18328. owner: {
  18329. required: true,
  18330. type: "string"
  18331. },
  18332. path: {
  18333. required: true,
  18334. type: "string"
  18335. },
  18336. position: {
  18337. type: "integer"
  18338. },
  18339. pull_number: {
  18340. required: true,
  18341. type: "integer"
  18342. },
  18343. repo: {
  18344. required: true,
  18345. type: "string"
  18346. },
  18347. side: {
  18348. enum: ["LEFT", "RIGHT"],
  18349. type: "string"
  18350. },
  18351. start_line: {
  18352. type: "integer"
  18353. },
  18354. start_side: {
  18355. enum: ["LEFT", "RIGHT", "side"],
  18356. type: "string"
  18357. }
  18358. },
  18359. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18360. },
  18361. createCommentReply: {
  18362. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18363. method: "POST",
  18364. params: {
  18365. body: {
  18366. required: true,
  18367. type: "string"
  18368. },
  18369. commit_id: {
  18370. required: true,
  18371. type: "string"
  18372. },
  18373. in_reply_to: {
  18374. deprecated: true,
  18375. 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.",
  18376. type: "integer"
  18377. },
  18378. line: {
  18379. type: "integer"
  18380. },
  18381. number: {
  18382. alias: "pull_number",
  18383. deprecated: true,
  18384. type: "integer"
  18385. },
  18386. owner: {
  18387. required: true,
  18388. type: "string"
  18389. },
  18390. path: {
  18391. required: true,
  18392. type: "string"
  18393. },
  18394. position: {
  18395. type: "integer"
  18396. },
  18397. pull_number: {
  18398. required: true,
  18399. type: "integer"
  18400. },
  18401. repo: {
  18402. required: true,
  18403. type: "string"
  18404. },
  18405. side: {
  18406. enum: ["LEFT", "RIGHT"],
  18407. type: "string"
  18408. },
  18409. start_line: {
  18410. type: "integer"
  18411. },
  18412. start_side: {
  18413. enum: ["LEFT", "RIGHT", "side"],
  18414. type: "string"
  18415. }
  18416. },
  18417. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18418. },
  18419. createFromIssue: {
  18420. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18421. method: "POST",
  18422. params: {
  18423. base: {
  18424. required: true,
  18425. type: "string"
  18426. },
  18427. draft: {
  18428. type: "boolean"
  18429. },
  18430. head: {
  18431. required: true,
  18432. type: "string"
  18433. },
  18434. issue: {
  18435. required: true,
  18436. type: "integer"
  18437. },
  18438. maintainer_can_modify: {
  18439. type: "boolean"
  18440. },
  18441. owner: {
  18442. required: true,
  18443. type: "string"
  18444. },
  18445. repo: {
  18446. required: true,
  18447. type: "string"
  18448. }
  18449. },
  18450. url: "/repos/:owner/:repo/pulls"
  18451. },
  18452. createReview: {
  18453. method: "POST",
  18454. params: {
  18455. body: {
  18456. type: "string"
  18457. },
  18458. comments: {
  18459. type: "object[]"
  18460. },
  18461. "comments[].body": {
  18462. required: true,
  18463. type: "string"
  18464. },
  18465. "comments[].path": {
  18466. required: true,
  18467. type: "string"
  18468. },
  18469. "comments[].position": {
  18470. required: true,
  18471. type: "integer"
  18472. },
  18473. commit_id: {
  18474. type: "string"
  18475. },
  18476. event: {
  18477. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18478. type: "string"
  18479. },
  18480. number: {
  18481. alias: "pull_number",
  18482. deprecated: true,
  18483. type: "integer"
  18484. },
  18485. owner: {
  18486. required: true,
  18487. type: "string"
  18488. },
  18489. pull_number: {
  18490. required: true,
  18491. type: "integer"
  18492. },
  18493. repo: {
  18494. required: true,
  18495. type: "string"
  18496. }
  18497. },
  18498. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18499. },
  18500. createReviewCommentReply: {
  18501. method: "POST",
  18502. params: {
  18503. body: {
  18504. required: true,
  18505. type: "string"
  18506. },
  18507. comment_id: {
  18508. required: true,
  18509. type: "integer"
  18510. },
  18511. owner: {
  18512. required: true,
  18513. type: "string"
  18514. },
  18515. pull_number: {
  18516. required: true,
  18517. type: "integer"
  18518. },
  18519. repo: {
  18520. required: true,
  18521. type: "string"
  18522. }
  18523. },
  18524. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18525. },
  18526. createReviewRequest: {
  18527. method: "POST",
  18528. params: {
  18529. number: {
  18530. alias: "pull_number",
  18531. deprecated: true,
  18532. type: "integer"
  18533. },
  18534. owner: {
  18535. required: true,
  18536. type: "string"
  18537. },
  18538. pull_number: {
  18539. required: true,
  18540. type: "integer"
  18541. },
  18542. repo: {
  18543. required: true,
  18544. type: "string"
  18545. },
  18546. reviewers: {
  18547. type: "string[]"
  18548. },
  18549. team_reviewers: {
  18550. type: "string[]"
  18551. }
  18552. },
  18553. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18554. },
  18555. deleteComment: {
  18556. method: "DELETE",
  18557. params: {
  18558. comment_id: {
  18559. required: true,
  18560. type: "integer"
  18561. },
  18562. owner: {
  18563. required: true,
  18564. type: "string"
  18565. },
  18566. repo: {
  18567. required: true,
  18568. type: "string"
  18569. }
  18570. },
  18571. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18572. },
  18573. deletePendingReview: {
  18574. method: "DELETE",
  18575. params: {
  18576. number: {
  18577. alias: "pull_number",
  18578. deprecated: true,
  18579. type: "integer"
  18580. },
  18581. owner: {
  18582. required: true,
  18583. type: "string"
  18584. },
  18585. pull_number: {
  18586. required: true,
  18587. type: "integer"
  18588. },
  18589. repo: {
  18590. required: true,
  18591. type: "string"
  18592. },
  18593. review_id: {
  18594. required: true,
  18595. type: "integer"
  18596. }
  18597. },
  18598. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18599. },
  18600. deleteReviewRequest: {
  18601. method: "DELETE",
  18602. params: {
  18603. number: {
  18604. alias: "pull_number",
  18605. deprecated: true,
  18606. type: "integer"
  18607. },
  18608. owner: {
  18609. required: true,
  18610. type: "string"
  18611. },
  18612. pull_number: {
  18613. required: true,
  18614. type: "integer"
  18615. },
  18616. repo: {
  18617. required: true,
  18618. type: "string"
  18619. },
  18620. reviewers: {
  18621. type: "string[]"
  18622. },
  18623. team_reviewers: {
  18624. type: "string[]"
  18625. }
  18626. },
  18627. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18628. },
  18629. dismissReview: {
  18630. method: "PUT",
  18631. params: {
  18632. message: {
  18633. required: true,
  18634. type: "string"
  18635. },
  18636. number: {
  18637. alias: "pull_number",
  18638. deprecated: true,
  18639. type: "integer"
  18640. },
  18641. owner: {
  18642. required: true,
  18643. type: "string"
  18644. },
  18645. pull_number: {
  18646. required: true,
  18647. type: "integer"
  18648. },
  18649. repo: {
  18650. required: true,
  18651. type: "string"
  18652. },
  18653. review_id: {
  18654. required: true,
  18655. type: "integer"
  18656. }
  18657. },
  18658. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18659. },
  18660. get: {
  18661. method: "GET",
  18662. params: {
  18663. number: {
  18664. alias: "pull_number",
  18665. deprecated: true,
  18666. type: "integer"
  18667. },
  18668. owner: {
  18669. required: true,
  18670. type: "string"
  18671. },
  18672. pull_number: {
  18673. required: true,
  18674. type: "integer"
  18675. },
  18676. repo: {
  18677. required: true,
  18678. type: "string"
  18679. }
  18680. },
  18681. url: "/repos/:owner/:repo/pulls/:pull_number"
  18682. },
  18683. getComment: {
  18684. method: "GET",
  18685. params: {
  18686. comment_id: {
  18687. required: true,
  18688. type: "integer"
  18689. },
  18690. owner: {
  18691. required: true,
  18692. type: "string"
  18693. },
  18694. repo: {
  18695. required: true,
  18696. type: "string"
  18697. }
  18698. },
  18699. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18700. },
  18701. getCommentsForReview: {
  18702. method: "GET",
  18703. params: {
  18704. number: {
  18705. alias: "pull_number",
  18706. deprecated: true,
  18707. type: "integer"
  18708. },
  18709. owner: {
  18710. required: true,
  18711. type: "string"
  18712. },
  18713. page: {
  18714. type: "integer"
  18715. },
  18716. per_page: {
  18717. type: "integer"
  18718. },
  18719. pull_number: {
  18720. required: true,
  18721. type: "integer"
  18722. },
  18723. repo: {
  18724. required: true,
  18725. type: "string"
  18726. },
  18727. review_id: {
  18728. required: true,
  18729. type: "integer"
  18730. }
  18731. },
  18732. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  18733. },
  18734. getReview: {
  18735. method: "GET",
  18736. params: {
  18737. number: {
  18738. alias: "pull_number",
  18739. deprecated: true,
  18740. type: "integer"
  18741. },
  18742. owner: {
  18743. required: true,
  18744. type: "string"
  18745. },
  18746. pull_number: {
  18747. required: true,
  18748. type: "integer"
  18749. },
  18750. repo: {
  18751. required: true,
  18752. type: "string"
  18753. },
  18754. review_id: {
  18755. required: true,
  18756. type: "integer"
  18757. }
  18758. },
  18759. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18760. },
  18761. list: {
  18762. method: "GET",
  18763. params: {
  18764. base: {
  18765. type: "string"
  18766. },
  18767. direction: {
  18768. enum: ["asc", "desc"],
  18769. type: "string"
  18770. },
  18771. head: {
  18772. type: "string"
  18773. },
  18774. owner: {
  18775. required: true,
  18776. type: "string"
  18777. },
  18778. page: {
  18779. type: "integer"
  18780. },
  18781. per_page: {
  18782. type: "integer"
  18783. },
  18784. repo: {
  18785. required: true,
  18786. type: "string"
  18787. },
  18788. sort: {
  18789. enum: ["created", "updated", "popularity", "long-running"],
  18790. type: "string"
  18791. },
  18792. state: {
  18793. enum: ["open", "closed", "all"],
  18794. type: "string"
  18795. }
  18796. },
  18797. url: "/repos/:owner/:repo/pulls"
  18798. },
  18799. listComments: {
  18800. method: "GET",
  18801. params: {
  18802. direction: {
  18803. enum: ["asc", "desc"],
  18804. type: "string"
  18805. },
  18806. number: {
  18807. alias: "pull_number",
  18808. deprecated: true,
  18809. type: "integer"
  18810. },
  18811. owner: {
  18812. required: true,
  18813. type: "string"
  18814. },
  18815. page: {
  18816. type: "integer"
  18817. },
  18818. per_page: {
  18819. type: "integer"
  18820. },
  18821. pull_number: {
  18822. required: true,
  18823. type: "integer"
  18824. },
  18825. repo: {
  18826. required: true,
  18827. type: "string"
  18828. },
  18829. since: {
  18830. type: "string"
  18831. },
  18832. sort: {
  18833. enum: ["created", "updated"],
  18834. type: "string"
  18835. }
  18836. },
  18837. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18838. },
  18839. listCommentsForRepo: {
  18840. method: "GET",
  18841. params: {
  18842. direction: {
  18843. enum: ["asc", "desc"],
  18844. type: "string"
  18845. },
  18846. owner: {
  18847. required: true,
  18848. type: "string"
  18849. },
  18850. page: {
  18851. type: "integer"
  18852. },
  18853. per_page: {
  18854. type: "integer"
  18855. },
  18856. repo: {
  18857. required: true,
  18858. type: "string"
  18859. },
  18860. since: {
  18861. type: "string"
  18862. },
  18863. sort: {
  18864. enum: ["created", "updated"],
  18865. type: "string"
  18866. }
  18867. },
  18868. url: "/repos/:owner/:repo/pulls/comments"
  18869. },
  18870. listCommits: {
  18871. method: "GET",
  18872. params: {
  18873. number: {
  18874. alias: "pull_number",
  18875. deprecated: true,
  18876. type: "integer"
  18877. },
  18878. owner: {
  18879. required: true,
  18880. type: "string"
  18881. },
  18882. page: {
  18883. type: "integer"
  18884. },
  18885. per_page: {
  18886. type: "integer"
  18887. },
  18888. pull_number: {
  18889. required: true,
  18890. type: "integer"
  18891. },
  18892. repo: {
  18893. required: true,
  18894. type: "string"
  18895. }
  18896. },
  18897. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  18898. },
  18899. listFiles: {
  18900. method: "GET",
  18901. params: {
  18902. number: {
  18903. alias: "pull_number",
  18904. deprecated: true,
  18905. type: "integer"
  18906. },
  18907. owner: {
  18908. required: true,
  18909. type: "string"
  18910. },
  18911. page: {
  18912. type: "integer"
  18913. },
  18914. per_page: {
  18915. type: "integer"
  18916. },
  18917. pull_number: {
  18918. required: true,
  18919. type: "integer"
  18920. },
  18921. repo: {
  18922. required: true,
  18923. type: "string"
  18924. }
  18925. },
  18926. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  18927. },
  18928. listReviewRequests: {
  18929. method: "GET",
  18930. params: {
  18931. number: {
  18932. alias: "pull_number",
  18933. deprecated: true,
  18934. type: "integer"
  18935. },
  18936. owner: {
  18937. required: true,
  18938. type: "string"
  18939. },
  18940. page: {
  18941. type: "integer"
  18942. },
  18943. per_page: {
  18944. type: "integer"
  18945. },
  18946. pull_number: {
  18947. required: true,
  18948. type: "integer"
  18949. },
  18950. repo: {
  18951. required: true,
  18952. type: "string"
  18953. }
  18954. },
  18955. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18956. },
  18957. listReviews: {
  18958. method: "GET",
  18959. params: {
  18960. number: {
  18961. alias: "pull_number",
  18962. deprecated: true,
  18963. type: "integer"
  18964. },
  18965. owner: {
  18966. required: true,
  18967. type: "string"
  18968. },
  18969. page: {
  18970. type: "integer"
  18971. },
  18972. per_page: {
  18973. type: "integer"
  18974. },
  18975. pull_number: {
  18976. required: true,
  18977. type: "integer"
  18978. },
  18979. repo: {
  18980. required: true,
  18981. type: "string"
  18982. }
  18983. },
  18984. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18985. },
  18986. merge: {
  18987. method: "PUT",
  18988. params: {
  18989. commit_message: {
  18990. type: "string"
  18991. },
  18992. commit_title: {
  18993. type: "string"
  18994. },
  18995. merge_method: {
  18996. enum: ["merge", "squash", "rebase"],
  18997. type: "string"
  18998. },
  18999. number: {
  19000. alias: "pull_number",
  19001. deprecated: true,
  19002. type: "integer"
  19003. },
  19004. owner: {
  19005. required: true,
  19006. type: "string"
  19007. },
  19008. pull_number: {
  19009. required: true,
  19010. type: "integer"
  19011. },
  19012. repo: {
  19013. required: true,
  19014. type: "string"
  19015. },
  19016. sha: {
  19017. type: "string"
  19018. }
  19019. },
  19020. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19021. },
  19022. submitReview: {
  19023. method: "POST",
  19024. params: {
  19025. body: {
  19026. type: "string"
  19027. },
  19028. event: {
  19029. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19030. required: true,
  19031. type: "string"
  19032. },
  19033. number: {
  19034. alias: "pull_number",
  19035. deprecated: true,
  19036. type: "integer"
  19037. },
  19038. owner: {
  19039. required: true,
  19040. type: "string"
  19041. },
  19042. pull_number: {
  19043. required: true,
  19044. type: "integer"
  19045. },
  19046. repo: {
  19047. required: true,
  19048. type: "string"
  19049. },
  19050. review_id: {
  19051. required: true,
  19052. type: "integer"
  19053. }
  19054. },
  19055. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19056. },
  19057. update: {
  19058. method: "PATCH",
  19059. params: {
  19060. base: {
  19061. type: "string"
  19062. },
  19063. body: {
  19064. type: "string"
  19065. },
  19066. maintainer_can_modify: {
  19067. type: "boolean"
  19068. },
  19069. number: {
  19070. alias: "pull_number",
  19071. deprecated: true,
  19072. type: "integer"
  19073. },
  19074. owner: {
  19075. required: true,
  19076. type: "string"
  19077. },
  19078. pull_number: {
  19079. required: true,
  19080. type: "integer"
  19081. },
  19082. repo: {
  19083. required: true,
  19084. type: "string"
  19085. },
  19086. state: {
  19087. enum: ["open", "closed"],
  19088. type: "string"
  19089. },
  19090. title: {
  19091. type: "string"
  19092. }
  19093. },
  19094. url: "/repos/:owner/:repo/pulls/:pull_number"
  19095. },
  19096. updateBranch: {
  19097. headers: {
  19098. accept: "application/vnd.github.lydian-preview+json"
  19099. },
  19100. method: "PUT",
  19101. params: {
  19102. expected_head_sha: {
  19103. type: "string"
  19104. },
  19105. owner: {
  19106. required: true,
  19107. type: "string"
  19108. },
  19109. pull_number: {
  19110. required: true,
  19111. type: "integer"
  19112. },
  19113. repo: {
  19114. required: true,
  19115. type: "string"
  19116. }
  19117. },
  19118. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19119. },
  19120. updateComment: {
  19121. method: "PATCH",
  19122. params: {
  19123. body: {
  19124. required: true,
  19125. type: "string"
  19126. },
  19127. comment_id: {
  19128. required: true,
  19129. type: "integer"
  19130. },
  19131. owner: {
  19132. required: true,
  19133. type: "string"
  19134. },
  19135. repo: {
  19136. required: true,
  19137. type: "string"
  19138. }
  19139. },
  19140. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19141. },
  19142. updateReview: {
  19143. method: "PUT",
  19144. params: {
  19145. body: {
  19146. required: true,
  19147. type: "string"
  19148. },
  19149. number: {
  19150. alias: "pull_number",
  19151. deprecated: true,
  19152. type: "integer"
  19153. },
  19154. owner: {
  19155. required: true,
  19156. type: "string"
  19157. },
  19158. pull_number: {
  19159. required: true,
  19160. type: "integer"
  19161. },
  19162. repo: {
  19163. required: true,
  19164. type: "string"
  19165. },
  19166. review_id: {
  19167. required: true,
  19168. type: "integer"
  19169. }
  19170. },
  19171. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19172. }
  19173. },
  19174. rateLimit: {
  19175. get: {
  19176. method: "GET",
  19177. params: {},
  19178. url: "/rate_limit"
  19179. }
  19180. },
  19181. reactions: {
  19182. createForCommitComment: {
  19183. headers: {
  19184. accept: "application/vnd.github.squirrel-girl-preview+json"
  19185. },
  19186. method: "POST",
  19187. params: {
  19188. comment_id: {
  19189. required: true,
  19190. type: "integer"
  19191. },
  19192. content: {
  19193. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19194. required: true,
  19195. type: "string"
  19196. },
  19197. owner: {
  19198. required: true,
  19199. type: "string"
  19200. },
  19201. repo: {
  19202. required: true,
  19203. type: "string"
  19204. }
  19205. },
  19206. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19207. },
  19208. createForIssue: {
  19209. headers: {
  19210. accept: "application/vnd.github.squirrel-girl-preview+json"
  19211. },
  19212. method: "POST",
  19213. params: {
  19214. content: {
  19215. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19216. required: true,
  19217. type: "string"
  19218. },
  19219. issue_number: {
  19220. required: true,
  19221. type: "integer"
  19222. },
  19223. number: {
  19224. alias: "issue_number",
  19225. deprecated: true,
  19226. type: "integer"
  19227. },
  19228. owner: {
  19229. required: true,
  19230. type: "string"
  19231. },
  19232. repo: {
  19233. required: true,
  19234. type: "string"
  19235. }
  19236. },
  19237. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19238. },
  19239. createForIssueComment: {
  19240. headers: {
  19241. accept: "application/vnd.github.squirrel-girl-preview+json"
  19242. },
  19243. method: "POST",
  19244. params: {
  19245. comment_id: {
  19246. required: true,
  19247. type: "integer"
  19248. },
  19249. content: {
  19250. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19251. required: true,
  19252. type: "string"
  19253. },
  19254. owner: {
  19255. required: true,
  19256. type: "string"
  19257. },
  19258. repo: {
  19259. required: true,
  19260. type: "string"
  19261. }
  19262. },
  19263. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19264. },
  19265. createForPullRequestReviewComment: {
  19266. headers: {
  19267. accept: "application/vnd.github.squirrel-girl-preview+json"
  19268. },
  19269. method: "POST",
  19270. params: {
  19271. comment_id: {
  19272. required: true,
  19273. type: "integer"
  19274. },
  19275. content: {
  19276. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19277. required: true,
  19278. type: "string"
  19279. },
  19280. owner: {
  19281. required: true,
  19282. type: "string"
  19283. },
  19284. repo: {
  19285. required: true,
  19286. type: "string"
  19287. }
  19288. },
  19289. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19290. },
  19291. createForTeamDiscussion: {
  19292. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19293. headers: {
  19294. accept: "application/vnd.github.squirrel-girl-preview+json"
  19295. },
  19296. method: "POST",
  19297. params: {
  19298. content: {
  19299. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19300. required: true,
  19301. type: "string"
  19302. },
  19303. discussion_number: {
  19304. required: true,
  19305. type: "integer"
  19306. },
  19307. team_id: {
  19308. required: true,
  19309. type: "integer"
  19310. }
  19311. },
  19312. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19313. },
  19314. createForTeamDiscussionComment: {
  19315. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19316. headers: {
  19317. accept: "application/vnd.github.squirrel-girl-preview+json"
  19318. },
  19319. method: "POST",
  19320. params: {
  19321. comment_number: {
  19322. required: true,
  19323. type: "integer"
  19324. },
  19325. content: {
  19326. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19327. required: true,
  19328. type: "string"
  19329. },
  19330. discussion_number: {
  19331. required: true,
  19332. type: "integer"
  19333. },
  19334. team_id: {
  19335. required: true,
  19336. type: "integer"
  19337. }
  19338. },
  19339. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19340. },
  19341. createForTeamDiscussionCommentInOrg: {
  19342. headers: {
  19343. accept: "application/vnd.github.squirrel-girl-preview+json"
  19344. },
  19345. method: "POST",
  19346. params: {
  19347. comment_number: {
  19348. required: true,
  19349. type: "integer"
  19350. },
  19351. content: {
  19352. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19353. required: true,
  19354. type: "string"
  19355. },
  19356. discussion_number: {
  19357. required: true,
  19358. type: "integer"
  19359. },
  19360. org: {
  19361. required: true,
  19362. type: "string"
  19363. },
  19364. team_slug: {
  19365. required: true,
  19366. type: "string"
  19367. }
  19368. },
  19369. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19370. },
  19371. createForTeamDiscussionCommentLegacy: {
  19372. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19373. headers: {
  19374. accept: "application/vnd.github.squirrel-girl-preview+json"
  19375. },
  19376. method: "POST",
  19377. params: {
  19378. comment_number: {
  19379. required: true,
  19380. type: "integer"
  19381. },
  19382. content: {
  19383. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19384. required: true,
  19385. type: "string"
  19386. },
  19387. discussion_number: {
  19388. required: true,
  19389. type: "integer"
  19390. },
  19391. team_id: {
  19392. required: true,
  19393. type: "integer"
  19394. }
  19395. },
  19396. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19397. },
  19398. createForTeamDiscussionInOrg: {
  19399. headers: {
  19400. accept: "application/vnd.github.squirrel-girl-preview+json"
  19401. },
  19402. method: "POST",
  19403. params: {
  19404. content: {
  19405. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19406. required: true,
  19407. type: "string"
  19408. },
  19409. discussion_number: {
  19410. required: true,
  19411. type: "integer"
  19412. },
  19413. org: {
  19414. required: true,
  19415. type: "string"
  19416. },
  19417. team_slug: {
  19418. required: true,
  19419. type: "string"
  19420. }
  19421. },
  19422. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19423. },
  19424. createForTeamDiscussionLegacy: {
  19425. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19426. headers: {
  19427. accept: "application/vnd.github.squirrel-girl-preview+json"
  19428. },
  19429. method: "POST",
  19430. params: {
  19431. content: {
  19432. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19433. required: true,
  19434. type: "string"
  19435. },
  19436. discussion_number: {
  19437. required: true,
  19438. type: "integer"
  19439. },
  19440. team_id: {
  19441. required: true,
  19442. type: "integer"
  19443. }
  19444. },
  19445. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19446. },
  19447. delete: {
  19448. headers: {
  19449. accept: "application/vnd.github.squirrel-girl-preview+json"
  19450. },
  19451. method: "DELETE",
  19452. params: {
  19453. reaction_id: {
  19454. required: true,
  19455. type: "integer"
  19456. }
  19457. },
  19458. url: "/reactions/:reaction_id"
  19459. },
  19460. listForCommitComment: {
  19461. headers: {
  19462. accept: "application/vnd.github.squirrel-girl-preview+json"
  19463. },
  19464. method: "GET",
  19465. params: {
  19466. comment_id: {
  19467. required: true,
  19468. type: "integer"
  19469. },
  19470. content: {
  19471. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19472. type: "string"
  19473. },
  19474. owner: {
  19475. required: true,
  19476. type: "string"
  19477. },
  19478. page: {
  19479. type: "integer"
  19480. },
  19481. per_page: {
  19482. type: "integer"
  19483. },
  19484. repo: {
  19485. required: true,
  19486. type: "string"
  19487. }
  19488. },
  19489. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19490. },
  19491. listForIssue: {
  19492. headers: {
  19493. accept: "application/vnd.github.squirrel-girl-preview+json"
  19494. },
  19495. method: "GET",
  19496. params: {
  19497. content: {
  19498. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19499. type: "string"
  19500. },
  19501. issue_number: {
  19502. required: true,
  19503. type: "integer"
  19504. },
  19505. number: {
  19506. alias: "issue_number",
  19507. deprecated: true,
  19508. type: "integer"
  19509. },
  19510. owner: {
  19511. required: true,
  19512. type: "string"
  19513. },
  19514. page: {
  19515. type: "integer"
  19516. },
  19517. per_page: {
  19518. type: "integer"
  19519. },
  19520. repo: {
  19521. required: true,
  19522. type: "string"
  19523. }
  19524. },
  19525. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19526. },
  19527. listForIssueComment: {
  19528. headers: {
  19529. accept: "application/vnd.github.squirrel-girl-preview+json"
  19530. },
  19531. method: "GET",
  19532. params: {
  19533. comment_id: {
  19534. required: true,
  19535. type: "integer"
  19536. },
  19537. content: {
  19538. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19539. type: "string"
  19540. },
  19541. owner: {
  19542. required: true,
  19543. type: "string"
  19544. },
  19545. page: {
  19546. type: "integer"
  19547. },
  19548. per_page: {
  19549. type: "integer"
  19550. },
  19551. repo: {
  19552. required: true,
  19553. type: "string"
  19554. }
  19555. },
  19556. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19557. },
  19558. listForPullRequestReviewComment: {
  19559. headers: {
  19560. accept: "application/vnd.github.squirrel-girl-preview+json"
  19561. },
  19562. method: "GET",
  19563. params: {
  19564. comment_id: {
  19565. required: true,
  19566. type: "integer"
  19567. },
  19568. content: {
  19569. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19570. type: "string"
  19571. },
  19572. owner: {
  19573. required: true,
  19574. type: "string"
  19575. },
  19576. page: {
  19577. type: "integer"
  19578. },
  19579. per_page: {
  19580. type: "integer"
  19581. },
  19582. repo: {
  19583. required: true,
  19584. type: "string"
  19585. }
  19586. },
  19587. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19588. },
  19589. listForTeamDiscussion: {
  19590. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19591. headers: {
  19592. accept: "application/vnd.github.squirrel-girl-preview+json"
  19593. },
  19594. method: "GET",
  19595. params: {
  19596. content: {
  19597. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19598. type: "string"
  19599. },
  19600. discussion_number: {
  19601. required: true,
  19602. type: "integer"
  19603. },
  19604. page: {
  19605. type: "integer"
  19606. },
  19607. per_page: {
  19608. type: "integer"
  19609. },
  19610. team_id: {
  19611. required: true,
  19612. type: "integer"
  19613. }
  19614. },
  19615. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19616. },
  19617. listForTeamDiscussionComment: {
  19618. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19619. headers: {
  19620. accept: "application/vnd.github.squirrel-girl-preview+json"
  19621. },
  19622. method: "GET",
  19623. params: {
  19624. comment_number: {
  19625. required: true,
  19626. type: "integer"
  19627. },
  19628. content: {
  19629. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19630. type: "string"
  19631. },
  19632. discussion_number: {
  19633. required: true,
  19634. type: "integer"
  19635. },
  19636. page: {
  19637. type: "integer"
  19638. },
  19639. per_page: {
  19640. type: "integer"
  19641. },
  19642. team_id: {
  19643. required: true,
  19644. type: "integer"
  19645. }
  19646. },
  19647. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19648. },
  19649. listForTeamDiscussionCommentInOrg: {
  19650. headers: {
  19651. accept: "application/vnd.github.squirrel-girl-preview+json"
  19652. },
  19653. method: "GET",
  19654. params: {
  19655. comment_number: {
  19656. required: true,
  19657. type: "integer"
  19658. },
  19659. content: {
  19660. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19661. type: "string"
  19662. },
  19663. discussion_number: {
  19664. required: true,
  19665. type: "integer"
  19666. },
  19667. org: {
  19668. required: true,
  19669. type: "string"
  19670. },
  19671. page: {
  19672. type: "integer"
  19673. },
  19674. per_page: {
  19675. type: "integer"
  19676. },
  19677. team_slug: {
  19678. required: true,
  19679. type: "string"
  19680. }
  19681. },
  19682. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19683. },
  19684. listForTeamDiscussionCommentLegacy: {
  19685. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19686. headers: {
  19687. accept: "application/vnd.github.squirrel-girl-preview+json"
  19688. },
  19689. method: "GET",
  19690. params: {
  19691. comment_number: {
  19692. required: true,
  19693. type: "integer"
  19694. },
  19695. content: {
  19696. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19697. type: "string"
  19698. },
  19699. discussion_number: {
  19700. required: true,
  19701. type: "integer"
  19702. },
  19703. page: {
  19704. type: "integer"
  19705. },
  19706. per_page: {
  19707. type: "integer"
  19708. },
  19709. team_id: {
  19710. required: true,
  19711. type: "integer"
  19712. }
  19713. },
  19714. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19715. },
  19716. listForTeamDiscussionInOrg: {
  19717. headers: {
  19718. accept: "application/vnd.github.squirrel-girl-preview+json"
  19719. },
  19720. method: "GET",
  19721. params: {
  19722. content: {
  19723. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19724. type: "string"
  19725. },
  19726. discussion_number: {
  19727. required: true,
  19728. type: "integer"
  19729. },
  19730. org: {
  19731. required: true,
  19732. type: "string"
  19733. },
  19734. page: {
  19735. type: "integer"
  19736. },
  19737. per_page: {
  19738. type: "integer"
  19739. },
  19740. team_slug: {
  19741. required: true,
  19742. type: "string"
  19743. }
  19744. },
  19745. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19746. },
  19747. listForTeamDiscussionLegacy: {
  19748. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  19749. headers: {
  19750. accept: "application/vnd.github.squirrel-girl-preview+json"
  19751. },
  19752. method: "GET",
  19753. params: {
  19754. content: {
  19755. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19756. type: "string"
  19757. },
  19758. discussion_number: {
  19759. required: true,
  19760. type: "integer"
  19761. },
  19762. page: {
  19763. type: "integer"
  19764. },
  19765. per_page: {
  19766. type: "integer"
  19767. },
  19768. team_id: {
  19769. required: true,
  19770. type: "integer"
  19771. }
  19772. },
  19773. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19774. }
  19775. },
  19776. repos: {
  19777. acceptInvitation: {
  19778. method: "PATCH",
  19779. params: {
  19780. invitation_id: {
  19781. required: true,
  19782. type: "integer"
  19783. }
  19784. },
  19785. url: "/user/repository_invitations/:invitation_id"
  19786. },
  19787. addCollaborator: {
  19788. method: "PUT",
  19789. params: {
  19790. owner: {
  19791. required: true,
  19792. type: "string"
  19793. },
  19794. permission: {
  19795. enum: ["pull", "push", "admin"],
  19796. type: "string"
  19797. },
  19798. repo: {
  19799. required: true,
  19800. type: "string"
  19801. },
  19802. username: {
  19803. required: true,
  19804. type: "string"
  19805. }
  19806. },
  19807. url: "/repos/:owner/:repo/collaborators/:username"
  19808. },
  19809. addDeployKey: {
  19810. method: "POST",
  19811. params: {
  19812. key: {
  19813. required: true,
  19814. type: "string"
  19815. },
  19816. owner: {
  19817. required: true,
  19818. type: "string"
  19819. },
  19820. read_only: {
  19821. type: "boolean"
  19822. },
  19823. repo: {
  19824. required: true,
  19825. type: "string"
  19826. },
  19827. title: {
  19828. type: "string"
  19829. }
  19830. },
  19831. url: "/repos/:owner/:repo/keys"
  19832. },
  19833. addProtectedBranchAdminEnforcement: {
  19834. method: "POST",
  19835. params: {
  19836. branch: {
  19837. required: true,
  19838. type: "string"
  19839. },
  19840. owner: {
  19841. required: true,
  19842. type: "string"
  19843. },
  19844. repo: {
  19845. required: true,
  19846. type: "string"
  19847. }
  19848. },
  19849. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  19850. },
  19851. addProtectedBranchAppRestrictions: {
  19852. method: "POST",
  19853. params: {
  19854. apps: {
  19855. mapTo: "data",
  19856. required: true,
  19857. type: "string[]"
  19858. },
  19859. branch: {
  19860. required: true,
  19861. type: "string"
  19862. },
  19863. owner: {
  19864. required: true,
  19865. type: "string"
  19866. },
  19867. repo: {
  19868. required: true,
  19869. type: "string"
  19870. }
  19871. },
  19872. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  19873. },
  19874. addProtectedBranchRequiredSignatures: {
  19875. headers: {
  19876. accept: "application/vnd.github.zzzax-preview+json"
  19877. },
  19878. method: "POST",
  19879. params: {
  19880. branch: {
  19881. required: true,
  19882. type: "string"
  19883. },
  19884. owner: {
  19885. required: true,
  19886. type: "string"
  19887. },
  19888. repo: {
  19889. required: true,
  19890. type: "string"
  19891. }
  19892. },
  19893. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  19894. },
  19895. addProtectedBranchRequiredStatusChecksContexts: {
  19896. method: "POST",
  19897. params: {
  19898. branch: {
  19899. required: true,
  19900. type: "string"
  19901. },
  19902. contexts: {
  19903. mapTo: "data",
  19904. required: true,
  19905. type: "string[]"
  19906. },
  19907. owner: {
  19908. required: true,
  19909. type: "string"
  19910. },
  19911. repo: {
  19912. required: true,
  19913. type: "string"
  19914. }
  19915. },
  19916. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  19917. },
  19918. addProtectedBranchTeamRestrictions: {
  19919. method: "POST",
  19920. params: {
  19921. branch: {
  19922. required: true,
  19923. type: "string"
  19924. },
  19925. owner: {
  19926. required: true,
  19927. type: "string"
  19928. },
  19929. repo: {
  19930. required: true,
  19931. type: "string"
  19932. },
  19933. teams: {
  19934. mapTo: "data",
  19935. required: true,
  19936. type: "string[]"
  19937. }
  19938. },
  19939. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  19940. },
  19941. addProtectedBranchUserRestrictions: {
  19942. method: "POST",
  19943. params: {
  19944. branch: {
  19945. required: true,
  19946. type: "string"
  19947. },
  19948. owner: {
  19949. required: true,
  19950. type: "string"
  19951. },
  19952. repo: {
  19953. required: true,
  19954. type: "string"
  19955. },
  19956. users: {
  19957. mapTo: "data",
  19958. required: true,
  19959. type: "string[]"
  19960. }
  19961. },
  19962. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  19963. },
  19964. checkCollaborator: {
  19965. method: "GET",
  19966. params: {
  19967. owner: {
  19968. required: true,
  19969. type: "string"
  19970. },
  19971. repo: {
  19972. required: true,
  19973. type: "string"
  19974. },
  19975. username: {
  19976. required: true,
  19977. type: "string"
  19978. }
  19979. },
  19980. url: "/repos/:owner/:repo/collaborators/:username"
  19981. },
  19982. checkVulnerabilityAlerts: {
  19983. headers: {
  19984. accept: "application/vnd.github.dorian-preview+json"
  19985. },
  19986. method: "GET",
  19987. params: {
  19988. owner: {
  19989. required: true,
  19990. type: "string"
  19991. },
  19992. repo: {
  19993. required: true,
  19994. type: "string"
  19995. }
  19996. },
  19997. url: "/repos/:owner/:repo/vulnerability-alerts"
  19998. },
  19999. compareCommits: {
  20000. method: "GET",
  20001. params: {
  20002. base: {
  20003. required: true,
  20004. type: "string"
  20005. },
  20006. head: {
  20007. required: true,
  20008. type: "string"
  20009. },
  20010. owner: {
  20011. required: true,
  20012. type: "string"
  20013. },
  20014. repo: {
  20015. required: true,
  20016. type: "string"
  20017. }
  20018. },
  20019. url: "/repos/:owner/:repo/compare/:base...:head"
  20020. },
  20021. createCommitComment: {
  20022. method: "POST",
  20023. params: {
  20024. body: {
  20025. required: true,
  20026. type: "string"
  20027. },
  20028. commit_sha: {
  20029. required: true,
  20030. type: "string"
  20031. },
  20032. line: {
  20033. type: "integer"
  20034. },
  20035. owner: {
  20036. required: true,
  20037. type: "string"
  20038. },
  20039. path: {
  20040. type: "string"
  20041. },
  20042. position: {
  20043. type: "integer"
  20044. },
  20045. repo: {
  20046. required: true,
  20047. type: "string"
  20048. },
  20049. sha: {
  20050. alias: "commit_sha",
  20051. deprecated: true,
  20052. type: "string"
  20053. }
  20054. },
  20055. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20056. },
  20057. createDeployment: {
  20058. method: "POST",
  20059. params: {
  20060. auto_merge: {
  20061. type: "boolean"
  20062. },
  20063. description: {
  20064. type: "string"
  20065. },
  20066. environment: {
  20067. type: "string"
  20068. },
  20069. owner: {
  20070. required: true,
  20071. type: "string"
  20072. },
  20073. payload: {
  20074. type: "string"
  20075. },
  20076. production_environment: {
  20077. type: "boolean"
  20078. },
  20079. ref: {
  20080. required: true,
  20081. type: "string"
  20082. },
  20083. repo: {
  20084. required: true,
  20085. type: "string"
  20086. },
  20087. required_contexts: {
  20088. type: "string[]"
  20089. },
  20090. task: {
  20091. type: "string"
  20092. },
  20093. transient_environment: {
  20094. type: "boolean"
  20095. }
  20096. },
  20097. url: "/repos/:owner/:repo/deployments"
  20098. },
  20099. createDeploymentStatus: {
  20100. method: "POST",
  20101. params: {
  20102. auto_inactive: {
  20103. type: "boolean"
  20104. },
  20105. deployment_id: {
  20106. required: true,
  20107. type: "integer"
  20108. },
  20109. description: {
  20110. type: "string"
  20111. },
  20112. environment: {
  20113. enum: ["production", "staging", "qa"],
  20114. type: "string"
  20115. },
  20116. environment_url: {
  20117. type: "string"
  20118. },
  20119. log_url: {
  20120. type: "string"
  20121. },
  20122. owner: {
  20123. required: true,
  20124. type: "string"
  20125. },
  20126. repo: {
  20127. required: true,
  20128. type: "string"
  20129. },
  20130. state: {
  20131. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20132. required: true,
  20133. type: "string"
  20134. },
  20135. target_url: {
  20136. type: "string"
  20137. }
  20138. },
  20139. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20140. },
  20141. createDispatchEvent: {
  20142. method: "POST",
  20143. params: {
  20144. client_payload: {
  20145. type: "object"
  20146. },
  20147. event_type: {
  20148. type: "string"
  20149. },
  20150. owner: {
  20151. required: true,
  20152. type: "string"
  20153. },
  20154. repo: {
  20155. required: true,
  20156. type: "string"
  20157. }
  20158. },
  20159. url: "/repos/:owner/:repo/dispatches"
  20160. },
  20161. createFile: {
  20162. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20163. method: "PUT",
  20164. params: {
  20165. author: {
  20166. type: "object"
  20167. },
  20168. "author.email": {
  20169. required: true,
  20170. type: "string"
  20171. },
  20172. "author.name": {
  20173. required: true,
  20174. type: "string"
  20175. },
  20176. branch: {
  20177. type: "string"
  20178. },
  20179. committer: {
  20180. type: "object"
  20181. },
  20182. "committer.email": {
  20183. required: true,
  20184. type: "string"
  20185. },
  20186. "committer.name": {
  20187. required: true,
  20188. type: "string"
  20189. },
  20190. content: {
  20191. required: true,
  20192. type: "string"
  20193. },
  20194. message: {
  20195. required: true,
  20196. type: "string"
  20197. },
  20198. owner: {
  20199. required: true,
  20200. type: "string"
  20201. },
  20202. path: {
  20203. required: true,
  20204. type: "string"
  20205. },
  20206. repo: {
  20207. required: true,
  20208. type: "string"
  20209. },
  20210. sha: {
  20211. type: "string"
  20212. }
  20213. },
  20214. url: "/repos/:owner/:repo/contents/:path"
  20215. },
  20216. createForAuthenticatedUser: {
  20217. method: "POST",
  20218. params: {
  20219. allow_merge_commit: {
  20220. type: "boolean"
  20221. },
  20222. allow_rebase_merge: {
  20223. type: "boolean"
  20224. },
  20225. allow_squash_merge: {
  20226. type: "boolean"
  20227. },
  20228. auto_init: {
  20229. type: "boolean"
  20230. },
  20231. delete_branch_on_merge: {
  20232. type: "boolean"
  20233. },
  20234. description: {
  20235. type: "string"
  20236. },
  20237. gitignore_template: {
  20238. type: "string"
  20239. },
  20240. has_issues: {
  20241. type: "boolean"
  20242. },
  20243. has_projects: {
  20244. type: "boolean"
  20245. },
  20246. has_wiki: {
  20247. type: "boolean"
  20248. },
  20249. homepage: {
  20250. type: "string"
  20251. },
  20252. is_template: {
  20253. type: "boolean"
  20254. },
  20255. license_template: {
  20256. type: "string"
  20257. },
  20258. name: {
  20259. required: true,
  20260. type: "string"
  20261. },
  20262. private: {
  20263. type: "boolean"
  20264. },
  20265. team_id: {
  20266. type: "integer"
  20267. },
  20268. visibility: {
  20269. enum: ["public", "private", "visibility", "internal"],
  20270. type: "string"
  20271. }
  20272. },
  20273. url: "/user/repos"
  20274. },
  20275. createFork: {
  20276. method: "POST",
  20277. params: {
  20278. organization: {
  20279. type: "string"
  20280. },
  20281. owner: {
  20282. required: true,
  20283. type: "string"
  20284. },
  20285. repo: {
  20286. required: true,
  20287. type: "string"
  20288. }
  20289. },
  20290. url: "/repos/:owner/:repo/forks"
  20291. },
  20292. createHook: {
  20293. method: "POST",
  20294. params: {
  20295. active: {
  20296. type: "boolean"
  20297. },
  20298. config: {
  20299. required: true,
  20300. type: "object"
  20301. },
  20302. "config.content_type": {
  20303. type: "string"
  20304. },
  20305. "config.insecure_ssl": {
  20306. type: "string"
  20307. },
  20308. "config.secret": {
  20309. type: "string"
  20310. },
  20311. "config.url": {
  20312. required: true,
  20313. type: "string"
  20314. },
  20315. events: {
  20316. type: "string[]"
  20317. },
  20318. name: {
  20319. type: "string"
  20320. },
  20321. owner: {
  20322. required: true,
  20323. type: "string"
  20324. },
  20325. repo: {
  20326. required: true,
  20327. type: "string"
  20328. }
  20329. },
  20330. url: "/repos/:owner/:repo/hooks"
  20331. },
  20332. createInOrg: {
  20333. method: "POST",
  20334. params: {
  20335. allow_merge_commit: {
  20336. type: "boolean"
  20337. },
  20338. allow_rebase_merge: {
  20339. type: "boolean"
  20340. },
  20341. allow_squash_merge: {
  20342. type: "boolean"
  20343. },
  20344. auto_init: {
  20345. type: "boolean"
  20346. },
  20347. delete_branch_on_merge: {
  20348. type: "boolean"
  20349. },
  20350. description: {
  20351. type: "string"
  20352. },
  20353. gitignore_template: {
  20354. type: "string"
  20355. },
  20356. has_issues: {
  20357. type: "boolean"
  20358. },
  20359. has_projects: {
  20360. type: "boolean"
  20361. },
  20362. has_wiki: {
  20363. type: "boolean"
  20364. },
  20365. homepage: {
  20366. type: "string"
  20367. },
  20368. is_template: {
  20369. type: "boolean"
  20370. },
  20371. license_template: {
  20372. type: "string"
  20373. },
  20374. name: {
  20375. required: true,
  20376. type: "string"
  20377. },
  20378. org: {
  20379. required: true,
  20380. type: "string"
  20381. },
  20382. private: {
  20383. type: "boolean"
  20384. },
  20385. team_id: {
  20386. type: "integer"
  20387. },
  20388. visibility: {
  20389. enum: ["public", "private", "visibility", "internal"],
  20390. type: "string"
  20391. }
  20392. },
  20393. url: "/orgs/:org/repos"
  20394. },
  20395. createOrUpdateFile: {
  20396. method: "PUT",
  20397. params: {
  20398. author: {
  20399. type: "object"
  20400. },
  20401. "author.email": {
  20402. required: true,
  20403. type: "string"
  20404. },
  20405. "author.name": {
  20406. required: true,
  20407. type: "string"
  20408. },
  20409. branch: {
  20410. type: "string"
  20411. },
  20412. committer: {
  20413. type: "object"
  20414. },
  20415. "committer.email": {
  20416. required: true,
  20417. type: "string"
  20418. },
  20419. "committer.name": {
  20420. required: true,
  20421. type: "string"
  20422. },
  20423. content: {
  20424. required: true,
  20425. type: "string"
  20426. },
  20427. message: {
  20428. required: true,
  20429. type: "string"
  20430. },
  20431. owner: {
  20432. required: true,
  20433. type: "string"
  20434. },
  20435. path: {
  20436. required: true,
  20437. type: "string"
  20438. },
  20439. repo: {
  20440. required: true,
  20441. type: "string"
  20442. },
  20443. sha: {
  20444. type: "string"
  20445. }
  20446. },
  20447. url: "/repos/:owner/:repo/contents/:path"
  20448. },
  20449. createRelease: {
  20450. method: "POST",
  20451. params: {
  20452. body: {
  20453. type: "string"
  20454. },
  20455. draft: {
  20456. type: "boolean"
  20457. },
  20458. name: {
  20459. type: "string"
  20460. },
  20461. owner: {
  20462. required: true,
  20463. type: "string"
  20464. },
  20465. prerelease: {
  20466. type: "boolean"
  20467. },
  20468. repo: {
  20469. required: true,
  20470. type: "string"
  20471. },
  20472. tag_name: {
  20473. required: true,
  20474. type: "string"
  20475. },
  20476. target_commitish: {
  20477. type: "string"
  20478. }
  20479. },
  20480. url: "/repos/:owner/:repo/releases"
  20481. },
  20482. createStatus: {
  20483. method: "POST",
  20484. params: {
  20485. context: {
  20486. type: "string"
  20487. },
  20488. description: {
  20489. type: "string"
  20490. },
  20491. owner: {
  20492. required: true,
  20493. type: "string"
  20494. },
  20495. repo: {
  20496. required: true,
  20497. type: "string"
  20498. },
  20499. sha: {
  20500. required: true,
  20501. type: "string"
  20502. },
  20503. state: {
  20504. enum: ["error", "failure", "pending", "success"],
  20505. required: true,
  20506. type: "string"
  20507. },
  20508. target_url: {
  20509. type: "string"
  20510. }
  20511. },
  20512. url: "/repos/:owner/:repo/statuses/:sha"
  20513. },
  20514. createUsingTemplate: {
  20515. headers: {
  20516. accept: "application/vnd.github.baptiste-preview+json"
  20517. },
  20518. method: "POST",
  20519. params: {
  20520. description: {
  20521. type: "string"
  20522. },
  20523. name: {
  20524. required: true,
  20525. type: "string"
  20526. },
  20527. owner: {
  20528. type: "string"
  20529. },
  20530. private: {
  20531. type: "boolean"
  20532. },
  20533. template_owner: {
  20534. required: true,
  20535. type: "string"
  20536. },
  20537. template_repo: {
  20538. required: true,
  20539. type: "string"
  20540. }
  20541. },
  20542. url: "/repos/:template_owner/:template_repo/generate"
  20543. },
  20544. declineInvitation: {
  20545. method: "DELETE",
  20546. params: {
  20547. invitation_id: {
  20548. required: true,
  20549. type: "integer"
  20550. }
  20551. },
  20552. url: "/user/repository_invitations/:invitation_id"
  20553. },
  20554. delete: {
  20555. method: "DELETE",
  20556. params: {
  20557. owner: {
  20558. required: true,
  20559. type: "string"
  20560. },
  20561. repo: {
  20562. required: true,
  20563. type: "string"
  20564. }
  20565. },
  20566. url: "/repos/:owner/:repo"
  20567. },
  20568. deleteCommitComment: {
  20569. method: "DELETE",
  20570. params: {
  20571. comment_id: {
  20572. required: true,
  20573. type: "integer"
  20574. },
  20575. owner: {
  20576. required: true,
  20577. type: "string"
  20578. },
  20579. repo: {
  20580. required: true,
  20581. type: "string"
  20582. }
  20583. },
  20584. url: "/repos/:owner/:repo/comments/:comment_id"
  20585. },
  20586. deleteDownload: {
  20587. method: "DELETE",
  20588. params: {
  20589. download_id: {
  20590. required: true,
  20591. type: "integer"
  20592. },
  20593. owner: {
  20594. required: true,
  20595. type: "string"
  20596. },
  20597. repo: {
  20598. required: true,
  20599. type: "string"
  20600. }
  20601. },
  20602. url: "/repos/:owner/:repo/downloads/:download_id"
  20603. },
  20604. deleteFile: {
  20605. method: "DELETE",
  20606. params: {
  20607. author: {
  20608. type: "object"
  20609. },
  20610. "author.email": {
  20611. type: "string"
  20612. },
  20613. "author.name": {
  20614. type: "string"
  20615. },
  20616. branch: {
  20617. type: "string"
  20618. },
  20619. committer: {
  20620. type: "object"
  20621. },
  20622. "committer.email": {
  20623. type: "string"
  20624. },
  20625. "committer.name": {
  20626. type: "string"
  20627. },
  20628. message: {
  20629. required: true,
  20630. type: "string"
  20631. },
  20632. owner: {
  20633. required: true,
  20634. type: "string"
  20635. },
  20636. path: {
  20637. required: true,
  20638. type: "string"
  20639. },
  20640. repo: {
  20641. required: true,
  20642. type: "string"
  20643. },
  20644. sha: {
  20645. required: true,
  20646. type: "string"
  20647. }
  20648. },
  20649. url: "/repos/:owner/:repo/contents/:path"
  20650. },
  20651. deleteHook: {
  20652. method: "DELETE",
  20653. params: {
  20654. hook_id: {
  20655. required: true,
  20656. type: "integer"
  20657. },
  20658. owner: {
  20659. required: true,
  20660. type: "string"
  20661. },
  20662. repo: {
  20663. required: true,
  20664. type: "string"
  20665. }
  20666. },
  20667. url: "/repos/:owner/:repo/hooks/:hook_id"
  20668. },
  20669. deleteInvitation: {
  20670. method: "DELETE",
  20671. params: {
  20672. invitation_id: {
  20673. required: true,
  20674. type: "integer"
  20675. },
  20676. owner: {
  20677. required: true,
  20678. type: "string"
  20679. },
  20680. repo: {
  20681. required: true,
  20682. type: "string"
  20683. }
  20684. },
  20685. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20686. },
  20687. deleteRelease: {
  20688. method: "DELETE",
  20689. params: {
  20690. owner: {
  20691. required: true,
  20692. type: "string"
  20693. },
  20694. release_id: {
  20695. required: true,
  20696. type: "integer"
  20697. },
  20698. repo: {
  20699. required: true,
  20700. type: "string"
  20701. }
  20702. },
  20703. url: "/repos/:owner/:repo/releases/:release_id"
  20704. },
  20705. deleteReleaseAsset: {
  20706. method: "DELETE",
  20707. params: {
  20708. asset_id: {
  20709. required: true,
  20710. type: "integer"
  20711. },
  20712. owner: {
  20713. required: true,
  20714. type: "string"
  20715. },
  20716. repo: {
  20717. required: true,
  20718. type: "string"
  20719. }
  20720. },
  20721. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20722. },
  20723. disableAutomatedSecurityFixes: {
  20724. headers: {
  20725. accept: "application/vnd.github.london-preview+json"
  20726. },
  20727. method: "DELETE",
  20728. params: {
  20729. owner: {
  20730. required: true,
  20731. type: "string"
  20732. },
  20733. repo: {
  20734. required: true,
  20735. type: "string"
  20736. }
  20737. },
  20738. url: "/repos/:owner/:repo/automated-security-fixes"
  20739. },
  20740. disablePagesSite: {
  20741. headers: {
  20742. accept: "application/vnd.github.switcheroo-preview+json"
  20743. },
  20744. method: "DELETE",
  20745. params: {
  20746. owner: {
  20747. required: true,
  20748. type: "string"
  20749. },
  20750. repo: {
  20751. required: true,
  20752. type: "string"
  20753. }
  20754. },
  20755. url: "/repos/:owner/:repo/pages"
  20756. },
  20757. disableVulnerabilityAlerts: {
  20758. headers: {
  20759. accept: "application/vnd.github.dorian-preview+json"
  20760. },
  20761. method: "DELETE",
  20762. params: {
  20763. owner: {
  20764. required: true,
  20765. type: "string"
  20766. },
  20767. repo: {
  20768. required: true,
  20769. type: "string"
  20770. }
  20771. },
  20772. url: "/repos/:owner/:repo/vulnerability-alerts"
  20773. },
  20774. enableAutomatedSecurityFixes: {
  20775. headers: {
  20776. accept: "application/vnd.github.london-preview+json"
  20777. },
  20778. method: "PUT",
  20779. params: {
  20780. owner: {
  20781. required: true,
  20782. type: "string"
  20783. },
  20784. repo: {
  20785. required: true,
  20786. type: "string"
  20787. }
  20788. },
  20789. url: "/repos/:owner/:repo/automated-security-fixes"
  20790. },
  20791. enablePagesSite: {
  20792. headers: {
  20793. accept: "application/vnd.github.switcheroo-preview+json"
  20794. },
  20795. method: "POST",
  20796. params: {
  20797. owner: {
  20798. required: true,
  20799. type: "string"
  20800. },
  20801. repo: {
  20802. required: true,
  20803. type: "string"
  20804. },
  20805. source: {
  20806. type: "object"
  20807. },
  20808. "source.branch": {
  20809. enum: ["master", "gh-pages"],
  20810. type: "string"
  20811. },
  20812. "source.path": {
  20813. type: "string"
  20814. }
  20815. },
  20816. url: "/repos/:owner/:repo/pages"
  20817. },
  20818. enableVulnerabilityAlerts: {
  20819. headers: {
  20820. accept: "application/vnd.github.dorian-preview+json"
  20821. },
  20822. method: "PUT",
  20823. params: {
  20824. owner: {
  20825. required: true,
  20826. type: "string"
  20827. },
  20828. repo: {
  20829. required: true,
  20830. type: "string"
  20831. }
  20832. },
  20833. url: "/repos/:owner/:repo/vulnerability-alerts"
  20834. },
  20835. get: {
  20836. method: "GET",
  20837. params: {
  20838. owner: {
  20839. required: true,
  20840. type: "string"
  20841. },
  20842. repo: {
  20843. required: true,
  20844. type: "string"
  20845. }
  20846. },
  20847. url: "/repos/:owner/:repo"
  20848. },
  20849. getAppsWithAccessToProtectedBranch: {
  20850. method: "GET",
  20851. params: {
  20852. branch: {
  20853. required: true,
  20854. type: "string"
  20855. },
  20856. owner: {
  20857. required: true,
  20858. type: "string"
  20859. },
  20860. repo: {
  20861. required: true,
  20862. type: "string"
  20863. }
  20864. },
  20865. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20866. },
  20867. getArchiveLink: {
  20868. method: "GET",
  20869. params: {
  20870. archive_format: {
  20871. required: true,
  20872. type: "string"
  20873. },
  20874. owner: {
  20875. required: true,
  20876. type: "string"
  20877. },
  20878. ref: {
  20879. required: true,
  20880. type: "string"
  20881. },
  20882. repo: {
  20883. required: true,
  20884. type: "string"
  20885. }
  20886. },
  20887. url: "/repos/:owner/:repo/:archive_format/:ref"
  20888. },
  20889. getBranch: {
  20890. method: "GET",
  20891. params: {
  20892. branch: {
  20893. required: true,
  20894. type: "string"
  20895. },
  20896. owner: {
  20897. required: true,
  20898. type: "string"
  20899. },
  20900. repo: {
  20901. required: true,
  20902. type: "string"
  20903. }
  20904. },
  20905. url: "/repos/:owner/:repo/branches/:branch"
  20906. },
  20907. getBranchProtection: {
  20908. method: "GET",
  20909. params: {
  20910. branch: {
  20911. required: true,
  20912. type: "string"
  20913. },
  20914. owner: {
  20915. required: true,
  20916. type: "string"
  20917. },
  20918. repo: {
  20919. required: true,
  20920. type: "string"
  20921. }
  20922. },
  20923. url: "/repos/:owner/:repo/branches/:branch/protection"
  20924. },
  20925. getClones: {
  20926. method: "GET",
  20927. params: {
  20928. owner: {
  20929. required: true,
  20930. type: "string"
  20931. },
  20932. per: {
  20933. enum: ["day", "week"],
  20934. type: "string"
  20935. },
  20936. repo: {
  20937. required: true,
  20938. type: "string"
  20939. }
  20940. },
  20941. url: "/repos/:owner/:repo/traffic/clones"
  20942. },
  20943. getCodeFrequencyStats: {
  20944. method: "GET",
  20945. params: {
  20946. owner: {
  20947. required: true,
  20948. type: "string"
  20949. },
  20950. repo: {
  20951. required: true,
  20952. type: "string"
  20953. }
  20954. },
  20955. url: "/repos/:owner/:repo/stats/code_frequency"
  20956. },
  20957. getCollaboratorPermissionLevel: {
  20958. method: "GET",
  20959. params: {
  20960. owner: {
  20961. required: true,
  20962. type: "string"
  20963. },
  20964. repo: {
  20965. required: true,
  20966. type: "string"
  20967. },
  20968. username: {
  20969. required: true,
  20970. type: "string"
  20971. }
  20972. },
  20973. url: "/repos/:owner/:repo/collaborators/:username/permission"
  20974. },
  20975. getCombinedStatusForRef: {
  20976. method: "GET",
  20977. params: {
  20978. owner: {
  20979. required: true,
  20980. type: "string"
  20981. },
  20982. ref: {
  20983. required: true,
  20984. type: "string"
  20985. },
  20986. repo: {
  20987. required: true,
  20988. type: "string"
  20989. }
  20990. },
  20991. url: "/repos/:owner/:repo/commits/:ref/status"
  20992. },
  20993. getCommit: {
  20994. method: "GET",
  20995. params: {
  20996. commit_sha: {
  20997. alias: "ref",
  20998. deprecated: true,
  20999. type: "string"
  21000. },
  21001. owner: {
  21002. required: true,
  21003. type: "string"
  21004. },
  21005. ref: {
  21006. required: true,
  21007. type: "string"
  21008. },
  21009. repo: {
  21010. required: true,
  21011. type: "string"
  21012. },
  21013. sha: {
  21014. alias: "ref",
  21015. deprecated: true,
  21016. type: "string"
  21017. }
  21018. },
  21019. url: "/repos/:owner/:repo/commits/:ref"
  21020. },
  21021. getCommitActivityStats: {
  21022. method: "GET",
  21023. params: {
  21024. owner: {
  21025. required: true,
  21026. type: "string"
  21027. },
  21028. repo: {
  21029. required: true,
  21030. type: "string"
  21031. }
  21032. },
  21033. url: "/repos/:owner/:repo/stats/commit_activity"
  21034. },
  21035. getCommitComment: {
  21036. method: "GET",
  21037. params: {
  21038. comment_id: {
  21039. required: true,
  21040. type: "integer"
  21041. },
  21042. owner: {
  21043. required: true,
  21044. type: "string"
  21045. },
  21046. repo: {
  21047. required: true,
  21048. type: "string"
  21049. }
  21050. },
  21051. url: "/repos/:owner/:repo/comments/:comment_id"
  21052. },
  21053. getCommitRefSha: {
  21054. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21055. headers: {
  21056. accept: "application/vnd.github.v3.sha"
  21057. },
  21058. method: "GET",
  21059. params: {
  21060. owner: {
  21061. required: true,
  21062. type: "string"
  21063. },
  21064. ref: {
  21065. required: true,
  21066. type: "string"
  21067. },
  21068. repo: {
  21069. required: true,
  21070. type: "string"
  21071. }
  21072. },
  21073. url: "/repos/:owner/:repo/commits/:ref"
  21074. },
  21075. getContents: {
  21076. method: "GET",
  21077. params: {
  21078. owner: {
  21079. required: true,
  21080. type: "string"
  21081. },
  21082. path: {
  21083. required: true,
  21084. type: "string"
  21085. },
  21086. ref: {
  21087. type: "string"
  21088. },
  21089. repo: {
  21090. required: true,
  21091. type: "string"
  21092. }
  21093. },
  21094. url: "/repos/:owner/:repo/contents/:path"
  21095. },
  21096. getContributorsStats: {
  21097. method: "GET",
  21098. params: {
  21099. owner: {
  21100. required: true,
  21101. type: "string"
  21102. },
  21103. repo: {
  21104. required: true,
  21105. type: "string"
  21106. }
  21107. },
  21108. url: "/repos/:owner/:repo/stats/contributors"
  21109. },
  21110. getDeployKey: {
  21111. method: "GET",
  21112. params: {
  21113. key_id: {
  21114. required: true,
  21115. type: "integer"
  21116. },
  21117. owner: {
  21118. required: true,
  21119. type: "string"
  21120. },
  21121. repo: {
  21122. required: true,
  21123. type: "string"
  21124. }
  21125. },
  21126. url: "/repos/:owner/:repo/keys/:key_id"
  21127. },
  21128. getDeployment: {
  21129. method: "GET",
  21130. params: {
  21131. deployment_id: {
  21132. required: true,
  21133. type: "integer"
  21134. },
  21135. owner: {
  21136. required: true,
  21137. type: "string"
  21138. },
  21139. repo: {
  21140. required: true,
  21141. type: "string"
  21142. }
  21143. },
  21144. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21145. },
  21146. getDeploymentStatus: {
  21147. method: "GET",
  21148. params: {
  21149. deployment_id: {
  21150. required: true,
  21151. type: "integer"
  21152. },
  21153. owner: {
  21154. required: true,
  21155. type: "string"
  21156. },
  21157. repo: {
  21158. required: true,
  21159. type: "string"
  21160. },
  21161. status_id: {
  21162. required: true,
  21163. type: "integer"
  21164. }
  21165. },
  21166. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21167. },
  21168. getDownload: {
  21169. method: "GET",
  21170. params: {
  21171. download_id: {
  21172. required: true,
  21173. type: "integer"
  21174. },
  21175. owner: {
  21176. required: true,
  21177. type: "string"
  21178. },
  21179. repo: {
  21180. required: true,
  21181. type: "string"
  21182. }
  21183. },
  21184. url: "/repos/:owner/:repo/downloads/:download_id"
  21185. },
  21186. getHook: {
  21187. method: "GET",
  21188. params: {
  21189. hook_id: {
  21190. required: true,
  21191. type: "integer"
  21192. },
  21193. owner: {
  21194. required: true,
  21195. type: "string"
  21196. },
  21197. repo: {
  21198. required: true,
  21199. type: "string"
  21200. }
  21201. },
  21202. url: "/repos/:owner/:repo/hooks/:hook_id"
  21203. },
  21204. getLatestPagesBuild: {
  21205. method: "GET",
  21206. params: {
  21207. owner: {
  21208. required: true,
  21209. type: "string"
  21210. },
  21211. repo: {
  21212. required: true,
  21213. type: "string"
  21214. }
  21215. },
  21216. url: "/repos/:owner/:repo/pages/builds/latest"
  21217. },
  21218. getLatestRelease: {
  21219. method: "GET",
  21220. params: {
  21221. owner: {
  21222. required: true,
  21223. type: "string"
  21224. },
  21225. repo: {
  21226. required: true,
  21227. type: "string"
  21228. }
  21229. },
  21230. url: "/repos/:owner/:repo/releases/latest"
  21231. },
  21232. getPages: {
  21233. method: "GET",
  21234. params: {
  21235. owner: {
  21236. required: true,
  21237. type: "string"
  21238. },
  21239. repo: {
  21240. required: true,
  21241. type: "string"
  21242. }
  21243. },
  21244. url: "/repos/:owner/:repo/pages"
  21245. },
  21246. getPagesBuild: {
  21247. method: "GET",
  21248. params: {
  21249. build_id: {
  21250. required: true,
  21251. type: "integer"
  21252. },
  21253. owner: {
  21254. required: true,
  21255. type: "string"
  21256. },
  21257. repo: {
  21258. required: true,
  21259. type: "string"
  21260. }
  21261. },
  21262. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21263. },
  21264. getParticipationStats: {
  21265. method: "GET",
  21266. params: {
  21267. owner: {
  21268. required: true,
  21269. type: "string"
  21270. },
  21271. repo: {
  21272. required: true,
  21273. type: "string"
  21274. }
  21275. },
  21276. url: "/repos/:owner/:repo/stats/participation"
  21277. },
  21278. getProtectedBranchAdminEnforcement: {
  21279. method: "GET",
  21280. params: {
  21281. branch: {
  21282. required: true,
  21283. type: "string"
  21284. },
  21285. owner: {
  21286. required: true,
  21287. type: "string"
  21288. },
  21289. repo: {
  21290. required: true,
  21291. type: "string"
  21292. }
  21293. },
  21294. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21295. },
  21296. getProtectedBranchPullRequestReviewEnforcement: {
  21297. method: "GET",
  21298. params: {
  21299. branch: {
  21300. required: true,
  21301. type: "string"
  21302. },
  21303. owner: {
  21304. required: true,
  21305. type: "string"
  21306. },
  21307. repo: {
  21308. required: true,
  21309. type: "string"
  21310. }
  21311. },
  21312. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21313. },
  21314. getProtectedBranchRequiredSignatures: {
  21315. headers: {
  21316. accept: "application/vnd.github.zzzax-preview+json"
  21317. },
  21318. method: "GET",
  21319. params: {
  21320. branch: {
  21321. required: true,
  21322. type: "string"
  21323. },
  21324. owner: {
  21325. required: true,
  21326. type: "string"
  21327. },
  21328. repo: {
  21329. required: true,
  21330. type: "string"
  21331. }
  21332. },
  21333. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21334. },
  21335. getProtectedBranchRequiredStatusChecks: {
  21336. method: "GET",
  21337. params: {
  21338. branch: {
  21339. required: true,
  21340. type: "string"
  21341. },
  21342. owner: {
  21343. required: true,
  21344. type: "string"
  21345. },
  21346. repo: {
  21347. required: true,
  21348. type: "string"
  21349. }
  21350. },
  21351. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21352. },
  21353. getProtectedBranchRestrictions: {
  21354. method: "GET",
  21355. params: {
  21356. branch: {
  21357. required: true,
  21358. type: "string"
  21359. },
  21360. owner: {
  21361. required: true,
  21362. type: "string"
  21363. },
  21364. repo: {
  21365. required: true,
  21366. type: "string"
  21367. }
  21368. },
  21369. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21370. },
  21371. getPunchCardStats: {
  21372. method: "GET",
  21373. params: {
  21374. owner: {
  21375. required: true,
  21376. type: "string"
  21377. },
  21378. repo: {
  21379. required: true,
  21380. type: "string"
  21381. }
  21382. },
  21383. url: "/repos/:owner/:repo/stats/punch_card"
  21384. },
  21385. getReadme: {
  21386. method: "GET",
  21387. params: {
  21388. owner: {
  21389. required: true,
  21390. type: "string"
  21391. },
  21392. ref: {
  21393. type: "string"
  21394. },
  21395. repo: {
  21396. required: true,
  21397. type: "string"
  21398. }
  21399. },
  21400. url: "/repos/:owner/:repo/readme"
  21401. },
  21402. getRelease: {
  21403. method: "GET",
  21404. params: {
  21405. owner: {
  21406. required: true,
  21407. type: "string"
  21408. },
  21409. release_id: {
  21410. required: true,
  21411. type: "integer"
  21412. },
  21413. repo: {
  21414. required: true,
  21415. type: "string"
  21416. }
  21417. },
  21418. url: "/repos/:owner/:repo/releases/:release_id"
  21419. },
  21420. getReleaseAsset: {
  21421. method: "GET",
  21422. params: {
  21423. asset_id: {
  21424. required: true,
  21425. type: "integer"
  21426. },
  21427. owner: {
  21428. required: true,
  21429. type: "string"
  21430. },
  21431. repo: {
  21432. required: true,
  21433. type: "string"
  21434. }
  21435. },
  21436. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21437. },
  21438. getReleaseByTag: {
  21439. method: "GET",
  21440. params: {
  21441. owner: {
  21442. required: true,
  21443. type: "string"
  21444. },
  21445. repo: {
  21446. required: true,
  21447. type: "string"
  21448. },
  21449. tag: {
  21450. required: true,
  21451. type: "string"
  21452. }
  21453. },
  21454. url: "/repos/:owner/:repo/releases/tags/:tag"
  21455. },
  21456. getTeamsWithAccessToProtectedBranch: {
  21457. method: "GET",
  21458. params: {
  21459. branch: {
  21460. required: true,
  21461. type: "string"
  21462. },
  21463. owner: {
  21464. required: true,
  21465. type: "string"
  21466. },
  21467. repo: {
  21468. required: true,
  21469. type: "string"
  21470. }
  21471. },
  21472. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21473. },
  21474. getTopPaths: {
  21475. method: "GET",
  21476. params: {
  21477. owner: {
  21478. required: true,
  21479. type: "string"
  21480. },
  21481. repo: {
  21482. required: true,
  21483. type: "string"
  21484. }
  21485. },
  21486. url: "/repos/:owner/:repo/traffic/popular/paths"
  21487. },
  21488. getTopReferrers: {
  21489. method: "GET",
  21490. params: {
  21491. owner: {
  21492. required: true,
  21493. type: "string"
  21494. },
  21495. repo: {
  21496. required: true,
  21497. type: "string"
  21498. }
  21499. },
  21500. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21501. },
  21502. getUsersWithAccessToProtectedBranch: {
  21503. method: "GET",
  21504. params: {
  21505. branch: {
  21506. required: true,
  21507. type: "string"
  21508. },
  21509. owner: {
  21510. required: true,
  21511. type: "string"
  21512. },
  21513. repo: {
  21514. required: true,
  21515. type: "string"
  21516. }
  21517. },
  21518. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21519. },
  21520. getViews: {
  21521. method: "GET",
  21522. params: {
  21523. owner: {
  21524. required: true,
  21525. type: "string"
  21526. },
  21527. per: {
  21528. enum: ["day", "week"],
  21529. type: "string"
  21530. },
  21531. repo: {
  21532. required: true,
  21533. type: "string"
  21534. }
  21535. },
  21536. url: "/repos/:owner/:repo/traffic/views"
  21537. },
  21538. list: {
  21539. method: "GET",
  21540. params: {
  21541. affiliation: {
  21542. type: "string"
  21543. },
  21544. direction: {
  21545. enum: ["asc", "desc"],
  21546. type: "string"
  21547. },
  21548. page: {
  21549. type: "integer"
  21550. },
  21551. per_page: {
  21552. type: "integer"
  21553. },
  21554. sort: {
  21555. enum: ["created", "updated", "pushed", "full_name"],
  21556. type: "string"
  21557. },
  21558. type: {
  21559. enum: ["all", "owner", "public", "private", "member"],
  21560. type: "string"
  21561. },
  21562. visibility: {
  21563. enum: ["all", "public", "private"],
  21564. type: "string"
  21565. }
  21566. },
  21567. url: "/user/repos"
  21568. },
  21569. listAppsWithAccessToProtectedBranch: {
  21570. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21571. method: "GET",
  21572. params: {
  21573. branch: {
  21574. required: true,
  21575. type: "string"
  21576. },
  21577. owner: {
  21578. required: true,
  21579. type: "string"
  21580. },
  21581. repo: {
  21582. required: true,
  21583. type: "string"
  21584. }
  21585. },
  21586. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21587. },
  21588. listAssetsForRelease: {
  21589. method: "GET",
  21590. params: {
  21591. owner: {
  21592. required: true,
  21593. type: "string"
  21594. },
  21595. page: {
  21596. type: "integer"
  21597. },
  21598. per_page: {
  21599. type: "integer"
  21600. },
  21601. release_id: {
  21602. required: true,
  21603. type: "integer"
  21604. },
  21605. repo: {
  21606. required: true,
  21607. type: "string"
  21608. }
  21609. },
  21610. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21611. },
  21612. listBranches: {
  21613. method: "GET",
  21614. params: {
  21615. owner: {
  21616. required: true,
  21617. type: "string"
  21618. },
  21619. page: {
  21620. type: "integer"
  21621. },
  21622. per_page: {
  21623. type: "integer"
  21624. },
  21625. protected: {
  21626. type: "boolean"
  21627. },
  21628. repo: {
  21629. required: true,
  21630. type: "string"
  21631. }
  21632. },
  21633. url: "/repos/:owner/:repo/branches"
  21634. },
  21635. listBranchesForHeadCommit: {
  21636. headers: {
  21637. accept: "application/vnd.github.groot-preview+json"
  21638. },
  21639. method: "GET",
  21640. params: {
  21641. commit_sha: {
  21642. required: true,
  21643. type: "string"
  21644. },
  21645. owner: {
  21646. required: true,
  21647. type: "string"
  21648. },
  21649. repo: {
  21650. required: true,
  21651. type: "string"
  21652. }
  21653. },
  21654. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21655. },
  21656. listCollaborators: {
  21657. method: "GET",
  21658. params: {
  21659. affiliation: {
  21660. enum: ["outside", "direct", "all"],
  21661. type: "string"
  21662. },
  21663. owner: {
  21664. required: true,
  21665. type: "string"
  21666. },
  21667. page: {
  21668. type: "integer"
  21669. },
  21670. per_page: {
  21671. type: "integer"
  21672. },
  21673. repo: {
  21674. required: true,
  21675. type: "string"
  21676. }
  21677. },
  21678. url: "/repos/:owner/:repo/collaborators"
  21679. },
  21680. listCommentsForCommit: {
  21681. method: "GET",
  21682. params: {
  21683. commit_sha: {
  21684. required: true,
  21685. type: "string"
  21686. },
  21687. owner: {
  21688. required: true,
  21689. type: "string"
  21690. },
  21691. page: {
  21692. type: "integer"
  21693. },
  21694. per_page: {
  21695. type: "integer"
  21696. },
  21697. ref: {
  21698. alias: "commit_sha",
  21699. deprecated: true,
  21700. type: "string"
  21701. },
  21702. repo: {
  21703. required: true,
  21704. type: "string"
  21705. }
  21706. },
  21707. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21708. },
  21709. listCommitComments: {
  21710. method: "GET",
  21711. params: {
  21712. owner: {
  21713. required: true,
  21714. type: "string"
  21715. },
  21716. page: {
  21717. type: "integer"
  21718. },
  21719. per_page: {
  21720. type: "integer"
  21721. },
  21722. repo: {
  21723. required: true,
  21724. type: "string"
  21725. }
  21726. },
  21727. url: "/repos/:owner/:repo/comments"
  21728. },
  21729. listCommits: {
  21730. method: "GET",
  21731. params: {
  21732. author: {
  21733. type: "string"
  21734. },
  21735. owner: {
  21736. required: true,
  21737. type: "string"
  21738. },
  21739. page: {
  21740. type: "integer"
  21741. },
  21742. path: {
  21743. type: "string"
  21744. },
  21745. per_page: {
  21746. type: "integer"
  21747. },
  21748. repo: {
  21749. required: true,
  21750. type: "string"
  21751. },
  21752. sha: {
  21753. type: "string"
  21754. },
  21755. since: {
  21756. type: "string"
  21757. },
  21758. until: {
  21759. type: "string"
  21760. }
  21761. },
  21762. url: "/repos/:owner/:repo/commits"
  21763. },
  21764. listContributors: {
  21765. method: "GET",
  21766. params: {
  21767. anon: {
  21768. type: "string"
  21769. },
  21770. owner: {
  21771. required: true,
  21772. type: "string"
  21773. },
  21774. page: {
  21775. type: "integer"
  21776. },
  21777. per_page: {
  21778. type: "integer"
  21779. },
  21780. repo: {
  21781. required: true,
  21782. type: "string"
  21783. }
  21784. },
  21785. url: "/repos/:owner/:repo/contributors"
  21786. },
  21787. listDeployKeys: {
  21788. method: "GET",
  21789. params: {
  21790. owner: {
  21791. required: true,
  21792. type: "string"
  21793. },
  21794. page: {
  21795. type: "integer"
  21796. },
  21797. per_page: {
  21798. type: "integer"
  21799. },
  21800. repo: {
  21801. required: true,
  21802. type: "string"
  21803. }
  21804. },
  21805. url: "/repos/:owner/:repo/keys"
  21806. },
  21807. listDeploymentStatuses: {
  21808. method: "GET",
  21809. params: {
  21810. deployment_id: {
  21811. required: true,
  21812. type: "integer"
  21813. },
  21814. owner: {
  21815. required: true,
  21816. type: "string"
  21817. },
  21818. page: {
  21819. type: "integer"
  21820. },
  21821. per_page: {
  21822. type: "integer"
  21823. },
  21824. repo: {
  21825. required: true,
  21826. type: "string"
  21827. }
  21828. },
  21829. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  21830. },
  21831. listDeployments: {
  21832. method: "GET",
  21833. params: {
  21834. environment: {
  21835. type: "string"
  21836. },
  21837. owner: {
  21838. required: true,
  21839. type: "string"
  21840. },
  21841. page: {
  21842. type: "integer"
  21843. },
  21844. per_page: {
  21845. type: "integer"
  21846. },
  21847. ref: {
  21848. type: "string"
  21849. },
  21850. repo: {
  21851. required: true,
  21852. type: "string"
  21853. },
  21854. sha: {
  21855. type: "string"
  21856. },
  21857. task: {
  21858. type: "string"
  21859. }
  21860. },
  21861. url: "/repos/:owner/:repo/deployments"
  21862. },
  21863. listDownloads: {
  21864. method: "GET",
  21865. params: {
  21866. owner: {
  21867. required: true,
  21868. type: "string"
  21869. },
  21870. page: {
  21871. type: "integer"
  21872. },
  21873. per_page: {
  21874. type: "integer"
  21875. },
  21876. repo: {
  21877. required: true,
  21878. type: "string"
  21879. }
  21880. },
  21881. url: "/repos/:owner/:repo/downloads"
  21882. },
  21883. listForOrg: {
  21884. method: "GET",
  21885. params: {
  21886. direction: {
  21887. enum: ["asc", "desc"],
  21888. type: "string"
  21889. },
  21890. org: {
  21891. required: true,
  21892. type: "string"
  21893. },
  21894. page: {
  21895. type: "integer"
  21896. },
  21897. per_page: {
  21898. type: "integer"
  21899. },
  21900. sort: {
  21901. enum: ["created", "updated", "pushed", "full_name"],
  21902. type: "string"
  21903. },
  21904. type: {
  21905. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  21906. type: "string"
  21907. }
  21908. },
  21909. url: "/orgs/:org/repos"
  21910. },
  21911. listForUser: {
  21912. method: "GET",
  21913. params: {
  21914. direction: {
  21915. enum: ["asc", "desc"],
  21916. type: "string"
  21917. },
  21918. page: {
  21919. type: "integer"
  21920. },
  21921. per_page: {
  21922. type: "integer"
  21923. },
  21924. sort: {
  21925. enum: ["created", "updated", "pushed", "full_name"],
  21926. type: "string"
  21927. },
  21928. type: {
  21929. enum: ["all", "owner", "member"],
  21930. type: "string"
  21931. },
  21932. username: {
  21933. required: true,
  21934. type: "string"
  21935. }
  21936. },
  21937. url: "/users/:username/repos"
  21938. },
  21939. listForks: {
  21940. method: "GET",
  21941. params: {
  21942. owner: {
  21943. required: true,
  21944. type: "string"
  21945. },
  21946. page: {
  21947. type: "integer"
  21948. },
  21949. per_page: {
  21950. type: "integer"
  21951. },
  21952. repo: {
  21953. required: true,
  21954. type: "string"
  21955. },
  21956. sort: {
  21957. enum: ["newest", "oldest", "stargazers"],
  21958. type: "string"
  21959. }
  21960. },
  21961. url: "/repos/:owner/:repo/forks"
  21962. },
  21963. listHooks: {
  21964. method: "GET",
  21965. params: {
  21966. owner: {
  21967. required: true,
  21968. type: "string"
  21969. },
  21970. page: {
  21971. type: "integer"
  21972. },
  21973. per_page: {
  21974. type: "integer"
  21975. },
  21976. repo: {
  21977. required: true,
  21978. type: "string"
  21979. }
  21980. },
  21981. url: "/repos/:owner/:repo/hooks"
  21982. },
  21983. listInvitations: {
  21984. method: "GET",
  21985. params: {
  21986. owner: {
  21987. required: true,
  21988. type: "string"
  21989. },
  21990. page: {
  21991. type: "integer"
  21992. },
  21993. per_page: {
  21994. type: "integer"
  21995. },
  21996. repo: {
  21997. required: true,
  21998. type: "string"
  21999. }
  22000. },
  22001. url: "/repos/:owner/:repo/invitations"
  22002. },
  22003. listInvitationsForAuthenticatedUser: {
  22004. method: "GET",
  22005. params: {
  22006. page: {
  22007. type: "integer"
  22008. },
  22009. per_page: {
  22010. type: "integer"
  22011. }
  22012. },
  22013. url: "/user/repository_invitations"
  22014. },
  22015. listLanguages: {
  22016. method: "GET",
  22017. params: {
  22018. owner: {
  22019. required: true,
  22020. type: "string"
  22021. },
  22022. repo: {
  22023. required: true,
  22024. type: "string"
  22025. }
  22026. },
  22027. url: "/repos/:owner/:repo/languages"
  22028. },
  22029. listPagesBuilds: {
  22030. method: "GET",
  22031. params: {
  22032. owner: {
  22033. required: true,
  22034. type: "string"
  22035. },
  22036. page: {
  22037. type: "integer"
  22038. },
  22039. per_page: {
  22040. type: "integer"
  22041. },
  22042. repo: {
  22043. required: true,
  22044. type: "string"
  22045. }
  22046. },
  22047. url: "/repos/:owner/:repo/pages/builds"
  22048. },
  22049. listProtectedBranchRequiredStatusChecksContexts: {
  22050. method: "GET",
  22051. params: {
  22052. branch: {
  22053. required: true,
  22054. type: "string"
  22055. },
  22056. owner: {
  22057. required: true,
  22058. type: "string"
  22059. },
  22060. repo: {
  22061. required: true,
  22062. type: "string"
  22063. }
  22064. },
  22065. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22066. },
  22067. listProtectedBranchTeamRestrictions: {
  22068. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22069. method: "GET",
  22070. params: {
  22071. branch: {
  22072. required: true,
  22073. type: "string"
  22074. },
  22075. owner: {
  22076. required: true,
  22077. type: "string"
  22078. },
  22079. repo: {
  22080. required: true,
  22081. type: "string"
  22082. }
  22083. },
  22084. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22085. },
  22086. listProtectedBranchUserRestrictions: {
  22087. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22088. method: "GET",
  22089. params: {
  22090. branch: {
  22091. required: true,
  22092. type: "string"
  22093. },
  22094. owner: {
  22095. required: true,
  22096. type: "string"
  22097. },
  22098. repo: {
  22099. required: true,
  22100. type: "string"
  22101. }
  22102. },
  22103. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22104. },
  22105. listPublic: {
  22106. method: "GET",
  22107. params: {
  22108. page: {
  22109. type: "integer"
  22110. },
  22111. per_page: {
  22112. type: "integer"
  22113. },
  22114. since: {
  22115. type: "integer"
  22116. }
  22117. },
  22118. url: "/repositories"
  22119. },
  22120. listPullRequestsAssociatedWithCommit: {
  22121. headers: {
  22122. accept: "application/vnd.github.groot-preview+json"
  22123. },
  22124. method: "GET",
  22125. params: {
  22126. commit_sha: {
  22127. required: true,
  22128. type: "string"
  22129. },
  22130. owner: {
  22131. required: true,
  22132. type: "string"
  22133. },
  22134. page: {
  22135. type: "integer"
  22136. },
  22137. per_page: {
  22138. type: "integer"
  22139. },
  22140. repo: {
  22141. required: true,
  22142. type: "string"
  22143. }
  22144. },
  22145. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22146. },
  22147. listReleases: {
  22148. method: "GET",
  22149. params: {
  22150. owner: {
  22151. required: true,
  22152. type: "string"
  22153. },
  22154. page: {
  22155. type: "integer"
  22156. },
  22157. per_page: {
  22158. type: "integer"
  22159. },
  22160. repo: {
  22161. required: true,
  22162. type: "string"
  22163. }
  22164. },
  22165. url: "/repos/:owner/:repo/releases"
  22166. },
  22167. listStatusesForRef: {
  22168. method: "GET",
  22169. params: {
  22170. owner: {
  22171. required: true,
  22172. type: "string"
  22173. },
  22174. page: {
  22175. type: "integer"
  22176. },
  22177. per_page: {
  22178. type: "integer"
  22179. },
  22180. ref: {
  22181. required: true,
  22182. type: "string"
  22183. },
  22184. repo: {
  22185. required: true,
  22186. type: "string"
  22187. }
  22188. },
  22189. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22190. },
  22191. listTags: {
  22192. method: "GET",
  22193. params: {
  22194. owner: {
  22195. required: true,
  22196. type: "string"
  22197. },
  22198. page: {
  22199. type: "integer"
  22200. },
  22201. per_page: {
  22202. type: "integer"
  22203. },
  22204. repo: {
  22205. required: true,
  22206. type: "string"
  22207. }
  22208. },
  22209. url: "/repos/:owner/:repo/tags"
  22210. },
  22211. listTeams: {
  22212. method: "GET",
  22213. params: {
  22214. owner: {
  22215. required: true,
  22216. type: "string"
  22217. },
  22218. page: {
  22219. type: "integer"
  22220. },
  22221. per_page: {
  22222. type: "integer"
  22223. },
  22224. repo: {
  22225. required: true,
  22226. type: "string"
  22227. }
  22228. },
  22229. url: "/repos/:owner/:repo/teams"
  22230. },
  22231. listTeamsWithAccessToProtectedBranch: {
  22232. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22233. method: "GET",
  22234. params: {
  22235. branch: {
  22236. required: true,
  22237. type: "string"
  22238. },
  22239. owner: {
  22240. required: true,
  22241. type: "string"
  22242. },
  22243. repo: {
  22244. required: true,
  22245. type: "string"
  22246. }
  22247. },
  22248. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22249. },
  22250. listTopics: {
  22251. headers: {
  22252. accept: "application/vnd.github.mercy-preview+json"
  22253. },
  22254. method: "GET",
  22255. params: {
  22256. owner: {
  22257. required: true,
  22258. type: "string"
  22259. },
  22260. repo: {
  22261. required: true,
  22262. type: "string"
  22263. }
  22264. },
  22265. url: "/repos/:owner/:repo/topics"
  22266. },
  22267. listUsersWithAccessToProtectedBranch: {
  22268. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22269. method: "GET",
  22270. params: {
  22271. branch: {
  22272. required: true,
  22273. type: "string"
  22274. },
  22275. owner: {
  22276. required: true,
  22277. type: "string"
  22278. },
  22279. repo: {
  22280. required: true,
  22281. type: "string"
  22282. }
  22283. },
  22284. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22285. },
  22286. merge: {
  22287. method: "POST",
  22288. params: {
  22289. base: {
  22290. required: true,
  22291. type: "string"
  22292. },
  22293. commit_message: {
  22294. type: "string"
  22295. },
  22296. head: {
  22297. required: true,
  22298. type: "string"
  22299. },
  22300. owner: {
  22301. required: true,
  22302. type: "string"
  22303. },
  22304. repo: {
  22305. required: true,
  22306. type: "string"
  22307. }
  22308. },
  22309. url: "/repos/:owner/:repo/merges"
  22310. },
  22311. pingHook: {
  22312. method: "POST",
  22313. params: {
  22314. hook_id: {
  22315. required: true,
  22316. type: "integer"
  22317. },
  22318. owner: {
  22319. required: true,
  22320. type: "string"
  22321. },
  22322. repo: {
  22323. required: true,
  22324. type: "string"
  22325. }
  22326. },
  22327. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22328. },
  22329. removeBranchProtection: {
  22330. method: "DELETE",
  22331. params: {
  22332. branch: {
  22333. required: true,
  22334. type: "string"
  22335. },
  22336. owner: {
  22337. required: true,
  22338. type: "string"
  22339. },
  22340. repo: {
  22341. required: true,
  22342. type: "string"
  22343. }
  22344. },
  22345. url: "/repos/:owner/:repo/branches/:branch/protection"
  22346. },
  22347. removeCollaborator: {
  22348. method: "DELETE",
  22349. params: {
  22350. owner: {
  22351. required: true,
  22352. type: "string"
  22353. },
  22354. repo: {
  22355. required: true,
  22356. type: "string"
  22357. },
  22358. username: {
  22359. required: true,
  22360. type: "string"
  22361. }
  22362. },
  22363. url: "/repos/:owner/:repo/collaborators/:username"
  22364. },
  22365. removeDeployKey: {
  22366. method: "DELETE",
  22367. params: {
  22368. key_id: {
  22369. required: true,
  22370. type: "integer"
  22371. },
  22372. owner: {
  22373. required: true,
  22374. type: "string"
  22375. },
  22376. repo: {
  22377. required: true,
  22378. type: "string"
  22379. }
  22380. },
  22381. url: "/repos/:owner/:repo/keys/:key_id"
  22382. },
  22383. removeProtectedBranchAdminEnforcement: {
  22384. method: "DELETE",
  22385. params: {
  22386. branch: {
  22387. required: true,
  22388. type: "string"
  22389. },
  22390. owner: {
  22391. required: true,
  22392. type: "string"
  22393. },
  22394. repo: {
  22395. required: true,
  22396. type: "string"
  22397. }
  22398. },
  22399. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22400. },
  22401. removeProtectedBranchAppRestrictions: {
  22402. method: "DELETE",
  22403. params: {
  22404. apps: {
  22405. mapTo: "data",
  22406. required: true,
  22407. type: "string[]"
  22408. },
  22409. branch: {
  22410. required: true,
  22411. type: "string"
  22412. },
  22413. owner: {
  22414. required: true,
  22415. type: "string"
  22416. },
  22417. repo: {
  22418. required: true,
  22419. type: "string"
  22420. }
  22421. },
  22422. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22423. },
  22424. removeProtectedBranchPullRequestReviewEnforcement: {
  22425. method: "DELETE",
  22426. params: {
  22427. branch: {
  22428. required: true,
  22429. type: "string"
  22430. },
  22431. owner: {
  22432. required: true,
  22433. type: "string"
  22434. },
  22435. repo: {
  22436. required: true,
  22437. type: "string"
  22438. }
  22439. },
  22440. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22441. },
  22442. removeProtectedBranchRequiredSignatures: {
  22443. headers: {
  22444. accept: "application/vnd.github.zzzax-preview+json"
  22445. },
  22446. method: "DELETE",
  22447. params: {
  22448. branch: {
  22449. required: true,
  22450. type: "string"
  22451. },
  22452. owner: {
  22453. required: true,
  22454. type: "string"
  22455. },
  22456. repo: {
  22457. required: true,
  22458. type: "string"
  22459. }
  22460. },
  22461. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22462. },
  22463. removeProtectedBranchRequiredStatusChecks: {
  22464. method: "DELETE",
  22465. params: {
  22466. branch: {
  22467. required: true,
  22468. type: "string"
  22469. },
  22470. owner: {
  22471. required: true,
  22472. type: "string"
  22473. },
  22474. repo: {
  22475. required: true,
  22476. type: "string"
  22477. }
  22478. },
  22479. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22480. },
  22481. removeProtectedBranchRequiredStatusChecksContexts: {
  22482. method: "DELETE",
  22483. params: {
  22484. branch: {
  22485. required: true,
  22486. type: "string"
  22487. },
  22488. contexts: {
  22489. mapTo: "data",
  22490. required: true,
  22491. type: "string[]"
  22492. },
  22493. owner: {
  22494. required: true,
  22495. type: "string"
  22496. },
  22497. repo: {
  22498. required: true,
  22499. type: "string"
  22500. }
  22501. },
  22502. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22503. },
  22504. removeProtectedBranchRestrictions: {
  22505. method: "DELETE",
  22506. params: {
  22507. branch: {
  22508. required: true,
  22509. type: "string"
  22510. },
  22511. owner: {
  22512. required: true,
  22513. type: "string"
  22514. },
  22515. repo: {
  22516. required: true,
  22517. type: "string"
  22518. }
  22519. },
  22520. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22521. },
  22522. removeProtectedBranchTeamRestrictions: {
  22523. method: "DELETE",
  22524. params: {
  22525. branch: {
  22526. required: true,
  22527. type: "string"
  22528. },
  22529. owner: {
  22530. required: true,
  22531. type: "string"
  22532. },
  22533. repo: {
  22534. required: true,
  22535. type: "string"
  22536. },
  22537. teams: {
  22538. mapTo: "data",
  22539. required: true,
  22540. type: "string[]"
  22541. }
  22542. },
  22543. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22544. },
  22545. removeProtectedBranchUserRestrictions: {
  22546. method: "DELETE",
  22547. params: {
  22548. branch: {
  22549. required: true,
  22550. type: "string"
  22551. },
  22552. owner: {
  22553. required: true,
  22554. type: "string"
  22555. },
  22556. repo: {
  22557. required: true,
  22558. type: "string"
  22559. },
  22560. users: {
  22561. mapTo: "data",
  22562. required: true,
  22563. type: "string[]"
  22564. }
  22565. },
  22566. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22567. },
  22568. replaceProtectedBranchAppRestrictions: {
  22569. method: "PUT",
  22570. params: {
  22571. apps: {
  22572. mapTo: "data",
  22573. required: true,
  22574. type: "string[]"
  22575. },
  22576. branch: {
  22577. required: true,
  22578. type: "string"
  22579. },
  22580. owner: {
  22581. required: true,
  22582. type: "string"
  22583. },
  22584. repo: {
  22585. required: true,
  22586. type: "string"
  22587. }
  22588. },
  22589. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22590. },
  22591. replaceProtectedBranchRequiredStatusChecksContexts: {
  22592. method: "PUT",
  22593. params: {
  22594. branch: {
  22595. required: true,
  22596. type: "string"
  22597. },
  22598. contexts: {
  22599. mapTo: "data",
  22600. required: true,
  22601. type: "string[]"
  22602. },
  22603. owner: {
  22604. required: true,
  22605. type: "string"
  22606. },
  22607. repo: {
  22608. required: true,
  22609. type: "string"
  22610. }
  22611. },
  22612. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22613. },
  22614. replaceProtectedBranchTeamRestrictions: {
  22615. method: "PUT",
  22616. params: {
  22617. branch: {
  22618. required: true,
  22619. type: "string"
  22620. },
  22621. owner: {
  22622. required: true,
  22623. type: "string"
  22624. },
  22625. repo: {
  22626. required: true,
  22627. type: "string"
  22628. },
  22629. teams: {
  22630. mapTo: "data",
  22631. required: true,
  22632. type: "string[]"
  22633. }
  22634. },
  22635. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22636. },
  22637. replaceProtectedBranchUserRestrictions: {
  22638. method: "PUT",
  22639. params: {
  22640. branch: {
  22641. required: true,
  22642. type: "string"
  22643. },
  22644. owner: {
  22645. required: true,
  22646. type: "string"
  22647. },
  22648. repo: {
  22649. required: true,
  22650. type: "string"
  22651. },
  22652. users: {
  22653. mapTo: "data",
  22654. required: true,
  22655. type: "string[]"
  22656. }
  22657. },
  22658. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22659. },
  22660. replaceTopics: {
  22661. headers: {
  22662. accept: "application/vnd.github.mercy-preview+json"
  22663. },
  22664. method: "PUT",
  22665. params: {
  22666. names: {
  22667. required: true,
  22668. type: "string[]"
  22669. },
  22670. owner: {
  22671. required: true,
  22672. type: "string"
  22673. },
  22674. repo: {
  22675. required: true,
  22676. type: "string"
  22677. }
  22678. },
  22679. url: "/repos/:owner/:repo/topics"
  22680. },
  22681. requestPageBuild: {
  22682. method: "POST",
  22683. params: {
  22684. owner: {
  22685. required: true,
  22686. type: "string"
  22687. },
  22688. repo: {
  22689. required: true,
  22690. type: "string"
  22691. }
  22692. },
  22693. url: "/repos/:owner/:repo/pages/builds"
  22694. },
  22695. retrieveCommunityProfileMetrics: {
  22696. method: "GET",
  22697. params: {
  22698. owner: {
  22699. required: true,
  22700. type: "string"
  22701. },
  22702. repo: {
  22703. required: true,
  22704. type: "string"
  22705. }
  22706. },
  22707. url: "/repos/:owner/:repo/community/profile"
  22708. },
  22709. testPushHook: {
  22710. method: "POST",
  22711. params: {
  22712. hook_id: {
  22713. required: true,
  22714. type: "integer"
  22715. },
  22716. owner: {
  22717. required: true,
  22718. type: "string"
  22719. },
  22720. repo: {
  22721. required: true,
  22722. type: "string"
  22723. }
  22724. },
  22725. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22726. },
  22727. transfer: {
  22728. method: "POST",
  22729. params: {
  22730. new_owner: {
  22731. type: "string"
  22732. },
  22733. owner: {
  22734. required: true,
  22735. type: "string"
  22736. },
  22737. repo: {
  22738. required: true,
  22739. type: "string"
  22740. },
  22741. team_ids: {
  22742. type: "integer[]"
  22743. }
  22744. },
  22745. url: "/repos/:owner/:repo/transfer"
  22746. },
  22747. update: {
  22748. method: "PATCH",
  22749. params: {
  22750. allow_merge_commit: {
  22751. type: "boolean"
  22752. },
  22753. allow_rebase_merge: {
  22754. type: "boolean"
  22755. },
  22756. allow_squash_merge: {
  22757. type: "boolean"
  22758. },
  22759. archived: {
  22760. type: "boolean"
  22761. },
  22762. default_branch: {
  22763. type: "string"
  22764. },
  22765. delete_branch_on_merge: {
  22766. type: "boolean"
  22767. },
  22768. description: {
  22769. type: "string"
  22770. },
  22771. has_issues: {
  22772. type: "boolean"
  22773. },
  22774. has_projects: {
  22775. type: "boolean"
  22776. },
  22777. has_wiki: {
  22778. type: "boolean"
  22779. },
  22780. homepage: {
  22781. type: "string"
  22782. },
  22783. is_template: {
  22784. type: "boolean"
  22785. },
  22786. name: {
  22787. type: "string"
  22788. },
  22789. owner: {
  22790. required: true,
  22791. type: "string"
  22792. },
  22793. private: {
  22794. type: "boolean"
  22795. },
  22796. repo: {
  22797. required: true,
  22798. type: "string"
  22799. },
  22800. visibility: {
  22801. enum: ["public", "private", "visibility", "internal"],
  22802. type: "string"
  22803. }
  22804. },
  22805. url: "/repos/:owner/:repo"
  22806. },
  22807. updateBranchProtection: {
  22808. method: "PUT",
  22809. params: {
  22810. allow_deletions: {
  22811. type: "boolean"
  22812. },
  22813. allow_force_pushes: {
  22814. allowNull: true,
  22815. type: "boolean"
  22816. },
  22817. branch: {
  22818. required: true,
  22819. type: "string"
  22820. },
  22821. enforce_admins: {
  22822. allowNull: true,
  22823. required: true,
  22824. type: "boolean"
  22825. },
  22826. owner: {
  22827. required: true,
  22828. type: "string"
  22829. },
  22830. repo: {
  22831. required: true,
  22832. type: "string"
  22833. },
  22834. required_linear_history: {
  22835. type: "boolean"
  22836. },
  22837. required_pull_request_reviews: {
  22838. allowNull: true,
  22839. required: true,
  22840. type: "object"
  22841. },
  22842. "required_pull_request_reviews.dismiss_stale_reviews": {
  22843. type: "boolean"
  22844. },
  22845. "required_pull_request_reviews.dismissal_restrictions": {
  22846. type: "object"
  22847. },
  22848. "required_pull_request_reviews.dismissal_restrictions.teams": {
  22849. type: "string[]"
  22850. },
  22851. "required_pull_request_reviews.dismissal_restrictions.users": {
  22852. type: "string[]"
  22853. },
  22854. "required_pull_request_reviews.require_code_owner_reviews": {
  22855. type: "boolean"
  22856. },
  22857. "required_pull_request_reviews.required_approving_review_count": {
  22858. type: "integer"
  22859. },
  22860. required_status_checks: {
  22861. allowNull: true,
  22862. required: true,
  22863. type: "object"
  22864. },
  22865. "required_status_checks.contexts": {
  22866. required: true,
  22867. type: "string[]"
  22868. },
  22869. "required_status_checks.strict": {
  22870. required: true,
  22871. type: "boolean"
  22872. },
  22873. restrictions: {
  22874. allowNull: true,
  22875. required: true,
  22876. type: "object"
  22877. },
  22878. "restrictions.apps": {
  22879. type: "string[]"
  22880. },
  22881. "restrictions.teams": {
  22882. required: true,
  22883. type: "string[]"
  22884. },
  22885. "restrictions.users": {
  22886. required: true,
  22887. type: "string[]"
  22888. }
  22889. },
  22890. url: "/repos/:owner/:repo/branches/:branch/protection"
  22891. },
  22892. updateCommitComment: {
  22893. method: "PATCH",
  22894. params: {
  22895. body: {
  22896. required: true,
  22897. type: "string"
  22898. },
  22899. comment_id: {
  22900. required: true,
  22901. type: "integer"
  22902. },
  22903. owner: {
  22904. required: true,
  22905. type: "string"
  22906. },
  22907. repo: {
  22908. required: true,
  22909. type: "string"
  22910. }
  22911. },
  22912. url: "/repos/:owner/:repo/comments/:comment_id"
  22913. },
  22914. updateFile: {
  22915. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  22916. method: "PUT",
  22917. params: {
  22918. author: {
  22919. type: "object"
  22920. },
  22921. "author.email": {
  22922. required: true,
  22923. type: "string"
  22924. },
  22925. "author.name": {
  22926. required: true,
  22927. type: "string"
  22928. },
  22929. branch: {
  22930. type: "string"
  22931. },
  22932. committer: {
  22933. type: "object"
  22934. },
  22935. "committer.email": {
  22936. required: true,
  22937. type: "string"
  22938. },
  22939. "committer.name": {
  22940. required: true,
  22941. type: "string"
  22942. },
  22943. content: {
  22944. required: true,
  22945. type: "string"
  22946. },
  22947. message: {
  22948. required: true,
  22949. type: "string"
  22950. },
  22951. owner: {
  22952. required: true,
  22953. type: "string"
  22954. },
  22955. path: {
  22956. required: true,
  22957. type: "string"
  22958. },
  22959. repo: {
  22960. required: true,
  22961. type: "string"
  22962. },
  22963. sha: {
  22964. type: "string"
  22965. }
  22966. },
  22967. url: "/repos/:owner/:repo/contents/:path"
  22968. },
  22969. updateHook: {
  22970. method: "PATCH",
  22971. params: {
  22972. active: {
  22973. type: "boolean"
  22974. },
  22975. add_events: {
  22976. type: "string[]"
  22977. },
  22978. config: {
  22979. type: "object"
  22980. },
  22981. "config.content_type": {
  22982. type: "string"
  22983. },
  22984. "config.insecure_ssl": {
  22985. type: "string"
  22986. },
  22987. "config.secret": {
  22988. type: "string"
  22989. },
  22990. "config.url": {
  22991. required: true,
  22992. type: "string"
  22993. },
  22994. events: {
  22995. type: "string[]"
  22996. },
  22997. hook_id: {
  22998. required: true,
  22999. type: "integer"
  23000. },
  23001. owner: {
  23002. required: true,
  23003. type: "string"
  23004. },
  23005. remove_events: {
  23006. type: "string[]"
  23007. },
  23008. repo: {
  23009. required: true,
  23010. type: "string"
  23011. }
  23012. },
  23013. url: "/repos/:owner/:repo/hooks/:hook_id"
  23014. },
  23015. updateInformationAboutPagesSite: {
  23016. method: "PUT",
  23017. params: {
  23018. cname: {
  23019. type: "string"
  23020. },
  23021. owner: {
  23022. required: true,
  23023. type: "string"
  23024. },
  23025. repo: {
  23026. required: true,
  23027. type: "string"
  23028. },
  23029. source: {
  23030. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23031. type: "string"
  23032. }
  23033. },
  23034. url: "/repos/:owner/:repo/pages"
  23035. },
  23036. updateInvitation: {
  23037. method: "PATCH",
  23038. params: {
  23039. invitation_id: {
  23040. required: true,
  23041. type: "integer"
  23042. },
  23043. owner: {
  23044. required: true,
  23045. type: "string"
  23046. },
  23047. permissions: {
  23048. enum: ["read", "write", "admin"],
  23049. type: "string"
  23050. },
  23051. repo: {
  23052. required: true,
  23053. type: "string"
  23054. }
  23055. },
  23056. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23057. },
  23058. updateProtectedBranchPullRequestReviewEnforcement: {
  23059. method: "PATCH",
  23060. params: {
  23061. branch: {
  23062. required: true,
  23063. type: "string"
  23064. },
  23065. dismiss_stale_reviews: {
  23066. type: "boolean"
  23067. },
  23068. dismissal_restrictions: {
  23069. type: "object"
  23070. },
  23071. "dismissal_restrictions.teams": {
  23072. type: "string[]"
  23073. },
  23074. "dismissal_restrictions.users": {
  23075. type: "string[]"
  23076. },
  23077. owner: {
  23078. required: true,
  23079. type: "string"
  23080. },
  23081. repo: {
  23082. required: true,
  23083. type: "string"
  23084. },
  23085. require_code_owner_reviews: {
  23086. type: "boolean"
  23087. },
  23088. required_approving_review_count: {
  23089. type: "integer"
  23090. }
  23091. },
  23092. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23093. },
  23094. updateProtectedBranchRequiredStatusChecks: {
  23095. method: "PATCH",
  23096. params: {
  23097. branch: {
  23098. required: true,
  23099. type: "string"
  23100. },
  23101. contexts: {
  23102. type: "string[]"
  23103. },
  23104. owner: {
  23105. required: true,
  23106. type: "string"
  23107. },
  23108. repo: {
  23109. required: true,
  23110. type: "string"
  23111. },
  23112. strict: {
  23113. type: "boolean"
  23114. }
  23115. },
  23116. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23117. },
  23118. updateRelease: {
  23119. method: "PATCH",
  23120. params: {
  23121. body: {
  23122. type: "string"
  23123. },
  23124. draft: {
  23125. type: "boolean"
  23126. },
  23127. name: {
  23128. type: "string"
  23129. },
  23130. owner: {
  23131. required: true,
  23132. type: "string"
  23133. },
  23134. prerelease: {
  23135. type: "boolean"
  23136. },
  23137. release_id: {
  23138. required: true,
  23139. type: "integer"
  23140. },
  23141. repo: {
  23142. required: true,
  23143. type: "string"
  23144. },
  23145. tag_name: {
  23146. type: "string"
  23147. },
  23148. target_commitish: {
  23149. type: "string"
  23150. }
  23151. },
  23152. url: "/repos/:owner/:repo/releases/:release_id"
  23153. },
  23154. updateReleaseAsset: {
  23155. method: "PATCH",
  23156. params: {
  23157. asset_id: {
  23158. required: true,
  23159. type: "integer"
  23160. },
  23161. label: {
  23162. type: "string"
  23163. },
  23164. name: {
  23165. type: "string"
  23166. },
  23167. owner: {
  23168. required: true,
  23169. type: "string"
  23170. },
  23171. repo: {
  23172. required: true,
  23173. type: "string"
  23174. }
  23175. },
  23176. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23177. },
  23178. uploadReleaseAsset: {
  23179. method: "POST",
  23180. params: {
  23181. data: {
  23182. mapTo: "data",
  23183. required: true,
  23184. type: "string | object"
  23185. },
  23186. file: {
  23187. alias: "data",
  23188. deprecated: true,
  23189. type: "string | object"
  23190. },
  23191. headers: {
  23192. required: true,
  23193. type: "object"
  23194. },
  23195. "headers.content-length": {
  23196. required: true,
  23197. type: "integer"
  23198. },
  23199. "headers.content-type": {
  23200. required: true,
  23201. type: "string"
  23202. },
  23203. label: {
  23204. type: "string"
  23205. },
  23206. name: {
  23207. required: true,
  23208. type: "string"
  23209. },
  23210. url: {
  23211. required: true,
  23212. type: "string"
  23213. }
  23214. },
  23215. url: ":url"
  23216. }
  23217. },
  23218. search: {
  23219. code: {
  23220. method: "GET",
  23221. params: {
  23222. order: {
  23223. enum: ["desc", "asc"],
  23224. type: "string"
  23225. },
  23226. page: {
  23227. type: "integer"
  23228. },
  23229. per_page: {
  23230. type: "integer"
  23231. },
  23232. q: {
  23233. required: true,
  23234. type: "string"
  23235. },
  23236. sort: {
  23237. enum: ["indexed"],
  23238. type: "string"
  23239. }
  23240. },
  23241. url: "/search/code"
  23242. },
  23243. commits: {
  23244. headers: {
  23245. accept: "application/vnd.github.cloak-preview+json"
  23246. },
  23247. method: "GET",
  23248. params: {
  23249. order: {
  23250. enum: ["desc", "asc"],
  23251. type: "string"
  23252. },
  23253. page: {
  23254. type: "integer"
  23255. },
  23256. per_page: {
  23257. type: "integer"
  23258. },
  23259. q: {
  23260. required: true,
  23261. type: "string"
  23262. },
  23263. sort: {
  23264. enum: ["author-date", "committer-date"],
  23265. type: "string"
  23266. }
  23267. },
  23268. url: "/search/commits"
  23269. },
  23270. issues: {
  23271. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23272. method: "GET",
  23273. params: {
  23274. order: {
  23275. enum: ["desc", "asc"],
  23276. type: "string"
  23277. },
  23278. page: {
  23279. type: "integer"
  23280. },
  23281. per_page: {
  23282. type: "integer"
  23283. },
  23284. q: {
  23285. required: true,
  23286. type: "string"
  23287. },
  23288. sort: {
  23289. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23290. type: "string"
  23291. }
  23292. },
  23293. url: "/search/issues"
  23294. },
  23295. issuesAndPullRequests: {
  23296. method: "GET",
  23297. params: {
  23298. order: {
  23299. enum: ["desc", "asc"],
  23300. type: "string"
  23301. },
  23302. page: {
  23303. type: "integer"
  23304. },
  23305. per_page: {
  23306. type: "integer"
  23307. },
  23308. q: {
  23309. required: true,
  23310. type: "string"
  23311. },
  23312. sort: {
  23313. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23314. type: "string"
  23315. }
  23316. },
  23317. url: "/search/issues"
  23318. },
  23319. labels: {
  23320. method: "GET",
  23321. params: {
  23322. order: {
  23323. enum: ["desc", "asc"],
  23324. type: "string"
  23325. },
  23326. q: {
  23327. required: true,
  23328. type: "string"
  23329. },
  23330. repository_id: {
  23331. required: true,
  23332. type: "integer"
  23333. },
  23334. sort: {
  23335. enum: ["created", "updated"],
  23336. type: "string"
  23337. }
  23338. },
  23339. url: "/search/labels"
  23340. },
  23341. repos: {
  23342. method: "GET",
  23343. params: {
  23344. order: {
  23345. enum: ["desc", "asc"],
  23346. type: "string"
  23347. },
  23348. page: {
  23349. type: "integer"
  23350. },
  23351. per_page: {
  23352. type: "integer"
  23353. },
  23354. q: {
  23355. required: true,
  23356. type: "string"
  23357. },
  23358. sort: {
  23359. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23360. type: "string"
  23361. }
  23362. },
  23363. url: "/search/repositories"
  23364. },
  23365. topics: {
  23366. method: "GET",
  23367. params: {
  23368. q: {
  23369. required: true,
  23370. type: "string"
  23371. }
  23372. },
  23373. url: "/search/topics"
  23374. },
  23375. users: {
  23376. method: "GET",
  23377. params: {
  23378. order: {
  23379. enum: ["desc", "asc"],
  23380. type: "string"
  23381. },
  23382. page: {
  23383. type: "integer"
  23384. },
  23385. per_page: {
  23386. type: "integer"
  23387. },
  23388. q: {
  23389. required: true,
  23390. type: "string"
  23391. },
  23392. sort: {
  23393. enum: ["followers", "repositories", "joined"],
  23394. type: "string"
  23395. }
  23396. },
  23397. url: "/search/users"
  23398. }
  23399. },
  23400. teams: {
  23401. addMember: {
  23402. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23403. method: "PUT",
  23404. params: {
  23405. team_id: {
  23406. required: true,
  23407. type: "integer"
  23408. },
  23409. username: {
  23410. required: true,
  23411. type: "string"
  23412. }
  23413. },
  23414. url: "/teams/:team_id/members/:username"
  23415. },
  23416. addMemberLegacy: {
  23417. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23418. method: "PUT",
  23419. params: {
  23420. team_id: {
  23421. required: true,
  23422. type: "integer"
  23423. },
  23424. username: {
  23425. required: true,
  23426. type: "string"
  23427. }
  23428. },
  23429. url: "/teams/:team_id/members/:username"
  23430. },
  23431. addOrUpdateMembership: {
  23432. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23433. method: "PUT",
  23434. params: {
  23435. role: {
  23436. enum: ["member", "maintainer"],
  23437. type: "string"
  23438. },
  23439. team_id: {
  23440. required: true,
  23441. type: "integer"
  23442. },
  23443. username: {
  23444. required: true,
  23445. type: "string"
  23446. }
  23447. },
  23448. url: "/teams/:team_id/memberships/:username"
  23449. },
  23450. addOrUpdateMembershipInOrg: {
  23451. method: "PUT",
  23452. params: {
  23453. org: {
  23454. required: true,
  23455. type: "string"
  23456. },
  23457. role: {
  23458. enum: ["member", "maintainer"],
  23459. type: "string"
  23460. },
  23461. team_slug: {
  23462. required: true,
  23463. type: "string"
  23464. },
  23465. username: {
  23466. required: true,
  23467. type: "string"
  23468. }
  23469. },
  23470. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23471. },
  23472. addOrUpdateMembershipLegacy: {
  23473. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23474. method: "PUT",
  23475. params: {
  23476. role: {
  23477. enum: ["member", "maintainer"],
  23478. type: "string"
  23479. },
  23480. team_id: {
  23481. required: true,
  23482. type: "integer"
  23483. },
  23484. username: {
  23485. required: true,
  23486. type: "string"
  23487. }
  23488. },
  23489. url: "/teams/:team_id/memberships/:username"
  23490. },
  23491. addOrUpdateProject: {
  23492. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23493. headers: {
  23494. accept: "application/vnd.github.inertia-preview+json"
  23495. },
  23496. method: "PUT",
  23497. params: {
  23498. permission: {
  23499. enum: ["read", "write", "admin"],
  23500. type: "string"
  23501. },
  23502. project_id: {
  23503. required: true,
  23504. type: "integer"
  23505. },
  23506. team_id: {
  23507. required: true,
  23508. type: "integer"
  23509. }
  23510. },
  23511. url: "/teams/:team_id/projects/:project_id"
  23512. },
  23513. addOrUpdateProjectInOrg: {
  23514. headers: {
  23515. accept: "application/vnd.github.inertia-preview+json"
  23516. },
  23517. method: "PUT",
  23518. params: {
  23519. org: {
  23520. required: true,
  23521. type: "string"
  23522. },
  23523. permission: {
  23524. enum: ["read", "write", "admin"],
  23525. type: "string"
  23526. },
  23527. project_id: {
  23528. required: true,
  23529. type: "integer"
  23530. },
  23531. team_slug: {
  23532. required: true,
  23533. type: "string"
  23534. }
  23535. },
  23536. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23537. },
  23538. addOrUpdateProjectLegacy: {
  23539. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23540. headers: {
  23541. accept: "application/vnd.github.inertia-preview+json"
  23542. },
  23543. method: "PUT",
  23544. params: {
  23545. permission: {
  23546. enum: ["read", "write", "admin"],
  23547. type: "string"
  23548. },
  23549. project_id: {
  23550. required: true,
  23551. type: "integer"
  23552. },
  23553. team_id: {
  23554. required: true,
  23555. type: "integer"
  23556. }
  23557. },
  23558. url: "/teams/:team_id/projects/:project_id"
  23559. },
  23560. addOrUpdateRepo: {
  23561. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23562. method: "PUT",
  23563. params: {
  23564. owner: {
  23565. required: true,
  23566. type: "string"
  23567. },
  23568. permission: {
  23569. enum: ["pull", "push", "admin"],
  23570. type: "string"
  23571. },
  23572. repo: {
  23573. required: true,
  23574. type: "string"
  23575. },
  23576. team_id: {
  23577. required: true,
  23578. type: "integer"
  23579. }
  23580. },
  23581. url: "/teams/:team_id/repos/:owner/:repo"
  23582. },
  23583. addOrUpdateRepoInOrg: {
  23584. method: "PUT",
  23585. params: {
  23586. org: {
  23587. required: true,
  23588. type: "string"
  23589. },
  23590. owner: {
  23591. required: true,
  23592. type: "string"
  23593. },
  23594. permission: {
  23595. enum: ["pull", "push", "admin"],
  23596. type: "string"
  23597. },
  23598. repo: {
  23599. required: true,
  23600. type: "string"
  23601. },
  23602. team_slug: {
  23603. required: true,
  23604. type: "string"
  23605. }
  23606. },
  23607. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23608. },
  23609. addOrUpdateRepoLegacy: {
  23610. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23611. method: "PUT",
  23612. params: {
  23613. owner: {
  23614. required: true,
  23615. type: "string"
  23616. },
  23617. permission: {
  23618. enum: ["pull", "push", "admin"],
  23619. type: "string"
  23620. },
  23621. repo: {
  23622. required: true,
  23623. type: "string"
  23624. },
  23625. team_id: {
  23626. required: true,
  23627. type: "integer"
  23628. }
  23629. },
  23630. url: "/teams/:team_id/repos/:owner/:repo"
  23631. },
  23632. checkManagesRepo: {
  23633. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23634. method: "GET",
  23635. params: {
  23636. owner: {
  23637. required: true,
  23638. type: "string"
  23639. },
  23640. repo: {
  23641. required: true,
  23642. type: "string"
  23643. },
  23644. team_id: {
  23645. required: true,
  23646. type: "integer"
  23647. }
  23648. },
  23649. url: "/teams/:team_id/repos/:owner/:repo"
  23650. },
  23651. checkManagesRepoInOrg: {
  23652. method: "GET",
  23653. params: {
  23654. org: {
  23655. required: true,
  23656. type: "string"
  23657. },
  23658. owner: {
  23659. required: true,
  23660. type: "string"
  23661. },
  23662. repo: {
  23663. required: true,
  23664. type: "string"
  23665. },
  23666. team_slug: {
  23667. required: true,
  23668. type: "string"
  23669. }
  23670. },
  23671. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23672. },
  23673. checkManagesRepoLegacy: {
  23674. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23675. method: "GET",
  23676. params: {
  23677. owner: {
  23678. required: true,
  23679. type: "string"
  23680. },
  23681. repo: {
  23682. required: true,
  23683. type: "string"
  23684. },
  23685. team_id: {
  23686. required: true,
  23687. type: "integer"
  23688. }
  23689. },
  23690. url: "/teams/:team_id/repos/:owner/:repo"
  23691. },
  23692. create: {
  23693. method: "POST",
  23694. params: {
  23695. description: {
  23696. type: "string"
  23697. },
  23698. maintainers: {
  23699. type: "string[]"
  23700. },
  23701. name: {
  23702. required: true,
  23703. type: "string"
  23704. },
  23705. org: {
  23706. required: true,
  23707. type: "string"
  23708. },
  23709. parent_team_id: {
  23710. type: "integer"
  23711. },
  23712. permission: {
  23713. enum: ["pull", "push", "admin"],
  23714. type: "string"
  23715. },
  23716. privacy: {
  23717. enum: ["secret", "closed"],
  23718. type: "string"
  23719. },
  23720. repo_names: {
  23721. type: "string[]"
  23722. }
  23723. },
  23724. url: "/orgs/:org/teams"
  23725. },
  23726. createDiscussion: {
  23727. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23728. method: "POST",
  23729. params: {
  23730. body: {
  23731. required: true,
  23732. type: "string"
  23733. },
  23734. private: {
  23735. type: "boolean"
  23736. },
  23737. team_id: {
  23738. required: true,
  23739. type: "integer"
  23740. },
  23741. title: {
  23742. required: true,
  23743. type: "string"
  23744. }
  23745. },
  23746. url: "/teams/:team_id/discussions"
  23747. },
  23748. createDiscussionComment: {
  23749. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  23750. method: "POST",
  23751. params: {
  23752. body: {
  23753. required: true,
  23754. type: "string"
  23755. },
  23756. discussion_number: {
  23757. required: true,
  23758. type: "integer"
  23759. },
  23760. team_id: {
  23761. required: true,
  23762. type: "integer"
  23763. }
  23764. },
  23765. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23766. },
  23767. createDiscussionCommentInOrg: {
  23768. method: "POST",
  23769. params: {
  23770. body: {
  23771. required: true,
  23772. type: "string"
  23773. },
  23774. discussion_number: {
  23775. required: true,
  23776. type: "integer"
  23777. },
  23778. org: {
  23779. required: true,
  23780. type: "string"
  23781. },
  23782. team_slug: {
  23783. required: true,
  23784. type: "string"
  23785. }
  23786. },
  23787. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  23788. },
  23789. createDiscussionCommentLegacy: {
  23790. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  23791. method: "POST",
  23792. params: {
  23793. body: {
  23794. required: true,
  23795. type: "string"
  23796. },
  23797. discussion_number: {
  23798. required: true,
  23799. type: "integer"
  23800. },
  23801. team_id: {
  23802. required: true,
  23803. type: "integer"
  23804. }
  23805. },
  23806. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23807. },
  23808. createDiscussionInOrg: {
  23809. method: "POST",
  23810. params: {
  23811. body: {
  23812. required: true,
  23813. type: "string"
  23814. },
  23815. org: {
  23816. required: true,
  23817. type: "string"
  23818. },
  23819. private: {
  23820. type: "boolean"
  23821. },
  23822. team_slug: {
  23823. required: true,
  23824. type: "string"
  23825. },
  23826. title: {
  23827. required: true,
  23828. type: "string"
  23829. }
  23830. },
  23831. url: "/orgs/:org/teams/:team_slug/discussions"
  23832. },
  23833. createDiscussionLegacy: {
  23834. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  23835. method: "POST",
  23836. params: {
  23837. body: {
  23838. required: true,
  23839. type: "string"
  23840. },
  23841. private: {
  23842. type: "boolean"
  23843. },
  23844. team_id: {
  23845. required: true,
  23846. type: "integer"
  23847. },
  23848. title: {
  23849. required: true,
  23850. type: "string"
  23851. }
  23852. },
  23853. url: "/teams/:team_id/discussions"
  23854. },
  23855. delete: {
  23856. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  23857. method: "DELETE",
  23858. params: {
  23859. team_id: {
  23860. required: true,
  23861. type: "integer"
  23862. }
  23863. },
  23864. url: "/teams/:team_id"
  23865. },
  23866. deleteDiscussion: {
  23867. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  23868. method: "DELETE",
  23869. params: {
  23870. discussion_number: {
  23871. required: true,
  23872. type: "integer"
  23873. },
  23874. team_id: {
  23875. required: true,
  23876. type: "integer"
  23877. }
  23878. },
  23879. url: "/teams/:team_id/discussions/:discussion_number"
  23880. },
  23881. deleteDiscussionComment: {
  23882. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  23883. method: "DELETE",
  23884. params: {
  23885. comment_number: {
  23886. required: true,
  23887. type: "integer"
  23888. },
  23889. discussion_number: {
  23890. required: true,
  23891. type: "integer"
  23892. },
  23893. team_id: {
  23894. required: true,
  23895. type: "integer"
  23896. }
  23897. },
  23898. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  23899. },
  23900. deleteDiscussionCommentInOrg: {
  23901. method: "DELETE",
  23902. params: {
  23903. comment_number: {
  23904. required: true,
  23905. type: "integer"
  23906. },
  23907. discussion_number: {
  23908. required: true,
  23909. type: "integer"
  23910. },
  23911. org: {
  23912. required: true,
  23913. type: "string"
  23914. },
  23915. team_slug: {
  23916. required: true,
  23917. type: "string"
  23918. }
  23919. },
  23920. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  23921. },
  23922. deleteDiscussionCommentLegacy: {
  23923. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  23924. method: "DELETE",
  23925. params: {
  23926. comment_number: {
  23927. required: true,
  23928. type: "integer"
  23929. },
  23930. discussion_number: {
  23931. required: true,
  23932. type: "integer"
  23933. },
  23934. team_id: {
  23935. required: true,
  23936. type: "integer"
  23937. }
  23938. },
  23939. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  23940. },
  23941. deleteDiscussionInOrg: {
  23942. method: "DELETE",
  23943. params: {
  23944. discussion_number: {
  23945. required: true,
  23946. type: "integer"
  23947. },
  23948. org: {
  23949. required: true,
  23950. type: "string"
  23951. },
  23952. team_slug: {
  23953. required: true,
  23954. type: "string"
  23955. }
  23956. },
  23957. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  23958. },
  23959. deleteDiscussionLegacy: {
  23960. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  23961. method: "DELETE",
  23962. params: {
  23963. discussion_number: {
  23964. required: true,
  23965. type: "integer"
  23966. },
  23967. team_id: {
  23968. required: true,
  23969. type: "integer"
  23970. }
  23971. },
  23972. url: "/teams/:team_id/discussions/:discussion_number"
  23973. },
  23974. deleteInOrg: {
  23975. method: "DELETE",
  23976. params: {
  23977. org: {
  23978. required: true,
  23979. type: "string"
  23980. },
  23981. team_slug: {
  23982. required: true,
  23983. type: "string"
  23984. }
  23985. },
  23986. url: "/orgs/:org/teams/:team_slug"
  23987. },
  23988. deleteLegacy: {
  23989. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  23990. method: "DELETE",
  23991. params: {
  23992. team_id: {
  23993. required: true,
  23994. type: "integer"
  23995. }
  23996. },
  23997. url: "/teams/:team_id"
  23998. },
  23999. get: {
  24000. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24001. method: "GET",
  24002. params: {
  24003. team_id: {
  24004. required: true,
  24005. type: "integer"
  24006. }
  24007. },
  24008. url: "/teams/:team_id"
  24009. },
  24010. getByName: {
  24011. method: "GET",
  24012. params: {
  24013. org: {
  24014. required: true,
  24015. type: "string"
  24016. },
  24017. team_slug: {
  24018. required: true,
  24019. type: "string"
  24020. }
  24021. },
  24022. url: "/orgs/:org/teams/:team_slug"
  24023. },
  24024. getDiscussion: {
  24025. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24026. method: "GET",
  24027. params: {
  24028. discussion_number: {
  24029. required: true,
  24030. type: "integer"
  24031. },
  24032. team_id: {
  24033. required: true,
  24034. type: "integer"
  24035. }
  24036. },
  24037. url: "/teams/:team_id/discussions/:discussion_number"
  24038. },
  24039. getDiscussionComment: {
  24040. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24041. method: "GET",
  24042. params: {
  24043. comment_number: {
  24044. required: true,
  24045. type: "integer"
  24046. },
  24047. discussion_number: {
  24048. required: true,
  24049. type: "integer"
  24050. },
  24051. team_id: {
  24052. required: true,
  24053. type: "integer"
  24054. }
  24055. },
  24056. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24057. },
  24058. getDiscussionCommentInOrg: {
  24059. method: "GET",
  24060. params: {
  24061. comment_number: {
  24062. required: true,
  24063. type: "integer"
  24064. },
  24065. discussion_number: {
  24066. required: true,
  24067. type: "integer"
  24068. },
  24069. org: {
  24070. required: true,
  24071. type: "string"
  24072. },
  24073. team_slug: {
  24074. required: true,
  24075. type: "string"
  24076. }
  24077. },
  24078. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24079. },
  24080. getDiscussionCommentLegacy: {
  24081. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24082. method: "GET",
  24083. params: {
  24084. comment_number: {
  24085. required: true,
  24086. type: "integer"
  24087. },
  24088. discussion_number: {
  24089. required: true,
  24090. type: "integer"
  24091. },
  24092. team_id: {
  24093. required: true,
  24094. type: "integer"
  24095. }
  24096. },
  24097. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24098. },
  24099. getDiscussionInOrg: {
  24100. method: "GET",
  24101. params: {
  24102. discussion_number: {
  24103. required: true,
  24104. type: "integer"
  24105. },
  24106. org: {
  24107. required: true,
  24108. type: "string"
  24109. },
  24110. team_slug: {
  24111. required: true,
  24112. type: "string"
  24113. }
  24114. },
  24115. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24116. },
  24117. getDiscussionLegacy: {
  24118. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24119. method: "GET",
  24120. params: {
  24121. discussion_number: {
  24122. required: true,
  24123. type: "integer"
  24124. },
  24125. team_id: {
  24126. required: true,
  24127. type: "integer"
  24128. }
  24129. },
  24130. url: "/teams/:team_id/discussions/:discussion_number"
  24131. },
  24132. getLegacy: {
  24133. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24134. method: "GET",
  24135. params: {
  24136. team_id: {
  24137. required: true,
  24138. type: "integer"
  24139. }
  24140. },
  24141. url: "/teams/:team_id"
  24142. },
  24143. getMember: {
  24144. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24145. method: "GET",
  24146. params: {
  24147. team_id: {
  24148. required: true,
  24149. type: "integer"
  24150. },
  24151. username: {
  24152. required: true,
  24153. type: "string"
  24154. }
  24155. },
  24156. url: "/teams/:team_id/members/:username"
  24157. },
  24158. getMemberLegacy: {
  24159. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24160. method: "GET",
  24161. params: {
  24162. team_id: {
  24163. required: true,
  24164. type: "integer"
  24165. },
  24166. username: {
  24167. required: true,
  24168. type: "string"
  24169. }
  24170. },
  24171. url: "/teams/:team_id/members/:username"
  24172. },
  24173. getMembership: {
  24174. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24175. method: "GET",
  24176. params: {
  24177. team_id: {
  24178. required: true,
  24179. type: "integer"
  24180. },
  24181. username: {
  24182. required: true,
  24183. type: "string"
  24184. }
  24185. },
  24186. url: "/teams/:team_id/memberships/:username"
  24187. },
  24188. getMembershipInOrg: {
  24189. method: "GET",
  24190. params: {
  24191. org: {
  24192. required: true,
  24193. type: "string"
  24194. },
  24195. team_slug: {
  24196. required: true,
  24197. type: "string"
  24198. },
  24199. username: {
  24200. required: true,
  24201. type: "string"
  24202. }
  24203. },
  24204. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24205. },
  24206. getMembershipLegacy: {
  24207. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24208. method: "GET",
  24209. params: {
  24210. team_id: {
  24211. required: true,
  24212. type: "integer"
  24213. },
  24214. username: {
  24215. required: true,
  24216. type: "string"
  24217. }
  24218. },
  24219. url: "/teams/:team_id/memberships/:username"
  24220. },
  24221. list: {
  24222. method: "GET",
  24223. params: {
  24224. org: {
  24225. required: true,
  24226. type: "string"
  24227. },
  24228. page: {
  24229. type: "integer"
  24230. },
  24231. per_page: {
  24232. type: "integer"
  24233. }
  24234. },
  24235. url: "/orgs/:org/teams"
  24236. },
  24237. listChild: {
  24238. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24239. method: "GET",
  24240. params: {
  24241. page: {
  24242. type: "integer"
  24243. },
  24244. per_page: {
  24245. type: "integer"
  24246. },
  24247. team_id: {
  24248. required: true,
  24249. type: "integer"
  24250. }
  24251. },
  24252. url: "/teams/:team_id/teams"
  24253. },
  24254. listChildInOrg: {
  24255. method: "GET",
  24256. params: {
  24257. org: {
  24258. required: true,
  24259. type: "string"
  24260. },
  24261. page: {
  24262. type: "integer"
  24263. },
  24264. per_page: {
  24265. type: "integer"
  24266. },
  24267. team_slug: {
  24268. required: true,
  24269. type: "string"
  24270. }
  24271. },
  24272. url: "/orgs/:org/teams/:team_slug/teams"
  24273. },
  24274. listChildLegacy: {
  24275. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24276. method: "GET",
  24277. params: {
  24278. page: {
  24279. type: "integer"
  24280. },
  24281. per_page: {
  24282. type: "integer"
  24283. },
  24284. team_id: {
  24285. required: true,
  24286. type: "integer"
  24287. }
  24288. },
  24289. url: "/teams/:team_id/teams"
  24290. },
  24291. listDiscussionComments: {
  24292. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24293. method: "GET",
  24294. params: {
  24295. direction: {
  24296. enum: ["asc", "desc"],
  24297. type: "string"
  24298. },
  24299. discussion_number: {
  24300. required: true,
  24301. type: "integer"
  24302. },
  24303. page: {
  24304. type: "integer"
  24305. },
  24306. per_page: {
  24307. type: "integer"
  24308. },
  24309. team_id: {
  24310. required: true,
  24311. type: "integer"
  24312. }
  24313. },
  24314. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24315. },
  24316. listDiscussionCommentsInOrg: {
  24317. method: "GET",
  24318. params: {
  24319. direction: {
  24320. enum: ["asc", "desc"],
  24321. type: "string"
  24322. },
  24323. discussion_number: {
  24324. required: true,
  24325. type: "integer"
  24326. },
  24327. org: {
  24328. required: true,
  24329. type: "string"
  24330. },
  24331. page: {
  24332. type: "integer"
  24333. },
  24334. per_page: {
  24335. type: "integer"
  24336. },
  24337. team_slug: {
  24338. required: true,
  24339. type: "string"
  24340. }
  24341. },
  24342. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24343. },
  24344. listDiscussionCommentsLegacy: {
  24345. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24346. method: "GET",
  24347. params: {
  24348. direction: {
  24349. enum: ["asc", "desc"],
  24350. type: "string"
  24351. },
  24352. discussion_number: {
  24353. required: true,
  24354. type: "integer"
  24355. },
  24356. page: {
  24357. type: "integer"
  24358. },
  24359. per_page: {
  24360. type: "integer"
  24361. },
  24362. team_id: {
  24363. required: true,
  24364. type: "integer"
  24365. }
  24366. },
  24367. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24368. },
  24369. listDiscussions: {
  24370. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24371. method: "GET",
  24372. params: {
  24373. direction: {
  24374. enum: ["asc", "desc"],
  24375. type: "string"
  24376. },
  24377. page: {
  24378. type: "integer"
  24379. },
  24380. per_page: {
  24381. type: "integer"
  24382. },
  24383. team_id: {
  24384. required: true,
  24385. type: "integer"
  24386. }
  24387. },
  24388. url: "/teams/:team_id/discussions"
  24389. },
  24390. listDiscussionsInOrg: {
  24391. method: "GET",
  24392. params: {
  24393. direction: {
  24394. enum: ["asc", "desc"],
  24395. type: "string"
  24396. },
  24397. org: {
  24398. required: true,
  24399. type: "string"
  24400. },
  24401. page: {
  24402. type: "integer"
  24403. },
  24404. per_page: {
  24405. type: "integer"
  24406. },
  24407. team_slug: {
  24408. required: true,
  24409. type: "string"
  24410. }
  24411. },
  24412. url: "/orgs/:org/teams/:team_slug/discussions"
  24413. },
  24414. listDiscussionsLegacy: {
  24415. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24416. method: "GET",
  24417. params: {
  24418. direction: {
  24419. enum: ["asc", "desc"],
  24420. type: "string"
  24421. },
  24422. page: {
  24423. type: "integer"
  24424. },
  24425. per_page: {
  24426. type: "integer"
  24427. },
  24428. team_id: {
  24429. required: true,
  24430. type: "integer"
  24431. }
  24432. },
  24433. url: "/teams/:team_id/discussions"
  24434. },
  24435. listForAuthenticatedUser: {
  24436. method: "GET",
  24437. params: {
  24438. page: {
  24439. type: "integer"
  24440. },
  24441. per_page: {
  24442. type: "integer"
  24443. }
  24444. },
  24445. url: "/user/teams"
  24446. },
  24447. listMembers: {
  24448. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24449. method: "GET",
  24450. params: {
  24451. page: {
  24452. type: "integer"
  24453. },
  24454. per_page: {
  24455. type: "integer"
  24456. },
  24457. role: {
  24458. enum: ["member", "maintainer", "all"],
  24459. type: "string"
  24460. },
  24461. team_id: {
  24462. required: true,
  24463. type: "integer"
  24464. }
  24465. },
  24466. url: "/teams/:team_id/members"
  24467. },
  24468. listMembersInOrg: {
  24469. method: "GET",
  24470. params: {
  24471. org: {
  24472. required: true,
  24473. type: "string"
  24474. },
  24475. page: {
  24476. type: "integer"
  24477. },
  24478. per_page: {
  24479. type: "integer"
  24480. },
  24481. role: {
  24482. enum: ["member", "maintainer", "all"],
  24483. type: "string"
  24484. },
  24485. team_slug: {
  24486. required: true,
  24487. type: "string"
  24488. }
  24489. },
  24490. url: "/orgs/:org/teams/:team_slug/members"
  24491. },
  24492. listMembersLegacy: {
  24493. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24494. method: "GET",
  24495. params: {
  24496. page: {
  24497. type: "integer"
  24498. },
  24499. per_page: {
  24500. type: "integer"
  24501. },
  24502. role: {
  24503. enum: ["member", "maintainer", "all"],
  24504. type: "string"
  24505. },
  24506. team_id: {
  24507. required: true,
  24508. type: "integer"
  24509. }
  24510. },
  24511. url: "/teams/:team_id/members"
  24512. },
  24513. listPendingInvitations: {
  24514. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24515. method: "GET",
  24516. params: {
  24517. page: {
  24518. type: "integer"
  24519. },
  24520. per_page: {
  24521. type: "integer"
  24522. },
  24523. team_id: {
  24524. required: true,
  24525. type: "integer"
  24526. }
  24527. },
  24528. url: "/teams/:team_id/invitations"
  24529. },
  24530. listPendingInvitationsInOrg: {
  24531. method: "GET",
  24532. params: {
  24533. org: {
  24534. required: true,
  24535. type: "string"
  24536. },
  24537. page: {
  24538. type: "integer"
  24539. },
  24540. per_page: {
  24541. type: "integer"
  24542. },
  24543. team_slug: {
  24544. required: true,
  24545. type: "string"
  24546. }
  24547. },
  24548. url: "/orgs/:org/teams/:team_slug/invitations"
  24549. },
  24550. listPendingInvitationsLegacy: {
  24551. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24552. method: "GET",
  24553. params: {
  24554. page: {
  24555. type: "integer"
  24556. },
  24557. per_page: {
  24558. type: "integer"
  24559. },
  24560. team_id: {
  24561. required: true,
  24562. type: "integer"
  24563. }
  24564. },
  24565. url: "/teams/:team_id/invitations"
  24566. },
  24567. listProjects: {
  24568. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24569. headers: {
  24570. accept: "application/vnd.github.inertia-preview+json"
  24571. },
  24572. method: "GET",
  24573. params: {
  24574. page: {
  24575. type: "integer"
  24576. },
  24577. per_page: {
  24578. type: "integer"
  24579. },
  24580. team_id: {
  24581. required: true,
  24582. type: "integer"
  24583. }
  24584. },
  24585. url: "/teams/:team_id/projects"
  24586. },
  24587. listProjectsInOrg: {
  24588. headers: {
  24589. accept: "application/vnd.github.inertia-preview+json"
  24590. },
  24591. method: "GET",
  24592. params: {
  24593. org: {
  24594. required: true,
  24595. type: "string"
  24596. },
  24597. page: {
  24598. type: "integer"
  24599. },
  24600. per_page: {
  24601. type: "integer"
  24602. },
  24603. team_slug: {
  24604. required: true,
  24605. type: "string"
  24606. }
  24607. },
  24608. url: "/orgs/:org/teams/:team_slug/projects"
  24609. },
  24610. listProjectsLegacy: {
  24611. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24612. headers: {
  24613. accept: "application/vnd.github.inertia-preview+json"
  24614. },
  24615. method: "GET",
  24616. params: {
  24617. page: {
  24618. type: "integer"
  24619. },
  24620. per_page: {
  24621. type: "integer"
  24622. },
  24623. team_id: {
  24624. required: true,
  24625. type: "integer"
  24626. }
  24627. },
  24628. url: "/teams/:team_id/projects"
  24629. },
  24630. listRepos: {
  24631. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24632. method: "GET",
  24633. params: {
  24634. page: {
  24635. type: "integer"
  24636. },
  24637. per_page: {
  24638. type: "integer"
  24639. },
  24640. team_id: {
  24641. required: true,
  24642. type: "integer"
  24643. }
  24644. },
  24645. url: "/teams/:team_id/repos"
  24646. },
  24647. listReposInOrg: {
  24648. method: "GET",
  24649. params: {
  24650. org: {
  24651. required: true,
  24652. type: "string"
  24653. },
  24654. page: {
  24655. type: "integer"
  24656. },
  24657. per_page: {
  24658. type: "integer"
  24659. },
  24660. team_slug: {
  24661. required: true,
  24662. type: "string"
  24663. }
  24664. },
  24665. url: "/orgs/:org/teams/:team_slug/repos"
  24666. },
  24667. listReposLegacy: {
  24668. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24669. method: "GET",
  24670. params: {
  24671. page: {
  24672. type: "integer"
  24673. },
  24674. per_page: {
  24675. type: "integer"
  24676. },
  24677. team_id: {
  24678. required: true,
  24679. type: "integer"
  24680. }
  24681. },
  24682. url: "/teams/:team_id/repos"
  24683. },
  24684. removeMember: {
  24685. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24686. method: "DELETE",
  24687. params: {
  24688. team_id: {
  24689. required: true,
  24690. type: "integer"
  24691. },
  24692. username: {
  24693. required: true,
  24694. type: "string"
  24695. }
  24696. },
  24697. url: "/teams/:team_id/members/:username"
  24698. },
  24699. removeMemberLegacy: {
  24700. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24701. method: "DELETE",
  24702. params: {
  24703. team_id: {
  24704. required: true,
  24705. type: "integer"
  24706. },
  24707. username: {
  24708. required: true,
  24709. type: "string"
  24710. }
  24711. },
  24712. url: "/teams/:team_id/members/:username"
  24713. },
  24714. removeMembership: {
  24715. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24716. method: "DELETE",
  24717. params: {
  24718. team_id: {
  24719. required: true,
  24720. type: "integer"
  24721. },
  24722. username: {
  24723. required: true,
  24724. type: "string"
  24725. }
  24726. },
  24727. url: "/teams/:team_id/memberships/:username"
  24728. },
  24729. removeMembershipInOrg: {
  24730. method: "DELETE",
  24731. params: {
  24732. org: {
  24733. required: true,
  24734. type: "string"
  24735. },
  24736. team_slug: {
  24737. required: true,
  24738. type: "string"
  24739. },
  24740. username: {
  24741. required: true,
  24742. type: "string"
  24743. }
  24744. },
  24745. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24746. },
  24747. removeMembershipLegacy: {
  24748. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  24749. method: "DELETE",
  24750. params: {
  24751. team_id: {
  24752. required: true,
  24753. type: "integer"
  24754. },
  24755. username: {
  24756. required: true,
  24757. type: "string"
  24758. }
  24759. },
  24760. url: "/teams/:team_id/memberships/:username"
  24761. },
  24762. removeProject: {
  24763. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  24764. method: "DELETE",
  24765. params: {
  24766. project_id: {
  24767. required: true,
  24768. type: "integer"
  24769. },
  24770. team_id: {
  24771. required: true,
  24772. type: "integer"
  24773. }
  24774. },
  24775. url: "/teams/:team_id/projects/:project_id"
  24776. },
  24777. removeProjectInOrg: {
  24778. method: "DELETE",
  24779. params: {
  24780. org: {
  24781. required: true,
  24782. type: "string"
  24783. },
  24784. project_id: {
  24785. required: true,
  24786. type: "integer"
  24787. },
  24788. team_slug: {
  24789. required: true,
  24790. type: "string"
  24791. }
  24792. },
  24793. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24794. },
  24795. removeProjectLegacy: {
  24796. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  24797. method: "DELETE",
  24798. params: {
  24799. project_id: {
  24800. required: true,
  24801. type: "integer"
  24802. },
  24803. team_id: {
  24804. required: true,
  24805. type: "integer"
  24806. }
  24807. },
  24808. url: "/teams/:team_id/projects/:project_id"
  24809. },
  24810. removeRepo: {
  24811. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  24812. method: "DELETE",
  24813. params: {
  24814. owner: {
  24815. required: true,
  24816. type: "string"
  24817. },
  24818. repo: {
  24819. required: true,
  24820. type: "string"
  24821. },
  24822. team_id: {
  24823. required: true,
  24824. type: "integer"
  24825. }
  24826. },
  24827. url: "/teams/:team_id/repos/:owner/:repo"
  24828. },
  24829. removeRepoInOrg: {
  24830. method: "DELETE",
  24831. params: {
  24832. org: {
  24833. required: true,
  24834. type: "string"
  24835. },
  24836. owner: {
  24837. required: true,
  24838. type: "string"
  24839. },
  24840. repo: {
  24841. required: true,
  24842. type: "string"
  24843. },
  24844. team_slug: {
  24845. required: true,
  24846. type: "string"
  24847. }
  24848. },
  24849. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24850. },
  24851. removeRepoLegacy: {
  24852. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  24853. method: "DELETE",
  24854. params: {
  24855. owner: {
  24856. required: true,
  24857. type: "string"
  24858. },
  24859. repo: {
  24860. required: true,
  24861. type: "string"
  24862. },
  24863. team_id: {
  24864. required: true,
  24865. type: "integer"
  24866. }
  24867. },
  24868. url: "/teams/:team_id/repos/:owner/:repo"
  24869. },
  24870. reviewProject: {
  24871. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  24872. headers: {
  24873. accept: "application/vnd.github.inertia-preview+json"
  24874. },
  24875. method: "GET",
  24876. params: {
  24877. project_id: {
  24878. required: true,
  24879. type: "integer"
  24880. },
  24881. team_id: {
  24882. required: true,
  24883. type: "integer"
  24884. }
  24885. },
  24886. url: "/teams/:team_id/projects/:project_id"
  24887. },
  24888. reviewProjectInOrg: {
  24889. headers: {
  24890. accept: "application/vnd.github.inertia-preview+json"
  24891. },
  24892. method: "GET",
  24893. params: {
  24894. org: {
  24895. required: true,
  24896. type: "string"
  24897. },
  24898. project_id: {
  24899. required: true,
  24900. type: "integer"
  24901. },
  24902. team_slug: {
  24903. required: true,
  24904. type: "string"
  24905. }
  24906. },
  24907. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24908. },
  24909. reviewProjectLegacy: {
  24910. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  24911. headers: {
  24912. accept: "application/vnd.github.inertia-preview+json"
  24913. },
  24914. method: "GET",
  24915. params: {
  24916. project_id: {
  24917. required: true,
  24918. type: "integer"
  24919. },
  24920. team_id: {
  24921. required: true,
  24922. type: "integer"
  24923. }
  24924. },
  24925. url: "/teams/:team_id/projects/:project_id"
  24926. },
  24927. update: {
  24928. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  24929. method: "PATCH",
  24930. params: {
  24931. description: {
  24932. type: "string"
  24933. },
  24934. name: {
  24935. required: true,
  24936. type: "string"
  24937. },
  24938. parent_team_id: {
  24939. type: "integer"
  24940. },
  24941. permission: {
  24942. enum: ["pull", "push", "admin"],
  24943. type: "string"
  24944. },
  24945. privacy: {
  24946. enum: ["secret", "closed"],
  24947. type: "string"
  24948. },
  24949. team_id: {
  24950. required: true,
  24951. type: "integer"
  24952. }
  24953. },
  24954. url: "/teams/:team_id"
  24955. },
  24956. updateDiscussion: {
  24957. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  24958. method: "PATCH",
  24959. params: {
  24960. body: {
  24961. type: "string"
  24962. },
  24963. discussion_number: {
  24964. required: true,
  24965. type: "integer"
  24966. },
  24967. team_id: {
  24968. required: true,
  24969. type: "integer"
  24970. },
  24971. title: {
  24972. type: "string"
  24973. }
  24974. },
  24975. url: "/teams/:team_id/discussions/:discussion_number"
  24976. },
  24977. updateDiscussionComment: {
  24978. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  24979. method: "PATCH",
  24980. params: {
  24981. body: {
  24982. required: true,
  24983. type: "string"
  24984. },
  24985. comment_number: {
  24986. required: true,
  24987. type: "integer"
  24988. },
  24989. discussion_number: {
  24990. required: true,
  24991. type: "integer"
  24992. },
  24993. team_id: {
  24994. required: true,
  24995. type: "integer"
  24996. }
  24997. },
  24998. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24999. },
  25000. updateDiscussionCommentInOrg: {
  25001. method: "PATCH",
  25002. params: {
  25003. body: {
  25004. required: true,
  25005. type: "string"
  25006. },
  25007. comment_number: {
  25008. required: true,
  25009. type: "integer"
  25010. },
  25011. discussion_number: {
  25012. required: true,
  25013. type: "integer"
  25014. },
  25015. org: {
  25016. required: true,
  25017. type: "string"
  25018. },
  25019. team_slug: {
  25020. required: true,
  25021. type: "string"
  25022. }
  25023. },
  25024. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25025. },
  25026. updateDiscussionCommentLegacy: {
  25027. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25028. method: "PATCH",
  25029. params: {
  25030. body: {
  25031. required: true,
  25032. type: "string"
  25033. },
  25034. comment_number: {
  25035. required: true,
  25036. type: "integer"
  25037. },
  25038. discussion_number: {
  25039. required: true,
  25040. type: "integer"
  25041. },
  25042. team_id: {
  25043. required: true,
  25044. type: "integer"
  25045. }
  25046. },
  25047. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25048. },
  25049. updateDiscussionInOrg: {
  25050. method: "PATCH",
  25051. params: {
  25052. body: {
  25053. type: "string"
  25054. },
  25055. discussion_number: {
  25056. required: true,
  25057. type: "integer"
  25058. },
  25059. org: {
  25060. required: true,
  25061. type: "string"
  25062. },
  25063. team_slug: {
  25064. required: true,
  25065. type: "string"
  25066. },
  25067. title: {
  25068. type: "string"
  25069. }
  25070. },
  25071. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25072. },
  25073. updateDiscussionLegacy: {
  25074. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25075. method: "PATCH",
  25076. params: {
  25077. body: {
  25078. type: "string"
  25079. },
  25080. discussion_number: {
  25081. required: true,
  25082. type: "integer"
  25083. },
  25084. team_id: {
  25085. required: true,
  25086. type: "integer"
  25087. },
  25088. title: {
  25089. type: "string"
  25090. }
  25091. },
  25092. url: "/teams/:team_id/discussions/:discussion_number"
  25093. },
  25094. updateInOrg: {
  25095. method: "PATCH",
  25096. params: {
  25097. description: {
  25098. type: "string"
  25099. },
  25100. name: {
  25101. required: true,
  25102. type: "string"
  25103. },
  25104. org: {
  25105. required: true,
  25106. type: "string"
  25107. },
  25108. parent_team_id: {
  25109. type: "integer"
  25110. },
  25111. permission: {
  25112. enum: ["pull", "push", "admin"],
  25113. type: "string"
  25114. },
  25115. privacy: {
  25116. enum: ["secret", "closed"],
  25117. type: "string"
  25118. },
  25119. team_slug: {
  25120. required: true,
  25121. type: "string"
  25122. }
  25123. },
  25124. url: "/orgs/:org/teams/:team_slug"
  25125. },
  25126. updateLegacy: {
  25127. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25128. method: "PATCH",
  25129. params: {
  25130. description: {
  25131. type: "string"
  25132. },
  25133. name: {
  25134. required: true,
  25135. type: "string"
  25136. },
  25137. parent_team_id: {
  25138. type: "integer"
  25139. },
  25140. permission: {
  25141. enum: ["pull", "push", "admin"],
  25142. type: "string"
  25143. },
  25144. privacy: {
  25145. enum: ["secret", "closed"],
  25146. type: "string"
  25147. },
  25148. team_id: {
  25149. required: true,
  25150. type: "integer"
  25151. }
  25152. },
  25153. url: "/teams/:team_id"
  25154. }
  25155. },
  25156. users: {
  25157. addEmails: {
  25158. method: "POST",
  25159. params: {
  25160. emails: {
  25161. required: true,
  25162. type: "string[]"
  25163. }
  25164. },
  25165. url: "/user/emails"
  25166. },
  25167. block: {
  25168. method: "PUT",
  25169. params: {
  25170. username: {
  25171. required: true,
  25172. type: "string"
  25173. }
  25174. },
  25175. url: "/user/blocks/:username"
  25176. },
  25177. checkBlocked: {
  25178. method: "GET",
  25179. params: {
  25180. username: {
  25181. required: true,
  25182. type: "string"
  25183. }
  25184. },
  25185. url: "/user/blocks/:username"
  25186. },
  25187. checkFollowing: {
  25188. method: "GET",
  25189. params: {
  25190. username: {
  25191. required: true,
  25192. type: "string"
  25193. }
  25194. },
  25195. url: "/user/following/:username"
  25196. },
  25197. checkFollowingForUser: {
  25198. method: "GET",
  25199. params: {
  25200. target_user: {
  25201. required: true,
  25202. type: "string"
  25203. },
  25204. username: {
  25205. required: true,
  25206. type: "string"
  25207. }
  25208. },
  25209. url: "/users/:username/following/:target_user"
  25210. },
  25211. createGpgKey: {
  25212. method: "POST",
  25213. params: {
  25214. armored_public_key: {
  25215. type: "string"
  25216. }
  25217. },
  25218. url: "/user/gpg_keys"
  25219. },
  25220. createPublicKey: {
  25221. method: "POST",
  25222. params: {
  25223. key: {
  25224. type: "string"
  25225. },
  25226. title: {
  25227. type: "string"
  25228. }
  25229. },
  25230. url: "/user/keys"
  25231. },
  25232. deleteEmails: {
  25233. method: "DELETE",
  25234. params: {
  25235. emails: {
  25236. required: true,
  25237. type: "string[]"
  25238. }
  25239. },
  25240. url: "/user/emails"
  25241. },
  25242. deleteGpgKey: {
  25243. method: "DELETE",
  25244. params: {
  25245. gpg_key_id: {
  25246. required: true,
  25247. type: "integer"
  25248. }
  25249. },
  25250. url: "/user/gpg_keys/:gpg_key_id"
  25251. },
  25252. deletePublicKey: {
  25253. method: "DELETE",
  25254. params: {
  25255. key_id: {
  25256. required: true,
  25257. type: "integer"
  25258. }
  25259. },
  25260. url: "/user/keys/:key_id"
  25261. },
  25262. follow: {
  25263. method: "PUT",
  25264. params: {
  25265. username: {
  25266. required: true,
  25267. type: "string"
  25268. }
  25269. },
  25270. url: "/user/following/:username"
  25271. },
  25272. getAuthenticated: {
  25273. method: "GET",
  25274. params: {},
  25275. url: "/user"
  25276. },
  25277. getByUsername: {
  25278. method: "GET",
  25279. params: {
  25280. username: {
  25281. required: true,
  25282. type: "string"
  25283. }
  25284. },
  25285. url: "/users/:username"
  25286. },
  25287. getContextForUser: {
  25288. method: "GET",
  25289. params: {
  25290. subject_id: {
  25291. type: "string"
  25292. },
  25293. subject_type: {
  25294. enum: ["organization", "repository", "issue", "pull_request"],
  25295. type: "string"
  25296. },
  25297. username: {
  25298. required: true,
  25299. type: "string"
  25300. }
  25301. },
  25302. url: "/users/:username/hovercard"
  25303. },
  25304. getGpgKey: {
  25305. method: "GET",
  25306. params: {
  25307. gpg_key_id: {
  25308. required: true,
  25309. type: "integer"
  25310. }
  25311. },
  25312. url: "/user/gpg_keys/:gpg_key_id"
  25313. },
  25314. getPublicKey: {
  25315. method: "GET",
  25316. params: {
  25317. key_id: {
  25318. required: true,
  25319. type: "integer"
  25320. }
  25321. },
  25322. url: "/user/keys/:key_id"
  25323. },
  25324. list: {
  25325. method: "GET",
  25326. params: {
  25327. page: {
  25328. type: "integer"
  25329. },
  25330. per_page: {
  25331. type: "integer"
  25332. },
  25333. since: {
  25334. type: "string"
  25335. }
  25336. },
  25337. url: "/users"
  25338. },
  25339. listBlocked: {
  25340. method: "GET",
  25341. params: {},
  25342. url: "/user/blocks"
  25343. },
  25344. listEmails: {
  25345. method: "GET",
  25346. params: {
  25347. page: {
  25348. type: "integer"
  25349. },
  25350. per_page: {
  25351. type: "integer"
  25352. }
  25353. },
  25354. url: "/user/emails"
  25355. },
  25356. listFollowersForAuthenticatedUser: {
  25357. method: "GET",
  25358. params: {
  25359. page: {
  25360. type: "integer"
  25361. },
  25362. per_page: {
  25363. type: "integer"
  25364. }
  25365. },
  25366. url: "/user/followers"
  25367. },
  25368. listFollowersForUser: {
  25369. method: "GET",
  25370. params: {
  25371. page: {
  25372. type: "integer"
  25373. },
  25374. per_page: {
  25375. type: "integer"
  25376. },
  25377. username: {
  25378. required: true,
  25379. type: "string"
  25380. }
  25381. },
  25382. url: "/users/:username/followers"
  25383. },
  25384. listFollowingForAuthenticatedUser: {
  25385. method: "GET",
  25386. params: {
  25387. page: {
  25388. type: "integer"
  25389. },
  25390. per_page: {
  25391. type: "integer"
  25392. }
  25393. },
  25394. url: "/user/following"
  25395. },
  25396. listFollowingForUser: {
  25397. method: "GET",
  25398. params: {
  25399. page: {
  25400. type: "integer"
  25401. },
  25402. per_page: {
  25403. type: "integer"
  25404. },
  25405. username: {
  25406. required: true,
  25407. type: "string"
  25408. }
  25409. },
  25410. url: "/users/:username/following"
  25411. },
  25412. listGpgKeys: {
  25413. method: "GET",
  25414. params: {
  25415. page: {
  25416. type: "integer"
  25417. },
  25418. per_page: {
  25419. type: "integer"
  25420. }
  25421. },
  25422. url: "/user/gpg_keys"
  25423. },
  25424. listGpgKeysForUser: {
  25425. method: "GET",
  25426. params: {
  25427. page: {
  25428. type: "integer"
  25429. },
  25430. per_page: {
  25431. type: "integer"
  25432. },
  25433. username: {
  25434. required: true,
  25435. type: "string"
  25436. }
  25437. },
  25438. url: "/users/:username/gpg_keys"
  25439. },
  25440. listPublicEmails: {
  25441. method: "GET",
  25442. params: {
  25443. page: {
  25444. type: "integer"
  25445. },
  25446. per_page: {
  25447. type: "integer"
  25448. }
  25449. },
  25450. url: "/user/public_emails"
  25451. },
  25452. listPublicKeys: {
  25453. method: "GET",
  25454. params: {
  25455. page: {
  25456. type: "integer"
  25457. },
  25458. per_page: {
  25459. type: "integer"
  25460. }
  25461. },
  25462. url: "/user/keys"
  25463. },
  25464. listPublicKeysForUser: {
  25465. method: "GET",
  25466. params: {
  25467. page: {
  25468. type: "integer"
  25469. },
  25470. per_page: {
  25471. type: "integer"
  25472. },
  25473. username: {
  25474. required: true,
  25475. type: "string"
  25476. }
  25477. },
  25478. url: "/users/:username/keys"
  25479. },
  25480. togglePrimaryEmailVisibility: {
  25481. method: "PATCH",
  25482. params: {
  25483. email: {
  25484. required: true,
  25485. type: "string"
  25486. },
  25487. visibility: {
  25488. required: true,
  25489. type: "string"
  25490. }
  25491. },
  25492. url: "/user/email/visibility"
  25493. },
  25494. unblock: {
  25495. method: "DELETE",
  25496. params: {
  25497. username: {
  25498. required: true,
  25499. type: "string"
  25500. }
  25501. },
  25502. url: "/user/blocks/:username"
  25503. },
  25504. unfollow: {
  25505. method: "DELETE",
  25506. params: {
  25507. username: {
  25508. required: true,
  25509. type: "string"
  25510. }
  25511. },
  25512. url: "/user/following/:username"
  25513. },
  25514. updateAuthenticated: {
  25515. method: "PATCH",
  25516. params: {
  25517. bio: {
  25518. type: "string"
  25519. },
  25520. blog: {
  25521. type: "string"
  25522. },
  25523. company: {
  25524. type: "string"
  25525. },
  25526. email: {
  25527. type: "string"
  25528. },
  25529. hireable: {
  25530. type: "boolean"
  25531. },
  25532. location: {
  25533. type: "string"
  25534. },
  25535. name: {
  25536. type: "string"
  25537. }
  25538. },
  25539. url: "/user"
  25540. }
  25541. }
  25542. };
  25543. const VERSION = "2.4.0";
  25544. function registerEndpoints(octokit, routes) {
  25545. Object.keys(routes).forEach(namespaceName => {
  25546. if (!octokit[namespaceName]) {
  25547. octokit[namespaceName] = {};
  25548. }
  25549. Object.keys(routes[namespaceName]).forEach(apiName => {
  25550. const apiOptions = routes[namespaceName][apiName];
  25551. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25552. if (typeof apiOptions[key] !== "undefined") {
  25553. map[key] = apiOptions[key];
  25554. }
  25555. return map;
  25556. }, {});
  25557. endpointDefaults.request = {
  25558. validate: apiOptions.params
  25559. };
  25560. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25561. // Not the most elegant solution, but we don’t want to move deprecation
  25562. // logic into octokit/endpoint.js as it’s out of scope
  25563. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25564. if (hasDeprecatedParam) {
  25565. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25566. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25567. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25568. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25569. }
  25570. if (apiOptions.deprecated) {
  25571. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25572. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25573. octokit[namespaceName][apiName] = request;
  25574. return request.apply(null, arguments);
  25575. }, request);
  25576. return;
  25577. }
  25578. octokit[namespaceName][apiName] = request;
  25579. });
  25580. });
  25581. }
  25582. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25583. const patchedMethod = options => {
  25584. options = Object.assign({}, options);
  25585. Object.keys(options).forEach(key => {
  25586. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25587. const aliasKey = apiOptions.params[key].alias;
  25588. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25589. if (!(aliasKey in options)) {
  25590. options[aliasKey] = options[key];
  25591. }
  25592. delete options[key];
  25593. }
  25594. });
  25595. return method(options);
  25596. };
  25597. Object.keys(method).forEach(key => {
  25598. patchedMethod[key] = method[key];
  25599. });
  25600. return patchedMethod;
  25601. }
  25602. /**
  25603. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25604. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25605. * done, we will remove the registerEndpoints methods and return the methods
  25606. * directly as with the other plugins. At that point we will also remove the
  25607. * legacy workarounds and deprecations.
  25608. *
  25609. * See the plan at
  25610. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25611. */
  25612. function restEndpointMethods(octokit) {
  25613. // @ts-ignore
  25614. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25615. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25616. // See https://github.com/octokit/rest.js/pull/1134
  25617. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25618. Object.defineProperty(octokit, deprecatedScope, {
  25619. get() {
  25620. octokit.log.warn( // @ts-ignore
  25621. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25622. return octokit[scope];
  25623. }
  25624. });
  25625. });
  25626. return {};
  25627. }
  25628. restEndpointMethods.VERSION = VERSION;
  25629. exports.restEndpointMethods = restEndpointMethods;
  25630. //# sourceMappingURL=index.js.map
  25631. /***/ }),
  25632. /***/ 850:
  25633. /***/ (function(module, __unusedexports, __webpack_require__) {
  25634. module.exports = paginationMethodsPlugin
  25635. function paginationMethodsPlugin (octokit) {
  25636. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25637. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25638. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25639. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25640. octokit.hasFirstPage = __webpack_require__(536)
  25641. octokit.hasLastPage = __webpack_require__(336)
  25642. octokit.hasNextPage = __webpack_require__(929)
  25643. octokit.hasPreviousPage = __webpack_require__(558)
  25644. }
  25645. /***/ }),
  25646. /***/ 854:
  25647. /***/ (function(module) {
  25648. /**
  25649. * lodash (Custom Build) <https://lodash.com/>
  25650. * Build: `lodash modularize exports="npm" -o ./`
  25651. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25652. * Released under MIT license <https://lodash.com/license>
  25653. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25654. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25655. */
  25656. /** Used as the `TypeError` message for "Functions" methods. */
  25657. var FUNC_ERROR_TEXT = 'Expected a function';
  25658. /** Used to stand-in for `undefined` hash values. */
  25659. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25660. /** Used as references for various `Number` constants. */
  25661. var INFINITY = 1 / 0;
  25662. /** `Object#toString` result references. */
  25663. var funcTag = '[object Function]',
  25664. genTag = '[object GeneratorFunction]',
  25665. symbolTag = '[object Symbol]';
  25666. /** Used to match property names within property paths. */
  25667. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25668. reIsPlainProp = /^\w*$/,
  25669. reLeadingDot = /^\./,
  25670. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25671. /**
  25672. * Used to match `RegExp`
  25673. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25674. */
  25675. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25676. /** Used to match backslashes in property paths. */
  25677. var reEscapeChar = /\\(\\)?/g;
  25678. /** Used to detect host constructors (Safari). */
  25679. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25680. /** Detect free variable `global` from Node.js. */
  25681. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25682. /** Detect free variable `self`. */
  25683. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25684. /** Used as a reference to the global object. */
  25685. var root = freeGlobal || freeSelf || Function('return this')();
  25686. /**
  25687. * Gets the value at `key` of `object`.
  25688. *
  25689. * @private
  25690. * @param {Object} [object] The object to query.
  25691. * @param {string} key The key of the property to get.
  25692. * @returns {*} Returns the property value.
  25693. */
  25694. function getValue(object, key) {
  25695. return object == null ? undefined : object[key];
  25696. }
  25697. /**
  25698. * Checks if `value` is a host object in IE < 9.
  25699. *
  25700. * @private
  25701. * @param {*} value The value to check.
  25702. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25703. */
  25704. function isHostObject(value) {
  25705. // Many host objects are `Object` objects that can coerce to strings
  25706. // despite having improperly defined `toString` methods.
  25707. var result = false;
  25708. if (value != null && typeof value.toString != 'function') {
  25709. try {
  25710. result = !!(value + '');
  25711. } catch (e) {}
  25712. }
  25713. return result;
  25714. }
  25715. /** Used for built-in method references. */
  25716. var arrayProto = Array.prototype,
  25717. funcProto = Function.prototype,
  25718. objectProto = Object.prototype;
  25719. /** Used to detect overreaching core-js shims. */
  25720. var coreJsData = root['__core-js_shared__'];
  25721. /** Used to detect methods masquerading as native. */
  25722. var maskSrcKey = (function() {
  25723. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25724. return uid ? ('Symbol(src)_1.' + uid) : '';
  25725. }());
  25726. /** Used to resolve the decompiled source of functions. */
  25727. var funcToString = funcProto.toString;
  25728. /** Used to check objects for own properties. */
  25729. var hasOwnProperty = objectProto.hasOwnProperty;
  25730. /**
  25731. * Used to resolve the
  25732. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25733. * of values.
  25734. */
  25735. var objectToString = objectProto.toString;
  25736. /** Used to detect if a method is native. */
  25737. var reIsNative = RegExp('^' +
  25738. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25739. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25740. );
  25741. /** Built-in value references. */
  25742. var Symbol = root.Symbol,
  25743. splice = arrayProto.splice;
  25744. /* Built-in method references that are verified to be native. */
  25745. var Map = getNative(root, 'Map'),
  25746. nativeCreate = getNative(Object, 'create');
  25747. /** Used to convert symbols to primitives and strings. */
  25748. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25749. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25750. /**
  25751. * Creates a hash object.
  25752. *
  25753. * @private
  25754. * @constructor
  25755. * @param {Array} [entries] The key-value pairs to cache.
  25756. */
  25757. function Hash(entries) {
  25758. var index = -1,
  25759. length = entries ? entries.length : 0;
  25760. this.clear();
  25761. while (++index < length) {
  25762. var entry = entries[index];
  25763. this.set(entry[0], entry[1]);
  25764. }
  25765. }
  25766. /**
  25767. * Removes all key-value entries from the hash.
  25768. *
  25769. * @private
  25770. * @name clear
  25771. * @memberOf Hash
  25772. */
  25773. function hashClear() {
  25774. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25775. }
  25776. /**
  25777. * Removes `key` and its value from the hash.
  25778. *
  25779. * @private
  25780. * @name delete
  25781. * @memberOf Hash
  25782. * @param {Object} hash The hash to modify.
  25783. * @param {string} key The key of the value to remove.
  25784. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25785. */
  25786. function hashDelete(key) {
  25787. return this.has(key) && delete this.__data__[key];
  25788. }
  25789. /**
  25790. * Gets the hash value for `key`.
  25791. *
  25792. * @private
  25793. * @name get
  25794. * @memberOf Hash
  25795. * @param {string} key The key of the value to get.
  25796. * @returns {*} Returns the entry value.
  25797. */
  25798. function hashGet(key) {
  25799. var data = this.__data__;
  25800. if (nativeCreate) {
  25801. var result = data[key];
  25802. return result === HASH_UNDEFINED ? undefined : result;
  25803. }
  25804. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  25805. }
  25806. /**
  25807. * Checks if a hash value for `key` exists.
  25808. *
  25809. * @private
  25810. * @name has
  25811. * @memberOf Hash
  25812. * @param {string} key The key of the entry to check.
  25813. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25814. */
  25815. function hashHas(key) {
  25816. var data = this.__data__;
  25817. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  25818. }
  25819. /**
  25820. * Sets the hash `key` to `value`.
  25821. *
  25822. * @private
  25823. * @name set
  25824. * @memberOf Hash
  25825. * @param {string} key The key of the value to set.
  25826. * @param {*} value The value to set.
  25827. * @returns {Object} Returns the hash instance.
  25828. */
  25829. function hashSet(key, value) {
  25830. var data = this.__data__;
  25831. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  25832. return this;
  25833. }
  25834. // Add methods to `Hash`.
  25835. Hash.prototype.clear = hashClear;
  25836. Hash.prototype['delete'] = hashDelete;
  25837. Hash.prototype.get = hashGet;
  25838. Hash.prototype.has = hashHas;
  25839. Hash.prototype.set = hashSet;
  25840. /**
  25841. * Creates an list cache object.
  25842. *
  25843. * @private
  25844. * @constructor
  25845. * @param {Array} [entries] The key-value pairs to cache.
  25846. */
  25847. function ListCache(entries) {
  25848. var index = -1,
  25849. length = entries ? entries.length : 0;
  25850. this.clear();
  25851. while (++index < length) {
  25852. var entry = entries[index];
  25853. this.set(entry[0], entry[1]);
  25854. }
  25855. }
  25856. /**
  25857. * Removes all key-value entries from the list cache.
  25858. *
  25859. * @private
  25860. * @name clear
  25861. * @memberOf ListCache
  25862. */
  25863. function listCacheClear() {
  25864. this.__data__ = [];
  25865. }
  25866. /**
  25867. * Removes `key` and its value from the list cache.
  25868. *
  25869. * @private
  25870. * @name delete
  25871. * @memberOf ListCache
  25872. * @param {string} key The key of the value to remove.
  25873. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25874. */
  25875. function listCacheDelete(key) {
  25876. var data = this.__data__,
  25877. index = assocIndexOf(data, key);
  25878. if (index < 0) {
  25879. return false;
  25880. }
  25881. var lastIndex = data.length - 1;
  25882. if (index == lastIndex) {
  25883. data.pop();
  25884. } else {
  25885. splice.call(data, index, 1);
  25886. }
  25887. return true;
  25888. }
  25889. /**
  25890. * Gets the list cache value for `key`.
  25891. *
  25892. * @private
  25893. * @name get
  25894. * @memberOf ListCache
  25895. * @param {string} key The key of the value to get.
  25896. * @returns {*} Returns the entry value.
  25897. */
  25898. function listCacheGet(key) {
  25899. var data = this.__data__,
  25900. index = assocIndexOf(data, key);
  25901. return index < 0 ? undefined : data[index][1];
  25902. }
  25903. /**
  25904. * Checks if a list cache value for `key` exists.
  25905. *
  25906. * @private
  25907. * @name has
  25908. * @memberOf ListCache
  25909. * @param {string} key The key of the entry to check.
  25910. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25911. */
  25912. function listCacheHas(key) {
  25913. return assocIndexOf(this.__data__, key) > -1;
  25914. }
  25915. /**
  25916. * Sets the list cache `key` to `value`.
  25917. *
  25918. * @private
  25919. * @name set
  25920. * @memberOf ListCache
  25921. * @param {string} key The key of the value to set.
  25922. * @param {*} value The value to set.
  25923. * @returns {Object} Returns the list cache instance.
  25924. */
  25925. function listCacheSet(key, value) {
  25926. var data = this.__data__,
  25927. index = assocIndexOf(data, key);
  25928. if (index < 0) {
  25929. data.push([key, value]);
  25930. } else {
  25931. data[index][1] = value;
  25932. }
  25933. return this;
  25934. }
  25935. // Add methods to `ListCache`.
  25936. ListCache.prototype.clear = listCacheClear;
  25937. ListCache.prototype['delete'] = listCacheDelete;
  25938. ListCache.prototype.get = listCacheGet;
  25939. ListCache.prototype.has = listCacheHas;
  25940. ListCache.prototype.set = listCacheSet;
  25941. /**
  25942. * Creates a map cache object to store key-value pairs.
  25943. *
  25944. * @private
  25945. * @constructor
  25946. * @param {Array} [entries] The key-value pairs to cache.
  25947. */
  25948. function MapCache(entries) {
  25949. var index = -1,
  25950. length = entries ? entries.length : 0;
  25951. this.clear();
  25952. while (++index < length) {
  25953. var entry = entries[index];
  25954. this.set(entry[0], entry[1]);
  25955. }
  25956. }
  25957. /**
  25958. * Removes all key-value entries from the map.
  25959. *
  25960. * @private
  25961. * @name clear
  25962. * @memberOf MapCache
  25963. */
  25964. function mapCacheClear() {
  25965. this.__data__ = {
  25966. 'hash': new Hash,
  25967. 'map': new (Map || ListCache),
  25968. 'string': new Hash
  25969. };
  25970. }
  25971. /**
  25972. * Removes `key` and its value from the map.
  25973. *
  25974. * @private
  25975. * @name delete
  25976. * @memberOf MapCache
  25977. * @param {string} key The key of the value to remove.
  25978. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25979. */
  25980. function mapCacheDelete(key) {
  25981. return getMapData(this, key)['delete'](key);
  25982. }
  25983. /**
  25984. * Gets the map value for `key`.
  25985. *
  25986. * @private
  25987. * @name get
  25988. * @memberOf MapCache
  25989. * @param {string} key The key of the value to get.
  25990. * @returns {*} Returns the entry value.
  25991. */
  25992. function mapCacheGet(key) {
  25993. return getMapData(this, key).get(key);
  25994. }
  25995. /**
  25996. * Checks if a map value for `key` exists.
  25997. *
  25998. * @private
  25999. * @name has
  26000. * @memberOf MapCache
  26001. * @param {string} key The key of the entry to check.
  26002. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26003. */
  26004. function mapCacheHas(key) {
  26005. return getMapData(this, key).has(key);
  26006. }
  26007. /**
  26008. * Sets the map `key` to `value`.
  26009. *
  26010. * @private
  26011. * @name set
  26012. * @memberOf MapCache
  26013. * @param {string} key The key of the value to set.
  26014. * @param {*} value The value to set.
  26015. * @returns {Object} Returns the map cache instance.
  26016. */
  26017. function mapCacheSet(key, value) {
  26018. getMapData(this, key).set(key, value);
  26019. return this;
  26020. }
  26021. // Add methods to `MapCache`.
  26022. MapCache.prototype.clear = mapCacheClear;
  26023. MapCache.prototype['delete'] = mapCacheDelete;
  26024. MapCache.prototype.get = mapCacheGet;
  26025. MapCache.prototype.has = mapCacheHas;
  26026. MapCache.prototype.set = mapCacheSet;
  26027. /**
  26028. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26029. *
  26030. * @private
  26031. * @param {Array} array The array to inspect.
  26032. * @param {*} key The key to search for.
  26033. * @returns {number} Returns the index of the matched value, else `-1`.
  26034. */
  26035. function assocIndexOf(array, key) {
  26036. var length = array.length;
  26037. while (length--) {
  26038. if (eq(array[length][0], key)) {
  26039. return length;
  26040. }
  26041. }
  26042. return -1;
  26043. }
  26044. /**
  26045. * The base implementation of `_.get` without support for default values.
  26046. *
  26047. * @private
  26048. * @param {Object} object The object to query.
  26049. * @param {Array|string} path The path of the property to get.
  26050. * @returns {*} Returns the resolved value.
  26051. */
  26052. function baseGet(object, path) {
  26053. path = isKey(path, object) ? [path] : castPath(path);
  26054. var index = 0,
  26055. length = path.length;
  26056. while (object != null && index < length) {
  26057. object = object[toKey(path[index++])];
  26058. }
  26059. return (index && index == length) ? object : undefined;
  26060. }
  26061. /**
  26062. * The base implementation of `_.isNative` without bad shim checks.
  26063. *
  26064. * @private
  26065. * @param {*} value The value to check.
  26066. * @returns {boolean} Returns `true` if `value` is a native function,
  26067. * else `false`.
  26068. */
  26069. function baseIsNative(value) {
  26070. if (!isObject(value) || isMasked(value)) {
  26071. return false;
  26072. }
  26073. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26074. return pattern.test(toSource(value));
  26075. }
  26076. /**
  26077. * The base implementation of `_.toString` which doesn't convert nullish
  26078. * values to empty strings.
  26079. *
  26080. * @private
  26081. * @param {*} value The value to process.
  26082. * @returns {string} Returns the string.
  26083. */
  26084. function baseToString(value) {
  26085. // Exit early for strings to avoid a performance hit in some environments.
  26086. if (typeof value == 'string') {
  26087. return value;
  26088. }
  26089. if (isSymbol(value)) {
  26090. return symbolToString ? symbolToString.call(value) : '';
  26091. }
  26092. var result = (value + '');
  26093. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26094. }
  26095. /**
  26096. * Casts `value` to a path array if it's not one.
  26097. *
  26098. * @private
  26099. * @param {*} value The value to inspect.
  26100. * @returns {Array} Returns the cast property path array.
  26101. */
  26102. function castPath(value) {
  26103. return isArray(value) ? value : stringToPath(value);
  26104. }
  26105. /**
  26106. * Gets the data for `map`.
  26107. *
  26108. * @private
  26109. * @param {Object} map The map to query.
  26110. * @param {string} key The reference key.
  26111. * @returns {*} Returns the map data.
  26112. */
  26113. function getMapData(map, key) {
  26114. var data = map.__data__;
  26115. return isKeyable(key)
  26116. ? data[typeof key == 'string' ? 'string' : 'hash']
  26117. : data.map;
  26118. }
  26119. /**
  26120. * Gets the native function at `key` of `object`.
  26121. *
  26122. * @private
  26123. * @param {Object} object The object to query.
  26124. * @param {string} key The key of the method to get.
  26125. * @returns {*} Returns the function if it's native, else `undefined`.
  26126. */
  26127. function getNative(object, key) {
  26128. var value = getValue(object, key);
  26129. return baseIsNative(value) ? value : undefined;
  26130. }
  26131. /**
  26132. * Checks if `value` is a property name and not a property path.
  26133. *
  26134. * @private
  26135. * @param {*} value The value to check.
  26136. * @param {Object} [object] The object to query keys on.
  26137. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26138. */
  26139. function isKey(value, object) {
  26140. if (isArray(value)) {
  26141. return false;
  26142. }
  26143. var type = typeof value;
  26144. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26145. value == null || isSymbol(value)) {
  26146. return true;
  26147. }
  26148. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26149. (object != null && value in Object(object));
  26150. }
  26151. /**
  26152. * Checks if `value` is suitable for use as unique object key.
  26153. *
  26154. * @private
  26155. * @param {*} value The value to check.
  26156. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26157. */
  26158. function isKeyable(value) {
  26159. var type = typeof value;
  26160. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26161. ? (value !== '__proto__')
  26162. : (value === null);
  26163. }
  26164. /**
  26165. * Checks if `func` has its source masked.
  26166. *
  26167. * @private
  26168. * @param {Function} func The function to check.
  26169. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26170. */
  26171. function isMasked(func) {
  26172. return !!maskSrcKey && (maskSrcKey in func);
  26173. }
  26174. /**
  26175. * Converts `string` to a property path array.
  26176. *
  26177. * @private
  26178. * @param {string} string The string to convert.
  26179. * @returns {Array} Returns the property path array.
  26180. */
  26181. var stringToPath = memoize(function(string) {
  26182. string = toString(string);
  26183. var result = [];
  26184. if (reLeadingDot.test(string)) {
  26185. result.push('');
  26186. }
  26187. string.replace(rePropName, function(match, number, quote, string) {
  26188. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26189. });
  26190. return result;
  26191. });
  26192. /**
  26193. * Converts `value` to a string key if it's not a string or symbol.
  26194. *
  26195. * @private
  26196. * @param {*} value The value to inspect.
  26197. * @returns {string|symbol} Returns the key.
  26198. */
  26199. function toKey(value) {
  26200. if (typeof value == 'string' || isSymbol(value)) {
  26201. return value;
  26202. }
  26203. var result = (value + '');
  26204. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26205. }
  26206. /**
  26207. * Converts `func` to its source code.
  26208. *
  26209. * @private
  26210. * @param {Function} func The function to process.
  26211. * @returns {string} Returns the source code.
  26212. */
  26213. function toSource(func) {
  26214. if (func != null) {
  26215. try {
  26216. return funcToString.call(func);
  26217. } catch (e) {}
  26218. try {
  26219. return (func + '');
  26220. } catch (e) {}
  26221. }
  26222. return '';
  26223. }
  26224. /**
  26225. * Creates a function that memoizes the result of `func`. If `resolver` is
  26226. * provided, it determines the cache key for storing the result based on the
  26227. * arguments provided to the memoized function. By default, the first argument
  26228. * provided to the memoized function is used as the map cache key. The `func`
  26229. * is invoked with the `this` binding of the memoized function.
  26230. *
  26231. * **Note:** The cache is exposed as the `cache` property on the memoized
  26232. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26233. * constructor with one whose instances implement the
  26234. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26235. * method interface of `delete`, `get`, `has`, and `set`.
  26236. *
  26237. * @static
  26238. * @memberOf _
  26239. * @since 0.1.0
  26240. * @category Function
  26241. * @param {Function} func The function to have its output memoized.
  26242. * @param {Function} [resolver] The function to resolve the cache key.
  26243. * @returns {Function} Returns the new memoized function.
  26244. * @example
  26245. *
  26246. * var object = { 'a': 1, 'b': 2 };
  26247. * var other = { 'c': 3, 'd': 4 };
  26248. *
  26249. * var values = _.memoize(_.values);
  26250. * values(object);
  26251. * // => [1, 2]
  26252. *
  26253. * values(other);
  26254. * // => [3, 4]
  26255. *
  26256. * object.a = 2;
  26257. * values(object);
  26258. * // => [1, 2]
  26259. *
  26260. * // Modify the result cache.
  26261. * values.cache.set(object, ['a', 'b']);
  26262. * values(object);
  26263. * // => ['a', 'b']
  26264. *
  26265. * // Replace `_.memoize.Cache`.
  26266. * _.memoize.Cache = WeakMap;
  26267. */
  26268. function memoize(func, resolver) {
  26269. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26270. throw new TypeError(FUNC_ERROR_TEXT);
  26271. }
  26272. var memoized = function() {
  26273. var args = arguments,
  26274. key = resolver ? resolver.apply(this, args) : args[0],
  26275. cache = memoized.cache;
  26276. if (cache.has(key)) {
  26277. return cache.get(key);
  26278. }
  26279. var result = func.apply(this, args);
  26280. memoized.cache = cache.set(key, result);
  26281. return result;
  26282. };
  26283. memoized.cache = new (memoize.Cache || MapCache);
  26284. return memoized;
  26285. }
  26286. // Assign cache to `_.memoize`.
  26287. memoize.Cache = MapCache;
  26288. /**
  26289. * Performs a
  26290. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26291. * comparison between two values to determine if they are equivalent.
  26292. *
  26293. * @static
  26294. * @memberOf _
  26295. * @since 4.0.0
  26296. * @category Lang
  26297. * @param {*} value The value to compare.
  26298. * @param {*} other The other value to compare.
  26299. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26300. * @example
  26301. *
  26302. * var object = { 'a': 1 };
  26303. * var other = { 'a': 1 };
  26304. *
  26305. * _.eq(object, object);
  26306. * // => true
  26307. *
  26308. * _.eq(object, other);
  26309. * // => false
  26310. *
  26311. * _.eq('a', 'a');
  26312. * // => true
  26313. *
  26314. * _.eq('a', Object('a'));
  26315. * // => false
  26316. *
  26317. * _.eq(NaN, NaN);
  26318. * // => true
  26319. */
  26320. function eq(value, other) {
  26321. return value === other || (value !== value && other !== other);
  26322. }
  26323. /**
  26324. * Checks if `value` is classified as an `Array` object.
  26325. *
  26326. * @static
  26327. * @memberOf _
  26328. * @since 0.1.0
  26329. * @category Lang
  26330. * @param {*} value The value to check.
  26331. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26332. * @example
  26333. *
  26334. * _.isArray([1, 2, 3]);
  26335. * // => true
  26336. *
  26337. * _.isArray(document.body.children);
  26338. * // => false
  26339. *
  26340. * _.isArray('abc');
  26341. * // => false
  26342. *
  26343. * _.isArray(_.noop);
  26344. * // => false
  26345. */
  26346. var isArray = Array.isArray;
  26347. /**
  26348. * Checks if `value` is classified as a `Function` object.
  26349. *
  26350. * @static
  26351. * @memberOf _
  26352. * @since 0.1.0
  26353. * @category Lang
  26354. * @param {*} value The value to check.
  26355. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26356. * @example
  26357. *
  26358. * _.isFunction(_);
  26359. * // => true
  26360. *
  26361. * _.isFunction(/abc/);
  26362. * // => false
  26363. */
  26364. function isFunction(value) {
  26365. // The use of `Object#toString` avoids issues with the `typeof` operator
  26366. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26367. var tag = isObject(value) ? objectToString.call(value) : '';
  26368. return tag == funcTag || tag == genTag;
  26369. }
  26370. /**
  26371. * Checks if `value` is the
  26372. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26373. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26374. *
  26375. * @static
  26376. * @memberOf _
  26377. * @since 0.1.0
  26378. * @category Lang
  26379. * @param {*} value The value to check.
  26380. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26381. * @example
  26382. *
  26383. * _.isObject({});
  26384. * // => true
  26385. *
  26386. * _.isObject([1, 2, 3]);
  26387. * // => true
  26388. *
  26389. * _.isObject(_.noop);
  26390. * // => true
  26391. *
  26392. * _.isObject(null);
  26393. * // => false
  26394. */
  26395. function isObject(value) {
  26396. var type = typeof value;
  26397. return !!value && (type == 'object' || type == 'function');
  26398. }
  26399. /**
  26400. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26401. * and has a `typeof` result of "object".
  26402. *
  26403. * @static
  26404. * @memberOf _
  26405. * @since 4.0.0
  26406. * @category Lang
  26407. * @param {*} value The value to check.
  26408. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26409. * @example
  26410. *
  26411. * _.isObjectLike({});
  26412. * // => true
  26413. *
  26414. * _.isObjectLike([1, 2, 3]);
  26415. * // => true
  26416. *
  26417. * _.isObjectLike(_.noop);
  26418. * // => false
  26419. *
  26420. * _.isObjectLike(null);
  26421. * // => false
  26422. */
  26423. function isObjectLike(value) {
  26424. return !!value && typeof value == 'object';
  26425. }
  26426. /**
  26427. * Checks if `value` is classified as a `Symbol` primitive or object.
  26428. *
  26429. * @static
  26430. * @memberOf _
  26431. * @since 4.0.0
  26432. * @category Lang
  26433. * @param {*} value The value to check.
  26434. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26435. * @example
  26436. *
  26437. * _.isSymbol(Symbol.iterator);
  26438. * // => true
  26439. *
  26440. * _.isSymbol('abc');
  26441. * // => false
  26442. */
  26443. function isSymbol(value) {
  26444. return typeof value == 'symbol' ||
  26445. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26446. }
  26447. /**
  26448. * Converts `value` to a string. An empty string is returned for `null`
  26449. * and `undefined` values. The sign of `-0` is preserved.
  26450. *
  26451. * @static
  26452. * @memberOf _
  26453. * @since 4.0.0
  26454. * @category Lang
  26455. * @param {*} value The value to process.
  26456. * @returns {string} Returns the string.
  26457. * @example
  26458. *
  26459. * _.toString(null);
  26460. * // => ''
  26461. *
  26462. * _.toString(-0);
  26463. * // => '-0'
  26464. *
  26465. * _.toString([1, 2, 3]);
  26466. * // => '1,2,3'
  26467. */
  26468. function toString(value) {
  26469. return value == null ? '' : baseToString(value);
  26470. }
  26471. /**
  26472. * Gets the value at `path` of `object`. If the resolved value is
  26473. * `undefined`, the `defaultValue` is returned in its place.
  26474. *
  26475. * @static
  26476. * @memberOf _
  26477. * @since 3.7.0
  26478. * @category Object
  26479. * @param {Object} object The object to query.
  26480. * @param {Array|string} path The path of the property to get.
  26481. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26482. * @returns {*} Returns the resolved value.
  26483. * @example
  26484. *
  26485. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26486. *
  26487. * _.get(object, 'a[0].b.c');
  26488. * // => 3
  26489. *
  26490. * _.get(object, ['a', '0', 'b', 'c']);
  26491. * // => 3
  26492. *
  26493. * _.get(object, 'a.b.c', 'default');
  26494. * // => 'default'
  26495. */
  26496. function get(object, path, defaultValue) {
  26497. var result = object == null ? undefined : baseGet(object, path);
  26498. return result === undefined ? defaultValue : result;
  26499. }
  26500. module.exports = get;
  26501. /***/ }),
  26502. /***/ 855:
  26503. /***/ (function(module, __unusedexports, __webpack_require__) {
  26504. module.exports = registerPlugin;
  26505. const factory = __webpack_require__(47);
  26506. function registerPlugin(plugins, pluginFunction) {
  26507. return factory(
  26508. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26509. );
  26510. }
  26511. /***/ }),
  26512. /***/ 856:
  26513. /***/ (function(module, __unusedexports, __webpack_require__) {
  26514. module.exports = __webpack_require__(141);
  26515. /***/ }),
  26516. /***/ 863:
  26517. /***/ (function(module, __unusedexports, __webpack_require__) {
  26518. module.exports = authenticationBeforeRequest;
  26519. const btoa = __webpack_require__(675);
  26520. const withAuthorizationPrefix = __webpack_require__(143);
  26521. function authenticationBeforeRequest(state, options) {
  26522. if (typeof state.auth === "string") {
  26523. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26524. return;
  26525. }
  26526. if (state.auth.username) {
  26527. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26528. options.headers.authorization = `Basic ${hash}`;
  26529. if (state.otp) {
  26530. options.headers["x-github-otp"] = state.otp;
  26531. }
  26532. return;
  26533. }
  26534. if (state.auth.clientId) {
  26535. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26536. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26537. // URL though: `/applications/:client_id/tokens/:access_token`.
  26538. //
  26539. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26540. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26541. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26542. //
  26543. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26544. // as well as "/applications/123/tokens/token456"
  26545. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26546. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26547. options.headers.authorization = `Basic ${hash}`;
  26548. return;
  26549. }
  26550. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26551. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26552. return;
  26553. }
  26554. return Promise.resolve()
  26555. .then(() => {
  26556. return state.auth();
  26557. })
  26558. .then(authorization => {
  26559. options.headers.authorization = withAuthorizationPrefix(authorization);
  26560. });
  26561. }
  26562. /***/ }),
  26563. /***/ 866:
  26564. /***/ (function(module, __unusedexports, __webpack_require__) {
  26565. "use strict";
  26566. var shebangRegex = __webpack_require__(816);
  26567. module.exports = function (str) {
  26568. var match = str.match(shebangRegex);
  26569. if (!match) {
  26570. return null;
  26571. }
  26572. var arr = match[0].replace(/#! ?/, '').split(' ');
  26573. var bin = arr[0].split('/').pop();
  26574. var arg = arr[1];
  26575. return (bin === 'env' ?
  26576. arg :
  26577. bin + (arg ? ' ' + arg : '')
  26578. );
  26579. };
  26580. /***/ }),
  26581. /***/ 874:
  26582. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26583. "use strict";
  26584. // Copyright (c) Microsoft. All rights reserved.
  26585. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26586. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26587. return new (P || (P = Promise))(function (resolve, reject) {
  26588. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26589. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26590. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26591. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26592. });
  26593. };
  26594. Object.defineProperty(exports, "__esModule", { value: true });
  26595. const url = __webpack_require__(835);
  26596. const http = __webpack_require__(605);
  26597. const https = __webpack_require__(34);
  26598. let fs;
  26599. let tunnel;
  26600. var HttpCodes;
  26601. (function (HttpCodes) {
  26602. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26603. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26604. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26605. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26606. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26607. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26608. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26609. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26610. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26611. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26612. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26613. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26614. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26615. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26616. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26617. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26618. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26619. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26620. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26621. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26622. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26623. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26624. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26625. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26626. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26627. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26628. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26629. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26630. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26631. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26632. const ExponentialBackoffCeiling = 10;
  26633. const ExponentialBackoffTimeSlice = 5;
  26634. class HttpClientResponse {
  26635. constructor(message) {
  26636. this.message = message;
  26637. }
  26638. readBody() {
  26639. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26640. let output = '';
  26641. this.message.on('data', (chunk) => {
  26642. output += chunk;
  26643. });
  26644. this.message.on('end', () => {
  26645. resolve(output);
  26646. });
  26647. }));
  26648. }
  26649. }
  26650. exports.HttpClientResponse = HttpClientResponse;
  26651. function isHttps(requestUrl) {
  26652. let parsedUrl = url.parse(requestUrl);
  26653. return parsedUrl.protocol === 'https:';
  26654. }
  26655. exports.isHttps = isHttps;
  26656. var EnvironmentVariables;
  26657. (function (EnvironmentVariables) {
  26658. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26659. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26660. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26661. class HttpClient {
  26662. constructor(userAgent, handlers, requestOptions) {
  26663. this._ignoreSslError = false;
  26664. this._allowRedirects = true;
  26665. this._maxRedirects = 50;
  26666. this._allowRetries = false;
  26667. this._maxRetries = 1;
  26668. this._keepAlive = false;
  26669. this._disposed = false;
  26670. this.userAgent = userAgent;
  26671. this.handlers = handlers || [];
  26672. this.requestOptions = requestOptions;
  26673. if (requestOptions) {
  26674. if (requestOptions.ignoreSslError != null) {
  26675. this._ignoreSslError = requestOptions.ignoreSslError;
  26676. }
  26677. this._socketTimeout = requestOptions.socketTimeout;
  26678. this._httpProxy = requestOptions.proxy;
  26679. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26680. this._httpProxyBypassHosts = [];
  26681. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26682. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26683. });
  26684. }
  26685. this._certConfig = requestOptions.cert;
  26686. if (this._certConfig) {
  26687. // If using cert, need fs
  26688. fs = __webpack_require__(747);
  26689. // cache the cert content into memory, so we don't have to read it from disk every time
  26690. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26691. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26692. }
  26693. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26694. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26695. }
  26696. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26697. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26698. }
  26699. }
  26700. if (requestOptions.allowRedirects != null) {
  26701. this._allowRedirects = requestOptions.allowRedirects;
  26702. }
  26703. if (requestOptions.maxRedirects != null) {
  26704. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26705. }
  26706. if (requestOptions.keepAlive != null) {
  26707. this._keepAlive = requestOptions.keepAlive;
  26708. }
  26709. if (requestOptions.allowRetries != null) {
  26710. this._allowRetries = requestOptions.allowRetries;
  26711. }
  26712. if (requestOptions.maxRetries != null) {
  26713. this._maxRetries = requestOptions.maxRetries;
  26714. }
  26715. }
  26716. }
  26717. options(requestUrl, additionalHeaders) {
  26718. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26719. }
  26720. get(requestUrl, additionalHeaders) {
  26721. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26722. }
  26723. del(requestUrl, additionalHeaders) {
  26724. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26725. }
  26726. post(requestUrl, data, additionalHeaders) {
  26727. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26728. }
  26729. patch(requestUrl, data, additionalHeaders) {
  26730. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26731. }
  26732. put(requestUrl, data, additionalHeaders) {
  26733. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  26734. }
  26735. head(requestUrl, additionalHeaders) {
  26736. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  26737. }
  26738. sendStream(verb, requestUrl, stream, additionalHeaders) {
  26739. return this.request(verb, requestUrl, stream, additionalHeaders);
  26740. }
  26741. /**
  26742. * Makes a raw http request.
  26743. * All other methods such as get, post, patch, and request ultimately call this.
  26744. * Prefer get, del, post and patch
  26745. */
  26746. request(verb, requestUrl, data, headers) {
  26747. return __awaiter(this, void 0, void 0, function* () {
  26748. if (this._disposed) {
  26749. throw new Error("Client has already been disposed.");
  26750. }
  26751. let info = this._prepareRequest(verb, requestUrl, headers);
  26752. // Only perform retries on reads since writes may not be idempotent.
  26753. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  26754. let numTries = 0;
  26755. let response;
  26756. while (numTries < maxTries) {
  26757. response = yield this.requestRaw(info, data);
  26758. // Check if it's an authentication challenge
  26759. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  26760. let authenticationHandler;
  26761. for (let i = 0; i < this.handlers.length; i++) {
  26762. if (this.handlers[i].canHandleAuthentication(response)) {
  26763. authenticationHandler = this.handlers[i];
  26764. break;
  26765. }
  26766. }
  26767. if (authenticationHandler) {
  26768. return authenticationHandler.handleAuthentication(this, info, data);
  26769. }
  26770. else {
  26771. // We have received an unauthorized response but have no handlers to handle it.
  26772. // Let the response return to the caller.
  26773. return response;
  26774. }
  26775. }
  26776. let redirectsRemaining = this._maxRedirects;
  26777. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  26778. && this._allowRedirects
  26779. && redirectsRemaining > 0) {
  26780. const redirectUrl = response.message.headers["location"];
  26781. if (!redirectUrl) {
  26782. // if there's no location to redirect to, we won't
  26783. break;
  26784. }
  26785. // we need to finish reading the response before reassigning response
  26786. // which will leak the open socket.
  26787. yield response.readBody();
  26788. // let's make the request with the new redirectUrl
  26789. info = this._prepareRequest(verb, redirectUrl, headers);
  26790. response = yield this.requestRaw(info, data);
  26791. redirectsRemaining--;
  26792. }
  26793. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  26794. // If not a retry code, return immediately instead of retrying
  26795. return response;
  26796. }
  26797. numTries += 1;
  26798. if (numTries < maxTries) {
  26799. yield response.readBody();
  26800. yield this._performExponentialBackoff(numTries);
  26801. }
  26802. }
  26803. return response;
  26804. });
  26805. }
  26806. /**
  26807. * Needs to be called if keepAlive is set to true in request options.
  26808. */
  26809. dispose() {
  26810. if (this._agent) {
  26811. this._agent.destroy();
  26812. }
  26813. this._disposed = true;
  26814. }
  26815. /**
  26816. * Raw request.
  26817. * @param info
  26818. * @param data
  26819. */
  26820. requestRaw(info, data) {
  26821. return new Promise((resolve, reject) => {
  26822. let callbackForResult = function (err, res) {
  26823. if (err) {
  26824. reject(err);
  26825. }
  26826. resolve(res);
  26827. };
  26828. this.requestRawWithCallback(info, data, callbackForResult);
  26829. });
  26830. }
  26831. /**
  26832. * Raw request with callback.
  26833. * @param info
  26834. * @param data
  26835. * @param onResult
  26836. */
  26837. requestRawWithCallback(info, data, onResult) {
  26838. let socket;
  26839. let isDataString = typeof (data) === 'string';
  26840. if (typeof (data) === 'string') {
  26841. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  26842. }
  26843. let callbackCalled = false;
  26844. let handleResult = (err, res) => {
  26845. if (!callbackCalled) {
  26846. callbackCalled = true;
  26847. onResult(err, res);
  26848. }
  26849. };
  26850. let req = info.httpModule.request(info.options, (msg) => {
  26851. let res = new HttpClientResponse(msg);
  26852. handleResult(null, res);
  26853. });
  26854. req.on('socket', (sock) => {
  26855. socket = sock;
  26856. });
  26857. // If we ever get disconnected, we want the socket to timeout eventually
  26858. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  26859. if (socket) {
  26860. socket.end();
  26861. }
  26862. handleResult(new Error('Request timeout: ' + info.options.path), null);
  26863. });
  26864. req.on('error', function (err) {
  26865. // err has statusCode property
  26866. // res should have headers
  26867. handleResult(err, null);
  26868. });
  26869. if (data && typeof (data) === 'string') {
  26870. req.write(data, 'utf8');
  26871. }
  26872. if (data && typeof (data) !== 'string') {
  26873. data.on('close', function () {
  26874. req.end();
  26875. });
  26876. data.pipe(req);
  26877. }
  26878. else {
  26879. req.end();
  26880. }
  26881. }
  26882. _prepareRequest(method, requestUrl, headers) {
  26883. const info = {};
  26884. info.parsedUrl = url.parse(requestUrl);
  26885. const usingSsl = info.parsedUrl.protocol === 'https:';
  26886. info.httpModule = usingSsl ? https : http;
  26887. const defaultPort = usingSsl ? 443 : 80;
  26888. info.options = {};
  26889. info.options.host = info.parsedUrl.hostname;
  26890. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  26891. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  26892. info.options.method = method;
  26893. info.options.headers = this._mergeHeaders(headers);
  26894. info.options.headers["user-agent"] = this.userAgent;
  26895. info.options.agent = this._getAgent(requestUrl);
  26896. // gives handlers an opportunity to participate
  26897. if (this.handlers && !this._isPresigned(requestUrl)) {
  26898. this.handlers.forEach((handler) => {
  26899. handler.prepareRequest(info.options);
  26900. });
  26901. }
  26902. return info;
  26903. }
  26904. _isPresigned(requestUrl) {
  26905. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  26906. const patterns = this.requestOptions.presignedUrlPatterns;
  26907. for (let i = 0; i < patterns.length; i++) {
  26908. if (requestUrl.match(patterns[i])) {
  26909. return true;
  26910. }
  26911. }
  26912. }
  26913. return false;
  26914. }
  26915. _mergeHeaders(headers) {
  26916. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  26917. if (this.requestOptions && this.requestOptions.headers) {
  26918. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  26919. }
  26920. return lowercaseKeys(headers || {});
  26921. }
  26922. _getAgent(requestUrl) {
  26923. let agent;
  26924. let proxy = this._getProxy(requestUrl);
  26925. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  26926. if (this._keepAlive && useProxy) {
  26927. agent = this._proxyAgent;
  26928. }
  26929. if (this._keepAlive && !useProxy) {
  26930. agent = this._agent;
  26931. }
  26932. // if agent is already assigned use that agent.
  26933. if (!!agent) {
  26934. return agent;
  26935. }
  26936. let parsedUrl = url.parse(requestUrl);
  26937. const usingSsl = parsedUrl.protocol === 'https:';
  26938. let maxSockets = 100;
  26939. if (!!this.requestOptions) {
  26940. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  26941. }
  26942. if (useProxy) {
  26943. // If using proxy, need tunnel
  26944. if (!tunnel) {
  26945. tunnel = __webpack_require__(856);
  26946. }
  26947. const agentOptions = {
  26948. maxSockets: maxSockets,
  26949. keepAlive: this._keepAlive,
  26950. proxy: {
  26951. proxyAuth: proxy.proxyAuth,
  26952. host: proxy.proxyUrl.hostname,
  26953. port: proxy.proxyUrl.port
  26954. },
  26955. };
  26956. let tunnelAgent;
  26957. const overHttps = proxy.proxyUrl.protocol === 'https:';
  26958. if (usingSsl) {
  26959. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  26960. }
  26961. else {
  26962. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  26963. }
  26964. agent = tunnelAgent(agentOptions);
  26965. this._proxyAgent = agent;
  26966. }
  26967. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  26968. if (this._keepAlive && !agent) {
  26969. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  26970. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  26971. this._agent = agent;
  26972. }
  26973. // if not using private agent and tunnel agent isn't setup then use global agent
  26974. if (!agent) {
  26975. agent = usingSsl ? https.globalAgent : http.globalAgent;
  26976. }
  26977. if (usingSsl && this._ignoreSslError) {
  26978. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  26979. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  26980. // we have to cast it to any and change it directly
  26981. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  26982. }
  26983. if (usingSsl && this._certConfig) {
  26984. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  26985. }
  26986. return agent;
  26987. }
  26988. _getProxy(requestUrl) {
  26989. const parsedUrl = url.parse(requestUrl);
  26990. let usingSsl = parsedUrl.protocol === 'https:';
  26991. let proxyConfig = this._httpProxy;
  26992. // fallback to http_proxy and https_proxy env
  26993. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  26994. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  26995. if (!proxyConfig) {
  26996. if (https_proxy && usingSsl) {
  26997. proxyConfig = {
  26998. proxyUrl: https_proxy
  26999. };
  27000. }
  27001. else if (http_proxy) {
  27002. proxyConfig = {
  27003. proxyUrl: http_proxy
  27004. };
  27005. }
  27006. }
  27007. let proxyUrl;
  27008. let proxyAuth;
  27009. if (proxyConfig) {
  27010. if (proxyConfig.proxyUrl.length > 0) {
  27011. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27012. }
  27013. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27014. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27015. }
  27016. }
  27017. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27018. }
  27019. _isBypassProxy(requestUrl) {
  27020. if (!this._httpProxyBypassHosts) {
  27021. return false;
  27022. }
  27023. let bypass = false;
  27024. this._httpProxyBypassHosts.forEach(bypassHost => {
  27025. if (bypassHost.test(requestUrl)) {
  27026. bypass = true;
  27027. }
  27028. });
  27029. return bypass;
  27030. }
  27031. _performExponentialBackoff(retryNumber) {
  27032. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27033. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27034. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27035. }
  27036. }
  27037. exports.HttpClient = HttpClient;
  27038. /***/ }),
  27039. /***/ 881:
  27040. /***/ (function(module) {
  27041. "use strict";
  27042. const isWin = process.platform === 'win32';
  27043. function notFoundError(original, syscall) {
  27044. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27045. code: 'ENOENT',
  27046. errno: 'ENOENT',
  27047. syscall: `${syscall} ${original.command}`,
  27048. path: original.command,
  27049. spawnargs: original.args,
  27050. });
  27051. }
  27052. function hookChildProcess(cp, parsed) {
  27053. if (!isWin) {
  27054. return;
  27055. }
  27056. const originalEmit = cp.emit;
  27057. cp.emit = function (name, arg1) {
  27058. // If emitting "exit" event and exit code is 1, we need to check if
  27059. // the command exists and emit an "error" instead
  27060. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27061. if (name === 'exit') {
  27062. const err = verifyENOENT(arg1, parsed, 'spawn');
  27063. if (err) {
  27064. return originalEmit.call(cp, 'error', err);
  27065. }
  27066. }
  27067. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27068. };
  27069. }
  27070. function verifyENOENT(status, parsed) {
  27071. if (isWin && status === 1 && !parsed.file) {
  27072. return notFoundError(parsed.original, 'spawn');
  27073. }
  27074. return null;
  27075. }
  27076. function verifyENOENTSync(status, parsed) {
  27077. if (isWin && status === 1 && !parsed.file) {
  27078. return notFoundError(parsed.original, 'spawnSync');
  27079. }
  27080. return null;
  27081. }
  27082. module.exports = {
  27083. hookChildProcess,
  27084. verifyENOENT,
  27085. verifyENOENTSync,
  27086. notFoundError,
  27087. };
  27088. /***/ }),
  27089. /***/ 883:
  27090. /***/ (function(module) {
  27091. /**
  27092. * lodash (Custom Build) <https://lodash.com/>
  27093. * Build: `lodash modularize exports="npm" -o ./`
  27094. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27095. * Released under MIT license <https://lodash.com/license>
  27096. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27097. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27098. */
  27099. /** Used as the `TypeError` message for "Functions" methods. */
  27100. var FUNC_ERROR_TEXT = 'Expected a function';
  27101. /** Used to stand-in for `undefined` hash values. */
  27102. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27103. /** Used as references for various `Number` constants. */
  27104. var INFINITY = 1 / 0,
  27105. MAX_SAFE_INTEGER = 9007199254740991;
  27106. /** `Object#toString` result references. */
  27107. var funcTag = '[object Function]',
  27108. genTag = '[object GeneratorFunction]',
  27109. symbolTag = '[object Symbol]';
  27110. /** Used to match property names within property paths. */
  27111. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27112. reIsPlainProp = /^\w*$/,
  27113. reLeadingDot = /^\./,
  27114. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27115. /**
  27116. * Used to match `RegExp`
  27117. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27118. */
  27119. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27120. /** Used to match backslashes in property paths. */
  27121. var reEscapeChar = /\\(\\)?/g;
  27122. /** Used to detect host constructors (Safari). */
  27123. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27124. /** Used to detect unsigned integer values. */
  27125. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27126. /** Detect free variable `global` from Node.js. */
  27127. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27128. /** Detect free variable `self`. */
  27129. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27130. /** Used as a reference to the global object. */
  27131. var root = freeGlobal || freeSelf || Function('return this')();
  27132. /**
  27133. * Gets the value at `key` of `object`.
  27134. *
  27135. * @private
  27136. * @param {Object} [object] The object to query.
  27137. * @param {string} key The key of the property to get.
  27138. * @returns {*} Returns the property value.
  27139. */
  27140. function getValue(object, key) {
  27141. return object == null ? undefined : object[key];
  27142. }
  27143. /**
  27144. * Checks if `value` is a host object in IE < 9.
  27145. *
  27146. * @private
  27147. * @param {*} value The value to check.
  27148. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27149. */
  27150. function isHostObject(value) {
  27151. // Many host objects are `Object` objects that can coerce to strings
  27152. // despite having improperly defined `toString` methods.
  27153. var result = false;
  27154. if (value != null && typeof value.toString != 'function') {
  27155. try {
  27156. result = !!(value + '');
  27157. } catch (e) {}
  27158. }
  27159. return result;
  27160. }
  27161. /** Used for built-in method references. */
  27162. var arrayProto = Array.prototype,
  27163. funcProto = Function.prototype,
  27164. objectProto = Object.prototype;
  27165. /** Used to detect overreaching core-js shims. */
  27166. var coreJsData = root['__core-js_shared__'];
  27167. /** Used to detect methods masquerading as native. */
  27168. var maskSrcKey = (function() {
  27169. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27170. return uid ? ('Symbol(src)_1.' + uid) : '';
  27171. }());
  27172. /** Used to resolve the decompiled source of functions. */
  27173. var funcToString = funcProto.toString;
  27174. /** Used to check objects for own properties. */
  27175. var hasOwnProperty = objectProto.hasOwnProperty;
  27176. /**
  27177. * Used to resolve the
  27178. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27179. * of values.
  27180. */
  27181. var objectToString = objectProto.toString;
  27182. /** Used to detect if a method is native. */
  27183. var reIsNative = RegExp('^' +
  27184. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27185. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27186. );
  27187. /** Built-in value references. */
  27188. var Symbol = root.Symbol,
  27189. splice = arrayProto.splice;
  27190. /* Built-in method references that are verified to be native. */
  27191. var Map = getNative(root, 'Map'),
  27192. nativeCreate = getNative(Object, 'create');
  27193. /** Used to convert symbols to primitives and strings. */
  27194. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27195. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27196. /**
  27197. * Creates a hash object.
  27198. *
  27199. * @private
  27200. * @constructor
  27201. * @param {Array} [entries] The key-value pairs to cache.
  27202. */
  27203. function Hash(entries) {
  27204. var index = -1,
  27205. length = entries ? entries.length : 0;
  27206. this.clear();
  27207. while (++index < length) {
  27208. var entry = entries[index];
  27209. this.set(entry[0], entry[1]);
  27210. }
  27211. }
  27212. /**
  27213. * Removes all key-value entries from the hash.
  27214. *
  27215. * @private
  27216. * @name clear
  27217. * @memberOf Hash
  27218. */
  27219. function hashClear() {
  27220. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27221. }
  27222. /**
  27223. * Removes `key` and its value from the hash.
  27224. *
  27225. * @private
  27226. * @name delete
  27227. * @memberOf Hash
  27228. * @param {Object} hash The hash to modify.
  27229. * @param {string} key The key of the value to remove.
  27230. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27231. */
  27232. function hashDelete(key) {
  27233. return this.has(key) && delete this.__data__[key];
  27234. }
  27235. /**
  27236. * Gets the hash value for `key`.
  27237. *
  27238. * @private
  27239. * @name get
  27240. * @memberOf Hash
  27241. * @param {string} key The key of the value to get.
  27242. * @returns {*} Returns the entry value.
  27243. */
  27244. function hashGet(key) {
  27245. var data = this.__data__;
  27246. if (nativeCreate) {
  27247. var result = data[key];
  27248. return result === HASH_UNDEFINED ? undefined : result;
  27249. }
  27250. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27251. }
  27252. /**
  27253. * Checks if a hash value for `key` exists.
  27254. *
  27255. * @private
  27256. * @name has
  27257. * @memberOf Hash
  27258. * @param {string} key The key of the entry to check.
  27259. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27260. */
  27261. function hashHas(key) {
  27262. var data = this.__data__;
  27263. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27264. }
  27265. /**
  27266. * Sets the hash `key` to `value`.
  27267. *
  27268. * @private
  27269. * @name set
  27270. * @memberOf Hash
  27271. * @param {string} key The key of the value to set.
  27272. * @param {*} value The value to set.
  27273. * @returns {Object} Returns the hash instance.
  27274. */
  27275. function hashSet(key, value) {
  27276. var data = this.__data__;
  27277. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27278. return this;
  27279. }
  27280. // Add methods to `Hash`.
  27281. Hash.prototype.clear = hashClear;
  27282. Hash.prototype['delete'] = hashDelete;
  27283. Hash.prototype.get = hashGet;
  27284. Hash.prototype.has = hashHas;
  27285. Hash.prototype.set = hashSet;
  27286. /**
  27287. * Creates an list cache object.
  27288. *
  27289. * @private
  27290. * @constructor
  27291. * @param {Array} [entries] The key-value pairs to cache.
  27292. */
  27293. function ListCache(entries) {
  27294. var index = -1,
  27295. length = entries ? entries.length : 0;
  27296. this.clear();
  27297. while (++index < length) {
  27298. var entry = entries[index];
  27299. this.set(entry[0], entry[1]);
  27300. }
  27301. }
  27302. /**
  27303. * Removes all key-value entries from the list cache.
  27304. *
  27305. * @private
  27306. * @name clear
  27307. * @memberOf ListCache
  27308. */
  27309. function listCacheClear() {
  27310. this.__data__ = [];
  27311. }
  27312. /**
  27313. * Removes `key` and its value from the list cache.
  27314. *
  27315. * @private
  27316. * @name delete
  27317. * @memberOf ListCache
  27318. * @param {string} key The key of the value to remove.
  27319. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27320. */
  27321. function listCacheDelete(key) {
  27322. var data = this.__data__,
  27323. index = assocIndexOf(data, key);
  27324. if (index < 0) {
  27325. return false;
  27326. }
  27327. var lastIndex = data.length - 1;
  27328. if (index == lastIndex) {
  27329. data.pop();
  27330. } else {
  27331. splice.call(data, index, 1);
  27332. }
  27333. return true;
  27334. }
  27335. /**
  27336. * Gets the list cache value for `key`.
  27337. *
  27338. * @private
  27339. * @name get
  27340. * @memberOf ListCache
  27341. * @param {string} key The key of the value to get.
  27342. * @returns {*} Returns the entry value.
  27343. */
  27344. function listCacheGet(key) {
  27345. var data = this.__data__,
  27346. index = assocIndexOf(data, key);
  27347. return index < 0 ? undefined : data[index][1];
  27348. }
  27349. /**
  27350. * Checks if a list cache value for `key` exists.
  27351. *
  27352. * @private
  27353. * @name has
  27354. * @memberOf ListCache
  27355. * @param {string} key The key of the entry to check.
  27356. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27357. */
  27358. function listCacheHas(key) {
  27359. return assocIndexOf(this.__data__, key) > -1;
  27360. }
  27361. /**
  27362. * Sets the list cache `key` to `value`.
  27363. *
  27364. * @private
  27365. * @name set
  27366. * @memberOf ListCache
  27367. * @param {string} key The key of the value to set.
  27368. * @param {*} value The value to set.
  27369. * @returns {Object} Returns the list cache instance.
  27370. */
  27371. function listCacheSet(key, value) {
  27372. var data = this.__data__,
  27373. index = assocIndexOf(data, key);
  27374. if (index < 0) {
  27375. data.push([key, value]);
  27376. } else {
  27377. data[index][1] = value;
  27378. }
  27379. return this;
  27380. }
  27381. // Add methods to `ListCache`.
  27382. ListCache.prototype.clear = listCacheClear;
  27383. ListCache.prototype['delete'] = listCacheDelete;
  27384. ListCache.prototype.get = listCacheGet;
  27385. ListCache.prototype.has = listCacheHas;
  27386. ListCache.prototype.set = listCacheSet;
  27387. /**
  27388. * Creates a map cache object to store key-value pairs.
  27389. *
  27390. * @private
  27391. * @constructor
  27392. * @param {Array} [entries] The key-value pairs to cache.
  27393. */
  27394. function MapCache(entries) {
  27395. var index = -1,
  27396. length = entries ? entries.length : 0;
  27397. this.clear();
  27398. while (++index < length) {
  27399. var entry = entries[index];
  27400. this.set(entry[0], entry[1]);
  27401. }
  27402. }
  27403. /**
  27404. * Removes all key-value entries from the map.
  27405. *
  27406. * @private
  27407. * @name clear
  27408. * @memberOf MapCache
  27409. */
  27410. function mapCacheClear() {
  27411. this.__data__ = {
  27412. 'hash': new Hash,
  27413. 'map': new (Map || ListCache),
  27414. 'string': new Hash
  27415. };
  27416. }
  27417. /**
  27418. * Removes `key` and its value from the map.
  27419. *
  27420. * @private
  27421. * @name delete
  27422. * @memberOf MapCache
  27423. * @param {string} key The key of the value to remove.
  27424. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27425. */
  27426. function mapCacheDelete(key) {
  27427. return getMapData(this, key)['delete'](key);
  27428. }
  27429. /**
  27430. * Gets the map value for `key`.
  27431. *
  27432. * @private
  27433. * @name get
  27434. * @memberOf MapCache
  27435. * @param {string} key The key of the value to get.
  27436. * @returns {*} Returns the entry value.
  27437. */
  27438. function mapCacheGet(key) {
  27439. return getMapData(this, key).get(key);
  27440. }
  27441. /**
  27442. * Checks if a map value for `key` exists.
  27443. *
  27444. * @private
  27445. * @name has
  27446. * @memberOf MapCache
  27447. * @param {string} key The key of the entry to check.
  27448. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27449. */
  27450. function mapCacheHas(key) {
  27451. return getMapData(this, key).has(key);
  27452. }
  27453. /**
  27454. * Sets the map `key` to `value`.
  27455. *
  27456. * @private
  27457. * @name set
  27458. * @memberOf MapCache
  27459. * @param {string} key The key of the value to set.
  27460. * @param {*} value The value to set.
  27461. * @returns {Object} Returns the map cache instance.
  27462. */
  27463. function mapCacheSet(key, value) {
  27464. getMapData(this, key).set(key, value);
  27465. return this;
  27466. }
  27467. // Add methods to `MapCache`.
  27468. MapCache.prototype.clear = mapCacheClear;
  27469. MapCache.prototype['delete'] = mapCacheDelete;
  27470. MapCache.prototype.get = mapCacheGet;
  27471. MapCache.prototype.has = mapCacheHas;
  27472. MapCache.prototype.set = mapCacheSet;
  27473. /**
  27474. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27475. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27476. * for equality comparisons.
  27477. *
  27478. * @private
  27479. * @param {Object} object The object to modify.
  27480. * @param {string} key The key of the property to assign.
  27481. * @param {*} value The value to assign.
  27482. */
  27483. function assignValue(object, key, value) {
  27484. var objValue = object[key];
  27485. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27486. (value === undefined && !(key in object))) {
  27487. object[key] = value;
  27488. }
  27489. }
  27490. /**
  27491. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27492. *
  27493. * @private
  27494. * @param {Array} array The array to inspect.
  27495. * @param {*} key The key to search for.
  27496. * @returns {number} Returns the index of the matched value, else `-1`.
  27497. */
  27498. function assocIndexOf(array, key) {
  27499. var length = array.length;
  27500. while (length--) {
  27501. if (eq(array[length][0], key)) {
  27502. return length;
  27503. }
  27504. }
  27505. return -1;
  27506. }
  27507. /**
  27508. * The base implementation of `_.isNative` without bad shim checks.
  27509. *
  27510. * @private
  27511. * @param {*} value The value to check.
  27512. * @returns {boolean} Returns `true` if `value` is a native function,
  27513. * else `false`.
  27514. */
  27515. function baseIsNative(value) {
  27516. if (!isObject(value) || isMasked(value)) {
  27517. return false;
  27518. }
  27519. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27520. return pattern.test(toSource(value));
  27521. }
  27522. /**
  27523. * The base implementation of `_.set`.
  27524. *
  27525. * @private
  27526. * @param {Object} object The object to modify.
  27527. * @param {Array|string} path The path of the property to set.
  27528. * @param {*} value The value to set.
  27529. * @param {Function} [customizer] The function to customize path creation.
  27530. * @returns {Object} Returns `object`.
  27531. */
  27532. function baseSet(object, path, value, customizer) {
  27533. if (!isObject(object)) {
  27534. return object;
  27535. }
  27536. path = isKey(path, object) ? [path] : castPath(path);
  27537. var index = -1,
  27538. length = path.length,
  27539. lastIndex = length - 1,
  27540. nested = object;
  27541. while (nested != null && ++index < length) {
  27542. var key = toKey(path[index]),
  27543. newValue = value;
  27544. if (index != lastIndex) {
  27545. var objValue = nested[key];
  27546. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27547. if (newValue === undefined) {
  27548. newValue = isObject(objValue)
  27549. ? objValue
  27550. : (isIndex(path[index + 1]) ? [] : {});
  27551. }
  27552. }
  27553. assignValue(nested, key, newValue);
  27554. nested = nested[key];
  27555. }
  27556. return object;
  27557. }
  27558. /**
  27559. * The base implementation of `_.toString` which doesn't convert nullish
  27560. * values to empty strings.
  27561. *
  27562. * @private
  27563. * @param {*} value The value to process.
  27564. * @returns {string} Returns the string.
  27565. */
  27566. function baseToString(value) {
  27567. // Exit early for strings to avoid a performance hit in some environments.
  27568. if (typeof value == 'string') {
  27569. return value;
  27570. }
  27571. if (isSymbol(value)) {
  27572. return symbolToString ? symbolToString.call(value) : '';
  27573. }
  27574. var result = (value + '');
  27575. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27576. }
  27577. /**
  27578. * Casts `value` to a path array if it's not one.
  27579. *
  27580. * @private
  27581. * @param {*} value The value to inspect.
  27582. * @returns {Array} Returns the cast property path array.
  27583. */
  27584. function castPath(value) {
  27585. return isArray(value) ? value : stringToPath(value);
  27586. }
  27587. /**
  27588. * Gets the data for `map`.
  27589. *
  27590. * @private
  27591. * @param {Object} map The map to query.
  27592. * @param {string} key The reference key.
  27593. * @returns {*} Returns the map data.
  27594. */
  27595. function getMapData(map, key) {
  27596. var data = map.__data__;
  27597. return isKeyable(key)
  27598. ? data[typeof key == 'string' ? 'string' : 'hash']
  27599. : data.map;
  27600. }
  27601. /**
  27602. * Gets the native function at `key` of `object`.
  27603. *
  27604. * @private
  27605. * @param {Object} object The object to query.
  27606. * @param {string} key The key of the method to get.
  27607. * @returns {*} Returns the function if it's native, else `undefined`.
  27608. */
  27609. function getNative(object, key) {
  27610. var value = getValue(object, key);
  27611. return baseIsNative(value) ? value : undefined;
  27612. }
  27613. /**
  27614. * Checks if `value` is a valid array-like index.
  27615. *
  27616. * @private
  27617. * @param {*} value The value to check.
  27618. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27619. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27620. */
  27621. function isIndex(value, length) {
  27622. length = length == null ? MAX_SAFE_INTEGER : length;
  27623. return !!length &&
  27624. (typeof value == 'number' || reIsUint.test(value)) &&
  27625. (value > -1 && value % 1 == 0 && value < length);
  27626. }
  27627. /**
  27628. * Checks if `value` is a property name and not a property path.
  27629. *
  27630. * @private
  27631. * @param {*} value The value to check.
  27632. * @param {Object} [object] The object to query keys on.
  27633. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27634. */
  27635. function isKey(value, object) {
  27636. if (isArray(value)) {
  27637. return false;
  27638. }
  27639. var type = typeof value;
  27640. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27641. value == null || isSymbol(value)) {
  27642. return true;
  27643. }
  27644. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27645. (object != null && value in Object(object));
  27646. }
  27647. /**
  27648. * Checks if `value` is suitable for use as unique object key.
  27649. *
  27650. * @private
  27651. * @param {*} value The value to check.
  27652. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27653. */
  27654. function isKeyable(value) {
  27655. var type = typeof value;
  27656. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27657. ? (value !== '__proto__')
  27658. : (value === null);
  27659. }
  27660. /**
  27661. * Checks if `func` has its source masked.
  27662. *
  27663. * @private
  27664. * @param {Function} func The function to check.
  27665. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27666. */
  27667. function isMasked(func) {
  27668. return !!maskSrcKey && (maskSrcKey in func);
  27669. }
  27670. /**
  27671. * Converts `string` to a property path array.
  27672. *
  27673. * @private
  27674. * @param {string} string The string to convert.
  27675. * @returns {Array} Returns the property path array.
  27676. */
  27677. var stringToPath = memoize(function(string) {
  27678. string = toString(string);
  27679. var result = [];
  27680. if (reLeadingDot.test(string)) {
  27681. result.push('');
  27682. }
  27683. string.replace(rePropName, function(match, number, quote, string) {
  27684. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27685. });
  27686. return result;
  27687. });
  27688. /**
  27689. * Converts `value` to a string key if it's not a string or symbol.
  27690. *
  27691. * @private
  27692. * @param {*} value The value to inspect.
  27693. * @returns {string|symbol} Returns the key.
  27694. */
  27695. function toKey(value) {
  27696. if (typeof value == 'string' || isSymbol(value)) {
  27697. return value;
  27698. }
  27699. var result = (value + '');
  27700. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27701. }
  27702. /**
  27703. * Converts `func` to its source code.
  27704. *
  27705. * @private
  27706. * @param {Function} func The function to process.
  27707. * @returns {string} Returns the source code.
  27708. */
  27709. function toSource(func) {
  27710. if (func != null) {
  27711. try {
  27712. return funcToString.call(func);
  27713. } catch (e) {}
  27714. try {
  27715. return (func + '');
  27716. } catch (e) {}
  27717. }
  27718. return '';
  27719. }
  27720. /**
  27721. * Creates a function that memoizes the result of `func`. If `resolver` is
  27722. * provided, it determines the cache key for storing the result based on the
  27723. * arguments provided to the memoized function. By default, the first argument
  27724. * provided to the memoized function is used as the map cache key. The `func`
  27725. * is invoked with the `this` binding of the memoized function.
  27726. *
  27727. * **Note:** The cache is exposed as the `cache` property on the memoized
  27728. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27729. * constructor with one whose instances implement the
  27730. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27731. * method interface of `delete`, `get`, `has`, and `set`.
  27732. *
  27733. * @static
  27734. * @memberOf _
  27735. * @since 0.1.0
  27736. * @category Function
  27737. * @param {Function} func The function to have its output memoized.
  27738. * @param {Function} [resolver] The function to resolve the cache key.
  27739. * @returns {Function} Returns the new memoized function.
  27740. * @example
  27741. *
  27742. * var object = { 'a': 1, 'b': 2 };
  27743. * var other = { 'c': 3, 'd': 4 };
  27744. *
  27745. * var values = _.memoize(_.values);
  27746. * values(object);
  27747. * // => [1, 2]
  27748. *
  27749. * values(other);
  27750. * // => [3, 4]
  27751. *
  27752. * object.a = 2;
  27753. * values(object);
  27754. * // => [1, 2]
  27755. *
  27756. * // Modify the result cache.
  27757. * values.cache.set(object, ['a', 'b']);
  27758. * values(object);
  27759. * // => ['a', 'b']
  27760. *
  27761. * // Replace `_.memoize.Cache`.
  27762. * _.memoize.Cache = WeakMap;
  27763. */
  27764. function memoize(func, resolver) {
  27765. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  27766. throw new TypeError(FUNC_ERROR_TEXT);
  27767. }
  27768. var memoized = function() {
  27769. var args = arguments,
  27770. key = resolver ? resolver.apply(this, args) : args[0],
  27771. cache = memoized.cache;
  27772. if (cache.has(key)) {
  27773. return cache.get(key);
  27774. }
  27775. var result = func.apply(this, args);
  27776. memoized.cache = cache.set(key, result);
  27777. return result;
  27778. };
  27779. memoized.cache = new (memoize.Cache || MapCache);
  27780. return memoized;
  27781. }
  27782. // Assign cache to `_.memoize`.
  27783. memoize.Cache = MapCache;
  27784. /**
  27785. * Performs a
  27786. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27787. * comparison between two values to determine if they are equivalent.
  27788. *
  27789. * @static
  27790. * @memberOf _
  27791. * @since 4.0.0
  27792. * @category Lang
  27793. * @param {*} value The value to compare.
  27794. * @param {*} other The other value to compare.
  27795. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  27796. * @example
  27797. *
  27798. * var object = { 'a': 1 };
  27799. * var other = { 'a': 1 };
  27800. *
  27801. * _.eq(object, object);
  27802. * // => true
  27803. *
  27804. * _.eq(object, other);
  27805. * // => false
  27806. *
  27807. * _.eq('a', 'a');
  27808. * // => true
  27809. *
  27810. * _.eq('a', Object('a'));
  27811. * // => false
  27812. *
  27813. * _.eq(NaN, NaN);
  27814. * // => true
  27815. */
  27816. function eq(value, other) {
  27817. return value === other || (value !== value && other !== other);
  27818. }
  27819. /**
  27820. * Checks if `value` is classified as an `Array` object.
  27821. *
  27822. * @static
  27823. * @memberOf _
  27824. * @since 0.1.0
  27825. * @category Lang
  27826. * @param {*} value The value to check.
  27827. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  27828. * @example
  27829. *
  27830. * _.isArray([1, 2, 3]);
  27831. * // => true
  27832. *
  27833. * _.isArray(document.body.children);
  27834. * // => false
  27835. *
  27836. * _.isArray('abc');
  27837. * // => false
  27838. *
  27839. * _.isArray(_.noop);
  27840. * // => false
  27841. */
  27842. var isArray = Array.isArray;
  27843. /**
  27844. * Checks if `value` is classified as a `Function` object.
  27845. *
  27846. * @static
  27847. * @memberOf _
  27848. * @since 0.1.0
  27849. * @category Lang
  27850. * @param {*} value The value to check.
  27851. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  27852. * @example
  27853. *
  27854. * _.isFunction(_);
  27855. * // => true
  27856. *
  27857. * _.isFunction(/abc/);
  27858. * // => false
  27859. */
  27860. function isFunction(value) {
  27861. // The use of `Object#toString` avoids issues with the `typeof` operator
  27862. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  27863. var tag = isObject(value) ? objectToString.call(value) : '';
  27864. return tag == funcTag || tag == genTag;
  27865. }
  27866. /**
  27867. * Checks if `value` is the
  27868. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  27869. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  27870. *
  27871. * @static
  27872. * @memberOf _
  27873. * @since 0.1.0
  27874. * @category Lang
  27875. * @param {*} value The value to check.
  27876. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  27877. * @example
  27878. *
  27879. * _.isObject({});
  27880. * // => true
  27881. *
  27882. * _.isObject([1, 2, 3]);
  27883. * // => true
  27884. *
  27885. * _.isObject(_.noop);
  27886. * // => true
  27887. *
  27888. * _.isObject(null);
  27889. * // => false
  27890. */
  27891. function isObject(value) {
  27892. var type = typeof value;
  27893. return !!value && (type == 'object' || type == 'function');
  27894. }
  27895. /**
  27896. * Checks if `value` is object-like. A value is object-like if it's not `null`
  27897. * and has a `typeof` result of "object".
  27898. *
  27899. * @static
  27900. * @memberOf _
  27901. * @since 4.0.0
  27902. * @category Lang
  27903. * @param {*} value The value to check.
  27904. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  27905. * @example
  27906. *
  27907. * _.isObjectLike({});
  27908. * // => true
  27909. *
  27910. * _.isObjectLike([1, 2, 3]);
  27911. * // => true
  27912. *
  27913. * _.isObjectLike(_.noop);
  27914. * // => false
  27915. *
  27916. * _.isObjectLike(null);
  27917. * // => false
  27918. */
  27919. function isObjectLike(value) {
  27920. return !!value && typeof value == 'object';
  27921. }
  27922. /**
  27923. * Checks if `value` is classified as a `Symbol` primitive or object.
  27924. *
  27925. * @static
  27926. * @memberOf _
  27927. * @since 4.0.0
  27928. * @category Lang
  27929. * @param {*} value The value to check.
  27930. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  27931. * @example
  27932. *
  27933. * _.isSymbol(Symbol.iterator);
  27934. * // => true
  27935. *
  27936. * _.isSymbol('abc');
  27937. * // => false
  27938. */
  27939. function isSymbol(value) {
  27940. return typeof value == 'symbol' ||
  27941. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  27942. }
  27943. /**
  27944. * Converts `value` to a string. An empty string is returned for `null`
  27945. * and `undefined` values. The sign of `-0` is preserved.
  27946. *
  27947. * @static
  27948. * @memberOf _
  27949. * @since 4.0.0
  27950. * @category Lang
  27951. * @param {*} value The value to process.
  27952. * @returns {string} Returns the string.
  27953. * @example
  27954. *
  27955. * _.toString(null);
  27956. * // => ''
  27957. *
  27958. * _.toString(-0);
  27959. * // => '-0'
  27960. *
  27961. * _.toString([1, 2, 3]);
  27962. * // => '1,2,3'
  27963. */
  27964. function toString(value) {
  27965. return value == null ? '' : baseToString(value);
  27966. }
  27967. /**
  27968. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  27969. * it's created. Arrays are created for missing index properties while objects
  27970. * are created for all other missing properties. Use `_.setWith` to customize
  27971. * `path` creation.
  27972. *
  27973. * **Note:** This method mutates `object`.
  27974. *
  27975. * @static
  27976. * @memberOf _
  27977. * @since 3.7.0
  27978. * @category Object
  27979. * @param {Object} object The object to modify.
  27980. * @param {Array|string} path The path of the property to set.
  27981. * @param {*} value The value to set.
  27982. * @returns {Object} Returns `object`.
  27983. * @example
  27984. *
  27985. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  27986. *
  27987. * _.set(object, 'a[0].b.c', 4);
  27988. * console.log(object.a[0].b.c);
  27989. * // => 4
  27990. *
  27991. * _.set(object, ['x', '0', 'y', 'z'], 5);
  27992. * console.log(object.x[0].y.z);
  27993. * // => 5
  27994. */
  27995. function set(object, path, value) {
  27996. return object == null ? object : baseSet(object, path, value);
  27997. }
  27998. module.exports = set;
  27999. /***/ }),
  28000. /***/ 898:
  28001. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28002. "use strict";
  28003. Object.defineProperty(exports, '__esModule', { value: true });
  28004. var request = __webpack_require__(753);
  28005. var universalUserAgent = __webpack_require__(796);
  28006. const VERSION = "4.3.1";
  28007. class GraphqlError extends Error {
  28008. constructor(request, response) {
  28009. const message = response.data.errors[0].message;
  28010. super(message);
  28011. Object.assign(this, response.data);
  28012. this.name = "GraphqlError";
  28013. this.request = request; // Maintains proper stack trace (only available on V8)
  28014. /* istanbul ignore next */
  28015. if (Error.captureStackTrace) {
  28016. Error.captureStackTrace(this, this.constructor);
  28017. }
  28018. }
  28019. }
  28020. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28021. function graphql(request, query, options) {
  28022. options = typeof query === "string" ? options = Object.assign({
  28023. query
  28024. }, options) : options = query;
  28025. const requestOptions = Object.keys(options).reduce((result, key) => {
  28026. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28027. result[key] = options[key];
  28028. return result;
  28029. }
  28030. if (!result.variables) {
  28031. result.variables = {};
  28032. }
  28033. result.variables[key] = options[key];
  28034. return result;
  28035. }, {});
  28036. return request(requestOptions).then(response => {
  28037. if (response.data.errors) {
  28038. throw new GraphqlError(requestOptions, {
  28039. data: response.data
  28040. });
  28041. }
  28042. return response.data.data;
  28043. });
  28044. }
  28045. function withDefaults(request$1, newDefaults) {
  28046. const newRequest = request$1.defaults(newDefaults);
  28047. const newApi = (query, options) => {
  28048. return graphql(newRequest, query, options);
  28049. };
  28050. return Object.assign(newApi, {
  28051. defaults: withDefaults.bind(null, newRequest),
  28052. endpoint: request.request.endpoint
  28053. });
  28054. }
  28055. const graphql$1 = withDefaults(request.request, {
  28056. headers: {
  28057. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28058. },
  28059. method: "POST",
  28060. url: "/graphql"
  28061. });
  28062. function withCustomRequest(customRequest) {
  28063. return withDefaults(customRequest, {
  28064. method: "POST",
  28065. url: "/graphql"
  28066. });
  28067. }
  28068. exports.graphql = graphql$1;
  28069. exports.withCustomRequest = withCustomRequest;
  28070. //# sourceMappingURL=index.js.map
  28071. /***/ }),
  28072. /***/ 916:
  28073. /***/ (function(__unusedmodule, exports) {
  28074. "use strict";
  28075. Object.defineProperty(exports, '__esModule', { value: true });
  28076. const VERSION = "1.0.0";
  28077. /**
  28078. * @param octokit Octokit instance
  28079. * @param options Options passed to Octokit constructor
  28080. */
  28081. function requestLog(octokit) {
  28082. octokit.hook.wrap("request", (request, options) => {
  28083. octokit.log.debug("request", options);
  28084. const start = Date.now();
  28085. const requestOptions = octokit.request.endpoint.parse(options);
  28086. const path = requestOptions.url.replace(options.baseUrl, "");
  28087. return request(options).then(response => {
  28088. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28089. return response;
  28090. }).catch(error => {
  28091. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28092. throw error;
  28093. });
  28094. });
  28095. }
  28096. requestLog.VERSION = VERSION;
  28097. exports.requestLog = requestLog;
  28098. //# sourceMappingURL=index.js.map
  28099. /***/ }),
  28100. /***/ 929:
  28101. /***/ (function(module, __unusedexports, __webpack_require__) {
  28102. module.exports = hasNextPage
  28103. const deprecate = __webpack_require__(370)
  28104. const getPageLinks = __webpack_require__(577)
  28105. function hasNextPage (link) {
  28106. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28107. return getPageLinks(link).next
  28108. }
  28109. /***/ }),
  28110. /***/ 948:
  28111. /***/ (function(module) {
  28112. "use strict";
  28113. /**
  28114. * Tries to execute a function and discards any error that occurs.
  28115. * @param {Function} fn - Function that might or might not throw an error.
  28116. * @returns {?*} Return-value of the function when no error occurred.
  28117. */
  28118. module.exports = function(fn) {
  28119. try { return fn() } catch (e) {}
  28120. }
  28121. /***/ }),
  28122. /***/ 950:
  28123. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28124. "use strict";
  28125. Object.defineProperty(exports, "__esModule", { value: true });
  28126. const url = __webpack_require__(835);
  28127. function getProxyUrl(reqUrl) {
  28128. let usingSsl = reqUrl.protocol === 'https:';
  28129. let proxyUrl;
  28130. if (checkBypass(reqUrl)) {
  28131. return proxyUrl;
  28132. }
  28133. let proxyVar;
  28134. if (usingSsl) {
  28135. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28136. }
  28137. else {
  28138. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28139. }
  28140. if (proxyVar) {
  28141. proxyUrl = url.parse(proxyVar);
  28142. }
  28143. return proxyUrl;
  28144. }
  28145. exports.getProxyUrl = getProxyUrl;
  28146. function checkBypass(reqUrl) {
  28147. if (!reqUrl.hostname) {
  28148. return false;
  28149. }
  28150. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28151. if (!noProxy) {
  28152. return false;
  28153. }
  28154. // Determine the request port
  28155. let reqPort;
  28156. if (reqUrl.port) {
  28157. reqPort = Number(reqUrl.port);
  28158. }
  28159. else if (reqUrl.protocol === 'http:') {
  28160. reqPort = 80;
  28161. }
  28162. else if (reqUrl.protocol === 'https:') {
  28163. reqPort = 443;
  28164. }
  28165. // Format the request hostname and hostname with port
  28166. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28167. if (typeof reqPort === 'number') {
  28168. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28169. }
  28170. // Compare request host against noproxy
  28171. for (let upperNoProxyItem of noProxy
  28172. .split(',')
  28173. .map(x => x.trim().toUpperCase())
  28174. .filter(x => x)) {
  28175. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28176. return true;
  28177. }
  28178. }
  28179. return false;
  28180. }
  28181. exports.checkBypass = checkBypass;
  28182. /***/ }),
  28183. /***/ 954:
  28184. /***/ (function(module) {
  28185. module.exports = validateAuth;
  28186. function validateAuth(auth) {
  28187. if (typeof auth === "string") {
  28188. return;
  28189. }
  28190. if (typeof auth === "function") {
  28191. return;
  28192. }
  28193. if (auth.username && auth.password) {
  28194. return;
  28195. }
  28196. if (auth.clientId && auth.clientSecret) {
  28197. return;
  28198. }
  28199. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28200. }
  28201. /***/ }),
  28202. /***/ 955:
  28203. /***/ (function(module, __unusedexports, __webpack_require__) {
  28204. "use strict";
  28205. const path = __webpack_require__(622);
  28206. const childProcess = __webpack_require__(129);
  28207. const crossSpawn = __webpack_require__(20);
  28208. const stripEof = __webpack_require__(768);
  28209. const npmRunPath = __webpack_require__(621);
  28210. const isStream = __webpack_require__(323);
  28211. const _getStream = __webpack_require__(145);
  28212. const pFinally = __webpack_require__(697);
  28213. const onExit = __webpack_require__(260);
  28214. const errname = __webpack_require__(427);
  28215. const stdio = __webpack_require__(168);
  28216. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28217. function handleArgs(cmd, args, opts) {
  28218. let parsed;
  28219. opts = Object.assign({
  28220. extendEnv: true,
  28221. env: {}
  28222. }, opts);
  28223. if (opts.extendEnv) {
  28224. opts.env = Object.assign({}, process.env, opts.env);
  28225. }
  28226. if (opts.__winShell === true) {
  28227. delete opts.__winShell;
  28228. parsed = {
  28229. command: cmd,
  28230. args,
  28231. options: opts,
  28232. file: cmd,
  28233. original: {
  28234. cmd,
  28235. args
  28236. }
  28237. };
  28238. } else {
  28239. parsed = crossSpawn._parse(cmd, args, opts);
  28240. }
  28241. opts = Object.assign({
  28242. maxBuffer: TEN_MEGABYTES,
  28243. buffer: true,
  28244. stripEof: true,
  28245. preferLocal: true,
  28246. localDir: parsed.options.cwd || process.cwd(),
  28247. encoding: 'utf8',
  28248. reject: true,
  28249. cleanup: true
  28250. }, parsed.options);
  28251. opts.stdio = stdio(opts);
  28252. if (opts.preferLocal) {
  28253. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28254. }
  28255. if (opts.detached) {
  28256. // #115
  28257. opts.cleanup = false;
  28258. }
  28259. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28260. // #116
  28261. parsed.args.unshift('/q');
  28262. }
  28263. return {
  28264. cmd: parsed.command,
  28265. args: parsed.args,
  28266. opts,
  28267. parsed
  28268. };
  28269. }
  28270. function handleInput(spawned, input) {
  28271. if (input === null || input === undefined) {
  28272. return;
  28273. }
  28274. if (isStream(input)) {
  28275. input.pipe(spawned.stdin);
  28276. } else {
  28277. spawned.stdin.end(input);
  28278. }
  28279. }
  28280. function handleOutput(opts, val) {
  28281. if (val && opts.stripEof) {
  28282. val = stripEof(val);
  28283. }
  28284. return val;
  28285. }
  28286. function handleShell(fn, cmd, opts) {
  28287. let file = '/bin/sh';
  28288. let args = ['-c', cmd];
  28289. opts = Object.assign({}, opts);
  28290. if (process.platform === 'win32') {
  28291. opts.__winShell = true;
  28292. file = process.env.comspec || 'cmd.exe';
  28293. args = ['/s', '/c', `"${cmd}"`];
  28294. opts.windowsVerbatimArguments = true;
  28295. }
  28296. if (opts.shell) {
  28297. file = opts.shell;
  28298. delete opts.shell;
  28299. }
  28300. return fn(file, args, opts);
  28301. }
  28302. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28303. if (!process[stream]) {
  28304. return null;
  28305. }
  28306. let ret;
  28307. if (!buffer) {
  28308. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28309. ret = new Promise((resolve, reject) => {
  28310. process[stream]
  28311. .once('end', resolve)
  28312. .once('error', reject);
  28313. });
  28314. } else if (encoding) {
  28315. ret = _getStream(process[stream], {
  28316. encoding,
  28317. maxBuffer
  28318. });
  28319. } else {
  28320. ret = _getStream.buffer(process[stream], {maxBuffer});
  28321. }
  28322. return ret.catch(err => {
  28323. err.stream = stream;
  28324. err.message = `${stream} ${err.message}`;
  28325. throw err;
  28326. });
  28327. }
  28328. function makeError(result, options) {
  28329. const {stdout, stderr} = result;
  28330. let err = result.error;
  28331. const {code, signal} = result;
  28332. const {parsed, joinedCmd} = options;
  28333. const timedOut = options.timedOut || false;
  28334. if (!err) {
  28335. let output = '';
  28336. if (Array.isArray(parsed.opts.stdio)) {
  28337. if (parsed.opts.stdio[2] !== 'inherit') {
  28338. output += output.length > 0 ? stderr : `\n${stderr}`;
  28339. }
  28340. if (parsed.opts.stdio[1] !== 'inherit') {
  28341. output += `\n${stdout}`;
  28342. }
  28343. } else if (parsed.opts.stdio !== 'inherit') {
  28344. output = `\n${stderr}${stdout}`;
  28345. }
  28346. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28347. err.code = code < 0 ? errname(code) : code;
  28348. }
  28349. err.stdout = stdout;
  28350. err.stderr = stderr;
  28351. err.failed = true;
  28352. err.signal = signal || null;
  28353. err.cmd = joinedCmd;
  28354. err.timedOut = timedOut;
  28355. return err;
  28356. }
  28357. function joinCmd(cmd, args) {
  28358. let joinedCmd = cmd;
  28359. if (Array.isArray(args) && args.length > 0) {
  28360. joinedCmd += ' ' + args.join(' ');
  28361. }
  28362. return joinedCmd;
  28363. }
  28364. module.exports = (cmd, args, opts) => {
  28365. const parsed = handleArgs(cmd, args, opts);
  28366. const {encoding, buffer, maxBuffer} = parsed.opts;
  28367. const joinedCmd = joinCmd(cmd, args);
  28368. let spawned;
  28369. try {
  28370. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28371. } catch (err) {
  28372. return Promise.reject(err);
  28373. }
  28374. let removeExitHandler;
  28375. if (parsed.opts.cleanup) {
  28376. removeExitHandler = onExit(() => {
  28377. spawned.kill();
  28378. });
  28379. }
  28380. let timeoutId = null;
  28381. let timedOut = false;
  28382. const cleanup = () => {
  28383. if (timeoutId) {
  28384. clearTimeout(timeoutId);
  28385. timeoutId = null;
  28386. }
  28387. if (removeExitHandler) {
  28388. removeExitHandler();
  28389. }
  28390. };
  28391. if (parsed.opts.timeout > 0) {
  28392. timeoutId = setTimeout(() => {
  28393. timeoutId = null;
  28394. timedOut = true;
  28395. spawned.kill(parsed.opts.killSignal);
  28396. }, parsed.opts.timeout);
  28397. }
  28398. const processDone = new Promise(resolve => {
  28399. spawned.on('exit', (code, signal) => {
  28400. cleanup();
  28401. resolve({code, signal});
  28402. });
  28403. spawned.on('error', err => {
  28404. cleanup();
  28405. resolve({error: err});
  28406. });
  28407. if (spawned.stdin) {
  28408. spawned.stdin.on('error', err => {
  28409. cleanup();
  28410. resolve({error: err});
  28411. });
  28412. }
  28413. });
  28414. function destroy() {
  28415. if (spawned.stdout) {
  28416. spawned.stdout.destroy();
  28417. }
  28418. if (spawned.stderr) {
  28419. spawned.stderr.destroy();
  28420. }
  28421. }
  28422. const handlePromise = () => pFinally(Promise.all([
  28423. processDone,
  28424. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28425. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28426. ]).then(arr => {
  28427. const result = arr[0];
  28428. result.stdout = arr[1];
  28429. result.stderr = arr[2];
  28430. if (result.error || result.code !== 0 || result.signal !== null) {
  28431. const err = makeError(result, {
  28432. joinedCmd,
  28433. parsed,
  28434. timedOut
  28435. });
  28436. // TODO: missing some timeout logic for killed
  28437. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28438. // err.killed = spawned.killed || killed;
  28439. err.killed = err.killed || spawned.killed;
  28440. if (!parsed.opts.reject) {
  28441. return err;
  28442. }
  28443. throw err;
  28444. }
  28445. return {
  28446. stdout: handleOutput(parsed.opts, result.stdout),
  28447. stderr: handleOutput(parsed.opts, result.stderr),
  28448. code: 0,
  28449. failed: false,
  28450. killed: false,
  28451. signal: null,
  28452. cmd: joinedCmd,
  28453. timedOut: false
  28454. };
  28455. }), destroy);
  28456. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28457. handleInput(spawned, parsed.opts.input);
  28458. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28459. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28460. return spawned;
  28461. };
  28462. // TODO: set `stderr: 'ignore'` when that option is implemented
  28463. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28464. // TODO: set `stdout: 'ignore'` when that option is implemented
  28465. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28466. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28467. module.exports.sync = (cmd, args, opts) => {
  28468. const parsed = handleArgs(cmd, args, opts);
  28469. const joinedCmd = joinCmd(cmd, args);
  28470. if (isStream(parsed.opts.input)) {
  28471. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28472. }
  28473. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28474. result.code = result.status;
  28475. if (result.error || result.status !== 0 || result.signal !== null) {
  28476. const err = makeError(result, {
  28477. joinedCmd,
  28478. parsed
  28479. });
  28480. if (!parsed.opts.reject) {
  28481. return err;
  28482. }
  28483. throw err;
  28484. }
  28485. return {
  28486. stdout: handleOutput(parsed.opts, result.stdout),
  28487. stderr: handleOutput(parsed.opts, result.stderr),
  28488. code: 0,
  28489. failed: false,
  28490. signal: null,
  28491. cmd: joinedCmd,
  28492. timedOut: false
  28493. };
  28494. };
  28495. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28496. /***/ }),
  28497. /***/ 966:
  28498. /***/ (function(module, __unusedexports, __webpack_require__) {
  28499. "use strict";
  28500. const {PassThrough} = __webpack_require__(413);
  28501. module.exports = options => {
  28502. options = Object.assign({}, options);
  28503. const {array} = options;
  28504. let {encoding} = options;
  28505. const buffer = encoding === 'buffer';
  28506. let objectMode = false;
  28507. if (array) {
  28508. objectMode = !(encoding || buffer);
  28509. } else {
  28510. encoding = encoding || 'utf8';
  28511. }
  28512. if (buffer) {
  28513. encoding = null;
  28514. }
  28515. let len = 0;
  28516. const ret = [];
  28517. const stream = new PassThrough({objectMode});
  28518. if (encoding) {
  28519. stream.setEncoding(encoding);
  28520. }
  28521. stream.on('data', chunk => {
  28522. ret.push(chunk);
  28523. if (objectMode) {
  28524. len = ret.length;
  28525. } else {
  28526. len += chunk.length;
  28527. }
  28528. });
  28529. stream.getBufferedValue = () => {
  28530. if (array) {
  28531. return ret;
  28532. }
  28533. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28534. };
  28535. stream.getBufferedLength = () => len;
  28536. return stream;
  28537. };
  28538. /***/ }),
  28539. /***/ 969:
  28540. /***/ (function(module, __unusedexports, __webpack_require__) {
  28541. var wrappy = __webpack_require__(11)
  28542. module.exports = wrappy(once)
  28543. module.exports.strict = wrappy(onceStrict)
  28544. once.proto = once(function () {
  28545. Object.defineProperty(Function.prototype, 'once', {
  28546. value: function () {
  28547. return once(this)
  28548. },
  28549. configurable: true
  28550. })
  28551. Object.defineProperty(Function.prototype, 'onceStrict', {
  28552. value: function () {
  28553. return onceStrict(this)
  28554. },
  28555. configurable: true
  28556. })
  28557. })
  28558. function once (fn) {
  28559. var f = function () {
  28560. if (f.called) return f.value
  28561. f.called = true
  28562. return f.value = fn.apply(this, arguments)
  28563. }
  28564. f.called = false
  28565. return f
  28566. }
  28567. function onceStrict (fn) {
  28568. var f = function () {
  28569. if (f.called)
  28570. throw new Error(f.onceError)
  28571. f.called = true
  28572. return f.value = fn.apply(this, arguments)
  28573. }
  28574. var name = fn.name || 'Function wrapped with `once`'
  28575. f.onceError = name + " shouldn't be called more than once"
  28576. f.called = false
  28577. return f
  28578. }
  28579. /***/ }),
  28580. /***/ 986:
  28581. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28582. "use strict";
  28583. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28584. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28585. return new (P || (P = Promise))(function (resolve, reject) {
  28586. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28587. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28588. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28589. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28590. });
  28591. };
  28592. Object.defineProperty(exports, "__esModule", { value: true });
  28593. const tr = __webpack_require__(9);
  28594. /**
  28595. * Exec a command.
  28596. * Output will be streamed to the live console.
  28597. * Returns promise with return code
  28598. *
  28599. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28600. * @param args optional arguments for tool. Escaping is handled by the lib.
  28601. * @param options optional exec options. See ExecOptions
  28602. * @returns Promise<number> exit code
  28603. */
  28604. function exec(commandLine, args, options) {
  28605. return __awaiter(this, void 0, void 0, function* () {
  28606. const commandArgs = tr.argStringToArray(commandLine);
  28607. if (commandArgs.length === 0) {
  28608. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28609. }
  28610. // Path to tool to execute should be first arg
  28611. const toolPath = commandArgs[0];
  28612. args = commandArgs.slice(1).concat(args || []);
  28613. const runner = new tr.ToolRunner(toolPath, args, options);
  28614. return runner.exec();
  28615. });
  28616. }
  28617. exports.exec = exec;
  28618. //# sourceMappingURL=exec.js.map
  28619. /***/ }),
  28620. /***/ 991:
  28621. /***/ (function(module, __unusedexports, __webpack_require__) {
  28622. module.exports = authenticationRequestError;
  28623. const { RequestError } = __webpack_require__(497);
  28624. function authenticationRequestError(state, error, options) {
  28625. if (!error.headers) throw error;
  28626. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28627. // handle "2FA required" error only
  28628. if (error.status !== 401 || !otpRequired) {
  28629. throw error;
  28630. }
  28631. if (
  28632. error.status === 401 &&
  28633. otpRequired &&
  28634. error.request &&
  28635. error.request.headers["x-github-otp"]
  28636. ) {
  28637. if (state.otp) {
  28638. delete state.otp; // no longer valid, request again
  28639. } else {
  28640. throw new RequestError(
  28641. "Invalid one-time password for two-factor authentication",
  28642. 401,
  28643. {
  28644. headers: error.headers,
  28645. request: options
  28646. }
  28647. );
  28648. }
  28649. }
  28650. if (typeof state.auth.on2fa !== "function") {
  28651. throw new RequestError(
  28652. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28653. 401,
  28654. {
  28655. headers: error.headers,
  28656. request: options
  28657. }
  28658. );
  28659. }
  28660. return Promise.resolve()
  28661. .then(() => {
  28662. return state.auth.on2fa();
  28663. })
  28664. .then(oneTimePassword => {
  28665. const newOptions = Object.assign(options, {
  28666. headers: Object.assign(options.headers, {
  28667. "x-github-otp": oneTimePassword
  28668. })
  28669. });
  28670. return state.octokit.request(newOptions).then(response => {
  28671. // If OTP still valid, then persist it for following requests
  28672. state.otp = oneTimePassword;
  28673. return response;
  28674. });
  28675. });
  28676. }
  28677. /***/ })
  28678. /******/ });