index.js 807 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const { requestLog } = __webpack_require__(916);
  48. const {
  49. restEndpointMethods
  50. } = __webpack_require__(842);
  51. const Core = __webpack_require__(529);
  52. const CORE_PLUGINS = [
  53. __webpack_require__(190),
  54. __webpack_require__(19), // deprecated: remove in v17
  55. requestLog,
  56. __webpack_require__(148),
  57. restEndpointMethods,
  58. __webpack_require__(430),
  59. __webpack_require__(850) // deprecated: remove in v17
  60. ];
  61. const OctokitRest = Core.plugin(CORE_PLUGINS);
  62. function DeprecatedOctokit(options) {
  63. const warn =
  64. options && options.log && options.log.warn
  65. ? options.log.warn
  66. : console.warn;
  67. warn(
  68. '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
  69. );
  70. return new OctokitRest(options);
  71. }
  72. const Octokit = Object.assign(DeprecatedOctokit, {
  73. Octokit: OctokitRest
  74. });
  75. Object.keys(OctokitRest).forEach(key => {
  76. /* istanbul ignore else */
  77. if (OctokitRest.hasOwnProperty(key)) {
  78. Octokit[key] = OctokitRest[key];
  79. }
  80. });
  81. module.exports = Octokit;
  82. /***/ }),
  83. /***/ 1:
  84. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  85. "use strict";
  86. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  87. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  88. return new (P || (P = Promise))(function (resolve, reject) {
  89. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  90. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  91. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  92. step((generator = generator.apply(thisArg, _arguments || [])).next());
  93. });
  94. };
  95. Object.defineProperty(exports, "__esModule", { value: true });
  96. const childProcess = __webpack_require__(129);
  97. const path = __webpack_require__(622);
  98. const util_1 = __webpack_require__(669);
  99. const ioUtil = __webpack_require__(672);
  100. const exec = util_1.promisify(childProcess.exec);
  101. /**
  102. * Copies a file or folder.
  103. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  104. *
  105. * @param source source path
  106. * @param dest destination path
  107. * @param options optional. See CopyOptions.
  108. */
  109. function cp(source, dest, options = {}) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const { force, recursive } = readCopyOptions(options);
  112. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  113. // Dest is an existing file, but not forcing
  114. if (destStat && destStat.isFile() && !force) {
  115. return;
  116. }
  117. // If dest is an existing directory, should copy inside.
  118. const newDest = destStat && destStat.isDirectory()
  119. ? path.join(dest, path.basename(source))
  120. : dest;
  121. if (!(yield ioUtil.exists(source))) {
  122. throw new Error(`no such file or directory: ${source}`);
  123. }
  124. const sourceStat = yield ioUtil.stat(source);
  125. if (sourceStat.isDirectory()) {
  126. if (!recursive) {
  127. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  128. }
  129. else {
  130. yield cpDirRecursive(source, newDest, 0, force);
  131. }
  132. }
  133. else {
  134. if (path.relative(source, newDest) === '') {
  135. // a file cannot be copied to itself
  136. throw new Error(`'${newDest}' and '${source}' are the same file`);
  137. }
  138. yield copyFile(source, newDest, force);
  139. }
  140. });
  141. }
  142. exports.cp = cp;
  143. /**
  144. * Moves a path.
  145. *
  146. * @param source source path
  147. * @param dest destination path
  148. * @param options optional. See MoveOptions.
  149. */
  150. function mv(source, dest, options = {}) {
  151. return __awaiter(this, void 0, void 0, function* () {
  152. if (yield ioUtil.exists(dest)) {
  153. let destExists = true;
  154. if (yield ioUtil.isDirectory(dest)) {
  155. // If dest is directory copy src into dest
  156. dest = path.join(dest, path.basename(source));
  157. destExists = yield ioUtil.exists(dest);
  158. }
  159. if (destExists) {
  160. if (options.force == null || options.force) {
  161. yield rmRF(dest);
  162. }
  163. else {
  164. throw new Error('Destination already exists');
  165. }
  166. }
  167. }
  168. yield mkdirP(path.dirname(dest));
  169. yield ioUtil.rename(source, dest);
  170. });
  171. }
  172. exports.mv = mv;
  173. /**
  174. * Remove a path recursively with force
  175. *
  176. * @param inputPath path to remove
  177. */
  178. function rmRF(inputPath) {
  179. return __awaiter(this, void 0, void 0, function* () {
  180. if (ioUtil.IS_WINDOWS) {
  181. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  182. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  183. try {
  184. if (yield ioUtil.isDirectory(inputPath, true)) {
  185. yield exec(`rd /s /q "${inputPath}"`);
  186. }
  187. else {
  188. yield exec(`del /f /a "${inputPath}"`);
  189. }
  190. }
  191. catch (err) {
  192. // if you try to delete a file that doesn't exist, desired result is achieved
  193. // other errors are valid
  194. if (err.code !== 'ENOENT')
  195. throw err;
  196. }
  197. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  198. try {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. catch (err) {
  202. // if you try to delete a file that doesn't exist, desired result is achieved
  203. // other errors are valid
  204. if (err.code !== 'ENOENT')
  205. throw err;
  206. }
  207. }
  208. else {
  209. let isDir = false;
  210. try {
  211. isDir = yield ioUtil.isDirectory(inputPath);
  212. }
  213. catch (err) {
  214. // if you try to delete a file that doesn't exist, desired result is achieved
  215. // other errors are valid
  216. if (err.code !== 'ENOENT')
  217. throw err;
  218. return;
  219. }
  220. if (isDir) {
  221. yield exec(`rm -rf "${inputPath}"`);
  222. }
  223. else {
  224. yield ioUtil.unlink(inputPath);
  225. }
  226. }
  227. });
  228. }
  229. exports.rmRF = rmRF;
  230. /**
  231. * Make a directory. Creates the full path with folders in between
  232. * Will throw if it fails
  233. *
  234. * @param fsPath path to create
  235. * @returns Promise<void>
  236. */
  237. function mkdirP(fsPath) {
  238. return __awaiter(this, void 0, void 0, function* () {
  239. yield ioUtil.mkdirP(fsPath);
  240. });
  241. }
  242. exports.mkdirP = mkdirP;
  243. /**
  244. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  245. * If you check and the tool does not exist, it will throw.
  246. *
  247. * @param tool name of the tool
  248. * @param check whether to check if tool exists
  249. * @returns Promise<string> path to tool
  250. */
  251. function which(tool, check) {
  252. return __awaiter(this, void 0, void 0, function* () {
  253. if (!tool) {
  254. throw new Error("parameter 'tool' is required");
  255. }
  256. // recursive when check=true
  257. if (check) {
  258. const result = yield which(tool, false);
  259. if (!result) {
  260. if (ioUtil.IS_WINDOWS) {
  261. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  262. }
  263. else {
  264. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  265. }
  266. }
  267. }
  268. try {
  269. // build the list of extensions to try
  270. const extensions = [];
  271. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  272. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  273. if (extension) {
  274. extensions.push(extension);
  275. }
  276. }
  277. }
  278. // if it's rooted, return it if exists. otherwise return empty.
  279. if (ioUtil.isRooted(tool)) {
  280. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  281. if (filePath) {
  282. return filePath;
  283. }
  284. return '';
  285. }
  286. // if any path separators, return empty
  287. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  288. return '';
  289. }
  290. // build the list of directories
  291. //
  292. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  293. // it feels like we should not do this. Checking the current directory seems like more of a use
  294. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  295. // across platforms.
  296. const directories = [];
  297. if (process.env.PATH) {
  298. for (const p of process.env.PATH.split(path.delimiter)) {
  299. if (p) {
  300. directories.push(p);
  301. }
  302. }
  303. }
  304. // return the first match
  305. for (const directory of directories) {
  306. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  307. if (filePath) {
  308. return filePath;
  309. }
  310. }
  311. return '';
  312. }
  313. catch (err) {
  314. throw new Error(`which failed with message ${err.message}`);
  315. }
  316. });
  317. }
  318. exports.which = which;
  319. function readCopyOptions(options) {
  320. const force = options.force == null ? true : options.force;
  321. const recursive = Boolean(options.recursive);
  322. return { force, recursive };
  323. }
  324. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. // Ensure there is not a run away recursive copy
  327. if (currentDepth >= 255)
  328. return;
  329. currentDepth++;
  330. yield mkdirP(destDir);
  331. const files = yield ioUtil.readdir(sourceDir);
  332. for (const fileName of files) {
  333. const srcFile = `${sourceDir}/${fileName}`;
  334. const destFile = `${destDir}/${fileName}`;
  335. const srcFileStat = yield ioUtil.lstat(srcFile);
  336. if (srcFileStat.isDirectory()) {
  337. // Recurse
  338. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  339. }
  340. else {
  341. yield copyFile(srcFile, destFile, force);
  342. }
  343. }
  344. // Change the mode for the newly created directory
  345. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  346. });
  347. }
  348. // Buffered file copy
  349. function copyFile(srcFile, destFile, force) {
  350. return __awaiter(this, void 0, void 0, function* () {
  351. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  352. // unlink/re-link it
  353. try {
  354. yield ioUtil.lstat(destFile);
  355. yield ioUtil.unlink(destFile);
  356. }
  357. catch (e) {
  358. // Try to override file permission
  359. if (e.code === 'EPERM') {
  360. yield ioUtil.chmod(destFile, '0666');
  361. yield ioUtil.unlink(destFile);
  362. }
  363. // other errors = it doesn't exist, no work to do
  364. }
  365. // Copy over symlink
  366. const symlinkFull = yield ioUtil.readlink(srcFile);
  367. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  368. }
  369. else if (!(yield ioUtil.exists(destFile)) || force) {
  370. yield ioUtil.copyFile(srcFile, destFile);
  371. }
  372. });
  373. }
  374. //# sourceMappingURL=io.js.map
  375. /***/ }),
  376. /***/ 2:
  377. /***/ (function(module, __unusedexports, __webpack_require__) {
  378. "use strict";
  379. const os = __webpack_require__(87);
  380. const macosRelease = __webpack_require__(118);
  381. const winRelease = __webpack_require__(49);
  382. const osName = (platform, release) => {
  383. if (!platform && release) {
  384. throw new Error('You can\'t specify a `release` without specifying `platform`');
  385. }
  386. platform = platform || os.platform();
  387. let id;
  388. if (platform === 'darwin') {
  389. if (!release && os.platform() === 'darwin') {
  390. release = os.release();
  391. }
  392. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  393. id = release ? macosRelease(release).name : '';
  394. return prefix + (id ? ' ' + id : '');
  395. }
  396. if (platform === 'linux') {
  397. if (!release && os.platform() === 'linux') {
  398. release = os.release();
  399. }
  400. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  401. return 'Linux' + (id ? ' ' + id : '');
  402. }
  403. if (platform === 'win32') {
  404. if (!release && os.platform() === 'win32') {
  405. release = os.release();
  406. }
  407. id = release ? winRelease(release) : '';
  408. return 'Windows' + (id ? ' ' + id : '');
  409. }
  410. return platform;
  411. };
  412. module.exports = osName;
  413. /***/ }),
  414. /***/ 3:
  415. /***/ (function(module, __unusedexports, __webpack_require__) {
  416. var once = __webpack_require__(969);
  417. var noop = function() {};
  418. var isRequest = function(stream) {
  419. return stream.setHeader && typeof stream.abort === 'function';
  420. };
  421. var isChildProcess = function(stream) {
  422. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  423. };
  424. var eos = function(stream, opts, callback) {
  425. if (typeof opts === 'function') return eos(stream, null, opts);
  426. if (!opts) opts = {};
  427. callback = once(callback || noop);
  428. var ws = stream._writableState;
  429. var rs = stream._readableState;
  430. var readable = opts.readable || (opts.readable !== false && stream.readable);
  431. var writable = opts.writable || (opts.writable !== false && stream.writable);
  432. var cancelled = false;
  433. var onlegacyfinish = function() {
  434. if (!stream.writable) onfinish();
  435. };
  436. var onfinish = function() {
  437. writable = false;
  438. if (!readable) callback.call(stream);
  439. };
  440. var onend = function() {
  441. readable = false;
  442. if (!writable) callback.call(stream);
  443. };
  444. var onexit = function(exitCode) {
  445. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  446. };
  447. var onerror = function(err) {
  448. callback.call(stream, err);
  449. };
  450. var onclose = function() {
  451. process.nextTick(onclosenexttick);
  452. };
  453. var onclosenexttick = function() {
  454. if (cancelled) return;
  455. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  456. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  457. };
  458. var onrequest = function() {
  459. stream.req.on('finish', onfinish);
  460. };
  461. if (isRequest(stream)) {
  462. stream.on('complete', onfinish);
  463. stream.on('abort', onclose);
  464. if (stream.req) onrequest();
  465. else stream.on('request', onrequest);
  466. } else if (writable && !ws) { // legacy streams
  467. stream.on('end', onlegacyfinish);
  468. stream.on('close', onlegacyfinish);
  469. }
  470. if (isChildProcess(stream)) stream.on('exit', onexit);
  471. stream.on('end', onend);
  472. stream.on('finish', onfinish);
  473. if (opts.error !== false) stream.on('error', onerror);
  474. stream.on('close', onclose);
  475. return function() {
  476. cancelled = true;
  477. stream.removeListener('complete', onfinish);
  478. stream.removeListener('abort', onclose);
  479. stream.removeListener('request', onrequest);
  480. if (stream.req) stream.req.removeListener('finish', onfinish);
  481. stream.removeListener('end', onlegacyfinish);
  482. stream.removeListener('close', onlegacyfinish);
  483. stream.removeListener('finish', onfinish);
  484. stream.removeListener('exit', onexit);
  485. stream.removeListener('end', onend);
  486. stream.removeListener('error', onerror);
  487. stream.removeListener('close', onclose);
  488. };
  489. };
  490. module.exports = eos;
  491. /***/ }),
  492. /***/ 9:
  493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  494. "use strict";
  495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  497. return new (P || (P = Promise))(function (resolve, reject) {
  498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  502. });
  503. };
  504. Object.defineProperty(exports, "__esModule", { value: true });
  505. const os = __webpack_require__(87);
  506. const events = __webpack_require__(614);
  507. const child = __webpack_require__(129);
  508. /* eslint-disable @typescript-eslint/unbound-method */
  509. const IS_WINDOWS = process.platform === 'win32';
  510. /*
  511. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  512. */
  513. class ToolRunner extends events.EventEmitter {
  514. constructor(toolPath, args, options) {
  515. super();
  516. if (!toolPath) {
  517. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  518. }
  519. this.toolPath = toolPath;
  520. this.args = args || [];
  521. this.options = options || {};
  522. }
  523. _debug(message) {
  524. if (this.options.listeners && this.options.listeners.debug) {
  525. this.options.listeners.debug(message);
  526. }
  527. }
  528. _getCommandString(options, noPrefix) {
  529. const toolPath = this._getSpawnFileName();
  530. const args = this._getSpawnArgs(options);
  531. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  532. if (IS_WINDOWS) {
  533. // Windows + cmd file
  534. if (this._isCmdFile()) {
  535. cmd += toolPath;
  536. for (const a of args) {
  537. cmd += ` ${a}`;
  538. }
  539. }
  540. // Windows + verbatim
  541. else if (options.windowsVerbatimArguments) {
  542. cmd += `"${toolPath}"`;
  543. for (const a of args) {
  544. cmd += ` ${a}`;
  545. }
  546. }
  547. // Windows (regular)
  548. else {
  549. cmd += this._windowsQuoteCmdArg(toolPath);
  550. for (const a of args) {
  551. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  552. }
  553. }
  554. }
  555. else {
  556. // OSX/Linux - this can likely be improved with some form of quoting.
  557. // creating processes on Unix is fundamentally different than Windows.
  558. // on Unix, execvp() takes an arg array.
  559. cmd += toolPath;
  560. for (const a of args) {
  561. cmd += ` ${a}`;
  562. }
  563. }
  564. return cmd;
  565. }
  566. _processLineBuffer(data, strBuffer, onLine) {
  567. try {
  568. let s = strBuffer + data.toString();
  569. let n = s.indexOf(os.EOL);
  570. while (n > -1) {
  571. const line = s.substring(0, n);
  572. onLine(line);
  573. // the rest of the string ...
  574. s = s.substring(n + os.EOL.length);
  575. n = s.indexOf(os.EOL);
  576. }
  577. strBuffer = s;
  578. }
  579. catch (err) {
  580. // streaming lines to console is best effort. Don't fail a build.
  581. this._debug(`error processing line. Failed with error ${err}`);
  582. }
  583. }
  584. _getSpawnFileName() {
  585. if (IS_WINDOWS) {
  586. if (this._isCmdFile()) {
  587. return process.env['COMSPEC'] || 'cmd.exe';
  588. }
  589. }
  590. return this.toolPath;
  591. }
  592. _getSpawnArgs(options) {
  593. if (IS_WINDOWS) {
  594. if (this._isCmdFile()) {
  595. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  596. for (const a of this.args) {
  597. argline += ' ';
  598. argline += options.windowsVerbatimArguments
  599. ? a
  600. : this._windowsQuoteCmdArg(a);
  601. }
  602. argline += '"';
  603. return [argline];
  604. }
  605. }
  606. return this.args;
  607. }
  608. _endsWith(str, end) {
  609. return str.endsWith(end);
  610. }
  611. _isCmdFile() {
  612. const upperToolPath = this.toolPath.toUpperCase();
  613. return (this._endsWith(upperToolPath, '.CMD') ||
  614. this._endsWith(upperToolPath, '.BAT'));
  615. }
  616. _windowsQuoteCmdArg(arg) {
  617. // for .exe, apply the normal quoting rules that libuv applies
  618. if (!this._isCmdFile()) {
  619. return this._uvQuoteCmdArg(arg);
  620. }
  621. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  622. // the libuv rules are generic and are not designed specifically for cmd.exe
  623. // command line parser.
  624. //
  625. // for a detailed description of the cmd.exe command line parser, refer to
  626. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  627. // need quotes for empty arg
  628. if (!arg) {
  629. return '""';
  630. }
  631. // determine whether the arg needs to be quoted
  632. const cmdSpecialChars = [
  633. ' ',
  634. '\t',
  635. '&',
  636. '(',
  637. ')',
  638. '[',
  639. ']',
  640. '{',
  641. '}',
  642. '^',
  643. '=',
  644. ';',
  645. '!',
  646. "'",
  647. '+',
  648. ',',
  649. '`',
  650. '~',
  651. '|',
  652. '<',
  653. '>',
  654. '"'
  655. ];
  656. let needsQuotes = false;
  657. for (const char of arg) {
  658. if (cmdSpecialChars.some(x => x === char)) {
  659. needsQuotes = true;
  660. break;
  661. }
  662. }
  663. // short-circuit if quotes not needed
  664. if (!needsQuotes) {
  665. return arg;
  666. }
  667. // the following quoting rules are very similar to the rules that by libuv applies.
  668. //
  669. // 1) wrap the string in quotes
  670. //
  671. // 2) double-up quotes - i.e. " => ""
  672. //
  673. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  674. // doesn't work well with a cmd.exe command line.
  675. //
  676. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  677. // for example, the command line:
  678. // foo.exe "myarg:""my val"""
  679. // is parsed by a .NET console app into an arg array:
  680. // [ "myarg:\"my val\"" ]
  681. // which is the same end result when applying libuv quoting rules. although the actual
  682. // command line from libuv quoting rules would look like:
  683. // foo.exe "myarg:\"my val\""
  684. //
  685. // 3) double-up slashes that precede a quote,
  686. // e.g. hello \world => "hello \world"
  687. // hello\"world => "hello\\""world"
  688. // hello\\"world => "hello\\\\""world"
  689. // hello world\ => "hello world\\"
  690. //
  691. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  692. // the reasons for including this as a .cmd quoting rule are:
  693. //
  694. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  695. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  696. //
  697. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  698. // haven't heard any complaints about that aspect.
  699. //
  700. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  701. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  702. // by using %%.
  703. //
  704. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  705. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  706. //
  707. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  708. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  709. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  710. // to an external program.
  711. //
  712. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  713. // % can be escaped within a .cmd file.
  714. let reverse = '"';
  715. let quoteHit = true;
  716. for (let i = arg.length; i > 0; i--) {
  717. // walk the string in reverse
  718. reverse += arg[i - 1];
  719. if (quoteHit && arg[i - 1] === '\\') {
  720. reverse += '\\'; // double the slash
  721. }
  722. else if (arg[i - 1] === '"') {
  723. quoteHit = true;
  724. reverse += '"'; // double the quote
  725. }
  726. else {
  727. quoteHit = false;
  728. }
  729. }
  730. reverse += '"';
  731. return reverse
  732. .split('')
  733. .reverse()
  734. .join('');
  735. }
  736. _uvQuoteCmdArg(arg) {
  737. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  738. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  739. // is used.
  740. //
  741. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  742. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  743. // pasting copyright notice from Node within this function:
  744. //
  745. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  746. //
  747. // Permission is hereby granted, free of charge, to any person obtaining a copy
  748. // of this software and associated documentation files (the "Software"), to
  749. // deal in the Software without restriction, including without limitation the
  750. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  751. // sell copies of the Software, and to permit persons to whom the Software is
  752. // furnished to do so, subject to the following conditions:
  753. //
  754. // The above copyright notice and this permission notice shall be included in
  755. // all copies or substantial portions of the Software.
  756. //
  757. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  758. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  759. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  760. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  761. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  762. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  763. // IN THE SOFTWARE.
  764. if (!arg) {
  765. // Need double quotation for empty argument
  766. return '""';
  767. }
  768. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  769. // No quotation needed
  770. return arg;
  771. }
  772. if (!arg.includes('"') && !arg.includes('\\')) {
  773. // No embedded double quotes or backslashes, so I can just wrap
  774. // quote marks around the whole thing.
  775. return `"${arg}"`;
  776. }
  777. // Expected input/output:
  778. // input : hello"world
  779. // output: "hello\"world"
  780. // input : hello""world
  781. // output: "hello\"\"world"
  782. // input : hello\world
  783. // output: hello\world
  784. // input : hello\\world
  785. // output: hello\\world
  786. // input : hello\"world
  787. // output: "hello\\\"world"
  788. // input : hello\\"world
  789. // output: "hello\\\\\"world"
  790. // input : hello world\
  791. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  792. // but it appears the comment is wrong, it should be "hello world\\"
  793. let reverse = '"';
  794. let quoteHit = true;
  795. for (let i = arg.length; i > 0; i--) {
  796. // walk the string in reverse
  797. reverse += arg[i - 1];
  798. if (quoteHit && arg[i - 1] === '\\') {
  799. reverse += '\\';
  800. }
  801. else if (arg[i - 1] === '"') {
  802. quoteHit = true;
  803. reverse += '\\';
  804. }
  805. else {
  806. quoteHit = false;
  807. }
  808. }
  809. reverse += '"';
  810. return reverse
  811. .split('')
  812. .reverse()
  813. .join('');
  814. }
  815. _cloneExecOptions(options) {
  816. options = options || {};
  817. const result = {
  818. cwd: options.cwd || process.cwd(),
  819. env: options.env || process.env,
  820. silent: options.silent || false,
  821. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  822. failOnStdErr: options.failOnStdErr || false,
  823. ignoreReturnCode: options.ignoreReturnCode || false,
  824. delay: options.delay || 10000
  825. };
  826. result.outStream = options.outStream || process.stdout;
  827. result.errStream = options.errStream || process.stderr;
  828. return result;
  829. }
  830. _getSpawnOptions(options, toolPath) {
  831. options = options || {};
  832. const result = {};
  833. result.cwd = options.cwd;
  834. result.env = options.env;
  835. result['windowsVerbatimArguments'] =
  836. options.windowsVerbatimArguments || this._isCmdFile();
  837. if (options.windowsVerbatimArguments) {
  838. result.argv0 = `"${toolPath}"`;
  839. }
  840. return result;
  841. }
  842. /**
  843. * Exec a tool.
  844. * Output will be streamed to the live console.
  845. * Returns promise with return code
  846. *
  847. * @param tool path to tool to exec
  848. * @param options optional exec options. See ExecOptions
  849. * @returns number
  850. */
  851. exec() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return new Promise((resolve, reject) => {
  854. this._debug(`exec tool: ${this.toolPath}`);
  855. this._debug('arguments:');
  856. for (const arg of this.args) {
  857. this._debug(` ${arg}`);
  858. }
  859. const optionsNonNull = this._cloneExecOptions(this.options);
  860. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  861. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  862. }
  863. const state = new ExecState(optionsNonNull, this.toolPath);
  864. state.on('debug', (message) => {
  865. this._debug(message);
  866. });
  867. const fileName = this._getSpawnFileName();
  868. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  869. const stdbuffer = '';
  870. if (cp.stdout) {
  871. cp.stdout.on('data', (data) => {
  872. if (this.options.listeners && this.options.listeners.stdout) {
  873. this.options.listeners.stdout(data);
  874. }
  875. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  876. optionsNonNull.outStream.write(data);
  877. }
  878. this._processLineBuffer(data, stdbuffer, (line) => {
  879. if (this.options.listeners && this.options.listeners.stdline) {
  880. this.options.listeners.stdline(line);
  881. }
  882. });
  883. });
  884. }
  885. const errbuffer = '';
  886. if (cp.stderr) {
  887. cp.stderr.on('data', (data) => {
  888. state.processStderr = true;
  889. if (this.options.listeners && this.options.listeners.stderr) {
  890. this.options.listeners.stderr(data);
  891. }
  892. if (!optionsNonNull.silent &&
  893. optionsNonNull.errStream &&
  894. optionsNonNull.outStream) {
  895. const s = optionsNonNull.failOnStdErr
  896. ? optionsNonNull.errStream
  897. : optionsNonNull.outStream;
  898. s.write(data);
  899. }
  900. this._processLineBuffer(data, errbuffer, (line) => {
  901. if (this.options.listeners && this.options.listeners.errline) {
  902. this.options.listeners.errline(line);
  903. }
  904. });
  905. });
  906. }
  907. cp.on('error', (err) => {
  908. state.processError = err.message;
  909. state.processExited = true;
  910. state.processClosed = true;
  911. state.CheckComplete();
  912. });
  913. cp.on('exit', (code) => {
  914. state.processExitCode = code;
  915. state.processExited = true;
  916. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  917. state.CheckComplete();
  918. });
  919. cp.on('close', (code) => {
  920. state.processExitCode = code;
  921. state.processExited = true;
  922. state.processClosed = true;
  923. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  924. state.CheckComplete();
  925. });
  926. state.on('done', (error, exitCode) => {
  927. if (stdbuffer.length > 0) {
  928. this.emit('stdline', stdbuffer);
  929. }
  930. if (errbuffer.length > 0) {
  931. this.emit('errline', errbuffer);
  932. }
  933. cp.removeAllListeners();
  934. if (error) {
  935. reject(error);
  936. }
  937. else {
  938. resolve(exitCode);
  939. }
  940. });
  941. });
  942. });
  943. }
  944. }
  945. exports.ToolRunner = ToolRunner;
  946. /**
  947. * Convert an arg string to an array of args. Handles escaping
  948. *
  949. * @param argString string of arguments
  950. * @returns string[] array of arguments
  951. */
  952. function argStringToArray(argString) {
  953. const args = [];
  954. let inQuotes = false;
  955. let escaped = false;
  956. let arg = '';
  957. function append(c) {
  958. // we only escape double quotes.
  959. if (escaped && c !== '"') {
  960. arg += '\\';
  961. }
  962. arg += c;
  963. escaped = false;
  964. }
  965. for (let i = 0; i < argString.length; i++) {
  966. const c = argString.charAt(i);
  967. if (c === '"') {
  968. if (!escaped) {
  969. inQuotes = !inQuotes;
  970. }
  971. else {
  972. append(c);
  973. }
  974. continue;
  975. }
  976. if (c === '\\' && escaped) {
  977. append(c);
  978. continue;
  979. }
  980. if (c === '\\' && inQuotes) {
  981. escaped = true;
  982. continue;
  983. }
  984. if (c === ' ' && !inQuotes) {
  985. if (arg.length > 0) {
  986. args.push(arg);
  987. arg = '';
  988. }
  989. continue;
  990. }
  991. append(c);
  992. }
  993. if (arg.length > 0) {
  994. args.push(arg.trim());
  995. }
  996. return args;
  997. }
  998. exports.argStringToArray = argStringToArray;
  999. class ExecState extends events.EventEmitter {
  1000. constructor(options, toolPath) {
  1001. super();
  1002. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1003. this.processError = '';
  1004. this.processExitCode = 0;
  1005. this.processExited = false; // tracks whether the process has exited
  1006. this.processStderr = false; // tracks whether stderr was written to
  1007. this.delay = 10000; // 10 seconds
  1008. this.done = false;
  1009. this.timeout = null;
  1010. if (!toolPath) {
  1011. throw new Error('toolPath must not be empty');
  1012. }
  1013. this.options = options;
  1014. this.toolPath = toolPath;
  1015. if (options.delay) {
  1016. this.delay = options.delay;
  1017. }
  1018. }
  1019. CheckComplete() {
  1020. if (this.done) {
  1021. return;
  1022. }
  1023. if (this.processClosed) {
  1024. this._setResult();
  1025. }
  1026. else if (this.processExited) {
  1027. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1028. }
  1029. }
  1030. _debug(message) {
  1031. this.emit('debug', message);
  1032. }
  1033. _setResult() {
  1034. // determine whether there is an error
  1035. let error;
  1036. if (this.processExited) {
  1037. if (this.processError) {
  1038. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  1039. }
  1040. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1041. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1042. }
  1043. else if (this.processStderr && this.options.failOnStdErr) {
  1044. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1045. }
  1046. }
  1047. // clear the timeout
  1048. if (this.timeout) {
  1049. clearTimeout(this.timeout);
  1050. this.timeout = null;
  1051. }
  1052. this.done = true;
  1053. this.emit('done', error, this.processExitCode);
  1054. }
  1055. static HandleTimeout(state) {
  1056. if (state.done) {
  1057. return;
  1058. }
  1059. if (!state.processClosed && state.processExited) {
  1060. const message = `The STDIO streams did not close within ${state.delay /
  1061. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  1062. state._debug(message);
  1063. }
  1064. state._setResult();
  1065. }
  1066. }
  1067. //# sourceMappingURL=toolrunner.js.map
  1068. /***/ }),
  1069. /***/ 11:
  1070. /***/ (function(module) {
  1071. // Returns a wrapper function that returns a wrapped callback
  1072. // The wrapper function should do some stuff, and return a
  1073. // presumably different callback function.
  1074. // This makes sure that own properties are retained, so that
  1075. // decorations and such are not lost along the way.
  1076. module.exports = wrappy
  1077. function wrappy (fn, cb) {
  1078. if (fn && cb) return wrappy(fn)(cb)
  1079. if (typeof fn !== 'function')
  1080. throw new TypeError('need wrapper function')
  1081. Object.keys(fn).forEach(function (k) {
  1082. wrapper[k] = fn[k]
  1083. })
  1084. return wrapper
  1085. function wrapper() {
  1086. var args = new Array(arguments.length)
  1087. for (var i = 0; i < args.length; i++) {
  1088. args[i] = arguments[i]
  1089. }
  1090. var ret = fn.apply(this, args)
  1091. var cb = args[args.length-1]
  1092. if (typeof ret === 'function' && ret !== cb) {
  1093. Object.keys(cb).forEach(function (k) {
  1094. ret[k] = cb[k]
  1095. })
  1096. }
  1097. return ret
  1098. }
  1099. }
  1100. /***/ }),
  1101. /***/ 16:
  1102. /***/ (function(module) {
  1103. module.exports = require("tls");
  1104. /***/ }),
  1105. /***/ 18:
  1106. /***/ (function() {
  1107. eval("require")("encoding");
  1108. /***/ }),
  1109. /***/ 19:
  1110. /***/ (function(module, __unusedexports, __webpack_require__) {
  1111. module.exports = authenticationPlugin;
  1112. const { Deprecation } = __webpack_require__(692);
  1113. const once = __webpack_require__(969);
  1114. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1115. const authenticate = __webpack_require__(674);
  1116. const beforeRequest = __webpack_require__(471);
  1117. const requestError = __webpack_require__(349);
  1118. function authenticationPlugin(octokit, options) {
  1119. if (options.auth) {
  1120. octokit.authenticate = () => {
  1121. deprecateAuthenticate(
  1122. octokit.log,
  1123. new Deprecation(
  1124. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1125. )
  1126. );
  1127. };
  1128. return;
  1129. }
  1130. const state = {
  1131. octokit,
  1132. auth: false
  1133. };
  1134. octokit.authenticate = authenticate.bind(null, state);
  1135. octokit.hook.before("request", beforeRequest.bind(null, state));
  1136. octokit.hook.error("request", requestError.bind(null, state));
  1137. }
  1138. /***/ }),
  1139. /***/ 20:
  1140. /***/ (function(module, __unusedexports, __webpack_require__) {
  1141. "use strict";
  1142. const cp = __webpack_require__(129);
  1143. const parse = __webpack_require__(568);
  1144. const enoent = __webpack_require__(881);
  1145. function spawn(command, args, options) {
  1146. // Parse the arguments
  1147. const parsed = parse(command, args, options);
  1148. // Spawn the child process
  1149. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1150. // Hook into child process "exit" event to emit an error if the command
  1151. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1152. enoent.hookChildProcess(spawned, parsed);
  1153. return spawned;
  1154. }
  1155. function spawnSync(command, args, options) {
  1156. // Parse the arguments
  1157. const parsed = parse(command, args, options);
  1158. // Spawn the child process
  1159. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1160. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1161. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1162. return result;
  1163. }
  1164. module.exports = spawn;
  1165. module.exports.spawn = spawn;
  1166. module.exports.sync = spawnSync;
  1167. module.exports._parse = parse;
  1168. module.exports._enoent = enoent;
  1169. /***/ }),
  1170. /***/ 34:
  1171. /***/ (function(module) {
  1172. module.exports = require("https");
  1173. /***/ }),
  1174. /***/ 39:
  1175. /***/ (function(module) {
  1176. "use strict";
  1177. module.exports = opts => {
  1178. opts = opts || {};
  1179. const env = opts.env || process.env;
  1180. const platform = opts.platform || process.platform;
  1181. if (platform !== 'win32') {
  1182. return 'PATH';
  1183. }
  1184. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1185. };
  1186. /***/ }),
  1187. /***/ 47:
  1188. /***/ (function(module, __unusedexports, __webpack_require__) {
  1189. module.exports = factory;
  1190. const Octokit = __webpack_require__(402);
  1191. const registerPlugin = __webpack_require__(855);
  1192. function factory(plugins) {
  1193. const Api = Octokit.bind(null, plugins || []);
  1194. Api.plugin = registerPlugin.bind(null, plugins || []);
  1195. return Api;
  1196. }
  1197. /***/ }),
  1198. /***/ 49:
  1199. /***/ (function(module, __unusedexports, __webpack_require__) {
  1200. "use strict";
  1201. const os = __webpack_require__(87);
  1202. const execa = __webpack_require__(955);
  1203. // Reference: https://www.gaijin.at/en/lstwinver.php
  1204. const names = new Map([
  1205. ['10.0', '10'],
  1206. ['6.3', '8.1'],
  1207. ['6.2', '8'],
  1208. ['6.1', '7'],
  1209. ['6.0', 'Vista'],
  1210. ['5.2', 'Server 2003'],
  1211. ['5.1', 'XP'],
  1212. ['5.0', '2000'],
  1213. ['4.9', 'ME'],
  1214. ['4.1', '98'],
  1215. ['4.0', '95']
  1216. ]);
  1217. const windowsRelease = release => {
  1218. const version = /\d+\.\d/.exec(release || os.release());
  1219. if (release && !version) {
  1220. throw new Error('`release` argument doesn\'t match `n.n`');
  1221. }
  1222. const ver = (version || [])[0];
  1223. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
  1224. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1225. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1226. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
  1227. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
  1228. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1229. let stdout;
  1230. try {
  1231. stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
  1232. } catch (_) {
  1233. stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1234. }
  1235. const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
  1236. if (year) {
  1237. return `Server ${year}`;
  1238. }
  1239. }
  1240. return names.get(ver);
  1241. };
  1242. module.exports = windowsRelease;
  1243. /***/ }),
  1244. /***/ 81:
  1245. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1246. "use strict";
  1247. var __importStar = (this && this.__importStar) || function (mod) {
  1248. if (mod && mod.__esModule) return mod;
  1249. var result = {};
  1250. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1251. result["default"] = mod;
  1252. return result;
  1253. };
  1254. Object.defineProperty(exports, "__esModule", { value: true });
  1255. const assert = __importStar(__webpack_require__(357));
  1256. const url_1 = __webpack_require__(835);
  1257. function getFetchUrl(settings) {
  1258. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1259. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1260. const serviceUrl = getServerUrl();
  1261. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1262. const encodedName = encodeURIComponent(settings.repositoryName);
  1263. if (settings.sshKey) {
  1264. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1265. }
  1266. // "origin" is SCHEME://HOSTNAME[:PORT]
  1267. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1268. }
  1269. exports.getFetchUrl = getFetchUrl;
  1270. function getServerUrl() {
  1271. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  1272. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  1273. process.env['GITHUB_URL'] ||
  1274. 'https://github.com');
  1275. }
  1276. exports.getServerUrl = getServerUrl;
  1277. /***/ }),
  1278. /***/ 87:
  1279. /***/ (function(module) {
  1280. module.exports = require("os");
  1281. /***/ }),
  1282. /***/ 118:
  1283. /***/ (function(module, __unusedexports, __webpack_require__) {
  1284. "use strict";
  1285. const os = __webpack_require__(87);
  1286. const nameMap = new Map([
  1287. [19, 'Catalina'],
  1288. [18, 'Mojave'],
  1289. [17, 'High Sierra'],
  1290. [16, 'Sierra'],
  1291. [15, 'El Capitan'],
  1292. [14, 'Yosemite'],
  1293. [13, 'Mavericks'],
  1294. [12, 'Mountain Lion'],
  1295. [11, 'Lion'],
  1296. [10, 'Snow Leopard'],
  1297. [9, 'Leopard'],
  1298. [8, 'Tiger'],
  1299. [7, 'Panther'],
  1300. [6, 'Jaguar'],
  1301. [5, 'Puma']
  1302. ]);
  1303. const macosRelease = release => {
  1304. release = Number((release || os.release()).split('.')[0]);
  1305. return {
  1306. name: nameMap.get(release),
  1307. version: '10.' + (release - 4)
  1308. };
  1309. };
  1310. module.exports = macosRelease;
  1311. // TODO: remove this in the next major version
  1312. module.exports.default = macosRelease;
  1313. /***/ }),
  1314. /***/ 126:
  1315. /***/ (function(module) {
  1316. /**
  1317. * lodash (Custom Build) <https://lodash.com/>
  1318. * Build: `lodash modularize exports="npm" -o ./`
  1319. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1320. * Released under MIT license <https://lodash.com/license>
  1321. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1322. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1323. */
  1324. /** Used as the size to enable large array optimizations. */
  1325. var LARGE_ARRAY_SIZE = 200;
  1326. /** Used to stand-in for `undefined` hash values. */
  1327. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1328. /** Used as references for various `Number` constants. */
  1329. var INFINITY = 1 / 0;
  1330. /** `Object#toString` result references. */
  1331. var funcTag = '[object Function]',
  1332. genTag = '[object GeneratorFunction]';
  1333. /**
  1334. * Used to match `RegExp`
  1335. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1336. */
  1337. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1338. /** Used to detect host constructors (Safari). */
  1339. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1340. /** Detect free variable `global` from Node.js. */
  1341. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1342. /** Detect free variable `self`. */
  1343. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1344. /** Used as a reference to the global object. */
  1345. var root = freeGlobal || freeSelf || Function('return this')();
  1346. /**
  1347. * A specialized version of `_.includes` for arrays without support for
  1348. * specifying an index to search from.
  1349. *
  1350. * @private
  1351. * @param {Array} [array] The array to inspect.
  1352. * @param {*} target The value to search for.
  1353. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1354. */
  1355. function arrayIncludes(array, value) {
  1356. var length = array ? array.length : 0;
  1357. return !!length && baseIndexOf(array, value, 0) > -1;
  1358. }
  1359. /**
  1360. * This function is like `arrayIncludes` except that it accepts a comparator.
  1361. *
  1362. * @private
  1363. * @param {Array} [array] The array to inspect.
  1364. * @param {*} target The value to search for.
  1365. * @param {Function} comparator The comparator invoked per element.
  1366. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1367. */
  1368. function arrayIncludesWith(array, value, comparator) {
  1369. var index = -1,
  1370. length = array ? array.length : 0;
  1371. while (++index < length) {
  1372. if (comparator(value, array[index])) {
  1373. return true;
  1374. }
  1375. }
  1376. return false;
  1377. }
  1378. /**
  1379. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1380. * support for iteratee shorthands.
  1381. *
  1382. * @private
  1383. * @param {Array} array The array to inspect.
  1384. * @param {Function} predicate The function invoked per iteration.
  1385. * @param {number} fromIndex The index to search from.
  1386. * @param {boolean} [fromRight] Specify iterating from right to left.
  1387. * @returns {number} Returns the index of the matched value, else `-1`.
  1388. */
  1389. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1390. var length = array.length,
  1391. index = fromIndex + (fromRight ? 1 : -1);
  1392. while ((fromRight ? index-- : ++index < length)) {
  1393. if (predicate(array[index], index, array)) {
  1394. return index;
  1395. }
  1396. }
  1397. return -1;
  1398. }
  1399. /**
  1400. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1401. *
  1402. * @private
  1403. * @param {Array} array The array to inspect.
  1404. * @param {*} value The value to search for.
  1405. * @param {number} fromIndex The index to search from.
  1406. * @returns {number} Returns the index of the matched value, else `-1`.
  1407. */
  1408. function baseIndexOf(array, value, fromIndex) {
  1409. if (value !== value) {
  1410. return baseFindIndex(array, baseIsNaN, fromIndex);
  1411. }
  1412. var index = fromIndex - 1,
  1413. length = array.length;
  1414. while (++index < length) {
  1415. if (array[index] === value) {
  1416. return index;
  1417. }
  1418. }
  1419. return -1;
  1420. }
  1421. /**
  1422. * The base implementation of `_.isNaN` without support for number objects.
  1423. *
  1424. * @private
  1425. * @param {*} value The value to check.
  1426. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1427. */
  1428. function baseIsNaN(value) {
  1429. return value !== value;
  1430. }
  1431. /**
  1432. * Checks if a cache value for `key` exists.
  1433. *
  1434. * @private
  1435. * @param {Object} cache The cache to query.
  1436. * @param {string} key The key of the entry to check.
  1437. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1438. */
  1439. function cacheHas(cache, key) {
  1440. return cache.has(key);
  1441. }
  1442. /**
  1443. * Gets the value at `key` of `object`.
  1444. *
  1445. * @private
  1446. * @param {Object} [object] The object to query.
  1447. * @param {string} key The key of the property to get.
  1448. * @returns {*} Returns the property value.
  1449. */
  1450. function getValue(object, key) {
  1451. return object == null ? undefined : object[key];
  1452. }
  1453. /**
  1454. * Checks if `value` is a host object in IE < 9.
  1455. *
  1456. * @private
  1457. * @param {*} value The value to check.
  1458. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1459. */
  1460. function isHostObject(value) {
  1461. // Many host objects are `Object` objects that can coerce to strings
  1462. // despite having improperly defined `toString` methods.
  1463. var result = false;
  1464. if (value != null && typeof value.toString != 'function') {
  1465. try {
  1466. result = !!(value + '');
  1467. } catch (e) {}
  1468. }
  1469. return result;
  1470. }
  1471. /**
  1472. * Converts `set` to an array of its values.
  1473. *
  1474. * @private
  1475. * @param {Object} set The set to convert.
  1476. * @returns {Array} Returns the values.
  1477. */
  1478. function setToArray(set) {
  1479. var index = -1,
  1480. result = Array(set.size);
  1481. set.forEach(function(value) {
  1482. result[++index] = value;
  1483. });
  1484. return result;
  1485. }
  1486. /** Used for built-in method references. */
  1487. var arrayProto = Array.prototype,
  1488. funcProto = Function.prototype,
  1489. objectProto = Object.prototype;
  1490. /** Used to detect overreaching core-js shims. */
  1491. var coreJsData = root['__core-js_shared__'];
  1492. /** Used to detect methods masquerading as native. */
  1493. var maskSrcKey = (function() {
  1494. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1495. return uid ? ('Symbol(src)_1.' + uid) : '';
  1496. }());
  1497. /** Used to resolve the decompiled source of functions. */
  1498. var funcToString = funcProto.toString;
  1499. /** Used to check objects for own properties. */
  1500. var hasOwnProperty = objectProto.hasOwnProperty;
  1501. /**
  1502. * Used to resolve the
  1503. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1504. * of values.
  1505. */
  1506. var objectToString = objectProto.toString;
  1507. /** Used to detect if a method is native. */
  1508. var reIsNative = RegExp('^' +
  1509. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1510. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1511. );
  1512. /** Built-in value references. */
  1513. var splice = arrayProto.splice;
  1514. /* Built-in method references that are verified to be native. */
  1515. var Map = getNative(root, 'Map'),
  1516. Set = getNative(root, 'Set'),
  1517. nativeCreate = getNative(Object, 'create');
  1518. /**
  1519. * Creates a hash object.
  1520. *
  1521. * @private
  1522. * @constructor
  1523. * @param {Array} [entries] The key-value pairs to cache.
  1524. */
  1525. function Hash(entries) {
  1526. var index = -1,
  1527. length = entries ? entries.length : 0;
  1528. this.clear();
  1529. while (++index < length) {
  1530. var entry = entries[index];
  1531. this.set(entry[0], entry[1]);
  1532. }
  1533. }
  1534. /**
  1535. * Removes all key-value entries from the hash.
  1536. *
  1537. * @private
  1538. * @name clear
  1539. * @memberOf Hash
  1540. */
  1541. function hashClear() {
  1542. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1543. }
  1544. /**
  1545. * Removes `key` and its value from the hash.
  1546. *
  1547. * @private
  1548. * @name delete
  1549. * @memberOf Hash
  1550. * @param {Object} hash The hash to modify.
  1551. * @param {string} key The key of the value to remove.
  1552. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1553. */
  1554. function hashDelete(key) {
  1555. return this.has(key) && delete this.__data__[key];
  1556. }
  1557. /**
  1558. * Gets the hash value for `key`.
  1559. *
  1560. * @private
  1561. * @name get
  1562. * @memberOf Hash
  1563. * @param {string} key The key of the value to get.
  1564. * @returns {*} Returns the entry value.
  1565. */
  1566. function hashGet(key) {
  1567. var data = this.__data__;
  1568. if (nativeCreate) {
  1569. var result = data[key];
  1570. return result === HASH_UNDEFINED ? undefined : result;
  1571. }
  1572. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1573. }
  1574. /**
  1575. * Checks if a hash value for `key` exists.
  1576. *
  1577. * @private
  1578. * @name has
  1579. * @memberOf Hash
  1580. * @param {string} key The key of the entry to check.
  1581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1582. */
  1583. function hashHas(key) {
  1584. var data = this.__data__;
  1585. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1586. }
  1587. /**
  1588. * Sets the hash `key` to `value`.
  1589. *
  1590. * @private
  1591. * @name set
  1592. * @memberOf Hash
  1593. * @param {string} key The key of the value to set.
  1594. * @param {*} value The value to set.
  1595. * @returns {Object} Returns the hash instance.
  1596. */
  1597. function hashSet(key, value) {
  1598. var data = this.__data__;
  1599. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1600. return this;
  1601. }
  1602. // Add methods to `Hash`.
  1603. Hash.prototype.clear = hashClear;
  1604. Hash.prototype['delete'] = hashDelete;
  1605. Hash.prototype.get = hashGet;
  1606. Hash.prototype.has = hashHas;
  1607. Hash.prototype.set = hashSet;
  1608. /**
  1609. * Creates an list cache object.
  1610. *
  1611. * @private
  1612. * @constructor
  1613. * @param {Array} [entries] The key-value pairs to cache.
  1614. */
  1615. function ListCache(entries) {
  1616. var index = -1,
  1617. length = entries ? entries.length : 0;
  1618. this.clear();
  1619. while (++index < length) {
  1620. var entry = entries[index];
  1621. this.set(entry[0], entry[1]);
  1622. }
  1623. }
  1624. /**
  1625. * Removes all key-value entries from the list cache.
  1626. *
  1627. * @private
  1628. * @name clear
  1629. * @memberOf ListCache
  1630. */
  1631. function listCacheClear() {
  1632. this.__data__ = [];
  1633. }
  1634. /**
  1635. * Removes `key` and its value from the list cache.
  1636. *
  1637. * @private
  1638. * @name delete
  1639. * @memberOf ListCache
  1640. * @param {string} key The key of the value to remove.
  1641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1642. */
  1643. function listCacheDelete(key) {
  1644. var data = this.__data__,
  1645. index = assocIndexOf(data, key);
  1646. if (index < 0) {
  1647. return false;
  1648. }
  1649. var lastIndex = data.length - 1;
  1650. if (index == lastIndex) {
  1651. data.pop();
  1652. } else {
  1653. splice.call(data, index, 1);
  1654. }
  1655. return true;
  1656. }
  1657. /**
  1658. * Gets the list cache value for `key`.
  1659. *
  1660. * @private
  1661. * @name get
  1662. * @memberOf ListCache
  1663. * @param {string} key The key of the value to get.
  1664. * @returns {*} Returns the entry value.
  1665. */
  1666. function listCacheGet(key) {
  1667. var data = this.__data__,
  1668. index = assocIndexOf(data, key);
  1669. return index < 0 ? undefined : data[index][1];
  1670. }
  1671. /**
  1672. * Checks if a list cache value for `key` exists.
  1673. *
  1674. * @private
  1675. * @name has
  1676. * @memberOf ListCache
  1677. * @param {string} key The key of the entry to check.
  1678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1679. */
  1680. function listCacheHas(key) {
  1681. return assocIndexOf(this.__data__, key) > -1;
  1682. }
  1683. /**
  1684. * Sets the list cache `key` to `value`.
  1685. *
  1686. * @private
  1687. * @name set
  1688. * @memberOf ListCache
  1689. * @param {string} key The key of the value to set.
  1690. * @param {*} value The value to set.
  1691. * @returns {Object} Returns the list cache instance.
  1692. */
  1693. function listCacheSet(key, value) {
  1694. var data = this.__data__,
  1695. index = assocIndexOf(data, key);
  1696. if (index < 0) {
  1697. data.push([key, value]);
  1698. } else {
  1699. data[index][1] = value;
  1700. }
  1701. return this;
  1702. }
  1703. // Add methods to `ListCache`.
  1704. ListCache.prototype.clear = listCacheClear;
  1705. ListCache.prototype['delete'] = listCacheDelete;
  1706. ListCache.prototype.get = listCacheGet;
  1707. ListCache.prototype.has = listCacheHas;
  1708. ListCache.prototype.set = listCacheSet;
  1709. /**
  1710. * Creates a map cache object to store key-value pairs.
  1711. *
  1712. * @private
  1713. * @constructor
  1714. * @param {Array} [entries] The key-value pairs to cache.
  1715. */
  1716. function MapCache(entries) {
  1717. var index = -1,
  1718. length = entries ? entries.length : 0;
  1719. this.clear();
  1720. while (++index < length) {
  1721. var entry = entries[index];
  1722. this.set(entry[0], entry[1]);
  1723. }
  1724. }
  1725. /**
  1726. * Removes all key-value entries from the map.
  1727. *
  1728. * @private
  1729. * @name clear
  1730. * @memberOf MapCache
  1731. */
  1732. function mapCacheClear() {
  1733. this.__data__ = {
  1734. 'hash': new Hash,
  1735. 'map': new (Map || ListCache),
  1736. 'string': new Hash
  1737. };
  1738. }
  1739. /**
  1740. * Removes `key` and its value from the map.
  1741. *
  1742. * @private
  1743. * @name delete
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the value to remove.
  1746. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1747. */
  1748. function mapCacheDelete(key) {
  1749. return getMapData(this, key)['delete'](key);
  1750. }
  1751. /**
  1752. * Gets the map value for `key`.
  1753. *
  1754. * @private
  1755. * @name get
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to get.
  1758. * @returns {*} Returns the entry value.
  1759. */
  1760. function mapCacheGet(key) {
  1761. return getMapData(this, key).get(key);
  1762. }
  1763. /**
  1764. * Checks if a map value for `key` exists.
  1765. *
  1766. * @private
  1767. * @name has
  1768. * @memberOf MapCache
  1769. * @param {string} key The key of the entry to check.
  1770. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1771. */
  1772. function mapCacheHas(key) {
  1773. return getMapData(this, key).has(key);
  1774. }
  1775. /**
  1776. * Sets the map `key` to `value`.
  1777. *
  1778. * @private
  1779. * @name set
  1780. * @memberOf MapCache
  1781. * @param {string} key The key of the value to set.
  1782. * @param {*} value The value to set.
  1783. * @returns {Object} Returns the map cache instance.
  1784. */
  1785. function mapCacheSet(key, value) {
  1786. getMapData(this, key).set(key, value);
  1787. return this;
  1788. }
  1789. // Add methods to `MapCache`.
  1790. MapCache.prototype.clear = mapCacheClear;
  1791. MapCache.prototype['delete'] = mapCacheDelete;
  1792. MapCache.prototype.get = mapCacheGet;
  1793. MapCache.prototype.has = mapCacheHas;
  1794. MapCache.prototype.set = mapCacheSet;
  1795. /**
  1796. *
  1797. * Creates an array cache object to store unique values.
  1798. *
  1799. * @private
  1800. * @constructor
  1801. * @param {Array} [values] The values to cache.
  1802. */
  1803. function SetCache(values) {
  1804. var index = -1,
  1805. length = values ? values.length : 0;
  1806. this.__data__ = new MapCache;
  1807. while (++index < length) {
  1808. this.add(values[index]);
  1809. }
  1810. }
  1811. /**
  1812. * Adds `value` to the array cache.
  1813. *
  1814. * @private
  1815. * @name add
  1816. * @memberOf SetCache
  1817. * @alias push
  1818. * @param {*} value The value to cache.
  1819. * @returns {Object} Returns the cache instance.
  1820. */
  1821. function setCacheAdd(value) {
  1822. this.__data__.set(value, HASH_UNDEFINED);
  1823. return this;
  1824. }
  1825. /**
  1826. * Checks if `value` is in the array cache.
  1827. *
  1828. * @private
  1829. * @name has
  1830. * @memberOf SetCache
  1831. * @param {*} value The value to search for.
  1832. * @returns {number} Returns `true` if `value` is found, else `false`.
  1833. */
  1834. function setCacheHas(value) {
  1835. return this.__data__.has(value);
  1836. }
  1837. // Add methods to `SetCache`.
  1838. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1839. SetCache.prototype.has = setCacheHas;
  1840. /**
  1841. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1842. *
  1843. * @private
  1844. * @param {Array} array The array to inspect.
  1845. * @param {*} key The key to search for.
  1846. * @returns {number} Returns the index of the matched value, else `-1`.
  1847. */
  1848. function assocIndexOf(array, key) {
  1849. var length = array.length;
  1850. while (length--) {
  1851. if (eq(array[length][0], key)) {
  1852. return length;
  1853. }
  1854. }
  1855. return -1;
  1856. }
  1857. /**
  1858. * The base implementation of `_.isNative` without bad shim checks.
  1859. *
  1860. * @private
  1861. * @param {*} value The value to check.
  1862. * @returns {boolean} Returns `true` if `value` is a native function,
  1863. * else `false`.
  1864. */
  1865. function baseIsNative(value) {
  1866. if (!isObject(value) || isMasked(value)) {
  1867. return false;
  1868. }
  1869. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1870. return pattern.test(toSource(value));
  1871. }
  1872. /**
  1873. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {Function} [iteratee] The iteratee invoked per element.
  1878. * @param {Function} [comparator] The comparator invoked per element.
  1879. * @returns {Array} Returns the new duplicate free array.
  1880. */
  1881. function baseUniq(array, iteratee, comparator) {
  1882. var index = -1,
  1883. includes = arrayIncludes,
  1884. length = array.length,
  1885. isCommon = true,
  1886. result = [],
  1887. seen = result;
  1888. if (comparator) {
  1889. isCommon = false;
  1890. includes = arrayIncludesWith;
  1891. }
  1892. else if (length >= LARGE_ARRAY_SIZE) {
  1893. var set = iteratee ? null : createSet(array);
  1894. if (set) {
  1895. return setToArray(set);
  1896. }
  1897. isCommon = false;
  1898. includes = cacheHas;
  1899. seen = new SetCache;
  1900. }
  1901. else {
  1902. seen = iteratee ? [] : result;
  1903. }
  1904. outer:
  1905. while (++index < length) {
  1906. var value = array[index],
  1907. computed = iteratee ? iteratee(value) : value;
  1908. value = (comparator || value !== 0) ? value : 0;
  1909. if (isCommon && computed === computed) {
  1910. var seenIndex = seen.length;
  1911. while (seenIndex--) {
  1912. if (seen[seenIndex] === computed) {
  1913. continue outer;
  1914. }
  1915. }
  1916. if (iteratee) {
  1917. seen.push(computed);
  1918. }
  1919. result.push(value);
  1920. }
  1921. else if (!includes(seen, computed, comparator)) {
  1922. if (seen !== result) {
  1923. seen.push(computed);
  1924. }
  1925. result.push(value);
  1926. }
  1927. }
  1928. return result;
  1929. }
  1930. /**
  1931. * Creates a set object of `values`.
  1932. *
  1933. * @private
  1934. * @param {Array} values The values to add to the set.
  1935. * @returns {Object} Returns the new set.
  1936. */
  1937. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1938. return new Set(values);
  1939. };
  1940. /**
  1941. * Gets the data for `map`.
  1942. *
  1943. * @private
  1944. * @param {Object} map The map to query.
  1945. * @param {string} key The reference key.
  1946. * @returns {*} Returns the map data.
  1947. */
  1948. function getMapData(map, key) {
  1949. var data = map.__data__;
  1950. return isKeyable(key)
  1951. ? data[typeof key == 'string' ? 'string' : 'hash']
  1952. : data.map;
  1953. }
  1954. /**
  1955. * Gets the native function at `key` of `object`.
  1956. *
  1957. * @private
  1958. * @param {Object} object The object to query.
  1959. * @param {string} key The key of the method to get.
  1960. * @returns {*} Returns the function if it's native, else `undefined`.
  1961. */
  1962. function getNative(object, key) {
  1963. var value = getValue(object, key);
  1964. return baseIsNative(value) ? value : undefined;
  1965. }
  1966. /**
  1967. * Checks if `value` is suitable for use as unique object key.
  1968. *
  1969. * @private
  1970. * @param {*} value The value to check.
  1971. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1972. */
  1973. function isKeyable(value) {
  1974. var type = typeof value;
  1975. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1976. ? (value !== '__proto__')
  1977. : (value === null);
  1978. }
  1979. /**
  1980. * Checks if `func` has its source masked.
  1981. *
  1982. * @private
  1983. * @param {Function} func The function to check.
  1984. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1985. */
  1986. function isMasked(func) {
  1987. return !!maskSrcKey && (maskSrcKey in func);
  1988. }
  1989. /**
  1990. * Converts `func` to its source code.
  1991. *
  1992. * @private
  1993. * @param {Function} func The function to process.
  1994. * @returns {string} Returns the source code.
  1995. */
  1996. function toSource(func) {
  1997. if (func != null) {
  1998. try {
  1999. return funcToString.call(func);
  2000. } catch (e) {}
  2001. try {
  2002. return (func + '');
  2003. } catch (e) {}
  2004. }
  2005. return '';
  2006. }
  2007. /**
  2008. * Creates a duplicate-free version of an array, using
  2009. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2010. * for equality comparisons, in which only the first occurrence of each
  2011. * element is kept.
  2012. *
  2013. * @static
  2014. * @memberOf _
  2015. * @since 0.1.0
  2016. * @category Array
  2017. * @param {Array} array The array to inspect.
  2018. * @returns {Array} Returns the new duplicate free array.
  2019. * @example
  2020. *
  2021. * _.uniq([2, 1, 2]);
  2022. * // => [2, 1]
  2023. */
  2024. function uniq(array) {
  2025. return (array && array.length)
  2026. ? baseUniq(array)
  2027. : [];
  2028. }
  2029. /**
  2030. * Performs a
  2031. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2032. * comparison between two values to determine if they are equivalent.
  2033. *
  2034. * @static
  2035. * @memberOf _
  2036. * @since 4.0.0
  2037. * @category Lang
  2038. * @param {*} value The value to compare.
  2039. * @param {*} other The other value to compare.
  2040. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2041. * @example
  2042. *
  2043. * var object = { 'a': 1 };
  2044. * var other = { 'a': 1 };
  2045. *
  2046. * _.eq(object, object);
  2047. * // => true
  2048. *
  2049. * _.eq(object, other);
  2050. * // => false
  2051. *
  2052. * _.eq('a', 'a');
  2053. * // => true
  2054. *
  2055. * _.eq('a', Object('a'));
  2056. * // => false
  2057. *
  2058. * _.eq(NaN, NaN);
  2059. * // => true
  2060. */
  2061. function eq(value, other) {
  2062. return value === other || (value !== value && other !== other);
  2063. }
  2064. /**
  2065. * Checks if `value` is classified as a `Function` object.
  2066. *
  2067. * @static
  2068. * @memberOf _
  2069. * @since 0.1.0
  2070. * @category Lang
  2071. * @param {*} value The value to check.
  2072. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2073. * @example
  2074. *
  2075. * _.isFunction(_);
  2076. * // => true
  2077. *
  2078. * _.isFunction(/abc/);
  2079. * // => false
  2080. */
  2081. function isFunction(value) {
  2082. // The use of `Object#toString` avoids issues with the `typeof` operator
  2083. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2084. var tag = isObject(value) ? objectToString.call(value) : '';
  2085. return tag == funcTag || tag == genTag;
  2086. }
  2087. /**
  2088. * Checks if `value` is the
  2089. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2090. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2091. *
  2092. * @static
  2093. * @memberOf _
  2094. * @since 0.1.0
  2095. * @category Lang
  2096. * @param {*} value The value to check.
  2097. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2098. * @example
  2099. *
  2100. * _.isObject({});
  2101. * // => true
  2102. *
  2103. * _.isObject([1, 2, 3]);
  2104. * // => true
  2105. *
  2106. * _.isObject(_.noop);
  2107. * // => true
  2108. *
  2109. * _.isObject(null);
  2110. * // => false
  2111. */
  2112. function isObject(value) {
  2113. var type = typeof value;
  2114. return !!value && (type == 'object' || type == 'function');
  2115. }
  2116. /**
  2117. * This method returns `undefined`.
  2118. *
  2119. * @static
  2120. * @memberOf _
  2121. * @since 2.3.0
  2122. * @category Util
  2123. * @example
  2124. *
  2125. * _.times(2, _.noop);
  2126. * // => [undefined, undefined]
  2127. */
  2128. function noop() {
  2129. // No operation performed.
  2130. }
  2131. module.exports = uniq;
  2132. /***/ }),
  2133. /***/ 129:
  2134. /***/ (function(module) {
  2135. module.exports = require("child_process");
  2136. /***/ }),
  2137. /***/ 139:
  2138. /***/ (function(module, __unusedexports, __webpack_require__) {
  2139. // Unique ID creation requires a high quality random # generator. In node.js
  2140. // this is pretty straight-forward - we use the crypto API.
  2141. var crypto = __webpack_require__(417);
  2142. module.exports = function nodeRNG() {
  2143. return crypto.randomBytes(16);
  2144. };
  2145. /***/ }),
  2146. /***/ 141:
  2147. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2148. "use strict";
  2149. var net = __webpack_require__(631);
  2150. var tls = __webpack_require__(16);
  2151. var http = __webpack_require__(605);
  2152. var https = __webpack_require__(34);
  2153. var events = __webpack_require__(614);
  2154. var assert = __webpack_require__(357);
  2155. var util = __webpack_require__(669);
  2156. exports.httpOverHttp = httpOverHttp;
  2157. exports.httpsOverHttp = httpsOverHttp;
  2158. exports.httpOverHttps = httpOverHttps;
  2159. exports.httpsOverHttps = httpsOverHttps;
  2160. function httpOverHttp(options) {
  2161. var agent = new TunnelingAgent(options);
  2162. agent.request = http.request;
  2163. return agent;
  2164. }
  2165. function httpsOverHttp(options) {
  2166. var agent = new TunnelingAgent(options);
  2167. agent.request = http.request;
  2168. agent.createSocket = createSecureSocket;
  2169. return agent;
  2170. }
  2171. function httpOverHttps(options) {
  2172. var agent = new TunnelingAgent(options);
  2173. agent.request = https.request;
  2174. return agent;
  2175. }
  2176. function httpsOverHttps(options) {
  2177. var agent = new TunnelingAgent(options);
  2178. agent.request = https.request;
  2179. agent.createSocket = createSecureSocket;
  2180. return agent;
  2181. }
  2182. function TunnelingAgent(options) {
  2183. var self = this;
  2184. self.options = options || {};
  2185. self.proxyOptions = self.options.proxy || {};
  2186. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2187. self.requests = [];
  2188. self.sockets = [];
  2189. self.on('free', function onFree(socket, host, port, localAddress) {
  2190. var options = toOptions(host, port, localAddress);
  2191. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2192. var pending = self.requests[i];
  2193. if (pending.host === options.host && pending.port === options.port) {
  2194. // Detect the request to connect same origin server,
  2195. // reuse the connection.
  2196. self.requests.splice(i, 1);
  2197. pending.request.onSocket(socket);
  2198. return;
  2199. }
  2200. }
  2201. socket.destroy();
  2202. self.removeSocket(socket);
  2203. });
  2204. }
  2205. util.inherits(TunnelingAgent, events.EventEmitter);
  2206. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2207. var self = this;
  2208. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2209. if (self.sockets.length >= this.maxSockets) {
  2210. // We are over limit so we'll add it to the queue.
  2211. self.requests.push(options);
  2212. return;
  2213. }
  2214. // If we are under maxSockets create a new one.
  2215. self.createSocket(options, function(socket) {
  2216. socket.on('free', onFree);
  2217. socket.on('close', onCloseOrRemove);
  2218. socket.on('agentRemove', onCloseOrRemove);
  2219. req.onSocket(socket);
  2220. function onFree() {
  2221. self.emit('free', socket, options);
  2222. }
  2223. function onCloseOrRemove(err) {
  2224. self.removeSocket(socket);
  2225. socket.removeListener('free', onFree);
  2226. socket.removeListener('close', onCloseOrRemove);
  2227. socket.removeListener('agentRemove', onCloseOrRemove);
  2228. }
  2229. });
  2230. };
  2231. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2232. var self = this;
  2233. var placeholder = {};
  2234. self.sockets.push(placeholder);
  2235. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2236. method: 'CONNECT',
  2237. path: options.host + ':' + options.port,
  2238. agent: false
  2239. });
  2240. if (connectOptions.proxyAuth) {
  2241. connectOptions.headers = connectOptions.headers || {};
  2242. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2243. new Buffer(connectOptions.proxyAuth).toString('base64');
  2244. }
  2245. debug('making CONNECT request');
  2246. var connectReq = self.request(connectOptions);
  2247. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2248. connectReq.once('response', onResponse); // for v0.6
  2249. connectReq.once('upgrade', onUpgrade); // for v0.6
  2250. connectReq.once('connect', onConnect); // for v0.7 or later
  2251. connectReq.once('error', onError);
  2252. connectReq.end();
  2253. function onResponse(res) {
  2254. // Very hacky. This is necessary to avoid http-parser leaks.
  2255. res.upgrade = true;
  2256. }
  2257. function onUpgrade(res, socket, head) {
  2258. // Hacky.
  2259. process.nextTick(function() {
  2260. onConnect(res, socket, head);
  2261. });
  2262. }
  2263. function onConnect(res, socket, head) {
  2264. connectReq.removeAllListeners();
  2265. socket.removeAllListeners();
  2266. if (res.statusCode === 200) {
  2267. assert.equal(head.length, 0);
  2268. debug('tunneling connection has established');
  2269. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2270. cb(socket);
  2271. } else {
  2272. debug('tunneling socket could not be established, statusCode=%d',
  2273. res.statusCode);
  2274. var error = new Error('tunneling socket could not be established, ' +
  2275. 'statusCode=' + res.statusCode);
  2276. error.code = 'ECONNRESET';
  2277. options.request.emit('error', error);
  2278. self.removeSocket(placeholder);
  2279. }
  2280. }
  2281. function onError(cause) {
  2282. connectReq.removeAllListeners();
  2283. debug('tunneling socket could not be established, cause=%s\n',
  2284. cause.message, cause.stack);
  2285. var error = new Error('tunneling socket could not be established, ' +
  2286. 'cause=' + cause.message);
  2287. error.code = 'ECONNRESET';
  2288. options.request.emit('error', error);
  2289. self.removeSocket(placeholder);
  2290. }
  2291. };
  2292. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2293. var pos = this.sockets.indexOf(socket)
  2294. if (pos === -1) {
  2295. return;
  2296. }
  2297. this.sockets.splice(pos, 1);
  2298. var pending = this.requests.shift();
  2299. if (pending) {
  2300. // If we have pending requests and a socket gets closed a new one
  2301. // needs to be created to take over in the pool for the one that closed.
  2302. this.createSocket(pending, function(socket) {
  2303. pending.request.onSocket(socket);
  2304. });
  2305. }
  2306. };
  2307. function createSecureSocket(options, cb) {
  2308. var self = this;
  2309. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2310. var hostHeader = options.request.getHeader('host');
  2311. var tlsOptions = mergeOptions({}, self.options, {
  2312. socket: socket,
  2313. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2314. });
  2315. // 0 is dummy port for v0.6
  2316. var secureSocket = tls.connect(0, tlsOptions);
  2317. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2318. cb(secureSocket);
  2319. });
  2320. }
  2321. function toOptions(host, port, localAddress) {
  2322. if (typeof host === 'string') { // since v0.10
  2323. return {
  2324. host: host,
  2325. port: port,
  2326. localAddress: localAddress
  2327. };
  2328. }
  2329. return host; // for v0.11 or later
  2330. }
  2331. function mergeOptions(target) {
  2332. for (var i = 1, len = arguments.length; i < len; ++i) {
  2333. var overrides = arguments[i];
  2334. if (typeof overrides === 'object') {
  2335. var keys = Object.keys(overrides);
  2336. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2337. var k = keys[j];
  2338. if (overrides[k] !== undefined) {
  2339. target[k] = overrides[k];
  2340. }
  2341. }
  2342. }
  2343. }
  2344. return target;
  2345. }
  2346. var debug;
  2347. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2348. debug = function() {
  2349. var args = Array.prototype.slice.call(arguments);
  2350. if (typeof args[0] === 'string') {
  2351. args[0] = 'TUNNEL: ' + args[0];
  2352. } else {
  2353. args.unshift('TUNNEL:');
  2354. }
  2355. console.error.apply(console, args);
  2356. }
  2357. } else {
  2358. debug = function() {};
  2359. }
  2360. exports.debug = debug; // for test
  2361. /***/ }),
  2362. /***/ 143:
  2363. /***/ (function(module, __unusedexports, __webpack_require__) {
  2364. module.exports = withAuthorizationPrefix;
  2365. const atob = __webpack_require__(368);
  2366. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2367. function withAuthorizationPrefix(authorization) {
  2368. if (/^(basic|bearer|token) /i.test(authorization)) {
  2369. return authorization;
  2370. }
  2371. try {
  2372. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2373. return `basic ${authorization}`;
  2374. }
  2375. } catch (error) {}
  2376. if (authorization.split(/\./).length === 3) {
  2377. return `bearer ${authorization}`;
  2378. }
  2379. return `token ${authorization}`;
  2380. }
  2381. /***/ }),
  2382. /***/ 145:
  2383. /***/ (function(module, __unusedexports, __webpack_require__) {
  2384. "use strict";
  2385. const pump = __webpack_require__(453);
  2386. const bufferStream = __webpack_require__(966);
  2387. class MaxBufferError extends Error {
  2388. constructor() {
  2389. super('maxBuffer exceeded');
  2390. this.name = 'MaxBufferError';
  2391. }
  2392. }
  2393. function getStream(inputStream, options) {
  2394. if (!inputStream) {
  2395. return Promise.reject(new Error('Expected a stream'));
  2396. }
  2397. options = Object.assign({maxBuffer: Infinity}, options);
  2398. const {maxBuffer} = options;
  2399. let stream;
  2400. return new Promise((resolve, reject) => {
  2401. const rejectPromise = error => {
  2402. if (error) { // A null check
  2403. error.bufferedData = stream.getBufferedValue();
  2404. }
  2405. reject(error);
  2406. };
  2407. stream = pump(inputStream, bufferStream(options), error => {
  2408. if (error) {
  2409. rejectPromise(error);
  2410. return;
  2411. }
  2412. resolve();
  2413. });
  2414. stream.on('data', () => {
  2415. if (stream.getBufferedLength() > maxBuffer) {
  2416. rejectPromise(new MaxBufferError());
  2417. }
  2418. });
  2419. }).then(() => stream.getBufferedValue());
  2420. }
  2421. module.exports = getStream;
  2422. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2423. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2424. module.exports.MaxBufferError = MaxBufferError;
  2425. /***/ }),
  2426. /***/ 148:
  2427. /***/ (function(module, __unusedexports, __webpack_require__) {
  2428. module.exports = paginatePlugin;
  2429. const { paginateRest } = __webpack_require__(299);
  2430. function paginatePlugin(octokit) {
  2431. Object.assign(octokit, paginateRest(octokit));
  2432. }
  2433. /***/ }),
  2434. /***/ 153:
  2435. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2436. "use strict";
  2437. var __importStar = (this && this.__importStar) || function (mod) {
  2438. if (mod && mod.__esModule) return mod;
  2439. var result = {};
  2440. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2441. result["default"] = mod;
  2442. return result;
  2443. };
  2444. Object.defineProperty(exports, "__esModule", { value: true });
  2445. const coreCommand = __importStar(__webpack_require__(431));
  2446. /**
  2447. * Indicates whether the POST action is running
  2448. */
  2449. exports.IsPost = !!process.env['STATE_isPost'];
  2450. /**
  2451. * The repository path for the POST action. The value is empty during the MAIN action.
  2452. */
  2453. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2454. /**
  2455. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2456. */
  2457. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2458. /**
  2459. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2460. */
  2461. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2462. /**
  2463. * Save the repository path so the POST action can retrieve the value.
  2464. */
  2465. function setRepositoryPath(repositoryPath) {
  2466. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2467. }
  2468. exports.setRepositoryPath = setRepositoryPath;
  2469. /**
  2470. * Save the SSH key path so the POST action can retrieve the value.
  2471. */
  2472. function setSshKeyPath(sshKeyPath) {
  2473. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2474. }
  2475. exports.setSshKeyPath = setSshKeyPath;
  2476. /**
  2477. * Save the SSH known hosts path so the POST action can retrieve the value.
  2478. */
  2479. function setSshKnownHostsPath(sshKnownHostsPath) {
  2480. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2481. }
  2482. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2483. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2484. // This is necessary since we don't have a separate entry point.
  2485. if (!exports.IsPost) {
  2486. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2487. }
  2488. /***/ }),
  2489. /***/ 168:
  2490. /***/ (function(module) {
  2491. "use strict";
  2492. const alias = ['stdin', 'stdout', 'stderr'];
  2493. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2494. module.exports = opts => {
  2495. if (!opts) {
  2496. return null;
  2497. }
  2498. if (opts.stdio && hasAlias(opts)) {
  2499. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2500. }
  2501. if (typeof opts.stdio === 'string') {
  2502. return opts.stdio;
  2503. }
  2504. const stdio = opts.stdio || [];
  2505. if (!Array.isArray(stdio)) {
  2506. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2507. }
  2508. const result = [];
  2509. const len = Math.max(stdio.length, alias.length);
  2510. for (let i = 0; i < len; i++) {
  2511. let value = null;
  2512. if (stdio[i] !== undefined) {
  2513. value = stdio[i];
  2514. } else if (opts[alias[i]] !== undefined) {
  2515. value = opts[alias[i]];
  2516. }
  2517. result[i] = value;
  2518. }
  2519. return result;
  2520. };
  2521. /***/ }),
  2522. /***/ 179:
  2523. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2524. "use strict";
  2525. var net = __webpack_require__(631);
  2526. var tls = __webpack_require__(16);
  2527. var http = __webpack_require__(605);
  2528. var https = __webpack_require__(34);
  2529. var events = __webpack_require__(614);
  2530. var assert = __webpack_require__(357);
  2531. var util = __webpack_require__(669);
  2532. exports.httpOverHttp = httpOverHttp;
  2533. exports.httpsOverHttp = httpsOverHttp;
  2534. exports.httpOverHttps = httpOverHttps;
  2535. exports.httpsOverHttps = httpsOverHttps;
  2536. function httpOverHttp(options) {
  2537. var agent = new TunnelingAgent(options);
  2538. agent.request = http.request;
  2539. return agent;
  2540. }
  2541. function httpsOverHttp(options) {
  2542. var agent = new TunnelingAgent(options);
  2543. agent.request = http.request;
  2544. agent.createSocket = createSecureSocket;
  2545. agent.defaultPort = 443;
  2546. return agent;
  2547. }
  2548. function httpOverHttps(options) {
  2549. var agent = new TunnelingAgent(options);
  2550. agent.request = https.request;
  2551. return agent;
  2552. }
  2553. function httpsOverHttps(options) {
  2554. var agent = new TunnelingAgent(options);
  2555. agent.request = https.request;
  2556. agent.createSocket = createSecureSocket;
  2557. agent.defaultPort = 443;
  2558. return agent;
  2559. }
  2560. function TunnelingAgent(options) {
  2561. var self = this;
  2562. self.options = options || {};
  2563. self.proxyOptions = self.options.proxy || {};
  2564. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2565. self.requests = [];
  2566. self.sockets = [];
  2567. self.on('free', function onFree(socket, host, port, localAddress) {
  2568. var options = toOptions(host, port, localAddress);
  2569. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2570. var pending = self.requests[i];
  2571. if (pending.host === options.host && pending.port === options.port) {
  2572. // Detect the request to connect same origin server,
  2573. // reuse the connection.
  2574. self.requests.splice(i, 1);
  2575. pending.request.onSocket(socket);
  2576. return;
  2577. }
  2578. }
  2579. socket.destroy();
  2580. self.removeSocket(socket);
  2581. });
  2582. }
  2583. util.inherits(TunnelingAgent, events.EventEmitter);
  2584. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2585. var self = this;
  2586. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2587. if (self.sockets.length >= this.maxSockets) {
  2588. // We are over limit so we'll add it to the queue.
  2589. self.requests.push(options);
  2590. return;
  2591. }
  2592. // If we are under maxSockets create a new one.
  2593. self.createSocket(options, function(socket) {
  2594. socket.on('free', onFree);
  2595. socket.on('close', onCloseOrRemove);
  2596. socket.on('agentRemove', onCloseOrRemove);
  2597. req.onSocket(socket);
  2598. function onFree() {
  2599. self.emit('free', socket, options);
  2600. }
  2601. function onCloseOrRemove(err) {
  2602. self.removeSocket(socket);
  2603. socket.removeListener('free', onFree);
  2604. socket.removeListener('close', onCloseOrRemove);
  2605. socket.removeListener('agentRemove', onCloseOrRemove);
  2606. }
  2607. });
  2608. };
  2609. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2610. var self = this;
  2611. var placeholder = {};
  2612. self.sockets.push(placeholder);
  2613. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2614. method: 'CONNECT',
  2615. path: options.host + ':' + options.port,
  2616. agent: false,
  2617. headers: {
  2618. host: options.host + ':' + options.port
  2619. }
  2620. });
  2621. if (options.localAddress) {
  2622. connectOptions.localAddress = options.localAddress;
  2623. }
  2624. if (connectOptions.proxyAuth) {
  2625. connectOptions.headers = connectOptions.headers || {};
  2626. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2627. new Buffer(connectOptions.proxyAuth).toString('base64');
  2628. }
  2629. debug('making CONNECT request');
  2630. var connectReq = self.request(connectOptions);
  2631. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2632. connectReq.once('response', onResponse); // for v0.6
  2633. connectReq.once('upgrade', onUpgrade); // for v0.6
  2634. connectReq.once('connect', onConnect); // for v0.7 or later
  2635. connectReq.once('error', onError);
  2636. connectReq.end();
  2637. function onResponse(res) {
  2638. // Very hacky. This is necessary to avoid http-parser leaks.
  2639. res.upgrade = true;
  2640. }
  2641. function onUpgrade(res, socket, head) {
  2642. // Hacky.
  2643. process.nextTick(function() {
  2644. onConnect(res, socket, head);
  2645. });
  2646. }
  2647. function onConnect(res, socket, head) {
  2648. connectReq.removeAllListeners();
  2649. socket.removeAllListeners();
  2650. if (res.statusCode !== 200) {
  2651. debug('tunneling socket could not be established, statusCode=%d',
  2652. res.statusCode);
  2653. socket.destroy();
  2654. var error = new Error('tunneling socket could not be established, ' +
  2655. 'statusCode=' + res.statusCode);
  2656. error.code = 'ECONNRESET';
  2657. options.request.emit('error', error);
  2658. self.removeSocket(placeholder);
  2659. return;
  2660. }
  2661. if (head.length > 0) {
  2662. debug('got illegal response body from proxy');
  2663. socket.destroy();
  2664. var error = new Error('got illegal response body from proxy');
  2665. error.code = 'ECONNRESET';
  2666. options.request.emit('error', error);
  2667. self.removeSocket(placeholder);
  2668. return;
  2669. }
  2670. debug('tunneling connection has established');
  2671. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2672. return cb(socket);
  2673. }
  2674. function onError(cause) {
  2675. connectReq.removeAllListeners();
  2676. debug('tunneling socket could not be established, cause=%s\n',
  2677. cause.message, cause.stack);
  2678. var error = new Error('tunneling socket could not be established, ' +
  2679. 'cause=' + cause.message);
  2680. error.code = 'ECONNRESET';
  2681. options.request.emit('error', error);
  2682. self.removeSocket(placeholder);
  2683. }
  2684. };
  2685. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2686. var pos = this.sockets.indexOf(socket)
  2687. if (pos === -1) {
  2688. return;
  2689. }
  2690. this.sockets.splice(pos, 1);
  2691. var pending = this.requests.shift();
  2692. if (pending) {
  2693. // If we have pending requests and a socket gets closed a new one
  2694. // needs to be created to take over in the pool for the one that closed.
  2695. this.createSocket(pending, function(socket) {
  2696. pending.request.onSocket(socket);
  2697. });
  2698. }
  2699. };
  2700. function createSecureSocket(options, cb) {
  2701. var self = this;
  2702. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2703. var hostHeader = options.request.getHeader('host');
  2704. var tlsOptions = mergeOptions({}, self.options, {
  2705. socket: socket,
  2706. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2707. });
  2708. // 0 is dummy port for v0.6
  2709. var secureSocket = tls.connect(0, tlsOptions);
  2710. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2711. cb(secureSocket);
  2712. });
  2713. }
  2714. function toOptions(host, port, localAddress) {
  2715. if (typeof host === 'string') { // since v0.10
  2716. return {
  2717. host: host,
  2718. port: port,
  2719. localAddress: localAddress
  2720. };
  2721. }
  2722. return host; // for v0.11 or later
  2723. }
  2724. function mergeOptions(target) {
  2725. for (var i = 1, len = arguments.length; i < len; ++i) {
  2726. var overrides = arguments[i];
  2727. if (typeof overrides === 'object') {
  2728. var keys = Object.keys(overrides);
  2729. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2730. var k = keys[j];
  2731. if (overrides[k] !== undefined) {
  2732. target[k] = overrides[k];
  2733. }
  2734. }
  2735. }
  2736. }
  2737. return target;
  2738. }
  2739. var debug;
  2740. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2741. debug = function() {
  2742. var args = Array.prototype.slice.call(arguments);
  2743. if (typeof args[0] === 'string') {
  2744. args[0] = 'TUNNEL: ' + args[0];
  2745. } else {
  2746. args.unshift('TUNNEL:');
  2747. }
  2748. console.error.apply(console, args);
  2749. }
  2750. } else {
  2751. debug = function() {};
  2752. }
  2753. exports.debug = debug; // for test
  2754. /***/ }),
  2755. /***/ 190:
  2756. /***/ (function(module, __unusedexports, __webpack_require__) {
  2757. module.exports = authenticationPlugin;
  2758. const { createTokenAuth } = __webpack_require__(813);
  2759. const { Deprecation } = __webpack_require__(692);
  2760. const once = __webpack_require__(969);
  2761. const beforeRequest = __webpack_require__(863);
  2762. const requestError = __webpack_require__(991);
  2763. const validate = __webpack_require__(954);
  2764. const withAuthorizationPrefix = __webpack_require__(143);
  2765. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2766. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2767. function authenticationPlugin(octokit, options) {
  2768. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2769. if (options.authStrategy) {
  2770. const auth = options.authStrategy(options.auth);
  2771. octokit.hook.wrap("request", auth.hook);
  2772. octokit.auth = auth;
  2773. return;
  2774. }
  2775. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2776. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2777. if (!options.auth) {
  2778. octokit.auth = () =>
  2779. Promise.resolve({
  2780. type: "unauthenticated"
  2781. });
  2782. return;
  2783. }
  2784. const isBasicAuthString =
  2785. typeof options.auth === "string" &&
  2786. /^basic/.test(withAuthorizationPrefix(options.auth));
  2787. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2788. if (typeof options.auth === "string" && !isBasicAuthString) {
  2789. const auth = createTokenAuth(options.auth);
  2790. octokit.hook.wrap("request", auth.hook);
  2791. octokit.auth = auth;
  2792. return;
  2793. }
  2794. // Otherwise log a deprecation message
  2795. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2796. ? [
  2797. deprecateAuthBasic,
  2798. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2799. ]
  2800. : [
  2801. deprecateAuthObject,
  2802. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2803. ];
  2804. deprecationMethod(
  2805. octokit.log,
  2806. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2807. );
  2808. octokit.auth = () =>
  2809. Promise.resolve({
  2810. type: "deprecated",
  2811. message: deprecationMessapge
  2812. });
  2813. validate(options.auth);
  2814. const state = {
  2815. octokit,
  2816. auth: options.auth
  2817. };
  2818. octokit.hook.before("request", beforeRequest.bind(null, state));
  2819. octokit.hook.error("request", requestError.bind(null, state));
  2820. }
  2821. /***/ }),
  2822. /***/ 197:
  2823. /***/ (function(module, __unusedexports, __webpack_require__) {
  2824. module.exports = isexe
  2825. isexe.sync = sync
  2826. var fs = __webpack_require__(747)
  2827. function isexe (path, options, cb) {
  2828. fs.stat(path, function (er, stat) {
  2829. cb(er, er ? false : checkStat(stat, options))
  2830. })
  2831. }
  2832. function sync (path, options) {
  2833. return checkStat(fs.statSync(path), options)
  2834. }
  2835. function checkStat (stat, options) {
  2836. return stat.isFile() && checkMode(stat, options)
  2837. }
  2838. function checkMode (stat, options) {
  2839. var mod = stat.mode
  2840. var uid = stat.uid
  2841. var gid = stat.gid
  2842. var myUid = options.uid !== undefined ?
  2843. options.uid : process.getuid && process.getuid()
  2844. var myGid = options.gid !== undefined ?
  2845. options.gid : process.getgid && process.getgid()
  2846. var u = parseInt('100', 8)
  2847. var g = parseInt('010', 8)
  2848. var o = parseInt('001', 8)
  2849. var ug = u | g
  2850. var ret = (mod & o) ||
  2851. (mod & g) && gid === myGid ||
  2852. (mod & u) && uid === myUid ||
  2853. (mod & ug) && myUid === 0
  2854. return ret
  2855. }
  2856. /***/ }),
  2857. /***/ 198:
  2858. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2859. "use strict";
  2860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2861. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2862. return new (P || (P = Promise))(function (resolve, reject) {
  2863. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2864. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2865. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2866. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2867. });
  2868. };
  2869. var __importStar = (this && this.__importStar) || function (mod) {
  2870. if (mod && mod.__esModule) return mod;
  2871. var result = {};
  2872. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2873. result["default"] = mod;
  2874. return result;
  2875. };
  2876. Object.defineProperty(exports, "__esModule", { value: true });
  2877. const core = __importStar(__webpack_require__(470));
  2878. const coreCommand = __importStar(__webpack_require__(431));
  2879. const gitSourceProvider = __importStar(__webpack_require__(293));
  2880. const inputHelper = __importStar(__webpack_require__(821));
  2881. const path = __importStar(__webpack_require__(622));
  2882. const stateHelper = __importStar(__webpack_require__(153));
  2883. function run() {
  2884. return __awaiter(this, void 0, void 0, function* () {
  2885. try {
  2886. const sourceSettings = inputHelper.getInputs();
  2887. try {
  2888. // Register problem matcher
  2889. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2890. // Get sources
  2891. yield gitSourceProvider.getSource(sourceSettings);
  2892. }
  2893. finally {
  2894. // Unregister problem matcher
  2895. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2896. }
  2897. }
  2898. catch (error) {
  2899. core.setFailed(error.message);
  2900. }
  2901. });
  2902. }
  2903. function cleanup() {
  2904. return __awaiter(this, void 0, void 0, function* () {
  2905. try {
  2906. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2907. }
  2908. catch (error) {
  2909. core.warning(error.message);
  2910. }
  2911. });
  2912. }
  2913. // Main
  2914. if (!stateHelper.IsPost) {
  2915. run();
  2916. }
  2917. // Post
  2918. else {
  2919. cleanup();
  2920. }
  2921. /***/ }),
  2922. /***/ 211:
  2923. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2924. "use strict";
  2925. Object.defineProperty(exports, '__esModule', { value: true });
  2926. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2927. var osName = _interopDefault(__webpack_require__(2));
  2928. function getUserAgent() {
  2929. try {
  2930. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2931. } catch (error) {
  2932. if (/wmic os get Caption/.test(error.message)) {
  2933. return "Windows <version undetectable>";
  2934. }
  2935. return "<environment undetectable>";
  2936. }
  2937. }
  2938. exports.getUserAgent = getUserAgent;
  2939. //# sourceMappingURL=index.js.map
  2940. /***/ }),
  2941. /***/ 215:
  2942. /***/ (function(module) {
  2943. module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_from":"@octokit/rest@16.43.1"};
  2944. /***/ }),
  2945. /***/ 227:
  2946. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2947. "use strict";
  2948. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2949. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2950. return new (P || (P = Promise))(function (resolve, reject) {
  2951. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2952. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2953. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2954. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2955. });
  2956. };
  2957. var __importStar = (this && this.__importStar) || function (mod) {
  2958. if (mod && mod.__esModule) return mod;
  2959. var result = {};
  2960. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2961. result["default"] = mod;
  2962. return result;
  2963. };
  2964. Object.defineProperty(exports, "__esModule", { value: true });
  2965. const url_1 = __webpack_require__(835);
  2966. const core = __importStar(__webpack_require__(470));
  2967. const github = __importStar(__webpack_require__(469));
  2968. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2969. function getCheckoutInfo(git, ref, commit) {
  2970. return __awaiter(this, void 0, void 0, function* () {
  2971. if (!git) {
  2972. throw new Error('Arg git cannot be empty');
  2973. }
  2974. if (!ref && !commit) {
  2975. throw new Error('Args ref and commit cannot both be empty');
  2976. }
  2977. const result = {};
  2978. const upperRef = (ref || '').toUpperCase();
  2979. // SHA only
  2980. if (!ref) {
  2981. result.ref = commit;
  2982. }
  2983. // refs/heads/
  2984. else if (upperRef.startsWith('REFS/HEADS/')) {
  2985. const branch = ref.substring('refs/heads/'.length);
  2986. result.ref = branch;
  2987. result.startPoint = `refs/remotes/origin/${branch}`;
  2988. }
  2989. // refs/pull/
  2990. else if (upperRef.startsWith('REFS/PULL/')) {
  2991. const branch = ref.substring('refs/pull/'.length);
  2992. result.ref = `refs/remotes/pull/${branch}`;
  2993. }
  2994. // refs/tags/
  2995. else if (upperRef.startsWith('REFS/')) {
  2996. result.ref = ref;
  2997. }
  2998. // Unqualified ref, check for a matching branch or tag
  2999. else {
  3000. if (yield git.branchExists(true, `origin/${ref}`)) {
  3001. result.ref = ref;
  3002. result.startPoint = `refs/remotes/origin/${ref}`;
  3003. }
  3004. else if (yield git.tagExists(`${ref}`)) {
  3005. result.ref = `refs/tags/${ref}`;
  3006. }
  3007. else {
  3008. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3009. }
  3010. }
  3011. return result;
  3012. });
  3013. }
  3014. exports.getCheckoutInfo = getCheckoutInfo;
  3015. function getRefSpecForAllHistory(ref, commit) {
  3016. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3017. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3018. const branch = ref.substring('refs/pull/'.length);
  3019. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3020. }
  3021. return result;
  3022. }
  3023. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3024. function getRefSpec(ref, commit) {
  3025. if (!ref && !commit) {
  3026. throw new Error('Args ref and commit cannot both be empty');
  3027. }
  3028. const upperRef = (ref || '').toUpperCase();
  3029. // SHA
  3030. if (commit) {
  3031. // refs/heads
  3032. if (upperRef.startsWith('REFS/HEADS/')) {
  3033. const branch = ref.substring('refs/heads/'.length);
  3034. return [`+${commit}:refs/remotes/origin/${branch}`];
  3035. }
  3036. // refs/pull/
  3037. else if (upperRef.startsWith('REFS/PULL/')) {
  3038. const branch = ref.substring('refs/pull/'.length);
  3039. return [`+${commit}:refs/remotes/pull/${branch}`];
  3040. }
  3041. // refs/tags/
  3042. else if (upperRef.startsWith('REFS/TAGS/')) {
  3043. return [`+${commit}:${ref}`];
  3044. }
  3045. // Otherwise no destination ref
  3046. else {
  3047. return [commit];
  3048. }
  3049. }
  3050. // Unqualified ref, check for a matching branch or tag
  3051. else if (!upperRef.startsWith('REFS/')) {
  3052. return [
  3053. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3054. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3055. ];
  3056. }
  3057. // refs/heads/
  3058. else if (upperRef.startsWith('REFS/HEADS/')) {
  3059. const branch = ref.substring('refs/heads/'.length);
  3060. return [`+${ref}:refs/remotes/origin/${branch}`];
  3061. }
  3062. // refs/pull/
  3063. else if (upperRef.startsWith('REFS/PULL/')) {
  3064. const branch = ref.substring('refs/pull/'.length);
  3065. return [`+${ref}:refs/remotes/pull/${branch}`];
  3066. }
  3067. // refs/tags/
  3068. else {
  3069. return [`+${ref}:${ref}`];
  3070. }
  3071. }
  3072. exports.getRefSpec = getRefSpec;
  3073. /**
  3074. * Tests whether the initial fetch created the ref at the expected commit
  3075. */
  3076. function testRef(git, ref, commit) {
  3077. return __awaiter(this, void 0, void 0, function* () {
  3078. if (!git) {
  3079. throw new Error('Arg git cannot be empty');
  3080. }
  3081. if (!ref && !commit) {
  3082. throw new Error('Args ref and commit cannot both be empty');
  3083. }
  3084. // No SHA? Nothing to test
  3085. if (!commit) {
  3086. return true;
  3087. }
  3088. // SHA only?
  3089. else if (!ref) {
  3090. return yield git.shaExists(commit);
  3091. }
  3092. const upperRef = ref.toUpperCase();
  3093. // refs/heads/
  3094. if (upperRef.startsWith('REFS/HEADS/')) {
  3095. const branch = ref.substring('refs/heads/'.length);
  3096. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3097. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3098. }
  3099. // refs/pull/
  3100. else if (upperRef.startsWith('REFS/PULL/')) {
  3101. // Assume matches because fetched using the commit
  3102. return true;
  3103. }
  3104. // refs/tags/
  3105. else if (upperRef.startsWith('REFS/TAGS/')) {
  3106. const tagName = ref.substring('refs/tags/'.length);
  3107. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3108. }
  3109. // Unexpected
  3110. else {
  3111. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3112. return true;
  3113. }
  3114. });
  3115. }
  3116. exports.testRef = testRef;
  3117. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3118. return __awaiter(this, void 0, void 0, function* () {
  3119. try {
  3120. // GHES?
  3121. if (isGhes()) {
  3122. return;
  3123. }
  3124. // Auth token?
  3125. if (!token) {
  3126. return;
  3127. }
  3128. // Public PR synchronize, for workflow repo?
  3129. if (fromPayload('repository.private') !== false ||
  3130. github.context.eventName !== 'pull_request' ||
  3131. fromPayload('action') !== 'synchronize' ||
  3132. repositoryOwner !== github.context.repo.owner ||
  3133. repositoryName !== github.context.repo.repo ||
  3134. ref !== github.context.ref ||
  3135. !ref.startsWith('refs/pull/') ||
  3136. commit !== github.context.sha) {
  3137. return;
  3138. }
  3139. // Head SHA
  3140. const expectedHeadSha = fromPayload('after');
  3141. if (!expectedHeadSha) {
  3142. core.debug('Unable to determine head sha');
  3143. return;
  3144. }
  3145. // Base SHA
  3146. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3147. if (!expectedBaseSha) {
  3148. core.debug('Unable to determine base sha');
  3149. return;
  3150. }
  3151. // Expected message?
  3152. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3153. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3154. return;
  3155. }
  3156. // Extract details from message
  3157. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3158. if (!match) {
  3159. core.debug('Unexpected message format');
  3160. return;
  3161. }
  3162. // Post telemetry
  3163. const actualHeadSha = match[1];
  3164. if (actualHeadSha !== expectedHeadSha) {
  3165. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3166. const octokit = new github.GitHub(token, {
  3167. userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
  3168. });
  3169. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3170. }
  3171. }
  3172. catch (err) {
  3173. core.debug(`Error when validating commit info: ${err.stack}`);
  3174. }
  3175. });
  3176. }
  3177. exports.checkCommitInfo = checkCommitInfo;
  3178. function fromPayload(path) {
  3179. return select(github.context.payload, path);
  3180. }
  3181. function select(obj, path) {
  3182. if (!obj) {
  3183. return undefined;
  3184. }
  3185. const i = path.indexOf('.');
  3186. if (i < 0) {
  3187. return obj[path];
  3188. }
  3189. const key = path.substr(0, i);
  3190. return select(obj[key], path.substr(i + 1));
  3191. }
  3192. function isGhes() {
  3193. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3194. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3195. }
  3196. /***/ }),
  3197. /***/ 260:
  3198. /***/ (function(module, __unusedexports, __webpack_require__) {
  3199. // Note: since nyc uses this module to output coverage, any lines
  3200. // that are in the direct sync flow of nyc's outputCoverage are
  3201. // ignored, since we can never get coverage for them.
  3202. var assert = __webpack_require__(357)
  3203. var signals = __webpack_require__(654)
  3204. var EE = __webpack_require__(614)
  3205. /* istanbul ignore if */
  3206. if (typeof EE !== 'function') {
  3207. EE = EE.EventEmitter
  3208. }
  3209. var emitter
  3210. if (process.__signal_exit_emitter__) {
  3211. emitter = process.__signal_exit_emitter__
  3212. } else {
  3213. emitter = process.__signal_exit_emitter__ = new EE()
  3214. emitter.count = 0
  3215. emitter.emitted = {}
  3216. }
  3217. // Because this emitter is a global, we have to check to see if a
  3218. // previous version of this library failed to enable infinite listeners.
  3219. // I know what you're about to say. But literally everything about
  3220. // signal-exit is a compromise with evil. Get used to it.
  3221. if (!emitter.infinite) {
  3222. emitter.setMaxListeners(Infinity)
  3223. emitter.infinite = true
  3224. }
  3225. module.exports = function (cb, opts) {
  3226. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3227. if (loaded === false) {
  3228. load()
  3229. }
  3230. var ev = 'exit'
  3231. if (opts && opts.alwaysLast) {
  3232. ev = 'afterexit'
  3233. }
  3234. var remove = function () {
  3235. emitter.removeListener(ev, cb)
  3236. if (emitter.listeners('exit').length === 0 &&
  3237. emitter.listeners('afterexit').length === 0) {
  3238. unload()
  3239. }
  3240. }
  3241. emitter.on(ev, cb)
  3242. return remove
  3243. }
  3244. module.exports.unload = unload
  3245. function unload () {
  3246. if (!loaded) {
  3247. return
  3248. }
  3249. loaded = false
  3250. signals.forEach(function (sig) {
  3251. try {
  3252. process.removeListener(sig, sigListeners[sig])
  3253. } catch (er) {}
  3254. })
  3255. process.emit = originalProcessEmit
  3256. process.reallyExit = originalProcessReallyExit
  3257. emitter.count -= 1
  3258. }
  3259. function emit (event, code, signal) {
  3260. if (emitter.emitted[event]) {
  3261. return
  3262. }
  3263. emitter.emitted[event] = true
  3264. emitter.emit(event, code, signal)
  3265. }
  3266. // { <signal>: <listener fn>, ... }
  3267. var sigListeners = {}
  3268. signals.forEach(function (sig) {
  3269. sigListeners[sig] = function listener () {
  3270. // If there are no other listeners, an exit is coming!
  3271. // Simplest way: remove us and then re-send the signal.
  3272. // We know that this will kill the process, so we can
  3273. // safely emit now.
  3274. var listeners = process.listeners(sig)
  3275. if (listeners.length === emitter.count) {
  3276. unload()
  3277. emit('exit', null, sig)
  3278. /* istanbul ignore next */
  3279. emit('afterexit', null, sig)
  3280. /* istanbul ignore next */
  3281. process.kill(process.pid, sig)
  3282. }
  3283. }
  3284. })
  3285. module.exports.signals = function () {
  3286. return signals
  3287. }
  3288. module.exports.load = load
  3289. var loaded = false
  3290. function load () {
  3291. if (loaded) {
  3292. return
  3293. }
  3294. loaded = true
  3295. // This is the number of onSignalExit's that are in play.
  3296. // It's important so that we can count the correct number of
  3297. // listeners on signals, and don't wait for the other one to
  3298. // handle it instead of us.
  3299. emitter.count += 1
  3300. signals = signals.filter(function (sig) {
  3301. try {
  3302. process.on(sig, sigListeners[sig])
  3303. return true
  3304. } catch (er) {
  3305. return false
  3306. }
  3307. })
  3308. process.emit = processEmit
  3309. process.reallyExit = processReallyExit
  3310. }
  3311. var originalProcessReallyExit = process.reallyExit
  3312. function processReallyExit (code) {
  3313. process.exitCode = code || 0
  3314. emit('exit', process.exitCode, null)
  3315. /* istanbul ignore next */
  3316. emit('afterexit', process.exitCode, null)
  3317. /* istanbul ignore next */
  3318. originalProcessReallyExit.call(process, process.exitCode)
  3319. }
  3320. var originalProcessEmit = process.emit
  3321. function processEmit (ev, arg) {
  3322. if (ev === 'exit') {
  3323. if (arg !== undefined) {
  3324. process.exitCode = arg
  3325. }
  3326. var ret = originalProcessEmit.apply(this, arguments)
  3327. emit('exit', process.exitCode, null)
  3328. /* istanbul ignore next */
  3329. emit('afterexit', process.exitCode, null)
  3330. return ret
  3331. } else {
  3332. return originalProcessEmit.apply(this, arguments)
  3333. }
  3334. }
  3335. /***/ }),
  3336. /***/ 262:
  3337. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3338. "use strict";
  3339. Object.defineProperty(exports, "__esModule", { value: true });
  3340. const fs_1 = __webpack_require__(747);
  3341. const os_1 = __webpack_require__(87);
  3342. class Context {
  3343. /**
  3344. * Hydrate the context from the environment
  3345. */
  3346. constructor() {
  3347. this.payload = {};
  3348. if (process.env.GITHUB_EVENT_PATH) {
  3349. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3350. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3351. }
  3352. else {
  3353. const path = process.env.GITHUB_EVENT_PATH;
  3354. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3355. }
  3356. }
  3357. this.eventName = process.env.GITHUB_EVENT_NAME;
  3358. this.sha = process.env.GITHUB_SHA;
  3359. this.ref = process.env.GITHUB_REF;
  3360. this.workflow = process.env.GITHUB_WORKFLOW;
  3361. this.action = process.env.GITHUB_ACTION;
  3362. this.actor = process.env.GITHUB_ACTOR;
  3363. }
  3364. get issue() {
  3365. const payload = this.payload;
  3366. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3367. }
  3368. get repo() {
  3369. if (process.env.GITHUB_REPOSITORY) {
  3370. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3371. return { owner, repo };
  3372. }
  3373. if (this.payload.repository) {
  3374. return {
  3375. owner: this.payload.repository.owner.login,
  3376. repo: this.payload.repository.name
  3377. };
  3378. }
  3379. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3380. }
  3381. }
  3382. exports.Context = Context;
  3383. //# sourceMappingURL=context.js.map
  3384. /***/ }),
  3385. /***/ 265:
  3386. /***/ (function(module, __unusedexports, __webpack_require__) {
  3387. module.exports = getPage
  3388. const deprecate = __webpack_require__(370)
  3389. const getPageLinks = __webpack_require__(577)
  3390. const HttpError = __webpack_require__(297)
  3391. function getPage (octokit, link, which, headers) {
  3392. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  3393. const url = getPageLinks(link)[which]
  3394. if (!url) {
  3395. const urlError = new HttpError(`No ${which} page found`, 404)
  3396. return Promise.reject(urlError)
  3397. }
  3398. const requestOptions = {
  3399. url,
  3400. headers: applyAcceptHeader(link, headers)
  3401. }
  3402. const promise = octokit.request(requestOptions)
  3403. return promise
  3404. }
  3405. function applyAcceptHeader (res, headers) {
  3406. const previous = res.headers && res.headers['x-github-media-type']
  3407. if (!previous || (headers && headers.accept)) {
  3408. return headers
  3409. }
  3410. headers = headers || {}
  3411. headers.accept = 'application/vnd.' + previous
  3412. .replace('; param=', '.')
  3413. .replace('; format=', '+')
  3414. return headers
  3415. }
  3416. /***/ }),
  3417. /***/ 280:
  3418. /***/ (function(module, exports) {
  3419. exports = module.exports = SemVer
  3420. var debug
  3421. /* istanbul ignore next */
  3422. if (typeof process === 'object' &&
  3423. process.env &&
  3424. process.env.NODE_DEBUG &&
  3425. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3426. debug = function () {
  3427. var args = Array.prototype.slice.call(arguments, 0)
  3428. args.unshift('SEMVER')
  3429. console.log.apply(console, args)
  3430. }
  3431. } else {
  3432. debug = function () {}
  3433. }
  3434. // Note: this is the semver.org version of the spec that it implements
  3435. // Not necessarily the package version of this code.
  3436. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3437. var MAX_LENGTH = 256
  3438. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3439. /* istanbul ignore next */ 9007199254740991
  3440. // Max safe segment length for coercion.
  3441. var MAX_SAFE_COMPONENT_LENGTH = 16
  3442. // The actual regexps go on exports.re
  3443. var re = exports.re = []
  3444. var src = exports.src = []
  3445. var R = 0
  3446. // The following Regular Expressions can be used for tokenizing,
  3447. // validating, and parsing SemVer version strings.
  3448. // ## Numeric Identifier
  3449. // A single `0`, or a non-zero digit followed by zero or more digits.
  3450. var NUMERICIDENTIFIER = R++
  3451. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3452. var NUMERICIDENTIFIERLOOSE = R++
  3453. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3454. // ## Non-numeric Identifier
  3455. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3456. // more letters, digits, or hyphens.
  3457. var NONNUMERICIDENTIFIER = R++
  3458. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3459. // ## Main Version
  3460. // Three dot-separated numeric identifiers.
  3461. var MAINVERSION = R++
  3462. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3463. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3464. '(' + src[NUMERICIDENTIFIER] + ')'
  3465. var MAINVERSIONLOOSE = R++
  3466. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3467. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3468. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3469. // ## Pre-release Version Identifier
  3470. // A numeric identifier, or a non-numeric identifier.
  3471. var PRERELEASEIDENTIFIER = R++
  3472. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3473. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3474. var PRERELEASEIDENTIFIERLOOSE = R++
  3475. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3476. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3477. // ## Pre-release Version
  3478. // Hyphen, followed by one or more dot-separated pre-release version
  3479. // identifiers.
  3480. var PRERELEASE = R++
  3481. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3482. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3483. var PRERELEASELOOSE = R++
  3484. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3485. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3486. // ## Build Metadata Identifier
  3487. // Any combination of digits, letters, or hyphens.
  3488. var BUILDIDENTIFIER = R++
  3489. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3490. // ## Build Metadata
  3491. // Plus sign, followed by one or more period-separated build metadata
  3492. // identifiers.
  3493. var BUILD = R++
  3494. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3495. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3496. // ## Full Version String
  3497. // A main version, followed optionally by a pre-release version and
  3498. // build metadata.
  3499. // Note that the only major, minor, patch, and pre-release sections of
  3500. // the version string are capturing groups. The build metadata is not a
  3501. // capturing group, because it should not ever be used in version
  3502. // comparison.
  3503. var FULL = R++
  3504. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3505. src[PRERELEASE] + '?' +
  3506. src[BUILD] + '?'
  3507. src[FULL] = '^' + FULLPLAIN + '$'
  3508. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3509. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3510. // common in the npm registry.
  3511. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3512. src[PRERELEASELOOSE] + '?' +
  3513. src[BUILD] + '?'
  3514. var LOOSE = R++
  3515. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3516. var GTLT = R++
  3517. src[GTLT] = '((?:<|>)?=?)'
  3518. // Something like "2.*" or "1.2.x".
  3519. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3520. // Only the first item is strictly required.
  3521. var XRANGEIDENTIFIERLOOSE = R++
  3522. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3523. var XRANGEIDENTIFIER = R++
  3524. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3525. var XRANGEPLAIN = R++
  3526. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3527. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3528. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3529. '(?:' + src[PRERELEASE] + ')?' +
  3530. src[BUILD] + '?' +
  3531. ')?)?'
  3532. var XRANGEPLAINLOOSE = R++
  3533. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3534. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3535. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3536. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3537. src[BUILD] + '?' +
  3538. ')?)?'
  3539. var XRANGE = R++
  3540. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3541. var XRANGELOOSE = R++
  3542. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3543. // Coercion.
  3544. // Extract anything that could conceivably be a part of a valid semver
  3545. var COERCE = R++
  3546. src[COERCE] = '(?:^|[^\\d])' +
  3547. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3548. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3549. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3550. '(?:$|[^\\d])'
  3551. // Tilde ranges.
  3552. // Meaning is "reasonably at or greater than"
  3553. var LONETILDE = R++
  3554. src[LONETILDE] = '(?:~>?)'
  3555. var TILDETRIM = R++
  3556. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3557. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3558. var tildeTrimReplace = '$1~'
  3559. var TILDE = R++
  3560. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3561. var TILDELOOSE = R++
  3562. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3563. // Caret ranges.
  3564. // Meaning is "at least and backwards compatible with"
  3565. var LONECARET = R++
  3566. src[LONECARET] = '(?:\\^)'
  3567. var CARETTRIM = R++
  3568. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3569. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3570. var caretTrimReplace = '$1^'
  3571. var CARET = R++
  3572. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3573. var CARETLOOSE = R++
  3574. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3575. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3576. var COMPARATORLOOSE = R++
  3577. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3578. var COMPARATOR = R++
  3579. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3580. // An expression to strip any whitespace between the gtlt and the thing
  3581. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3582. var COMPARATORTRIM = R++
  3583. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3584. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3585. // this one has to use the /g flag
  3586. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3587. var comparatorTrimReplace = '$1$2$3'
  3588. // Something like `1.2.3 - 1.2.4`
  3589. // Note that these all use the loose form, because they'll be
  3590. // checked against either the strict or loose comparator form
  3591. // later.
  3592. var HYPHENRANGE = R++
  3593. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3594. '\\s+-\\s+' +
  3595. '(' + src[XRANGEPLAIN] + ')' +
  3596. '\\s*$'
  3597. var HYPHENRANGELOOSE = R++
  3598. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3599. '\\s+-\\s+' +
  3600. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3601. '\\s*$'
  3602. // Star ranges basically just allow anything at all.
  3603. var STAR = R++
  3604. src[STAR] = '(<|>)?=?\\s*\\*'
  3605. // Compile to actual regexp objects.
  3606. // All are flag-free, unless they were created above with a flag.
  3607. for (var i = 0; i < R; i++) {
  3608. debug(i, src[i])
  3609. if (!re[i]) {
  3610. re[i] = new RegExp(src[i])
  3611. }
  3612. }
  3613. exports.parse = parse
  3614. function parse (version, options) {
  3615. if (!options || typeof options !== 'object') {
  3616. options = {
  3617. loose: !!options,
  3618. includePrerelease: false
  3619. }
  3620. }
  3621. if (version instanceof SemVer) {
  3622. return version
  3623. }
  3624. if (typeof version !== 'string') {
  3625. return null
  3626. }
  3627. if (version.length > MAX_LENGTH) {
  3628. return null
  3629. }
  3630. var r = options.loose ? re[LOOSE] : re[FULL]
  3631. if (!r.test(version)) {
  3632. return null
  3633. }
  3634. try {
  3635. return new SemVer(version, options)
  3636. } catch (er) {
  3637. return null
  3638. }
  3639. }
  3640. exports.valid = valid
  3641. function valid (version, options) {
  3642. var v = parse(version, options)
  3643. return v ? v.version : null
  3644. }
  3645. exports.clean = clean
  3646. function clean (version, options) {
  3647. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3648. return s ? s.version : null
  3649. }
  3650. exports.SemVer = SemVer
  3651. function SemVer (version, options) {
  3652. if (!options || typeof options !== 'object') {
  3653. options = {
  3654. loose: !!options,
  3655. includePrerelease: false
  3656. }
  3657. }
  3658. if (version instanceof SemVer) {
  3659. if (version.loose === options.loose) {
  3660. return version
  3661. } else {
  3662. version = version.version
  3663. }
  3664. } else if (typeof version !== 'string') {
  3665. throw new TypeError('Invalid Version: ' + version)
  3666. }
  3667. if (version.length > MAX_LENGTH) {
  3668. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3669. }
  3670. if (!(this instanceof SemVer)) {
  3671. return new SemVer(version, options)
  3672. }
  3673. debug('SemVer', version, options)
  3674. this.options = options
  3675. this.loose = !!options.loose
  3676. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3677. if (!m) {
  3678. throw new TypeError('Invalid Version: ' + version)
  3679. }
  3680. this.raw = version
  3681. // these are actually numbers
  3682. this.major = +m[1]
  3683. this.minor = +m[2]
  3684. this.patch = +m[3]
  3685. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3686. throw new TypeError('Invalid major version')
  3687. }
  3688. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3689. throw new TypeError('Invalid minor version')
  3690. }
  3691. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3692. throw new TypeError('Invalid patch version')
  3693. }
  3694. // numberify any prerelease numeric ids
  3695. if (!m[4]) {
  3696. this.prerelease = []
  3697. } else {
  3698. this.prerelease = m[4].split('.').map(function (id) {
  3699. if (/^[0-9]+$/.test(id)) {
  3700. var num = +id
  3701. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3702. return num
  3703. }
  3704. }
  3705. return id
  3706. })
  3707. }
  3708. this.build = m[5] ? m[5].split('.') : []
  3709. this.format()
  3710. }
  3711. SemVer.prototype.format = function () {
  3712. this.version = this.major + '.' + this.minor + '.' + this.patch
  3713. if (this.prerelease.length) {
  3714. this.version += '-' + this.prerelease.join('.')
  3715. }
  3716. return this.version
  3717. }
  3718. SemVer.prototype.toString = function () {
  3719. return this.version
  3720. }
  3721. SemVer.prototype.compare = function (other) {
  3722. debug('SemVer.compare', this.version, this.options, other)
  3723. if (!(other instanceof SemVer)) {
  3724. other = new SemVer(other, this.options)
  3725. }
  3726. return this.compareMain(other) || this.comparePre(other)
  3727. }
  3728. SemVer.prototype.compareMain = function (other) {
  3729. if (!(other instanceof SemVer)) {
  3730. other = new SemVer(other, this.options)
  3731. }
  3732. return compareIdentifiers(this.major, other.major) ||
  3733. compareIdentifiers(this.minor, other.minor) ||
  3734. compareIdentifiers(this.patch, other.patch)
  3735. }
  3736. SemVer.prototype.comparePre = function (other) {
  3737. if (!(other instanceof SemVer)) {
  3738. other = new SemVer(other, this.options)
  3739. }
  3740. // NOT having a prerelease is > having one
  3741. if (this.prerelease.length && !other.prerelease.length) {
  3742. return -1
  3743. } else if (!this.prerelease.length && other.prerelease.length) {
  3744. return 1
  3745. } else if (!this.prerelease.length && !other.prerelease.length) {
  3746. return 0
  3747. }
  3748. var i = 0
  3749. do {
  3750. var a = this.prerelease[i]
  3751. var b = other.prerelease[i]
  3752. debug('prerelease compare', i, a, b)
  3753. if (a === undefined && b === undefined) {
  3754. return 0
  3755. } else if (b === undefined) {
  3756. return 1
  3757. } else if (a === undefined) {
  3758. return -1
  3759. } else if (a === b) {
  3760. continue
  3761. } else {
  3762. return compareIdentifiers(a, b)
  3763. }
  3764. } while (++i)
  3765. }
  3766. // preminor will bump the version up to the next minor release, and immediately
  3767. // down to pre-release. premajor and prepatch work the same way.
  3768. SemVer.prototype.inc = function (release, identifier) {
  3769. switch (release) {
  3770. case 'premajor':
  3771. this.prerelease.length = 0
  3772. this.patch = 0
  3773. this.minor = 0
  3774. this.major++
  3775. this.inc('pre', identifier)
  3776. break
  3777. case 'preminor':
  3778. this.prerelease.length = 0
  3779. this.patch = 0
  3780. this.minor++
  3781. this.inc('pre', identifier)
  3782. break
  3783. case 'prepatch':
  3784. // If this is already a prerelease, it will bump to the next version
  3785. // drop any prereleases that might already exist, since they are not
  3786. // relevant at this point.
  3787. this.prerelease.length = 0
  3788. this.inc('patch', identifier)
  3789. this.inc('pre', identifier)
  3790. break
  3791. // If the input is a non-prerelease version, this acts the same as
  3792. // prepatch.
  3793. case 'prerelease':
  3794. if (this.prerelease.length === 0) {
  3795. this.inc('patch', identifier)
  3796. }
  3797. this.inc('pre', identifier)
  3798. break
  3799. case 'major':
  3800. // If this is a pre-major version, bump up to the same major version.
  3801. // Otherwise increment major.
  3802. // 1.0.0-5 bumps to 1.0.0
  3803. // 1.1.0 bumps to 2.0.0
  3804. if (this.minor !== 0 ||
  3805. this.patch !== 0 ||
  3806. this.prerelease.length === 0) {
  3807. this.major++
  3808. }
  3809. this.minor = 0
  3810. this.patch = 0
  3811. this.prerelease = []
  3812. break
  3813. case 'minor':
  3814. // If this is a pre-minor version, bump up to the same minor version.
  3815. // Otherwise increment minor.
  3816. // 1.2.0-5 bumps to 1.2.0
  3817. // 1.2.1 bumps to 1.3.0
  3818. if (this.patch !== 0 || this.prerelease.length === 0) {
  3819. this.minor++
  3820. }
  3821. this.patch = 0
  3822. this.prerelease = []
  3823. break
  3824. case 'patch':
  3825. // If this is not a pre-release version, it will increment the patch.
  3826. // If it is a pre-release it will bump up to the same patch version.
  3827. // 1.2.0-5 patches to 1.2.0
  3828. // 1.2.0 patches to 1.2.1
  3829. if (this.prerelease.length === 0) {
  3830. this.patch++
  3831. }
  3832. this.prerelease = []
  3833. break
  3834. // This probably shouldn't be used publicly.
  3835. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3836. case 'pre':
  3837. if (this.prerelease.length === 0) {
  3838. this.prerelease = [0]
  3839. } else {
  3840. var i = this.prerelease.length
  3841. while (--i >= 0) {
  3842. if (typeof this.prerelease[i] === 'number') {
  3843. this.prerelease[i]++
  3844. i = -2
  3845. }
  3846. }
  3847. if (i === -1) {
  3848. // didn't increment anything
  3849. this.prerelease.push(0)
  3850. }
  3851. }
  3852. if (identifier) {
  3853. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3854. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3855. if (this.prerelease[0] === identifier) {
  3856. if (isNaN(this.prerelease[1])) {
  3857. this.prerelease = [identifier, 0]
  3858. }
  3859. } else {
  3860. this.prerelease = [identifier, 0]
  3861. }
  3862. }
  3863. break
  3864. default:
  3865. throw new Error('invalid increment argument: ' + release)
  3866. }
  3867. this.format()
  3868. this.raw = this.version
  3869. return this
  3870. }
  3871. exports.inc = inc
  3872. function inc (version, release, loose, identifier) {
  3873. if (typeof (loose) === 'string') {
  3874. identifier = loose
  3875. loose = undefined
  3876. }
  3877. try {
  3878. return new SemVer(version, loose).inc(release, identifier).version
  3879. } catch (er) {
  3880. return null
  3881. }
  3882. }
  3883. exports.diff = diff
  3884. function diff (version1, version2) {
  3885. if (eq(version1, version2)) {
  3886. return null
  3887. } else {
  3888. var v1 = parse(version1)
  3889. var v2 = parse(version2)
  3890. var prefix = ''
  3891. if (v1.prerelease.length || v2.prerelease.length) {
  3892. prefix = 'pre'
  3893. var defaultResult = 'prerelease'
  3894. }
  3895. for (var key in v1) {
  3896. if (key === 'major' || key === 'minor' || key === 'patch') {
  3897. if (v1[key] !== v2[key]) {
  3898. return prefix + key
  3899. }
  3900. }
  3901. }
  3902. return defaultResult // may be undefined
  3903. }
  3904. }
  3905. exports.compareIdentifiers = compareIdentifiers
  3906. var numeric = /^[0-9]+$/
  3907. function compareIdentifiers (a, b) {
  3908. var anum = numeric.test(a)
  3909. var bnum = numeric.test(b)
  3910. if (anum && bnum) {
  3911. a = +a
  3912. b = +b
  3913. }
  3914. return a === b ? 0
  3915. : (anum && !bnum) ? -1
  3916. : (bnum && !anum) ? 1
  3917. : a < b ? -1
  3918. : 1
  3919. }
  3920. exports.rcompareIdentifiers = rcompareIdentifiers
  3921. function rcompareIdentifiers (a, b) {
  3922. return compareIdentifiers(b, a)
  3923. }
  3924. exports.major = major
  3925. function major (a, loose) {
  3926. return new SemVer(a, loose).major
  3927. }
  3928. exports.minor = minor
  3929. function minor (a, loose) {
  3930. return new SemVer(a, loose).minor
  3931. }
  3932. exports.patch = patch
  3933. function patch (a, loose) {
  3934. return new SemVer(a, loose).patch
  3935. }
  3936. exports.compare = compare
  3937. function compare (a, b, loose) {
  3938. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3939. }
  3940. exports.compareLoose = compareLoose
  3941. function compareLoose (a, b) {
  3942. return compare(a, b, true)
  3943. }
  3944. exports.rcompare = rcompare
  3945. function rcompare (a, b, loose) {
  3946. return compare(b, a, loose)
  3947. }
  3948. exports.sort = sort
  3949. function sort (list, loose) {
  3950. return list.sort(function (a, b) {
  3951. return exports.compare(a, b, loose)
  3952. })
  3953. }
  3954. exports.rsort = rsort
  3955. function rsort (list, loose) {
  3956. return list.sort(function (a, b) {
  3957. return exports.rcompare(a, b, loose)
  3958. })
  3959. }
  3960. exports.gt = gt
  3961. function gt (a, b, loose) {
  3962. return compare(a, b, loose) > 0
  3963. }
  3964. exports.lt = lt
  3965. function lt (a, b, loose) {
  3966. return compare(a, b, loose) < 0
  3967. }
  3968. exports.eq = eq
  3969. function eq (a, b, loose) {
  3970. return compare(a, b, loose) === 0
  3971. }
  3972. exports.neq = neq
  3973. function neq (a, b, loose) {
  3974. return compare(a, b, loose) !== 0
  3975. }
  3976. exports.gte = gte
  3977. function gte (a, b, loose) {
  3978. return compare(a, b, loose) >= 0
  3979. }
  3980. exports.lte = lte
  3981. function lte (a, b, loose) {
  3982. return compare(a, b, loose) <= 0
  3983. }
  3984. exports.cmp = cmp
  3985. function cmp (a, op, b, loose) {
  3986. switch (op) {
  3987. case '===':
  3988. if (typeof a === 'object')
  3989. a = a.version
  3990. if (typeof b === 'object')
  3991. b = b.version
  3992. return a === b
  3993. case '!==':
  3994. if (typeof a === 'object')
  3995. a = a.version
  3996. if (typeof b === 'object')
  3997. b = b.version
  3998. return a !== b
  3999. case '':
  4000. case '=':
  4001. case '==':
  4002. return eq(a, b, loose)
  4003. case '!=':
  4004. return neq(a, b, loose)
  4005. case '>':
  4006. return gt(a, b, loose)
  4007. case '>=':
  4008. return gte(a, b, loose)
  4009. case '<':
  4010. return lt(a, b, loose)
  4011. case '<=':
  4012. return lte(a, b, loose)
  4013. default:
  4014. throw new TypeError('Invalid operator: ' + op)
  4015. }
  4016. }
  4017. exports.Comparator = Comparator
  4018. function Comparator (comp, options) {
  4019. if (!options || typeof options !== 'object') {
  4020. options = {
  4021. loose: !!options,
  4022. includePrerelease: false
  4023. }
  4024. }
  4025. if (comp instanceof Comparator) {
  4026. if (comp.loose === !!options.loose) {
  4027. return comp
  4028. } else {
  4029. comp = comp.value
  4030. }
  4031. }
  4032. if (!(this instanceof Comparator)) {
  4033. return new Comparator(comp, options)
  4034. }
  4035. debug('comparator', comp, options)
  4036. this.options = options
  4037. this.loose = !!options.loose
  4038. this.parse(comp)
  4039. if (this.semver === ANY) {
  4040. this.value = ''
  4041. } else {
  4042. this.value = this.operator + this.semver.version
  4043. }
  4044. debug('comp', this)
  4045. }
  4046. var ANY = {}
  4047. Comparator.prototype.parse = function (comp) {
  4048. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4049. var m = comp.match(r)
  4050. if (!m) {
  4051. throw new TypeError('Invalid comparator: ' + comp)
  4052. }
  4053. this.operator = m[1]
  4054. if (this.operator === '=') {
  4055. this.operator = ''
  4056. }
  4057. // if it literally is just '>' or '' then allow anything.
  4058. if (!m[2]) {
  4059. this.semver = ANY
  4060. } else {
  4061. this.semver = new SemVer(m[2], this.options.loose)
  4062. }
  4063. }
  4064. Comparator.prototype.toString = function () {
  4065. return this.value
  4066. }
  4067. Comparator.prototype.test = function (version) {
  4068. debug('Comparator.test', version, this.options.loose)
  4069. if (this.semver === ANY) {
  4070. return true
  4071. }
  4072. if (typeof version === 'string') {
  4073. version = new SemVer(version, this.options)
  4074. }
  4075. return cmp(version, this.operator, this.semver, this.options)
  4076. }
  4077. Comparator.prototype.intersects = function (comp, options) {
  4078. if (!(comp instanceof Comparator)) {
  4079. throw new TypeError('a Comparator is required')
  4080. }
  4081. if (!options || typeof options !== 'object') {
  4082. options = {
  4083. loose: !!options,
  4084. includePrerelease: false
  4085. }
  4086. }
  4087. var rangeTmp
  4088. if (this.operator === '') {
  4089. rangeTmp = new Range(comp.value, options)
  4090. return satisfies(this.value, rangeTmp, options)
  4091. } else if (comp.operator === '') {
  4092. rangeTmp = new Range(this.value, options)
  4093. return satisfies(comp.semver, rangeTmp, options)
  4094. }
  4095. var sameDirectionIncreasing =
  4096. (this.operator === '>=' || this.operator === '>') &&
  4097. (comp.operator === '>=' || comp.operator === '>')
  4098. var sameDirectionDecreasing =
  4099. (this.operator === '<=' || this.operator === '<') &&
  4100. (comp.operator === '<=' || comp.operator === '<')
  4101. var sameSemVer = this.semver.version === comp.semver.version
  4102. var differentDirectionsInclusive =
  4103. (this.operator === '>=' || this.operator === '<=') &&
  4104. (comp.operator === '>=' || comp.operator === '<=')
  4105. var oppositeDirectionsLessThan =
  4106. cmp(this.semver, '<', comp.semver, options) &&
  4107. ((this.operator === '>=' || this.operator === '>') &&
  4108. (comp.operator === '<=' || comp.operator === '<'))
  4109. var oppositeDirectionsGreaterThan =
  4110. cmp(this.semver, '>', comp.semver, options) &&
  4111. ((this.operator === '<=' || this.operator === '<') &&
  4112. (comp.operator === '>=' || comp.operator === '>'))
  4113. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4114. (sameSemVer && differentDirectionsInclusive) ||
  4115. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4116. }
  4117. exports.Range = Range
  4118. function Range (range, options) {
  4119. if (!options || typeof options !== 'object') {
  4120. options = {
  4121. loose: !!options,
  4122. includePrerelease: false
  4123. }
  4124. }
  4125. if (range instanceof Range) {
  4126. if (range.loose === !!options.loose &&
  4127. range.includePrerelease === !!options.includePrerelease) {
  4128. return range
  4129. } else {
  4130. return new Range(range.raw, options)
  4131. }
  4132. }
  4133. if (range instanceof Comparator) {
  4134. return new Range(range.value, options)
  4135. }
  4136. if (!(this instanceof Range)) {
  4137. return new Range(range, options)
  4138. }
  4139. this.options = options
  4140. this.loose = !!options.loose
  4141. this.includePrerelease = !!options.includePrerelease
  4142. // First, split based on boolean or ||
  4143. this.raw = range
  4144. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4145. return this.parseRange(range.trim())
  4146. }, this).filter(function (c) {
  4147. // throw out any that are not relevant for whatever reason
  4148. return c.length
  4149. })
  4150. if (!this.set.length) {
  4151. throw new TypeError('Invalid SemVer Range: ' + range)
  4152. }
  4153. this.format()
  4154. }
  4155. Range.prototype.format = function () {
  4156. this.range = this.set.map(function (comps) {
  4157. return comps.join(' ').trim()
  4158. }).join('||').trim()
  4159. return this.range
  4160. }
  4161. Range.prototype.toString = function () {
  4162. return this.range
  4163. }
  4164. Range.prototype.parseRange = function (range) {
  4165. var loose = this.options.loose
  4166. range = range.trim()
  4167. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4168. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4169. range = range.replace(hr, hyphenReplace)
  4170. debug('hyphen replace', range)
  4171. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4172. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4173. debug('comparator trim', range, re[COMPARATORTRIM])
  4174. // `~ 1.2.3` => `~1.2.3`
  4175. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4176. // `^ 1.2.3` => `^1.2.3`
  4177. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4178. // normalize spaces
  4179. range = range.split(/\s+/).join(' ')
  4180. // At this point, the range is completely trimmed and
  4181. // ready to be split into comparators.
  4182. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4183. var set = range.split(' ').map(function (comp) {
  4184. return parseComparator(comp, this.options)
  4185. }, this).join(' ').split(/\s+/)
  4186. if (this.options.loose) {
  4187. // in loose mode, throw out any that are not valid comparators
  4188. set = set.filter(function (comp) {
  4189. return !!comp.match(compRe)
  4190. })
  4191. }
  4192. set = set.map(function (comp) {
  4193. return new Comparator(comp, this.options)
  4194. }, this)
  4195. return set
  4196. }
  4197. Range.prototype.intersects = function (range, options) {
  4198. if (!(range instanceof Range)) {
  4199. throw new TypeError('a Range is required')
  4200. }
  4201. return this.set.some(function (thisComparators) {
  4202. return thisComparators.every(function (thisComparator) {
  4203. return range.set.some(function (rangeComparators) {
  4204. return rangeComparators.every(function (rangeComparator) {
  4205. return thisComparator.intersects(rangeComparator, options)
  4206. })
  4207. })
  4208. })
  4209. })
  4210. }
  4211. // Mostly just for testing and legacy API reasons
  4212. exports.toComparators = toComparators
  4213. function toComparators (range, options) {
  4214. return new Range(range, options).set.map(function (comp) {
  4215. return comp.map(function (c) {
  4216. return c.value
  4217. }).join(' ').trim().split(' ')
  4218. })
  4219. }
  4220. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4221. // already replaced the hyphen ranges
  4222. // turn into a set of JUST comparators.
  4223. function parseComparator (comp, options) {
  4224. debug('comp', comp, options)
  4225. comp = replaceCarets(comp, options)
  4226. debug('caret', comp)
  4227. comp = replaceTildes(comp, options)
  4228. debug('tildes', comp)
  4229. comp = replaceXRanges(comp, options)
  4230. debug('xrange', comp)
  4231. comp = replaceStars(comp, options)
  4232. debug('stars', comp)
  4233. return comp
  4234. }
  4235. function isX (id) {
  4236. return !id || id.toLowerCase() === 'x' || id === '*'
  4237. }
  4238. // ~, ~> --> * (any, kinda silly)
  4239. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4240. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4241. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4242. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4243. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4244. function replaceTildes (comp, options) {
  4245. return comp.trim().split(/\s+/).map(function (comp) {
  4246. return replaceTilde(comp, options)
  4247. }).join(' ')
  4248. }
  4249. function replaceTilde (comp, options) {
  4250. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4251. return comp.replace(r, function (_, M, m, p, pr) {
  4252. debug('tilde', comp, _, M, m, p, pr)
  4253. var ret
  4254. if (isX(M)) {
  4255. ret = ''
  4256. } else if (isX(m)) {
  4257. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4258. } else if (isX(p)) {
  4259. // ~1.2 == >=1.2.0 <1.3.0
  4260. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4261. } else if (pr) {
  4262. debug('replaceTilde pr', pr)
  4263. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4264. ' <' + M + '.' + (+m + 1) + '.0'
  4265. } else {
  4266. // ~1.2.3 == >=1.2.3 <1.3.0
  4267. ret = '>=' + M + '.' + m + '.' + p +
  4268. ' <' + M + '.' + (+m + 1) + '.0'
  4269. }
  4270. debug('tilde return', ret)
  4271. return ret
  4272. })
  4273. }
  4274. // ^ --> * (any, kinda silly)
  4275. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4276. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4277. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4278. // ^1.2.3 --> >=1.2.3 <2.0.0
  4279. // ^1.2.0 --> >=1.2.0 <2.0.0
  4280. function replaceCarets (comp, options) {
  4281. return comp.trim().split(/\s+/).map(function (comp) {
  4282. return replaceCaret(comp, options)
  4283. }).join(' ')
  4284. }
  4285. function replaceCaret (comp, options) {
  4286. debug('caret', comp, options)
  4287. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4288. return comp.replace(r, function (_, M, m, p, pr) {
  4289. debug('caret', comp, _, M, m, p, pr)
  4290. var ret
  4291. if (isX(M)) {
  4292. ret = ''
  4293. } else if (isX(m)) {
  4294. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4295. } else if (isX(p)) {
  4296. if (M === '0') {
  4297. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4298. } else {
  4299. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4300. }
  4301. } else if (pr) {
  4302. debug('replaceCaret pr', pr)
  4303. if (M === '0') {
  4304. if (m === '0') {
  4305. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4306. ' <' + M + '.' + m + '.' + (+p + 1)
  4307. } else {
  4308. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4309. ' <' + M + '.' + (+m + 1) + '.0'
  4310. }
  4311. } else {
  4312. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4313. ' <' + (+M + 1) + '.0.0'
  4314. }
  4315. } else {
  4316. debug('no pr')
  4317. if (M === '0') {
  4318. if (m === '0') {
  4319. ret = '>=' + M + '.' + m + '.' + p +
  4320. ' <' + M + '.' + m + '.' + (+p + 1)
  4321. } else {
  4322. ret = '>=' + M + '.' + m + '.' + p +
  4323. ' <' + M + '.' + (+m + 1) + '.0'
  4324. }
  4325. } else {
  4326. ret = '>=' + M + '.' + m + '.' + p +
  4327. ' <' + (+M + 1) + '.0.0'
  4328. }
  4329. }
  4330. debug('caret return', ret)
  4331. return ret
  4332. })
  4333. }
  4334. function replaceXRanges (comp, options) {
  4335. debug('replaceXRanges', comp, options)
  4336. return comp.split(/\s+/).map(function (comp) {
  4337. return replaceXRange(comp, options)
  4338. }).join(' ')
  4339. }
  4340. function replaceXRange (comp, options) {
  4341. comp = comp.trim()
  4342. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4343. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4344. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4345. var xM = isX(M)
  4346. var xm = xM || isX(m)
  4347. var xp = xm || isX(p)
  4348. var anyX = xp
  4349. if (gtlt === '=' && anyX) {
  4350. gtlt = ''
  4351. }
  4352. if (xM) {
  4353. if (gtlt === '>' || gtlt === '<') {
  4354. // nothing is allowed
  4355. ret = '<0.0.0'
  4356. } else {
  4357. // nothing is forbidden
  4358. ret = '*'
  4359. }
  4360. } else if (gtlt && anyX) {
  4361. // we know patch is an x, because we have any x at all.
  4362. // replace X with 0
  4363. if (xm) {
  4364. m = 0
  4365. }
  4366. p = 0
  4367. if (gtlt === '>') {
  4368. // >1 => >=2.0.0
  4369. // >1.2 => >=1.3.0
  4370. // >1.2.3 => >= 1.2.4
  4371. gtlt = '>='
  4372. if (xm) {
  4373. M = +M + 1
  4374. m = 0
  4375. p = 0
  4376. } else {
  4377. m = +m + 1
  4378. p = 0
  4379. }
  4380. } else if (gtlt === '<=') {
  4381. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4382. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4383. gtlt = '<'
  4384. if (xm) {
  4385. M = +M + 1
  4386. } else {
  4387. m = +m + 1
  4388. }
  4389. }
  4390. ret = gtlt + M + '.' + m + '.' + p
  4391. } else if (xm) {
  4392. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4393. } else if (xp) {
  4394. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4395. }
  4396. debug('xRange return', ret)
  4397. return ret
  4398. })
  4399. }
  4400. // Because * is AND-ed with everything else in the comparator,
  4401. // and '' means "any version", just remove the *s entirely.
  4402. function replaceStars (comp, options) {
  4403. debug('replaceStars', comp, options)
  4404. // Looseness is ignored here. star is always as loose as it gets!
  4405. return comp.trim().replace(re[STAR], '')
  4406. }
  4407. // This function is passed to string.replace(re[HYPHENRANGE])
  4408. // M, m, patch, prerelease, build
  4409. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4410. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4411. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4412. function hyphenReplace ($0,
  4413. from, fM, fm, fp, fpr, fb,
  4414. to, tM, tm, tp, tpr, tb) {
  4415. if (isX(fM)) {
  4416. from = ''
  4417. } else if (isX(fm)) {
  4418. from = '>=' + fM + '.0.0'
  4419. } else if (isX(fp)) {
  4420. from = '>=' + fM + '.' + fm + '.0'
  4421. } else {
  4422. from = '>=' + from
  4423. }
  4424. if (isX(tM)) {
  4425. to = ''
  4426. } else if (isX(tm)) {
  4427. to = '<' + (+tM + 1) + '.0.0'
  4428. } else if (isX(tp)) {
  4429. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4430. } else if (tpr) {
  4431. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4432. } else {
  4433. to = '<=' + to
  4434. }
  4435. return (from + ' ' + to).trim()
  4436. }
  4437. // if ANY of the sets match ALL of its comparators, then pass
  4438. Range.prototype.test = function (version) {
  4439. if (!version) {
  4440. return false
  4441. }
  4442. if (typeof version === 'string') {
  4443. version = new SemVer(version, this.options)
  4444. }
  4445. for (var i = 0; i < this.set.length; i++) {
  4446. if (testSet(this.set[i], version, this.options)) {
  4447. return true
  4448. }
  4449. }
  4450. return false
  4451. }
  4452. function testSet (set, version, options) {
  4453. for (var i = 0; i < set.length; i++) {
  4454. if (!set[i].test(version)) {
  4455. return false
  4456. }
  4457. }
  4458. if (version.prerelease.length && !options.includePrerelease) {
  4459. // Find the set of versions that are allowed to have prereleases
  4460. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4461. // That should allow `1.2.3-pr.2` to pass.
  4462. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4463. // even though it's within the range set by the comparators.
  4464. for (i = 0; i < set.length; i++) {
  4465. debug(set[i].semver)
  4466. if (set[i].semver === ANY) {
  4467. continue
  4468. }
  4469. if (set[i].semver.prerelease.length > 0) {
  4470. var allowed = set[i].semver
  4471. if (allowed.major === version.major &&
  4472. allowed.minor === version.minor &&
  4473. allowed.patch === version.patch) {
  4474. return true
  4475. }
  4476. }
  4477. }
  4478. // Version has a -pre, but it's not one of the ones we like.
  4479. return false
  4480. }
  4481. return true
  4482. }
  4483. exports.satisfies = satisfies
  4484. function satisfies (version, range, options) {
  4485. try {
  4486. range = new Range(range, options)
  4487. } catch (er) {
  4488. return false
  4489. }
  4490. return range.test(version)
  4491. }
  4492. exports.maxSatisfying = maxSatisfying
  4493. function maxSatisfying (versions, range, options) {
  4494. var max = null
  4495. var maxSV = null
  4496. try {
  4497. var rangeObj = new Range(range, options)
  4498. } catch (er) {
  4499. return null
  4500. }
  4501. versions.forEach(function (v) {
  4502. if (rangeObj.test(v)) {
  4503. // satisfies(v, range, options)
  4504. if (!max || maxSV.compare(v) === -1) {
  4505. // compare(max, v, true)
  4506. max = v
  4507. maxSV = new SemVer(max, options)
  4508. }
  4509. }
  4510. })
  4511. return max
  4512. }
  4513. exports.minSatisfying = minSatisfying
  4514. function minSatisfying (versions, range, options) {
  4515. var min = null
  4516. var minSV = null
  4517. try {
  4518. var rangeObj = new Range(range, options)
  4519. } catch (er) {
  4520. return null
  4521. }
  4522. versions.forEach(function (v) {
  4523. if (rangeObj.test(v)) {
  4524. // satisfies(v, range, options)
  4525. if (!min || minSV.compare(v) === 1) {
  4526. // compare(min, v, true)
  4527. min = v
  4528. minSV = new SemVer(min, options)
  4529. }
  4530. }
  4531. })
  4532. return min
  4533. }
  4534. exports.minVersion = minVersion
  4535. function minVersion (range, loose) {
  4536. range = new Range(range, loose)
  4537. var minver = new SemVer('0.0.0')
  4538. if (range.test(minver)) {
  4539. return minver
  4540. }
  4541. minver = new SemVer('0.0.0-0')
  4542. if (range.test(minver)) {
  4543. return minver
  4544. }
  4545. minver = null
  4546. for (var i = 0; i < range.set.length; ++i) {
  4547. var comparators = range.set[i]
  4548. comparators.forEach(function (comparator) {
  4549. // Clone to avoid manipulating the comparator's semver object.
  4550. var compver = new SemVer(comparator.semver.version)
  4551. switch (comparator.operator) {
  4552. case '>':
  4553. if (compver.prerelease.length === 0) {
  4554. compver.patch++
  4555. } else {
  4556. compver.prerelease.push(0)
  4557. }
  4558. compver.raw = compver.format()
  4559. /* fallthrough */
  4560. case '':
  4561. case '>=':
  4562. if (!minver || gt(minver, compver)) {
  4563. minver = compver
  4564. }
  4565. break
  4566. case '<':
  4567. case '<=':
  4568. /* Ignore maximum versions */
  4569. break
  4570. /* istanbul ignore next */
  4571. default:
  4572. throw new Error('Unexpected operation: ' + comparator.operator)
  4573. }
  4574. })
  4575. }
  4576. if (minver && range.test(minver)) {
  4577. return minver
  4578. }
  4579. return null
  4580. }
  4581. exports.validRange = validRange
  4582. function validRange (range, options) {
  4583. try {
  4584. // Return '*' instead of '' so that truthiness works.
  4585. // This will throw if it's invalid anyway
  4586. return new Range(range, options).range || '*'
  4587. } catch (er) {
  4588. return null
  4589. }
  4590. }
  4591. // Determine if version is less than all the versions possible in the range
  4592. exports.ltr = ltr
  4593. function ltr (version, range, options) {
  4594. return outside(version, range, '<', options)
  4595. }
  4596. // Determine if version is greater than all the versions possible in the range.
  4597. exports.gtr = gtr
  4598. function gtr (version, range, options) {
  4599. return outside(version, range, '>', options)
  4600. }
  4601. exports.outside = outside
  4602. function outside (version, range, hilo, options) {
  4603. version = new SemVer(version, options)
  4604. range = new Range(range, options)
  4605. var gtfn, ltefn, ltfn, comp, ecomp
  4606. switch (hilo) {
  4607. case '>':
  4608. gtfn = gt
  4609. ltefn = lte
  4610. ltfn = lt
  4611. comp = '>'
  4612. ecomp = '>='
  4613. break
  4614. case '<':
  4615. gtfn = lt
  4616. ltefn = gte
  4617. ltfn = gt
  4618. comp = '<'
  4619. ecomp = '<='
  4620. break
  4621. default:
  4622. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4623. }
  4624. // If it satisifes the range it is not outside
  4625. if (satisfies(version, range, options)) {
  4626. return false
  4627. }
  4628. // From now on, variable terms are as if we're in "gtr" mode.
  4629. // but note that everything is flipped for the "ltr" function.
  4630. for (var i = 0; i < range.set.length; ++i) {
  4631. var comparators = range.set[i]
  4632. var high = null
  4633. var low = null
  4634. comparators.forEach(function (comparator) {
  4635. if (comparator.semver === ANY) {
  4636. comparator = new Comparator('>=0.0.0')
  4637. }
  4638. high = high || comparator
  4639. low = low || comparator
  4640. if (gtfn(comparator.semver, high.semver, options)) {
  4641. high = comparator
  4642. } else if (ltfn(comparator.semver, low.semver, options)) {
  4643. low = comparator
  4644. }
  4645. })
  4646. // If the edge version comparator has a operator then our version
  4647. // isn't outside it
  4648. if (high.operator === comp || high.operator === ecomp) {
  4649. return false
  4650. }
  4651. // If the lowest version comparator has an operator and our version
  4652. // is less than it then it isn't higher than the range
  4653. if ((!low.operator || low.operator === comp) &&
  4654. ltefn(version, low.semver)) {
  4655. return false
  4656. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4657. return false
  4658. }
  4659. }
  4660. return true
  4661. }
  4662. exports.prerelease = prerelease
  4663. function prerelease (version, options) {
  4664. var parsed = parse(version, options)
  4665. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4666. }
  4667. exports.intersects = intersects
  4668. function intersects (r1, r2, options) {
  4669. r1 = new Range(r1, options)
  4670. r2 = new Range(r2, options)
  4671. return r1.intersects(r2)
  4672. }
  4673. exports.coerce = coerce
  4674. function coerce (version) {
  4675. if (version instanceof SemVer) {
  4676. return version
  4677. }
  4678. if (typeof version !== 'string') {
  4679. return null
  4680. }
  4681. var match = version.match(re[COERCE])
  4682. if (match == null) {
  4683. return null
  4684. }
  4685. return parse(match[1] +
  4686. '.' + (match[2] || '0') +
  4687. '.' + (match[3] || '0'))
  4688. }
  4689. /***/ }),
  4690. /***/ 287:
  4691. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4692. "use strict";
  4693. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4694. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4695. return new (P || (P = Promise))(function (resolve, reject) {
  4696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4698. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4700. });
  4701. };
  4702. var __importStar = (this && this.__importStar) || function (mod) {
  4703. if (mod && mod.__esModule) return mod;
  4704. var result = {};
  4705. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4706. result["default"] = mod;
  4707. return result;
  4708. };
  4709. var __importDefault = (this && this.__importDefault) || function (mod) {
  4710. return (mod && mod.__esModule) ? mod : { "default": mod };
  4711. };
  4712. Object.defineProperty(exports, "__esModule", { value: true });
  4713. const assert = __importStar(__webpack_require__(357));
  4714. const core = __importStar(__webpack_require__(470));
  4715. const exec = __importStar(__webpack_require__(986));
  4716. const fs = __importStar(__webpack_require__(747));
  4717. const io = __importStar(__webpack_require__(1));
  4718. const os = __importStar(__webpack_require__(87));
  4719. const path = __importStar(__webpack_require__(622));
  4720. const regexpHelper = __importStar(__webpack_require__(528));
  4721. const stateHelper = __importStar(__webpack_require__(153));
  4722. const urlHelper = __importStar(__webpack_require__(81));
  4723. const v4_1 = __importDefault(__webpack_require__(826));
  4724. const IS_WINDOWS = process.platform === 'win32';
  4725. const SSH_COMMAND_KEY = 'core.sshCommand';
  4726. function createAuthHelper(git, settings) {
  4727. return new GitAuthHelper(git, settings);
  4728. }
  4729. exports.createAuthHelper = createAuthHelper;
  4730. class GitAuthHelper {
  4731. constructor(gitCommandManager, gitSourceSettings) {
  4732. this.sshCommand = '';
  4733. this.sshKeyPath = '';
  4734. this.sshKnownHostsPath = '';
  4735. this.temporaryHomePath = '';
  4736. this.git = gitCommandManager;
  4737. this.settings = gitSourceSettings || {};
  4738. // Token auth header
  4739. const serverUrl = urlHelper.getServerUrl();
  4740. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4741. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4742. core.setSecret(basicCredential);
  4743. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4744. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4745. // Instead of SSH URL
  4746. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4747. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4748. }
  4749. configureAuth() {
  4750. return __awaiter(this, void 0, void 0, function* () {
  4751. // Remove possible previous values
  4752. yield this.removeAuth();
  4753. // Configure new values
  4754. yield this.configureSsh();
  4755. yield this.configureToken();
  4756. });
  4757. }
  4758. configureGlobalAuth() {
  4759. return __awaiter(this, void 0, void 0, function* () {
  4760. // Create a temp home directory
  4761. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4762. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4763. const uniqueId = v4_1.default();
  4764. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4765. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4766. // Copy the global git config
  4767. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4768. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4769. let configExists = false;
  4770. try {
  4771. yield fs.promises.stat(gitConfigPath);
  4772. configExists = true;
  4773. }
  4774. catch (err) {
  4775. if (err.code !== 'ENOENT') {
  4776. throw err;
  4777. }
  4778. }
  4779. if (configExists) {
  4780. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4781. yield io.cp(gitConfigPath, newGitConfigPath);
  4782. }
  4783. else {
  4784. yield fs.promises.writeFile(newGitConfigPath, '');
  4785. }
  4786. try {
  4787. // Override HOME
  4788. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4789. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4790. // Configure the token
  4791. yield this.configureToken(newGitConfigPath, true);
  4792. // Configure HTTPS instead of SSH
  4793. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4794. if (!this.settings.sshKey) {
  4795. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4796. }
  4797. }
  4798. catch (err) {
  4799. // Unset in case somehow written to the real global config
  4800. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4801. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4802. throw err;
  4803. }
  4804. });
  4805. }
  4806. configureSubmoduleAuth() {
  4807. return __awaiter(this, void 0, void 0, function* () {
  4808. // Remove possible previous HTTPS instead of SSH
  4809. yield this.removeGitConfig(this.insteadOfKey, true);
  4810. if (this.settings.persistCredentials) {
  4811. // Configure a placeholder value. This approach avoids the credential being captured
  4812. // by process creation audit events, which are commonly logged. For more information,
  4813. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4814. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4815. // Replace the placeholder
  4816. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4817. for (const configPath of configPaths) {
  4818. core.debug(`Replacing token placeholder in '${configPath}'`);
  4819. this.replaceTokenPlaceholder(configPath);
  4820. }
  4821. if (this.settings.sshKey) {
  4822. // Configure core.sshCommand
  4823. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4824. }
  4825. else {
  4826. // Configure HTTPS instead of SSH
  4827. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4828. }
  4829. }
  4830. });
  4831. }
  4832. removeAuth() {
  4833. return __awaiter(this, void 0, void 0, function* () {
  4834. yield this.removeSsh();
  4835. yield this.removeToken();
  4836. });
  4837. }
  4838. removeGlobalAuth() {
  4839. return __awaiter(this, void 0, void 0, function* () {
  4840. core.debug(`Unsetting HOME override`);
  4841. this.git.removeEnvironmentVariable('HOME');
  4842. yield io.rmRF(this.temporaryHomePath);
  4843. });
  4844. }
  4845. configureSsh() {
  4846. return __awaiter(this, void 0, void 0, function* () {
  4847. if (!this.settings.sshKey) {
  4848. return;
  4849. }
  4850. // Write key
  4851. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4852. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4853. const uniqueId = v4_1.default();
  4854. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4855. stateHelper.setSshKeyPath(this.sshKeyPath);
  4856. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4857. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4858. // Remove inherited permissions on Windows
  4859. if (IS_WINDOWS) {
  4860. const icacls = yield io.which('icacls.exe');
  4861. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4862. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4863. }
  4864. // Write known hosts
  4865. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4866. let userKnownHosts = '';
  4867. try {
  4868. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4869. }
  4870. catch (err) {
  4871. if (err.code !== 'ENOENT') {
  4872. throw err;
  4873. }
  4874. }
  4875. let knownHosts = '';
  4876. if (userKnownHosts) {
  4877. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4878. }
  4879. if (this.settings.sshKnownHosts) {
  4880. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4881. }
  4882. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4883. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4884. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4885. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4886. // Configure GIT_SSH_COMMAND
  4887. const sshPath = yield io.which('ssh', true);
  4888. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4889. if (this.settings.sshStrict) {
  4890. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4891. }
  4892. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4893. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4894. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4895. // Configure core.sshCommand
  4896. if (this.settings.persistCredentials) {
  4897. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4898. }
  4899. });
  4900. }
  4901. configureToken(configPath, globalConfig) {
  4902. return __awaiter(this, void 0, void 0, function* () {
  4903. // Validate args
  4904. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4905. // Default config path
  4906. if (!configPath && !globalConfig) {
  4907. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4908. }
  4909. // Configure a placeholder value. This approach avoids the credential being captured
  4910. // by process creation audit events, which are commonly logged. For more information,
  4911. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4912. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4913. // Replace the placeholder
  4914. yield this.replaceTokenPlaceholder(configPath || '');
  4915. });
  4916. }
  4917. replaceTokenPlaceholder(configPath) {
  4918. return __awaiter(this, void 0, void 0, function* () {
  4919. assert.ok(configPath, 'configPath is not defined');
  4920. let content = (yield fs.promises.readFile(configPath)).toString();
  4921. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4922. if (placeholderIndex < 0 ||
  4923. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4924. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4925. }
  4926. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4927. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4928. yield fs.promises.writeFile(configPath, content);
  4929. });
  4930. }
  4931. removeSsh() {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. // SSH key
  4934. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4935. if (keyPath) {
  4936. try {
  4937. yield io.rmRF(keyPath);
  4938. }
  4939. catch (err) {
  4940. core.debug(err.message);
  4941. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4942. }
  4943. }
  4944. // SSH known hosts
  4945. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4946. if (knownHostsPath) {
  4947. try {
  4948. yield io.rmRF(knownHostsPath);
  4949. }
  4950. catch (_a) {
  4951. // Intentionally empty
  4952. }
  4953. }
  4954. // SSH command
  4955. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4956. });
  4957. }
  4958. removeToken() {
  4959. return __awaiter(this, void 0, void 0, function* () {
  4960. // HTTP extra header
  4961. yield this.removeGitConfig(this.tokenConfigKey);
  4962. });
  4963. }
  4964. removeGitConfig(configKey, submoduleOnly = false) {
  4965. return __awaiter(this, void 0, void 0, function* () {
  4966. if (!submoduleOnly) {
  4967. if ((yield this.git.configExists(configKey)) &&
  4968. !(yield this.git.tryConfigUnset(configKey))) {
  4969. // Load the config contents
  4970. core.warning(`Failed to remove '${configKey}' from the git config`);
  4971. }
  4972. }
  4973. const pattern = regexpHelper.escape(configKey);
  4974. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4975. });
  4976. }
  4977. }
  4978. /***/ }),
  4979. /***/ 289:
  4980. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4981. "use strict";
  4982. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4983. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4984. return new (P || (P = Promise))(function (resolve, reject) {
  4985. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4986. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4987. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4988. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4989. });
  4990. };
  4991. var __importStar = (this && this.__importStar) || function (mod) {
  4992. if (mod && mod.__esModule) return mod;
  4993. var result = {};
  4994. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4995. result["default"] = mod;
  4996. return result;
  4997. };
  4998. Object.defineProperty(exports, "__esModule", { value: true });
  4999. const core = __importStar(__webpack_require__(470));
  5000. const exec = __importStar(__webpack_require__(986));
  5001. const fshelper = __importStar(__webpack_require__(618));
  5002. const io = __importStar(__webpack_require__(1));
  5003. const path = __importStar(__webpack_require__(622));
  5004. const refHelper = __importStar(__webpack_require__(227));
  5005. const regexpHelper = __importStar(__webpack_require__(528));
  5006. const retryHelper = __importStar(__webpack_require__(587));
  5007. const git_version_1 = __webpack_require__(559);
  5008. // Auth header not supported before 2.9
  5009. // Wire protocol v2 not supported before 2.18
  5010. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5011. function createCommandManager(workingDirectory, lfs) {
  5012. return __awaiter(this, void 0, void 0, function* () {
  5013. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5014. });
  5015. }
  5016. exports.createCommandManager = createCommandManager;
  5017. class GitCommandManager {
  5018. // Private constructor; use createCommandManager()
  5019. constructor() {
  5020. this.gitEnv = {
  5021. GIT_TERMINAL_PROMPT: '0',
  5022. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5023. };
  5024. this.gitPath = '';
  5025. this.lfs = false;
  5026. this.workingDirectory = '';
  5027. }
  5028. branchDelete(remote, branch) {
  5029. return __awaiter(this, void 0, void 0, function* () {
  5030. const args = ['branch', '--delete', '--force'];
  5031. if (remote) {
  5032. args.push('--remote');
  5033. }
  5034. args.push(branch);
  5035. yield this.execGit(args);
  5036. });
  5037. }
  5038. branchExists(remote, pattern) {
  5039. return __awaiter(this, void 0, void 0, function* () {
  5040. const args = ['branch', '--list'];
  5041. if (remote) {
  5042. args.push('--remote');
  5043. }
  5044. args.push(pattern);
  5045. const output = yield this.execGit(args);
  5046. return !!output.stdout.trim();
  5047. });
  5048. }
  5049. branchList(remote) {
  5050. return __awaiter(this, void 0, void 0, function* () {
  5051. const result = [];
  5052. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5053. // "branch --list" is more difficult when in a detached HEAD state.
  5054. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5055. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5056. const args = ['rev-parse', '--symbolic-full-name'];
  5057. if (remote) {
  5058. args.push('--remotes=origin');
  5059. }
  5060. else {
  5061. args.push('--branches');
  5062. }
  5063. const output = yield this.execGit(args);
  5064. for (let branch of output.stdout.trim().split('\n')) {
  5065. branch = branch.trim();
  5066. if (branch) {
  5067. if (branch.startsWith('refs/heads/')) {
  5068. branch = branch.substr('refs/heads/'.length);
  5069. }
  5070. else if (branch.startsWith('refs/remotes/')) {
  5071. branch = branch.substr('refs/remotes/'.length);
  5072. }
  5073. result.push(branch);
  5074. }
  5075. }
  5076. return result;
  5077. });
  5078. }
  5079. checkout(ref, startPoint) {
  5080. return __awaiter(this, void 0, void 0, function* () {
  5081. const args = ['checkout', '--progress', '--force'];
  5082. if (startPoint) {
  5083. args.push('-B', ref, startPoint);
  5084. }
  5085. else {
  5086. args.push(ref);
  5087. }
  5088. yield this.execGit(args);
  5089. });
  5090. }
  5091. checkoutDetach() {
  5092. return __awaiter(this, void 0, void 0, function* () {
  5093. const args = ['checkout', '--detach'];
  5094. yield this.execGit(args);
  5095. });
  5096. }
  5097. config(configKey, configValue, globalConfig) {
  5098. return __awaiter(this, void 0, void 0, function* () {
  5099. yield this.execGit([
  5100. 'config',
  5101. globalConfig ? '--global' : '--local',
  5102. configKey,
  5103. configValue
  5104. ]);
  5105. });
  5106. }
  5107. configExists(configKey, globalConfig) {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. const pattern = regexpHelper.escape(configKey);
  5110. const output = yield this.execGit([
  5111. 'config',
  5112. globalConfig ? '--global' : '--local',
  5113. '--name-only',
  5114. '--get-regexp',
  5115. pattern
  5116. ], true);
  5117. return output.exitCode === 0;
  5118. });
  5119. }
  5120. fetch(refSpec, fetchDepth) {
  5121. return __awaiter(this, void 0, void 0, function* () {
  5122. const args = ['-c', 'protocol.version=2', 'fetch'];
  5123. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5124. args.push('--no-tags');
  5125. }
  5126. args.push('--prune', '--progress', '--no-recurse-submodules');
  5127. if (fetchDepth && fetchDepth > 0) {
  5128. args.push(`--depth=${fetchDepth}`);
  5129. }
  5130. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5131. args.push('--unshallow');
  5132. }
  5133. args.push('origin');
  5134. for (const arg of refSpec) {
  5135. args.push(arg);
  5136. }
  5137. const that = this;
  5138. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5139. yield that.execGit(args);
  5140. }));
  5141. });
  5142. }
  5143. getWorkingDirectory() {
  5144. return this.workingDirectory;
  5145. }
  5146. init() {
  5147. return __awaiter(this, void 0, void 0, function* () {
  5148. yield this.execGit(['init', this.workingDirectory]);
  5149. });
  5150. }
  5151. isDetached() {
  5152. return __awaiter(this, void 0, void 0, function* () {
  5153. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5154. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5155. return !output.stdout.trim().startsWith('refs/heads/');
  5156. });
  5157. }
  5158. lfsFetch(ref) {
  5159. return __awaiter(this, void 0, void 0, function* () {
  5160. const args = ['lfs', 'fetch', 'origin', ref];
  5161. const that = this;
  5162. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5163. yield that.execGit(args);
  5164. }));
  5165. });
  5166. }
  5167. lfsInstall() {
  5168. return __awaiter(this, void 0, void 0, function* () {
  5169. yield this.execGit(['lfs', 'install', '--local']);
  5170. });
  5171. }
  5172. log1() {
  5173. return __awaiter(this, void 0, void 0, function* () {
  5174. const output = yield this.execGit(['log', '-1']);
  5175. return output.stdout;
  5176. });
  5177. }
  5178. remoteAdd(remoteName, remoteUrl) {
  5179. return __awaiter(this, void 0, void 0, function* () {
  5180. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5181. });
  5182. }
  5183. removeEnvironmentVariable(name) {
  5184. delete this.gitEnv[name];
  5185. }
  5186. /**
  5187. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5188. * For an annotated tag, the tag SHA is returned.
  5189. * @param {string} ref For example: 'refs/heads/master' or '/refs/tags/v1'
  5190. * @returns {Promise<string>}
  5191. */
  5192. revParse(ref) {
  5193. return __awaiter(this, void 0, void 0, function* () {
  5194. const output = yield this.execGit(['rev-parse', ref]);
  5195. return output.stdout.trim();
  5196. });
  5197. }
  5198. setEnvironmentVariable(name, value) {
  5199. this.gitEnv[name] = value;
  5200. }
  5201. shaExists(sha) {
  5202. return __awaiter(this, void 0, void 0, function* () {
  5203. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5204. const output = yield this.execGit(args, true);
  5205. return output.exitCode === 0;
  5206. });
  5207. }
  5208. submoduleForeach(command, recursive) {
  5209. return __awaiter(this, void 0, void 0, function* () {
  5210. const args = ['submodule', 'foreach'];
  5211. if (recursive) {
  5212. args.push('--recursive');
  5213. }
  5214. args.push(command);
  5215. const output = yield this.execGit(args);
  5216. return output.stdout;
  5217. });
  5218. }
  5219. submoduleSync(recursive) {
  5220. return __awaiter(this, void 0, void 0, function* () {
  5221. const args = ['submodule', 'sync'];
  5222. if (recursive) {
  5223. args.push('--recursive');
  5224. }
  5225. yield this.execGit(args);
  5226. });
  5227. }
  5228. submoduleUpdate(fetchDepth, recursive) {
  5229. return __awaiter(this, void 0, void 0, function* () {
  5230. const args = ['-c', 'protocol.version=2'];
  5231. args.push('submodule', 'update', '--init', '--force');
  5232. if (fetchDepth > 0) {
  5233. args.push(`--depth=${fetchDepth}`);
  5234. }
  5235. if (recursive) {
  5236. args.push('--recursive');
  5237. }
  5238. yield this.execGit(args);
  5239. });
  5240. }
  5241. tagExists(pattern) {
  5242. return __awaiter(this, void 0, void 0, function* () {
  5243. const output = yield this.execGit(['tag', '--list', pattern]);
  5244. return !!output.stdout.trim();
  5245. });
  5246. }
  5247. tryClean() {
  5248. return __awaiter(this, void 0, void 0, function* () {
  5249. const output = yield this.execGit(['clean', '-ffdx'], true);
  5250. return output.exitCode === 0;
  5251. });
  5252. }
  5253. tryConfigUnset(configKey, globalConfig) {
  5254. return __awaiter(this, void 0, void 0, function* () {
  5255. const output = yield this.execGit([
  5256. 'config',
  5257. globalConfig ? '--global' : '--local',
  5258. '--unset-all',
  5259. configKey
  5260. ], true);
  5261. return output.exitCode === 0;
  5262. });
  5263. }
  5264. tryDisableAutomaticGarbageCollection() {
  5265. return __awaiter(this, void 0, void 0, function* () {
  5266. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5267. return output.exitCode === 0;
  5268. });
  5269. }
  5270. tryGetFetchUrl() {
  5271. return __awaiter(this, void 0, void 0, function* () {
  5272. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5273. if (output.exitCode !== 0) {
  5274. return '';
  5275. }
  5276. const stdout = output.stdout.trim();
  5277. if (stdout.includes('\n')) {
  5278. return '';
  5279. }
  5280. return stdout;
  5281. });
  5282. }
  5283. tryReset() {
  5284. return __awaiter(this, void 0, void 0, function* () {
  5285. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5286. return output.exitCode === 0;
  5287. });
  5288. }
  5289. static createCommandManager(workingDirectory, lfs) {
  5290. return __awaiter(this, void 0, void 0, function* () {
  5291. const result = new GitCommandManager();
  5292. yield result.initializeCommandManager(workingDirectory, lfs);
  5293. return result;
  5294. });
  5295. }
  5296. execGit(args, allowAllExitCodes = false) {
  5297. return __awaiter(this, void 0, void 0, function* () {
  5298. fshelper.directoryExistsSync(this.workingDirectory, true);
  5299. const result = new GitOutput();
  5300. const env = {};
  5301. for (const key of Object.keys(process.env)) {
  5302. env[key] = process.env[key];
  5303. }
  5304. for (const key of Object.keys(this.gitEnv)) {
  5305. env[key] = this.gitEnv[key];
  5306. }
  5307. const stdout = [];
  5308. const options = {
  5309. cwd: this.workingDirectory,
  5310. env,
  5311. ignoreReturnCode: allowAllExitCodes,
  5312. listeners: {
  5313. stdout: (data) => {
  5314. stdout.push(data.toString());
  5315. }
  5316. }
  5317. };
  5318. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5319. result.stdout = stdout.join('');
  5320. return result;
  5321. });
  5322. }
  5323. initializeCommandManager(workingDirectory, lfs) {
  5324. return __awaiter(this, void 0, void 0, function* () {
  5325. this.workingDirectory = workingDirectory;
  5326. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5327. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5328. this.lfs = lfs;
  5329. if (!this.lfs) {
  5330. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5331. }
  5332. this.gitPath = yield io.which('git', true);
  5333. // Git version
  5334. core.debug('Getting git version');
  5335. let gitVersion = new git_version_1.GitVersion();
  5336. let gitOutput = yield this.execGit(['version']);
  5337. let stdout = gitOutput.stdout.trim();
  5338. if (!stdout.includes('\n')) {
  5339. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5340. if (match) {
  5341. gitVersion = new git_version_1.GitVersion(match[0]);
  5342. }
  5343. }
  5344. if (!gitVersion.isValid()) {
  5345. throw new Error('Unable to determine git version');
  5346. }
  5347. // Minimum git version
  5348. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5349. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5350. }
  5351. if (this.lfs) {
  5352. // Git-lfs version
  5353. core.debug('Getting git-lfs version');
  5354. let gitLfsVersion = new git_version_1.GitVersion();
  5355. const gitLfsPath = yield io.which('git-lfs', true);
  5356. gitOutput = yield this.execGit(['lfs', 'version']);
  5357. stdout = gitOutput.stdout.trim();
  5358. if (!stdout.includes('\n')) {
  5359. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5360. if (match) {
  5361. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5362. }
  5363. }
  5364. if (!gitLfsVersion.isValid()) {
  5365. throw new Error('Unable to determine git-lfs version');
  5366. }
  5367. // Minimum git-lfs version
  5368. // Note:
  5369. // - Auth header not supported before 2.1
  5370. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5371. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5372. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5373. }
  5374. }
  5375. // Set the user agent
  5376. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5377. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5378. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5379. });
  5380. }
  5381. }
  5382. class GitOutput {
  5383. constructor() {
  5384. this.stdout = '';
  5385. this.exitCode = 0;
  5386. }
  5387. }
  5388. /***/ }),
  5389. /***/ 293:
  5390. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5391. "use strict";
  5392. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5393. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5394. return new (P || (P = Promise))(function (resolve, reject) {
  5395. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5396. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5397. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5398. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5399. });
  5400. };
  5401. var __importStar = (this && this.__importStar) || function (mod) {
  5402. if (mod && mod.__esModule) return mod;
  5403. var result = {};
  5404. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5405. result["default"] = mod;
  5406. return result;
  5407. };
  5408. Object.defineProperty(exports, "__esModule", { value: true });
  5409. const core = __importStar(__webpack_require__(470));
  5410. const fsHelper = __importStar(__webpack_require__(618));
  5411. const gitAuthHelper = __importStar(__webpack_require__(287));
  5412. const gitCommandManager = __importStar(__webpack_require__(289));
  5413. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5414. const githubApiHelper = __importStar(__webpack_require__(464));
  5415. const io = __importStar(__webpack_require__(1));
  5416. const path = __importStar(__webpack_require__(622));
  5417. const refHelper = __importStar(__webpack_require__(227));
  5418. const stateHelper = __importStar(__webpack_require__(153));
  5419. const urlHelper = __importStar(__webpack_require__(81));
  5420. function getSource(settings) {
  5421. return __awaiter(this, void 0, void 0, function* () {
  5422. // Repository URL
  5423. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5424. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5425. // Remove conflicting file path
  5426. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5427. yield io.rmRF(settings.repositoryPath);
  5428. }
  5429. // Create directory
  5430. let isExisting = true;
  5431. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5432. isExisting = false;
  5433. yield io.mkdirP(settings.repositoryPath);
  5434. }
  5435. // Git command manager
  5436. core.startGroup('Getting Git version info');
  5437. const git = yield getGitCommandManager(settings);
  5438. core.endGroup();
  5439. // Prepare existing directory, otherwise recreate
  5440. if (isExisting) {
  5441. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5442. }
  5443. if (!git) {
  5444. // Downloading using REST API
  5445. core.info(`The repository will be downloaded using the GitHub REST API`);
  5446. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5447. if (settings.submodules) {
  5448. 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.`);
  5449. }
  5450. else if (settings.sshKey) {
  5451. 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.`);
  5452. }
  5453. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5454. return;
  5455. }
  5456. // Save state for POST action
  5457. stateHelper.setRepositoryPath(settings.repositoryPath);
  5458. // Initialize the repository
  5459. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5460. core.startGroup('Initializing the repository');
  5461. yield git.init();
  5462. yield git.remoteAdd('origin', repositoryUrl);
  5463. core.endGroup();
  5464. }
  5465. // Disable automatic garbage collection
  5466. core.startGroup('Disabling automatic garbage collection');
  5467. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5468. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5469. }
  5470. core.endGroup();
  5471. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5472. try {
  5473. // Configure auth
  5474. core.startGroup('Setting up auth');
  5475. yield authHelper.configureAuth();
  5476. core.endGroup();
  5477. // LFS install
  5478. if (settings.lfs) {
  5479. yield git.lfsInstall();
  5480. }
  5481. // Fetch
  5482. core.startGroup('Fetching the repository');
  5483. if (settings.fetchDepth <= 0) {
  5484. // Fetch all branches and tags
  5485. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5486. yield git.fetch(refSpec);
  5487. // When all history is fetched, the ref we're interested in may have moved to a different
  5488. // commit (push or force push). If so, fetch again with a targeted refspec.
  5489. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5490. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5491. yield git.fetch(refSpec);
  5492. }
  5493. }
  5494. else {
  5495. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5496. yield git.fetch(refSpec, settings.fetchDepth);
  5497. }
  5498. core.endGroup();
  5499. // Checkout info
  5500. core.startGroup('Determining the checkout info');
  5501. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5502. core.endGroup();
  5503. // LFS fetch
  5504. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5505. // Explicit lfs fetch will fetch lfs objects in parallel.
  5506. if (settings.lfs) {
  5507. core.startGroup('Fetching LFS objects');
  5508. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5509. core.endGroup();
  5510. }
  5511. // Checkout
  5512. core.startGroup('Checking out the ref');
  5513. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5514. core.endGroup();
  5515. // Submodules
  5516. if (settings.submodules) {
  5517. try {
  5518. // Temporarily override global config
  5519. core.startGroup('Setting up auth for fetching submodules');
  5520. yield authHelper.configureGlobalAuth();
  5521. core.endGroup();
  5522. // Checkout submodules
  5523. core.startGroup('Fetching submodules');
  5524. yield git.submoduleSync(settings.nestedSubmodules);
  5525. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5526. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5527. core.endGroup();
  5528. // Persist credentials
  5529. if (settings.persistCredentials) {
  5530. core.startGroup('Persisting credentials for submodules');
  5531. yield authHelper.configureSubmoduleAuth();
  5532. core.endGroup();
  5533. }
  5534. }
  5535. finally {
  5536. // Remove temporary global config override
  5537. yield authHelper.removeGlobalAuth();
  5538. }
  5539. }
  5540. // Dump some info about the checked out commit
  5541. const commitInfo = yield git.log1();
  5542. // Check for incorrect pull request merge commit
  5543. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5544. }
  5545. finally {
  5546. // Remove auth
  5547. if (!settings.persistCredentials) {
  5548. core.startGroup('Removing auth');
  5549. yield authHelper.removeAuth();
  5550. core.endGroup();
  5551. }
  5552. }
  5553. });
  5554. }
  5555. exports.getSource = getSource;
  5556. function cleanup(repositoryPath) {
  5557. return __awaiter(this, void 0, void 0, function* () {
  5558. // Repo exists?
  5559. if (!repositoryPath ||
  5560. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5561. return;
  5562. }
  5563. let git;
  5564. try {
  5565. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5566. }
  5567. catch (_a) {
  5568. return;
  5569. }
  5570. // Remove auth
  5571. const authHelper = gitAuthHelper.createAuthHelper(git);
  5572. yield authHelper.removeAuth();
  5573. });
  5574. }
  5575. exports.cleanup = cleanup;
  5576. function getGitCommandManager(settings) {
  5577. return __awaiter(this, void 0, void 0, function* () {
  5578. core.info(`Working directory is '${settings.repositoryPath}'`);
  5579. try {
  5580. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5581. }
  5582. catch (err) {
  5583. // Git is required for LFS
  5584. if (settings.lfs) {
  5585. throw err;
  5586. }
  5587. // Otherwise fallback to REST API
  5588. return undefined;
  5589. }
  5590. });
  5591. }
  5592. /***/ }),
  5593. /***/ 294:
  5594. /***/ (function(module, __unusedexports, __webpack_require__) {
  5595. module.exports = parseOptions;
  5596. const { Deprecation } = __webpack_require__(692);
  5597. const { getUserAgent } = __webpack_require__(796);
  5598. const once = __webpack_require__(969);
  5599. const pkg = __webpack_require__(215);
  5600. const deprecateOptionsTimeout = once((log, deprecation) =>
  5601. log.warn(deprecation)
  5602. );
  5603. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5604. const deprecateOptionsHeaders = once((log, deprecation) =>
  5605. log.warn(deprecation)
  5606. );
  5607. function parseOptions(options, log, hook) {
  5608. if (options.headers) {
  5609. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5610. newObj[key.toLowerCase()] = options.headers[key];
  5611. return newObj;
  5612. }, {});
  5613. }
  5614. const clientDefaults = {
  5615. headers: options.headers || {},
  5616. request: options.request || {},
  5617. mediaType: {
  5618. previews: [],
  5619. format: ""
  5620. }
  5621. };
  5622. if (options.baseUrl) {
  5623. clientDefaults.baseUrl = options.baseUrl;
  5624. }
  5625. if (options.userAgent) {
  5626. clientDefaults.headers["user-agent"] = options.userAgent;
  5627. }
  5628. if (options.previews) {
  5629. clientDefaults.mediaType.previews = options.previews;
  5630. }
  5631. if (options.timeZone) {
  5632. clientDefaults.headers["time-zone"] = options.timeZone;
  5633. }
  5634. if (options.timeout) {
  5635. deprecateOptionsTimeout(
  5636. log,
  5637. new Deprecation(
  5638. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5639. )
  5640. );
  5641. clientDefaults.request.timeout = options.timeout;
  5642. }
  5643. if (options.agent) {
  5644. deprecateOptionsAgent(
  5645. log,
  5646. new Deprecation(
  5647. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5648. )
  5649. );
  5650. clientDefaults.request.agent = options.agent;
  5651. }
  5652. if (options.headers) {
  5653. deprecateOptionsHeaders(
  5654. log,
  5655. new Deprecation(
  5656. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5657. )
  5658. );
  5659. }
  5660. const userAgentOption = clientDefaults.headers["user-agent"];
  5661. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5662. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5663. .filter(Boolean)
  5664. .join(" ");
  5665. clientDefaults.request.hook = hook.bind(null, "request");
  5666. return clientDefaults;
  5667. }
  5668. /***/ }),
  5669. /***/ 297:
  5670. /***/ (function(module) {
  5671. module.exports = class HttpError extends Error {
  5672. constructor (message, code, headers) {
  5673. super(message)
  5674. // Maintains proper stack trace (only available on V8)
  5675. /* istanbul ignore next */
  5676. if (Error.captureStackTrace) {
  5677. Error.captureStackTrace(this, this.constructor)
  5678. }
  5679. this.name = 'HttpError'
  5680. this.code = code
  5681. this.headers = headers
  5682. }
  5683. }
  5684. /***/ }),
  5685. /***/ 299:
  5686. /***/ (function(__unusedmodule, exports) {
  5687. "use strict";
  5688. Object.defineProperty(exports, '__esModule', { value: true });
  5689. const VERSION = "1.1.2";
  5690. /**
  5691. * Some “list” response that can be paginated have a different response structure
  5692. *
  5693. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5694. * /installation/repositories also has `repository_selection`), as well as a key with
  5695. * the list of the items which name varies from endpoint to endpoint:
  5696. *
  5697. * - https://developer.github.com/v3/search/#example (key `items`)
  5698. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5699. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5700. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5701. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5702. *
  5703. * Octokit normalizes these responses so that paginated results are always returned following
  5704. * the same structure. One challenge is that if the list response has only one page, no Link
  5705. * header is provided, so this header alone is not sufficient to check wether a response is
  5706. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5707. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5708. * property because it also exists in the response of Get the combined status for a specific ref.
  5709. */
  5710. 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))?([^/]|$)/];
  5711. function normalizePaginatedListResponse(octokit, url, response) {
  5712. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5713. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5714. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5715. // to retrieve the same information.
  5716. const incompleteResults = response.data.incomplete_results;
  5717. const repositorySelection = response.data.repository_selection;
  5718. const totalCount = response.data.total_count;
  5719. delete response.data.incomplete_results;
  5720. delete response.data.repository_selection;
  5721. delete response.data.total_count;
  5722. const namespaceKey = Object.keys(response.data)[0];
  5723. const data = response.data[namespaceKey];
  5724. response.data = data;
  5725. if (typeof incompleteResults !== "undefined") {
  5726. response.data.incomplete_results = incompleteResults;
  5727. }
  5728. if (typeof repositorySelection !== "undefined") {
  5729. response.data.repository_selection = repositorySelection;
  5730. }
  5731. response.data.total_count = totalCount;
  5732. Object.defineProperty(response.data, namespaceKey, {
  5733. get() {
  5734. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5735. return Array.from(data);
  5736. }
  5737. });
  5738. }
  5739. function iterator(octokit, route, parameters) {
  5740. const options = octokit.request.endpoint(route, parameters);
  5741. const method = options.method;
  5742. const headers = options.headers;
  5743. let url = options.url;
  5744. return {
  5745. [Symbol.asyncIterator]: () => ({
  5746. next() {
  5747. if (!url) {
  5748. return Promise.resolve({
  5749. done: true
  5750. });
  5751. }
  5752. return octokit.request({
  5753. method,
  5754. url,
  5755. headers
  5756. }).then(response => {
  5757. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5758. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5759. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5760. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5761. return {
  5762. value: response
  5763. };
  5764. });
  5765. }
  5766. })
  5767. };
  5768. }
  5769. function paginate(octokit, route, parameters, mapFn) {
  5770. if (typeof parameters === "function") {
  5771. mapFn = parameters;
  5772. parameters = undefined;
  5773. }
  5774. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5775. }
  5776. function gather(octokit, results, iterator, mapFn) {
  5777. return iterator.next().then(result => {
  5778. if (result.done) {
  5779. return results;
  5780. }
  5781. let earlyExit = false;
  5782. function done() {
  5783. earlyExit = true;
  5784. }
  5785. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5786. if (earlyExit) {
  5787. return results;
  5788. }
  5789. return gather(octokit, results, iterator, mapFn);
  5790. });
  5791. }
  5792. /**
  5793. * @param octokit Octokit instance
  5794. * @param options Options passed to Octokit constructor
  5795. */
  5796. function paginateRest(octokit) {
  5797. return {
  5798. paginate: Object.assign(paginate.bind(null, octokit), {
  5799. iterator: iterator.bind(null, octokit)
  5800. })
  5801. };
  5802. }
  5803. paginateRest.VERSION = VERSION;
  5804. exports.paginateRest = paginateRest;
  5805. //# sourceMappingURL=index.js.map
  5806. /***/ }),
  5807. /***/ 323:
  5808. /***/ (function(module) {
  5809. "use strict";
  5810. var isStream = module.exports = function (stream) {
  5811. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5812. };
  5813. isStream.writable = function (stream) {
  5814. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5815. };
  5816. isStream.readable = function (stream) {
  5817. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5818. };
  5819. isStream.duplex = function (stream) {
  5820. return isStream.writable(stream) && isStream.readable(stream);
  5821. };
  5822. isStream.transform = function (stream) {
  5823. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5824. };
  5825. /***/ }),
  5826. /***/ 335:
  5827. /***/ (function(module, __unusedexports, __webpack_require__) {
  5828. module.exports = __webpack_require__(179);
  5829. /***/ }),
  5830. /***/ 336:
  5831. /***/ (function(module, __unusedexports, __webpack_require__) {
  5832. module.exports = hasLastPage
  5833. const deprecate = __webpack_require__(370)
  5834. const getPageLinks = __webpack_require__(577)
  5835. function hasLastPage (link) {
  5836. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5837. return getPageLinks(link).last
  5838. }
  5839. /***/ }),
  5840. /***/ 348:
  5841. /***/ (function(module, __unusedexports, __webpack_require__) {
  5842. "use strict";
  5843. module.exports = validate;
  5844. const { RequestError } = __webpack_require__(497);
  5845. const get = __webpack_require__(854);
  5846. const set = __webpack_require__(883);
  5847. function validate(octokit, options) {
  5848. if (!options.request.validate) {
  5849. return;
  5850. }
  5851. const { validate: params } = options.request;
  5852. Object.keys(params).forEach(parameterName => {
  5853. const parameter = get(params, parameterName);
  5854. const expectedType = parameter.type;
  5855. let parentParameterName;
  5856. let parentValue;
  5857. let parentParamIsPresent = true;
  5858. let parentParameterIsArray = false;
  5859. if (/\./.test(parameterName)) {
  5860. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5861. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5862. if (parentParameterIsArray) {
  5863. parentParameterName = parentParameterName.slice(0, -2);
  5864. }
  5865. parentValue = get(options, parentParameterName);
  5866. parentParamIsPresent =
  5867. parentParameterName === "headers" ||
  5868. (typeof parentValue === "object" && parentValue !== null);
  5869. }
  5870. const values = parentParameterIsArray
  5871. ? (get(options, parentParameterName) || []).map(
  5872. value => value[parameterName.split(/\./).pop()]
  5873. )
  5874. : [get(options, parameterName)];
  5875. values.forEach((value, i) => {
  5876. const valueIsPresent = typeof value !== "undefined";
  5877. const valueIsNull = value === null;
  5878. const currentParameterName = parentParameterIsArray
  5879. ? parameterName.replace(/\[\]/, `[${i}]`)
  5880. : parameterName;
  5881. if (!parameter.required && !valueIsPresent) {
  5882. return;
  5883. }
  5884. // if the parent parameter is of type object but allows null
  5885. // then the child parameters can be ignored
  5886. if (!parentParamIsPresent) {
  5887. return;
  5888. }
  5889. if (parameter.allowNull && valueIsNull) {
  5890. return;
  5891. }
  5892. if (!parameter.allowNull && valueIsNull) {
  5893. throw new RequestError(
  5894. `'${currentParameterName}' cannot be null`,
  5895. 400,
  5896. {
  5897. request: options
  5898. }
  5899. );
  5900. }
  5901. if (parameter.required && !valueIsPresent) {
  5902. throw new RequestError(
  5903. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5904. value
  5905. )}`,
  5906. 400,
  5907. {
  5908. request: options
  5909. }
  5910. );
  5911. }
  5912. // parse to integer before checking for enum
  5913. // so that string "1" will match enum with number 1
  5914. if (expectedType === "integer") {
  5915. const unparsedValue = value;
  5916. value = parseInt(value, 10);
  5917. if (isNaN(value)) {
  5918. throw new RequestError(
  5919. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5920. unparsedValue
  5921. )} is NaN`,
  5922. 400,
  5923. {
  5924. request: options
  5925. }
  5926. );
  5927. }
  5928. }
  5929. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5930. throw new RequestError(
  5931. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5932. value
  5933. )}`,
  5934. 400,
  5935. {
  5936. request: options
  5937. }
  5938. );
  5939. }
  5940. if (parameter.validation) {
  5941. const regex = new RegExp(parameter.validation);
  5942. if (!regex.test(value)) {
  5943. throw new RequestError(
  5944. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5945. value
  5946. )}`,
  5947. 400,
  5948. {
  5949. request: options
  5950. }
  5951. );
  5952. }
  5953. }
  5954. if (expectedType === "object" && typeof value === "string") {
  5955. try {
  5956. value = JSON.parse(value);
  5957. } catch (exception) {
  5958. throw new RequestError(
  5959. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5960. value
  5961. )}`,
  5962. 400,
  5963. {
  5964. request: options
  5965. }
  5966. );
  5967. }
  5968. }
  5969. set(options, parameter.mapTo || currentParameterName, value);
  5970. });
  5971. });
  5972. return options;
  5973. }
  5974. /***/ }),
  5975. /***/ 349:
  5976. /***/ (function(module, __unusedexports, __webpack_require__) {
  5977. module.exports = authenticationRequestError;
  5978. const { RequestError } = __webpack_require__(497);
  5979. function authenticationRequestError(state, error, options) {
  5980. /* istanbul ignore next */
  5981. if (!error.headers) throw error;
  5982. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5983. // handle "2FA required" error only
  5984. if (error.status !== 401 || !otpRequired) {
  5985. throw error;
  5986. }
  5987. if (
  5988. error.status === 401 &&
  5989. otpRequired &&
  5990. error.request &&
  5991. error.request.headers["x-github-otp"]
  5992. ) {
  5993. throw new RequestError(
  5994. "Invalid one-time password for two-factor authentication",
  5995. 401,
  5996. {
  5997. headers: error.headers,
  5998. request: options
  5999. }
  6000. );
  6001. }
  6002. if (typeof state.auth.on2fa !== "function") {
  6003. throw new RequestError(
  6004. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6005. 401,
  6006. {
  6007. headers: error.headers,
  6008. request: options
  6009. }
  6010. );
  6011. }
  6012. return Promise.resolve()
  6013. .then(() => {
  6014. return state.auth.on2fa();
  6015. })
  6016. .then(oneTimePassword => {
  6017. const newOptions = Object.assign(options, {
  6018. headers: Object.assign(
  6019. { "x-github-otp": oneTimePassword },
  6020. options.headers
  6021. )
  6022. });
  6023. return state.octokit.request(newOptions);
  6024. });
  6025. }
  6026. /***/ }),
  6027. /***/ 357:
  6028. /***/ (function(module) {
  6029. module.exports = require("assert");
  6030. /***/ }),
  6031. /***/ 363:
  6032. /***/ (function(module) {
  6033. module.exports = register
  6034. function register (state, name, method, options) {
  6035. if (typeof method !== 'function') {
  6036. throw new Error('method for before hook must be a function')
  6037. }
  6038. if (!options) {
  6039. options = {}
  6040. }
  6041. if (Array.isArray(name)) {
  6042. return name.reverse().reduce(function (callback, name) {
  6043. return register.bind(null, state, name, callback, options)
  6044. }, method)()
  6045. }
  6046. return Promise.resolve()
  6047. .then(function () {
  6048. if (!state.registry[name]) {
  6049. return method(options)
  6050. }
  6051. return (state.registry[name]).reduce(function (method, registered) {
  6052. return registered.hook.bind(null, method, options)
  6053. }, method)()
  6054. })
  6055. }
  6056. /***/ }),
  6057. /***/ 368:
  6058. /***/ (function(module) {
  6059. module.exports = function atob(str) {
  6060. return Buffer.from(str, 'base64').toString('binary')
  6061. }
  6062. /***/ }),
  6063. /***/ 370:
  6064. /***/ (function(module) {
  6065. module.exports = deprecate
  6066. const loggedMessages = {}
  6067. function deprecate (message) {
  6068. if (loggedMessages[message]) {
  6069. return
  6070. }
  6071. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6072. loggedMessages[message] = 1
  6073. }
  6074. /***/ }),
  6075. /***/ 385:
  6076. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6077. "use strict";
  6078. Object.defineProperty(exports, '__esModule', { value: true });
  6079. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6080. var isPlainObject = _interopDefault(__webpack_require__(696));
  6081. var universalUserAgent = __webpack_require__(562);
  6082. function lowercaseKeys(object) {
  6083. if (!object) {
  6084. return {};
  6085. }
  6086. return Object.keys(object).reduce((newObj, key) => {
  6087. newObj[key.toLowerCase()] = object[key];
  6088. return newObj;
  6089. }, {});
  6090. }
  6091. function mergeDeep(defaults, options) {
  6092. const result = Object.assign({}, defaults);
  6093. Object.keys(options).forEach(key => {
  6094. if (isPlainObject(options[key])) {
  6095. if (!(key in defaults)) Object.assign(result, {
  6096. [key]: options[key]
  6097. });else result[key] = mergeDeep(defaults[key], options[key]);
  6098. } else {
  6099. Object.assign(result, {
  6100. [key]: options[key]
  6101. });
  6102. }
  6103. });
  6104. return result;
  6105. }
  6106. function merge(defaults, route, options) {
  6107. if (typeof route === "string") {
  6108. let [method, url] = route.split(" ");
  6109. options = Object.assign(url ? {
  6110. method,
  6111. url
  6112. } : {
  6113. url: method
  6114. }, options);
  6115. } else {
  6116. options = Object.assign({}, route);
  6117. } // lowercase header names before merging with defaults to avoid duplicates
  6118. options.headers = lowercaseKeys(options.headers);
  6119. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6120. if (defaults && defaults.mediaType.previews.length) {
  6121. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6122. }
  6123. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6124. return mergedOptions;
  6125. }
  6126. function addQueryParameters(url, parameters) {
  6127. const separator = /\?/.test(url) ? "&" : "?";
  6128. const names = Object.keys(parameters);
  6129. if (names.length === 0) {
  6130. return url;
  6131. }
  6132. return url + separator + names.map(name => {
  6133. if (name === "q") {
  6134. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6135. }
  6136. return `${name}=${encodeURIComponent(parameters[name])}`;
  6137. }).join("&");
  6138. }
  6139. const urlVariableRegex = /\{[^}]+\}/g;
  6140. function removeNonChars(variableName) {
  6141. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6142. }
  6143. function extractUrlVariableNames(url) {
  6144. const matches = url.match(urlVariableRegex);
  6145. if (!matches) {
  6146. return [];
  6147. }
  6148. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6149. }
  6150. function omit(object, keysToOmit) {
  6151. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6152. obj[key] = object[key];
  6153. return obj;
  6154. }, {});
  6155. }
  6156. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6157. // TODO: create separate package.
  6158. //
  6159. // Copyright (c) 2012-2014, Bram Stein
  6160. // All rights reserved.
  6161. // Redistribution and use in source and binary forms, with or without
  6162. // modification, are permitted provided that the following conditions
  6163. // are met:
  6164. // 1. Redistributions of source code must retain the above copyright
  6165. // notice, this list of conditions and the following disclaimer.
  6166. // 2. Redistributions in binary form must reproduce the above copyright
  6167. // notice, this list of conditions and the following disclaimer in the
  6168. // documentation and/or other materials provided with the distribution.
  6169. // 3. The name of the author may not be used to endorse or promote products
  6170. // derived from this software without specific prior written permission.
  6171. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6172. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6173. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6174. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6175. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6176. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6177. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6178. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6179. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6180. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6181. /* istanbul ignore file */
  6182. function encodeReserved(str) {
  6183. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6184. if (!/%[0-9A-Fa-f]/.test(part)) {
  6185. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6186. }
  6187. return part;
  6188. }).join("");
  6189. }
  6190. function encodeUnreserved(str) {
  6191. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6192. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6193. });
  6194. }
  6195. function encodeValue(operator, value, key) {
  6196. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6197. if (key) {
  6198. return encodeUnreserved(key) + "=" + value;
  6199. } else {
  6200. return value;
  6201. }
  6202. }
  6203. function isDefined(value) {
  6204. return value !== undefined && value !== null;
  6205. }
  6206. function isKeyOperator(operator) {
  6207. return operator === ";" || operator === "&" || operator === "?";
  6208. }
  6209. function getValues(context, operator, key, modifier) {
  6210. var value = context[key],
  6211. result = [];
  6212. if (isDefined(value) && value !== "") {
  6213. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6214. value = value.toString();
  6215. if (modifier && modifier !== "*") {
  6216. value = value.substring(0, parseInt(modifier, 10));
  6217. }
  6218. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6219. } else {
  6220. if (modifier === "*") {
  6221. if (Array.isArray(value)) {
  6222. value.filter(isDefined).forEach(function (value) {
  6223. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6224. });
  6225. } else {
  6226. Object.keys(value).forEach(function (k) {
  6227. if (isDefined(value[k])) {
  6228. result.push(encodeValue(operator, value[k], k));
  6229. }
  6230. });
  6231. }
  6232. } else {
  6233. const tmp = [];
  6234. if (Array.isArray(value)) {
  6235. value.filter(isDefined).forEach(function (value) {
  6236. tmp.push(encodeValue(operator, value));
  6237. });
  6238. } else {
  6239. Object.keys(value).forEach(function (k) {
  6240. if (isDefined(value[k])) {
  6241. tmp.push(encodeUnreserved(k));
  6242. tmp.push(encodeValue(operator, value[k].toString()));
  6243. }
  6244. });
  6245. }
  6246. if (isKeyOperator(operator)) {
  6247. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6248. } else if (tmp.length !== 0) {
  6249. result.push(tmp.join(","));
  6250. }
  6251. }
  6252. }
  6253. } else {
  6254. if (operator === ";") {
  6255. if (isDefined(value)) {
  6256. result.push(encodeUnreserved(key));
  6257. }
  6258. } else if (value === "" && (operator === "&" || operator === "?")) {
  6259. result.push(encodeUnreserved(key) + "=");
  6260. } else if (value === "") {
  6261. result.push("");
  6262. }
  6263. }
  6264. return result;
  6265. }
  6266. function parseUrl(template) {
  6267. return {
  6268. expand: expand.bind(null, template)
  6269. };
  6270. }
  6271. function expand(template, context) {
  6272. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6273. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6274. if (expression) {
  6275. let operator = "";
  6276. const values = [];
  6277. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6278. operator = expression.charAt(0);
  6279. expression = expression.substr(1);
  6280. }
  6281. expression.split(/,/g).forEach(function (variable) {
  6282. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6283. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6284. });
  6285. if (operator && operator !== "+") {
  6286. var separator = ",";
  6287. if (operator === "?") {
  6288. separator = "&";
  6289. } else if (operator !== "#") {
  6290. separator = operator;
  6291. }
  6292. return (values.length !== 0 ? operator : "") + values.join(separator);
  6293. } else {
  6294. return values.join(",");
  6295. }
  6296. } else {
  6297. return encodeReserved(literal);
  6298. }
  6299. });
  6300. }
  6301. function parse(options) {
  6302. // https://fetch.spec.whatwg.org/#methods
  6303. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6304. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6305. let headers = Object.assign({}, options.headers);
  6306. let body;
  6307. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6308. const urlVariableNames = extractUrlVariableNames(url);
  6309. url = parseUrl(url).expand(parameters);
  6310. if (!/^http/.test(url)) {
  6311. url = options.baseUrl + url;
  6312. }
  6313. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6314. const remainingParameters = omit(parameters, omittedParameters);
  6315. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6316. if (!isBinaryRequset) {
  6317. if (options.mediaType.format) {
  6318. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6319. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6320. }
  6321. if (options.mediaType.previews.length) {
  6322. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6323. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6324. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6325. return `application/vnd.github.${preview}-preview${format}`;
  6326. }).join(",");
  6327. }
  6328. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6329. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6330. if (["GET", "HEAD"].includes(method)) {
  6331. url = addQueryParameters(url, remainingParameters);
  6332. } else {
  6333. if ("data" in remainingParameters) {
  6334. body = remainingParameters.data;
  6335. } else {
  6336. if (Object.keys(remainingParameters).length) {
  6337. body = remainingParameters;
  6338. } else {
  6339. headers["content-length"] = 0;
  6340. }
  6341. }
  6342. } // default content-type for JSON if body is set
  6343. if (!headers["content-type"] && typeof body !== "undefined") {
  6344. headers["content-type"] = "application/json; charset=utf-8";
  6345. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6346. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6347. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6348. body = "";
  6349. } // Only return body/request keys if present
  6350. return Object.assign({
  6351. method,
  6352. url,
  6353. headers
  6354. }, typeof body !== "undefined" ? {
  6355. body
  6356. } : null, options.request ? {
  6357. request: options.request
  6358. } : null);
  6359. }
  6360. function endpointWithDefaults(defaults, route, options) {
  6361. return parse(merge(defaults, route, options));
  6362. }
  6363. function withDefaults(oldDefaults, newDefaults) {
  6364. const DEFAULTS = merge(oldDefaults, newDefaults);
  6365. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6366. return Object.assign(endpoint, {
  6367. DEFAULTS,
  6368. defaults: withDefaults.bind(null, DEFAULTS),
  6369. merge: merge.bind(null, DEFAULTS),
  6370. parse
  6371. });
  6372. }
  6373. const VERSION = "6.0.1";
  6374. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6375. // So we use RequestParameters and add method as additional required property.
  6376. const DEFAULTS = {
  6377. method: "GET",
  6378. baseUrl: "https://api.github.com",
  6379. headers: {
  6380. accept: "application/vnd.github.v3+json",
  6381. "user-agent": userAgent
  6382. },
  6383. mediaType: {
  6384. format: "",
  6385. previews: []
  6386. }
  6387. };
  6388. const endpoint = withDefaults(null, DEFAULTS);
  6389. exports.endpoint = endpoint;
  6390. //# sourceMappingURL=index.js.map
  6391. /***/ }),
  6392. /***/ 389:
  6393. /***/ (function(module, __unusedexports, __webpack_require__) {
  6394. "use strict";
  6395. const fs = __webpack_require__(747);
  6396. const shebangCommand = __webpack_require__(866);
  6397. function readShebang(command) {
  6398. // Read the first 150 bytes from the file
  6399. const size = 150;
  6400. let buffer;
  6401. if (Buffer.alloc) {
  6402. // Node.js v4.5+ / v5.10+
  6403. buffer = Buffer.alloc(size);
  6404. } else {
  6405. // Old Node.js API
  6406. buffer = new Buffer(size);
  6407. buffer.fill(0); // zero-fill
  6408. }
  6409. let fd;
  6410. try {
  6411. fd = fs.openSync(command, 'r');
  6412. fs.readSync(fd, buffer, 0, size, 0);
  6413. fs.closeSync(fd);
  6414. } catch (e) { /* Empty */ }
  6415. // Attempt to extract shebang (null is returned if not a shebang)
  6416. return shebangCommand(buffer.toString());
  6417. }
  6418. module.exports = readShebang;
  6419. /***/ }),
  6420. /***/ 402:
  6421. /***/ (function(module, __unusedexports, __webpack_require__) {
  6422. module.exports = Octokit;
  6423. const { request } = __webpack_require__(753);
  6424. const Hook = __webpack_require__(523);
  6425. const parseClientOptions = __webpack_require__(294);
  6426. function Octokit(plugins, options) {
  6427. options = options || {};
  6428. const hook = new Hook.Collection();
  6429. const log = Object.assign(
  6430. {
  6431. debug: () => {},
  6432. info: () => {},
  6433. warn: console.warn,
  6434. error: console.error
  6435. },
  6436. options && options.log
  6437. );
  6438. const api = {
  6439. hook,
  6440. log,
  6441. request: request.defaults(parseClientOptions(options, log, hook))
  6442. };
  6443. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6444. return api;
  6445. }
  6446. /***/ }),
  6447. /***/ 413:
  6448. /***/ (function(module) {
  6449. module.exports = require("stream");
  6450. /***/ }),
  6451. /***/ 417:
  6452. /***/ (function(module) {
  6453. module.exports = require("crypto");
  6454. /***/ }),
  6455. /***/ 427:
  6456. /***/ (function(module, __unusedexports, __webpack_require__) {
  6457. "use strict";
  6458. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6459. // In that case, fall back to a deprecated internal.
  6460. const util = __webpack_require__(669);
  6461. let uv;
  6462. if (typeof util.getSystemErrorName === 'function') {
  6463. module.exports = util.getSystemErrorName;
  6464. } else {
  6465. try {
  6466. uv = process.binding('uv');
  6467. if (typeof uv.errname !== 'function') {
  6468. throw new TypeError('uv.errname is not a function');
  6469. }
  6470. } catch (err) {
  6471. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6472. uv = null;
  6473. }
  6474. module.exports = code => errname(uv, code);
  6475. }
  6476. // Used for testing the fallback behavior
  6477. module.exports.__test__ = errname;
  6478. function errname(uv, code) {
  6479. if (uv) {
  6480. return uv.errname(code);
  6481. }
  6482. if (!(code < 0)) {
  6483. throw new Error('err >= 0');
  6484. }
  6485. return `Unknown system error ${code}`;
  6486. }
  6487. /***/ }),
  6488. /***/ 430:
  6489. /***/ (function(module, __unusedexports, __webpack_require__) {
  6490. module.exports = octokitValidate;
  6491. const validate = __webpack_require__(348);
  6492. function octokitValidate(octokit) {
  6493. octokit.hook.before("request", validate.bind(null, octokit));
  6494. }
  6495. /***/ }),
  6496. /***/ 431:
  6497. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6498. "use strict";
  6499. Object.defineProperty(exports, "__esModule", { value: true });
  6500. const os = __webpack_require__(87);
  6501. /**
  6502. * Commands
  6503. *
  6504. * Command Format:
  6505. * ##[name key=value;key=value]message
  6506. *
  6507. * Examples:
  6508. * ##[warning]This is the user warning message
  6509. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6510. */
  6511. function issueCommand(command, properties, message) {
  6512. const cmd = new Command(command, properties, message);
  6513. process.stdout.write(cmd.toString() + os.EOL);
  6514. }
  6515. exports.issueCommand = issueCommand;
  6516. function issue(name, message = '') {
  6517. issueCommand(name, {}, message);
  6518. }
  6519. exports.issue = issue;
  6520. const CMD_STRING = '::';
  6521. class Command {
  6522. constructor(command, properties, message) {
  6523. if (!command) {
  6524. command = 'missing.command';
  6525. }
  6526. this.command = command;
  6527. this.properties = properties;
  6528. this.message = message;
  6529. }
  6530. toString() {
  6531. let cmdStr = CMD_STRING + this.command;
  6532. if (this.properties && Object.keys(this.properties).length > 0) {
  6533. cmdStr += ' ';
  6534. for (const key in this.properties) {
  6535. if (this.properties.hasOwnProperty(key)) {
  6536. const val = this.properties[key];
  6537. if (val) {
  6538. // safely append the val - avoid blowing up when attempting to
  6539. // call .replace() if message is not a string for some reason
  6540. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6541. }
  6542. }
  6543. }
  6544. }
  6545. cmdStr += CMD_STRING;
  6546. // safely append the message - avoid blowing up when attempting to
  6547. // call .replace() if message is not a string for some reason
  6548. const message = `${this.message || ''}`;
  6549. cmdStr += escapeData(message);
  6550. return cmdStr;
  6551. }
  6552. }
  6553. function escapeData(s) {
  6554. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6555. }
  6556. function escape(s) {
  6557. return s
  6558. .replace(/\r/g, '%0D')
  6559. .replace(/\n/g, '%0A')
  6560. .replace(/]/g, '%5D')
  6561. .replace(/;/g, '%3B');
  6562. }
  6563. //# sourceMappingURL=command.js.map
  6564. /***/ }),
  6565. /***/ 438:
  6566. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6567. "use strict";
  6568. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6569. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6570. return new (P || (P = Promise))(function (resolve, reject) {
  6571. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6572. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6573. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6574. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6575. });
  6576. };
  6577. var __importStar = (this && this.__importStar) || function (mod) {
  6578. if (mod && mod.__esModule) return mod;
  6579. var result = {};
  6580. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6581. result["default"] = mod;
  6582. return result;
  6583. };
  6584. Object.defineProperty(exports, "__esModule", { value: true });
  6585. const assert = __importStar(__webpack_require__(357));
  6586. const core = __importStar(__webpack_require__(470));
  6587. const fs = __importStar(__webpack_require__(747));
  6588. const fsHelper = __importStar(__webpack_require__(618));
  6589. const io = __importStar(__webpack_require__(1));
  6590. const path = __importStar(__webpack_require__(622));
  6591. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6592. return __awaiter(this, void 0, void 0, function* () {
  6593. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6594. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6595. // Indicates whether to delete the directory contents
  6596. let remove = false;
  6597. // Check whether using git or REST API
  6598. if (!git) {
  6599. remove = true;
  6600. }
  6601. // Fetch URL does not match
  6602. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6603. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6604. remove = true;
  6605. }
  6606. else {
  6607. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6608. const lockPaths = [
  6609. path.join(repositoryPath, '.git', 'index.lock'),
  6610. path.join(repositoryPath, '.git', 'shallow.lock')
  6611. ];
  6612. for (const lockPath of lockPaths) {
  6613. try {
  6614. yield io.rmRF(lockPath);
  6615. }
  6616. catch (error) {
  6617. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6618. }
  6619. }
  6620. try {
  6621. core.startGroup('Removing previously created refs, to avoid conflicts');
  6622. // Checkout detached HEAD
  6623. if (!(yield git.isDetached())) {
  6624. yield git.checkoutDetach();
  6625. }
  6626. // Remove all refs/heads/*
  6627. let branches = yield git.branchList(false);
  6628. for (const branch of branches) {
  6629. yield git.branchDelete(false, branch);
  6630. }
  6631. // Remove any conflicting refs/remotes/origin/*
  6632. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6633. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6634. if (ref) {
  6635. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6636. if (ref.startsWith('refs/heads/')) {
  6637. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6638. const upperName1Slash = `${upperName1}/`;
  6639. branches = yield git.branchList(true);
  6640. for (const branch of branches) {
  6641. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6642. const upperName2Slash = `${upperName2}/`;
  6643. if (upperName1.startsWith(upperName2Slash) ||
  6644. upperName2.startsWith(upperName1Slash)) {
  6645. yield git.branchDelete(true, branch);
  6646. }
  6647. }
  6648. }
  6649. }
  6650. core.endGroup();
  6651. // Clean
  6652. if (clean) {
  6653. core.startGroup('Cleaning the repository');
  6654. if (!(yield git.tryClean())) {
  6655. 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}'.`);
  6656. remove = true;
  6657. }
  6658. else if (!(yield git.tryReset())) {
  6659. remove = true;
  6660. }
  6661. core.endGroup();
  6662. if (remove) {
  6663. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6664. }
  6665. }
  6666. }
  6667. catch (error) {
  6668. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6669. remove = true;
  6670. }
  6671. }
  6672. if (remove) {
  6673. // Delete the contents of the directory. Don't delete the directory itself
  6674. // since it might be the current working directory.
  6675. core.info(`Deleting the contents of '${repositoryPath}'`);
  6676. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6677. yield io.rmRF(path.join(repositoryPath, file));
  6678. }
  6679. }
  6680. });
  6681. }
  6682. exports.prepareExistingDirectory = prepareExistingDirectory;
  6683. /***/ }),
  6684. /***/ 453:
  6685. /***/ (function(module, __unusedexports, __webpack_require__) {
  6686. var once = __webpack_require__(969)
  6687. var eos = __webpack_require__(3)
  6688. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6689. var noop = function () {}
  6690. var ancient = /^v?\.0/.test(process.version)
  6691. var isFn = function (fn) {
  6692. return typeof fn === 'function'
  6693. }
  6694. var isFS = function (stream) {
  6695. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6696. if (!fs) return false // browser
  6697. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6698. }
  6699. var isRequest = function (stream) {
  6700. return stream.setHeader && isFn(stream.abort)
  6701. }
  6702. var destroyer = function (stream, reading, writing, callback) {
  6703. callback = once(callback)
  6704. var closed = false
  6705. stream.on('close', function () {
  6706. closed = true
  6707. })
  6708. eos(stream, {readable: reading, writable: writing}, function (err) {
  6709. if (err) return callback(err)
  6710. closed = true
  6711. callback()
  6712. })
  6713. var destroyed = false
  6714. return function (err) {
  6715. if (closed) return
  6716. if (destroyed) return
  6717. destroyed = true
  6718. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6719. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6720. if (isFn(stream.destroy)) return stream.destroy()
  6721. callback(err || new Error('stream was destroyed'))
  6722. }
  6723. }
  6724. var call = function (fn) {
  6725. fn()
  6726. }
  6727. var pipe = function (from, to) {
  6728. return from.pipe(to)
  6729. }
  6730. var pump = function () {
  6731. var streams = Array.prototype.slice.call(arguments)
  6732. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6733. if (Array.isArray(streams[0])) streams = streams[0]
  6734. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6735. var error
  6736. var destroys = streams.map(function (stream, i) {
  6737. var reading = i < streams.length - 1
  6738. var writing = i > 0
  6739. return destroyer(stream, reading, writing, function (err) {
  6740. if (!error) error = err
  6741. if (err) destroys.forEach(call)
  6742. if (reading) return
  6743. destroys.forEach(call)
  6744. callback(error)
  6745. })
  6746. })
  6747. return streams.reduce(pipe)
  6748. }
  6749. module.exports = pump
  6750. /***/ }),
  6751. /***/ 454:
  6752. /***/ (function(module, exports, __webpack_require__) {
  6753. "use strict";
  6754. Object.defineProperty(exports, '__esModule', { value: true });
  6755. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6756. var Stream = _interopDefault(__webpack_require__(413));
  6757. var http = _interopDefault(__webpack_require__(605));
  6758. var Url = _interopDefault(__webpack_require__(835));
  6759. var https = _interopDefault(__webpack_require__(34));
  6760. var zlib = _interopDefault(__webpack_require__(761));
  6761. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6762. // fix for "Readable" isn't a named export issue
  6763. const Readable = Stream.Readable;
  6764. const BUFFER = Symbol('buffer');
  6765. const TYPE = Symbol('type');
  6766. class Blob {
  6767. constructor() {
  6768. this[TYPE] = '';
  6769. const blobParts = arguments[0];
  6770. const options = arguments[1];
  6771. const buffers = [];
  6772. let size = 0;
  6773. if (blobParts) {
  6774. const a = blobParts;
  6775. const length = Number(a.length);
  6776. for (let i = 0; i < length; i++) {
  6777. const element = a[i];
  6778. let buffer;
  6779. if (element instanceof Buffer) {
  6780. buffer = element;
  6781. } else if (ArrayBuffer.isView(element)) {
  6782. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6783. } else if (element instanceof ArrayBuffer) {
  6784. buffer = Buffer.from(element);
  6785. } else if (element instanceof Blob) {
  6786. buffer = element[BUFFER];
  6787. } else {
  6788. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6789. }
  6790. size += buffer.length;
  6791. buffers.push(buffer);
  6792. }
  6793. }
  6794. this[BUFFER] = Buffer.concat(buffers);
  6795. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6796. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6797. this[TYPE] = type;
  6798. }
  6799. }
  6800. get size() {
  6801. return this[BUFFER].length;
  6802. }
  6803. get type() {
  6804. return this[TYPE];
  6805. }
  6806. text() {
  6807. return Promise.resolve(this[BUFFER].toString());
  6808. }
  6809. arrayBuffer() {
  6810. const buf = this[BUFFER];
  6811. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6812. return Promise.resolve(ab);
  6813. }
  6814. stream() {
  6815. const readable = new Readable();
  6816. readable._read = function () {};
  6817. readable.push(this[BUFFER]);
  6818. readable.push(null);
  6819. return readable;
  6820. }
  6821. toString() {
  6822. return '[object Blob]';
  6823. }
  6824. slice() {
  6825. const size = this.size;
  6826. const start = arguments[0];
  6827. const end = arguments[1];
  6828. let relativeStart, relativeEnd;
  6829. if (start === undefined) {
  6830. relativeStart = 0;
  6831. } else if (start < 0) {
  6832. relativeStart = Math.max(size + start, 0);
  6833. } else {
  6834. relativeStart = Math.min(start, size);
  6835. }
  6836. if (end === undefined) {
  6837. relativeEnd = size;
  6838. } else if (end < 0) {
  6839. relativeEnd = Math.max(size + end, 0);
  6840. } else {
  6841. relativeEnd = Math.min(end, size);
  6842. }
  6843. const span = Math.max(relativeEnd - relativeStart, 0);
  6844. const buffer = this[BUFFER];
  6845. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6846. const blob = new Blob([], { type: arguments[2] });
  6847. blob[BUFFER] = slicedBuffer;
  6848. return blob;
  6849. }
  6850. }
  6851. Object.defineProperties(Blob.prototype, {
  6852. size: { enumerable: true },
  6853. type: { enumerable: true },
  6854. slice: { enumerable: true }
  6855. });
  6856. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6857. value: 'Blob',
  6858. writable: false,
  6859. enumerable: false,
  6860. configurable: true
  6861. });
  6862. /**
  6863. * fetch-error.js
  6864. *
  6865. * FetchError interface for operational errors
  6866. */
  6867. /**
  6868. * Create FetchError instance
  6869. *
  6870. * @param String message Error message for human
  6871. * @param String type Error type for machine
  6872. * @param String systemError For Node.js system error
  6873. * @return FetchError
  6874. */
  6875. function FetchError(message, type, systemError) {
  6876. Error.call(this, message);
  6877. this.message = message;
  6878. this.type = type;
  6879. // when err.type is `system`, err.code contains system error code
  6880. if (systemError) {
  6881. this.code = this.errno = systemError.code;
  6882. }
  6883. // hide custom error implementation details from end-users
  6884. Error.captureStackTrace(this, this.constructor);
  6885. }
  6886. FetchError.prototype = Object.create(Error.prototype);
  6887. FetchError.prototype.constructor = FetchError;
  6888. FetchError.prototype.name = 'FetchError';
  6889. let convert;
  6890. try {
  6891. convert = __webpack_require__(18).convert;
  6892. } catch (e) {}
  6893. const INTERNALS = Symbol('Body internals');
  6894. // fix an issue where "PassThrough" isn't a named export for node <10
  6895. const PassThrough = Stream.PassThrough;
  6896. /**
  6897. * Body mixin
  6898. *
  6899. * Ref: https://fetch.spec.whatwg.org/#body
  6900. *
  6901. * @param Stream body Readable stream
  6902. * @param Object opts Response options
  6903. * @return Void
  6904. */
  6905. function Body(body) {
  6906. var _this = this;
  6907. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6908. _ref$size = _ref.size;
  6909. let size = _ref$size === undefined ? 0 : _ref$size;
  6910. var _ref$timeout = _ref.timeout;
  6911. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6912. if (body == null) {
  6913. // body is undefined or null
  6914. body = null;
  6915. } else if (isURLSearchParams(body)) {
  6916. // body is a URLSearchParams
  6917. body = Buffer.from(body.toString());
  6918. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6919. // body is ArrayBuffer
  6920. body = Buffer.from(body);
  6921. } else if (ArrayBuffer.isView(body)) {
  6922. // body is ArrayBufferView
  6923. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6924. } else if (body instanceof Stream) ; else {
  6925. // none of the above
  6926. // coerce to string then buffer
  6927. body = Buffer.from(String(body));
  6928. }
  6929. this[INTERNALS] = {
  6930. body,
  6931. disturbed: false,
  6932. error: null
  6933. };
  6934. this.size = size;
  6935. this.timeout = timeout;
  6936. if (body instanceof Stream) {
  6937. body.on('error', function (err) {
  6938. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6939. _this[INTERNALS].error = error;
  6940. });
  6941. }
  6942. }
  6943. Body.prototype = {
  6944. get body() {
  6945. return this[INTERNALS].body;
  6946. },
  6947. get bodyUsed() {
  6948. return this[INTERNALS].disturbed;
  6949. },
  6950. /**
  6951. * Decode response as ArrayBuffer
  6952. *
  6953. * @return Promise
  6954. */
  6955. arrayBuffer() {
  6956. return consumeBody.call(this).then(function (buf) {
  6957. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6958. });
  6959. },
  6960. /**
  6961. * Return raw response as Blob
  6962. *
  6963. * @return Promise
  6964. */
  6965. blob() {
  6966. let ct = this.headers && this.headers.get('content-type') || '';
  6967. return consumeBody.call(this).then(function (buf) {
  6968. return Object.assign(
  6969. // Prevent copying
  6970. new Blob([], {
  6971. type: ct.toLowerCase()
  6972. }), {
  6973. [BUFFER]: buf
  6974. });
  6975. });
  6976. },
  6977. /**
  6978. * Decode response as json
  6979. *
  6980. * @return Promise
  6981. */
  6982. json() {
  6983. var _this2 = this;
  6984. return consumeBody.call(this).then(function (buffer) {
  6985. try {
  6986. return JSON.parse(buffer.toString());
  6987. } catch (err) {
  6988. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6989. }
  6990. });
  6991. },
  6992. /**
  6993. * Decode response as text
  6994. *
  6995. * @return Promise
  6996. */
  6997. text() {
  6998. return consumeBody.call(this).then(function (buffer) {
  6999. return buffer.toString();
  7000. });
  7001. },
  7002. /**
  7003. * Decode response as buffer (non-spec api)
  7004. *
  7005. * @return Promise
  7006. */
  7007. buffer() {
  7008. return consumeBody.call(this);
  7009. },
  7010. /**
  7011. * Decode response as text, while automatically detecting the encoding and
  7012. * trying to decode to UTF-8 (non-spec api)
  7013. *
  7014. * @return Promise
  7015. */
  7016. textConverted() {
  7017. var _this3 = this;
  7018. return consumeBody.call(this).then(function (buffer) {
  7019. return convertBody(buffer, _this3.headers);
  7020. });
  7021. }
  7022. };
  7023. // In browsers, all properties are enumerable.
  7024. Object.defineProperties(Body.prototype, {
  7025. body: { enumerable: true },
  7026. bodyUsed: { enumerable: true },
  7027. arrayBuffer: { enumerable: true },
  7028. blob: { enumerable: true },
  7029. json: { enumerable: true },
  7030. text: { enumerable: true }
  7031. });
  7032. Body.mixIn = function (proto) {
  7033. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7034. // istanbul ignore else: future proof
  7035. if (!(name in proto)) {
  7036. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7037. Object.defineProperty(proto, name, desc);
  7038. }
  7039. }
  7040. };
  7041. /**
  7042. * Consume and convert an entire Body to a Buffer.
  7043. *
  7044. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7045. *
  7046. * @return Promise
  7047. */
  7048. function consumeBody() {
  7049. var _this4 = this;
  7050. if (this[INTERNALS].disturbed) {
  7051. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7052. }
  7053. this[INTERNALS].disturbed = true;
  7054. if (this[INTERNALS].error) {
  7055. return Body.Promise.reject(this[INTERNALS].error);
  7056. }
  7057. let body = this.body;
  7058. // body is null
  7059. if (body === null) {
  7060. return Body.Promise.resolve(Buffer.alloc(0));
  7061. }
  7062. // body is blob
  7063. if (isBlob(body)) {
  7064. body = body.stream();
  7065. }
  7066. // body is buffer
  7067. if (Buffer.isBuffer(body)) {
  7068. return Body.Promise.resolve(body);
  7069. }
  7070. // istanbul ignore if: should never happen
  7071. if (!(body instanceof Stream)) {
  7072. return Body.Promise.resolve(Buffer.alloc(0));
  7073. }
  7074. // body is stream
  7075. // get ready to actually consume the body
  7076. let accum = [];
  7077. let accumBytes = 0;
  7078. let abort = false;
  7079. return new Body.Promise(function (resolve, reject) {
  7080. let resTimeout;
  7081. // allow timeout on slow response body
  7082. if (_this4.timeout) {
  7083. resTimeout = setTimeout(function () {
  7084. abort = true;
  7085. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7086. }, _this4.timeout);
  7087. }
  7088. // handle stream errors
  7089. body.on('error', function (err) {
  7090. if (err.name === 'AbortError') {
  7091. // if the request was aborted, reject with this Error
  7092. abort = true;
  7093. reject(err);
  7094. } else {
  7095. // other errors, such as incorrect content-encoding
  7096. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7097. }
  7098. });
  7099. body.on('data', function (chunk) {
  7100. if (abort || chunk === null) {
  7101. return;
  7102. }
  7103. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7104. abort = true;
  7105. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7106. return;
  7107. }
  7108. accumBytes += chunk.length;
  7109. accum.push(chunk);
  7110. });
  7111. body.on('end', function () {
  7112. if (abort) {
  7113. return;
  7114. }
  7115. clearTimeout(resTimeout);
  7116. try {
  7117. resolve(Buffer.concat(accum, accumBytes));
  7118. } catch (err) {
  7119. // handle streams that have accumulated too much data (issue #414)
  7120. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7121. }
  7122. });
  7123. });
  7124. }
  7125. /**
  7126. * Detect buffer encoding and convert to target encoding
  7127. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7128. *
  7129. * @param Buffer buffer Incoming buffer
  7130. * @param String encoding Target encoding
  7131. * @return String
  7132. */
  7133. function convertBody(buffer, headers) {
  7134. if (typeof convert !== 'function') {
  7135. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7136. }
  7137. const ct = headers.get('content-type');
  7138. let charset = 'utf-8';
  7139. let res, str;
  7140. // header
  7141. if (ct) {
  7142. res = /charset=([^;]*)/i.exec(ct);
  7143. }
  7144. // no charset in content type, peek at response body for at most 1024 bytes
  7145. str = buffer.slice(0, 1024).toString();
  7146. // html5
  7147. if (!res && str) {
  7148. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7149. }
  7150. // html4
  7151. if (!res && str) {
  7152. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7153. if (res) {
  7154. res = /charset=(.*)/i.exec(res.pop());
  7155. }
  7156. }
  7157. // xml
  7158. if (!res && str) {
  7159. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7160. }
  7161. // found charset
  7162. if (res) {
  7163. charset = res.pop();
  7164. // prevent decode issues when sites use incorrect encoding
  7165. // ref: https://hsivonen.fi/encoding-menu/
  7166. if (charset === 'gb2312' || charset === 'gbk') {
  7167. charset = 'gb18030';
  7168. }
  7169. }
  7170. // turn raw buffers into a single utf-8 buffer
  7171. return convert(buffer, 'UTF-8', charset).toString();
  7172. }
  7173. /**
  7174. * Detect a URLSearchParams object
  7175. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7176. *
  7177. * @param Object obj Object to detect by type or brand
  7178. * @return String
  7179. */
  7180. function isURLSearchParams(obj) {
  7181. // Duck-typing as a necessary condition.
  7182. 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') {
  7183. return false;
  7184. }
  7185. // Brand-checking and more duck-typing as optional condition.
  7186. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7187. }
  7188. /**
  7189. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7190. * @param {*} obj
  7191. * @return {boolean}
  7192. */
  7193. function isBlob(obj) {
  7194. 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]);
  7195. }
  7196. /**
  7197. * Clone body given Res/Req instance
  7198. *
  7199. * @param Mixed instance Response or Request instance
  7200. * @return Mixed
  7201. */
  7202. function clone(instance) {
  7203. let p1, p2;
  7204. let body = instance.body;
  7205. // don't allow cloning a used body
  7206. if (instance.bodyUsed) {
  7207. throw new Error('cannot clone body after it is used');
  7208. }
  7209. // check that body is a stream and not form-data object
  7210. // note: we can't clone the form-data object without having it as a dependency
  7211. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7212. // tee instance body
  7213. p1 = new PassThrough();
  7214. p2 = new PassThrough();
  7215. body.pipe(p1);
  7216. body.pipe(p2);
  7217. // set instance body to teed body and return the other teed body
  7218. instance[INTERNALS].body = p1;
  7219. body = p2;
  7220. }
  7221. return body;
  7222. }
  7223. /**
  7224. * Performs the operation "extract a `Content-Type` value from |object|" as
  7225. * specified in the specification:
  7226. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7227. *
  7228. * This function assumes that instance.body is present.
  7229. *
  7230. * @param Mixed instance Any options.body input
  7231. */
  7232. function extractContentType(body) {
  7233. if (body === null) {
  7234. // body is null
  7235. return null;
  7236. } else if (typeof body === 'string') {
  7237. // body is string
  7238. return 'text/plain;charset=UTF-8';
  7239. } else if (isURLSearchParams(body)) {
  7240. // body is a URLSearchParams
  7241. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7242. } else if (isBlob(body)) {
  7243. // body is blob
  7244. return body.type || null;
  7245. } else if (Buffer.isBuffer(body)) {
  7246. // body is buffer
  7247. return null;
  7248. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7249. // body is ArrayBuffer
  7250. return null;
  7251. } else if (ArrayBuffer.isView(body)) {
  7252. // body is ArrayBufferView
  7253. return null;
  7254. } else if (typeof body.getBoundary === 'function') {
  7255. // detect form data input from form-data module
  7256. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7257. } else if (body instanceof Stream) {
  7258. // body is stream
  7259. // can't really do much about this
  7260. return null;
  7261. } else {
  7262. // Body constructor defaults other things to string
  7263. return 'text/plain;charset=UTF-8';
  7264. }
  7265. }
  7266. /**
  7267. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7268. * For us, we have to explicitly get it with a function.
  7269. *
  7270. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7271. *
  7272. * @param Body instance Instance of Body
  7273. * @return Number? Number of bytes, or null if not possible
  7274. */
  7275. function getTotalBytes(instance) {
  7276. const body = instance.body;
  7277. if (body === null) {
  7278. // body is null
  7279. return 0;
  7280. } else if (isBlob(body)) {
  7281. return body.size;
  7282. } else if (Buffer.isBuffer(body)) {
  7283. // body is buffer
  7284. return body.length;
  7285. } else if (body && typeof body.getLengthSync === 'function') {
  7286. // detect form data input from form-data module
  7287. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7288. body.hasKnownLength && body.hasKnownLength()) {
  7289. // 2.x
  7290. return body.getLengthSync();
  7291. }
  7292. return null;
  7293. } else {
  7294. // body is stream
  7295. return null;
  7296. }
  7297. }
  7298. /**
  7299. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7300. *
  7301. * @param Body instance Instance of Body
  7302. * @return Void
  7303. */
  7304. function writeToStream(dest, instance) {
  7305. const body = instance.body;
  7306. if (body === null) {
  7307. // body is null
  7308. dest.end();
  7309. } else if (isBlob(body)) {
  7310. body.stream().pipe(dest);
  7311. } else if (Buffer.isBuffer(body)) {
  7312. // body is buffer
  7313. dest.write(body);
  7314. dest.end();
  7315. } else {
  7316. // body is stream
  7317. body.pipe(dest);
  7318. }
  7319. }
  7320. // expose Promise
  7321. Body.Promise = global.Promise;
  7322. /**
  7323. * headers.js
  7324. *
  7325. * Headers class offers convenient helpers
  7326. */
  7327. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7328. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7329. function validateName(name) {
  7330. name = `${name}`;
  7331. if (invalidTokenRegex.test(name) || name === '') {
  7332. throw new TypeError(`${name} is not a legal HTTP header name`);
  7333. }
  7334. }
  7335. function validateValue(value) {
  7336. value = `${value}`;
  7337. if (invalidHeaderCharRegex.test(value)) {
  7338. throw new TypeError(`${value} is not a legal HTTP header value`);
  7339. }
  7340. }
  7341. /**
  7342. * Find the key in the map object given a header name.
  7343. *
  7344. * Returns undefined if not found.
  7345. *
  7346. * @param String name Header name
  7347. * @return String|Undefined
  7348. */
  7349. function find(map, name) {
  7350. name = name.toLowerCase();
  7351. for (const key in map) {
  7352. if (key.toLowerCase() === name) {
  7353. return key;
  7354. }
  7355. }
  7356. return undefined;
  7357. }
  7358. const MAP = Symbol('map');
  7359. class Headers {
  7360. /**
  7361. * Headers class
  7362. *
  7363. * @param Object headers Response headers
  7364. * @return Void
  7365. */
  7366. constructor() {
  7367. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7368. this[MAP] = Object.create(null);
  7369. if (init instanceof Headers) {
  7370. const rawHeaders = init.raw();
  7371. const headerNames = Object.keys(rawHeaders);
  7372. for (const headerName of headerNames) {
  7373. for (const value of rawHeaders[headerName]) {
  7374. this.append(headerName, value);
  7375. }
  7376. }
  7377. return;
  7378. }
  7379. // We don't worry about converting prop to ByteString here as append()
  7380. // will handle it.
  7381. if (init == null) ; else if (typeof init === 'object') {
  7382. const method = init[Symbol.iterator];
  7383. if (method != null) {
  7384. if (typeof method !== 'function') {
  7385. throw new TypeError('Header pairs must be iterable');
  7386. }
  7387. // sequence<sequence<ByteString>>
  7388. // Note: per spec we have to first exhaust the lists then process them
  7389. const pairs = [];
  7390. for (const pair of init) {
  7391. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7392. throw new TypeError('Each header pair must be iterable');
  7393. }
  7394. pairs.push(Array.from(pair));
  7395. }
  7396. for (const pair of pairs) {
  7397. if (pair.length !== 2) {
  7398. throw new TypeError('Each header pair must be a name/value tuple');
  7399. }
  7400. this.append(pair[0], pair[1]);
  7401. }
  7402. } else {
  7403. // record<ByteString, ByteString>
  7404. for (const key of Object.keys(init)) {
  7405. const value = init[key];
  7406. this.append(key, value);
  7407. }
  7408. }
  7409. } else {
  7410. throw new TypeError('Provided initializer must be an object');
  7411. }
  7412. }
  7413. /**
  7414. * Return combined header value given name
  7415. *
  7416. * @param String name Header name
  7417. * @return Mixed
  7418. */
  7419. get(name) {
  7420. name = `${name}`;
  7421. validateName(name);
  7422. const key = find(this[MAP], name);
  7423. if (key === undefined) {
  7424. return null;
  7425. }
  7426. return this[MAP][key].join(', ');
  7427. }
  7428. /**
  7429. * Iterate over all headers
  7430. *
  7431. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7432. * @param Boolean thisArg `this` context for callback function
  7433. * @return Void
  7434. */
  7435. forEach(callback) {
  7436. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7437. let pairs = getHeaders(this);
  7438. let i = 0;
  7439. while (i < pairs.length) {
  7440. var _pairs$i = pairs[i];
  7441. const name = _pairs$i[0],
  7442. value = _pairs$i[1];
  7443. callback.call(thisArg, value, name, this);
  7444. pairs = getHeaders(this);
  7445. i++;
  7446. }
  7447. }
  7448. /**
  7449. * Overwrite header values given name
  7450. *
  7451. * @param String name Header name
  7452. * @param String value Header value
  7453. * @return Void
  7454. */
  7455. set(name, value) {
  7456. name = `${name}`;
  7457. value = `${value}`;
  7458. validateName(name);
  7459. validateValue(value);
  7460. const key = find(this[MAP], name);
  7461. this[MAP][key !== undefined ? key : name] = [value];
  7462. }
  7463. /**
  7464. * Append a value onto existing header
  7465. *
  7466. * @param String name Header name
  7467. * @param String value Header value
  7468. * @return Void
  7469. */
  7470. append(name, value) {
  7471. name = `${name}`;
  7472. value = `${value}`;
  7473. validateName(name);
  7474. validateValue(value);
  7475. const key = find(this[MAP], name);
  7476. if (key !== undefined) {
  7477. this[MAP][key].push(value);
  7478. } else {
  7479. this[MAP][name] = [value];
  7480. }
  7481. }
  7482. /**
  7483. * Check for header name existence
  7484. *
  7485. * @param String name Header name
  7486. * @return Boolean
  7487. */
  7488. has(name) {
  7489. name = `${name}`;
  7490. validateName(name);
  7491. return find(this[MAP], name) !== undefined;
  7492. }
  7493. /**
  7494. * Delete all header values given name
  7495. *
  7496. * @param String name Header name
  7497. * @return Void
  7498. */
  7499. delete(name) {
  7500. name = `${name}`;
  7501. validateName(name);
  7502. const key = find(this[MAP], name);
  7503. if (key !== undefined) {
  7504. delete this[MAP][key];
  7505. }
  7506. }
  7507. /**
  7508. * Return raw headers (non-spec api)
  7509. *
  7510. * @return Object
  7511. */
  7512. raw() {
  7513. return this[MAP];
  7514. }
  7515. /**
  7516. * Get an iterator on keys.
  7517. *
  7518. * @return Iterator
  7519. */
  7520. keys() {
  7521. return createHeadersIterator(this, 'key');
  7522. }
  7523. /**
  7524. * Get an iterator on values.
  7525. *
  7526. * @return Iterator
  7527. */
  7528. values() {
  7529. return createHeadersIterator(this, 'value');
  7530. }
  7531. /**
  7532. * Get an iterator on entries.
  7533. *
  7534. * This is the default iterator of the Headers object.
  7535. *
  7536. * @return Iterator
  7537. */
  7538. [Symbol.iterator]() {
  7539. return createHeadersIterator(this, 'key+value');
  7540. }
  7541. }
  7542. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7543. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7544. value: 'Headers',
  7545. writable: false,
  7546. enumerable: false,
  7547. configurable: true
  7548. });
  7549. Object.defineProperties(Headers.prototype, {
  7550. get: { enumerable: true },
  7551. forEach: { enumerable: true },
  7552. set: { enumerable: true },
  7553. append: { enumerable: true },
  7554. has: { enumerable: true },
  7555. delete: { enumerable: true },
  7556. keys: { enumerable: true },
  7557. values: { enumerable: true },
  7558. entries: { enumerable: true }
  7559. });
  7560. function getHeaders(headers) {
  7561. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7562. const keys = Object.keys(headers[MAP]).sort();
  7563. return keys.map(kind === 'key' ? function (k) {
  7564. return k.toLowerCase();
  7565. } : kind === 'value' ? function (k) {
  7566. return headers[MAP][k].join(', ');
  7567. } : function (k) {
  7568. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7569. });
  7570. }
  7571. const INTERNAL = Symbol('internal');
  7572. function createHeadersIterator(target, kind) {
  7573. const iterator = Object.create(HeadersIteratorPrototype);
  7574. iterator[INTERNAL] = {
  7575. target,
  7576. kind,
  7577. index: 0
  7578. };
  7579. return iterator;
  7580. }
  7581. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7582. next() {
  7583. // istanbul ignore if
  7584. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7585. throw new TypeError('Value of `this` is not a HeadersIterator');
  7586. }
  7587. var _INTERNAL = this[INTERNAL];
  7588. const target = _INTERNAL.target,
  7589. kind = _INTERNAL.kind,
  7590. index = _INTERNAL.index;
  7591. const values = getHeaders(target, kind);
  7592. const len = values.length;
  7593. if (index >= len) {
  7594. return {
  7595. value: undefined,
  7596. done: true
  7597. };
  7598. }
  7599. this[INTERNAL].index = index + 1;
  7600. return {
  7601. value: values[index],
  7602. done: false
  7603. };
  7604. }
  7605. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7606. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7607. value: 'HeadersIterator',
  7608. writable: false,
  7609. enumerable: false,
  7610. configurable: true
  7611. });
  7612. /**
  7613. * Export the Headers object in a form that Node.js can consume.
  7614. *
  7615. * @param Headers headers
  7616. * @return Object
  7617. */
  7618. function exportNodeCompatibleHeaders(headers) {
  7619. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7620. // http.request() only supports string as Host header. This hack makes
  7621. // specifying custom Host header possible.
  7622. const hostHeaderKey = find(headers[MAP], 'Host');
  7623. if (hostHeaderKey !== undefined) {
  7624. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7625. }
  7626. return obj;
  7627. }
  7628. /**
  7629. * Create a Headers object from an object of headers, ignoring those that do
  7630. * not conform to HTTP grammar productions.
  7631. *
  7632. * @param Object obj Object of headers
  7633. * @return Headers
  7634. */
  7635. function createHeadersLenient(obj) {
  7636. const headers = new Headers();
  7637. for (const name of Object.keys(obj)) {
  7638. if (invalidTokenRegex.test(name)) {
  7639. continue;
  7640. }
  7641. if (Array.isArray(obj[name])) {
  7642. for (const val of obj[name]) {
  7643. if (invalidHeaderCharRegex.test(val)) {
  7644. continue;
  7645. }
  7646. if (headers[MAP][name] === undefined) {
  7647. headers[MAP][name] = [val];
  7648. } else {
  7649. headers[MAP][name].push(val);
  7650. }
  7651. }
  7652. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7653. headers[MAP][name] = [obj[name]];
  7654. }
  7655. }
  7656. return headers;
  7657. }
  7658. const INTERNALS$1 = Symbol('Response internals');
  7659. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7660. const STATUS_CODES = http.STATUS_CODES;
  7661. /**
  7662. * Response class
  7663. *
  7664. * @param Stream body Readable stream
  7665. * @param Object opts Response options
  7666. * @return Void
  7667. */
  7668. class Response {
  7669. constructor() {
  7670. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7671. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7672. Body.call(this, body, opts);
  7673. const status = opts.status || 200;
  7674. const headers = new Headers(opts.headers);
  7675. if (body != null && !headers.has('Content-Type')) {
  7676. const contentType = extractContentType(body);
  7677. if (contentType) {
  7678. headers.append('Content-Type', contentType);
  7679. }
  7680. }
  7681. this[INTERNALS$1] = {
  7682. url: opts.url,
  7683. status,
  7684. statusText: opts.statusText || STATUS_CODES[status],
  7685. headers,
  7686. counter: opts.counter
  7687. };
  7688. }
  7689. get url() {
  7690. return this[INTERNALS$1].url || '';
  7691. }
  7692. get status() {
  7693. return this[INTERNALS$1].status;
  7694. }
  7695. /**
  7696. * Convenience property representing if the request ended normally
  7697. */
  7698. get ok() {
  7699. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7700. }
  7701. get redirected() {
  7702. return this[INTERNALS$1].counter > 0;
  7703. }
  7704. get statusText() {
  7705. return this[INTERNALS$1].statusText;
  7706. }
  7707. get headers() {
  7708. return this[INTERNALS$1].headers;
  7709. }
  7710. /**
  7711. * Clone this response
  7712. *
  7713. * @return Response
  7714. */
  7715. clone() {
  7716. return new Response(clone(this), {
  7717. url: this.url,
  7718. status: this.status,
  7719. statusText: this.statusText,
  7720. headers: this.headers,
  7721. ok: this.ok,
  7722. redirected: this.redirected
  7723. });
  7724. }
  7725. }
  7726. Body.mixIn(Response.prototype);
  7727. Object.defineProperties(Response.prototype, {
  7728. url: { enumerable: true },
  7729. status: { enumerable: true },
  7730. ok: { enumerable: true },
  7731. redirected: { enumerable: true },
  7732. statusText: { enumerable: true },
  7733. headers: { enumerable: true },
  7734. clone: { enumerable: true }
  7735. });
  7736. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7737. value: 'Response',
  7738. writable: false,
  7739. enumerable: false,
  7740. configurable: true
  7741. });
  7742. const INTERNALS$2 = Symbol('Request internals');
  7743. // fix an issue where "format", "parse" aren't a named export for node <10
  7744. const parse_url = Url.parse;
  7745. const format_url = Url.format;
  7746. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7747. /**
  7748. * Check if a value is an instance of Request.
  7749. *
  7750. * @param Mixed input
  7751. * @return Boolean
  7752. */
  7753. function isRequest(input) {
  7754. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7755. }
  7756. function isAbortSignal(signal) {
  7757. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7758. return !!(proto && proto.constructor.name === 'AbortSignal');
  7759. }
  7760. /**
  7761. * Request class
  7762. *
  7763. * @param Mixed input Url or Request instance
  7764. * @param Object init Custom options
  7765. * @return Void
  7766. */
  7767. class Request {
  7768. constructor(input) {
  7769. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7770. let parsedURL;
  7771. // normalize input
  7772. if (!isRequest(input)) {
  7773. if (input && input.href) {
  7774. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7775. // will fall into this branch also (since their `toString()` will return
  7776. // `href` property anyway)
  7777. parsedURL = parse_url(input.href);
  7778. } else {
  7779. // coerce input to a string before attempting to parse
  7780. parsedURL = parse_url(`${input}`);
  7781. }
  7782. input = {};
  7783. } else {
  7784. parsedURL = parse_url(input.url);
  7785. }
  7786. let method = init.method || input.method || 'GET';
  7787. method = method.toUpperCase();
  7788. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7789. throw new TypeError('Request with GET/HEAD method cannot have body');
  7790. }
  7791. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7792. Body.call(this, inputBody, {
  7793. timeout: init.timeout || input.timeout || 0,
  7794. size: init.size || input.size || 0
  7795. });
  7796. const headers = new Headers(init.headers || input.headers || {});
  7797. if (inputBody != null && !headers.has('Content-Type')) {
  7798. const contentType = extractContentType(inputBody);
  7799. if (contentType) {
  7800. headers.append('Content-Type', contentType);
  7801. }
  7802. }
  7803. let signal = isRequest(input) ? input.signal : null;
  7804. if ('signal' in init) signal = init.signal;
  7805. if (signal != null && !isAbortSignal(signal)) {
  7806. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7807. }
  7808. this[INTERNALS$2] = {
  7809. method,
  7810. redirect: init.redirect || input.redirect || 'follow',
  7811. headers,
  7812. parsedURL,
  7813. signal
  7814. };
  7815. // node-fetch-only options
  7816. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7817. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7818. this.counter = init.counter || input.counter || 0;
  7819. this.agent = init.agent || input.agent;
  7820. }
  7821. get method() {
  7822. return this[INTERNALS$2].method;
  7823. }
  7824. get url() {
  7825. return format_url(this[INTERNALS$2].parsedURL);
  7826. }
  7827. get headers() {
  7828. return this[INTERNALS$2].headers;
  7829. }
  7830. get redirect() {
  7831. return this[INTERNALS$2].redirect;
  7832. }
  7833. get signal() {
  7834. return this[INTERNALS$2].signal;
  7835. }
  7836. /**
  7837. * Clone this request
  7838. *
  7839. * @return Request
  7840. */
  7841. clone() {
  7842. return new Request(this);
  7843. }
  7844. }
  7845. Body.mixIn(Request.prototype);
  7846. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7847. value: 'Request',
  7848. writable: false,
  7849. enumerable: false,
  7850. configurable: true
  7851. });
  7852. Object.defineProperties(Request.prototype, {
  7853. method: { enumerable: true },
  7854. url: { enumerable: true },
  7855. headers: { enumerable: true },
  7856. redirect: { enumerable: true },
  7857. clone: { enumerable: true },
  7858. signal: { enumerable: true }
  7859. });
  7860. /**
  7861. * Convert a Request to Node.js http request options.
  7862. *
  7863. * @param Request A Request instance
  7864. * @return Object The options object to be passed to http.request
  7865. */
  7866. function getNodeRequestOptions(request) {
  7867. const parsedURL = request[INTERNALS$2].parsedURL;
  7868. const headers = new Headers(request[INTERNALS$2].headers);
  7869. // fetch step 1.3
  7870. if (!headers.has('Accept')) {
  7871. headers.set('Accept', '*/*');
  7872. }
  7873. // Basic fetch
  7874. if (!parsedURL.protocol || !parsedURL.hostname) {
  7875. throw new TypeError('Only absolute URLs are supported');
  7876. }
  7877. if (!/^https?:$/.test(parsedURL.protocol)) {
  7878. throw new TypeError('Only HTTP(S) protocols are supported');
  7879. }
  7880. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7881. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7882. }
  7883. // HTTP-network-or-cache fetch steps 2.4-2.7
  7884. let contentLengthValue = null;
  7885. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7886. contentLengthValue = '0';
  7887. }
  7888. if (request.body != null) {
  7889. const totalBytes = getTotalBytes(request);
  7890. if (typeof totalBytes === 'number') {
  7891. contentLengthValue = String(totalBytes);
  7892. }
  7893. }
  7894. if (contentLengthValue) {
  7895. headers.set('Content-Length', contentLengthValue);
  7896. }
  7897. // HTTP-network-or-cache fetch step 2.11
  7898. if (!headers.has('User-Agent')) {
  7899. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7900. }
  7901. // HTTP-network-or-cache fetch step 2.15
  7902. if (request.compress && !headers.has('Accept-Encoding')) {
  7903. headers.set('Accept-Encoding', 'gzip,deflate');
  7904. }
  7905. let agent = request.agent;
  7906. if (typeof agent === 'function') {
  7907. agent = agent(parsedURL);
  7908. }
  7909. if (!headers.has('Connection') && !agent) {
  7910. headers.set('Connection', 'close');
  7911. }
  7912. // HTTP-network fetch step 4.2
  7913. // chunked encoding is handled by Node.js
  7914. return Object.assign({}, parsedURL, {
  7915. method: request.method,
  7916. headers: exportNodeCompatibleHeaders(headers),
  7917. agent
  7918. });
  7919. }
  7920. /**
  7921. * abort-error.js
  7922. *
  7923. * AbortError interface for cancelled requests
  7924. */
  7925. /**
  7926. * Create AbortError instance
  7927. *
  7928. * @param String message Error message for human
  7929. * @return AbortError
  7930. */
  7931. function AbortError(message) {
  7932. Error.call(this, message);
  7933. this.type = 'aborted';
  7934. this.message = message;
  7935. // hide custom error implementation details from end-users
  7936. Error.captureStackTrace(this, this.constructor);
  7937. }
  7938. AbortError.prototype = Object.create(Error.prototype);
  7939. AbortError.prototype.constructor = AbortError;
  7940. AbortError.prototype.name = 'AbortError';
  7941. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7942. const PassThrough$1 = Stream.PassThrough;
  7943. const resolve_url = Url.resolve;
  7944. /**
  7945. * Fetch function
  7946. *
  7947. * @param Mixed url Absolute url or Request instance
  7948. * @param Object opts Fetch options
  7949. * @return Promise
  7950. */
  7951. function fetch(url, opts) {
  7952. // allow custom promise
  7953. if (!fetch.Promise) {
  7954. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7955. }
  7956. Body.Promise = fetch.Promise;
  7957. // wrap http.request into fetch
  7958. return new fetch.Promise(function (resolve, reject) {
  7959. // build request object
  7960. const request = new Request(url, opts);
  7961. const options = getNodeRequestOptions(request);
  7962. const send = (options.protocol === 'https:' ? https : http).request;
  7963. const signal = request.signal;
  7964. let response = null;
  7965. const abort = function abort() {
  7966. let error = new AbortError('The user aborted a request.');
  7967. reject(error);
  7968. if (request.body && request.body instanceof Stream.Readable) {
  7969. request.body.destroy(error);
  7970. }
  7971. if (!response || !response.body) return;
  7972. response.body.emit('error', error);
  7973. };
  7974. if (signal && signal.aborted) {
  7975. abort();
  7976. return;
  7977. }
  7978. const abortAndFinalize = function abortAndFinalize() {
  7979. abort();
  7980. finalize();
  7981. };
  7982. // send request
  7983. const req = send(options);
  7984. let reqTimeout;
  7985. if (signal) {
  7986. signal.addEventListener('abort', abortAndFinalize);
  7987. }
  7988. function finalize() {
  7989. req.abort();
  7990. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7991. clearTimeout(reqTimeout);
  7992. }
  7993. if (request.timeout) {
  7994. req.once('socket', function (socket) {
  7995. reqTimeout = setTimeout(function () {
  7996. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7997. finalize();
  7998. }, request.timeout);
  7999. });
  8000. }
  8001. req.on('error', function (err) {
  8002. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8003. finalize();
  8004. });
  8005. req.on('response', function (res) {
  8006. clearTimeout(reqTimeout);
  8007. const headers = createHeadersLenient(res.headers);
  8008. // HTTP fetch step 5
  8009. if (fetch.isRedirect(res.statusCode)) {
  8010. // HTTP fetch step 5.2
  8011. const location = headers.get('Location');
  8012. // HTTP fetch step 5.3
  8013. const locationURL = location === null ? null : resolve_url(request.url, location);
  8014. // HTTP fetch step 5.5
  8015. switch (request.redirect) {
  8016. case 'error':
  8017. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8018. finalize();
  8019. return;
  8020. case 'manual':
  8021. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8022. if (locationURL !== null) {
  8023. // handle corrupted header
  8024. try {
  8025. headers.set('Location', locationURL);
  8026. } catch (err) {
  8027. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8028. reject(err);
  8029. }
  8030. }
  8031. break;
  8032. case 'follow':
  8033. // HTTP-redirect fetch step 2
  8034. if (locationURL === null) {
  8035. break;
  8036. }
  8037. // HTTP-redirect fetch step 5
  8038. if (request.counter >= request.follow) {
  8039. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8040. finalize();
  8041. return;
  8042. }
  8043. // HTTP-redirect fetch step 6 (counter increment)
  8044. // Create a new Request object.
  8045. const requestOpts = {
  8046. headers: new Headers(request.headers),
  8047. follow: request.follow,
  8048. counter: request.counter + 1,
  8049. agent: request.agent,
  8050. compress: request.compress,
  8051. method: request.method,
  8052. body: request.body,
  8053. signal: request.signal,
  8054. timeout: request.timeout
  8055. };
  8056. // HTTP-redirect fetch step 9
  8057. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8058. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8059. finalize();
  8060. return;
  8061. }
  8062. // HTTP-redirect fetch step 11
  8063. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8064. requestOpts.method = 'GET';
  8065. requestOpts.body = undefined;
  8066. requestOpts.headers.delete('content-length');
  8067. }
  8068. // HTTP-redirect fetch step 15
  8069. resolve(fetch(new Request(locationURL, requestOpts)));
  8070. finalize();
  8071. return;
  8072. }
  8073. }
  8074. // prepare response
  8075. res.once('end', function () {
  8076. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8077. });
  8078. let body = res.pipe(new PassThrough$1());
  8079. const response_options = {
  8080. url: request.url,
  8081. status: res.statusCode,
  8082. statusText: res.statusMessage,
  8083. headers: headers,
  8084. size: request.size,
  8085. timeout: request.timeout,
  8086. counter: request.counter
  8087. };
  8088. // HTTP-network fetch step 12.1.1.3
  8089. const codings = headers.get('Content-Encoding');
  8090. // HTTP-network fetch step 12.1.1.4: handle content codings
  8091. // in following scenarios we ignore compression support
  8092. // 1. compression support is disabled
  8093. // 2. HEAD request
  8094. // 3. no Content-Encoding header
  8095. // 4. no content response (204)
  8096. // 5. content not modified response (304)
  8097. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8098. response = new Response(body, response_options);
  8099. resolve(response);
  8100. return;
  8101. }
  8102. // For Node v6+
  8103. // Be less strict when decoding compressed responses, since sometimes
  8104. // servers send slightly invalid responses that are still accepted
  8105. // by common browsers.
  8106. // Always using Z_SYNC_FLUSH is what cURL does.
  8107. const zlibOptions = {
  8108. flush: zlib.Z_SYNC_FLUSH,
  8109. finishFlush: zlib.Z_SYNC_FLUSH
  8110. };
  8111. // for gzip
  8112. if (codings == 'gzip' || codings == 'x-gzip') {
  8113. body = body.pipe(zlib.createGunzip(zlibOptions));
  8114. response = new Response(body, response_options);
  8115. resolve(response);
  8116. return;
  8117. }
  8118. // for deflate
  8119. if (codings == 'deflate' || codings == 'x-deflate') {
  8120. // handle the infamous raw deflate response from old servers
  8121. // a hack for old IIS and Apache servers
  8122. const raw = res.pipe(new PassThrough$1());
  8123. raw.once('data', function (chunk) {
  8124. // see http://stackoverflow.com/questions/37519828
  8125. if ((chunk[0] & 0x0F) === 0x08) {
  8126. body = body.pipe(zlib.createInflate());
  8127. } else {
  8128. body = body.pipe(zlib.createInflateRaw());
  8129. }
  8130. response = new Response(body, response_options);
  8131. resolve(response);
  8132. });
  8133. return;
  8134. }
  8135. // for br
  8136. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8137. body = body.pipe(zlib.createBrotliDecompress());
  8138. response = new Response(body, response_options);
  8139. resolve(response);
  8140. return;
  8141. }
  8142. // otherwise, use response as-is
  8143. response = new Response(body, response_options);
  8144. resolve(response);
  8145. });
  8146. writeToStream(req, request);
  8147. });
  8148. }
  8149. /**
  8150. * Redirect code matching
  8151. *
  8152. * @param Number code Status code
  8153. * @return Boolean
  8154. */
  8155. fetch.isRedirect = function (code) {
  8156. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8157. };
  8158. // expose Promise
  8159. fetch.Promise = global.Promise;
  8160. module.exports = exports = fetch;
  8161. Object.defineProperty(exports, "__esModule", { value: true });
  8162. exports.default = exports;
  8163. exports.Headers = Headers;
  8164. exports.Request = Request;
  8165. exports.Response = Response;
  8166. exports.FetchError = FetchError;
  8167. /***/ }),
  8168. /***/ 462:
  8169. /***/ (function(module) {
  8170. "use strict";
  8171. // See http://www.robvanderwoude.com/escapechars.php
  8172. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8173. function escapeCommand(arg) {
  8174. // Escape meta chars
  8175. arg = arg.replace(metaCharsRegExp, '^$1');
  8176. return arg;
  8177. }
  8178. function escapeArgument(arg, doubleEscapeMetaChars) {
  8179. // Convert to string
  8180. arg = `${arg}`;
  8181. // Algorithm below is based on https://qntm.org/cmd
  8182. // Sequence of backslashes followed by a double quote:
  8183. // double up all the backslashes and escape the double quote
  8184. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8185. // Sequence of backslashes followed by the end of the string
  8186. // (which will become a double quote later):
  8187. // double up all the backslashes
  8188. arg = arg.replace(/(\\*)$/, '$1$1');
  8189. // All other backslashes occur literally
  8190. // Quote the whole thing:
  8191. arg = `"${arg}"`;
  8192. // Escape meta chars
  8193. arg = arg.replace(metaCharsRegExp, '^$1');
  8194. // Double escape meta chars if necessary
  8195. if (doubleEscapeMetaChars) {
  8196. arg = arg.replace(metaCharsRegExp, '^$1');
  8197. }
  8198. return arg;
  8199. }
  8200. module.exports.command = escapeCommand;
  8201. module.exports.argument = escapeArgument;
  8202. /***/ }),
  8203. /***/ 463:
  8204. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8205. "use strict";
  8206. Object.defineProperty(exports, '__esModule', { value: true });
  8207. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8208. var deprecation = __webpack_require__(692);
  8209. var once = _interopDefault(__webpack_require__(969));
  8210. const logOnce = once(deprecation => console.warn(deprecation));
  8211. /**
  8212. * Error with extra properties to help with debugging
  8213. */
  8214. class RequestError extends Error {
  8215. constructor(message, statusCode, options) {
  8216. super(message); // Maintains proper stack trace (only available on V8)
  8217. /* istanbul ignore next */
  8218. if (Error.captureStackTrace) {
  8219. Error.captureStackTrace(this, this.constructor);
  8220. }
  8221. this.name = "HttpError";
  8222. this.status = statusCode;
  8223. Object.defineProperty(this, "code", {
  8224. get() {
  8225. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8226. return statusCode;
  8227. }
  8228. });
  8229. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8230. const requestCopy = Object.assign({}, options.request);
  8231. if (options.request.headers.authorization) {
  8232. requestCopy.headers = Object.assign({}, options.request.headers, {
  8233. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8234. });
  8235. }
  8236. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8237. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8238. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8239. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8240. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8241. this.request = requestCopy;
  8242. }
  8243. }
  8244. exports.RequestError = RequestError;
  8245. //# sourceMappingURL=index.js.map
  8246. /***/ }),
  8247. /***/ 464:
  8248. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8249. "use strict";
  8250. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8251. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8252. return new (P || (P = Promise))(function (resolve, reject) {
  8253. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8254. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8255. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8256. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8257. });
  8258. };
  8259. var __importStar = (this && this.__importStar) || function (mod) {
  8260. if (mod && mod.__esModule) return mod;
  8261. var result = {};
  8262. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8263. result["default"] = mod;
  8264. return result;
  8265. };
  8266. var __importDefault = (this && this.__importDefault) || function (mod) {
  8267. return (mod && mod.__esModule) ? mod : { "default": mod };
  8268. };
  8269. Object.defineProperty(exports, "__esModule", { value: true });
  8270. const assert = __importStar(__webpack_require__(357));
  8271. const core = __importStar(__webpack_require__(470));
  8272. const fs = __importStar(__webpack_require__(747));
  8273. const github = __importStar(__webpack_require__(469));
  8274. const io = __importStar(__webpack_require__(1));
  8275. const path = __importStar(__webpack_require__(622));
  8276. const retryHelper = __importStar(__webpack_require__(587));
  8277. const toolCache = __importStar(__webpack_require__(533));
  8278. const v4_1 = __importDefault(__webpack_require__(826));
  8279. const IS_WINDOWS = process.platform === 'win32';
  8280. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8281. return __awaiter(this, void 0, void 0, function* () {
  8282. // Download the archive
  8283. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8284. core.info('Downloading the archive');
  8285. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8286. }));
  8287. // Write archive to disk
  8288. core.info('Writing archive to disk');
  8289. const uniqueId = v4_1.default();
  8290. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8291. yield fs.promises.writeFile(archivePath, archiveData);
  8292. archiveData = Buffer.from(''); // Free memory
  8293. // Extract archive
  8294. core.info('Extracting the archive');
  8295. const extractPath = path.join(repositoryPath, uniqueId);
  8296. yield io.mkdirP(extractPath);
  8297. if (IS_WINDOWS) {
  8298. yield toolCache.extractZip(archivePath, extractPath);
  8299. }
  8300. else {
  8301. yield toolCache.extractTar(archivePath, extractPath);
  8302. }
  8303. io.rmRF(archivePath);
  8304. // Determine the path of the repository content. The archive contains
  8305. // a top-level folder and the repository content is inside.
  8306. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8307. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8308. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8309. core.info(`Resolved version ${archiveVersion}`);
  8310. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8311. // Move the files
  8312. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8313. const sourcePath = path.join(tempRepositoryPath, fileName);
  8314. const targetPath = path.join(repositoryPath, fileName);
  8315. if (IS_WINDOWS) {
  8316. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8317. }
  8318. else {
  8319. yield io.mv(sourcePath, targetPath);
  8320. }
  8321. }
  8322. io.rmRF(extractPath);
  8323. });
  8324. }
  8325. exports.downloadRepository = downloadRepository;
  8326. function downloadArchive(authToken, owner, repo, ref, commit) {
  8327. return __awaiter(this, void 0, void 0, function* () {
  8328. const octokit = new github.GitHub(authToken);
  8329. const params = {
  8330. owner: owner,
  8331. repo: repo,
  8332. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8333. ref: commit || ref
  8334. };
  8335. const response = yield octokit.repos.getArchiveLink(params);
  8336. if (response.status != 200) {
  8337. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8338. }
  8339. return Buffer.from(response.data); // response.data is ArrayBuffer
  8340. });
  8341. }
  8342. /***/ }),
  8343. /***/ 469:
  8344. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8345. "use strict";
  8346. var __importStar = (this && this.__importStar) || function (mod) {
  8347. if (mod && mod.__esModule) return mod;
  8348. var result = {};
  8349. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8350. result["default"] = mod;
  8351. return result;
  8352. };
  8353. Object.defineProperty(exports, "__esModule", { value: true });
  8354. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8355. const graphql_1 = __webpack_require__(898);
  8356. const rest_1 = __webpack_require__(0);
  8357. const Context = __importStar(__webpack_require__(262));
  8358. const httpClient = __importStar(__webpack_require__(539));
  8359. // We need this in order to extend Octokit
  8360. rest_1.Octokit.prototype = new rest_1.Octokit();
  8361. exports.context = new Context.Context();
  8362. class GitHub extends rest_1.Octokit {
  8363. constructor(token, opts) {
  8364. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8365. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8366. }
  8367. /**
  8368. * Disambiguates the constructor overload parameters
  8369. */
  8370. static disambiguate(token, opts) {
  8371. return [
  8372. typeof token === 'string' ? token : '',
  8373. typeof token === 'object' ? token : opts || {}
  8374. ];
  8375. }
  8376. static getOctokitOptions(args) {
  8377. const token = args[0];
  8378. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8379. // Base URL - GHES or Dotcom
  8380. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8381. // Auth
  8382. const auth = GitHub.getAuthString(token, options);
  8383. if (auth) {
  8384. options.auth = auth;
  8385. }
  8386. // Proxy
  8387. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8388. if (agent) {
  8389. // Shallow clone - don't mutate the object provided by the caller
  8390. options.request = options.request ? Object.assign({}, options.request) : {};
  8391. // Set the agent
  8392. options.request.agent = agent;
  8393. }
  8394. return options;
  8395. }
  8396. static getGraphQL(args) {
  8397. const defaults = {};
  8398. defaults.baseUrl = this.getGraphQLBaseUrl();
  8399. const token = args[0];
  8400. const options = args[1];
  8401. // Authorization
  8402. const auth = this.getAuthString(token, options);
  8403. if (auth) {
  8404. defaults.headers = {
  8405. authorization: auth
  8406. };
  8407. }
  8408. // Proxy
  8409. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8410. if (agent) {
  8411. defaults.request = { agent };
  8412. }
  8413. return graphql_1.graphql.defaults(defaults);
  8414. }
  8415. static getAuthString(token, options) {
  8416. // Validate args
  8417. if (!token && !options.auth) {
  8418. throw new Error('Parameter token or opts.auth is required');
  8419. }
  8420. else if (token && options.auth) {
  8421. throw new Error('Parameters token and opts.auth may not both be specified');
  8422. }
  8423. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8424. }
  8425. static getProxyAgent(destinationUrl, options) {
  8426. var _a;
  8427. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8428. if (httpClient.getProxyUrl(destinationUrl)) {
  8429. const hc = new httpClient.HttpClient();
  8430. return hc.getAgent(destinationUrl);
  8431. }
  8432. }
  8433. return undefined;
  8434. }
  8435. static getApiBaseUrl() {
  8436. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8437. }
  8438. static getGraphQLBaseUrl() {
  8439. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8440. // Shouldn't be a trailing slash, but remove if so
  8441. if (url.endsWith('/')) {
  8442. url = url.substr(0, url.length - 1);
  8443. }
  8444. // Remove trailing "/graphql"
  8445. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8446. url = url.substr(0, url.length - '/graphql'.length);
  8447. }
  8448. return url;
  8449. }
  8450. }
  8451. exports.GitHub = GitHub;
  8452. //# sourceMappingURL=github.js.map
  8453. /***/ }),
  8454. /***/ 470:
  8455. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8456. "use strict";
  8457. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8458. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8459. return new (P || (P = Promise))(function (resolve, reject) {
  8460. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8461. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8462. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8463. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8464. });
  8465. };
  8466. Object.defineProperty(exports, "__esModule", { value: true });
  8467. const command_1 = __webpack_require__(431);
  8468. const os = __webpack_require__(87);
  8469. const path = __webpack_require__(622);
  8470. /**
  8471. * The code to exit an action
  8472. */
  8473. var ExitCode;
  8474. (function (ExitCode) {
  8475. /**
  8476. * A code indicating that the action was successful
  8477. */
  8478. ExitCode[ExitCode["Success"] = 0] = "Success";
  8479. /**
  8480. * A code indicating that the action was a failure
  8481. */
  8482. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8483. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8484. //-----------------------------------------------------------------------
  8485. // Variables
  8486. //-----------------------------------------------------------------------
  8487. /**
  8488. * Sets env variable for this action and future actions in the job
  8489. * @param name the name of the variable to set
  8490. * @param val the value of the variable
  8491. */
  8492. function exportVariable(name, val) {
  8493. process.env[name] = val;
  8494. command_1.issueCommand('set-env', { name }, val);
  8495. }
  8496. exports.exportVariable = exportVariable;
  8497. /**
  8498. * Registers a secret which will get masked from logs
  8499. * @param secret value of the secret
  8500. */
  8501. function setSecret(secret) {
  8502. command_1.issueCommand('add-mask', {}, secret);
  8503. }
  8504. exports.setSecret = setSecret;
  8505. /**
  8506. * Prepends inputPath to the PATH (for this action and future actions)
  8507. * @param inputPath
  8508. */
  8509. function addPath(inputPath) {
  8510. command_1.issueCommand('add-path', {}, inputPath);
  8511. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8512. }
  8513. exports.addPath = addPath;
  8514. /**
  8515. * Gets the value of an input. The value is also trimmed.
  8516. *
  8517. * @param name name of the input to get
  8518. * @param options optional. See InputOptions.
  8519. * @returns string
  8520. */
  8521. function getInput(name, options) {
  8522. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8523. if (options && options.required && !val) {
  8524. throw new Error(`Input required and not supplied: ${name}`);
  8525. }
  8526. return val.trim();
  8527. }
  8528. exports.getInput = getInput;
  8529. /**
  8530. * Sets the value of an output.
  8531. *
  8532. * @param name name of the output to set
  8533. * @param value value to store
  8534. */
  8535. function setOutput(name, value) {
  8536. command_1.issueCommand('set-output', { name }, value);
  8537. }
  8538. exports.setOutput = setOutput;
  8539. //-----------------------------------------------------------------------
  8540. // Results
  8541. //-----------------------------------------------------------------------
  8542. /**
  8543. * Sets the action status to failed.
  8544. * When the action exits it will be with an exit code of 1
  8545. * @param message add error issue message
  8546. */
  8547. function setFailed(message) {
  8548. process.exitCode = ExitCode.Failure;
  8549. error(message);
  8550. }
  8551. exports.setFailed = setFailed;
  8552. //-----------------------------------------------------------------------
  8553. // Logging Commands
  8554. //-----------------------------------------------------------------------
  8555. /**
  8556. * Writes debug message to user log
  8557. * @param message debug message
  8558. */
  8559. function debug(message) {
  8560. command_1.issueCommand('debug', {}, message);
  8561. }
  8562. exports.debug = debug;
  8563. /**
  8564. * Adds an error issue
  8565. * @param message error issue message
  8566. */
  8567. function error(message) {
  8568. command_1.issue('error', message);
  8569. }
  8570. exports.error = error;
  8571. /**
  8572. * Adds an warning issue
  8573. * @param message warning issue message
  8574. */
  8575. function warning(message) {
  8576. command_1.issue('warning', message);
  8577. }
  8578. exports.warning = warning;
  8579. /**
  8580. * Writes info to log with console.log.
  8581. * @param message info message
  8582. */
  8583. function info(message) {
  8584. process.stdout.write(message + os.EOL);
  8585. }
  8586. exports.info = info;
  8587. /**
  8588. * Begin an output group.
  8589. *
  8590. * Output until the next `groupEnd` will be foldable in this group
  8591. *
  8592. * @param name The name of the output group
  8593. */
  8594. function startGroup(name) {
  8595. command_1.issue('group', name);
  8596. }
  8597. exports.startGroup = startGroup;
  8598. /**
  8599. * End an output group.
  8600. */
  8601. function endGroup() {
  8602. command_1.issue('endgroup');
  8603. }
  8604. exports.endGroup = endGroup;
  8605. /**
  8606. * Wrap an asynchronous function call in a group.
  8607. *
  8608. * Returns the same type as the function itself.
  8609. *
  8610. * @param name The name of the group
  8611. * @param fn The function to wrap in the group
  8612. */
  8613. function group(name, fn) {
  8614. return __awaiter(this, void 0, void 0, function* () {
  8615. startGroup(name);
  8616. let result;
  8617. try {
  8618. result = yield fn();
  8619. }
  8620. finally {
  8621. endGroup();
  8622. }
  8623. return result;
  8624. });
  8625. }
  8626. exports.group = group;
  8627. //# sourceMappingURL=core.js.map
  8628. /***/ }),
  8629. /***/ 471:
  8630. /***/ (function(module, __unusedexports, __webpack_require__) {
  8631. module.exports = authenticationBeforeRequest;
  8632. const btoa = __webpack_require__(675);
  8633. const uniq = __webpack_require__(126);
  8634. function authenticationBeforeRequest(state, options) {
  8635. if (!state.auth.type) {
  8636. return;
  8637. }
  8638. if (state.auth.type === "basic") {
  8639. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8640. options.headers.authorization = `Basic ${hash}`;
  8641. return;
  8642. }
  8643. if (state.auth.type === "token") {
  8644. options.headers.authorization = `token ${state.auth.token}`;
  8645. return;
  8646. }
  8647. if (state.auth.type === "app") {
  8648. options.headers.authorization = `Bearer ${state.auth.token}`;
  8649. const acceptHeaders = options.headers.accept
  8650. .split(",")
  8651. .concat("application/vnd.github.machine-man-preview+json");
  8652. options.headers.accept = uniq(acceptHeaders)
  8653. .filter(Boolean)
  8654. .join(",");
  8655. return;
  8656. }
  8657. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8658. if (state.auth.token) {
  8659. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8660. return;
  8661. }
  8662. const key = encodeURIComponent(state.auth.key);
  8663. const secret = encodeURIComponent(state.auth.secret);
  8664. options.url += `client_id=${key}&client_secret=${secret}`;
  8665. }
  8666. /***/ }),
  8667. /***/ 489:
  8668. /***/ (function(module, __unusedexports, __webpack_require__) {
  8669. "use strict";
  8670. const path = __webpack_require__(622);
  8671. const which = __webpack_require__(814);
  8672. const pathKey = __webpack_require__(39)();
  8673. function resolveCommandAttempt(parsed, withoutPathExt) {
  8674. const cwd = process.cwd();
  8675. const hasCustomCwd = parsed.options.cwd != null;
  8676. // If a custom `cwd` was specified, we need to change the process cwd
  8677. // because `which` will do stat calls but does not support a custom cwd
  8678. if (hasCustomCwd) {
  8679. try {
  8680. process.chdir(parsed.options.cwd);
  8681. } catch (err) {
  8682. /* Empty */
  8683. }
  8684. }
  8685. let resolved;
  8686. try {
  8687. resolved = which.sync(parsed.command, {
  8688. path: (parsed.options.env || process.env)[pathKey],
  8689. pathExt: withoutPathExt ? path.delimiter : undefined,
  8690. });
  8691. } catch (e) {
  8692. /* Empty */
  8693. } finally {
  8694. process.chdir(cwd);
  8695. }
  8696. // If we successfully resolved, ensure that an absolute path is returned
  8697. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8698. if (resolved) {
  8699. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8700. }
  8701. return resolved;
  8702. }
  8703. function resolveCommand(parsed) {
  8704. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8705. }
  8706. module.exports = resolveCommand;
  8707. /***/ }),
  8708. /***/ 497:
  8709. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8710. "use strict";
  8711. Object.defineProperty(exports, '__esModule', { value: true });
  8712. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8713. var deprecation = __webpack_require__(692);
  8714. var once = _interopDefault(__webpack_require__(969));
  8715. const logOnce = once(deprecation => console.warn(deprecation));
  8716. /**
  8717. * Error with extra properties to help with debugging
  8718. */
  8719. class RequestError extends Error {
  8720. constructor(message, statusCode, options) {
  8721. super(message); // Maintains proper stack trace (only available on V8)
  8722. /* istanbul ignore next */
  8723. if (Error.captureStackTrace) {
  8724. Error.captureStackTrace(this, this.constructor);
  8725. }
  8726. this.name = "HttpError";
  8727. this.status = statusCode;
  8728. Object.defineProperty(this, "code", {
  8729. get() {
  8730. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8731. return statusCode;
  8732. }
  8733. });
  8734. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8735. const requestCopy = Object.assign({}, options.request);
  8736. if (options.request.headers.authorization) {
  8737. requestCopy.headers = Object.assign({}, options.request.headers, {
  8738. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8739. });
  8740. }
  8741. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8742. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8743. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8744. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8745. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8746. this.request = requestCopy;
  8747. }
  8748. }
  8749. exports.RequestError = RequestError;
  8750. //# sourceMappingURL=index.js.map
  8751. /***/ }),
  8752. /***/ 510:
  8753. /***/ (function(module) {
  8754. module.exports = addHook
  8755. function addHook (state, kind, name, hook) {
  8756. var orig = hook
  8757. if (!state.registry[name]) {
  8758. state.registry[name] = []
  8759. }
  8760. if (kind === 'before') {
  8761. hook = function (method, options) {
  8762. return Promise.resolve()
  8763. .then(orig.bind(null, options))
  8764. .then(method.bind(null, options))
  8765. }
  8766. }
  8767. if (kind === 'after') {
  8768. hook = function (method, options) {
  8769. var result
  8770. return Promise.resolve()
  8771. .then(method.bind(null, options))
  8772. .then(function (result_) {
  8773. result = result_
  8774. return orig(result, options)
  8775. })
  8776. .then(function () {
  8777. return result
  8778. })
  8779. }
  8780. }
  8781. if (kind === 'error') {
  8782. hook = function (method, options) {
  8783. return Promise.resolve()
  8784. .then(method.bind(null, options))
  8785. .catch(function (error) {
  8786. return orig(error, options)
  8787. })
  8788. }
  8789. }
  8790. state.registry[name].push({
  8791. hook: hook,
  8792. orig: orig
  8793. })
  8794. }
  8795. /***/ }),
  8796. /***/ 523:
  8797. /***/ (function(module, __unusedexports, __webpack_require__) {
  8798. var register = __webpack_require__(363)
  8799. var addHook = __webpack_require__(510)
  8800. var removeHook = __webpack_require__(763)
  8801. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8802. var bind = Function.bind
  8803. var bindable = bind.bind(bind)
  8804. function bindApi (hook, state, name) {
  8805. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8806. hook.api = { remove: removeHookRef }
  8807. hook.remove = removeHookRef
  8808. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8809. var args = name ? [state, kind, name] : [state, kind]
  8810. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8811. })
  8812. }
  8813. function HookSingular () {
  8814. var singularHookName = 'h'
  8815. var singularHookState = {
  8816. registry: {}
  8817. }
  8818. var singularHook = register.bind(null, singularHookState, singularHookName)
  8819. bindApi(singularHook, singularHookState, singularHookName)
  8820. return singularHook
  8821. }
  8822. function HookCollection () {
  8823. var state = {
  8824. registry: {}
  8825. }
  8826. var hook = register.bind(null, state)
  8827. bindApi(hook, state)
  8828. return hook
  8829. }
  8830. var collectionHookDeprecationMessageDisplayed = false
  8831. function Hook () {
  8832. if (!collectionHookDeprecationMessageDisplayed) {
  8833. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8834. collectionHookDeprecationMessageDisplayed = true
  8835. }
  8836. return HookCollection()
  8837. }
  8838. Hook.Singular = HookSingular.bind()
  8839. Hook.Collection = HookCollection.bind()
  8840. module.exports = Hook
  8841. // expose constructors as a named property for TypeScript
  8842. module.exports.Hook = Hook
  8843. module.exports.Singular = Hook.Singular
  8844. module.exports.Collection = Hook.Collection
  8845. /***/ }),
  8846. /***/ 528:
  8847. /***/ (function(__unusedmodule, exports) {
  8848. "use strict";
  8849. Object.defineProperty(exports, "__esModule", { value: true });
  8850. function escape(value) {
  8851. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8852. return `\\${x}`;
  8853. });
  8854. }
  8855. exports.escape = escape;
  8856. /***/ }),
  8857. /***/ 529:
  8858. /***/ (function(module, __unusedexports, __webpack_require__) {
  8859. const factory = __webpack_require__(47);
  8860. module.exports = factory();
  8861. /***/ }),
  8862. /***/ 533:
  8863. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8864. "use strict";
  8865. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8866. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8867. return new (P || (P = Promise))(function (resolve, reject) {
  8868. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8869. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8870. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8871. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8872. });
  8873. };
  8874. Object.defineProperty(exports, "__esModule", { value: true });
  8875. const core = __webpack_require__(470);
  8876. const io = __webpack_require__(1);
  8877. const fs = __webpack_require__(747);
  8878. const os = __webpack_require__(87);
  8879. const path = __webpack_require__(622);
  8880. const httpm = __webpack_require__(874);
  8881. const semver = __webpack_require__(656);
  8882. const uuidV4 = __webpack_require__(826);
  8883. const exec_1 = __webpack_require__(986);
  8884. const assert_1 = __webpack_require__(357);
  8885. class HTTPError extends Error {
  8886. constructor(httpStatusCode) {
  8887. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8888. this.httpStatusCode = httpStatusCode;
  8889. Object.setPrototypeOf(this, new.target.prototype);
  8890. }
  8891. }
  8892. exports.HTTPError = HTTPError;
  8893. const IS_WINDOWS = process.platform === 'win32';
  8894. const userAgent = 'actions/tool-cache';
  8895. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8896. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8897. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8898. // If directories not found, place them in common temp locations
  8899. if (!tempDirectory || !cacheRoot) {
  8900. let baseLocation;
  8901. if (IS_WINDOWS) {
  8902. // On windows use the USERPROFILE env variable
  8903. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8904. }
  8905. else {
  8906. if (process.platform === 'darwin') {
  8907. baseLocation = '/Users';
  8908. }
  8909. else {
  8910. baseLocation = '/home';
  8911. }
  8912. }
  8913. if (!tempDirectory) {
  8914. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8915. }
  8916. if (!cacheRoot) {
  8917. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8918. }
  8919. }
  8920. /**
  8921. * Download a tool from an url and stream it into a file
  8922. *
  8923. * @param url url of tool to download
  8924. * @returns path to downloaded tool
  8925. */
  8926. function downloadTool(url) {
  8927. return __awaiter(this, void 0, void 0, function* () {
  8928. // Wrap in a promise so that we can resolve from within stream callbacks
  8929. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8930. try {
  8931. const http = new httpm.HttpClient(userAgent, [], {
  8932. allowRetries: true,
  8933. maxRetries: 3
  8934. });
  8935. const destPath = path.join(tempDirectory, uuidV4());
  8936. yield io.mkdirP(tempDirectory);
  8937. core.debug(`Downloading ${url}`);
  8938. core.debug(`Downloading ${destPath}`);
  8939. if (fs.existsSync(destPath)) {
  8940. throw new Error(`Destination file path ${destPath} already exists`);
  8941. }
  8942. const response = yield http.get(url);
  8943. if (response.message.statusCode !== 200) {
  8944. const err = new HTTPError(response.message.statusCode);
  8945. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8946. throw err;
  8947. }
  8948. const file = fs.createWriteStream(destPath);
  8949. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8950. try {
  8951. const stream = response.message.pipe(file);
  8952. stream.on('close', () => {
  8953. core.debug('download complete');
  8954. resolve(destPath);
  8955. });
  8956. }
  8957. catch (err) {
  8958. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8959. reject(err);
  8960. }
  8961. }));
  8962. file.on('error', err => {
  8963. file.end();
  8964. reject(err);
  8965. });
  8966. }
  8967. catch (err) {
  8968. reject(err);
  8969. }
  8970. }));
  8971. });
  8972. }
  8973. exports.downloadTool = downloadTool;
  8974. /**
  8975. * Extract a .7z file
  8976. *
  8977. * @param file path to the .7z file
  8978. * @param dest destination directory. Optional.
  8979. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8980. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8981. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8982. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8983. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8984. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8985. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8986. * to 7zr.exe can be pass to this function.
  8987. * @returns path to the destination directory
  8988. */
  8989. function extract7z(file, dest, _7zPath) {
  8990. return __awaiter(this, void 0, void 0, function* () {
  8991. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8992. assert_1.ok(file, 'parameter "file" is required');
  8993. dest = dest || (yield _createExtractFolder(dest));
  8994. const originalCwd = process.cwd();
  8995. process.chdir(dest);
  8996. if (_7zPath) {
  8997. try {
  8998. const args = [
  8999. 'x',
  9000. '-bb1',
  9001. '-bd',
  9002. '-sccUTF-8',
  9003. file
  9004. ];
  9005. const options = {
  9006. silent: true
  9007. };
  9008. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9009. }
  9010. finally {
  9011. process.chdir(originalCwd);
  9012. }
  9013. }
  9014. else {
  9015. const escapedScript = path
  9016. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9017. .replace(/'/g, "''")
  9018. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9019. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9020. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9021. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9022. const args = [
  9023. '-NoLogo',
  9024. '-Sta',
  9025. '-NoProfile',
  9026. '-NonInteractive',
  9027. '-ExecutionPolicy',
  9028. 'Unrestricted',
  9029. '-Command',
  9030. command
  9031. ];
  9032. const options = {
  9033. silent: true
  9034. };
  9035. try {
  9036. const powershellPath = yield io.which('powershell', true);
  9037. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9038. }
  9039. finally {
  9040. process.chdir(originalCwd);
  9041. }
  9042. }
  9043. return dest;
  9044. });
  9045. }
  9046. exports.extract7z = extract7z;
  9047. /**
  9048. * Extract a tar
  9049. *
  9050. * @param file path to the tar
  9051. * @param dest destination directory. Optional.
  9052. * @param flags flags for the tar. Optional.
  9053. * @returns path to the destination directory
  9054. */
  9055. function extractTar(file, dest, flags = 'xz') {
  9056. return __awaiter(this, void 0, void 0, function* () {
  9057. if (!file) {
  9058. throw new Error("parameter 'file' is required");
  9059. }
  9060. dest = dest || (yield _createExtractFolder(dest));
  9061. const tarPath = yield io.which('tar', true);
  9062. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9063. return dest;
  9064. });
  9065. }
  9066. exports.extractTar = extractTar;
  9067. /**
  9068. * Extract a zip
  9069. *
  9070. * @param file path to the zip
  9071. * @param dest destination directory. Optional.
  9072. * @returns path to the destination directory
  9073. */
  9074. function extractZip(file, dest) {
  9075. return __awaiter(this, void 0, void 0, function* () {
  9076. if (!file) {
  9077. throw new Error("parameter 'file' is required");
  9078. }
  9079. dest = dest || (yield _createExtractFolder(dest));
  9080. if (IS_WINDOWS) {
  9081. yield extractZipWin(file, dest);
  9082. }
  9083. else {
  9084. yield extractZipNix(file, dest);
  9085. }
  9086. return dest;
  9087. });
  9088. }
  9089. exports.extractZip = extractZip;
  9090. function extractZipWin(file, dest) {
  9091. return __awaiter(this, void 0, void 0, function* () {
  9092. // build the powershell command
  9093. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9094. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9095. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9096. // run powershell
  9097. const powershellPath = yield io.which('powershell');
  9098. const args = [
  9099. '-NoLogo',
  9100. '-Sta',
  9101. '-NoProfile',
  9102. '-NonInteractive',
  9103. '-ExecutionPolicy',
  9104. 'Unrestricted',
  9105. '-Command',
  9106. command
  9107. ];
  9108. yield exec_1.exec(`"${powershellPath}"`, args);
  9109. });
  9110. }
  9111. function extractZipNix(file, dest) {
  9112. return __awaiter(this, void 0, void 0, function* () {
  9113. const unzipPath = yield io.which('unzip');
  9114. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9115. });
  9116. }
  9117. /**
  9118. * Caches a directory and installs it into the tool cacheDir
  9119. *
  9120. * @param sourceDir the directory to cache into tools
  9121. * @param tool tool name
  9122. * @param version version of the tool. semver format
  9123. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9124. */
  9125. function cacheDir(sourceDir, tool, version, arch) {
  9126. return __awaiter(this, void 0, void 0, function* () {
  9127. version = semver.clean(version) || version;
  9128. arch = arch || os.arch();
  9129. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9130. core.debug(`source dir: ${sourceDir}`);
  9131. if (!fs.statSync(sourceDir).isDirectory()) {
  9132. throw new Error('sourceDir is not a directory');
  9133. }
  9134. // Create the tool dir
  9135. const destPath = yield _createToolPath(tool, version, arch);
  9136. // copy each child item. do not move. move can fail on Windows
  9137. // due to anti-virus software having an open handle on a file.
  9138. for (const itemName of fs.readdirSync(sourceDir)) {
  9139. const s = path.join(sourceDir, itemName);
  9140. yield io.cp(s, destPath, { recursive: true });
  9141. }
  9142. // write .complete
  9143. _completeToolPath(tool, version, arch);
  9144. return destPath;
  9145. });
  9146. }
  9147. exports.cacheDir = cacheDir;
  9148. /**
  9149. * Caches a downloaded file (GUID) and installs it
  9150. * into the tool cache with a given targetName
  9151. *
  9152. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9153. * @param targetFile the name of the file name in the tools directory
  9154. * @param tool tool name
  9155. * @param version version of the tool. semver format
  9156. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9157. */
  9158. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9159. return __awaiter(this, void 0, void 0, function* () {
  9160. version = semver.clean(version) || version;
  9161. arch = arch || os.arch();
  9162. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9163. core.debug(`source file: ${sourceFile}`);
  9164. if (!fs.statSync(sourceFile).isFile()) {
  9165. throw new Error('sourceFile is not a file');
  9166. }
  9167. // create the tool dir
  9168. const destFolder = yield _createToolPath(tool, version, arch);
  9169. // copy instead of move. move can fail on Windows due to
  9170. // anti-virus software having an open handle on a file.
  9171. const destPath = path.join(destFolder, targetFile);
  9172. core.debug(`destination file ${destPath}`);
  9173. yield io.cp(sourceFile, destPath);
  9174. // write .complete
  9175. _completeToolPath(tool, version, arch);
  9176. return destFolder;
  9177. });
  9178. }
  9179. exports.cacheFile = cacheFile;
  9180. /**
  9181. * Finds the path to a tool version in the local installed tool cache
  9182. *
  9183. * @param toolName name of the tool
  9184. * @param versionSpec version of the tool
  9185. * @param arch optional arch. defaults to arch of computer
  9186. */
  9187. function find(toolName, versionSpec, arch) {
  9188. if (!toolName) {
  9189. throw new Error('toolName parameter is required');
  9190. }
  9191. if (!versionSpec) {
  9192. throw new Error('versionSpec parameter is required');
  9193. }
  9194. arch = arch || os.arch();
  9195. // attempt to resolve an explicit version
  9196. if (!_isExplicitVersion(versionSpec)) {
  9197. const localVersions = findAllVersions(toolName, arch);
  9198. const match = _evaluateVersions(localVersions, versionSpec);
  9199. versionSpec = match;
  9200. }
  9201. // check for the explicit version in the cache
  9202. let toolPath = '';
  9203. if (versionSpec) {
  9204. versionSpec = semver.clean(versionSpec) || '';
  9205. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9206. core.debug(`checking cache: ${cachePath}`);
  9207. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9208. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9209. toolPath = cachePath;
  9210. }
  9211. else {
  9212. core.debug('not found');
  9213. }
  9214. }
  9215. return toolPath;
  9216. }
  9217. exports.find = find;
  9218. /**
  9219. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9220. *
  9221. * @param toolName name of the tool
  9222. * @param arch optional arch. defaults to arch of computer
  9223. */
  9224. function findAllVersions(toolName, arch) {
  9225. const versions = [];
  9226. arch = arch || os.arch();
  9227. const toolPath = path.join(cacheRoot, toolName);
  9228. if (fs.existsSync(toolPath)) {
  9229. const children = fs.readdirSync(toolPath);
  9230. for (const child of children) {
  9231. if (_isExplicitVersion(child)) {
  9232. const fullPath = path.join(toolPath, child, arch || '');
  9233. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9234. versions.push(child);
  9235. }
  9236. }
  9237. }
  9238. }
  9239. return versions;
  9240. }
  9241. exports.findAllVersions = findAllVersions;
  9242. function _createExtractFolder(dest) {
  9243. return __awaiter(this, void 0, void 0, function* () {
  9244. if (!dest) {
  9245. // create a temp dir
  9246. dest = path.join(tempDirectory, uuidV4());
  9247. }
  9248. yield io.mkdirP(dest);
  9249. return dest;
  9250. });
  9251. }
  9252. function _createToolPath(tool, version, arch) {
  9253. return __awaiter(this, void 0, void 0, function* () {
  9254. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9255. core.debug(`destination ${folderPath}`);
  9256. const markerPath = `${folderPath}.complete`;
  9257. yield io.rmRF(folderPath);
  9258. yield io.rmRF(markerPath);
  9259. yield io.mkdirP(folderPath);
  9260. return folderPath;
  9261. });
  9262. }
  9263. function _completeToolPath(tool, version, arch) {
  9264. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9265. const markerPath = `${folderPath}.complete`;
  9266. fs.writeFileSync(markerPath, '');
  9267. core.debug('finished caching tool');
  9268. }
  9269. function _isExplicitVersion(versionSpec) {
  9270. const c = semver.clean(versionSpec) || '';
  9271. core.debug(`isExplicit: ${c}`);
  9272. const valid = semver.valid(c) != null;
  9273. core.debug(`explicit? ${valid}`);
  9274. return valid;
  9275. }
  9276. function _evaluateVersions(versions, versionSpec) {
  9277. let version = '';
  9278. core.debug(`evaluating ${versions.length} versions`);
  9279. versions = versions.sort((a, b) => {
  9280. if (semver.gt(a, b)) {
  9281. return 1;
  9282. }
  9283. return -1;
  9284. });
  9285. for (let i = versions.length - 1; i >= 0; i--) {
  9286. const potential = versions[i];
  9287. const satisfied = semver.satisfies(potential, versionSpec);
  9288. if (satisfied) {
  9289. version = potential;
  9290. break;
  9291. }
  9292. }
  9293. if (version) {
  9294. core.debug(`matched: ${version}`);
  9295. }
  9296. else {
  9297. core.debug('match not found');
  9298. }
  9299. return version;
  9300. }
  9301. //# sourceMappingURL=tool-cache.js.map
  9302. /***/ }),
  9303. /***/ 536:
  9304. /***/ (function(module, __unusedexports, __webpack_require__) {
  9305. module.exports = hasFirstPage
  9306. const deprecate = __webpack_require__(370)
  9307. const getPageLinks = __webpack_require__(577)
  9308. function hasFirstPage (link) {
  9309. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9310. return getPageLinks(link).first
  9311. }
  9312. /***/ }),
  9313. /***/ 539:
  9314. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9315. "use strict";
  9316. Object.defineProperty(exports, "__esModule", { value: true });
  9317. const url = __webpack_require__(835);
  9318. const http = __webpack_require__(605);
  9319. const https = __webpack_require__(34);
  9320. const pm = __webpack_require__(950);
  9321. let tunnel;
  9322. var HttpCodes;
  9323. (function (HttpCodes) {
  9324. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9325. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9326. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9327. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9328. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9329. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9330. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9331. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9332. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9333. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9334. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9335. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9336. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9337. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9338. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9339. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9340. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9341. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9342. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9343. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9344. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9345. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9346. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9347. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9348. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9349. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9350. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9351. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9352. var Headers;
  9353. (function (Headers) {
  9354. Headers["Accept"] = "accept";
  9355. Headers["ContentType"] = "content-type";
  9356. })(Headers = exports.Headers || (exports.Headers = {}));
  9357. var MediaTypes;
  9358. (function (MediaTypes) {
  9359. MediaTypes["ApplicationJson"] = "application/json";
  9360. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9361. /**
  9362. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9363. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9364. */
  9365. function getProxyUrl(serverUrl) {
  9366. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9367. return proxyUrl ? proxyUrl.href : '';
  9368. }
  9369. exports.getProxyUrl = getProxyUrl;
  9370. const HttpRedirectCodes = [
  9371. HttpCodes.MovedPermanently,
  9372. HttpCodes.ResourceMoved,
  9373. HttpCodes.SeeOther,
  9374. HttpCodes.TemporaryRedirect,
  9375. HttpCodes.PermanentRedirect
  9376. ];
  9377. const HttpResponseRetryCodes = [
  9378. HttpCodes.BadGateway,
  9379. HttpCodes.ServiceUnavailable,
  9380. HttpCodes.GatewayTimeout
  9381. ];
  9382. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9383. const ExponentialBackoffCeiling = 10;
  9384. const ExponentialBackoffTimeSlice = 5;
  9385. class HttpClientResponse {
  9386. constructor(message) {
  9387. this.message = message;
  9388. }
  9389. readBody() {
  9390. return new Promise(async (resolve, reject) => {
  9391. let output = Buffer.alloc(0);
  9392. this.message.on('data', (chunk) => {
  9393. output = Buffer.concat([output, chunk]);
  9394. });
  9395. this.message.on('end', () => {
  9396. resolve(output.toString());
  9397. });
  9398. });
  9399. }
  9400. }
  9401. exports.HttpClientResponse = HttpClientResponse;
  9402. function isHttps(requestUrl) {
  9403. let parsedUrl = url.parse(requestUrl);
  9404. return parsedUrl.protocol === 'https:';
  9405. }
  9406. exports.isHttps = isHttps;
  9407. class HttpClient {
  9408. constructor(userAgent, handlers, requestOptions) {
  9409. this._ignoreSslError = false;
  9410. this._allowRedirects = true;
  9411. this._allowRedirectDowngrade = false;
  9412. this._maxRedirects = 50;
  9413. this._allowRetries = false;
  9414. this._maxRetries = 1;
  9415. this._keepAlive = false;
  9416. this._disposed = false;
  9417. this.userAgent = userAgent;
  9418. this.handlers = handlers || [];
  9419. this.requestOptions = requestOptions;
  9420. if (requestOptions) {
  9421. if (requestOptions.ignoreSslError != null) {
  9422. this._ignoreSslError = requestOptions.ignoreSslError;
  9423. }
  9424. this._socketTimeout = requestOptions.socketTimeout;
  9425. if (requestOptions.allowRedirects != null) {
  9426. this._allowRedirects = requestOptions.allowRedirects;
  9427. }
  9428. if (requestOptions.allowRedirectDowngrade != null) {
  9429. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9430. }
  9431. if (requestOptions.maxRedirects != null) {
  9432. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9433. }
  9434. if (requestOptions.keepAlive != null) {
  9435. this._keepAlive = requestOptions.keepAlive;
  9436. }
  9437. if (requestOptions.allowRetries != null) {
  9438. this._allowRetries = requestOptions.allowRetries;
  9439. }
  9440. if (requestOptions.maxRetries != null) {
  9441. this._maxRetries = requestOptions.maxRetries;
  9442. }
  9443. }
  9444. }
  9445. options(requestUrl, additionalHeaders) {
  9446. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9447. }
  9448. get(requestUrl, additionalHeaders) {
  9449. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9450. }
  9451. del(requestUrl, additionalHeaders) {
  9452. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9453. }
  9454. post(requestUrl, data, additionalHeaders) {
  9455. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9456. }
  9457. patch(requestUrl, data, additionalHeaders) {
  9458. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9459. }
  9460. put(requestUrl, data, additionalHeaders) {
  9461. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9462. }
  9463. head(requestUrl, additionalHeaders) {
  9464. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9465. }
  9466. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9467. return this.request(verb, requestUrl, stream, additionalHeaders);
  9468. }
  9469. /**
  9470. * Gets a typed object from an endpoint
  9471. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9472. */
  9473. async getJson(requestUrl, additionalHeaders = {}) {
  9474. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9475. let res = await this.get(requestUrl, additionalHeaders);
  9476. return this._processResponse(res, this.requestOptions);
  9477. }
  9478. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9479. let data = JSON.stringify(obj, null, 2);
  9480. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9481. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9482. let res = await this.post(requestUrl, data, additionalHeaders);
  9483. return this._processResponse(res, this.requestOptions);
  9484. }
  9485. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9486. let data = JSON.stringify(obj, null, 2);
  9487. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9488. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9489. let res = await this.put(requestUrl, data, additionalHeaders);
  9490. return this._processResponse(res, this.requestOptions);
  9491. }
  9492. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9493. let data = JSON.stringify(obj, null, 2);
  9494. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9495. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9496. let res = await this.patch(requestUrl, data, additionalHeaders);
  9497. return this._processResponse(res, this.requestOptions);
  9498. }
  9499. /**
  9500. * Makes a raw http request.
  9501. * All other methods such as get, post, patch, and request ultimately call this.
  9502. * Prefer get, del, post and patch
  9503. */
  9504. async request(verb, requestUrl, data, headers) {
  9505. if (this._disposed) {
  9506. throw new Error('Client has already been disposed.');
  9507. }
  9508. let parsedUrl = url.parse(requestUrl);
  9509. let info = this._prepareRequest(verb, parsedUrl, headers);
  9510. // Only perform retries on reads since writes may not be idempotent.
  9511. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9512. ? this._maxRetries + 1
  9513. : 1;
  9514. let numTries = 0;
  9515. let response;
  9516. while (numTries < maxTries) {
  9517. response = await this.requestRaw(info, data);
  9518. // Check if it's an authentication challenge
  9519. if (response &&
  9520. response.message &&
  9521. response.message.statusCode === HttpCodes.Unauthorized) {
  9522. let authenticationHandler;
  9523. for (let i = 0; i < this.handlers.length; i++) {
  9524. if (this.handlers[i].canHandleAuthentication(response)) {
  9525. authenticationHandler = this.handlers[i];
  9526. break;
  9527. }
  9528. }
  9529. if (authenticationHandler) {
  9530. return authenticationHandler.handleAuthentication(this, info, data);
  9531. }
  9532. else {
  9533. // We have received an unauthorized response but have no handlers to handle it.
  9534. // Let the response return to the caller.
  9535. return response;
  9536. }
  9537. }
  9538. let redirectsRemaining = this._maxRedirects;
  9539. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9540. this._allowRedirects &&
  9541. redirectsRemaining > 0) {
  9542. const redirectUrl = response.message.headers['location'];
  9543. if (!redirectUrl) {
  9544. // if there's no location to redirect to, we won't
  9545. break;
  9546. }
  9547. let parsedRedirectUrl = url.parse(redirectUrl);
  9548. if (parsedUrl.protocol == 'https:' &&
  9549. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9550. !this._allowRedirectDowngrade) {
  9551. 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.');
  9552. }
  9553. // we need to finish reading the response before reassigning response
  9554. // which will leak the open socket.
  9555. await response.readBody();
  9556. // strip authorization header if redirected to a different hostname
  9557. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9558. for (let header in headers) {
  9559. // header names are case insensitive
  9560. if (header.toLowerCase() === 'authorization') {
  9561. delete headers[header];
  9562. }
  9563. }
  9564. }
  9565. // let's make the request with the new redirectUrl
  9566. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9567. response = await this.requestRaw(info, data);
  9568. redirectsRemaining--;
  9569. }
  9570. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9571. // If not a retry code, return immediately instead of retrying
  9572. return response;
  9573. }
  9574. numTries += 1;
  9575. if (numTries < maxTries) {
  9576. await response.readBody();
  9577. await this._performExponentialBackoff(numTries);
  9578. }
  9579. }
  9580. return response;
  9581. }
  9582. /**
  9583. * Needs to be called if keepAlive is set to true in request options.
  9584. */
  9585. dispose() {
  9586. if (this._agent) {
  9587. this._agent.destroy();
  9588. }
  9589. this._disposed = true;
  9590. }
  9591. /**
  9592. * Raw request.
  9593. * @param info
  9594. * @param data
  9595. */
  9596. requestRaw(info, data) {
  9597. return new Promise((resolve, reject) => {
  9598. let callbackForResult = function (err, res) {
  9599. if (err) {
  9600. reject(err);
  9601. }
  9602. resolve(res);
  9603. };
  9604. this.requestRawWithCallback(info, data, callbackForResult);
  9605. });
  9606. }
  9607. /**
  9608. * Raw request with callback.
  9609. * @param info
  9610. * @param data
  9611. * @param onResult
  9612. */
  9613. requestRawWithCallback(info, data, onResult) {
  9614. let socket;
  9615. if (typeof data === 'string') {
  9616. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9617. }
  9618. let callbackCalled = false;
  9619. let handleResult = (err, res) => {
  9620. if (!callbackCalled) {
  9621. callbackCalled = true;
  9622. onResult(err, res);
  9623. }
  9624. };
  9625. let req = info.httpModule.request(info.options, (msg) => {
  9626. let res = new HttpClientResponse(msg);
  9627. handleResult(null, res);
  9628. });
  9629. req.on('socket', sock => {
  9630. socket = sock;
  9631. });
  9632. // If we ever get disconnected, we want the socket to timeout eventually
  9633. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9634. if (socket) {
  9635. socket.end();
  9636. }
  9637. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9638. });
  9639. req.on('error', function (err) {
  9640. // err has statusCode property
  9641. // res should have headers
  9642. handleResult(err, null);
  9643. });
  9644. if (data && typeof data === 'string') {
  9645. req.write(data, 'utf8');
  9646. }
  9647. if (data && typeof data !== 'string') {
  9648. data.on('close', function () {
  9649. req.end();
  9650. });
  9651. data.pipe(req);
  9652. }
  9653. else {
  9654. req.end();
  9655. }
  9656. }
  9657. /**
  9658. * Gets an http agent. This function is useful when you need an http agent that handles
  9659. * routing through a proxy server - depending upon the url and proxy environment variables.
  9660. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9661. */
  9662. getAgent(serverUrl) {
  9663. let parsedUrl = url.parse(serverUrl);
  9664. return this._getAgent(parsedUrl);
  9665. }
  9666. _prepareRequest(method, requestUrl, headers) {
  9667. const info = {};
  9668. info.parsedUrl = requestUrl;
  9669. const usingSsl = info.parsedUrl.protocol === 'https:';
  9670. info.httpModule = usingSsl ? https : http;
  9671. const defaultPort = usingSsl ? 443 : 80;
  9672. info.options = {};
  9673. info.options.host = info.parsedUrl.hostname;
  9674. info.options.port = info.parsedUrl.port
  9675. ? parseInt(info.parsedUrl.port)
  9676. : defaultPort;
  9677. info.options.path =
  9678. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9679. info.options.method = method;
  9680. info.options.headers = this._mergeHeaders(headers);
  9681. if (this.userAgent != null) {
  9682. info.options.headers['user-agent'] = this.userAgent;
  9683. }
  9684. info.options.agent = this._getAgent(info.parsedUrl);
  9685. // gives handlers an opportunity to participate
  9686. if (this.handlers) {
  9687. this.handlers.forEach(handler => {
  9688. handler.prepareRequest(info.options);
  9689. });
  9690. }
  9691. return info;
  9692. }
  9693. _mergeHeaders(headers) {
  9694. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9695. if (this.requestOptions && this.requestOptions.headers) {
  9696. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9697. }
  9698. return lowercaseKeys(headers || {});
  9699. }
  9700. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9701. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9702. let clientHeader;
  9703. if (this.requestOptions && this.requestOptions.headers) {
  9704. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9705. }
  9706. return additionalHeaders[header] || clientHeader || _default;
  9707. }
  9708. _getAgent(parsedUrl) {
  9709. let agent;
  9710. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9711. let useProxy = proxyUrl && proxyUrl.hostname;
  9712. if (this._keepAlive && useProxy) {
  9713. agent = this._proxyAgent;
  9714. }
  9715. if (this._keepAlive && !useProxy) {
  9716. agent = this._agent;
  9717. }
  9718. // if agent is already assigned use that agent.
  9719. if (!!agent) {
  9720. return agent;
  9721. }
  9722. const usingSsl = parsedUrl.protocol === 'https:';
  9723. let maxSockets = 100;
  9724. if (!!this.requestOptions) {
  9725. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9726. }
  9727. if (useProxy) {
  9728. // If using proxy, need tunnel
  9729. if (!tunnel) {
  9730. tunnel = __webpack_require__(335);
  9731. }
  9732. const agentOptions = {
  9733. maxSockets: maxSockets,
  9734. keepAlive: this._keepAlive,
  9735. proxy: {
  9736. proxyAuth: proxyUrl.auth,
  9737. host: proxyUrl.hostname,
  9738. port: proxyUrl.port
  9739. }
  9740. };
  9741. let tunnelAgent;
  9742. const overHttps = proxyUrl.protocol === 'https:';
  9743. if (usingSsl) {
  9744. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9745. }
  9746. else {
  9747. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9748. }
  9749. agent = tunnelAgent(agentOptions);
  9750. this._proxyAgent = agent;
  9751. }
  9752. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9753. if (this._keepAlive && !agent) {
  9754. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9755. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9756. this._agent = agent;
  9757. }
  9758. // if not using private agent and tunnel agent isn't setup then use global agent
  9759. if (!agent) {
  9760. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9761. }
  9762. if (usingSsl && this._ignoreSslError) {
  9763. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9764. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9765. // we have to cast it to any and change it directly
  9766. agent.options = Object.assign(agent.options || {}, {
  9767. rejectUnauthorized: false
  9768. });
  9769. }
  9770. return agent;
  9771. }
  9772. _performExponentialBackoff(retryNumber) {
  9773. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9774. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9775. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9776. }
  9777. static dateTimeDeserializer(key, value) {
  9778. if (typeof value === 'string') {
  9779. let a = new Date(value);
  9780. if (!isNaN(a.valueOf())) {
  9781. return a;
  9782. }
  9783. }
  9784. return value;
  9785. }
  9786. async _processResponse(res, options) {
  9787. return new Promise(async (resolve, reject) => {
  9788. const statusCode = res.message.statusCode;
  9789. const response = {
  9790. statusCode: statusCode,
  9791. result: null,
  9792. headers: {}
  9793. };
  9794. // not found leads to null obj returned
  9795. if (statusCode == HttpCodes.NotFound) {
  9796. resolve(response);
  9797. }
  9798. let obj;
  9799. let contents;
  9800. // get the result from the body
  9801. try {
  9802. contents = await res.readBody();
  9803. if (contents && contents.length > 0) {
  9804. if (options && options.deserializeDates) {
  9805. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9806. }
  9807. else {
  9808. obj = JSON.parse(contents);
  9809. }
  9810. response.result = obj;
  9811. }
  9812. response.headers = res.message.headers;
  9813. }
  9814. catch (err) {
  9815. // Invalid resource (contents not json); leaving result obj null
  9816. }
  9817. // note that 3xx redirects are handled by the http layer.
  9818. if (statusCode > 299) {
  9819. let msg;
  9820. // if exception/error in body, attempt to get better error
  9821. if (obj && obj.message) {
  9822. msg = obj.message;
  9823. }
  9824. else if (contents && contents.length > 0) {
  9825. // it may be the case that the exception is in the body message as string
  9826. msg = contents;
  9827. }
  9828. else {
  9829. msg = 'Failed request: (' + statusCode + ')';
  9830. }
  9831. let err = new Error(msg);
  9832. // attach statusCode and body obj (if available) to the error object
  9833. err['statusCode'] = statusCode;
  9834. if (response.result) {
  9835. err['result'] = response.result;
  9836. }
  9837. reject(err);
  9838. }
  9839. else {
  9840. resolve(response);
  9841. }
  9842. });
  9843. }
  9844. }
  9845. exports.HttpClient = HttpClient;
  9846. /***/ }),
  9847. /***/ 550:
  9848. /***/ (function(module, __unusedexports, __webpack_require__) {
  9849. module.exports = getNextPage
  9850. const getPage = __webpack_require__(265)
  9851. function getNextPage (octokit, link, headers) {
  9852. return getPage(octokit, link, 'next', headers)
  9853. }
  9854. /***/ }),
  9855. /***/ 558:
  9856. /***/ (function(module, __unusedexports, __webpack_require__) {
  9857. module.exports = hasPreviousPage
  9858. const deprecate = __webpack_require__(370)
  9859. const getPageLinks = __webpack_require__(577)
  9860. function hasPreviousPage (link) {
  9861. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9862. return getPageLinks(link).prev
  9863. }
  9864. /***/ }),
  9865. /***/ 559:
  9866. /***/ (function(__unusedmodule, exports) {
  9867. "use strict";
  9868. Object.defineProperty(exports, "__esModule", { value: true });
  9869. class GitVersion {
  9870. /**
  9871. * Used for comparing the version of git and git-lfs against the minimum required version
  9872. * @param version the version string, e.g. 1.2 or 1.2.3
  9873. */
  9874. constructor(version) {
  9875. this.major = NaN;
  9876. this.minor = NaN;
  9877. this.patch = NaN;
  9878. if (version) {
  9879. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9880. if (match) {
  9881. this.major = Number(match[1]);
  9882. this.minor = Number(match[2]);
  9883. if (match[4]) {
  9884. this.patch = Number(match[4]);
  9885. }
  9886. }
  9887. }
  9888. }
  9889. /**
  9890. * Compares the instance against a minimum required version
  9891. * @param minimum Minimum version
  9892. */
  9893. checkMinimum(minimum) {
  9894. if (!minimum.isValid()) {
  9895. throw new Error('Arg minimum is not a valid version');
  9896. }
  9897. // Major is insufficient
  9898. if (this.major < minimum.major) {
  9899. return false;
  9900. }
  9901. // Major is equal
  9902. if (this.major === minimum.major) {
  9903. // Minor is insufficient
  9904. if (this.minor < minimum.minor) {
  9905. return false;
  9906. }
  9907. // Minor is equal
  9908. if (this.minor === minimum.minor) {
  9909. // Patch is insufficient
  9910. if (this.patch && this.patch < (minimum.patch || 0)) {
  9911. return false;
  9912. }
  9913. }
  9914. }
  9915. return true;
  9916. }
  9917. /**
  9918. * Indicates whether the instance was constructed from a valid version string
  9919. */
  9920. isValid() {
  9921. return !isNaN(this.major);
  9922. }
  9923. /**
  9924. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9925. */
  9926. toString() {
  9927. let result = '';
  9928. if (this.isValid()) {
  9929. result = `${this.major}.${this.minor}`;
  9930. if (!isNaN(this.patch)) {
  9931. result += `.${this.patch}`;
  9932. }
  9933. }
  9934. return result;
  9935. }
  9936. }
  9937. exports.GitVersion = GitVersion;
  9938. /***/ }),
  9939. /***/ 562:
  9940. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9941. "use strict";
  9942. Object.defineProperty(exports, '__esModule', { value: true });
  9943. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9944. var osName = _interopDefault(__webpack_require__(2));
  9945. function getUserAgent() {
  9946. try {
  9947. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  9948. } catch (error) {
  9949. if (/wmic os get Caption/.test(error.message)) {
  9950. return "Windows <version undetectable>";
  9951. }
  9952. return "<environment undetectable>";
  9953. }
  9954. }
  9955. exports.getUserAgent = getUserAgent;
  9956. //# sourceMappingURL=index.js.map
  9957. /***/ }),
  9958. /***/ 563:
  9959. /***/ (function(module, __unusedexports, __webpack_require__) {
  9960. module.exports = getPreviousPage
  9961. const getPage = __webpack_require__(265)
  9962. function getPreviousPage (octokit, link, headers) {
  9963. return getPage(octokit, link, 'prev', headers)
  9964. }
  9965. /***/ }),
  9966. /***/ 568:
  9967. /***/ (function(module, __unusedexports, __webpack_require__) {
  9968. "use strict";
  9969. const path = __webpack_require__(622);
  9970. const niceTry = __webpack_require__(948);
  9971. const resolveCommand = __webpack_require__(489);
  9972. const escape = __webpack_require__(462);
  9973. const readShebang = __webpack_require__(389);
  9974. const semver = __webpack_require__(280);
  9975. const isWin = process.platform === 'win32';
  9976. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9977. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9978. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9979. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9980. function detectShebang(parsed) {
  9981. parsed.file = resolveCommand(parsed);
  9982. const shebang = parsed.file && readShebang(parsed.file);
  9983. if (shebang) {
  9984. parsed.args.unshift(parsed.file);
  9985. parsed.command = shebang;
  9986. return resolveCommand(parsed);
  9987. }
  9988. return parsed.file;
  9989. }
  9990. function parseNonShell(parsed) {
  9991. if (!isWin) {
  9992. return parsed;
  9993. }
  9994. // Detect & add support for shebangs
  9995. const commandFile = detectShebang(parsed);
  9996. // We don't need a shell if the command filename is an executable
  9997. const needsShell = !isExecutableRegExp.test(commandFile);
  9998. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9999. // Note that `forceShell` is an hidden option used only in tests
  10000. if (parsed.options.forceShell || needsShell) {
  10001. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10002. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10003. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10004. // we need to double escape them
  10005. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10006. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10007. // This is necessary otherwise it will always fail with ENOENT in those cases
  10008. parsed.command = path.normalize(parsed.command);
  10009. // Escape command & arguments
  10010. parsed.command = escape.command(parsed.command);
  10011. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10012. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10013. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10014. parsed.command = process.env.comspec || 'cmd.exe';
  10015. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10016. }
  10017. return parsed;
  10018. }
  10019. function parseShell(parsed) {
  10020. // If node supports the shell option, there's no need to mimic its behavior
  10021. if (supportsShellOption) {
  10022. return parsed;
  10023. }
  10024. // Mimic node shell option
  10025. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10026. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10027. if (isWin) {
  10028. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10029. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10030. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10031. } else {
  10032. if (typeof parsed.options.shell === 'string') {
  10033. parsed.command = parsed.options.shell;
  10034. } else if (process.platform === 'android') {
  10035. parsed.command = '/system/bin/sh';
  10036. } else {
  10037. parsed.command = '/bin/sh';
  10038. }
  10039. parsed.args = ['-c', shellCommand];
  10040. }
  10041. return parsed;
  10042. }
  10043. function parse(command, args, options) {
  10044. // Normalize arguments, similar to nodejs
  10045. if (args && !Array.isArray(args)) {
  10046. options = args;
  10047. args = null;
  10048. }
  10049. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10050. options = Object.assign({}, options); // Clone object to avoid changing the original
  10051. // Build our parsed object
  10052. const parsed = {
  10053. command,
  10054. args,
  10055. options,
  10056. file: undefined,
  10057. original: {
  10058. command,
  10059. args,
  10060. },
  10061. };
  10062. // Delegate further parsing to shell or non-shell
  10063. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10064. }
  10065. module.exports = parse;
  10066. /***/ }),
  10067. /***/ 577:
  10068. /***/ (function(module) {
  10069. module.exports = getPageLinks
  10070. function getPageLinks (link) {
  10071. link = link.link || link.headers.link || ''
  10072. const links = {}
  10073. // link format:
  10074. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10075. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10076. links[type] = uri
  10077. })
  10078. return links
  10079. }
  10080. /***/ }),
  10081. /***/ 587:
  10082. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10083. "use strict";
  10084. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10085. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10086. return new (P || (P = Promise))(function (resolve, reject) {
  10087. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10088. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10089. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10090. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10091. });
  10092. };
  10093. var __importStar = (this && this.__importStar) || function (mod) {
  10094. if (mod && mod.__esModule) return mod;
  10095. var result = {};
  10096. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10097. result["default"] = mod;
  10098. return result;
  10099. };
  10100. Object.defineProperty(exports, "__esModule", { value: true });
  10101. const core = __importStar(__webpack_require__(470));
  10102. const defaultMaxAttempts = 3;
  10103. const defaultMinSeconds = 10;
  10104. const defaultMaxSeconds = 20;
  10105. class RetryHelper {
  10106. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10107. this.maxAttempts = maxAttempts;
  10108. this.minSeconds = Math.floor(minSeconds);
  10109. this.maxSeconds = Math.floor(maxSeconds);
  10110. if (this.minSeconds > this.maxSeconds) {
  10111. throw new Error('min seconds should be less than or equal to max seconds');
  10112. }
  10113. }
  10114. execute(action) {
  10115. return __awaiter(this, void 0, void 0, function* () {
  10116. let attempt = 1;
  10117. while (attempt < this.maxAttempts) {
  10118. // Try
  10119. try {
  10120. return yield action();
  10121. }
  10122. catch (err) {
  10123. core.info(err.message);
  10124. }
  10125. // Sleep
  10126. const seconds = this.getSleepAmount();
  10127. core.info(`Waiting ${seconds} seconds before trying again`);
  10128. yield this.sleep(seconds);
  10129. attempt++;
  10130. }
  10131. // Last attempt
  10132. return yield action();
  10133. });
  10134. }
  10135. getSleepAmount() {
  10136. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10137. this.minSeconds);
  10138. }
  10139. sleep(seconds) {
  10140. return __awaiter(this, void 0, void 0, function* () {
  10141. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10142. });
  10143. }
  10144. }
  10145. exports.RetryHelper = RetryHelper;
  10146. function execute(action) {
  10147. return __awaiter(this, void 0, void 0, function* () {
  10148. const retryHelper = new RetryHelper();
  10149. return yield retryHelper.execute(action);
  10150. });
  10151. }
  10152. exports.execute = execute;
  10153. /***/ }),
  10154. /***/ 605:
  10155. /***/ (function(module) {
  10156. module.exports = require("http");
  10157. /***/ }),
  10158. /***/ 614:
  10159. /***/ (function(module) {
  10160. module.exports = require("events");
  10161. /***/ }),
  10162. /***/ 618:
  10163. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10164. "use strict";
  10165. var __importStar = (this && this.__importStar) || function (mod) {
  10166. if (mod && mod.__esModule) return mod;
  10167. var result = {};
  10168. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10169. result["default"] = mod;
  10170. return result;
  10171. };
  10172. Object.defineProperty(exports, "__esModule", { value: true });
  10173. const fs = __importStar(__webpack_require__(747));
  10174. function directoryExistsSync(path, required) {
  10175. if (!path) {
  10176. throw new Error("Arg 'path' must not be empty");
  10177. }
  10178. let stats;
  10179. try {
  10180. stats = fs.statSync(path);
  10181. }
  10182. catch (error) {
  10183. if (error.code === 'ENOENT') {
  10184. if (!required) {
  10185. return false;
  10186. }
  10187. throw new Error(`Directory '${path}' does not exist`);
  10188. }
  10189. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10190. }
  10191. if (stats.isDirectory()) {
  10192. return true;
  10193. }
  10194. else if (!required) {
  10195. return false;
  10196. }
  10197. throw new Error(`Directory '${path}' does not exist`);
  10198. }
  10199. exports.directoryExistsSync = directoryExistsSync;
  10200. function existsSync(path) {
  10201. if (!path) {
  10202. throw new Error("Arg 'path' must not be empty");
  10203. }
  10204. try {
  10205. fs.statSync(path);
  10206. }
  10207. catch (error) {
  10208. if (error.code === 'ENOENT') {
  10209. return false;
  10210. }
  10211. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10212. }
  10213. return true;
  10214. }
  10215. exports.existsSync = existsSync;
  10216. function fileExistsSync(path) {
  10217. if (!path) {
  10218. throw new Error("Arg 'path' must not be empty");
  10219. }
  10220. let stats;
  10221. try {
  10222. stats = fs.statSync(path);
  10223. }
  10224. catch (error) {
  10225. if (error.code === 'ENOENT') {
  10226. return false;
  10227. }
  10228. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10229. }
  10230. if (!stats.isDirectory()) {
  10231. return true;
  10232. }
  10233. return false;
  10234. }
  10235. exports.fileExistsSync = fileExistsSync;
  10236. /***/ }),
  10237. /***/ 621:
  10238. /***/ (function(module, __unusedexports, __webpack_require__) {
  10239. "use strict";
  10240. const path = __webpack_require__(622);
  10241. const pathKey = __webpack_require__(39);
  10242. module.exports = opts => {
  10243. opts = Object.assign({
  10244. cwd: process.cwd(),
  10245. path: process.env[pathKey()]
  10246. }, opts);
  10247. let prev;
  10248. let pth = path.resolve(opts.cwd);
  10249. const ret = [];
  10250. while (prev !== pth) {
  10251. ret.push(path.join(pth, 'node_modules/.bin'));
  10252. prev = pth;
  10253. pth = path.resolve(pth, '..');
  10254. }
  10255. // ensure the running `node` binary is used
  10256. ret.push(path.dirname(process.execPath));
  10257. return ret.concat(opts.path).join(path.delimiter);
  10258. };
  10259. module.exports.env = opts => {
  10260. opts = Object.assign({
  10261. env: process.env
  10262. }, opts);
  10263. const env = Object.assign({}, opts.env);
  10264. const path = pathKey({env});
  10265. opts.path = env[path];
  10266. env[path] = module.exports(opts);
  10267. return env;
  10268. };
  10269. /***/ }),
  10270. /***/ 622:
  10271. /***/ (function(module) {
  10272. module.exports = require("path");
  10273. /***/ }),
  10274. /***/ 631:
  10275. /***/ (function(module) {
  10276. module.exports = require("net");
  10277. /***/ }),
  10278. /***/ 649:
  10279. /***/ (function(module, __unusedexports, __webpack_require__) {
  10280. module.exports = getLastPage
  10281. const getPage = __webpack_require__(265)
  10282. function getLastPage (octokit, link, headers) {
  10283. return getPage(octokit, link, 'last', headers)
  10284. }
  10285. /***/ }),
  10286. /***/ 654:
  10287. /***/ (function(module) {
  10288. // This is not the set of all possible signals.
  10289. //
  10290. // It IS, however, the set of all signals that trigger
  10291. // an exit on either Linux or BSD systems. Linux is a
  10292. // superset of the signal names supported on BSD, and
  10293. // the unknown signals just fail to register, so we can
  10294. // catch that easily enough.
  10295. //
  10296. // Don't bother with SIGKILL. It's uncatchable, which
  10297. // means that we can't fire any callbacks anyway.
  10298. //
  10299. // If a user does happen to register a handler on a non-
  10300. // fatal signal like SIGWINCH or something, and then
  10301. // exit, it'll end up firing `process.emit('exit')`, so
  10302. // the handler will be fired anyway.
  10303. //
  10304. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10305. // artificially, inherently leave the process in a
  10306. // state from which it is not safe to try and enter JS
  10307. // listeners.
  10308. module.exports = [
  10309. 'SIGABRT',
  10310. 'SIGALRM',
  10311. 'SIGHUP',
  10312. 'SIGINT',
  10313. 'SIGTERM'
  10314. ]
  10315. if (process.platform !== 'win32') {
  10316. module.exports.push(
  10317. 'SIGVTALRM',
  10318. 'SIGXCPU',
  10319. 'SIGXFSZ',
  10320. 'SIGUSR2',
  10321. 'SIGTRAP',
  10322. 'SIGSYS',
  10323. 'SIGQUIT',
  10324. 'SIGIOT'
  10325. // should detect profiler and enable/disable accordingly.
  10326. // see #21
  10327. // 'SIGPROF'
  10328. )
  10329. }
  10330. if (process.platform === 'linux') {
  10331. module.exports.push(
  10332. 'SIGIO',
  10333. 'SIGPOLL',
  10334. 'SIGPWR',
  10335. 'SIGSTKFLT',
  10336. 'SIGUNUSED'
  10337. )
  10338. }
  10339. /***/ }),
  10340. /***/ 656:
  10341. /***/ (function(module, exports) {
  10342. exports = module.exports = SemVer
  10343. var debug
  10344. /* istanbul ignore next */
  10345. if (typeof process === 'object' &&
  10346. process.env &&
  10347. process.env.NODE_DEBUG &&
  10348. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10349. debug = function () {
  10350. var args = Array.prototype.slice.call(arguments, 0)
  10351. args.unshift('SEMVER')
  10352. console.log.apply(console, args)
  10353. }
  10354. } else {
  10355. debug = function () {}
  10356. }
  10357. // Note: this is the semver.org version of the spec that it implements
  10358. // Not necessarily the package version of this code.
  10359. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10360. var MAX_LENGTH = 256
  10361. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10362. /* istanbul ignore next */ 9007199254740991
  10363. // Max safe segment length for coercion.
  10364. var MAX_SAFE_COMPONENT_LENGTH = 16
  10365. // The actual regexps go on exports.re
  10366. var re = exports.re = []
  10367. var src = exports.src = []
  10368. var t = exports.tokens = {}
  10369. var R = 0
  10370. function tok (n) {
  10371. t[n] = R++
  10372. }
  10373. // The following Regular Expressions can be used for tokenizing,
  10374. // validating, and parsing SemVer version strings.
  10375. // ## Numeric Identifier
  10376. // A single `0`, or a non-zero digit followed by zero or more digits.
  10377. tok('NUMERICIDENTIFIER')
  10378. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10379. tok('NUMERICIDENTIFIERLOOSE')
  10380. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10381. // ## Non-numeric Identifier
  10382. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10383. // more letters, digits, or hyphens.
  10384. tok('NONNUMERICIDENTIFIER')
  10385. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10386. // ## Main Version
  10387. // Three dot-separated numeric identifiers.
  10388. tok('MAINVERSION')
  10389. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10390. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10391. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10392. tok('MAINVERSIONLOOSE')
  10393. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10394. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10395. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10396. // ## Pre-release Version Identifier
  10397. // A numeric identifier, or a non-numeric identifier.
  10398. tok('PRERELEASEIDENTIFIER')
  10399. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10400. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10401. tok('PRERELEASEIDENTIFIERLOOSE')
  10402. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10403. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10404. // ## Pre-release Version
  10405. // Hyphen, followed by one or more dot-separated pre-release version
  10406. // identifiers.
  10407. tok('PRERELEASE')
  10408. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10409. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10410. tok('PRERELEASELOOSE')
  10411. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10412. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10413. // ## Build Metadata Identifier
  10414. // Any combination of digits, letters, or hyphens.
  10415. tok('BUILDIDENTIFIER')
  10416. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10417. // ## Build Metadata
  10418. // Plus sign, followed by one or more period-separated build metadata
  10419. // identifiers.
  10420. tok('BUILD')
  10421. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10422. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10423. // ## Full Version String
  10424. // A main version, followed optionally by a pre-release version and
  10425. // build metadata.
  10426. // Note that the only major, minor, patch, and pre-release sections of
  10427. // the version string are capturing groups. The build metadata is not a
  10428. // capturing group, because it should not ever be used in version
  10429. // comparison.
  10430. tok('FULL')
  10431. tok('FULLPLAIN')
  10432. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10433. src[t.PRERELEASE] + '?' +
  10434. src[t.BUILD] + '?'
  10435. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10436. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10437. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10438. // common in the npm registry.
  10439. tok('LOOSEPLAIN')
  10440. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10441. src[t.PRERELEASELOOSE] + '?' +
  10442. src[t.BUILD] + '?'
  10443. tok('LOOSE')
  10444. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10445. tok('GTLT')
  10446. src[t.GTLT] = '((?:<|>)?=?)'
  10447. // Something like "2.*" or "1.2.x".
  10448. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10449. // Only the first item is strictly required.
  10450. tok('XRANGEIDENTIFIERLOOSE')
  10451. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10452. tok('XRANGEIDENTIFIER')
  10453. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10454. tok('XRANGEPLAIN')
  10455. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10456. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10457. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10458. '(?:' + src[t.PRERELEASE] + ')?' +
  10459. src[t.BUILD] + '?' +
  10460. ')?)?'
  10461. tok('XRANGEPLAINLOOSE')
  10462. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10463. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10464. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10465. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10466. src[t.BUILD] + '?' +
  10467. ')?)?'
  10468. tok('XRANGE')
  10469. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10470. tok('XRANGELOOSE')
  10471. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10472. // Coercion.
  10473. // Extract anything that could conceivably be a part of a valid semver
  10474. tok('COERCE')
  10475. src[t.COERCE] = '(^|[^\\d])' +
  10476. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10477. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10478. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10479. '(?:$|[^\\d])'
  10480. tok('COERCERTL')
  10481. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10482. // Tilde ranges.
  10483. // Meaning is "reasonably at or greater than"
  10484. tok('LONETILDE')
  10485. src[t.LONETILDE] = '(?:~>?)'
  10486. tok('TILDETRIM')
  10487. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10488. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10489. var tildeTrimReplace = '$1~'
  10490. tok('TILDE')
  10491. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10492. tok('TILDELOOSE')
  10493. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10494. // Caret ranges.
  10495. // Meaning is "at least and backwards compatible with"
  10496. tok('LONECARET')
  10497. src[t.LONECARET] = '(?:\\^)'
  10498. tok('CARETTRIM')
  10499. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10500. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10501. var caretTrimReplace = '$1^'
  10502. tok('CARET')
  10503. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10504. tok('CARETLOOSE')
  10505. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10506. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10507. tok('COMPARATORLOOSE')
  10508. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10509. tok('COMPARATOR')
  10510. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10511. // An expression to strip any whitespace between the gtlt and the thing
  10512. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10513. tok('COMPARATORTRIM')
  10514. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10515. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10516. // this one has to use the /g flag
  10517. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10518. var comparatorTrimReplace = '$1$2$3'
  10519. // Something like `1.2.3 - 1.2.4`
  10520. // Note that these all use the loose form, because they'll be
  10521. // checked against either the strict or loose comparator form
  10522. // later.
  10523. tok('HYPHENRANGE')
  10524. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10525. '\\s+-\\s+' +
  10526. '(' + src[t.XRANGEPLAIN] + ')' +
  10527. '\\s*$'
  10528. tok('HYPHENRANGELOOSE')
  10529. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10530. '\\s+-\\s+' +
  10531. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10532. '\\s*$'
  10533. // Star ranges basically just allow anything at all.
  10534. tok('STAR')
  10535. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10536. // Compile to actual regexp objects.
  10537. // All are flag-free, unless they were created above with a flag.
  10538. for (var i = 0; i < R; i++) {
  10539. debug(i, src[i])
  10540. if (!re[i]) {
  10541. re[i] = new RegExp(src[i])
  10542. }
  10543. }
  10544. exports.parse = parse
  10545. function parse (version, options) {
  10546. if (!options || typeof options !== 'object') {
  10547. options = {
  10548. loose: !!options,
  10549. includePrerelease: false
  10550. }
  10551. }
  10552. if (version instanceof SemVer) {
  10553. return version
  10554. }
  10555. if (typeof version !== 'string') {
  10556. return null
  10557. }
  10558. if (version.length > MAX_LENGTH) {
  10559. return null
  10560. }
  10561. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10562. if (!r.test(version)) {
  10563. return null
  10564. }
  10565. try {
  10566. return new SemVer(version, options)
  10567. } catch (er) {
  10568. return null
  10569. }
  10570. }
  10571. exports.valid = valid
  10572. function valid (version, options) {
  10573. var v = parse(version, options)
  10574. return v ? v.version : null
  10575. }
  10576. exports.clean = clean
  10577. function clean (version, options) {
  10578. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10579. return s ? s.version : null
  10580. }
  10581. exports.SemVer = SemVer
  10582. function SemVer (version, options) {
  10583. if (!options || typeof options !== 'object') {
  10584. options = {
  10585. loose: !!options,
  10586. includePrerelease: false
  10587. }
  10588. }
  10589. if (version instanceof SemVer) {
  10590. if (version.loose === options.loose) {
  10591. return version
  10592. } else {
  10593. version = version.version
  10594. }
  10595. } else if (typeof version !== 'string') {
  10596. throw new TypeError('Invalid Version: ' + version)
  10597. }
  10598. if (version.length > MAX_LENGTH) {
  10599. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10600. }
  10601. if (!(this instanceof SemVer)) {
  10602. return new SemVer(version, options)
  10603. }
  10604. debug('SemVer', version, options)
  10605. this.options = options
  10606. this.loose = !!options.loose
  10607. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10608. if (!m) {
  10609. throw new TypeError('Invalid Version: ' + version)
  10610. }
  10611. this.raw = version
  10612. // these are actually numbers
  10613. this.major = +m[1]
  10614. this.minor = +m[2]
  10615. this.patch = +m[3]
  10616. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10617. throw new TypeError('Invalid major version')
  10618. }
  10619. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10620. throw new TypeError('Invalid minor version')
  10621. }
  10622. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10623. throw new TypeError('Invalid patch version')
  10624. }
  10625. // numberify any prerelease numeric ids
  10626. if (!m[4]) {
  10627. this.prerelease = []
  10628. } else {
  10629. this.prerelease = m[4].split('.').map(function (id) {
  10630. if (/^[0-9]+$/.test(id)) {
  10631. var num = +id
  10632. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10633. return num
  10634. }
  10635. }
  10636. return id
  10637. })
  10638. }
  10639. this.build = m[5] ? m[5].split('.') : []
  10640. this.format()
  10641. }
  10642. SemVer.prototype.format = function () {
  10643. this.version = this.major + '.' + this.minor + '.' + this.patch
  10644. if (this.prerelease.length) {
  10645. this.version += '-' + this.prerelease.join('.')
  10646. }
  10647. return this.version
  10648. }
  10649. SemVer.prototype.toString = function () {
  10650. return this.version
  10651. }
  10652. SemVer.prototype.compare = function (other) {
  10653. debug('SemVer.compare', this.version, this.options, other)
  10654. if (!(other instanceof SemVer)) {
  10655. other = new SemVer(other, this.options)
  10656. }
  10657. return this.compareMain(other) || this.comparePre(other)
  10658. }
  10659. SemVer.prototype.compareMain = function (other) {
  10660. if (!(other instanceof SemVer)) {
  10661. other = new SemVer(other, this.options)
  10662. }
  10663. return compareIdentifiers(this.major, other.major) ||
  10664. compareIdentifiers(this.minor, other.minor) ||
  10665. compareIdentifiers(this.patch, other.patch)
  10666. }
  10667. SemVer.prototype.comparePre = function (other) {
  10668. if (!(other instanceof SemVer)) {
  10669. other = new SemVer(other, this.options)
  10670. }
  10671. // NOT having a prerelease is > having one
  10672. if (this.prerelease.length && !other.prerelease.length) {
  10673. return -1
  10674. } else if (!this.prerelease.length && other.prerelease.length) {
  10675. return 1
  10676. } else if (!this.prerelease.length && !other.prerelease.length) {
  10677. return 0
  10678. }
  10679. var i = 0
  10680. do {
  10681. var a = this.prerelease[i]
  10682. var b = other.prerelease[i]
  10683. debug('prerelease compare', i, a, b)
  10684. if (a === undefined && b === undefined) {
  10685. return 0
  10686. } else if (b === undefined) {
  10687. return 1
  10688. } else if (a === undefined) {
  10689. return -1
  10690. } else if (a === b) {
  10691. continue
  10692. } else {
  10693. return compareIdentifiers(a, b)
  10694. }
  10695. } while (++i)
  10696. }
  10697. SemVer.prototype.compareBuild = function (other) {
  10698. if (!(other instanceof SemVer)) {
  10699. other = new SemVer(other, this.options)
  10700. }
  10701. var i = 0
  10702. do {
  10703. var a = this.build[i]
  10704. var b = other.build[i]
  10705. debug('prerelease compare', i, a, b)
  10706. if (a === undefined && b === undefined) {
  10707. return 0
  10708. } else if (b === undefined) {
  10709. return 1
  10710. } else if (a === undefined) {
  10711. return -1
  10712. } else if (a === b) {
  10713. continue
  10714. } else {
  10715. return compareIdentifiers(a, b)
  10716. }
  10717. } while (++i)
  10718. }
  10719. // preminor will bump the version up to the next minor release, and immediately
  10720. // down to pre-release. premajor and prepatch work the same way.
  10721. SemVer.prototype.inc = function (release, identifier) {
  10722. switch (release) {
  10723. case 'premajor':
  10724. this.prerelease.length = 0
  10725. this.patch = 0
  10726. this.minor = 0
  10727. this.major++
  10728. this.inc('pre', identifier)
  10729. break
  10730. case 'preminor':
  10731. this.prerelease.length = 0
  10732. this.patch = 0
  10733. this.minor++
  10734. this.inc('pre', identifier)
  10735. break
  10736. case 'prepatch':
  10737. // If this is already a prerelease, it will bump to the next version
  10738. // drop any prereleases that might already exist, since they are not
  10739. // relevant at this point.
  10740. this.prerelease.length = 0
  10741. this.inc('patch', identifier)
  10742. this.inc('pre', identifier)
  10743. break
  10744. // If the input is a non-prerelease version, this acts the same as
  10745. // prepatch.
  10746. case 'prerelease':
  10747. if (this.prerelease.length === 0) {
  10748. this.inc('patch', identifier)
  10749. }
  10750. this.inc('pre', identifier)
  10751. break
  10752. case 'major':
  10753. // If this is a pre-major version, bump up to the same major version.
  10754. // Otherwise increment major.
  10755. // 1.0.0-5 bumps to 1.0.0
  10756. // 1.1.0 bumps to 2.0.0
  10757. if (this.minor !== 0 ||
  10758. this.patch !== 0 ||
  10759. this.prerelease.length === 0) {
  10760. this.major++
  10761. }
  10762. this.minor = 0
  10763. this.patch = 0
  10764. this.prerelease = []
  10765. break
  10766. case 'minor':
  10767. // If this is a pre-minor version, bump up to the same minor version.
  10768. // Otherwise increment minor.
  10769. // 1.2.0-5 bumps to 1.2.0
  10770. // 1.2.1 bumps to 1.3.0
  10771. if (this.patch !== 0 || this.prerelease.length === 0) {
  10772. this.minor++
  10773. }
  10774. this.patch = 0
  10775. this.prerelease = []
  10776. break
  10777. case 'patch':
  10778. // If this is not a pre-release version, it will increment the patch.
  10779. // If it is a pre-release it will bump up to the same patch version.
  10780. // 1.2.0-5 patches to 1.2.0
  10781. // 1.2.0 patches to 1.2.1
  10782. if (this.prerelease.length === 0) {
  10783. this.patch++
  10784. }
  10785. this.prerelease = []
  10786. break
  10787. // This probably shouldn't be used publicly.
  10788. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10789. case 'pre':
  10790. if (this.prerelease.length === 0) {
  10791. this.prerelease = [0]
  10792. } else {
  10793. var i = this.prerelease.length
  10794. while (--i >= 0) {
  10795. if (typeof this.prerelease[i] === 'number') {
  10796. this.prerelease[i]++
  10797. i = -2
  10798. }
  10799. }
  10800. if (i === -1) {
  10801. // didn't increment anything
  10802. this.prerelease.push(0)
  10803. }
  10804. }
  10805. if (identifier) {
  10806. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10807. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10808. if (this.prerelease[0] === identifier) {
  10809. if (isNaN(this.prerelease[1])) {
  10810. this.prerelease = [identifier, 0]
  10811. }
  10812. } else {
  10813. this.prerelease = [identifier, 0]
  10814. }
  10815. }
  10816. break
  10817. default:
  10818. throw new Error('invalid increment argument: ' + release)
  10819. }
  10820. this.format()
  10821. this.raw = this.version
  10822. return this
  10823. }
  10824. exports.inc = inc
  10825. function inc (version, release, loose, identifier) {
  10826. if (typeof (loose) === 'string') {
  10827. identifier = loose
  10828. loose = undefined
  10829. }
  10830. try {
  10831. return new SemVer(version, loose).inc(release, identifier).version
  10832. } catch (er) {
  10833. return null
  10834. }
  10835. }
  10836. exports.diff = diff
  10837. function diff (version1, version2) {
  10838. if (eq(version1, version2)) {
  10839. return null
  10840. } else {
  10841. var v1 = parse(version1)
  10842. var v2 = parse(version2)
  10843. var prefix = ''
  10844. if (v1.prerelease.length || v2.prerelease.length) {
  10845. prefix = 'pre'
  10846. var defaultResult = 'prerelease'
  10847. }
  10848. for (var key in v1) {
  10849. if (key === 'major' || key === 'minor' || key === 'patch') {
  10850. if (v1[key] !== v2[key]) {
  10851. return prefix + key
  10852. }
  10853. }
  10854. }
  10855. return defaultResult // may be undefined
  10856. }
  10857. }
  10858. exports.compareIdentifiers = compareIdentifiers
  10859. var numeric = /^[0-9]+$/
  10860. function compareIdentifiers (a, b) {
  10861. var anum = numeric.test(a)
  10862. var bnum = numeric.test(b)
  10863. if (anum && bnum) {
  10864. a = +a
  10865. b = +b
  10866. }
  10867. return a === b ? 0
  10868. : (anum && !bnum) ? -1
  10869. : (bnum && !anum) ? 1
  10870. : a < b ? -1
  10871. : 1
  10872. }
  10873. exports.rcompareIdentifiers = rcompareIdentifiers
  10874. function rcompareIdentifiers (a, b) {
  10875. return compareIdentifiers(b, a)
  10876. }
  10877. exports.major = major
  10878. function major (a, loose) {
  10879. return new SemVer(a, loose).major
  10880. }
  10881. exports.minor = minor
  10882. function minor (a, loose) {
  10883. return new SemVer(a, loose).minor
  10884. }
  10885. exports.patch = patch
  10886. function patch (a, loose) {
  10887. return new SemVer(a, loose).patch
  10888. }
  10889. exports.compare = compare
  10890. function compare (a, b, loose) {
  10891. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10892. }
  10893. exports.compareLoose = compareLoose
  10894. function compareLoose (a, b) {
  10895. return compare(a, b, true)
  10896. }
  10897. exports.compareBuild = compareBuild
  10898. function compareBuild (a, b, loose) {
  10899. var versionA = new SemVer(a, loose)
  10900. var versionB = new SemVer(b, loose)
  10901. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10902. }
  10903. exports.rcompare = rcompare
  10904. function rcompare (a, b, loose) {
  10905. return compare(b, a, loose)
  10906. }
  10907. exports.sort = sort
  10908. function sort (list, loose) {
  10909. return list.sort(function (a, b) {
  10910. return exports.compareBuild(a, b, loose)
  10911. })
  10912. }
  10913. exports.rsort = rsort
  10914. function rsort (list, loose) {
  10915. return list.sort(function (a, b) {
  10916. return exports.compareBuild(b, a, loose)
  10917. })
  10918. }
  10919. exports.gt = gt
  10920. function gt (a, b, loose) {
  10921. return compare(a, b, loose) > 0
  10922. }
  10923. exports.lt = lt
  10924. function lt (a, b, loose) {
  10925. return compare(a, b, loose) < 0
  10926. }
  10927. exports.eq = eq
  10928. function eq (a, b, loose) {
  10929. return compare(a, b, loose) === 0
  10930. }
  10931. exports.neq = neq
  10932. function neq (a, b, loose) {
  10933. return compare(a, b, loose) !== 0
  10934. }
  10935. exports.gte = gte
  10936. function gte (a, b, loose) {
  10937. return compare(a, b, loose) >= 0
  10938. }
  10939. exports.lte = lte
  10940. function lte (a, b, loose) {
  10941. return compare(a, b, loose) <= 0
  10942. }
  10943. exports.cmp = cmp
  10944. function cmp (a, op, b, loose) {
  10945. switch (op) {
  10946. case '===':
  10947. if (typeof a === 'object')
  10948. a = a.version
  10949. if (typeof b === 'object')
  10950. b = b.version
  10951. return a === b
  10952. case '!==':
  10953. if (typeof a === 'object')
  10954. a = a.version
  10955. if (typeof b === 'object')
  10956. b = b.version
  10957. return a !== b
  10958. case '':
  10959. case '=':
  10960. case '==':
  10961. return eq(a, b, loose)
  10962. case '!=':
  10963. return neq(a, b, loose)
  10964. case '>':
  10965. return gt(a, b, loose)
  10966. case '>=':
  10967. return gte(a, b, loose)
  10968. case '<':
  10969. return lt(a, b, loose)
  10970. case '<=':
  10971. return lte(a, b, loose)
  10972. default:
  10973. throw new TypeError('Invalid operator: ' + op)
  10974. }
  10975. }
  10976. exports.Comparator = Comparator
  10977. function Comparator (comp, options) {
  10978. if (!options || typeof options !== 'object') {
  10979. options = {
  10980. loose: !!options,
  10981. includePrerelease: false
  10982. }
  10983. }
  10984. if (comp instanceof Comparator) {
  10985. if (comp.loose === !!options.loose) {
  10986. return comp
  10987. } else {
  10988. comp = comp.value
  10989. }
  10990. }
  10991. if (!(this instanceof Comparator)) {
  10992. return new Comparator(comp, options)
  10993. }
  10994. debug('comparator', comp, options)
  10995. this.options = options
  10996. this.loose = !!options.loose
  10997. this.parse(comp)
  10998. if (this.semver === ANY) {
  10999. this.value = ''
  11000. } else {
  11001. this.value = this.operator + this.semver.version
  11002. }
  11003. debug('comp', this)
  11004. }
  11005. var ANY = {}
  11006. Comparator.prototype.parse = function (comp) {
  11007. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11008. var m = comp.match(r)
  11009. if (!m) {
  11010. throw new TypeError('Invalid comparator: ' + comp)
  11011. }
  11012. this.operator = m[1] !== undefined ? m[1] : ''
  11013. if (this.operator === '=') {
  11014. this.operator = ''
  11015. }
  11016. // if it literally is just '>' or '' then allow anything.
  11017. if (!m[2]) {
  11018. this.semver = ANY
  11019. } else {
  11020. this.semver = new SemVer(m[2], this.options.loose)
  11021. }
  11022. }
  11023. Comparator.prototype.toString = function () {
  11024. return this.value
  11025. }
  11026. Comparator.prototype.test = function (version) {
  11027. debug('Comparator.test', version, this.options.loose)
  11028. if (this.semver === ANY || version === ANY) {
  11029. return true
  11030. }
  11031. if (typeof version === 'string') {
  11032. try {
  11033. version = new SemVer(version, this.options)
  11034. } catch (er) {
  11035. return false
  11036. }
  11037. }
  11038. return cmp(version, this.operator, this.semver, this.options)
  11039. }
  11040. Comparator.prototype.intersects = function (comp, options) {
  11041. if (!(comp instanceof Comparator)) {
  11042. throw new TypeError('a Comparator is required')
  11043. }
  11044. if (!options || typeof options !== 'object') {
  11045. options = {
  11046. loose: !!options,
  11047. includePrerelease: false
  11048. }
  11049. }
  11050. var rangeTmp
  11051. if (this.operator === '') {
  11052. if (this.value === '') {
  11053. return true
  11054. }
  11055. rangeTmp = new Range(comp.value, options)
  11056. return satisfies(this.value, rangeTmp, options)
  11057. } else if (comp.operator === '') {
  11058. if (comp.value === '') {
  11059. return true
  11060. }
  11061. rangeTmp = new Range(this.value, options)
  11062. return satisfies(comp.semver, rangeTmp, options)
  11063. }
  11064. var sameDirectionIncreasing =
  11065. (this.operator === '>=' || this.operator === '>') &&
  11066. (comp.operator === '>=' || comp.operator === '>')
  11067. var sameDirectionDecreasing =
  11068. (this.operator === '<=' || this.operator === '<') &&
  11069. (comp.operator === '<=' || comp.operator === '<')
  11070. var sameSemVer = this.semver.version === comp.semver.version
  11071. var differentDirectionsInclusive =
  11072. (this.operator === '>=' || this.operator === '<=') &&
  11073. (comp.operator === '>=' || comp.operator === '<=')
  11074. var oppositeDirectionsLessThan =
  11075. cmp(this.semver, '<', comp.semver, options) &&
  11076. ((this.operator === '>=' || this.operator === '>') &&
  11077. (comp.operator === '<=' || comp.operator === '<'))
  11078. var oppositeDirectionsGreaterThan =
  11079. cmp(this.semver, '>', comp.semver, options) &&
  11080. ((this.operator === '<=' || this.operator === '<') &&
  11081. (comp.operator === '>=' || comp.operator === '>'))
  11082. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11083. (sameSemVer && differentDirectionsInclusive) ||
  11084. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11085. }
  11086. exports.Range = Range
  11087. function Range (range, options) {
  11088. if (!options || typeof options !== 'object') {
  11089. options = {
  11090. loose: !!options,
  11091. includePrerelease: false
  11092. }
  11093. }
  11094. if (range instanceof Range) {
  11095. if (range.loose === !!options.loose &&
  11096. range.includePrerelease === !!options.includePrerelease) {
  11097. return range
  11098. } else {
  11099. return new Range(range.raw, options)
  11100. }
  11101. }
  11102. if (range instanceof Comparator) {
  11103. return new Range(range.value, options)
  11104. }
  11105. if (!(this instanceof Range)) {
  11106. return new Range(range, options)
  11107. }
  11108. this.options = options
  11109. this.loose = !!options.loose
  11110. this.includePrerelease = !!options.includePrerelease
  11111. // First, split based on boolean or ||
  11112. this.raw = range
  11113. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11114. return this.parseRange(range.trim())
  11115. }, this).filter(function (c) {
  11116. // throw out any that are not relevant for whatever reason
  11117. return c.length
  11118. })
  11119. if (!this.set.length) {
  11120. throw new TypeError('Invalid SemVer Range: ' + range)
  11121. }
  11122. this.format()
  11123. }
  11124. Range.prototype.format = function () {
  11125. this.range = this.set.map(function (comps) {
  11126. return comps.join(' ').trim()
  11127. }).join('||').trim()
  11128. return this.range
  11129. }
  11130. Range.prototype.toString = function () {
  11131. return this.range
  11132. }
  11133. Range.prototype.parseRange = function (range) {
  11134. var loose = this.options.loose
  11135. range = range.trim()
  11136. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11137. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11138. range = range.replace(hr, hyphenReplace)
  11139. debug('hyphen replace', range)
  11140. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11141. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11142. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11143. // `~ 1.2.3` => `~1.2.3`
  11144. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11145. // `^ 1.2.3` => `^1.2.3`
  11146. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11147. // normalize spaces
  11148. range = range.split(/\s+/).join(' ')
  11149. // At this point, the range is completely trimmed and
  11150. // ready to be split into comparators.
  11151. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11152. var set = range.split(' ').map(function (comp) {
  11153. return parseComparator(comp, this.options)
  11154. }, this).join(' ').split(/\s+/)
  11155. if (this.options.loose) {
  11156. // in loose mode, throw out any that are not valid comparators
  11157. set = set.filter(function (comp) {
  11158. return !!comp.match(compRe)
  11159. })
  11160. }
  11161. set = set.map(function (comp) {
  11162. return new Comparator(comp, this.options)
  11163. }, this)
  11164. return set
  11165. }
  11166. Range.prototype.intersects = function (range, options) {
  11167. if (!(range instanceof Range)) {
  11168. throw new TypeError('a Range is required')
  11169. }
  11170. return this.set.some(function (thisComparators) {
  11171. return (
  11172. isSatisfiable(thisComparators, options) &&
  11173. range.set.some(function (rangeComparators) {
  11174. return (
  11175. isSatisfiable(rangeComparators, options) &&
  11176. thisComparators.every(function (thisComparator) {
  11177. return rangeComparators.every(function (rangeComparator) {
  11178. return thisComparator.intersects(rangeComparator, options)
  11179. })
  11180. })
  11181. )
  11182. })
  11183. )
  11184. })
  11185. }
  11186. // take a set of comparators and determine whether there
  11187. // exists a version which can satisfy it
  11188. function isSatisfiable (comparators, options) {
  11189. var result = true
  11190. var remainingComparators = comparators.slice()
  11191. var testComparator = remainingComparators.pop()
  11192. while (result && remainingComparators.length) {
  11193. result = remainingComparators.every(function (otherComparator) {
  11194. return testComparator.intersects(otherComparator, options)
  11195. })
  11196. testComparator = remainingComparators.pop()
  11197. }
  11198. return result
  11199. }
  11200. // Mostly just for testing and legacy API reasons
  11201. exports.toComparators = toComparators
  11202. function toComparators (range, options) {
  11203. return new Range(range, options).set.map(function (comp) {
  11204. return comp.map(function (c) {
  11205. return c.value
  11206. }).join(' ').trim().split(' ')
  11207. })
  11208. }
  11209. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11210. // already replaced the hyphen ranges
  11211. // turn into a set of JUST comparators.
  11212. function parseComparator (comp, options) {
  11213. debug('comp', comp, options)
  11214. comp = replaceCarets(comp, options)
  11215. debug('caret', comp)
  11216. comp = replaceTildes(comp, options)
  11217. debug('tildes', comp)
  11218. comp = replaceXRanges(comp, options)
  11219. debug('xrange', comp)
  11220. comp = replaceStars(comp, options)
  11221. debug('stars', comp)
  11222. return comp
  11223. }
  11224. function isX (id) {
  11225. return !id || id.toLowerCase() === 'x' || id === '*'
  11226. }
  11227. // ~, ~> --> * (any, kinda silly)
  11228. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11229. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11230. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11231. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11232. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11233. function replaceTildes (comp, options) {
  11234. return comp.trim().split(/\s+/).map(function (comp) {
  11235. return replaceTilde(comp, options)
  11236. }).join(' ')
  11237. }
  11238. function replaceTilde (comp, options) {
  11239. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11240. return comp.replace(r, function (_, M, m, p, pr) {
  11241. debug('tilde', comp, _, M, m, p, pr)
  11242. var ret
  11243. if (isX(M)) {
  11244. ret = ''
  11245. } else if (isX(m)) {
  11246. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11247. } else if (isX(p)) {
  11248. // ~1.2 == >=1.2.0 <1.3.0
  11249. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11250. } else if (pr) {
  11251. debug('replaceTilde pr', pr)
  11252. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11253. ' <' + M + '.' + (+m + 1) + '.0'
  11254. } else {
  11255. // ~1.2.3 == >=1.2.3 <1.3.0
  11256. ret = '>=' + M + '.' + m + '.' + p +
  11257. ' <' + M + '.' + (+m + 1) + '.0'
  11258. }
  11259. debug('tilde return', ret)
  11260. return ret
  11261. })
  11262. }
  11263. // ^ --> * (any, kinda silly)
  11264. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11265. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11266. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11267. // ^1.2.3 --> >=1.2.3 <2.0.0
  11268. // ^1.2.0 --> >=1.2.0 <2.0.0
  11269. function replaceCarets (comp, options) {
  11270. return comp.trim().split(/\s+/).map(function (comp) {
  11271. return replaceCaret(comp, options)
  11272. }).join(' ')
  11273. }
  11274. function replaceCaret (comp, options) {
  11275. debug('caret', comp, options)
  11276. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11277. return comp.replace(r, function (_, M, m, p, pr) {
  11278. debug('caret', comp, _, M, m, p, pr)
  11279. var ret
  11280. if (isX(M)) {
  11281. ret = ''
  11282. } else if (isX(m)) {
  11283. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11284. } else if (isX(p)) {
  11285. if (M === '0') {
  11286. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11287. } else {
  11288. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11289. }
  11290. } else if (pr) {
  11291. debug('replaceCaret pr', pr)
  11292. if (M === '0') {
  11293. if (m === '0') {
  11294. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11295. ' <' + M + '.' + m + '.' + (+p + 1)
  11296. } else {
  11297. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11298. ' <' + M + '.' + (+m + 1) + '.0'
  11299. }
  11300. } else {
  11301. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11302. ' <' + (+M + 1) + '.0.0'
  11303. }
  11304. } else {
  11305. debug('no pr')
  11306. if (M === '0') {
  11307. if (m === '0') {
  11308. ret = '>=' + M + '.' + m + '.' + p +
  11309. ' <' + M + '.' + m + '.' + (+p + 1)
  11310. } else {
  11311. ret = '>=' + M + '.' + m + '.' + p +
  11312. ' <' + M + '.' + (+m + 1) + '.0'
  11313. }
  11314. } else {
  11315. ret = '>=' + M + '.' + m + '.' + p +
  11316. ' <' + (+M + 1) + '.0.0'
  11317. }
  11318. }
  11319. debug('caret return', ret)
  11320. return ret
  11321. })
  11322. }
  11323. function replaceXRanges (comp, options) {
  11324. debug('replaceXRanges', comp, options)
  11325. return comp.split(/\s+/).map(function (comp) {
  11326. return replaceXRange(comp, options)
  11327. }).join(' ')
  11328. }
  11329. function replaceXRange (comp, options) {
  11330. comp = comp.trim()
  11331. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11332. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11333. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11334. var xM = isX(M)
  11335. var xm = xM || isX(m)
  11336. var xp = xm || isX(p)
  11337. var anyX = xp
  11338. if (gtlt === '=' && anyX) {
  11339. gtlt = ''
  11340. }
  11341. // if we're including prereleases in the match, then we need
  11342. // to fix this to -0, the lowest possible prerelease value
  11343. pr = options.includePrerelease ? '-0' : ''
  11344. if (xM) {
  11345. if (gtlt === '>' || gtlt === '<') {
  11346. // nothing is allowed
  11347. ret = '<0.0.0-0'
  11348. } else {
  11349. // nothing is forbidden
  11350. ret = '*'
  11351. }
  11352. } else if (gtlt && anyX) {
  11353. // we know patch is an x, because we have any x at all.
  11354. // replace X with 0
  11355. if (xm) {
  11356. m = 0
  11357. }
  11358. p = 0
  11359. if (gtlt === '>') {
  11360. // >1 => >=2.0.0
  11361. // >1.2 => >=1.3.0
  11362. // >1.2.3 => >= 1.2.4
  11363. gtlt = '>='
  11364. if (xm) {
  11365. M = +M + 1
  11366. m = 0
  11367. p = 0
  11368. } else {
  11369. m = +m + 1
  11370. p = 0
  11371. }
  11372. } else if (gtlt === '<=') {
  11373. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11374. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11375. gtlt = '<'
  11376. if (xm) {
  11377. M = +M + 1
  11378. } else {
  11379. m = +m + 1
  11380. }
  11381. }
  11382. ret = gtlt + M + '.' + m + '.' + p + pr
  11383. } else if (xm) {
  11384. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11385. } else if (xp) {
  11386. ret = '>=' + M + '.' + m + '.0' + pr +
  11387. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11388. }
  11389. debug('xRange return', ret)
  11390. return ret
  11391. })
  11392. }
  11393. // Because * is AND-ed with everything else in the comparator,
  11394. // and '' means "any version", just remove the *s entirely.
  11395. function replaceStars (comp, options) {
  11396. debug('replaceStars', comp, options)
  11397. // Looseness is ignored here. star is always as loose as it gets!
  11398. return comp.trim().replace(re[t.STAR], '')
  11399. }
  11400. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11401. // M, m, patch, prerelease, build
  11402. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11403. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11404. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11405. function hyphenReplace ($0,
  11406. from, fM, fm, fp, fpr, fb,
  11407. to, tM, tm, tp, tpr, tb) {
  11408. if (isX(fM)) {
  11409. from = ''
  11410. } else if (isX(fm)) {
  11411. from = '>=' + fM + '.0.0'
  11412. } else if (isX(fp)) {
  11413. from = '>=' + fM + '.' + fm + '.0'
  11414. } else {
  11415. from = '>=' + from
  11416. }
  11417. if (isX(tM)) {
  11418. to = ''
  11419. } else if (isX(tm)) {
  11420. to = '<' + (+tM + 1) + '.0.0'
  11421. } else if (isX(tp)) {
  11422. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11423. } else if (tpr) {
  11424. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11425. } else {
  11426. to = '<=' + to
  11427. }
  11428. return (from + ' ' + to).trim()
  11429. }
  11430. // if ANY of the sets match ALL of its comparators, then pass
  11431. Range.prototype.test = function (version) {
  11432. if (!version) {
  11433. return false
  11434. }
  11435. if (typeof version === 'string') {
  11436. try {
  11437. version = new SemVer(version, this.options)
  11438. } catch (er) {
  11439. return false
  11440. }
  11441. }
  11442. for (var i = 0; i < this.set.length; i++) {
  11443. if (testSet(this.set[i], version, this.options)) {
  11444. return true
  11445. }
  11446. }
  11447. return false
  11448. }
  11449. function testSet (set, version, options) {
  11450. for (var i = 0; i < set.length; i++) {
  11451. if (!set[i].test(version)) {
  11452. return false
  11453. }
  11454. }
  11455. if (version.prerelease.length && !options.includePrerelease) {
  11456. // Find the set of versions that are allowed to have prereleases
  11457. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11458. // That should allow `1.2.3-pr.2` to pass.
  11459. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11460. // even though it's within the range set by the comparators.
  11461. for (i = 0; i < set.length; i++) {
  11462. debug(set[i].semver)
  11463. if (set[i].semver === ANY) {
  11464. continue
  11465. }
  11466. if (set[i].semver.prerelease.length > 0) {
  11467. var allowed = set[i].semver
  11468. if (allowed.major === version.major &&
  11469. allowed.minor === version.minor &&
  11470. allowed.patch === version.patch) {
  11471. return true
  11472. }
  11473. }
  11474. }
  11475. // Version has a -pre, but it's not one of the ones we like.
  11476. return false
  11477. }
  11478. return true
  11479. }
  11480. exports.satisfies = satisfies
  11481. function satisfies (version, range, options) {
  11482. try {
  11483. range = new Range(range, options)
  11484. } catch (er) {
  11485. return false
  11486. }
  11487. return range.test(version)
  11488. }
  11489. exports.maxSatisfying = maxSatisfying
  11490. function maxSatisfying (versions, range, options) {
  11491. var max = null
  11492. var maxSV = null
  11493. try {
  11494. var rangeObj = new Range(range, options)
  11495. } catch (er) {
  11496. return null
  11497. }
  11498. versions.forEach(function (v) {
  11499. if (rangeObj.test(v)) {
  11500. // satisfies(v, range, options)
  11501. if (!max || maxSV.compare(v) === -1) {
  11502. // compare(max, v, true)
  11503. max = v
  11504. maxSV = new SemVer(max, options)
  11505. }
  11506. }
  11507. })
  11508. return max
  11509. }
  11510. exports.minSatisfying = minSatisfying
  11511. function minSatisfying (versions, range, options) {
  11512. var min = null
  11513. var minSV = null
  11514. try {
  11515. var rangeObj = new Range(range, options)
  11516. } catch (er) {
  11517. return null
  11518. }
  11519. versions.forEach(function (v) {
  11520. if (rangeObj.test(v)) {
  11521. // satisfies(v, range, options)
  11522. if (!min || minSV.compare(v) === 1) {
  11523. // compare(min, v, true)
  11524. min = v
  11525. minSV = new SemVer(min, options)
  11526. }
  11527. }
  11528. })
  11529. return min
  11530. }
  11531. exports.minVersion = minVersion
  11532. function minVersion (range, loose) {
  11533. range = new Range(range, loose)
  11534. var minver = new SemVer('0.0.0')
  11535. if (range.test(minver)) {
  11536. return minver
  11537. }
  11538. minver = new SemVer('0.0.0-0')
  11539. if (range.test(minver)) {
  11540. return minver
  11541. }
  11542. minver = null
  11543. for (var i = 0; i < range.set.length; ++i) {
  11544. var comparators = range.set[i]
  11545. comparators.forEach(function (comparator) {
  11546. // Clone to avoid manipulating the comparator's semver object.
  11547. var compver = new SemVer(comparator.semver.version)
  11548. switch (comparator.operator) {
  11549. case '>':
  11550. if (compver.prerelease.length === 0) {
  11551. compver.patch++
  11552. } else {
  11553. compver.prerelease.push(0)
  11554. }
  11555. compver.raw = compver.format()
  11556. /* fallthrough */
  11557. case '':
  11558. case '>=':
  11559. if (!minver || gt(minver, compver)) {
  11560. minver = compver
  11561. }
  11562. break
  11563. case '<':
  11564. case '<=':
  11565. /* Ignore maximum versions */
  11566. break
  11567. /* istanbul ignore next */
  11568. default:
  11569. throw new Error('Unexpected operation: ' + comparator.operator)
  11570. }
  11571. })
  11572. }
  11573. if (minver && range.test(minver)) {
  11574. return minver
  11575. }
  11576. return null
  11577. }
  11578. exports.validRange = validRange
  11579. function validRange (range, options) {
  11580. try {
  11581. // Return '*' instead of '' so that truthiness works.
  11582. // This will throw if it's invalid anyway
  11583. return new Range(range, options).range || '*'
  11584. } catch (er) {
  11585. return null
  11586. }
  11587. }
  11588. // Determine if version is less than all the versions possible in the range
  11589. exports.ltr = ltr
  11590. function ltr (version, range, options) {
  11591. return outside(version, range, '<', options)
  11592. }
  11593. // Determine if version is greater than all the versions possible in the range.
  11594. exports.gtr = gtr
  11595. function gtr (version, range, options) {
  11596. return outside(version, range, '>', options)
  11597. }
  11598. exports.outside = outside
  11599. function outside (version, range, hilo, options) {
  11600. version = new SemVer(version, options)
  11601. range = new Range(range, options)
  11602. var gtfn, ltefn, ltfn, comp, ecomp
  11603. switch (hilo) {
  11604. case '>':
  11605. gtfn = gt
  11606. ltefn = lte
  11607. ltfn = lt
  11608. comp = '>'
  11609. ecomp = '>='
  11610. break
  11611. case '<':
  11612. gtfn = lt
  11613. ltefn = gte
  11614. ltfn = gt
  11615. comp = '<'
  11616. ecomp = '<='
  11617. break
  11618. default:
  11619. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11620. }
  11621. // If it satisifes the range it is not outside
  11622. if (satisfies(version, range, options)) {
  11623. return false
  11624. }
  11625. // From now on, variable terms are as if we're in "gtr" mode.
  11626. // but note that everything is flipped for the "ltr" function.
  11627. for (var i = 0; i < range.set.length; ++i) {
  11628. var comparators = range.set[i]
  11629. var high = null
  11630. var low = null
  11631. comparators.forEach(function (comparator) {
  11632. if (comparator.semver === ANY) {
  11633. comparator = new Comparator('>=0.0.0')
  11634. }
  11635. high = high || comparator
  11636. low = low || comparator
  11637. if (gtfn(comparator.semver, high.semver, options)) {
  11638. high = comparator
  11639. } else if (ltfn(comparator.semver, low.semver, options)) {
  11640. low = comparator
  11641. }
  11642. })
  11643. // If the edge version comparator has a operator then our version
  11644. // isn't outside it
  11645. if (high.operator === comp || high.operator === ecomp) {
  11646. return false
  11647. }
  11648. // If the lowest version comparator has an operator and our version
  11649. // is less than it then it isn't higher than the range
  11650. if ((!low.operator || low.operator === comp) &&
  11651. ltefn(version, low.semver)) {
  11652. return false
  11653. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11654. return false
  11655. }
  11656. }
  11657. return true
  11658. }
  11659. exports.prerelease = prerelease
  11660. function prerelease (version, options) {
  11661. var parsed = parse(version, options)
  11662. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11663. }
  11664. exports.intersects = intersects
  11665. function intersects (r1, r2, options) {
  11666. r1 = new Range(r1, options)
  11667. r2 = new Range(r2, options)
  11668. return r1.intersects(r2)
  11669. }
  11670. exports.coerce = coerce
  11671. function coerce (version, options) {
  11672. if (version instanceof SemVer) {
  11673. return version
  11674. }
  11675. if (typeof version === 'number') {
  11676. version = String(version)
  11677. }
  11678. if (typeof version !== 'string') {
  11679. return null
  11680. }
  11681. options = options || {}
  11682. var match = null
  11683. if (!options.rtl) {
  11684. match = version.match(re[t.COERCE])
  11685. } else {
  11686. // Find the right-most coercible string that does not share
  11687. // a terminus with a more left-ward coercible string.
  11688. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11689. //
  11690. // Walk through the string checking with a /g regexp
  11691. // Manually set the index so as to pick up overlapping matches.
  11692. // Stop when we get a match that ends at the string end, since no
  11693. // coercible string can be more right-ward without the same terminus.
  11694. var next
  11695. while ((next = re[t.COERCERTL].exec(version)) &&
  11696. (!match || match.index + match[0].length !== version.length)
  11697. ) {
  11698. if (!match ||
  11699. next.index + next[0].length !== match.index + match[0].length) {
  11700. match = next
  11701. }
  11702. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11703. }
  11704. // leave it in a clean state
  11705. re[t.COERCERTL].lastIndex = -1
  11706. }
  11707. if (match === null) {
  11708. return null
  11709. }
  11710. return parse(match[2] +
  11711. '.' + (match[3] || '0') +
  11712. '.' + (match[4] || '0'), options)
  11713. }
  11714. /***/ }),
  11715. /***/ 669:
  11716. /***/ (function(module) {
  11717. module.exports = require("util");
  11718. /***/ }),
  11719. /***/ 672:
  11720. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11721. "use strict";
  11722. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11723. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11724. return new (P || (P = Promise))(function (resolve, reject) {
  11725. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11726. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11727. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11728. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11729. });
  11730. };
  11731. var _a;
  11732. Object.defineProperty(exports, "__esModule", { value: true });
  11733. const assert_1 = __webpack_require__(357);
  11734. const fs = __webpack_require__(747);
  11735. const path = __webpack_require__(622);
  11736. _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;
  11737. exports.IS_WINDOWS = process.platform === 'win32';
  11738. function exists(fsPath) {
  11739. return __awaiter(this, void 0, void 0, function* () {
  11740. try {
  11741. yield exports.stat(fsPath);
  11742. }
  11743. catch (err) {
  11744. if (err.code === 'ENOENT') {
  11745. return false;
  11746. }
  11747. throw err;
  11748. }
  11749. return true;
  11750. });
  11751. }
  11752. exports.exists = exists;
  11753. function isDirectory(fsPath, useStat = false) {
  11754. return __awaiter(this, void 0, void 0, function* () {
  11755. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11756. return stats.isDirectory();
  11757. });
  11758. }
  11759. exports.isDirectory = isDirectory;
  11760. /**
  11761. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11762. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11763. */
  11764. function isRooted(p) {
  11765. p = normalizeSeparators(p);
  11766. if (!p) {
  11767. throw new Error('isRooted() parameter "p" cannot be empty');
  11768. }
  11769. if (exports.IS_WINDOWS) {
  11770. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11771. ); // e.g. C: or C:\hello
  11772. }
  11773. return p.startsWith('/');
  11774. }
  11775. exports.isRooted = isRooted;
  11776. /**
  11777. * Recursively create a directory at `fsPath`.
  11778. *
  11779. * This implementation is optimistic, meaning it attempts to create the full
  11780. * path first, and backs up the path stack from there.
  11781. *
  11782. * @param fsPath The path to create
  11783. * @param maxDepth The maximum recursion depth
  11784. * @param depth The current recursion depth
  11785. */
  11786. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11787. return __awaiter(this, void 0, void 0, function* () {
  11788. assert_1.ok(fsPath, 'a path argument must be provided');
  11789. fsPath = path.resolve(fsPath);
  11790. if (depth >= maxDepth)
  11791. return exports.mkdir(fsPath);
  11792. try {
  11793. yield exports.mkdir(fsPath);
  11794. return;
  11795. }
  11796. catch (err) {
  11797. switch (err.code) {
  11798. case 'ENOENT': {
  11799. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11800. yield exports.mkdir(fsPath);
  11801. return;
  11802. }
  11803. default: {
  11804. let stats;
  11805. try {
  11806. stats = yield exports.stat(fsPath);
  11807. }
  11808. catch (err2) {
  11809. throw err;
  11810. }
  11811. if (!stats.isDirectory())
  11812. throw err;
  11813. }
  11814. }
  11815. }
  11816. });
  11817. }
  11818. exports.mkdirP = mkdirP;
  11819. /**
  11820. * Best effort attempt to determine whether a file exists and is executable.
  11821. * @param filePath file path to check
  11822. * @param extensions additional file extensions to try
  11823. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11824. */
  11825. function tryGetExecutablePath(filePath, extensions) {
  11826. return __awaiter(this, void 0, void 0, function* () {
  11827. let stats = undefined;
  11828. try {
  11829. // test file exists
  11830. stats = yield exports.stat(filePath);
  11831. }
  11832. catch (err) {
  11833. if (err.code !== 'ENOENT') {
  11834. // eslint-disable-next-line no-console
  11835. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11836. }
  11837. }
  11838. if (stats && stats.isFile()) {
  11839. if (exports.IS_WINDOWS) {
  11840. // on Windows, test for valid extension
  11841. const upperExt = path.extname(filePath).toUpperCase();
  11842. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11843. return filePath;
  11844. }
  11845. }
  11846. else {
  11847. if (isUnixExecutable(stats)) {
  11848. return filePath;
  11849. }
  11850. }
  11851. }
  11852. // try each extension
  11853. const originalFilePath = filePath;
  11854. for (const extension of extensions) {
  11855. filePath = originalFilePath + extension;
  11856. stats = undefined;
  11857. try {
  11858. stats = yield exports.stat(filePath);
  11859. }
  11860. catch (err) {
  11861. if (err.code !== 'ENOENT') {
  11862. // eslint-disable-next-line no-console
  11863. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11864. }
  11865. }
  11866. if (stats && stats.isFile()) {
  11867. if (exports.IS_WINDOWS) {
  11868. // preserve the case of the actual file (since an extension was appended)
  11869. try {
  11870. const directory = path.dirname(filePath);
  11871. const upperName = path.basename(filePath).toUpperCase();
  11872. for (const actualName of yield exports.readdir(directory)) {
  11873. if (upperName === actualName.toUpperCase()) {
  11874. filePath = path.join(directory, actualName);
  11875. break;
  11876. }
  11877. }
  11878. }
  11879. catch (err) {
  11880. // eslint-disable-next-line no-console
  11881. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11882. }
  11883. return filePath;
  11884. }
  11885. else {
  11886. if (isUnixExecutable(stats)) {
  11887. return filePath;
  11888. }
  11889. }
  11890. }
  11891. }
  11892. return '';
  11893. });
  11894. }
  11895. exports.tryGetExecutablePath = tryGetExecutablePath;
  11896. function normalizeSeparators(p) {
  11897. p = p || '';
  11898. if (exports.IS_WINDOWS) {
  11899. // convert slashes on Windows
  11900. p = p.replace(/\//g, '\\');
  11901. // remove redundant slashes
  11902. return p.replace(/\\\\+/g, '\\');
  11903. }
  11904. // remove redundant slashes
  11905. return p.replace(/\/\/+/g, '/');
  11906. }
  11907. // on Mac/Linux, test the execute bit
  11908. // R W X R W X R W X
  11909. // 256 128 64 32 16 8 4 2 1
  11910. function isUnixExecutable(stats) {
  11911. return ((stats.mode & 1) > 0 ||
  11912. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11913. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11914. }
  11915. //# sourceMappingURL=io-util.js.map
  11916. /***/ }),
  11917. /***/ 674:
  11918. /***/ (function(module, __unusedexports, __webpack_require__) {
  11919. module.exports = authenticate;
  11920. const { Deprecation } = __webpack_require__(692);
  11921. const once = __webpack_require__(969);
  11922. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11923. function authenticate(state, options) {
  11924. deprecateAuthenticate(
  11925. state.octokit.log,
  11926. new Deprecation(
  11927. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11928. )
  11929. );
  11930. if (!options) {
  11931. state.auth = false;
  11932. return;
  11933. }
  11934. switch (options.type) {
  11935. case "basic":
  11936. if (!options.username || !options.password) {
  11937. throw new Error(
  11938. "Basic authentication requires both a username and password to be set"
  11939. );
  11940. }
  11941. break;
  11942. case "oauth":
  11943. if (!options.token && !(options.key && options.secret)) {
  11944. throw new Error(
  11945. "OAuth2 authentication requires a token or key & secret to be set"
  11946. );
  11947. }
  11948. break;
  11949. case "token":
  11950. case "app":
  11951. if (!options.token) {
  11952. throw new Error("Token authentication requires a token to be set");
  11953. }
  11954. break;
  11955. default:
  11956. throw new Error(
  11957. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11958. );
  11959. }
  11960. state.auth = options;
  11961. }
  11962. /***/ }),
  11963. /***/ 675:
  11964. /***/ (function(module) {
  11965. module.exports = function btoa(str) {
  11966. return new Buffer(str).toString('base64')
  11967. }
  11968. /***/ }),
  11969. /***/ 692:
  11970. /***/ (function(__unusedmodule, exports) {
  11971. "use strict";
  11972. Object.defineProperty(exports, '__esModule', { value: true });
  11973. class Deprecation extends Error {
  11974. constructor(message) {
  11975. super(message); // Maintains proper stack trace (only available on V8)
  11976. /* istanbul ignore next */
  11977. if (Error.captureStackTrace) {
  11978. Error.captureStackTrace(this, this.constructor);
  11979. }
  11980. this.name = 'Deprecation';
  11981. }
  11982. }
  11983. exports.Deprecation = Deprecation;
  11984. /***/ }),
  11985. /***/ 696:
  11986. /***/ (function(module) {
  11987. "use strict";
  11988. /*!
  11989. * isobject <https://github.com/jonschlinkert/isobject>
  11990. *
  11991. * Copyright (c) 2014-2017, Jon Schlinkert.
  11992. * Released under the MIT License.
  11993. */
  11994. function isObject(val) {
  11995. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11996. }
  11997. /*!
  11998. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11999. *
  12000. * Copyright (c) 2014-2017, Jon Schlinkert.
  12001. * Released under the MIT License.
  12002. */
  12003. function isObjectObject(o) {
  12004. return isObject(o) === true
  12005. && Object.prototype.toString.call(o) === '[object Object]';
  12006. }
  12007. function isPlainObject(o) {
  12008. var ctor,prot;
  12009. if (isObjectObject(o) === false) return false;
  12010. // If has modified constructor
  12011. ctor = o.constructor;
  12012. if (typeof ctor !== 'function') return false;
  12013. // If has modified prototype
  12014. prot = ctor.prototype;
  12015. if (isObjectObject(prot) === false) return false;
  12016. // If constructor does not have an Object-specific method
  12017. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12018. return false;
  12019. }
  12020. // Most likely a plain Object
  12021. return true;
  12022. }
  12023. module.exports = isPlainObject;
  12024. /***/ }),
  12025. /***/ 697:
  12026. /***/ (function(module) {
  12027. "use strict";
  12028. module.exports = (promise, onFinally) => {
  12029. onFinally = onFinally || (() => {});
  12030. return promise.then(
  12031. val => new Promise(resolve => {
  12032. resolve(onFinally());
  12033. }).then(() => val),
  12034. err => new Promise(resolve => {
  12035. resolve(onFinally());
  12036. }).then(() => {
  12037. throw err;
  12038. })
  12039. );
  12040. };
  12041. /***/ }),
  12042. /***/ 722:
  12043. /***/ (function(module) {
  12044. /**
  12045. * Convert array of 16 byte values to UUID string format of the form:
  12046. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12047. */
  12048. var byteToHex = [];
  12049. for (var i = 0; i < 256; ++i) {
  12050. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12051. }
  12052. function bytesToUuid(buf, offset) {
  12053. var i = offset || 0;
  12054. var bth = byteToHex;
  12055. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12056. return ([bth[buf[i++]], bth[buf[i++]],
  12057. bth[buf[i++]], bth[buf[i++]], '-',
  12058. bth[buf[i++]], bth[buf[i++]], '-',
  12059. bth[buf[i++]], bth[buf[i++]], '-',
  12060. bth[buf[i++]], bth[buf[i++]], '-',
  12061. bth[buf[i++]], bth[buf[i++]],
  12062. bth[buf[i++]], bth[buf[i++]],
  12063. bth[buf[i++]], bth[buf[i++]]]).join('');
  12064. }
  12065. module.exports = bytesToUuid;
  12066. /***/ }),
  12067. /***/ 742:
  12068. /***/ (function(module, __unusedexports, __webpack_require__) {
  12069. var fs = __webpack_require__(747)
  12070. var core
  12071. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12072. core = __webpack_require__(818)
  12073. } else {
  12074. core = __webpack_require__(197)
  12075. }
  12076. module.exports = isexe
  12077. isexe.sync = sync
  12078. function isexe (path, options, cb) {
  12079. if (typeof options === 'function') {
  12080. cb = options
  12081. options = {}
  12082. }
  12083. if (!cb) {
  12084. if (typeof Promise !== 'function') {
  12085. throw new TypeError('callback not provided')
  12086. }
  12087. return new Promise(function (resolve, reject) {
  12088. isexe(path, options || {}, function (er, is) {
  12089. if (er) {
  12090. reject(er)
  12091. } else {
  12092. resolve(is)
  12093. }
  12094. })
  12095. })
  12096. }
  12097. core(path, options || {}, function (er, is) {
  12098. // ignore EACCES because that just means we aren't allowed to run it
  12099. if (er) {
  12100. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12101. er = null
  12102. is = false
  12103. }
  12104. }
  12105. cb(er, is)
  12106. })
  12107. }
  12108. function sync (path, options) {
  12109. // my kingdom for a filtered catch
  12110. try {
  12111. return core.sync(path, options || {})
  12112. } catch (er) {
  12113. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12114. return false
  12115. } else {
  12116. throw er
  12117. }
  12118. }
  12119. }
  12120. /***/ }),
  12121. /***/ 747:
  12122. /***/ (function(module) {
  12123. module.exports = require("fs");
  12124. /***/ }),
  12125. /***/ 753:
  12126. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12127. "use strict";
  12128. Object.defineProperty(exports, '__esModule', { value: true });
  12129. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12130. var endpoint = __webpack_require__(385);
  12131. var universalUserAgent = __webpack_require__(211);
  12132. var isPlainObject = _interopDefault(__webpack_require__(696));
  12133. var nodeFetch = _interopDefault(__webpack_require__(454));
  12134. var requestError = __webpack_require__(463);
  12135. const VERSION = "5.4.2";
  12136. function getBufferResponse(response) {
  12137. return response.arrayBuffer();
  12138. }
  12139. function fetchWrapper(requestOptions) {
  12140. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12141. requestOptions.body = JSON.stringify(requestOptions.body);
  12142. }
  12143. let headers = {};
  12144. let status;
  12145. let url;
  12146. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12147. return fetch(requestOptions.url, Object.assign({
  12148. method: requestOptions.method,
  12149. body: requestOptions.body,
  12150. headers: requestOptions.headers,
  12151. redirect: requestOptions.redirect
  12152. }, requestOptions.request)).then(response => {
  12153. url = response.url;
  12154. status = response.status;
  12155. for (const keyAndValue of response.headers) {
  12156. headers[keyAndValue[0]] = keyAndValue[1];
  12157. }
  12158. if (status === 204 || status === 205) {
  12159. return;
  12160. } // GitHub API returns 200 for HEAD requests
  12161. if (requestOptions.method === "HEAD") {
  12162. if (status < 400) {
  12163. return;
  12164. }
  12165. throw new requestError.RequestError(response.statusText, status, {
  12166. headers,
  12167. request: requestOptions
  12168. });
  12169. }
  12170. if (status === 304) {
  12171. throw new requestError.RequestError("Not modified", status, {
  12172. headers,
  12173. request: requestOptions
  12174. });
  12175. }
  12176. if (status >= 400) {
  12177. return response.text().then(message => {
  12178. const error = new requestError.RequestError(message, status, {
  12179. headers,
  12180. request: requestOptions
  12181. });
  12182. try {
  12183. let responseBody = JSON.parse(error.message);
  12184. Object.assign(error, responseBody);
  12185. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12186. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12187. } catch (e) {// ignore, see octokit/rest.js#684
  12188. }
  12189. throw error;
  12190. });
  12191. }
  12192. const contentType = response.headers.get("content-type");
  12193. if (/application\/json/.test(contentType)) {
  12194. return response.json();
  12195. }
  12196. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12197. return response.text();
  12198. }
  12199. return getBufferResponse(response);
  12200. }).then(data => {
  12201. return {
  12202. status,
  12203. url,
  12204. headers,
  12205. data
  12206. };
  12207. }).catch(error => {
  12208. if (error instanceof requestError.RequestError) {
  12209. throw error;
  12210. }
  12211. throw new requestError.RequestError(error.message, 500, {
  12212. headers,
  12213. request: requestOptions
  12214. });
  12215. });
  12216. }
  12217. function withDefaults(oldEndpoint, newDefaults) {
  12218. const endpoint = oldEndpoint.defaults(newDefaults);
  12219. const newApi = function (route, parameters) {
  12220. const endpointOptions = endpoint.merge(route, parameters);
  12221. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12222. return fetchWrapper(endpoint.parse(endpointOptions));
  12223. }
  12224. const request = (route, parameters) => {
  12225. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12226. };
  12227. Object.assign(request, {
  12228. endpoint,
  12229. defaults: withDefaults.bind(null, endpoint)
  12230. });
  12231. return endpointOptions.request.hook(request, endpointOptions);
  12232. };
  12233. return Object.assign(newApi, {
  12234. endpoint,
  12235. defaults: withDefaults.bind(null, endpoint)
  12236. });
  12237. }
  12238. const request = withDefaults(endpoint.endpoint, {
  12239. headers: {
  12240. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12241. }
  12242. });
  12243. exports.request = request;
  12244. //# sourceMappingURL=index.js.map
  12245. /***/ }),
  12246. /***/ 761:
  12247. /***/ (function(module) {
  12248. module.exports = require("zlib");
  12249. /***/ }),
  12250. /***/ 763:
  12251. /***/ (function(module) {
  12252. module.exports = removeHook
  12253. function removeHook (state, name, method) {
  12254. if (!state.registry[name]) {
  12255. return
  12256. }
  12257. var index = state.registry[name]
  12258. .map(function (registered) { return registered.orig })
  12259. .indexOf(method)
  12260. if (index === -1) {
  12261. return
  12262. }
  12263. state.registry[name].splice(index, 1)
  12264. }
  12265. /***/ }),
  12266. /***/ 768:
  12267. /***/ (function(module) {
  12268. "use strict";
  12269. module.exports = function (x) {
  12270. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12271. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12272. if (x[x.length - 1] === lf) {
  12273. x = x.slice(0, x.length - 1);
  12274. }
  12275. if (x[x.length - 1] === cr) {
  12276. x = x.slice(0, x.length - 1);
  12277. }
  12278. return x;
  12279. };
  12280. /***/ }),
  12281. /***/ 777:
  12282. /***/ (function(module, __unusedexports, __webpack_require__) {
  12283. module.exports = getFirstPage
  12284. const getPage = __webpack_require__(265)
  12285. function getFirstPage (octokit, link, headers) {
  12286. return getPage(octokit, link, 'first', headers)
  12287. }
  12288. /***/ }),
  12289. /***/ 796:
  12290. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12291. "use strict";
  12292. Object.defineProperty(exports, '__esModule', { value: true });
  12293. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12294. var osName = _interopDefault(__webpack_require__(2));
  12295. function getUserAgent() {
  12296. try {
  12297. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12298. } catch (error) {
  12299. if (/wmic os get Caption/.test(error.message)) {
  12300. return "Windows <version undetectable>";
  12301. }
  12302. throw error;
  12303. }
  12304. }
  12305. exports.getUserAgent = getUserAgent;
  12306. //# sourceMappingURL=index.js.map
  12307. /***/ }),
  12308. /***/ 813:
  12309. /***/ (function(__unusedmodule, exports) {
  12310. "use strict";
  12311. Object.defineProperty(exports, '__esModule', { value: true });
  12312. async function auth(token) {
  12313. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12314. return {
  12315. type: "token",
  12316. token: token,
  12317. tokenType
  12318. };
  12319. }
  12320. /**
  12321. * Prefix token for usage in the Authorization header
  12322. *
  12323. * @param token OAuth token or JSON Web Token
  12324. */
  12325. function withAuthorizationPrefix(token) {
  12326. if (token.split(/\./).length === 3) {
  12327. return `bearer ${token}`;
  12328. }
  12329. return `token ${token}`;
  12330. }
  12331. async function hook(token, request, route, parameters) {
  12332. const endpoint = request.endpoint.merge(route, parameters);
  12333. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12334. return request(endpoint);
  12335. }
  12336. const createTokenAuth = function createTokenAuth(token) {
  12337. if (!token) {
  12338. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12339. }
  12340. if (typeof token !== "string") {
  12341. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12342. }
  12343. token = token.replace(/^(token|bearer) +/i, "");
  12344. return Object.assign(auth.bind(null, token), {
  12345. hook: hook.bind(null, token)
  12346. });
  12347. };
  12348. exports.createTokenAuth = createTokenAuth;
  12349. //# sourceMappingURL=index.js.map
  12350. /***/ }),
  12351. /***/ 814:
  12352. /***/ (function(module, __unusedexports, __webpack_require__) {
  12353. module.exports = which
  12354. which.sync = whichSync
  12355. var isWindows = process.platform === 'win32' ||
  12356. process.env.OSTYPE === 'cygwin' ||
  12357. process.env.OSTYPE === 'msys'
  12358. var path = __webpack_require__(622)
  12359. var COLON = isWindows ? ';' : ':'
  12360. var isexe = __webpack_require__(742)
  12361. function getNotFoundError (cmd) {
  12362. var er = new Error('not found: ' + cmd)
  12363. er.code = 'ENOENT'
  12364. return er
  12365. }
  12366. function getPathInfo (cmd, opt) {
  12367. var colon = opt.colon || COLON
  12368. var pathEnv = opt.path || process.env.PATH || ''
  12369. var pathExt = ['']
  12370. pathEnv = pathEnv.split(colon)
  12371. var pathExtExe = ''
  12372. if (isWindows) {
  12373. pathEnv.unshift(process.cwd())
  12374. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12375. pathExt = pathExtExe.split(colon)
  12376. // Always test the cmd itself first. isexe will check to make sure
  12377. // it's found in the pathExt set.
  12378. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12379. pathExt.unshift('')
  12380. }
  12381. // If it has a slash, then we don't bother searching the pathenv.
  12382. // just check the file itself, and that's it.
  12383. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12384. pathEnv = ['']
  12385. return {
  12386. env: pathEnv,
  12387. ext: pathExt,
  12388. extExe: pathExtExe
  12389. }
  12390. }
  12391. function which (cmd, opt, cb) {
  12392. if (typeof opt === 'function') {
  12393. cb = opt
  12394. opt = {}
  12395. }
  12396. var info = getPathInfo(cmd, opt)
  12397. var pathEnv = info.env
  12398. var pathExt = info.ext
  12399. var pathExtExe = info.extExe
  12400. var found = []
  12401. ;(function F (i, l) {
  12402. if (i === l) {
  12403. if (opt.all && found.length)
  12404. return cb(null, found)
  12405. else
  12406. return cb(getNotFoundError(cmd))
  12407. }
  12408. var pathPart = pathEnv[i]
  12409. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12410. pathPart = pathPart.slice(1, -1)
  12411. var p = path.join(pathPart, cmd)
  12412. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12413. p = cmd.slice(0, 2) + p
  12414. }
  12415. ;(function E (ii, ll) {
  12416. if (ii === ll) return F(i + 1, l)
  12417. var ext = pathExt[ii]
  12418. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12419. if (!er && is) {
  12420. if (opt.all)
  12421. found.push(p + ext)
  12422. else
  12423. return cb(null, p + ext)
  12424. }
  12425. return E(ii + 1, ll)
  12426. })
  12427. })(0, pathExt.length)
  12428. })(0, pathEnv.length)
  12429. }
  12430. function whichSync (cmd, opt) {
  12431. opt = opt || {}
  12432. var info = getPathInfo(cmd, opt)
  12433. var pathEnv = info.env
  12434. var pathExt = info.ext
  12435. var pathExtExe = info.extExe
  12436. var found = []
  12437. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12438. var pathPart = pathEnv[i]
  12439. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12440. pathPart = pathPart.slice(1, -1)
  12441. var p = path.join(pathPart, cmd)
  12442. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12443. p = cmd.slice(0, 2) + p
  12444. }
  12445. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12446. var cur = p + pathExt[j]
  12447. var is
  12448. try {
  12449. is = isexe.sync(cur, { pathExt: pathExtExe })
  12450. if (is) {
  12451. if (opt.all)
  12452. found.push(cur)
  12453. else
  12454. return cur
  12455. }
  12456. } catch (ex) {}
  12457. }
  12458. }
  12459. if (opt.all && found.length)
  12460. return found
  12461. if (opt.nothrow)
  12462. return null
  12463. throw getNotFoundError(cmd)
  12464. }
  12465. /***/ }),
  12466. /***/ 816:
  12467. /***/ (function(module) {
  12468. "use strict";
  12469. module.exports = /^#!.*/;
  12470. /***/ }),
  12471. /***/ 818:
  12472. /***/ (function(module, __unusedexports, __webpack_require__) {
  12473. module.exports = isexe
  12474. isexe.sync = sync
  12475. var fs = __webpack_require__(747)
  12476. function checkPathExt (path, options) {
  12477. var pathext = options.pathExt !== undefined ?
  12478. options.pathExt : process.env.PATHEXT
  12479. if (!pathext) {
  12480. return true
  12481. }
  12482. pathext = pathext.split(';')
  12483. if (pathext.indexOf('') !== -1) {
  12484. return true
  12485. }
  12486. for (var i = 0; i < pathext.length; i++) {
  12487. var p = pathext[i].toLowerCase()
  12488. if (p && path.substr(-p.length).toLowerCase() === p) {
  12489. return true
  12490. }
  12491. }
  12492. return false
  12493. }
  12494. function checkStat (stat, path, options) {
  12495. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12496. return false
  12497. }
  12498. return checkPathExt(path, options)
  12499. }
  12500. function isexe (path, options, cb) {
  12501. fs.stat(path, function (er, stat) {
  12502. cb(er, er ? false : checkStat(stat, path, options))
  12503. })
  12504. }
  12505. function sync (path, options) {
  12506. return checkStat(fs.statSync(path), path, options)
  12507. }
  12508. /***/ }),
  12509. /***/ 821:
  12510. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12511. "use strict";
  12512. var __importStar = (this && this.__importStar) || function (mod) {
  12513. if (mod && mod.__esModule) return mod;
  12514. var result = {};
  12515. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12516. result["default"] = mod;
  12517. return result;
  12518. };
  12519. Object.defineProperty(exports, "__esModule", { value: true });
  12520. const core = __importStar(__webpack_require__(470));
  12521. const fsHelper = __importStar(__webpack_require__(618));
  12522. const github = __importStar(__webpack_require__(469));
  12523. const path = __importStar(__webpack_require__(622));
  12524. function getInputs() {
  12525. const result = {};
  12526. // GitHub workspace
  12527. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12528. if (!githubWorkspacePath) {
  12529. throw new Error('GITHUB_WORKSPACE not defined');
  12530. }
  12531. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12532. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12533. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12534. // Qualified repository
  12535. const qualifiedRepository = core.getInput('repository') ||
  12536. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12537. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12538. const splitRepository = qualifiedRepository.split('/');
  12539. if (splitRepository.length !== 2 ||
  12540. !splitRepository[0] ||
  12541. !splitRepository[1]) {
  12542. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12543. }
  12544. result.repositoryOwner = splitRepository[0];
  12545. result.repositoryName = splitRepository[1];
  12546. // Repository path
  12547. result.repositoryPath = core.getInput('path') || '.';
  12548. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12549. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12550. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12551. }
  12552. // Workflow repository?
  12553. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12554. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12555. // Source branch, source version
  12556. result.ref = core.getInput('ref');
  12557. if (!result.ref) {
  12558. if (isWorkflowRepository) {
  12559. result.ref = github.context.ref;
  12560. result.commit = github.context.sha;
  12561. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12562. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12563. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12564. result.ref = `refs/heads/${result.ref}`;
  12565. }
  12566. }
  12567. if (!result.ref && !result.commit) {
  12568. result.ref = 'refs/heads/master';
  12569. }
  12570. }
  12571. // SHA?
  12572. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12573. result.commit = result.ref;
  12574. result.ref = '';
  12575. }
  12576. core.debug(`ref = '${result.ref}'`);
  12577. core.debug(`commit = '${result.commit}'`);
  12578. // Clean
  12579. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12580. core.debug(`clean = ${result.clean}`);
  12581. // Fetch depth
  12582. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12583. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12584. result.fetchDepth = 0;
  12585. }
  12586. core.debug(`fetch depth = ${result.fetchDepth}`);
  12587. // LFS
  12588. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12589. core.debug(`lfs = ${result.lfs}`);
  12590. // Submodules
  12591. result.submodules = false;
  12592. result.nestedSubmodules = false;
  12593. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12594. if (submodulesString == 'RECURSIVE') {
  12595. result.submodules = true;
  12596. result.nestedSubmodules = true;
  12597. }
  12598. else if (submodulesString == 'TRUE') {
  12599. result.submodules = true;
  12600. }
  12601. core.debug(`submodules = ${result.submodules}`);
  12602. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12603. // Auth token
  12604. result.authToken = core.getInput('token');
  12605. // SSH
  12606. result.sshKey = core.getInput('ssh-key');
  12607. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12608. result.sshStrict =
  12609. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12610. // Persist credentials
  12611. result.persistCredentials =
  12612. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12613. return result;
  12614. }
  12615. exports.getInputs = getInputs;
  12616. /***/ }),
  12617. /***/ 826:
  12618. /***/ (function(module, __unusedexports, __webpack_require__) {
  12619. var rng = __webpack_require__(139);
  12620. var bytesToUuid = __webpack_require__(722);
  12621. function v4(options, buf, offset) {
  12622. var i = buf && offset || 0;
  12623. if (typeof(options) == 'string') {
  12624. buf = options === 'binary' ? new Array(16) : null;
  12625. options = null;
  12626. }
  12627. options = options || {};
  12628. var rnds = options.random || (options.rng || rng)();
  12629. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12630. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12631. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12632. // Copy bytes to buffer, if provided
  12633. if (buf) {
  12634. for (var ii = 0; ii < 16; ++ii) {
  12635. buf[i + ii] = rnds[ii];
  12636. }
  12637. }
  12638. return buf || bytesToUuid(rnds);
  12639. }
  12640. module.exports = v4;
  12641. /***/ }),
  12642. /***/ 835:
  12643. /***/ (function(module) {
  12644. module.exports = require("url");
  12645. /***/ }),
  12646. /***/ 842:
  12647. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12648. "use strict";
  12649. Object.defineProperty(exports, '__esModule', { value: true });
  12650. var deprecation = __webpack_require__(692);
  12651. var endpointsByScope = {
  12652. actions: {
  12653. cancelWorkflowRun: {
  12654. method: "POST",
  12655. params: {
  12656. owner: {
  12657. required: true,
  12658. type: "string"
  12659. },
  12660. repo: {
  12661. required: true,
  12662. type: "string"
  12663. },
  12664. run_id: {
  12665. required: true,
  12666. type: "integer"
  12667. }
  12668. },
  12669. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12670. },
  12671. createOrUpdateSecretForRepo: {
  12672. method: "PUT",
  12673. params: {
  12674. encrypted_value: {
  12675. type: "string"
  12676. },
  12677. key_id: {
  12678. type: "string"
  12679. },
  12680. name: {
  12681. required: true,
  12682. type: "string"
  12683. },
  12684. owner: {
  12685. required: true,
  12686. type: "string"
  12687. },
  12688. repo: {
  12689. required: true,
  12690. type: "string"
  12691. }
  12692. },
  12693. url: "/repos/:owner/:repo/actions/secrets/:name"
  12694. },
  12695. createRegistrationToken: {
  12696. method: "POST",
  12697. params: {
  12698. owner: {
  12699. required: true,
  12700. type: "string"
  12701. },
  12702. repo: {
  12703. required: true,
  12704. type: "string"
  12705. }
  12706. },
  12707. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12708. },
  12709. createRemoveToken: {
  12710. method: "POST",
  12711. params: {
  12712. owner: {
  12713. required: true,
  12714. type: "string"
  12715. },
  12716. repo: {
  12717. required: true,
  12718. type: "string"
  12719. }
  12720. },
  12721. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12722. },
  12723. deleteArtifact: {
  12724. method: "DELETE",
  12725. params: {
  12726. artifact_id: {
  12727. required: true,
  12728. type: "integer"
  12729. },
  12730. owner: {
  12731. required: true,
  12732. type: "string"
  12733. },
  12734. repo: {
  12735. required: true,
  12736. type: "string"
  12737. }
  12738. },
  12739. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12740. },
  12741. deleteSecretFromRepo: {
  12742. method: "DELETE",
  12743. params: {
  12744. name: {
  12745. required: true,
  12746. type: "string"
  12747. },
  12748. owner: {
  12749. required: true,
  12750. type: "string"
  12751. },
  12752. repo: {
  12753. required: true,
  12754. type: "string"
  12755. }
  12756. },
  12757. url: "/repos/:owner/:repo/actions/secrets/:name"
  12758. },
  12759. downloadArtifact: {
  12760. method: "GET",
  12761. params: {
  12762. archive_format: {
  12763. required: true,
  12764. type: "string"
  12765. },
  12766. artifact_id: {
  12767. required: true,
  12768. type: "integer"
  12769. },
  12770. owner: {
  12771. required: true,
  12772. type: "string"
  12773. },
  12774. repo: {
  12775. required: true,
  12776. type: "string"
  12777. }
  12778. },
  12779. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12780. },
  12781. getArtifact: {
  12782. method: "GET",
  12783. params: {
  12784. artifact_id: {
  12785. required: true,
  12786. type: "integer"
  12787. },
  12788. owner: {
  12789. required: true,
  12790. type: "string"
  12791. },
  12792. repo: {
  12793. required: true,
  12794. type: "string"
  12795. }
  12796. },
  12797. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12798. },
  12799. getPublicKey: {
  12800. method: "GET",
  12801. params: {
  12802. owner: {
  12803. required: true,
  12804. type: "string"
  12805. },
  12806. repo: {
  12807. required: true,
  12808. type: "string"
  12809. }
  12810. },
  12811. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12812. },
  12813. getSecret: {
  12814. method: "GET",
  12815. params: {
  12816. name: {
  12817. required: true,
  12818. type: "string"
  12819. },
  12820. owner: {
  12821. required: true,
  12822. type: "string"
  12823. },
  12824. page: {
  12825. type: "integer"
  12826. },
  12827. per_page: {
  12828. type: "integer"
  12829. },
  12830. repo: {
  12831. required: true,
  12832. type: "string"
  12833. }
  12834. },
  12835. url: "/repos/:owner/:repo/actions/secrets/:name"
  12836. },
  12837. getSelfHostedRunner: {
  12838. method: "GET",
  12839. params: {
  12840. owner: {
  12841. required: true,
  12842. type: "string"
  12843. },
  12844. repo: {
  12845. required: true,
  12846. type: "string"
  12847. },
  12848. runner_id: {
  12849. required: true,
  12850. type: "integer"
  12851. }
  12852. },
  12853. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12854. },
  12855. getWorkflow: {
  12856. method: "GET",
  12857. params: {
  12858. owner: {
  12859. required: true,
  12860. type: "string"
  12861. },
  12862. repo: {
  12863. required: true,
  12864. type: "string"
  12865. },
  12866. workflow_id: {
  12867. required: true,
  12868. type: "integer"
  12869. }
  12870. },
  12871. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12872. },
  12873. getWorkflowJob: {
  12874. method: "GET",
  12875. params: {
  12876. job_id: {
  12877. required: true,
  12878. type: "integer"
  12879. },
  12880. owner: {
  12881. required: true,
  12882. type: "string"
  12883. },
  12884. repo: {
  12885. required: true,
  12886. type: "string"
  12887. }
  12888. },
  12889. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12890. },
  12891. getWorkflowRun: {
  12892. method: "GET",
  12893. params: {
  12894. owner: {
  12895. required: true,
  12896. type: "string"
  12897. },
  12898. repo: {
  12899. required: true,
  12900. type: "string"
  12901. },
  12902. run_id: {
  12903. required: true,
  12904. type: "integer"
  12905. }
  12906. },
  12907. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12908. },
  12909. listDownloadsForSelfHostedRunnerApplication: {
  12910. method: "GET",
  12911. params: {
  12912. owner: {
  12913. required: true,
  12914. type: "string"
  12915. },
  12916. repo: {
  12917. required: true,
  12918. type: "string"
  12919. }
  12920. },
  12921. url: "/repos/:owner/:repo/actions/runners/downloads"
  12922. },
  12923. listJobsForWorkflowRun: {
  12924. method: "GET",
  12925. params: {
  12926. owner: {
  12927. required: true,
  12928. type: "string"
  12929. },
  12930. page: {
  12931. type: "integer"
  12932. },
  12933. per_page: {
  12934. type: "integer"
  12935. },
  12936. repo: {
  12937. required: true,
  12938. type: "string"
  12939. },
  12940. run_id: {
  12941. required: true,
  12942. type: "integer"
  12943. }
  12944. },
  12945. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  12946. },
  12947. listRepoWorkflowRuns: {
  12948. method: "GET",
  12949. params: {
  12950. actor: {
  12951. type: "string"
  12952. },
  12953. branch: {
  12954. type: "string"
  12955. },
  12956. event: {
  12957. type: "string"
  12958. },
  12959. owner: {
  12960. required: true,
  12961. type: "string"
  12962. },
  12963. page: {
  12964. type: "integer"
  12965. },
  12966. per_page: {
  12967. type: "integer"
  12968. },
  12969. repo: {
  12970. required: true,
  12971. type: "string"
  12972. },
  12973. status: {
  12974. enum: ["completed", "status", "conclusion"],
  12975. type: "string"
  12976. }
  12977. },
  12978. url: "/repos/:owner/:repo/actions/runs"
  12979. },
  12980. listRepoWorkflows: {
  12981. method: "GET",
  12982. params: {
  12983. owner: {
  12984. required: true,
  12985. type: "string"
  12986. },
  12987. page: {
  12988. type: "integer"
  12989. },
  12990. per_page: {
  12991. type: "integer"
  12992. },
  12993. repo: {
  12994. required: true,
  12995. type: "string"
  12996. }
  12997. },
  12998. url: "/repos/:owner/:repo/actions/workflows"
  12999. },
  13000. listSecretsForRepo: {
  13001. method: "GET",
  13002. params: {
  13003. owner: {
  13004. required: true,
  13005. type: "string"
  13006. },
  13007. page: {
  13008. type: "integer"
  13009. },
  13010. per_page: {
  13011. type: "integer"
  13012. },
  13013. repo: {
  13014. required: true,
  13015. type: "string"
  13016. }
  13017. },
  13018. url: "/repos/:owner/:repo/actions/secrets"
  13019. },
  13020. listSelfHostedRunnersForRepo: {
  13021. method: "GET",
  13022. params: {
  13023. owner: {
  13024. required: true,
  13025. type: "string"
  13026. },
  13027. page: {
  13028. type: "integer"
  13029. },
  13030. per_page: {
  13031. type: "integer"
  13032. },
  13033. repo: {
  13034. required: true,
  13035. type: "string"
  13036. }
  13037. },
  13038. url: "/repos/:owner/:repo/actions/runners"
  13039. },
  13040. listWorkflowJobLogs: {
  13041. method: "GET",
  13042. params: {
  13043. job_id: {
  13044. required: true,
  13045. type: "integer"
  13046. },
  13047. owner: {
  13048. required: true,
  13049. type: "string"
  13050. },
  13051. page: {
  13052. type: "integer"
  13053. },
  13054. per_page: {
  13055. type: "integer"
  13056. },
  13057. repo: {
  13058. required: true,
  13059. type: "string"
  13060. }
  13061. },
  13062. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13063. },
  13064. listWorkflowRunArtifacts: {
  13065. method: "GET",
  13066. params: {
  13067. owner: {
  13068. required: true,
  13069. type: "string"
  13070. },
  13071. page: {
  13072. type: "integer"
  13073. },
  13074. per_page: {
  13075. type: "integer"
  13076. },
  13077. repo: {
  13078. required: true,
  13079. type: "string"
  13080. },
  13081. run_id: {
  13082. required: true,
  13083. type: "integer"
  13084. }
  13085. },
  13086. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13087. },
  13088. listWorkflowRunLogs: {
  13089. method: "GET",
  13090. params: {
  13091. owner: {
  13092. required: true,
  13093. type: "string"
  13094. },
  13095. page: {
  13096. type: "integer"
  13097. },
  13098. per_page: {
  13099. type: "integer"
  13100. },
  13101. repo: {
  13102. required: true,
  13103. type: "string"
  13104. },
  13105. run_id: {
  13106. required: true,
  13107. type: "integer"
  13108. }
  13109. },
  13110. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13111. },
  13112. listWorkflowRuns: {
  13113. method: "GET",
  13114. params: {
  13115. actor: {
  13116. type: "string"
  13117. },
  13118. branch: {
  13119. type: "string"
  13120. },
  13121. event: {
  13122. type: "string"
  13123. },
  13124. owner: {
  13125. required: true,
  13126. type: "string"
  13127. },
  13128. page: {
  13129. type: "integer"
  13130. },
  13131. per_page: {
  13132. type: "integer"
  13133. },
  13134. repo: {
  13135. required: true,
  13136. type: "string"
  13137. },
  13138. status: {
  13139. enum: ["completed", "status", "conclusion"],
  13140. type: "string"
  13141. },
  13142. workflow_id: {
  13143. required: true,
  13144. type: "integer"
  13145. }
  13146. },
  13147. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13148. },
  13149. reRunWorkflow: {
  13150. method: "POST",
  13151. params: {
  13152. owner: {
  13153. required: true,
  13154. type: "string"
  13155. },
  13156. repo: {
  13157. required: true,
  13158. type: "string"
  13159. },
  13160. run_id: {
  13161. required: true,
  13162. type: "integer"
  13163. }
  13164. },
  13165. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13166. },
  13167. removeSelfHostedRunner: {
  13168. method: "DELETE",
  13169. params: {
  13170. owner: {
  13171. required: true,
  13172. type: "string"
  13173. },
  13174. repo: {
  13175. required: true,
  13176. type: "string"
  13177. },
  13178. runner_id: {
  13179. required: true,
  13180. type: "integer"
  13181. }
  13182. },
  13183. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13184. }
  13185. },
  13186. activity: {
  13187. checkStarringRepo: {
  13188. method: "GET",
  13189. params: {
  13190. owner: {
  13191. required: true,
  13192. type: "string"
  13193. },
  13194. repo: {
  13195. required: true,
  13196. type: "string"
  13197. }
  13198. },
  13199. url: "/user/starred/:owner/:repo"
  13200. },
  13201. deleteRepoSubscription: {
  13202. method: "DELETE",
  13203. params: {
  13204. owner: {
  13205. required: true,
  13206. type: "string"
  13207. },
  13208. repo: {
  13209. required: true,
  13210. type: "string"
  13211. }
  13212. },
  13213. url: "/repos/:owner/:repo/subscription"
  13214. },
  13215. deleteThreadSubscription: {
  13216. method: "DELETE",
  13217. params: {
  13218. thread_id: {
  13219. required: true,
  13220. type: "integer"
  13221. }
  13222. },
  13223. url: "/notifications/threads/:thread_id/subscription"
  13224. },
  13225. getRepoSubscription: {
  13226. method: "GET",
  13227. params: {
  13228. owner: {
  13229. required: true,
  13230. type: "string"
  13231. },
  13232. repo: {
  13233. required: true,
  13234. type: "string"
  13235. }
  13236. },
  13237. url: "/repos/:owner/:repo/subscription"
  13238. },
  13239. getThread: {
  13240. method: "GET",
  13241. params: {
  13242. thread_id: {
  13243. required: true,
  13244. type: "integer"
  13245. }
  13246. },
  13247. url: "/notifications/threads/:thread_id"
  13248. },
  13249. getThreadSubscription: {
  13250. method: "GET",
  13251. params: {
  13252. thread_id: {
  13253. required: true,
  13254. type: "integer"
  13255. }
  13256. },
  13257. url: "/notifications/threads/:thread_id/subscription"
  13258. },
  13259. listEventsForOrg: {
  13260. method: "GET",
  13261. params: {
  13262. org: {
  13263. required: true,
  13264. type: "string"
  13265. },
  13266. page: {
  13267. type: "integer"
  13268. },
  13269. per_page: {
  13270. type: "integer"
  13271. },
  13272. username: {
  13273. required: true,
  13274. type: "string"
  13275. }
  13276. },
  13277. url: "/users/:username/events/orgs/:org"
  13278. },
  13279. listEventsForUser: {
  13280. method: "GET",
  13281. params: {
  13282. page: {
  13283. type: "integer"
  13284. },
  13285. per_page: {
  13286. type: "integer"
  13287. },
  13288. username: {
  13289. required: true,
  13290. type: "string"
  13291. }
  13292. },
  13293. url: "/users/:username/events"
  13294. },
  13295. listFeeds: {
  13296. method: "GET",
  13297. params: {},
  13298. url: "/feeds"
  13299. },
  13300. listNotifications: {
  13301. method: "GET",
  13302. params: {
  13303. all: {
  13304. type: "boolean"
  13305. },
  13306. before: {
  13307. type: "string"
  13308. },
  13309. page: {
  13310. type: "integer"
  13311. },
  13312. participating: {
  13313. type: "boolean"
  13314. },
  13315. per_page: {
  13316. type: "integer"
  13317. },
  13318. since: {
  13319. type: "string"
  13320. }
  13321. },
  13322. url: "/notifications"
  13323. },
  13324. listNotificationsForRepo: {
  13325. method: "GET",
  13326. params: {
  13327. all: {
  13328. type: "boolean"
  13329. },
  13330. before: {
  13331. type: "string"
  13332. },
  13333. owner: {
  13334. required: true,
  13335. type: "string"
  13336. },
  13337. page: {
  13338. type: "integer"
  13339. },
  13340. participating: {
  13341. type: "boolean"
  13342. },
  13343. per_page: {
  13344. type: "integer"
  13345. },
  13346. repo: {
  13347. required: true,
  13348. type: "string"
  13349. },
  13350. since: {
  13351. type: "string"
  13352. }
  13353. },
  13354. url: "/repos/:owner/:repo/notifications"
  13355. },
  13356. listPublicEvents: {
  13357. method: "GET",
  13358. params: {
  13359. page: {
  13360. type: "integer"
  13361. },
  13362. per_page: {
  13363. type: "integer"
  13364. }
  13365. },
  13366. url: "/events"
  13367. },
  13368. listPublicEventsForOrg: {
  13369. method: "GET",
  13370. params: {
  13371. org: {
  13372. required: true,
  13373. type: "string"
  13374. },
  13375. page: {
  13376. type: "integer"
  13377. },
  13378. per_page: {
  13379. type: "integer"
  13380. }
  13381. },
  13382. url: "/orgs/:org/events"
  13383. },
  13384. listPublicEventsForRepoNetwork: {
  13385. method: "GET",
  13386. params: {
  13387. owner: {
  13388. required: true,
  13389. type: "string"
  13390. },
  13391. page: {
  13392. type: "integer"
  13393. },
  13394. per_page: {
  13395. type: "integer"
  13396. },
  13397. repo: {
  13398. required: true,
  13399. type: "string"
  13400. }
  13401. },
  13402. url: "/networks/:owner/:repo/events"
  13403. },
  13404. listPublicEventsForUser: {
  13405. method: "GET",
  13406. params: {
  13407. page: {
  13408. type: "integer"
  13409. },
  13410. per_page: {
  13411. type: "integer"
  13412. },
  13413. username: {
  13414. required: true,
  13415. type: "string"
  13416. }
  13417. },
  13418. url: "/users/:username/events/public"
  13419. },
  13420. listReceivedEventsForUser: {
  13421. method: "GET",
  13422. params: {
  13423. page: {
  13424. type: "integer"
  13425. },
  13426. per_page: {
  13427. type: "integer"
  13428. },
  13429. username: {
  13430. required: true,
  13431. type: "string"
  13432. }
  13433. },
  13434. url: "/users/:username/received_events"
  13435. },
  13436. listReceivedPublicEventsForUser: {
  13437. method: "GET",
  13438. params: {
  13439. page: {
  13440. type: "integer"
  13441. },
  13442. per_page: {
  13443. type: "integer"
  13444. },
  13445. username: {
  13446. required: true,
  13447. type: "string"
  13448. }
  13449. },
  13450. url: "/users/:username/received_events/public"
  13451. },
  13452. listRepoEvents: {
  13453. method: "GET",
  13454. params: {
  13455. owner: {
  13456. required: true,
  13457. type: "string"
  13458. },
  13459. page: {
  13460. type: "integer"
  13461. },
  13462. per_page: {
  13463. type: "integer"
  13464. },
  13465. repo: {
  13466. required: true,
  13467. type: "string"
  13468. }
  13469. },
  13470. url: "/repos/:owner/:repo/events"
  13471. },
  13472. listReposStarredByAuthenticatedUser: {
  13473. method: "GET",
  13474. params: {
  13475. direction: {
  13476. enum: ["asc", "desc"],
  13477. type: "string"
  13478. },
  13479. page: {
  13480. type: "integer"
  13481. },
  13482. per_page: {
  13483. type: "integer"
  13484. },
  13485. sort: {
  13486. enum: ["created", "updated"],
  13487. type: "string"
  13488. }
  13489. },
  13490. url: "/user/starred"
  13491. },
  13492. listReposStarredByUser: {
  13493. method: "GET",
  13494. params: {
  13495. direction: {
  13496. enum: ["asc", "desc"],
  13497. type: "string"
  13498. },
  13499. page: {
  13500. type: "integer"
  13501. },
  13502. per_page: {
  13503. type: "integer"
  13504. },
  13505. sort: {
  13506. enum: ["created", "updated"],
  13507. type: "string"
  13508. },
  13509. username: {
  13510. required: true,
  13511. type: "string"
  13512. }
  13513. },
  13514. url: "/users/:username/starred"
  13515. },
  13516. listReposWatchedByUser: {
  13517. method: "GET",
  13518. params: {
  13519. page: {
  13520. type: "integer"
  13521. },
  13522. per_page: {
  13523. type: "integer"
  13524. },
  13525. username: {
  13526. required: true,
  13527. type: "string"
  13528. }
  13529. },
  13530. url: "/users/:username/subscriptions"
  13531. },
  13532. listStargazersForRepo: {
  13533. method: "GET",
  13534. params: {
  13535. owner: {
  13536. required: true,
  13537. type: "string"
  13538. },
  13539. page: {
  13540. type: "integer"
  13541. },
  13542. per_page: {
  13543. type: "integer"
  13544. },
  13545. repo: {
  13546. required: true,
  13547. type: "string"
  13548. }
  13549. },
  13550. url: "/repos/:owner/:repo/stargazers"
  13551. },
  13552. listWatchedReposForAuthenticatedUser: {
  13553. method: "GET",
  13554. params: {
  13555. page: {
  13556. type: "integer"
  13557. },
  13558. per_page: {
  13559. type: "integer"
  13560. }
  13561. },
  13562. url: "/user/subscriptions"
  13563. },
  13564. listWatchersForRepo: {
  13565. method: "GET",
  13566. params: {
  13567. owner: {
  13568. required: true,
  13569. type: "string"
  13570. },
  13571. page: {
  13572. type: "integer"
  13573. },
  13574. per_page: {
  13575. type: "integer"
  13576. },
  13577. repo: {
  13578. required: true,
  13579. type: "string"
  13580. }
  13581. },
  13582. url: "/repos/:owner/:repo/subscribers"
  13583. },
  13584. markAsRead: {
  13585. method: "PUT",
  13586. params: {
  13587. last_read_at: {
  13588. type: "string"
  13589. }
  13590. },
  13591. url: "/notifications"
  13592. },
  13593. markNotificationsAsReadForRepo: {
  13594. method: "PUT",
  13595. params: {
  13596. last_read_at: {
  13597. type: "string"
  13598. },
  13599. owner: {
  13600. required: true,
  13601. type: "string"
  13602. },
  13603. repo: {
  13604. required: true,
  13605. type: "string"
  13606. }
  13607. },
  13608. url: "/repos/:owner/:repo/notifications"
  13609. },
  13610. markThreadAsRead: {
  13611. method: "PATCH",
  13612. params: {
  13613. thread_id: {
  13614. required: true,
  13615. type: "integer"
  13616. }
  13617. },
  13618. url: "/notifications/threads/:thread_id"
  13619. },
  13620. setRepoSubscription: {
  13621. method: "PUT",
  13622. params: {
  13623. ignored: {
  13624. type: "boolean"
  13625. },
  13626. owner: {
  13627. required: true,
  13628. type: "string"
  13629. },
  13630. repo: {
  13631. required: true,
  13632. type: "string"
  13633. },
  13634. subscribed: {
  13635. type: "boolean"
  13636. }
  13637. },
  13638. url: "/repos/:owner/:repo/subscription"
  13639. },
  13640. setThreadSubscription: {
  13641. method: "PUT",
  13642. params: {
  13643. ignored: {
  13644. type: "boolean"
  13645. },
  13646. thread_id: {
  13647. required: true,
  13648. type: "integer"
  13649. }
  13650. },
  13651. url: "/notifications/threads/:thread_id/subscription"
  13652. },
  13653. starRepo: {
  13654. method: "PUT",
  13655. params: {
  13656. owner: {
  13657. required: true,
  13658. type: "string"
  13659. },
  13660. repo: {
  13661. required: true,
  13662. type: "string"
  13663. }
  13664. },
  13665. url: "/user/starred/:owner/:repo"
  13666. },
  13667. unstarRepo: {
  13668. method: "DELETE",
  13669. params: {
  13670. owner: {
  13671. required: true,
  13672. type: "string"
  13673. },
  13674. repo: {
  13675. required: true,
  13676. type: "string"
  13677. }
  13678. },
  13679. url: "/user/starred/:owner/:repo"
  13680. }
  13681. },
  13682. apps: {
  13683. addRepoToInstallation: {
  13684. headers: {
  13685. accept: "application/vnd.github.machine-man-preview+json"
  13686. },
  13687. method: "PUT",
  13688. params: {
  13689. installation_id: {
  13690. required: true,
  13691. type: "integer"
  13692. },
  13693. repository_id: {
  13694. required: true,
  13695. type: "integer"
  13696. }
  13697. },
  13698. url: "/user/installations/:installation_id/repositories/:repository_id"
  13699. },
  13700. checkAccountIsAssociatedWithAny: {
  13701. method: "GET",
  13702. params: {
  13703. account_id: {
  13704. required: true,
  13705. type: "integer"
  13706. }
  13707. },
  13708. url: "/marketplace_listing/accounts/:account_id"
  13709. },
  13710. checkAccountIsAssociatedWithAnyStubbed: {
  13711. method: "GET",
  13712. params: {
  13713. account_id: {
  13714. required: true,
  13715. type: "integer"
  13716. }
  13717. },
  13718. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13719. },
  13720. checkAuthorization: {
  13721. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13722. method: "GET",
  13723. params: {
  13724. access_token: {
  13725. required: true,
  13726. type: "string"
  13727. },
  13728. client_id: {
  13729. required: true,
  13730. type: "string"
  13731. }
  13732. },
  13733. url: "/applications/:client_id/tokens/:access_token"
  13734. },
  13735. checkToken: {
  13736. headers: {
  13737. accept: "application/vnd.github.doctor-strange-preview+json"
  13738. },
  13739. method: "POST",
  13740. params: {
  13741. access_token: {
  13742. type: "string"
  13743. },
  13744. client_id: {
  13745. required: true,
  13746. type: "string"
  13747. }
  13748. },
  13749. url: "/applications/:client_id/token"
  13750. },
  13751. createContentAttachment: {
  13752. headers: {
  13753. accept: "application/vnd.github.corsair-preview+json"
  13754. },
  13755. method: "POST",
  13756. params: {
  13757. body: {
  13758. required: true,
  13759. type: "string"
  13760. },
  13761. content_reference_id: {
  13762. required: true,
  13763. type: "integer"
  13764. },
  13765. title: {
  13766. required: true,
  13767. type: "string"
  13768. }
  13769. },
  13770. url: "/content_references/:content_reference_id/attachments"
  13771. },
  13772. createFromManifest: {
  13773. headers: {
  13774. accept: "application/vnd.github.fury-preview+json"
  13775. },
  13776. method: "POST",
  13777. params: {
  13778. code: {
  13779. required: true,
  13780. type: "string"
  13781. }
  13782. },
  13783. url: "/app-manifests/:code/conversions"
  13784. },
  13785. createInstallationToken: {
  13786. headers: {
  13787. accept: "application/vnd.github.machine-man-preview+json"
  13788. },
  13789. method: "POST",
  13790. params: {
  13791. installation_id: {
  13792. required: true,
  13793. type: "integer"
  13794. },
  13795. permissions: {
  13796. type: "object"
  13797. },
  13798. repository_ids: {
  13799. type: "integer[]"
  13800. }
  13801. },
  13802. url: "/app/installations/:installation_id/access_tokens"
  13803. },
  13804. deleteAuthorization: {
  13805. headers: {
  13806. accept: "application/vnd.github.doctor-strange-preview+json"
  13807. },
  13808. method: "DELETE",
  13809. params: {
  13810. access_token: {
  13811. type: "string"
  13812. },
  13813. client_id: {
  13814. required: true,
  13815. type: "string"
  13816. }
  13817. },
  13818. url: "/applications/:client_id/grant"
  13819. },
  13820. deleteInstallation: {
  13821. headers: {
  13822. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13823. },
  13824. method: "DELETE",
  13825. params: {
  13826. installation_id: {
  13827. required: true,
  13828. type: "integer"
  13829. }
  13830. },
  13831. url: "/app/installations/:installation_id"
  13832. },
  13833. deleteToken: {
  13834. headers: {
  13835. accept: "application/vnd.github.doctor-strange-preview+json"
  13836. },
  13837. method: "DELETE",
  13838. params: {
  13839. access_token: {
  13840. type: "string"
  13841. },
  13842. client_id: {
  13843. required: true,
  13844. type: "string"
  13845. }
  13846. },
  13847. url: "/applications/:client_id/token"
  13848. },
  13849. findOrgInstallation: {
  13850. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13851. headers: {
  13852. accept: "application/vnd.github.machine-man-preview+json"
  13853. },
  13854. method: "GET",
  13855. params: {
  13856. org: {
  13857. required: true,
  13858. type: "string"
  13859. }
  13860. },
  13861. url: "/orgs/:org/installation"
  13862. },
  13863. findRepoInstallation: {
  13864. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13865. headers: {
  13866. accept: "application/vnd.github.machine-man-preview+json"
  13867. },
  13868. method: "GET",
  13869. params: {
  13870. owner: {
  13871. required: true,
  13872. type: "string"
  13873. },
  13874. repo: {
  13875. required: true,
  13876. type: "string"
  13877. }
  13878. },
  13879. url: "/repos/:owner/:repo/installation"
  13880. },
  13881. findUserInstallation: {
  13882. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13883. headers: {
  13884. accept: "application/vnd.github.machine-man-preview+json"
  13885. },
  13886. method: "GET",
  13887. params: {
  13888. username: {
  13889. required: true,
  13890. type: "string"
  13891. }
  13892. },
  13893. url: "/users/:username/installation"
  13894. },
  13895. getAuthenticated: {
  13896. headers: {
  13897. accept: "application/vnd.github.machine-man-preview+json"
  13898. },
  13899. method: "GET",
  13900. params: {},
  13901. url: "/app"
  13902. },
  13903. getBySlug: {
  13904. headers: {
  13905. accept: "application/vnd.github.machine-man-preview+json"
  13906. },
  13907. method: "GET",
  13908. params: {
  13909. app_slug: {
  13910. required: true,
  13911. type: "string"
  13912. }
  13913. },
  13914. url: "/apps/:app_slug"
  13915. },
  13916. getInstallation: {
  13917. headers: {
  13918. accept: "application/vnd.github.machine-man-preview+json"
  13919. },
  13920. method: "GET",
  13921. params: {
  13922. installation_id: {
  13923. required: true,
  13924. type: "integer"
  13925. }
  13926. },
  13927. url: "/app/installations/:installation_id"
  13928. },
  13929. getOrgInstallation: {
  13930. headers: {
  13931. accept: "application/vnd.github.machine-man-preview+json"
  13932. },
  13933. method: "GET",
  13934. params: {
  13935. org: {
  13936. required: true,
  13937. type: "string"
  13938. }
  13939. },
  13940. url: "/orgs/:org/installation"
  13941. },
  13942. getRepoInstallation: {
  13943. headers: {
  13944. accept: "application/vnd.github.machine-man-preview+json"
  13945. },
  13946. method: "GET",
  13947. params: {
  13948. owner: {
  13949. required: true,
  13950. type: "string"
  13951. },
  13952. repo: {
  13953. required: true,
  13954. type: "string"
  13955. }
  13956. },
  13957. url: "/repos/:owner/:repo/installation"
  13958. },
  13959. getUserInstallation: {
  13960. headers: {
  13961. accept: "application/vnd.github.machine-man-preview+json"
  13962. },
  13963. method: "GET",
  13964. params: {
  13965. username: {
  13966. required: true,
  13967. type: "string"
  13968. }
  13969. },
  13970. url: "/users/:username/installation"
  13971. },
  13972. listAccountsUserOrOrgOnPlan: {
  13973. method: "GET",
  13974. params: {
  13975. direction: {
  13976. enum: ["asc", "desc"],
  13977. type: "string"
  13978. },
  13979. page: {
  13980. type: "integer"
  13981. },
  13982. per_page: {
  13983. type: "integer"
  13984. },
  13985. plan_id: {
  13986. required: true,
  13987. type: "integer"
  13988. },
  13989. sort: {
  13990. enum: ["created", "updated"],
  13991. type: "string"
  13992. }
  13993. },
  13994. url: "/marketplace_listing/plans/:plan_id/accounts"
  13995. },
  13996. listAccountsUserOrOrgOnPlanStubbed: {
  13997. method: "GET",
  13998. params: {
  13999. direction: {
  14000. enum: ["asc", "desc"],
  14001. type: "string"
  14002. },
  14003. page: {
  14004. type: "integer"
  14005. },
  14006. per_page: {
  14007. type: "integer"
  14008. },
  14009. plan_id: {
  14010. required: true,
  14011. type: "integer"
  14012. },
  14013. sort: {
  14014. enum: ["created", "updated"],
  14015. type: "string"
  14016. }
  14017. },
  14018. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14019. },
  14020. listInstallationReposForAuthenticatedUser: {
  14021. headers: {
  14022. accept: "application/vnd.github.machine-man-preview+json"
  14023. },
  14024. method: "GET",
  14025. params: {
  14026. installation_id: {
  14027. required: true,
  14028. type: "integer"
  14029. },
  14030. page: {
  14031. type: "integer"
  14032. },
  14033. per_page: {
  14034. type: "integer"
  14035. }
  14036. },
  14037. url: "/user/installations/:installation_id/repositories"
  14038. },
  14039. listInstallations: {
  14040. headers: {
  14041. accept: "application/vnd.github.machine-man-preview+json"
  14042. },
  14043. method: "GET",
  14044. params: {
  14045. page: {
  14046. type: "integer"
  14047. },
  14048. per_page: {
  14049. type: "integer"
  14050. }
  14051. },
  14052. url: "/app/installations"
  14053. },
  14054. listInstallationsForAuthenticatedUser: {
  14055. headers: {
  14056. accept: "application/vnd.github.machine-man-preview+json"
  14057. },
  14058. method: "GET",
  14059. params: {
  14060. page: {
  14061. type: "integer"
  14062. },
  14063. per_page: {
  14064. type: "integer"
  14065. }
  14066. },
  14067. url: "/user/installations"
  14068. },
  14069. listMarketplacePurchasesForAuthenticatedUser: {
  14070. method: "GET",
  14071. params: {
  14072. page: {
  14073. type: "integer"
  14074. },
  14075. per_page: {
  14076. type: "integer"
  14077. }
  14078. },
  14079. url: "/user/marketplace_purchases"
  14080. },
  14081. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14082. method: "GET",
  14083. params: {
  14084. page: {
  14085. type: "integer"
  14086. },
  14087. per_page: {
  14088. type: "integer"
  14089. }
  14090. },
  14091. url: "/user/marketplace_purchases/stubbed"
  14092. },
  14093. listPlans: {
  14094. method: "GET",
  14095. params: {
  14096. page: {
  14097. type: "integer"
  14098. },
  14099. per_page: {
  14100. type: "integer"
  14101. }
  14102. },
  14103. url: "/marketplace_listing/plans"
  14104. },
  14105. listPlansStubbed: {
  14106. method: "GET",
  14107. params: {
  14108. page: {
  14109. type: "integer"
  14110. },
  14111. per_page: {
  14112. type: "integer"
  14113. }
  14114. },
  14115. url: "/marketplace_listing/stubbed/plans"
  14116. },
  14117. listRepos: {
  14118. headers: {
  14119. accept: "application/vnd.github.machine-man-preview+json"
  14120. },
  14121. method: "GET",
  14122. params: {
  14123. page: {
  14124. type: "integer"
  14125. },
  14126. per_page: {
  14127. type: "integer"
  14128. }
  14129. },
  14130. url: "/installation/repositories"
  14131. },
  14132. removeRepoFromInstallation: {
  14133. headers: {
  14134. accept: "application/vnd.github.machine-man-preview+json"
  14135. },
  14136. method: "DELETE",
  14137. params: {
  14138. installation_id: {
  14139. required: true,
  14140. type: "integer"
  14141. },
  14142. repository_id: {
  14143. required: true,
  14144. type: "integer"
  14145. }
  14146. },
  14147. url: "/user/installations/:installation_id/repositories/:repository_id"
  14148. },
  14149. resetAuthorization: {
  14150. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14151. method: "POST",
  14152. params: {
  14153. access_token: {
  14154. required: true,
  14155. type: "string"
  14156. },
  14157. client_id: {
  14158. required: true,
  14159. type: "string"
  14160. }
  14161. },
  14162. url: "/applications/:client_id/tokens/:access_token"
  14163. },
  14164. resetToken: {
  14165. headers: {
  14166. accept: "application/vnd.github.doctor-strange-preview+json"
  14167. },
  14168. method: "PATCH",
  14169. params: {
  14170. access_token: {
  14171. type: "string"
  14172. },
  14173. client_id: {
  14174. required: true,
  14175. type: "string"
  14176. }
  14177. },
  14178. url: "/applications/:client_id/token"
  14179. },
  14180. revokeAuthorizationForApplication: {
  14181. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14182. method: "DELETE",
  14183. params: {
  14184. access_token: {
  14185. required: true,
  14186. type: "string"
  14187. },
  14188. client_id: {
  14189. required: true,
  14190. type: "string"
  14191. }
  14192. },
  14193. url: "/applications/:client_id/tokens/:access_token"
  14194. },
  14195. revokeGrantForApplication: {
  14196. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14197. method: "DELETE",
  14198. params: {
  14199. access_token: {
  14200. required: true,
  14201. type: "string"
  14202. },
  14203. client_id: {
  14204. required: true,
  14205. type: "string"
  14206. }
  14207. },
  14208. url: "/applications/:client_id/grants/:access_token"
  14209. },
  14210. revokeInstallationToken: {
  14211. headers: {
  14212. accept: "application/vnd.github.gambit-preview+json"
  14213. },
  14214. method: "DELETE",
  14215. params: {},
  14216. url: "/installation/token"
  14217. }
  14218. },
  14219. checks: {
  14220. create: {
  14221. headers: {
  14222. accept: "application/vnd.github.antiope-preview+json"
  14223. },
  14224. method: "POST",
  14225. params: {
  14226. actions: {
  14227. type: "object[]"
  14228. },
  14229. "actions[].description": {
  14230. required: true,
  14231. type: "string"
  14232. },
  14233. "actions[].identifier": {
  14234. required: true,
  14235. type: "string"
  14236. },
  14237. "actions[].label": {
  14238. required: true,
  14239. type: "string"
  14240. },
  14241. completed_at: {
  14242. type: "string"
  14243. },
  14244. conclusion: {
  14245. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14246. type: "string"
  14247. },
  14248. details_url: {
  14249. type: "string"
  14250. },
  14251. external_id: {
  14252. type: "string"
  14253. },
  14254. head_sha: {
  14255. required: true,
  14256. type: "string"
  14257. },
  14258. name: {
  14259. required: true,
  14260. type: "string"
  14261. },
  14262. output: {
  14263. type: "object"
  14264. },
  14265. "output.annotations": {
  14266. type: "object[]"
  14267. },
  14268. "output.annotations[].annotation_level": {
  14269. enum: ["notice", "warning", "failure"],
  14270. required: true,
  14271. type: "string"
  14272. },
  14273. "output.annotations[].end_column": {
  14274. type: "integer"
  14275. },
  14276. "output.annotations[].end_line": {
  14277. required: true,
  14278. type: "integer"
  14279. },
  14280. "output.annotations[].message": {
  14281. required: true,
  14282. type: "string"
  14283. },
  14284. "output.annotations[].path": {
  14285. required: true,
  14286. type: "string"
  14287. },
  14288. "output.annotations[].raw_details": {
  14289. type: "string"
  14290. },
  14291. "output.annotations[].start_column": {
  14292. type: "integer"
  14293. },
  14294. "output.annotations[].start_line": {
  14295. required: true,
  14296. type: "integer"
  14297. },
  14298. "output.annotations[].title": {
  14299. type: "string"
  14300. },
  14301. "output.images": {
  14302. type: "object[]"
  14303. },
  14304. "output.images[].alt": {
  14305. required: true,
  14306. type: "string"
  14307. },
  14308. "output.images[].caption": {
  14309. type: "string"
  14310. },
  14311. "output.images[].image_url": {
  14312. required: true,
  14313. type: "string"
  14314. },
  14315. "output.summary": {
  14316. required: true,
  14317. type: "string"
  14318. },
  14319. "output.text": {
  14320. type: "string"
  14321. },
  14322. "output.title": {
  14323. required: true,
  14324. type: "string"
  14325. },
  14326. owner: {
  14327. required: true,
  14328. type: "string"
  14329. },
  14330. repo: {
  14331. required: true,
  14332. type: "string"
  14333. },
  14334. started_at: {
  14335. type: "string"
  14336. },
  14337. status: {
  14338. enum: ["queued", "in_progress", "completed"],
  14339. type: "string"
  14340. }
  14341. },
  14342. url: "/repos/:owner/:repo/check-runs"
  14343. },
  14344. createSuite: {
  14345. headers: {
  14346. accept: "application/vnd.github.antiope-preview+json"
  14347. },
  14348. method: "POST",
  14349. params: {
  14350. head_sha: {
  14351. required: true,
  14352. type: "string"
  14353. },
  14354. owner: {
  14355. required: true,
  14356. type: "string"
  14357. },
  14358. repo: {
  14359. required: true,
  14360. type: "string"
  14361. }
  14362. },
  14363. url: "/repos/:owner/:repo/check-suites"
  14364. },
  14365. get: {
  14366. headers: {
  14367. accept: "application/vnd.github.antiope-preview+json"
  14368. },
  14369. method: "GET",
  14370. params: {
  14371. check_run_id: {
  14372. required: true,
  14373. type: "integer"
  14374. },
  14375. owner: {
  14376. required: true,
  14377. type: "string"
  14378. },
  14379. repo: {
  14380. required: true,
  14381. type: "string"
  14382. }
  14383. },
  14384. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14385. },
  14386. getSuite: {
  14387. headers: {
  14388. accept: "application/vnd.github.antiope-preview+json"
  14389. },
  14390. method: "GET",
  14391. params: {
  14392. check_suite_id: {
  14393. required: true,
  14394. type: "integer"
  14395. },
  14396. owner: {
  14397. required: true,
  14398. type: "string"
  14399. },
  14400. repo: {
  14401. required: true,
  14402. type: "string"
  14403. }
  14404. },
  14405. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14406. },
  14407. listAnnotations: {
  14408. headers: {
  14409. accept: "application/vnd.github.antiope-preview+json"
  14410. },
  14411. method: "GET",
  14412. params: {
  14413. check_run_id: {
  14414. required: true,
  14415. type: "integer"
  14416. },
  14417. owner: {
  14418. required: true,
  14419. type: "string"
  14420. },
  14421. page: {
  14422. type: "integer"
  14423. },
  14424. per_page: {
  14425. type: "integer"
  14426. },
  14427. repo: {
  14428. required: true,
  14429. type: "string"
  14430. }
  14431. },
  14432. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14433. },
  14434. listForRef: {
  14435. headers: {
  14436. accept: "application/vnd.github.antiope-preview+json"
  14437. },
  14438. method: "GET",
  14439. params: {
  14440. check_name: {
  14441. type: "string"
  14442. },
  14443. filter: {
  14444. enum: ["latest", "all"],
  14445. type: "string"
  14446. },
  14447. owner: {
  14448. required: true,
  14449. type: "string"
  14450. },
  14451. page: {
  14452. type: "integer"
  14453. },
  14454. per_page: {
  14455. type: "integer"
  14456. },
  14457. ref: {
  14458. required: true,
  14459. type: "string"
  14460. },
  14461. repo: {
  14462. required: true,
  14463. type: "string"
  14464. },
  14465. status: {
  14466. enum: ["queued", "in_progress", "completed"],
  14467. type: "string"
  14468. }
  14469. },
  14470. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14471. },
  14472. listForSuite: {
  14473. headers: {
  14474. accept: "application/vnd.github.antiope-preview+json"
  14475. },
  14476. method: "GET",
  14477. params: {
  14478. check_name: {
  14479. type: "string"
  14480. },
  14481. check_suite_id: {
  14482. required: true,
  14483. type: "integer"
  14484. },
  14485. filter: {
  14486. enum: ["latest", "all"],
  14487. type: "string"
  14488. },
  14489. owner: {
  14490. required: true,
  14491. type: "string"
  14492. },
  14493. page: {
  14494. type: "integer"
  14495. },
  14496. per_page: {
  14497. type: "integer"
  14498. },
  14499. repo: {
  14500. required: true,
  14501. type: "string"
  14502. },
  14503. status: {
  14504. enum: ["queued", "in_progress", "completed"],
  14505. type: "string"
  14506. }
  14507. },
  14508. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14509. },
  14510. listSuitesForRef: {
  14511. headers: {
  14512. accept: "application/vnd.github.antiope-preview+json"
  14513. },
  14514. method: "GET",
  14515. params: {
  14516. app_id: {
  14517. type: "integer"
  14518. },
  14519. check_name: {
  14520. type: "string"
  14521. },
  14522. owner: {
  14523. required: true,
  14524. type: "string"
  14525. },
  14526. page: {
  14527. type: "integer"
  14528. },
  14529. per_page: {
  14530. type: "integer"
  14531. },
  14532. ref: {
  14533. required: true,
  14534. type: "string"
  14535. },
  14536. repo: {
  14537. required: true,
  14538. type: "string"
  14539. }
  14540. },
  14541. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14542. },
  14543. rerequestSuite: {
  14544. headers: {
  14545. accept: "application/vnd.github.antiope-preview+json"
  14546. },
  14547. method: "POST",
  14548. params: {
  14549. check_suite_id: {
  14550. required: true,
  14551. type: "integer"
  14552. },
  14553. owner: {
  14554. required: true,
  14555. type: "string"
  14556. },
  14557. repo: {
  14558. required: true,
  14559. type: "string"
  14560. }
  14561. },
  14562. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14563. },
  14564. setSuitesPreferences: {
  14565. headers: {
  14566. accept: "application/vnd.github.antiope-preview+json"
  14567. },
  14568. method: "PATCH",
  14569. params: {
  14570. auto_trigger_checks: {
  14571. type: "object[]"
  14572. },
  14573. "auto_trigger_checks[].app_id": {
  14574. required: true,
  14575. type: "integer"
  14576. },
  14577. "auto_trigger_checks[].setting": {
  14578. required: true,
  14579. type: "boolean"
  14580. },
  14581. owner: {
  14582. required: true,
  14583. type: "string"
  14584. },
  14585. repo: {
  14586. required: true,
  14587. type: "string"
  14588. }
  14589. },
  14590. url: "/repos/:owner/:repo/check-suites/preferences"
  14591. },
  14592. update: {
  14593. headers: {
  14594. accept: "application/vnd.github.antiope-preview+json"
  14595. },
  14596. method: "PATCH",
  14597. params: {
  14598. actions: {
  14599. type: "object[]"
  14600. },
  14601. "actions[].description": {
  14602. required: true,
  14603. type: "string"
  14604. },
  14605. "actions[].identifier": {
  14606. required: true,
  14607. type: "string"
  14608. },
  14609. "actions[].label": {
  14610. required: true,
  14611. type: "string"
  14612. },
  14613. check_run_id: {
  14614. required: true,
  14615. type: "integer"
  14616. },
  14617. completed_at: {
  14618. type: "string"
  14619. },
  14620. conclusion: {
  14621. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14622. type: "string"
  14623. },
  14624. details_url: {
  14625. type: "string"
  14626. },
  14627. external_id: {
  14628. type: "string"
  14629. },
  14630. name: {
  14631. type: "string"
  14632. },
  14633. output: {
  14634. type: "object"
  14635. },
  14636. "output.annotations": {
  14637. type: "object[]"
  14638. },
  14639. "output.annotations[].annotation_level": {
  14640. enum: ["notice", "warning", "failure"],
  14641. required: true,
  14642. type: "string"
  14643. },
  14644. "output.annotations[].end_column": {
  14645. type: "integer"
  14646. },
  14647. "output.annotations[].end_line": {
  14648. required: true,
  14649. type: "integer"
  14650. },
  14651. "output.annotations[].message": {
  14652. required: true,
  14653. type: "string"
  14654. },
  14655. "output.annotations[].path": {
  14656. required: true,
  14657. type: "string"
  14658. },
  14659. "output.annotations[].raw_details": {
  14660. type: "string"
  14661. },
  14662. "output.annotations[].start_column": {
  14663. type: "integer"
  14664. },
  14665. "output.annotations[].start_line": {
  14666. required: true,
  14667. type: "integer"
  14668. },
  14669. "output.annotations[].title": {
  14670. type: "string"
  14671. },
  14672. "output.images": {
  14673. type: "object[]"
  14674. },
  14675. "output.images[].alt": {
  14676. required: true,
  14677. type: "string"
  14678. },
  14679. "output.images[].caption": {
  14680. type: "string"
  14681. },
  14682. "output.images[].image_url": {
  14683. required: true,
  14684. type: "string"
  14685. },
  14686. "output.summary": {
  14687. required: true,
  14688. type: "string"
  14689. },
  14690. "output.text": {
  14691. type: "string"
  14692. },
  14693. "output.title": {
  14694. type: "string"
  14695. },
  14696. owner: {
  14697. required: true,
  14698. type: "string"
  14699. },
  14700. repo: {
  14701. required: true,
  14702. type: "string"
  14703. },
  14704. started_at: {
  14705. type: "string"
  14706. },
  14707. status: {
  14708. enum: ["queued", "in_progress", "completed"],
  14709. type: "string"
  14710. }
  14711. },
  14712. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14713. }
  14714. },
  14715. codesOfConduct: {
  14716. getConductCode: {
  14717. headers: {
  14718. accept: "application/vnd.github.scarlet-witch-preview+json"
  14719. },
  14720. method: "GET",
  14721. params: {
  14722. key: {
  14723. required: true,
  14724. type: "string"
  14725. }
  14726. },
  14727. url: "/codes_of_conduct/:key"
  14728. },
  14729. getForRepo: {
  14730. headers: {
  14731. accept: "application/vnd.github.scarlet-witch-preview+json"
  14732. },
  14733. method: "GET",
  14734. params: {
  14735. owner: {
  14736. required: true,
  14737. type: "string"
  14738. },
  14739. repo: {
  14740. required: true,
  14741. type: "string"
  14742. }
  14743. },
  14744. url: "/repos/:owner/:repo/community/code_of_conduct"
  14745. },
  14746. listConductCodes: {
  14747. headers: {
  14748. accept: "application/vnd.github.scarlet-witch-preview+json"
  14749. },
  14750. method: "GET",
  14751. params: {},
  14752. url: "/codes_of_conduct"
  14753. }
  14754. },
  14755. emojis: {
  14756. get: {
  14757. method: "GET",
  14758. params: {},
  14759. url: "/emojis"
  14760. }
  14761. },
  14762. gists: {
  14763. checkIsStarred: {
  14764. method: "GET",
  14765. params: {
  14766. gist_id: {
  14767. required: true,
  14768. type: "string"
  14769. }
  14770. },
  14771. url: "/gists/:gist_id/star"
  14772. },
  14773. create: {
  14774. method: "POST",
  14775. params: {
  14776. description: {
  14777. type: "string"
  14778. },
  14779. files: {
  14780. required: true,
  14781. type: "object"
  14782. },
  14783. "files.content": {
  14784. type: "string"
  14785. },
  14786. public: {
  14787. type: "boolean"
  14788. }
  14789. },
  14790. url: "/gists"
  14791. },
  14792. createComment: {
  14793. method: "POST",
  14794. params: {
  14795. body: {
  14796. required: true,
  14797. type: "string"
  14798. },
  14799. gist_id: {
  14800. required: true,
  14801. type: "string"
  14802. }
  14803. },
  14804. url: "/gists/:gist_id/comments"
  14805. },
  14806. delete: {
  14807. method: "DELETE",
  14808. params: {
  14809. gist_id: {
  14810. required: true,
  14811. type: "string"
  14812. }
  14813. },
  14814. url: "/gists/:gist_id"
  14815. },
  14816. deleteComment: {
  14817. method: "DELETE",
  14818. params: {
  14819. comment_id: {
  14820. required: true,
  14821. type: "integer"
  14822. },
  14823. gist_id: {
  14824. required: true,
  14825. type: "string"
  14826. }
  14827. },
  14828. url: "/gists/:gist_id/comments/:comment_id"
  14829. },
  14830. fork: {
  14831. method: "POST",
  14832. params: {
  14833. gist_id: {
  14834. required: true,
  14835. type: "string"
  14836. }
  14837. },
  14838. url: "/gists/:gist_id/forks"
  14839. },
  14840. get: {
  14841. method: "GET",
  14842. params: {
  14843. gist_id: {
  14844. required: true,
  14845. type: "string"
  14846. }
  14847. },
  14848. url: "/gists/:gist_id"
  14849. },
  14850. getComment: {
  14851. method: "GET",
  14852. params: {
  14853. comment_id: {
  14854. required: true,
  14855. type: "integer"
  14856. },
  14857. gist_id: {
  14858. required: true,
  14859. type: "string"
  14860. }
  14861. },
  14862. url: "/gists/:gist_id/comments/:comment_id"
  14863. },
  14864. getRevision: {
  14865. method: "GET",
  14866. params: {
  14867. gist_id: {
  14868. required: true,
  14869. type: "string"
  14870. },
  14871. sha: {
  14872. required: true,
  14873. type: "string"
  14874. }
  14875. },
  14876. url: "/gists/:gist_id/:sha"
  14877. },
  14878. list: {
  14879. method: "GET",
  14880. params: {
  14881. page: {
  14882. type: "integer"
  14883. },
  14884. per_page: {
  14885. type: "integer"
  14886. },
  14887. since: {
  14888. type: "string"
  14889. }
  14890. },
  14891. url: "/gists"
  14892. },
  14893. listComments: {
  14894. method: "GET",
  14895. params: {
  14896. gist_id: {
  14897. required: true,
  14898. type: "string"
  14899. },
  14900. page: {
  14901. type: "integer"
  14902. },
  14903. per_page: {
  14904. type: "integer"
  14905. }
  14906. },
  14907. url: "/gists/:gist_id/comments"
  14908. },
  14909. listCommits: {
  14910. method: "GET",
  14911. params: {
  14912. gist_id: {
  14913. required: true,
  14914. type: "string"
  14915. },
  14916. page: {
  14917. type: "integer"
  14918. },
  14919. per_page: {
  14920. type: "integer"
  14921. }
  14922. },
  14923. url: "/gists/:gist_id/commits"
  14924. },
  14925. listForks: {
  14926. method: "GET",
  14927. params: {
  14928. gist_id: {
  14929. required: true,
  14930. type: "string"
  14931. },
  14932. page: {
  14933. type: "integer"
  14934. },
  14935. per_page: {
  14936. type: "integer"
  14937. }
  14938. },
  14939. url: "/gists/:gist_id/forks"
  14940. },
  14941. listPublic: {
  14942. method: "GET",
  14943. params: {
  14944. page: {
  14945. type: "integer"
  14946. },
  14947. per_page: {
  14948. type: "integer"
  14949. },
  14950. since: {
  14951. type: "string"
  14952. }
  14953. },
  14954. url: "/gists/public"
  14955. },
  14956. listPublicForUser: {
  14957. method: "GET",
  14958. params: {
  14959. page: {
  14960. type: "integer"
  14961. },
  14962. per_page: {
  14963. type: "integer"
  14964. },
  14965. since: {
  14966. type: "string"
  14967. },
  14968. username: {
  14969. required: true,
  14970. type: "string"
  14971. }
  14972. },
  14973. url: "/users/:username/gists"
  14974. },
  14975. listStarred: {
  14976. method: "GET",
  14977. params: {
  14978. page: {
  14979. type: "integer"
  14980. },
  14981. per_page: {
  14982. type: "integer"
  14983. },
  14984. since: {
  14985. type: "string"
  14986. }
  14987. },
  14988. url: "/gists/starred"
  14989. },
  14990. star: {
  14991. method: "PUT",
  14992. params: {
  14993. gist_id: {
  14994. required: true,
  14995. type: "string"
  14996. }
  14997. },
  14998. url: "/gists/:gist_id/star"
  14999. },
  15000. unstar: {
  15001. method: "DELETE",
  15002. params: {
  15003. gist_id: {
  15004. required: true,
  15005. type: "string"
  15006. }
  15007. },
  15008. url: "/gists/:gist_id/star"
  15009. },
  15010. update: {
  15011. method: "PATCH",
  15012. params: {
  15013. description: {
  15014. type: "string"
  15015. },
  15016. files: {
  15017. type: "object"
  15018. },
  15019. "files.content": {
  15020. type: "string"
  15021. },
  15022. "files.filename": {
  15023. type: "string"
  15024. },
  15025. gist_id: {
  15026. required: true,
  15027. type: "string"
  15028. }
  15029. },
  15030. url: "/gists/:gist_id"
  15031. },
  15032. updateComment: {
  15033. method: "PATCH",
  15034. params: {
  15035. body: {
  15036. required: true,
  15037. type: "string"
  15038. },
  15039. comment_id: {
  15040. required: true,
  15041. type: "integer"
  15042. },
  15043. gist_id: {
  15044. required: true,
  15045. type: "string"
  15046. }
  15047. },
  15048. url: "/gists/:gist_id/comments/:comment_id"
  15049. }
  15050. },
  15051. git: {
  15052. createBlob: {
  15053. method: "POST",
  15054. params: {
  15055. content: {
  15056. required: true,
  15057. type: "string"
  15058. },
  15059. encoding: {
  15060. type: "string"
  15061. },
  15062. owner: {
  15063. required: true,
  15064. type: "string"
  15065. },
  15066. repo: {
  15067. required: true,
  15068. type: "string"
  15069. }
  15070. },
  15071. url: "/repos/:owner/:repo/git/blobs"
  15072. },
  15073. createCommit: {
  15074. method: "POST",
  15075. params: {
  15076. author: {
  15077. type: "object"
  15078. },
  15079. "author.date": {
  15080. type: "string"
  15081. },
  15082. "author.email": {
  15083. type: "string"
  15084. },
  15085. "author.name": {
  15086. type: "string"
  15087. },
  15088. committer: {
  15089. type: "object"
  15090. },
  15091. "committer.date": {
  15092. type: "string"
  15093. },
  15094. "committer.email": {
  15095. type: "string"
  15096. },
  15097. "committer.name": {
  15098. type: "string"
  15099. },
  15100. message: {
  15101. required: true,
  15102. type: "string"
  15103. },
  15104. owner: {
  15105. required: true,
  15106. type: "string"
  15107. },
  15108. parents: {
  15109. required: true,
  15110. type: "string[]"
  15111. },
  15112. repo: {
  15113. required: true,
  15114. type: "string"
  15115. },
  15116. signature: {
  15117. type: "string"
  15118. },
  15119. tree: {
  15120. required: true,
  15121. type: "string"
  15122. }
  15123. },
  15124. url: "/repos/:owner/:repo/git/commits"
  15125. },
  15126. createRef: {
  15127. method: "POST",
  15128. params: {
  15129. owner: {
  15130. required: true,
  15131. type: "string"
  15132. },
  15133. ref: {
  15134. required: true,
  15135. type: "string"
  15136. },
  15137. repo: {
  15138. required: true,
  15139. type: "string"
  15140. },
  15141. sha: {
  15142. required: true,
  15143. type: "string"
  15144. }
  15145. },
  15146. url: "/repos/:owner/:repo/git/refs"
  15147. },
  15148. createTag: {
  15149. method: "POST",
  15150. params: {
  15151. message: {
  15152. required: true,
  15153. type: "string"
  15154. },
  15155. object: {
  15156. required: true,
  15157. type: "string"
  15158. },
  15159. owner: {
  15160. required: true,
  15161. type: "string"
  15162. },
  15163. repo: {
  15164. required: true,
  15165. type: "string"
  15166. },
  15167. tag: {
  15168. required: true,
  15169. type: "string"
  15170. },
  15171. tagger: {
  15172. type: "object"
  15173. },
  15174. "tagger.date": {
  15175. type: "string"
  15176. },
  15177. "tagger.email": {
  15178. type: "string"
  15179. },
  15180. "tagger.name": {
  15181. type: "string"
  15182. },
  15183. type: {
  15184. enum: ["commit", "tree", "blob"],
  15185. required: true,
  15186. type: "string"
  15187. }
  15188. },
  15189. url: "/repos/:owner/:repo/git/tags"
  15190. },
  15191. createTree: {
  15192. method: "POST",
  15193. params: {
  15194. base_tree: {
  15195. type: "string"
  15196. },
  15197. owner: {
  15198. required: true,
  15199. type: "string"
  15200. },
  15201. repo: {
  15202. required: true,
  15203. type: "string"
  15204. },
  15205. tree: {
  15206. required: true,
  15207. type: "object[]"
  15208. },
  15209. "tree[].content": {
  15210. type: "string"
  15211. },
  15212. "tree[].mode": {
  15213. enum: ["100644", "100755", "040000", "160000", "120000"],
  15214. type: "string"
  15215. },
  15216. "tree[].path": {
  15217. type: "string"
  15218. },
  15219. "tree[].sha": {
  15220. allowNull: true,
  15221. type: "string"
  15222. },
  15223. "tree[].type": {
  15224. enum: ["blob", "tree", "commit"],
  15225. type: "string"
  15226. }
  15227. },
  15228. url: "/repos/:owner/:repo/git/trees"
  15229. },
  15230. deleteRef: {
  15231. method: "DELETE",
  15232. params: {
  15233. owner: {
  15234. required: true,
  15235. type: "string"
  15236. },
  15237. ref: {
  15238. required: true,
  15239. type: "string"
  15240. },
  15241. repo: {
  15242. required: true,
  15243. type: "string"
  15244. }
  15245. },
  15246. url: "/repos/:owner/:repo/git/refs/:ref"
  15247. },
  15248. getBlob: {
  15249. method: "GET",
  15250. params: {
  15251. file_sha: {
  15252. required: true,
  15253. type: "string"
  15254. },
  15255. owner: {
  15256. required: true,
  15257. type: "string"
  15258. },
  15259. repo: {
  15260. required: true,
  15261. type: "string"
  15262. }
  15263. },
  15264. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15265. },
  15266. getCommit: {
  15267. method: "GET",
  15268. params: {
  15269. commit_sha: {
  15270. required: true,
  15271. type: "string"
  15272. },
  15273. owner: {
  15274. required: true,
  15275. type: "string"
  15276. },
  15277. repo: {
  15278. required: true,
  15279. type: "string"
  15280. }
  15281. },
  15282. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15283. },
  15284. getRef: {
  15285. method: "GET",
  15286. params: {
  15287. owner: {
  15288. required: true,
  15289. type: "string"
  15290. },
  15291. ref: {
  15292. required: true,
  15293. type: "string"
  15294. },
  15295. repo: {
  15296. required: true,
  15297. type: "string"
  15298. }
  15299. },
  15300. url: "/repos/:owner/:repo/git/ref/:ref"
  15301. },
  15302. getTag: {
  15303. method: "GET",
  15304. params: {
  15305. owner: {
  15306. required: true,
  15307. type: "string"
  15308. },
  15309. repo: {
  15310. required: true,
  15311. type: "string"
  15312. },
  15313. tag_sha: {
  15314. required: true,
  15315. type: "string"
  15316. }
  15317. },
  15318. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15319. },
  15320. getTree: {
  15321. method: "GET",
  15322. params: {
  15323. owner: {
  15324. required: true,
  15325. type: "string"
  15326. },
  15327. recursive: {
  15328. enum: ["1"],
  15329. type: "integer"
  15330. },
  15331. repo: {
  15332. required: true,
  15333. type: "string"
  15334. },
  15335. tree_sha: {
  15336. required: true,
  15337. type: "string"
  15338. }
  15339. },
  15340. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15341. },
  15342. listMatchingRefs: {
  15343. method: "GET",
  15344. params: {
  15345. owner: {
  15346. required: true,
  15347. type: "string"
  15348. },
  15349. page: {
  15350. type: "integer"
  15351. },
  15352. per_page: {
  15353. type: "integer"
  15354. },
  15355. ref: {
  15356. required: true,
  15357. type: "string"
  15358. },
  15359. repo: {
  15360. required: true,
  15361. type: "string"
  15362. }
  15363. },
  15364. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15365. },
  15366. listRefs: {
  15367. method: "GET",
  15368. params: {
  15369. namespace: {
  15370. type: "string"
  15371. },
  15372. owner: {
  15373. required: true,
  15374. type: "string"
  15375. },
  15376. page: {
  15377. type: "integer"
  15378. },
  15379. per_page: {
  15380. type: "integer"
  15381. },
  15382. repo: {
  15383. required: true,
  15384. type: "string"
  15385. }
  15386. },
  15387. url: "/repos/:owner/:repo/git/refs/:namespace"
  15388. },
  15389. updateRef: {
  15390. method: "PATCH",
  15391. params: {
  15392. force: {
  15393. type: "boolean"
  15394. },
  15395. owner: {
  15396. required: true,
  15397. type: "string"
  15398. },
  15399. ref: {
  15400. required: true,
  15401. type: "string"
  15402. },
  15403. repo: {
  15404. required: true,
  15405. type: "string"
  15406. },
  15407. sha: {
  15408. required: true,
  15409. type: "string"
  15410. }
  15411. },
  15412. url: "/repos/:owner/:repo/git/refs/:ref"
  15413. }
  15414. },
  15415. gitignore: {
  15416. getTemplate: {
  15417. method: "GET",
  15418. params: {
  15419. name: {
  15420. required: true,
  15421. type: "string"
  15422. }
  15423. },
  15424. url: "/gitignore/templates/:name"
  15425. },
  15426. listTemplates: {
  15427. method: "GET",
  15428. params: {},
  15429. url: "/gitignore/templates"
  15430. }
  15431. },
  15432. interactions: {
  15433. addOrUpdateRestrictionsForOrg: {
  15434. headers: {
  15435. accept: "application/vnd.github.sombra-preview+json"
  15436. },
  15437. method: "PUT",
  15438. params: {
  15439. limit: {
  15440. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15441. required: true,
  15442. type: "string"
  15443. },
  15444. org: {
  15445. required: true,
  15446. type: "string"
  15447. }
  15448. },
  15449. url: "/orgs/:org/interaction-limits"
  15450. },
  15451. addOrUpdateRestrictionsForRepo: {
  15452. headers: {
  15453. accept: "application/vnd.github.sombra-preview+json"
  15454. },
  15455. method: "PUT",
  15456. params: {
  15457. limit: {
  15458. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15459. required: true,
  15460. type: "string"
  15461. },
  15462. owner: {
  15463. required: true,
  15464. type: "string"
  15465. },
  15466. repo: {
  15467. required: true,
  15468. type: "string"
  15469. }
  15470. },
  15471. url: "/repos/:owner/:repo/interaction-limits"
  15472. },
  15473. getRestrictionsForOrg: {
  15474. headers: {
  15475. accept: "application/vnd.github.sombra-preview+json"
  15476. },
  15477. method: "GET",
  15478. params: {
  15479. org: {
  15480. required: true,
  15481. type: "string"
  15482. }
  15483. },
  15484. url: "/orgs/:org/interaction-limits"
  15485. },
  15486. getRestrictionsForRepo: {
  15487. headers: {
  15488. accept: "application/vnd.github.sombra-preview+json"
  15489. },
  15490. method: "GET",
  15491. params: {
  15492. owner: {
  15493. required: true,
  15494. type: "string"
  15495. },
  15496. repo: {
  15497. required: true,
  15498. type: "string"
  15499. }
  15500. },
  15501. url: "/repos/:owner/:repo/interaction-limits"
  15502. },
  15503. removeRestrictionsForOrg: {
  15504. headers: {
  15505. accept: "application/vnd.github.sombra-preview+json"
  15506. },
  15507. method: "DELETE",
  15508. params: {
  15509. org: {
  15510. required: true,
  15511. type: "string"
  15512. }
  15513. },
  15514. url: "/orgs/:org/interaction-limits"
  15515. },
  15516. removeRestrictionsForRepo: {
  15517. headers: {
  15518. accept: "application/vnd.github.sombra-preview+json"
  15519. },
  15520. method: "DELETE",
  15521. params: {
  15522. owner: {
  15523. required: true,
  15524. type: "string"
  15525. },
  15526. repo: {
  15527. required: true,
  15528. type: "string"
  15529. }
  15530. },
  15531. url: "/repos/:owner/:repo/interaction-limits"
  15532. }
  15533. },
  15534. issues: {
  15535. addAssignees: {
  15536. method: "POST",
  15537. params: {
  15538. assignees: {
  15539. type: "string[]"
  15540. },
  15541. issue_number: {
  15542. required: true,
  15543. type: "integer"
  15544. },
  15545. number: {
  15546. alias: "issue_number",
  15547. deprecated: true,
  15548. type: "integer"
  15549. },
  15550. owner: {
  15551. required: true,
  15552. type: "string"
  15553. },
  15554. repo: {
  15555. required: true,
  15556. type: "string"
  15557. }
  15558. },
  15559. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15560. },
  15561. addLabels: {
  15562. method: "POST",
  15563. params: {
  15564. issue_number: {
  15565. required: true,
  15566. type: "integer"
  15567. },
  15568. labels: {
  15569. required: true,
  15570. type: "string[]"
  15571. },
  15572. number: {
  15573. alias: "issue_number",
  15574. deprecated: true,
  15575. type: "integer"
  15576. },
  15577. owner: {
  15578. required: true,
  15579. type: "string"
  15580. },
  15581. repo: {
  15582. required: true,
  15583. type: "string"
  15584. }
  15585. },
  15586. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15587. },
  15588. checkAssignee: {
  15589. method: "GET",
  15590. params: {
  15591. assignee: {
  15592. required: true,
  15593. type: "string"
  15594. },
  15595. owner: {
  15596. required: true,
  15597. type: "string"
  15598. },
  15599. repo: {
  15600. required: true,
  15601. type: "string"
  15602. }
  15603. },
  15604. url: "/repos/:owner/:repo/assignees/:assignee"
  15605. },
  15606. create: {
  15607. method: "POST",
  15608. params: {
  15609. assignee: {
  15610. type: "string"
  15611. },
  15612. assignees: {
  15613. type: "string[]"
  15614. },
  15615. body: {
  15616. type: "string"
  15617. },
  15618. labels: {
  15619. type: "string[]"
  15620. },
  15621. milestone: {
  15622. type: "integer"
  15623. },
  15624. owner: {
  15625. required: true,
  15626. type: "string"
  15627. },
  15628. repo: {
  15629. required: true,
  15630. type: "string"
  15631. },
  15632. title: {
  15633. required: true,
  15634. type: "string"
  15635. }
  15636. },
  15637. url: "/repos/:owner/:repo/issues"
  15638. },
  15639. createComment: {
  15640. method: "POST",
  15641. params: {
  15642. body: {
  15643. required: true,
  15644. type: "string"
  15645. },
  15646. issue_number: {
  15647. required: true,
  15648. type: "integer"
  15649. },
  15650. number: {
  15651. alias: "issue_number",
  15652. deprecated: true,
  15653. type: "integer"
  15654. },
  15655. owner: {
  15656. required: true,
  15657. type: "string"
  15658. },
  15659. repo: {
  15660. required: true,
  15661. type: "string"
  15662. }
  15663. },
  15664. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15665. },
  15666. createLabel: {
  15667. method: "POST",
  15668. params: {
  15669. color: {
  15670. required: true,
  15671. type: "string"
  15672. },
  15673. description: {
  15674. type: "string"
  15675. },
  15676. name: {
  15677. required: true,
  15678. type: "string"
  15679. },
  15680. owner: {
  15681. required: true,
  15682. type: "string"
  15683. },
  15684. repo: {
  15685. required: true,
  15686. type: "string"
  15687. }
  15688. },
  15689. url: "/repos/:owner/:repo/labels"
  15690. },
  15691. createMilestone: {
  15692. method: "POST",
  15693. params: {
  15694. description: {
  15695. type: "string"
  15696. },
  15697. due_on: {
  15698. type: "string"
  15699. },
  15700. owner: {
  15701. required: true,
  15702. type: "string"
  15703. },
  15704. repo: {
  15705. required: true,
  15706. type: "string"
  15707. },
  15708. state: {
  15709. enum: ["open", "closed"],
  15710. type: "string"
  15711. },
  15712. title: {
  15713. required: true,
  15714. type: "string"
  15715. }
  15716. },
  15717. url: "/repos/:owner/:repo/milestones"
  15718. },
  15719. deleteComment: {
  15720. method: "DELETE",
  15721. params: {
  15722. comment_id: {
  15723. required: true,
  15724. type: "integer"
  15725. },
  15726. owner: {
  15727. required: true,
  15728. type: "string"
  15729. },
  15730. repo: {
  15731. required: true,
  15732. type: "string"
  15733. }
  15734. },
  15735. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15736. },
  15737. deleteLabel: {
  15738. method: "DELETE",
  15739. params: {
  15740. name: {
  15741. required: true,
  15742. type: "string"
  15743. },
  15744. owner: {
  15745. required: true,
  15746. type: "string"
  15747. },
  15748. repo: {
  15749. required: true,
  15750. type: "string"
  15751. }
  15752. },
  15753. url: "/repos/:owner/:repo/labels/:name"
  15754. },
  15755. deleteMilestone: {
  15756. method: "DELETE",
  15757. params: {
  15758. milestone_number: {
  15759. required: true,
  15760. type: "integer"
  15761. },
  15762. number: {
  15763. alias: "milestone_number",
  15764. deprecated: true,
  15765. type: "integer"
  15766. },
  15767. owner: {
  15768. required: true,
  15769. type: "string"
  15770. },
  15771. repo: {
  15772. required: true,
  15773. type: "string"
  15774. }
  15775. },
  15776. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15777. },
  15778. get: {
  15779. method: "GET",
  15780. params: {
  15781. issue_number: {
  15782. required: true,
  15783. type: "integer"
  15784. },
  15785. number: {
  15786. alias: "issue_number",
  15787. deprecated: true,
  15788. type: "integer"
  15789. },
  15790. owner: {
  15791. required: true,
  15792. type: "string"
  15793. },
  15794. repo: {
  15795. required: true,
  15796. type: "string"
  15797. }
  15798. },
  15799. url: "/repos/:owner/:repo/issues/:issue_number"
  15800. },
  15801. getComment: {
  15802. method: "GET",
  15803. params: {
  15804. comment_id: {
  15805. required: true,
  15806. type: "integer"
  15807. },
  15808. owner: {
  15809. required: true,
  15810. type: "string"
  15811. },
  15812. repo: {
  15813. required: true,
  15814. type: "string"
  15815. }
  15816. },
  15817. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15818. },
  15819. getEvent: {
  15820. method: "GET",
  15821. params: {
  15822. event_id: {
  15823. required: true,
  15824. type: "integer"
  15825. },
  15826. owner: {
  15827. required: true,
  15828. type: "string"
  15829. },
  15830. repo: {
  15831. required: true,
  15832. type: "string"
  15833. }
  15834. },
  15835. url: "/repos/:owner/:repo/issues/events/:event_id"
  15836. },
  15837. getLabel: {
  15838. method: "GET",
  15839. params: {
  15840. name: {
  15841. required: true,
  15842. type: "string"
  15843. },
  15844. owner: {
  15845. required: true,
  15846. type: "string"
  15847. },
  15848. repo: {
  15849. required: true,
  15850. type: "string"
  15851. }
  15852. },
  15853. url: "/repos/:owner/:repo/labels/:name"
  15854. },
  15855. getMilestone: {
  15856. method: "GET",
  15857. params: {
  15858. milestone_number: {
  15859. required: true,
  15860. type: "integer"
  15861. },
  15862. number: {
  15863. alias: "milestone_number",
  15864. deprecated: true,
  15865. type: "integer"
  15866. },
  15867. owner: {
  15868. required: true,
  15869. type: "string"
  15870. },
  15871. repo: {
  15872. required: true,
  15873. type: "string"
  15874. }
  15875. },
  15876. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15877. },
  15878. list: {
  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: "/issues"
  15911. },
  15912. listAssignees: {
  15913. method: "GET",
  15914. params: {
  15915. owner: {
  15916. required: true,
  15917. type: "string"
  15918. },
  15919. page: {
  15920. type: "integer"
  15921. },
  15922. per_page: {
  15923. type: "integer"
  15924. },
  15925. repo: {
  15926. required: true,
  15927. type: "string"
  15928. }
  15929. },
  15930. url: "/repos/:owner/:repo/assignees"
  15931. },
  15932. listComments: {
  15933. method: "GET",
  15934. params: {
  15935. issue_number: {
  15936. required: true,
  15937. type: "integer"
  15938. },
  15939. number: {
  15940. alias: "issue_number",
  15941. deprecated: true,
  15942. type: "integer"
  15943. },
  15944. owner: {
  15945. required: true,
  15946. type: "string"
  15947. },
  15948. page: {
  15949. type: "integer"
  15950. },
  15951. per_page: {
  15952. type: "integer"
  15953. },
  15954. repo: {
  15955. required: true,
  15956. type: "string"
  15957. },
  15958. since: {
  15959. type: "string"
  15960. }
  15961. },
  15962. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15963. },
  15964. listCommentsForRepo: {
  15965. method: "GET",
  15966. params: {
  15967. direction: {
  15968. enum: ["asc", "desc"],
  15969. type: "string"
  15970. },
  15971. owner: {
  15972. required: true,
  15973. type: "string"
  15974. },
  15975. repo: {
  15976. required: true,
  15977. type: "string"
  15978. },
  15979. since: {
  15980. type: "string"
  15981. },
  15982. sort: {
  15983. enum: ["created", "updated"],
  15984. type: "string"
  15985. }
  15986. },
  15987. url: "/repos/:owner/:repo/issues/comments"
  15988. },
  15989. listEvents: {
  15990. method: "GET",
  15991. params: {
  15992. issue_number: {
  15993. required: true,
  15994. type: "integer"
  15995. },
  15996. number: {
  15997. alias: "issue_number",
  15998. deprecated: true,
  15999. type: "integer"
  16000. },
  16001. owner: {
  16002. required: true,
  16003. type: "string"
  16004. },
  16005. page: {
  16006. type: "integer"
  16007. },
  16008. per_page: {
  16009. type: "integer"
  16010. },
  16011. repo: {
  16012. required: true,
  16013. type: "string"
  16014. }
  16015. },
  16016. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16017. },
  16018. listEventsForRepo: {
  16019. method: "GET",
  16020. params: {
  16021. owner: {
  16022. required: true,
  16023. type: "string"
  16024. },
  16025. page: {
  16026. type: "integer"
  16027. },
  16028. per_page: {
  16029. type: "integer"
  16030. },
  16031. repo: {
  16032. required: true,
  16033. type: "string"
  16034. }
  16035. },
  16036. url: "/repos/:owner/:repo/issues/events"
  16037. },
  16038. listEventsForTimeline: {
  16039. headers: {
  16040. accept: "application/vnd.github.mockingbird-preview+json"
  16041. },
  16042. method: "GET",
  16043. params: {
  16044. issue_number: {
  16045. required: true,
  16046. type: "integer"
  16047. },
  16048. number: {
  16049. alias: "issue_number",
  16050. deprecated: true,
  16051. type: "integer"
  16052. },
  16053. owner: {
  16054. required: true,
  16055. type: "string"
  16056. },
  16057. page: {
  16058. type: "integer"
  16059. },
  16060. per_page: {
  16061. type: "integer"
  16062. },
  16063. repo: {
  16064. required: true,
  16065. type: "string"
  16066. }
  16067. },
  16068. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16069. },
  16070. listForAuthenticatedUser: {
  16071. method: "GET",
  16072. params: {
  16073. direction: {
  16074. enum: ["asc", "desc"],
  16075. type: "string"
  16076. },
  16077. filter: {
  16078. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16079. type: "string"
  16080. },
  16081. labels: {
  16082. type: "string"
  16083. },
  16084. page: {
  16085. type: "integer"
  16086. },
  16087. per_page: {
  16088. type: "integer"
  16089. },
  16090. since: {
  16091. type: "string"
  16092. },
  16093. sort: {
  16094. enum: ["created", "updated", "comments"],
  16095. type: "string"
  16096. },
  16097. state: {
  16098. enum: ["open", "closed", "all"],
  16099. type: "string"
  16100. }
  16101. },
  16102. url: "/user/issues"
  16103. },
  16104. listForOrg: {
  16105. method: "GET",
  16106. params: {
  16107. direction: {
  16108. enum: ["asc", "desc"],
  16109. type: "string"
  16110. },
  16111. filter: {
  16112. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16113. type: "string"
  16114. },
  16115. labels: {
  16116. type: "string"
  16117. },
  16118. org: {
  16119. required: true,
  16120. type: "string"
  16121. },
  16122. page: {
  16123. type: "integer"
  16124. },
  16125. per_page: {
  16126. type: "integer"
  16127. },
  16128. since: {
  16129. type: "string"
  16130. },
  16131. sort: {
  16132. enum: ["created", "updated", "comments"],
  16133. type: "string"
  16134. },
  16135. state: {
  16136. enum: ["open", "closed", "all"],
  16137. type: "string"
  16138. }
  16139. },
  16140. url: "/orgs/:org/issues"
  16141. },
  16142. listForRepo: {
  16143. method: "GET",
  16144. params: {
  16145. assignee: {
  16146. type: "string"
  16147. },
  16148. creator: {
  16149. type: "string"
  16150. },
  16151. direction: {
  16152. enum: ["asc", "desc"],
  16153. type: "string"
  16154. },
  16155. labels: {
  16156. type: "string"
  16157. },
  16158. mentioned: {
  16159. type: "string"
  16160. },
  16161. milestone: {
  16162. type: "string"
  16163. },
  16164. owner: {
  16165. required: true,
  16166. type: "string"
  16167. },
  16168. page: {
  16169. type: "integer"
  16170. },
  16171. per_page: {
  16172. type: "integer"
  16173. },
  16174. repo: {
  16175. required: true,
  16176. type: "string"
  16177. },
  16178. since: {
  16179. type: "string"
  16180. },
  16181. sort: {
  16182. enum: ["created", "updated", "comments"],
  16183. type: "string"
  16184. },
  16185. state: {
  16186. enum: ["open", "closed", "all"],
  16187. type: "string"
  16188. }
  16189. },
  16190. url: "/repos/:owner/:repo/issues"
  16191. },
  16192. listLabelsForMilestone: {
  16193. method: "GET",
  16194. params: {
  16195. milestone_number: {
  16196. required: true,
  16197. type: "integer"
  16198. },
  16199. number: {
  16200. alias: "milestone_number",
  16201. deprecated: true,
  16202. type: "integer"
  16203. },
  16204. owner: {
  16205. required: true,
  16206. type: "string"
  16207. },
  16208. page: {
  16209. type: "integer"
  16210. },
  16211. per_page: {
  16212. type: "integer"
  16213. },
  16214. repo: {
  16215. required: true,
  16216. type: "string"
  16217. }
  16218. },
  16219. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16220. },
  16221. listLabelsForRepo: {
  16222. method: "GET",
  16223. params: {
  16224. owner: {
  16225. required: true,
  16226. type: "string"
  16227. },
  16228. page: {
  16229. type: "integer"
  16230. },
  16231. per_page: {
  16232. type: "integer"
  16233. },
  16234. repo: {
  16235. required: true,
  16236. type: "string"
  16237. }
  16238. },
  16239. url: "/repos/:owner/:repo/labels"
  16240. },
  16241. listLabelsOnIssue: {
  16242. method: "GET",
  16243. params: {
  16244. issue_number: {
  16245. required: true,
  16246. type: "integer"
  16247. },
  16248. number: {
  16249. alias: "issue_number",
  16250. deprecated: true,
  16251. type: "integer"
  16252. },
  16253. owner: {
  16254. required: true,
  16255. type: "string"
  16256. },
  16257. page: {
  16258. type: "integer"
  16259. },
  16260. per_page: {
  16261. type: "integer"
  16262. },
  16263. repo: {
  16264. required: true,
  16265. type: "string"
  16266. }
  16267. },
  16268. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16269. },
  16270. listMilestonesForRepo: {
  16271. method: "GET",
  16272. params: {
  16273. direction: {
  16274. enum: ["asc", "desc"],
  16275. type: "string"
  16276. },
  16277. owner: {
  16278. required: true,
  16279. type: "string"
  16280. },
  16281. page: {
  16282. type: "integer"
  16283. },
  16284. per_page: {
  16285. type: "integer"
  16286. },
  16287. repo: {
  16288. required: true,
  16289. type: "string"
  16290. },
  16291. sort: {
  16292. enum: ["due_on", "completeness"],
  16293. type: "string"
  16294. },
  16295. state: {
  16296. enum: ["open", "closed", "all"],
  16297. type: "string"
  16298. }
  16299. },
  16300. url: "/repos/:owner/:repo/milestones"
  16301. },
  16302. lock: {
  16303. method: "PUT",
  16304. params: {
  16305. issue_number: {
  16306. required: true,
  16307. type: "integer"
  16308. },
  16309. lock_reason: {
  16310. enum: ["off-topic", "too heated", "resolved", "spam"],
  16311. type: "string"
  16312. },
  16313. number: {
  16314. alias: "issue_number",
  16315. deprecated: true,
  16316. type: "integer"
  16317. },
  16318. owner: {
  16319. required: true,
  16320. type: "string"
  16321. },
  16322. repo: {
  16323. required: true,
  16324. type: "string"
  16325. }
  16326. },
  16327. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16328. },
  16329. removeAssignees: {
  16330. method: "DELETE",
  16331. params: {
  16332. assignees: {
  16333. type: "string[]"
  16334. },
  16335. issue_number: {
  16336. required: true,
  16337. type: "integer"
  16338. },
  16339. number: {
  16340. alias: "issue_number",
  16341. deprecated: true,
  16342. type: "integer"
  16343. },
  16344. owner: {
  16345. required: true,
  16346. type: "string"
  16347. },
  16348. repo: {
  16349. required: true,
  16350. type: "string"
  16351. }
  16352. },
  16353. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16354. },
  16355. removeLabel: {
  16356. method: "DELETE",
  16357. params: {
  16358. issue_number: {
  16359. required: true,
  16360. type: "integer"
  16361. },
  16362. name: {
  16363. required: true,
  16364. type: "string"
  16365. },
  16366. number: {
  16367. alias: "issue_number",
  16368. deprecated: true,
  16369. type: "integer"
  16370. },
  16371. owner: {
  16372. required: true,
  16373. type: "string"
  16374. },
  16375. repo: {
  16376. required: true,
  16377. type: "string"
  16378. }
  16379. },
  16380. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16381. },
  16382. removeLabels: {
  16383. method: "DELETE",
  16384. params: {
  16385. issue_number: {
  16386. required: true,
  16387. type: "integer"
  16388. },
  16389. number: {
  16390. alias: "issue_number",
  16391. deprecated: true,
  16392. type: "integer"
  16393. },
  16394. owner: {
  16395. required: true,
  16396. type: "string"
  16397. },
  16398. repo: {
  16399. required: true,
  16400. type: "string"
  16401. }
  16402. },
  16403. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16404. },
  16405. replaceLabels: {
  16406. method: "PUT",
  16407. params: {
  16408. issue_number: {
  16409. required: true,
  16410. type: "integer"
  16411. },
  16412. labels: {
  16413. type: "string[]"
  16414. },
  16415. number: {
  16416. alias: "issue_number",
  16417. deprecated: true,
  16418. type: "integer"
  16419. },
  16420. owner: {
  16421. required: true,
  16422. type: "string"
  16423. },
  16424. repo: {
  16425. required: true,
  16426. type: "string"
  16427. }
  16428. },
  16429. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16430. },
  16431. unlock: {
  16432. method: "DELETE",
  16433. params: {
  16434. issue_number: {
  16435. required: true,
  16436. type: "integer"
  16437. },
  16438. number: {
  16439. alias: "issue_number",
  16440. deprecated: true,
  16441. type: "integer"
  16442. },
  16443. owner: {
  16444. required: true,
  16445. type: "string"
  16446. },
  16447. repo: {
  16448. required: true,
  16449. type: "string"
  16450. }
  16451. },
  16452. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16453. },
  16454. update: {
  16455. method: "PATCH",
  16456. params: {
  16457. assignee: {
  16458. type: "string"
  16459. },
  16460. assignees: {
  16461. type: "string[]"
  16462. },
  16463. body: {
  16464. type: "string"
  16465. },
  16466. issue_number: {
  16467. required: true,
  16468. type: "integer"
  16469. },
  16470. labels: {
  16471. type: "string[]"
  16472. },
  16473. milestone: {
  16474. allowNull: true,
  16475. type: "integer"
  16476. },
  16477. number: {
  16478. alias: "issue_number",
  16479. deprecated: true,
  16480. type: "integer"
  16481. },
  16482. owner: {
  16483. required: true,
  16484. type: "string"
  16485. },
  16486. repo: {
  16487. required: true,
  16488. type: "string"
  16489. },
  16490. state: {
  16491. enum: ["open", "closed"],
  16492. type: "string"
  16493. },
  16494. title: {
  16495. type: "string"
  16496. }
  16497. },
  16498. url: "/repos/:owner/:repo/issues/:issue_number"
  16499. },
  16500. updateComment: {
  16501. method: "PATCH",
  16502. params: {
  16503. body: {
  16504. required: true,
  16505. type: "string"
  16506. },
  16507. comment_id: {
  16508. required: true,
  16509. type: "integer"
  16510. },
  16511. owner: {
  16512. required: true,
  16513. type: "string"
  16514. },
  16515. repo: {
  16516. required: true,
  16517. type: "string"
  16518. }
  16519. },
  16520. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16521. },
  16522. updateLabel: {
  16523. method: "PATCH",
  16524. params: {
  16525. color: {
  16526. type: "string"
  16527. },
  16528. current_name: {
  16529. required: true,
  16530. type: "string"
  16531. },
  16532. description: {
  16533. type: "string"
  16534. },
  16535. name: {
  16536. type: "string"
  16537. },
  16538. owner: {
  16539. required: true,
  16540. type: "string"
  16541. },
  16542. repo: {
  16543. required: true,
  16544. type: "string"
  16545. }
  16546. },
  16547. url: "/repos/:owner/:repo/labels/:current_name"
  16548. },
  16549. updateMilestone: {
  16550. method: "PATCH",
  16551. params: {
  16552. description: {
  16553. type: "string"
  16554. },
  16555. due_on: {
  16556. type: "string"
  16557. },
  16558. milestone_number: {
  16559. required: true,
  16560. type: "integer"
  16561. },
  16562. number: {
  16563. alias: "milestone_number",
  16564. deprecated: true,
  16565. type: "integer"
  16566. },
  16567. owner: {
  16568. required: true,
  16569. type: "string"
  16570. },
  16571. repo: {
  16572. required: true,
  16573. type: "string"
  16574. },
  16575. state: {
  16576. enum: ["open", "closed"],
  16577. type: "string"
  16578. },
  16579. title: {
  16580. type: "string"
  16581. }
  16582. },
  16583. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16584. }
  16585. },
  16586. licenses: {
  16587. get: {
  16588. method: "GET",
  16589. params: {
  16590. license: {
  16591. required: true,
  16592. type: "string"
  16593. }
  16594. },
  16595. url: "/licenses/:license"
  16596. },
  16597. getForRepo: {
  16598. method: "GET",
  16599. params: {
  16600. owner: {
  16601. required: true,
  16602. type: "string"
  16603. },
  16604. repo: {
  16605. required: true,
  16606. type: "string"
  16607. }
  16608. },
  16609. url: "/repos/:owner/:repo/license"
  16610. },
  16611. list: {
  16612. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16613. method: "GET",
  16614. params: {},
  16615. url: "/licenses"
  16616. },
  16617. listCommonlyUsed: {
  16618. method: "GET",
  16619. params: {},
  16620. url: "/licenses"
  16621. }
  16622. },
  16623. markdown: {
  16624. render: {
  16625. method: "POST",
  16626. params: {
  16627. context: {
  16628. type: "string"
  16629. },
  16630. mode: {
  16631. enum: ["markdown", "gfm"],
  16632. type: "string"
  16633. },
  16634. text: {
  16635. required: true,
  16636. type: "string"
  16637. }
  16638. },
  16639. url: "/markdown"
  16640. },
  16641. renderRaw: {
  16642. headers: {
  16643. "content-type": "text/plain; charset=utf-8"
  16644. },
  16645. method: "POST",
  16646. params: {
  16647. data: {
  16648. mapTo: "data",
  16649. required: true,
  16650. type: "string"
  16651. }
  16652. },
  16653. url: "/markdown/raw"
  16654. }
  16655. },
  16656. meta: {
  16657. get: {
  16658. method: "GET",
  16659. params: {},
  16660. url: "/meta"
  16661. }
  16662. },
  16663. migrations: {
  16664. cancelImport: {
  16665. method: "DELETE",
  16666. params: {
  16667. owner: {
  16668. required: true,
  16669. type: "string"
  16670. },
  16671. repo: {
  16672. required: true,
  16673. type: "string"
  16674. }
  16675. },
  16676. url: "/repos/:owner/:repo/import"
  16677. },
  16678. deleteArchiveForAuthenticatedUser: {
  16679. headers: {
  16680. accept: "application/vnd.github.wyandotte-preview+json"
  16681. },
  16682. method: "DELETE",
  16683. params: {
  16684. migration_id: {
  16685. required: true,
  16686. type: "integer"
  16687. }
  16688. },
  16689. url: "/user/migrations/:migration_id/archive"
  16690. },
  16691. deleteArchiveForOrg: {
  16692. headers: {
  16693. accept: "application/vnd.github.wyandotte-preview+json"
  16694. },
  16695. method: "DELETE",
  16696. params: {
  16697. migration_id: {
  16698. required: true,
  16699. type: "integer"
  16700. },
  16701. org: {
  16702. required: true,
  16703. type: "string"
  16704. }
  16705. },
  16706. url: "/orgs/:org/migrations/:migration_id/archive"
  16707. },
  16708. downloadArchiveForOrg: {
  16709. headers: {
  16710. accept: "application/vnd.github.wyandotte-preview+json"
  16711. },
  16712. method: "GET",
  16713. params: {
  16714. migration_id: {
  16715. required: true,
  16716. type: "integer"
  16717. },
  16718. org: {
  16719. required: true,
  16720. type: "string"
  16721. }
  16722. },
  16723. url: "/orgs/:org/migrations/:migration_id/archive"
  16724. },
  16725. getArchiveForAuthenticatedUser: {
  16726. headers: {
  16727. accept: "application/vnd.github.wyandotte-preview+json"
  16728. },
  16729. method: "GET",
  16730. params: {
  16731. migration_id: {
  16732. required: true,
  16733. type: "integer"
  16734. }
  16735. },
  16736. url: "/user/migrations/:migration_id/archive"
  16737. },
  16738. getArchiveForOrg: {
  16739. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16740. headers: {
  16741. accept: "application/vnd.github.wyandotte-preview+json"
  16742. },
  16743. method: "GET",
  16744. params: {
  16745. migration_id: {
  16746. required: true,
  16747. type: "integer"
  16748. },
  16749. org: {
  16750. required: true,
  16751. type: "string"
  16752. }
  16753. },
  16754. url: "/orgs/:org/migrations/:migration_id/archive"
  16755. },
  16756. getCommitAuthors: {
  16757. method: "GET",
  16758. params: {
  16759. owner: {
  16760. required: true,
  16761. type: "string"
  16762. },
  16763. repo: {
  16764. required: true,
  16765. type: "string"
  16766. },
  16767. since: {
  16768. type: "string"
  16769. }
  16770. },
  16771. url: "/repos/:owner/:repo/import/authors"
  16772. },
  16773. getImportProgress: {
  16774. method: "GET",
  16775. params: {
  16776. owner: {
  16777. required: true,
  16778. type: "string"
  16779. },
  16780. repo: {
  16781. required: true,
  16782. type: "string"
  16783. }
  16784. },
  16785. url: "/repos/:owner/:repo/import"
  16786. },
  16787. getLargeFiles: {
  16788. method: "GET",
  16789. params: {
  16790. owner: {
  16791. required: true,
  16792. type: "string"
  16793. },
  16794. repo: {
  16795. required: true,
  16796. type: "string"
  16797. }
  16798. },
  16799. url: "/repos/:owner/:repo/import/large_files"
  16800. },
  16801. getStatusForAuthenticatedUser: {
  16802. headers: {
  16803. accept: "application/vnd.github.wyandotte-preview+json"
  16804. },
  16805. method: "GET",
  16806. params: {
  16807. migration_id: {
  16808. required: true,
  16809. type: "integer"
  16810. }
  16811. },
  16812. url: "/user/migrations/:migration_id"
  16813. },
  16814. getStatusForOrg: {
  16815. headers: {
  16816. accept: "application/vnd.github.wyandotte-preview+json"
  16817. },
  16818. method: "GET",
  16819. params: {
  16820. migration_id: {
  16821. required: true,
  16822. type: "integer"
  16823. },
  16824. org: {
  16825. required: true,
  16826. type: "string"
  16827. }
  16828. },
  16829. url: "/orgs/:org/migrations/:migration_id"
  16830. },
  16831. listForAuthenticatedUser: {
  16832. headers: {
  16833. accept: "application/vnd.github.wyandotte-preview+json"
  16834. },
  16835. method: "GET",
  16836. params: {
  16837. page: {
  16838. type: "integer"
  16839. },
  16840. per_page: {
  16841. type: "integer"
  16842. }
  16843. },
  16844. url: "/user/migrations"
  16845. },
  16846. listForOrg: {
  16847. headers: {
  16848. accept: "application/vnd.github.wyandotte-preview+json"
  16849. },
  16850. method: "GET",
  16851. params: {
  16852. org: {
  16853. required: true,
  16854. type: "string"
  16855. },
  16856. page: {
  16857. type: "integer"
  16858. },
  16859. per_page: {
  16860. type: "integer"
  16861. }
  16862. },
  16863. url: "/orgs/:org/migrations"
  16864. },
  16865. listReposForOrg: {
  16866. headers: {
  16867. accept: "application/vnd.github.wyandotte-preview+json"
  16868. },
  16869. method: "GET",
  16870. params: {
  16871. migration_id: {
  16872. required: true,
  16873. type: "integer"
  16874. },
  16875. org: {
  16876. required: true,
  16877. type: "string"
  16878. },
  16879. page: {
  16880. type: "integer"
  16881. },
  16882. per_page: {
  16883. type: "integer"
  16884. }
  16885. },
  16886. url: "/orgs/:org/migrations/:migration_id/repositories"
  16887. },
  16888. listReposForUser: {
  16889. headers: {
  16890. accept: "application/vnd.github.wyandotte-preview+json"
  16891. },
  16892. method: "GET",
  16893. params: {
  16894. migration_id: {
  16895. required: true,
  16896. type: "integer"
  16897. },
  16898. page: {
  16899. type: "integer"
  16900. },
  16901. per_page: {
  16902. type: "integer"
  16903. }
  16904. },
  16905. url: "/user/:migration_id/repositories"
  16906. },
  16907. mapCommitAuthor: {
  16908. method: "PATCH",
  16909. params: {
  16910. author_id: {
  16911. required: true,
  16912. type: "integer"
  16913. },
  16914. email: {
  16915. type: "string"
  16916. },
  16917. name: {
  16918. type: "string"
  16919. },
  16920. owner: {
  16921. required: true,
  16922. type: "string"
  16923. },
  16924. repo: {
  16925. required: true,
  16926. type: "string"
  16927. }
  16928. },
  16929. url: "/repos/:owner/:repo/import/authors/:author_id"
  16930. },
  16931. setLfsPreference: {
  16932. method: "PATCH",
  16933. params: {
  16934. owner: {
  16935. required: true,
  16936. type: "string"
  16937. },
  16938. repo: {
  16939. required: true,
  16940. type: "string"
  16941. },
  16942. use_lfs: {
  16943. enum: ["opt_in", "opt_out"],
  16944. required: true,
  16945. type: "string"
  16946. }
  16947. },
  16948. url: "/repos/:owner/:repo/import/lfs"
  16949. },
  16950. startForAuthenticatedUser: {
  16951. method: "POST",
  16952. params: {
  16953. exclude_attachments: {
  16954. type: "boolean"
  16955. },
  16956. lock_repositories: {
  16957. type: "boolean"
  16958. },
  16959. repositories: {
  16960. required: true,
  16961. type: "string[]"
  16962. }
  16963. },
  16964. url: "/user/migrations"
  16965. },
  16966. startForOrg: {
  16967. method: "POST",
  16968. params: {
  16969. exclude_attachments: {
  16970. type: "boolean"
  16971. },
  16972. lock_repositories: {
  16973. type: "boolean"
  16974. },
  16975. org: {
  16976. required: true,
  16977. type: "string"
  16978. },
  16979. repositories: {
  16980. required: true,
  16981. type: "string[]"
  16982. }
  16983. },
  16984. url: "/orgs/:org/migrations"
  16985. },
  16986. startImport: {
  16987. method: "PUT",
  16988. params: {
  16989. owner: {
  16990. required: true,
  16991. type: "string"
  16992. },
  16993. repo: {
  16994. required: true,
  16995. type: "string"
  16996. },
  16997. tfvc_project: {
  16998. type: "string"
  16999. },
  17000. vcs: {
  17001. enum: ["subversion", "git", "mercurial", "tfvc"],
  17002. type: "string"
  17003. },
  17004. vcs_password: {
  17005. type: "string"
  17006. },
  17007. vcs_url: {
  17008. required: true,
  17009. type: "string"
  17010. },
  17011. vcs_username: {
  17012. type: "string"
  17013. }
  17014. },
  17015. url: "/repos/:owner/:repo/import"
  17016. },
  17017. unlockRepoForAuthenticatedUser: {
  17018. headers: {
  17019. accept: "application/vnd.github.wyandotte-preview+json"
  17020. },
  17021. method: "DELETE",
  17022. params: {
  17023. migration_id: {
  17024. required: true,
  17025. type: "integer"
  17026. },
  17027. repo_name: {
  17028. required: true,
  17029. type: "string"
  17030. }
  17031. },
  17032. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17033. },
  17034. unlockRepoForOrg: {
  17035. headers: {
  17036. accept: "application/vnd.github.wyandotte-preview+json"
  17037. },
  17038. method: "DELETE",
  17039. params: {
  17040. migration_id: {
  17041. required: true,
  17042. type: "integer"
  17043. },
  17044. org: {
  17045. required: true,
  17046. type: "string"
  17047. },
  17048. repo_name: {
  17049. required: true,
  17050. type: "string"
  17051. }
  17052. },
  17053. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17054. },
  17055. updateImport: {
  17056. method: "PATCH",
  17057. params: {
  17058. owner: {
  17059. required: true,
  17060. type: "string"
  17061. },
  17062. repo: {
  17063. required: true,
  17064. type: "string"
  17065. },
  17066. vcs_password: {
  17067. type: "string"
  17068. },
  17069. vcs_username: {
  17070. type: "string"
  17071. }
  17072. },
  17073. url: "/repos/:owner/:repo/import"
  17074. }
  17075. },
  17076. oauthAuthorizations: {
  17077. checkAuthorization: {
  17078. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17079. method: "GET",
  17080. params: {
  17081. access_token: {
  17082. required: true,
  17083. type: "string"
  17084. },
  17085. client_id: {
  17086. required: true,
  17087. type: "string"
  17088. }
  17089. },
  17090. url: "/applications/:client_id/tokens/:access_token"
  17091. },
  17092. createAuthorization: {
  17093. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17094. method: "POST",
  17095. params: {
  17096. client_id: {
  17097. type: "string"
  17098. },
  17099. client_secret: {
  17100. type: "string"
  17101. },
  17102. fingerprint: {
  17103. type: "string"
  17104. },
  17105. note: {
  17106. required: true,
  17107. type: "string"
  17108. },
  17109. note_url: {
  17110. type: "string"
  17111. },
  17112. scopes: {
  17113. type: "string[]"
  17114. }
  17115. },
  17116. url: "/authorizations"
  17117. },
  17118. deleteAuthorization: {
  17119. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17120. method: "DELETE",
  17121. params: {
  17122. authorization_id: {
  17123. required: true,
  17124. type: "integer"
  17125. }
  17126. },
  17127. url: "/authorizations/:authorization_id"
  17128. },
  17129. deleteGrant: {
  17130. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17131. method: "DELETE",
  17132. params: {
  17133. grant_id: {
  17134. required: true,
  17135. type: "integer"
  17136. }
  17137. },
  17138. url: "/applications/grants/:grant_id"
  17139. },
  17140. getAuthorization: {
  17141. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17142. method: "GET",
  17143. params: {
  17144. authorization_id: {
  17145. required: true,
  17146. type: "integer"
  17147. }
  17148. },
  17149. url: "/authorizations/:authorization_id"
  17150. },
  17151. getGrant: {
  17152. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17153. method: "GET",
  17154. params: {
  17155. grant_id: {
  17156. required: true,
  17157. type: "integer"
  17158. }
  17159. },
  17160. url: "/applications/grants/:grant_id"
  17161. },
  17162. getOrCreateAuthorizationForApp: {
  17163. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17164. method: "PUT",
  17165. params: {
  17166. client_id: {
  17167. required: true,
  17168. type: "string"
  17169. },
  17170. client_secret: {
  17171. required: true,
  17172. type: "string"
  17173. },
  17174. fingerprint: {
  17175. type: "string"
  17176. },
  17177. note: {
  17178. type: "string"
  17179. },
  17180. note_url: {
  17181. type: "string"
  17182. },
  17183. scopes: {
  17184. type: "string[]"
  17185. }
  17186. },
  17187. url: "/authorizations/clients/:client_id"
  17188. },
  17189. getOrCreateAuthorizationForAppAndFingerprint: {
  17190. 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",
  17191. method: "PUT",
  17192. params: {
  17193. client_id: {
  17194. required: true,
  17195. type: "string"
  17196. },
  17197. client_secret: {
  17198. required: true,
  17199. type: "string"
  17200. },
  17201. fingerprint: {
  17202. required: true,
  17203. type: "string"
  17204. },
  17205. note: {
  17206. type: "string"
  17207. },
  17208. note_url: {
  17209. type: "string"
  17210. },
  17211. scopes: {
  17212. type: "string[]"
  17213. }
  17214. },
  17215. url: "/authorizations/clients/:client_id/:fingerprint"
  17216. },
  17217. getOrCreateAuthorizationForAppFingerprint: {
  17218. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17219. method: "PUT",
  17220. params: {
  17221. client_id: {
  17222. required: true,
  17223. type: "string"
  17224. },
  17225. client_secret: {
  17226. required: true,
  17227. type: "string"
  17228. },
  17229. fingerprint: {
  17230. required: true,
  17231. type: "string"
  17232. },
  17233. note: {
  17234. type: "string"
  17235. },
  17236. note_url: {
  17237. type: "string"
  17238. },
  17239. scopes: {
  17240. type: "string[]"
  17241. }
  17242. },
  17243. url: "/authorizations/clients/:client_id/:fingerprint"
  17244. },
  17245. listAuthorizations: {
  17246. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17247. method: "GET",
  17248. params: {
  17249. page: {
  17250. type: "integer"
  17251. },
  17252. per_page: {
  17253. type: "integer"
  17254. }
  17255. },
  17256. url: "/authorizations"
  17257. },
  17258. listGrants: {
  17259. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17260. method: "GET",
  17261. params: {
  17262. page: {
  17263. type: "integer"
  17264. },
  17265. per_page: {
  17266. type: "integer"
  17267. }
  17268. },
  17269. url: "/applications/grants"
  17270. },
  17271. resetAuthorization: {
  17272. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17273. method: "POST",
  17274. params: {
  17275. access_token: {
  17276. required: true,
  17277. type: "string"
  17278. },
  17279. client_id: {
  17280. required: true,
  17281. type: "string"
  17282. }
  17283. },
  17284. url: "/applications/:client_id/tokens/:access_token"
  17285. },
  17286. revokeAuthorizationForApplication: {
  17287. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17288. method: "DELETE",
  17289. params: {
  17290. access_token: {
  17291. required: true,
  17292. type: "string"
  17293. },
  17294. client_id: {
  17295. required: true,
  17296. type: "string"
  17297. }
  17298. },
  17299. url: "/applications/:client_id/tokens/:access_token"
  17300. },
  17301. revokeGrantForApplication: {
  17302. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17303. method: "DELETE",
  17304. params: {
  17305. access_token: {
  17306. required: true,
  17307. type: "string"
  17308. },
  17309. client_id: {
  17310. required: true,
  17311. type: "string"
  17312. }
  17313. },
  17314. url: "/applications/:client_id/grants/:access_token"
  17315. },
  17316. updateAuthorization: {
  17317. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17318. method: "PATCH",
  17319. params: {
  17320. add_scopes: {
  17321. type: "string[]"
  17322. },
  17323. authorization_id: {
  17324. required: true,
  17325. type: "integer"
  17326. },
  17327. fingerprint: {
  17328. type: "string"
  17329. },
  17330. note: {
  17331. type: "string"
  17332. },
  17333. note_url: {
  17334. type: "string"
  17335. },
  17336. remove_scopes: {
  17337. type: "string[]"
  17338. },
  17339. scopes: {
  17340. type: "string[]"
  17341. }
  17342. },
  17343. url: "/authorizations/:authorization_id"
  17344. }
  17345. },
  17346. orgs: {
  17347. addOrUpdateMembership: {
  17348. method: "PUT",
  17349. params: {
  17350. org: {
  17351. required: true,
  17352. type: "string"
  17353. },
  17354. role: {
  17355. enum: ["admin", "member"],
  17356. type: "string"
  17357. },
  17358. username: {
  17359. required: true,
  17360. type: "string"
  17361. }
  17362. },
  17363. url: "/orgs/:org/memberships/:username"
  17364. },
  17365. blockUser: {
  17366. method: "PUT",
  17367. params: {
  17368. org: {
  17369. required: true,
  17370. type: "string"
  17371. },
  17372. username: {
  17373. required: true,
  17374. type: "string"
  17375. }
  17376. },
  17377. url: "/orgs/:org/blocks/:username"
  17378. },
  17379. checkBlockedUser: {
  17380. method: "GET",
  17381. params: {
  17382. org: {
  17383. required: true,
  17384. type: "string"
  17385. },
  17386. username: {
  17387. required: true,
  17388. type: "string"
  17389. }
  17390. },
  17391. url: "/orgs/:org/blocks/:username"
  17392. },
  17393. checkMembership: {
  17394. method: "GET",
  17395. params: {
  17396. org: {
  17397. required: true,
  17398. type: "string"
  17399. },
  17400. username: {
  17401. required: true,
  17402. type: "string"
  17403. }
  17404. },
  17405. url: "/orgs/:org/members/:username"
  17406. },
  17407. checkPublicMembership: {
  17408. method: "GET",
  17409. params: {
  17410. org: {
  17411. required: true,
  17412. type: "string"
  17413. },
  17414. username: {
  17415. required: true,
  17416. type: "string"
  17417. }
  17418. },
  17419. url: "/orgs/:org/public_members/:username"
  17420. },
  17421. concealMembership: {
  17422. method: "DELETE",
  17423. params: {
  17424. org: {
  17425. required: true,
  17426. type: "string"
  17427. },
  17428. username: {
  17429. required: true,
  17430. type: "string"
  17431. }
  17432. },
  17433. url: "/orgs/:org/public_members/:username"
  17434. },
  17435. convertMemberToOutsideCollaborator: {
  17436. method: "PUT",
  17437. params: {
  17438. org: {
  17439. required: true,
  17440. type: "string"
  17441. },
  17442. username: {
  17443. required: true,
  17444. type: "string"
  17445. }
  17446. },
  17447. url: "/orgs/:org/outside_collaborators/:username"
  17448. },
  17449. createHook: {
  17450. method: "POST",
  17451. params: {
  17452. active: {
  17453. type: "boolean"
  17454. },
  17455. config: {
  17456. required: true,
  17457. type: "object"
  17458. },
  17459. "config.content_type": {
  17460. type: "string"
  17461. },
  17462. "config.insecure_ssl": {
  17463. type: "string"
  17464. },
  17465. "config.secret": {
  17466. type: "string"
  17467. },
  17468. "config.url": {
  17469. required: true,
  17470. type: "string"
  17471. },
  17472. events: {
  17473. type: "string[]"
  17474. },
  17475. name: {
  17476. required: true,
  17477. type: "string"
  17478. },
  17479. org: {
  17480. required: true,
  17481. type: "string"
  17482. }
  17483. },
  17484. url: "/orgs/:org/hooks"
  17485. },
  17486. createInvitation: {
  17487. method: "POST",
  17488. params: {
  17489. email: {
  17490. type: "string"
  17491. },
  17492. invitee_id: {
  17493. type: "integer"
  17494. },
  17495. org: {
  17496. required: true,
  17497. type: "string"
  17498. },
  17499. role: {
  17500. enum: ["admin", "direct_member", "billing_manager"],
  17501. type: "string"
  17502. },
  17503. team_ids: {
  17504. type: "integer[]"
  17505. }
  17506. },
  17507. url: "/orgs/:org/invitations"
  17508. },
  17509. deleteHook: {
  17510. method: "DELETE",
  17511. params: {
  17512. hook_id: {
  17513. required: true,
  17514. type: "integer"
  17515. },
  17516. org: {
  17517. required: true,
  17518. type: "string"
  17519. }
  17520. },
  17521. url: "/orgs/:org/hooks/:hook_id"
  17522. },
  17523. get: {
  17524. method: "GET",
  17525. params: {
  17526. org: {
  17527. required: true,
  17528. type: "string"
  17529. }
  17530. },
  17531. url: "/orgs/:org"
  17532. },
  17533. getHook: {
  17534. method: "GET",
  17535. params: {
  17536. hook_id: {
  17537. required: true,
  17538. type: "integer"
  17539. },
  17540. org: {
  17541. required: true,
  17542. type: "string"
  17543. }
  17544. },
  17545. url: "/orgs/:org/hooks/:hook_id"
  17546. },
  17547. getMembership: {
  17548. method: "GET",
  17549. params: {
  17550. org: {
  17551. required: true,
  17552. type: "string"
  17553. },
  17554. username: {
  17555. required: true,
  17556. type: "string"
  17557. }
  17558. },
  17559. url: "/orgs/:org/memberships/:username"
  17560. },
  17561. getMembershipForAuthenticatedUser: {
  17562. method: "GET",
  17563. params: {
  17564. org: {
  17565. required: true,
  17566. type: "string"
  17567. }
  17568. },
  17569. url: "/user/memberships/orgs/:org"
  17570. },
  17571. list: {
  17572. method: "GET",
  17573. params: {
  17574. page: {
  17575. type: "integer"
  17576. },
  17577. per_page: {
  17578. type: "integer"
  17579. },
  17580. since: {
  17581. type: "integer"
  17582. }
  17583. },
  17584. url: "/organizations"
  17585. },
  17586. listBlockedUsers: {
  17587. method: "GET",
  17588. params: {
  17589. org: {
  17590. required: true,
  17591. type: "string"
  17592. }
  17593. },
  17594. url: "/orgs/:org/blocks"
  17595. },
  17596. listForAuthenticatedUser: {
  17597. method: "GET",
  17598. params: {
  17599. page: {
  17600. type: "integer"
  17601. },
  17602. per_page: {
  17603. type: "integer"
  17604. }
  17605. },
  17606. url: "/user/orgs"
  17607. },
  17608. listForUser: {
  17609. method: "GET",
  17610. params: {
  17611. page: {
  17612. type: "integer"
  17613. },
  17614. per_page: {
  17615. type: "integer"
  17616. },
  17617. username: {
  17618. required: true,
  17619. type: "string"
  17620. }
  17621. },
  17622. url: "/users/:username/orgs"
  17623. },
  17624. listHooks: {
  17625. method: "GET",
  17626. params: {
  17627. org: {
  17628. required: true,
  17629. type: "string"
  17630. },
  17631. page: {
  17632. type: "integer"
  17633. },
  17634. per_page: {
  17635. type: "integer"
  17636. }
  17637. },
  17638. url: "/orgs/:org/hooks"
  17639. },
  17640. listInstallations: {
  17641. headers: {
  17642. accept: "application/vnd.github.machine-man-preview+json"
  17643. },
  17644. method: "GET",
  17645. params: {
  17646. org: {
  17647. required: true,
  17648. type: "string"
  17649. },
  17650. page: {
  17651. type: "integer"
  17652. },
  17653. per_page: {
  17654. type: "integer"
  17655. }
  17656. },
  17657. url: "/orgs/:org/installations"
  17658. },
  17659. listInvitationTeams: {
  17660. method: "GET",
  17661. params: {
  17662. invitation_id: {
  17663. required: true,
  17664. type: "integer"
  17665. },
  17666. org: {
  17667. required: true,
  17668. type: "string"
  17669. },
  17670. page: {
  17671. type: "integer"
  17672. },
  17673. per_page: {
  17674. type: "integer"
  17675. }
  17676. },
  17677. url: "/orgs/:org/invitations/:invitation_id/teams"
  17678. },
  17679. listMembers: {
  17680. method: "GET",
  17681. params: {
  17682. filter: {
  17683. enum: ["2fa_disabled", "all"],
  17684. type: "string"
  17685. },
  17686. org: {
  17687. required: true,
  17688. type: "string"
  17689. },
  17690. page: {
  17691. type: "integer"
  17692. },
  17693. per_page: {
  17694. type: "integer"
  17695. },
  17696. role: {
  17697. enum: ["all", "admin", "member"],
  17698. type: "string"
  17699. }
  17700. },
  17701. url: "/orgs/:org/members"
  17702. },
  17703. listMemberships: {
  17704. method: "GET",
  17705. params: {
  17706. page: {
  17707. type: "integer"
  17708. },
  17709. per_page: {
  17710. type: "integer"
  17711. },
  17712. state: {
  17713. enum: ["active", "pending"],
  17714. type: "string"
  17715. }
  17716. },
  17717. url: "/user/memberships/orgs"
  17718. },
  17719. listOutsideCollaborators: {
  17720. method: "GET",
  17721. params: {
  17722. filter: {
  17723. enum: ["2fa_disabled", "all"],
  17724. type: "string"
  17725. },
  17726. org: {
  17727. required: true,
  17728. type: "string"
  17729. },
  17730. page: {
  17731. type: "integer"
  17732. },
  17733. per_page: {
  17734. type: "integer"
  17735. }
  17736. },
  17737. url: "/orgs/:org/outside_collaborators"
  17738. },
  17739. listPendingInvitations: {
  17740. method: "GET",
  17741. params: {
  17742. org: {
  17743. required: true,
  17744. type: "string"
  17745. },
  17746. page: {
  17747. type: "integer"
  17748. },
  17749. per_page: {
  17750. type: "integer"
  17751. }
  17752. },
  17753. url: "/orgs/:org/invitations"
  17754. },
  17755. listPublicMembers: {
  17756. method: "GET",
  17757. params: {
  17758. org: {
  17759. required: true,
  17760. type: "string"
  17761. },
  17762. page: {
  17763. type: "integer"
  17764. },
  17765. per_page: {
  17766. type: "integer"
  17767. }
  17768. },
  17769. url: "/orgs/:org/public_members"
  17770. },
  17771. pingHook: {
  17772. method: "POST",
  17773. params: {
  17774. hook_id: {
  17775. required: true,
  17776. type: "integer"
  17777. },
  17778. org: {
  17779. required: true,
  17780. type: "string"
  17781. }
  17782. },
  17783. url: "/orgs/:org/hooks/:hook_id/pings"
  17784. },
  17785. publicizeMembership: {
  17786. method: "PUT",
  17787. params: {
  17788. org: {
  17789. required: true,
  17790. type: "string"
  17791. },
  17792. username: {
  17793. required: true,
  17794. type: "string"
  17795. }
  17796. },
  17797. url: "/orgs/:org/public_members/:username"
  17798. },
  17799. removeMember: {
  17800. method: "DELETE",
  17801. params: {
  17802. org: {
  17803. required: true,
  17804. type: "string"
  17805. },
  17806. username: {
  17807. required: true,
  17808. type: "string"
  17809. }
  17810. },
  17811. url: "/orgs/:org/members/:username"
  17812. },
  17813. removeMembership: {
  17814. method: "DELETE",
  17815. params: {
  17816. org: {
  17817. required: true,
  17818. type: "string"
  17819. },
  17820. username: {
  17821. required: true,
  17822. type: "string"
  17823. }
  17824. },
  17825. url: "/orgs/:org/memberships/:username"
  17826. },
  17827. removeOutsideCollaborator: {
  17828. method: "DELETE",
  17829. params: {
  17830. org: {
  17831. required: true,
  17832. type: "string"
  17833. },
  17834. username: {
  17835. required: true,
  17836. type: "string"
  17837. }
  17838. },
  17839. url: "/orgs/:org/outside_collaborators/:username"
  17840. },
  17841. unblockUser: {
  17842. method: "DELETE",
  17843. params: {
  17844. org: {
  17845. required: true,
  17846. type: "string"
  17847. },
  17848. username: {
  17849. required: true,
  17850. type: "string"
  17851. }
  17852. },
  17853. url: "/orgs/:org/blocks/:username"
  17854. },
  17855. update: {
  17856. method: "PATCH",
  17857. params: {
  17858. billing_email: {
  17859. type: "string"
  17860. },
  17861. company: {
  17862. type: "string"
  17863. },
  17864. default_repository_permission: {
  17865. enum: ["read", "write", "admin", "none"],
  17866. type: "string"
  17867. },
  17868. description: {
  17869. type: "string"
  17870. },
  17871. email: {
  17872. type: "string"
  17873. },
  17874. has_organization_projects: {
  17875. type: "boolean"
  17876. },
  17877. has_repository_projects: {
  17878. type: "boolean"
  17879. },
  17880. location: {
  17881. type: "string"
  17882. },
  17883. members_allowed_repository_creation_type: {
  17884. enum: ["all", "private", "none"],
  17885. type: "string"
  17886. },
  17887. members_can_create_internal_repositories: {
  17888. type: "boolean"
  17889. },
  17890. members_can_create_private_repositories: {
  17891. type: "boolean"
  17892. },
  17893. members_can_create_public_repositories: {
  17894. type: "boolean"
  17895. },
  17896. members_can_create_repositories: {
  17897. type: "boolean"
  17898. },
  17899. name: {
  17900. type: "string"
  17901. },
  17902. org: {
  17903. required: true,
  17904. type: "string"
  17905. }
  17906. },
  17907. url: "/orgs/:org"
  17908. },
  17909. updateHook: {
  17910. method: "PATCH",
  17911. params: {
  17912. active: {
  17913. type: "boolean"
  17914. },
  17915. config: {
  17916. type: "object"
  17917. },
  17918. "config.content_type": {
  17919. type: "string"
  17920. },
  17921. "config.insecure_ssl": {
  17922. type: "string"
  17923. },
  17924. "config.secret": {
  17925. type: "string"
  17926. },
  17927. "config.url": {
  17928. required: true,
  17929. type: "string"
  17930. },
  17931. events: {
  17932. type: "string[]"
  17933. },
  17934. hook_id: {
  17935. required: true,
  17936. type: "integer"
  17937. },
  17938. org: {
  17939. required: true,
  17940. type: "string"
  17941. }
  17942. },
  17943. url: "/orgs/:org/hooks/:hook_id"
  17944. },
  17945. updateMembership: {
  17946. method: "PATCH",
  17947. params: {
  17948. org: {
  17949. required: true,
  17950. type: "string"
  17951. },
  17952. state: {
  17953. enum: ["active"],
  17954. required: true,
  17955. type: "string"
  17956. }
  17957. },
  17958. url: "/user/memberships/orgs/:org"
  17959. }
  17960. },
  17961. projects: {
  17962. addCollaborator: {
  17963. headers: {
  17964. accept: "application/vnd.github.inertia-preview+json"
  17965. },
  17966. method: "PUT",
  17967. params: {
  17968. permission: {
  17969. enum: ["read", "write", "admin"],
  17970. type: "string"
  17971. },
  17972. project_id: {
  17973. required: true,
  17974. type: "integer"
  17975. },
  17976. username: {
  17977. required: true,
  17978. type: "string"
  17979. }
  17980. },
  17981. url: "/projects/:project_id/collaborators/:username"
  17982. },
  17983. createCard: {
  17984. headers: {
  17985. accept: "application/vnd.github.inertia-preview+json"
  17986. },
  17987. method: "POST",
  17988. params: {
  17989. column_id: {
  17990. required: true,
  17991. type: "integer"
  17992. },
  17993. content_id: {
  17994. type: "integer"
  17995. },
  17996. content_type: {
  17997. type: "string"
  17998. },
  17999. note: {
  18000. type: "string"
  18001. }
  18002. },
  18003. url: "/projects/columns/:column_id/cards"
  18004. },
  18005. createColumn: {
  18006. headers: {
  18007. accept: "application/vnd.github.inertia-preview+json"
  18008. },
  18009. method: "POST",
  18010. params: {
  18011. name: {
  18012. required: true,
  18013. type: "string"
  18014. },
  18015. project_id: {
  18016. required: true,
  18017. type: "integer"
  18018. }
  18019. },
  18020. url: "/projects/:project_id/columns"
  18021. },
  18022. createForAuthenticatedUser: {
  18023. headers: {
  18024. accept: "application/vnd.github.inertia-preview+json"
  18025. },
  18026. method: "POST",
  18027. params: {
  18028. body: {
  18029. type: "string"
  18030. },
  18031. name: {
  18032. required: true,
  18033. type: "string"
  18034. }
  18035. },
  18036. url: "/user/projects"
  18037. },
  18038. createForOrg: {
  18039. headers: {
  18040. accept: "application/vnd.github.inertia-preview+json"
  18041. },
  18042. method: "POST",
  18043. params: {
  18044. body: {
  18045. type: "string"
  18046. },
  18047. name: {
  18048. required: true,
  18049. type: "string"
  18050. },
  18051. org: {
  18052. required: true,
  18053. type: "string"
  18054. }
  18055. },
  18056. url: "/orgs/:org/projects"
  18057. },
  18058. createForRepo: {
  18059. headers: {
  18060. accept: "application/vnd.github.inertia-preview+json"
  18061. },
  18062. method: "POST",
  18063. params: {
  18064. body: {
  18065. type: "string"
  18066. },
  18067. name: {
  18068. required: true,
  18069. type: "string"
  18070. },
  18071. owner: {
  18072. required: true,
  18073. type: "string"
  18074. },
  18075. repo: {
  18076. required: true,
  18077. type: "string"
  18078. }
  18079. },
  18080. url: "/repos/:owner/:repo/projects"
  18081. },
  18082. delete: {
  18083. headers: {
  18084. accept: "application/vnd.github.inertia-preview+json"
  18085. },
  18086. method: "DELETE",
  18087. params: {
  18088. project_id: {
  18089. required: true,
  18090. type: "integer"
  18091. }
  18092. },
  18093. url: "/projects/:project_id"
  18094. },
  18095. deleteCard: {
  18096. headers: {
  18097. accept: "application/vnd.github.inertia-preview+json"
  18098. },
  18099. method: "DELETE",
  18100. params: {
  18101. card_id: {
  18102. required: true,
  18103. type: "integer"
  18104. }
  18105. },
  18106. url: "/projects/columns/cards/:card_id"
  18107. },
  18108. deleteColumn: {
  18109. headers: {
  18110. accept: "application/vnd.github.inertia-preview+json"
  18111. },
  18112. method: "DELETE",
  18113. params: {
  18114. column_id: {
  18115. required: true,
  18116. type: "integer"
  18117. }
  18118. },
  18119. url: "/projects/columns/:column_id"
  18120. },
  18121. get: {
  18122. headers: {
  18123. accept: "application/vnd.github.inertia-preview+json"
  18124. },
  18125. method: "GET",
  18126. params: {
  18127. project_id: {
  18128. required: true,
  18129. type: "integer"
  18130. }
  18131. },
  18132. url: "/projects/:project_id"
  18133. },
  18134. getCard: {
  18135. headers: {
  18136. accept: "application/vnd.github.inertia-preview+json"
  18137. },
  18138. method: "GET",
  18139. params: {
  18140. card_id: {
  18141. required: true,
  18142. type: "integer"
  18143. }
  18144. },
  18145. url: "/projects/columns/cards/:card_id"
  18146. },
  18147. getColumn: {
  18148. headers: {
  18149. accept: "application/vnd.github.inertia-preview+json"
  18150. },
  18151. method: "GET",
  18152. params: {
  18153. column_id: {
  18154. required: true,
  18155. type: "integer"
  18156. }
  18157. },
  18158. url: "/projects/columns/:column_id"
  18159. },
  18160. listCards: {
  18161. headers: {
  18162. accept: "application/vnd.github.inertia-preview+json"
  18163. },
  18164. method: "GET",
  18165. params: {
  18166. archived_state: {
  18167. enum: ["all", "archived", "not_archived"],
  18168. type: "string"
  18169. },
  18170. column_id: {
  18171. required: true,
  18172. type: "integer"
  18173. },
  18174. page: {
  18175. type: "integer"
  18176. },
  18177. per_page: {
  18178. type: "integer"
  18179. }
  18180. },
  18181. url: "/projects/columns/:column_id/cards"
  18182. },
  18183. listCollaborators: {
  18184. headers: {
  18185. accept: "application/vnd.github.inertia-preview+json"
  18186. },
  18187. method: "GET",
  18188. params: {
  18189. affiliation: {
  18190. enum: ["outside", "direct", "all"],
  18191. type: "string"
  18192. },
  18193. page: {
  18194. type: "integer"
  18195. },
  18196. per_page: {
  18197. type: "integer"
  18198. },
  18199. project_id: {
  18200. required: true,
  18201. type: "integer"
  18202. }
  18203. },
  18204. url: "/projects/:project_id/collaborators"
  18205. },
  18206. listColumns: {
  18207. headers: {
  18208. accept: "application/vnd.github.inertia-preview+json"
  18209. },
  18210. method: "GET",
  18211. params: {
  18212. page: {
  18213. type: "integer"
  18214. },
  18215. per_page: {
  18216. type: "integer"
  18217. },
  18218. project_id: {
  18219. required: true,
  18220. type: "integer"
  18221. }
  18222. },
  18223. url: "/projects/:project_id/columns"
  18224. },
  18225. listForOrg: {
  18226. headers: {
  18227. accept: "application/vnd.github.inertia-preview+json"
  18228. },
  18229. method: "GET",
  18230. params: {
  18231. org: {
  18232. required: true,
  18233. type: "string"
  18234. },
  18235. page: {
  18236. type: "integer"
  18237. },
  18238. per_page: {
  18239. type: "integer"
  18240. },
  18241. state: {
  18242. enum: ["open", "closed", "all"],
  18243. type: "string"
  18244. }
  18245. },
  18246. url: "/orgs/:org/projects"
  18247. },
  18248. listForRepo: {
  18249. headers: {
  18250. accept: "application/vnd.github.inertia-preview+json"
  18251. },
  18252. method: "GET",
  18253. params: {
  18254. owner: {
  18255. required: true,
  18256. type: "string"
  18257. },
  18258. page: {
  18259. type: "integer"
  18260. },
  18261. per_page: {
  18262. type: "integer"
  18263. },
  18264. repo: {
  18265. required: true,
  18266. type: "string"
  18267. },
  18268. state: {
  18269. enum: ["open", "closed", "all"],
  18270. type: "string"
  18271. }
  18272. },
  18273. url: "/repos/:owner/:repo/projects"
  18274. },
  18275. listForUser: {
  18276. headers: {
  18277. accept: "application/vnd.github.inertia-preview+json"
  18278. },
  18279. method: "GET",
  18280. params: {
  18281. page: {
  18282. type: "integer"
  18283. },
  18284. per_page: {
  18285. type: "integer"
  18286. },
  18287. state: {
  18288. enum: ["open", "closed", "all"],
  18289. type: "string"
  18290. },
  18291. username: {
  18292. required: true,
  18293. type: "string"
  18294. }
  18295. },
  18296. url: "/users/:username/projects"
  18297. },
  18298. moveCard: {
  18299. headers: {
  18300. accept: "application/vnd.github.inertia-preview+json"
  18301. },
  18302. method: "POST",
  18303. params: {
  18304. card_id: {
  18305. required: true,
  18306. type: "integer"
  18307. },
  18308. column_id: {
  18309. type: "integer"
  18310. },
  18311. position: {
  18312. required: true,
  18313. type: "string",
  18314. validation: "^(top|bottom|after:\\d+)$"
  18315. }
  18316. },
  18317. url: "/projects/columns/cards/:card_id/moves"
  18318. },
  18319. moveColumn: {
  18320. headers: {
  18321. accept: "application/vnd.github.inertia-preview+json"
  18322. },
  18323. method: "POST",
  18324. params: {
  18325. column_id: {
  18326. required: true,
  18327. type: "integer"
  18328. },
  18329. position: {
  18330. required: true,
  18331. type: "string",
  18332. validation: "^(first|last|after:\\d+)$"
  18333. }
  18334. },
  18335. url: "/projects/columns/:column_id/moves"
  18336. },
  18337. removeCollaborator: {
  18338. headers: {
  18339. accept: "application/vnd.github.inertia-preview+json"
  18340. },
  18341. method: "DELETE",
  18342. params: {
  18343. project_id: {
  18344. required: true,
  18345. type: "integer"
  18346. },
  18347. username: {
  18348. required: true,
  18349. type: "string"
  18350. }
  18351. },
  18352. url: "/projects/:project_id/collaborators/:username"
  18353. },
  18354. reviewUserPermissionLevel: {
  18355. headers: {
  18356. accept: "application/vnd.github.inertia-preview+json"
  18357. },
  18358. method: "GET",
  18359. params: {
  18360. project_id: {
  18361. required: true,
  18362. type: "integer"
  18363. },
  18364. username: {
  18365. required: true,
  18366. type: "string"
  18367. }
  18368. },
  18369. url: "/projects/:project_id/collaborators/:username/permission"
  18370. },
  18371. update: {
  18372. headers: {
  18373. accept: "application/vnd.github.inertia-preview+json"
  18374. },
  18375. method: "PATCH",
  18376. params: {
  18377. body: {
  18378. type: "string"
  18379. },
  18380. name: {
  18381. type: "string"
  18382. },
  18383. organization_permission: {
  18384. type: "string"
  18385. },
  18386. private: {
  18387. type: "boolean"
  18388. },
  18389. project_id: {
  18390. required: true,
  18391. type: "integer"
  18392. },
  18393. state: {
  18394. enum: ["open", "closed"],
  18395. type: "string"
  18396. }
  18397. },
  18398. url: "/projects/:project_id"
  18399. },
  18400. updateCard: {
  18401. headers: {
  18402. accept: "application/vnd.github.inertia-preview+json"
  18403. },
  18404. method: "PATCH",
  18405. params: {
  18406. archived: {
  18407. type: "boolean"
  18408. },
  18409. card_id: {
  18410. required: true,
  18411. type: "integer"
  18412. },
  18413. note: {
  18414. type: "string"
  18415. }
  18416. },
  18417. url: "/projects/columns/cards/:card_id"
  18418. },
  18419. updateColumn: {
  18420. headers: {
  18421. accept: "application/vnd.github.inertia-preview+json"
  18422. },
  18423. method: "PATCH",
  18424. params: {
  18425. column_id: {
  18426. required: true,
  18427. type: "integer"
  18428. },
  18429. name: {
  18430. required: true,
  18431. type: "string"
  18432. }
  18433. },
  18434. url: "/projects/columns/:column_id"
  18435. }
  18436. },
  18437. pulls: {
  18438. checkIfMerged: {
  18439. method: "GET",
  18440. params: {
  18441. number: {
  18442. alias: "pull_number",
  18443. deprecated: true,
  18444. type: "integer"
  18445. },
  18446. owner: {
  18447. required: true,
  18448. type: "string"
  18449. },
  18450. pull_number: {
  18451. required: true,
  18452. type: "integer"
  18453. },
  18454. repo: {
  18455. required: true,
  18456. type: "string"
  18457. }
  18458. },
  18459. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18460. },
  18461. create: {
  18462. method: "POST",
  18463. params: {
  18464. base: {
  18465. required: true,
  18466. type: "string"
  18467. },
  18468. body: {
  18469. type: "string"
  18470. },
  18471. draft: {
  18472. type: "boolean"
  18473. },
  18474. head: {
  18475. required: true,
  18476. type: "string"
  18477. },
  18478. maintainer_can_modify: {
  18479. type: "boolean"
  18480. },
  18481. owner: {
  18482. required: true,
  18483. type: "string"
  18484. },
  18485. repo: {
  18486. required: true,
  18487. type: "string"
  18488. },
  18489. title: {
  18490. required: true,
  18491. type: "string"
  18492. }
  18493. },
  18494. url: "/repos/:owner/:repo/pulls"
  18495. },
  18496. createComment: {
  18497. method: "POST",
  18498. params: {
  18499. body: {
  18500. required: true,
  18501. type: "string"
  18502. },
  18503. commit_id: {
  18504. required: true,
  18505. type: "string"
  18506. },
  18507. in_reply_to: {
  18508. deprecated: true,
  18509. 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.",
  18510. type: "integer"
  18511. },
  18512. line: {
  18513. type: "integer"
  18514. },
  18515. number: {
  18516. alias: "pull_number",
  18517. deprecated: true,
  18518. type: "integer"
  18519. },
  18520. owner: {
  18521. required: true,
  18522. type: "string"
  18523. },
  18524. path: {
  18525. required: true,
  18526. type: "string"
  18527. },
  18528. position: {
  18529. type: "integer"
  18530. },
  18531. pull_number: {
  18532. required: true,
  18533. type: "integer"
  18534. },
  18535. repo: {
  18536. required: true,
  18537. type: "string"
  18538. },
  18539. side: {
  18540. enum: ["LEFT", "RIGHT"],
  18541. type: "string"
  18542. },
  18543. start_line: {
  18544. type: "integer"
  18545. },
  18546. start_side: {
  18547. enum: ["LEFT", "RIGHT", "side"],
  18548. type: "string"
  18549. }
  18550. },
  18551. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18552. },
  18553. createCommentReply: {
  18554. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18555. method: "POST",
  18556. params: {
  18557. body: {
  18558. required: true,
  18559. type: "string"
  18560. },
  18561. commit_id: {
  18562. required: true,
  18563. type: "string"
  18564. },
  18565. in_reply_to: {
  18566. deprecated: true,
  18567. 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.",
  18568. type: "integer"
  18569. },
  18570. line: {
  18571. type: "integer"
  18572. },
  18573. number: {
  18574. alias: "pull_number",
  18575. deprecated: true,
  18576. type: "integer"
  18577. },
  18578. owner: {
  18579. required: true,
  18580. type: "string"
  18581. },
  18582. path: {
  18583. required: true,
  18584. type: "string"
  18585. },
  18586. position: {
  18587. type: "integer"
  18588. },
  18589. pull_number: {
  18590. required: true,
  18591. type: "integer"
  18592. },
  18593. repo: {
  18594. required: true,
  18595. type: "string"
  18596. },
  18597. side: {
  18598. enum: ["LEFT", "RIGHT"],
  18599. type: "string"
  18600. },
  18601. start_line: {
  18602. type: "integer"
  18603. },
  18604. start_side: {
  18605. enum: ["LEFT", "RIGHT", "side"],
  18606. type: "string"
  18607. }
  18608. },
  18609. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18610. },
  18611. createFromIssue: {
  18612. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18613. method: "POST",
  18614. params: {
  18615. base: {
  18616. required: true,
  18617. type: "string"
  18618. },
  18619. draft: {
  18620. type: "boolean"
  18621. },
  18622. head: {
  18623. required: true,
  18624. type: "string"
  18625. },
  18626. issue: {
  18627. required: true,
  18628. type: "integer"
  18629. },
  18630. maintainer_can_modify: {
  18631. type: "boolean"
  18632. },
  18633. owner: {
  18634. required: true,
  18635. type: "string"
  18636. },
  18637. repo: {
  18638. required: true,
  18639. type: "string"
  18640. }
  18641. },
  18642. url: "/repos/:owner/:repo/pulls"
  18643. },
  18644. createReview: {
  18645. method: "POST",
  18646. params: {
  18647. body: {
  18648. type: "string"
  18649. },
  18650. comments: {
  18651. type: "object[]"
  18652. },
  18653. "comments[].body": {
  18654. required: true,
  18655. type: "string"
  18656. },
  18657. "comments[].path": {
  18658. required: true,
  18659. type: "string"
  18660. },
  18661. "comments[].position": {
  18662. required: true,
  18663. type: "integer"
  18664. },
  18665. commit_id: {
  18666. type: "string"
  18667. },
  18668. event: {
  18669. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18670. type: "string"
  18671. },
  18672. number: {
  18673. alias: "pull_number",
  18674. deprecated: true,
  18675. type: "integer"
  18676. },
  18677. owner: {
  18678. required: true,
  18679. type: "string"
  18680. },
  18681. pull_number: {
  18682. required: true,
  18683. type: "integer"
  18684. },
  18685. repo: {
  18686. required: true,
  18687. type: "string"
  18688. }
  18689. },
  18690. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18691. },
  18692. createReviewCommentReply: {
  18693. method: "POST",
  18694. params: {
  18695. body: {
  18696. required: true,
  18697. type: "string"
  18698. },
  18699. comment_id: {
  18700. required: true,
  18701. type: "integer"
  18702. },
  18703. owner: {
  18704. required: true,
  18705. type: "string"
  18706. },
  18707. pull_number: {
  18708. required: true,
  18709. type: "integer"
  18710. },
  18711. repo: {
  18712. required: true,
  18713. type: "string"
  18714. }
  18715. },
  18716. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18717. },
  18718. createReviewRequest: {
  18719. method: "POST",
  18720. params: {
  18721. number: {
  18722. alias: "pull_number",
  18723. deprecated: true,
  18724. type: "integer"
  18725. },
  18726. owner: {
  18727. required: true,
  18728. type: "string"
  18729. },
  18730. pull_number: {
  18731. required: true,
  18732. type: "integer"
  18733. },
  18734. repo: {
  18735. required: true,
  18736. type: "string"
  18737. },
  18738. reviewers: {
  18739. type: "string[]"
  18740. },
  18741. team_reviewers: {
  18742. type: "string[]"
  18743. }
  18744. },
  18745. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18746. },
  18747. deleteComment: {
  18748. method: "DELETE",
  18749. params: {
  18750. comment_id: {
  18751. required: true,
  18752. type: "integer"
  18753. },
  18754. owner: {
  18755. required: true,
  18756. type: "string"
  18757. },
  18758. repo: {
  18759. required: true,
  18760. type: "string"
  18761. }
  18762. },
  18763. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18764. },
  18765. deletePendingReview: {
  18766. method: "DELETE",
  18767. params: {
  18768. number: {
  18769. alias: "pull_number",
  18770. deprecated: true,
  18771. type: "integer"
  18772. },
  18773. owner: {
  18774. required: true,
  18775. type: "string"
  18776. },
  18777. pull_number: {
  18778. required: true,
  18779. type: "integer"
  18780. },
  18781. repo: {
  18782. required: true,
  18783. type: "string"
  18784. },
  18785. review_id: {
  18786. required: true,
  18787. type: "integer"
  18788. }
  18789. },
  18790. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18791. },
  18792. deleteReviewRequest: {
  18793. method: "DELETE",
  18794. params: {
  18795. number: {
  18796. alias: "pull_number",
  18797. deprecated: true,
  18798. type: "integer"
  18799. },
  18800. owner: {
  18801. required: true,
  18802. type: "string"
  18803. },
  18804. pull_number: {
  18805. required: true,
  18806. type: "integer"
  18807. },
  18808. repo: {
  18809. required: true,
  18810. type: "string"
  18811. },
  18812. reviewers: {
  18813. type: "string[]"
  18814. },
  18815. team_reviewers: {
  18816. type: "string[]"
  18817. }
  18818. },
  18819. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18820. },
  18821. dismissReview: {
  18822. method: "PUT",
  18823. params: {
  18824. message: {
  18825. required: true,
  18826. type: "string"
  18827. },
  18828. number: {
  18829. alias: "pull_number",
  18830. deprecated: true,
  18831. type: "integer"
  18832. },
  18833. owner: {
  18834. required: true,
  18835. type: "string"
  18836. },
  18837. pull_number: {
  18838. required: true,
  18839. type: "integer"
  18840. },
  18841. repo: {
  18842. required: true,
  18843. type: "string"
  18844. },
  18845. review_id: {
  18846. required: true,
  18847. type: "integer"
  18848. }
  18849. },
  18850. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18851. },
  18852. get: {
  18853. method: "GET",
  18854. params: {
  18855. number: {
  18856. alias: "pull_number",
  18857. deprecated: true,
  18858. type: "integer"
  18859. },
  18860. owner: {
  18861. required: true,
  18862. type: "string"
  18863. },
  18864. pull_number: {
  18865. required: true,
  18866. type: "integer"
  18867. },
  18868. repo: {
  18869. required: true,
  18870. type: "string"
  18871. }
  18872. },
  18873. url: "/repos/:owner/:repo/pulls/:pull_number"
  18874. },
  18875. getComment: {
  18876. method: "GET",
  18877. params: {
  18878. comment_id: {
  18879. required: true,
  18880. type: "integer"
  18881. },
  18882. owner: {
  18883. required: true,
  18884. type: "string"
  18885. },
  18886. repo: {
  18887. required: true,
  18888. type: "string"
  18889. }
  18890. },
  18891. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18892. },
  18893. getCommentsForReview: {
  18894. method: "GET",
  18895. params: {
  18896. number: {
  18897. alias: "pull_number",
  18898. deprecated: true,
  18899. type: "integer"
  18900. },
  18901. owner: {
  18902. required: true,
  18903. type: "string"
  18904. },
  18905. page: {
  18906. type: "integer"
  18907. },
  18908. per_page: {
  18909. type: "integer"
  18910. },
  18911. pull_number: {
  18912. required: true,
  18913. type: "integer"
  18914. },
  18915. repo: {
  18916. required: true,
  18917. type: "string"
  18918. },
  18919. review_id: {
  18920. required: true,
  18921. type: "integer"
  18922. }
  18923. },
  18924. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  18925. },
  18926. getReview: {
  18927. method: "GET",
  18928. params: {
  18929. number: {
  18930. alias: "pull_number",
  18931. deprecated: true,
  18932. type: "integer"
  18933. },
  18934. owner: {
  18935. required: true,
  18936. type: "string"
  18937. },
  18938. pull_number: {
  18939. required: true,
  18940. type: "integer"
  18941. },
  18942. repo: {
  18943. required: true,
  18944. type: "string"
  18945. },
  18946. review_id: {
  18947. required: true,
  18948. type: "integer"
  18949. }
  18950. },
  18951. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18952. },
  18953. list: {
  18954. method: "GET",
  18955. params: {
  18956. base: {
  18957. type: "string"
  18958. },
  18959. direction: {
  18960. enum: ["asc", "desc"],
  18961. type: "string"
  18962. },
  18963. head: {
  18964. type: "string"
  18965. },
  18966. owner: {
  18967. required: true,
  18968. type: "string"
  18969. },
  18970. page: {
  18971. type: "integer"
  18972. },
  18973. per_page: {
  18974. type: "integer"
  18975. },
  18976. repo: {
  18977. required: true,
  18978. type: "string"
  18979. },
  18980. sort: {
  18981. enum: ["created", "updated", "popularity", "long-running"],
  18982. type: "string"
  18983. },
  18984. state: {
  18985. enum: ["open", "closed", "all"],
  18986. type: "string"
  18987. }
  18988. },
  18989. url: "/repos/:owner/:repo/pulls"
  18990. },
  18991. listComments: {
  18992. method: "GET",
  18993. params: {
  18994. direction: {
  18995. enum: ["asc", "desc"],
  18996. type: "string"
  18997. },
  18998. number: {
  18999. alias: "pull_number",
  19000. deprecated: true,
  19001. type: "integer"
  19002. },
  19003. owner: {
  19004. required: true,
  19005. type: "string"
  19006. },
  19007. page: {
  19008. type: "integer"
  19009. },
  19010. per_page: {
  19011. type: "integer"
  19012. },
  19013. pull_number: {
  19014. required: true,
  19015. type: "integer"
  19016. },
  19017. repo: {
  19018. required: true,
  19019. type: "string"
  19020. },
  19021. since: {
  19022. type: "string"
  19023. },
  19024. sort: {
  19025. enum: ["created", "updated"],
  19026. type: "string"
  19027. }
  19028. },
  19029. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19030. },
  19031. listCommentsForRepo: {
  19032. method: "GET",
  19033. params: {
  19034. direction: {
  19035. enum: ["asc", "desc"],
  19036. type: "string"
  19037. },
  19038. owner: {
  19039. required: true,
  19040. type: "string"
  19041. },
  19042. page: {
  19043. type: "integer"
  19044. },
  19045. per_page: {
  19046. type: "integer"
  19047. },
  19048. repo: {
  19049. required: true,
  19050. type: "string"
  19051. },
  19052. since: {
  19053. type: "string"
  19054. },
  19055. sort: {
  19056. enum: ["created", "updated"],
  19057. type: "string"
  19058. }
  19059. },
  19060. url: "/repos/:owner/:repo/pulls/comments"
  19061. },
  19062. listCommits: {
  19063. method: "GET",
  19064. params: {
  19065. number: {
  19066. alias: "pull_number",
  19067. deprecated: true,
  19068. type: "integer"
  19069. },
  19070. owner: {
  19071. required: true,
  19072. type: "string"
  19073. },
  19074. page: {
  19075. type: "integer"
  19076. },
  19077. per_page: {
  19078. type: "integer"
  19079. },
  19080. pull_number: {
  19081. required: true,
  19082. type: "integer"
  19083. },
  19084. repo: {
  19085. required: true,
  19086. type: "string"
  19087. }
  19088. },
  19089. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19090. },
  19091. listFiles: {
  19092. method: "GET",
  19093. params: {
  19094. number: {
  19095. alias: "pull_number",
  19096. deprecated: true,
  19097. type: "integer"
  19098. },
  19099. owner: {
  19100. required: true,
  19101. type: "string"
  19102. },
  19103. page: {
  19104. type: "integer"
  19105. },
  19106. per_page: {
  19107. type: "integer"
  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/files"
  19119. },
  19120. listReviewRequests: {
  19121. method: "GET",
  19122. params: {
  19123. number: {
  19124. alias: "pull_number",
  19125. deprecated: true,
  19126. type: "integer"
  19127. },
  19128. owner: {
  19129. required: true,
  19130. type: "string"
  19131. },
  19132. page: {
  19133. type: "integer"
  19134. },
  19135. per_page: {
  19136. type: "integer"
  19137. },
  19138. pull_number: {
  19139. required: true,
  19140. type: "integer"
  19141. },
  19142. repo: {
  19143. required: true,
  19144. type: "string"
  19145. }
  19146. },
  19147. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19148. },
  19149. listReviews: {
  19150. method: "GET",
  19151. params: {
  19152. number: {
  19153. alias: "pull_number",
  19154. deprecated: true,
  19155. type: "integer"
  19156. },
  19157. owner: {
  19158. required: true,
  19159. type: "string"
  19160. },
  19161. page: {
  19162. type: "integer"
  19163. },
  19164. per_page: {
  19165. type: "integer"
  19166. },
  19167. pull_number: {
  19168. required: true,
  19169. type: "integer"
  19170. },
  19171. repo: {
  19172. required: true,
  19173. type: "string"
  19174. }
  19175. },
  19176. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19177. },
  19178. merge: {
  19179. method: "PUT",
  19180. params: {
  19181. commit_message: {
  19182. type: "string"
  19183. },
  19184. commit_title: {
  19185. type: "string"
  19186. },
  19187. merge_method: {
  19188. enum: ["merge", "squash", "rebase"],
  19189. type: "string"
  19190. },
  19191. number: {
  19192. alias: "pull_number",
  19193. deprecated: true,
  19194. type: "integer"
  19195. },
  19196. owner: {
  19197. required: true,
  19198. type: "string"
  19199. },
  19200. pull_number: {
  19201. required: true,
  19202. type: "integer"
  19203. },
  19204. repo: {
  19205. required: true,
  19206. type: "string"
  19207. },
  19208. sha: {
  19209. type: "string"
  19210. }
  19211. },
  19212. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19213. },
  19214. submitReview: {
  19215. method: "POST",
  19216. params: {
  19217. body: {
  19218. type: "string"
  19219. },
  19220. event: {
  19221. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19222. required: true,
  19223. type: "string"
  19224. },
  19225. number: {
  19226. alias: "pull_number",
  19227. deprecated: true,
  19228. type: "integer"
  19229. },
  19230. owner: {
  19231. required: true,
  19232. type: "string"
  19233. },
  19234. pull_number: {
  19235. required: true,
  19236. type: "integer"
  19237. },
  19238. repo: {
  19239. required: true,
  19240. type: "string"
  19241. },
  19242. review_id: {
  19243. required: true,
  19244. type: "integer"
  19245. }
  19246. },
  19247. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19248. },
  19249. update: {
  19250. method: "PATCH",
  19251. params: {
  19252. base: {
  19253. type: "string"
  19254. },
  19255. body: {
  19256. type: "string"
  19257. },
  19258. maintainer_can_modify: {
  19259. type: "boolean"
  19260. },
  19261. number: {
  19262. alias: "pull_number",
  19263. deprecated: true,
  19264. type: "integer"
  19265. },
  19266. owner: {
  19267. required: true,
  19268. type: "string"
  19269. },
  19270. pull_number: {
  19271. required: true,
  19272. type: "integer"
  19273. },
  19274. repo: {
  19275. required: true,
  19276. type: "string"
  19277. },
  19278. state: {
  19279. enum: ["open", "closed"],
  19280. type: "string"
  19281. },
  19282. title: {
  19283. type: "string"
  19284. }
  19285. },
  19286. url: "/repos/:owner/:repo/pulls/:pull_number"
  19287. },
  19288. updateBranch: {
  19289. headers: {
  19290. accept: "application/vnd.github.lydian-preview+json"
  19291. },
  19292. method: "PUT",
  19293. params: {
  19294. expected_head_sha: {
  19295. type: "string"
  19296. },
  19297. owner: {
  19298. required: true,
  19299. type: "string"
  19300. },
  19301. pull_number: {
  19302. required: true,
  19303. type: "integer"
  19304. },
  19305. repo: {
  19306. required: true,
  19307. type: "string"
  19308. }
  19309. },
  19310. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19311. },
  19312. updateComment: {
  19313. method: "PATCH",
  19314. params: {
  19315. body: {
  19316. required: true,
  19317. type: "string"
  19318. },
  19319. comment_id: {
  19320. required: true,
  19321. type: "integer"
  19322. },
  19323. owner: {
  19324. required: true,
  19325. type: "string"
  19326. },
  19327. repo: {
  19328. required: true,
  19329. type: "string"
  19330. }
  19331. },
  19332. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19333. },
  19334. updateReview: {
  19335. method: "PUT",
  19336. params: {
  19337. body: {
  19338. required: true,
  19339. type: "string"
  19340. },
  19341. number: {
  19342. alias: "pull_number",
  19343. deprecated: true,
  19344. type: "integer"
  19345. },
  19346. owner: {
  19347. required: true,
  19348. type: "string"
  19349. },
  19350. pull_number: {
  19351. required: true,
  19352. type: "integer"
  19353. },
  19354. repo: {
  19355. required: true,
  19356. type: "string"
  19357. },
  19358. review_id: {
  19359. required: true,
  19360. type: "integer"
  19361. }
  19362. },
  19363. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19364. }
  19365. },
  19366. rateLimit: {
  19367. get: {
  19368. method: "GET",
  19369. params: {},
  19370. url: "/rate_limit"
  19371. }
  19372. },
  19373. reactions: {
  19374. createForCommitComment: {
  19375. headers: {
  19376. accept: "application/vnd.github.squirrel-girl-preview+json"
  19377. },
  19378. method: "POST",
  19379. params: {
  19380. comment_id: {
  19381. required: true,
  19382. type: "integer"
  19383. },
  19384. content: {
  19385. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19386. required: true,
  19387. type: "string"
  19388. },
  19389. owner: {
  19390. required: true,
  19391. type: "string"
  19392. },
  19393. repo: {
  19394. required: true,
  19395. type: "string"
  19396. }
  19397. },
  19398. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19399. },
  19400. createForIssue: {
  19401. headers: {
  19402. accept: "application/vnd.github.squirrel-girl-preview+json"
  19403. },
  19404. method: "POST",
  19405. params: {
  19406. content: {
  19407. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19408. required: true,
  19409. type: "string"
  19410. },
  19411. issue_number: {
  19412. required: true,
  19413. type: "integer"
  19414. },
  19415. number: {
  19416. alias: "issue_number",
  19417. deprecated: true,
  19418. type: "integer"
  19419. },
  19420. owner: {
  19421. required: true,
  19422. type: "string"
  19423. },
  19424. repo: {
  19425. required: true,
  19426. type: "string"
  19427. }
  19428. },
  19429. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19430. },
  19431. createForIssueComment: {
  19432. headers: {
  19433. accept: "application/vnd.github.squirrel-girl-preview+json"
  19434. },
  19435. method: "POST",
  19436. params: {
  19437. comment_id: {
  19438. required: true,
  19439. type: "integer"
  19440. },
  19441. content: {
  19442. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19443. required: true,
  19444. type: "string"
  19445. },
  19446. owner: {
  19447. required: true,
  19448. type: "string"
  19449. },
  19450. repo: {
  19451. required: true,
  19452. type: "string"
  19453. }
  19454. },
  19455. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19456. },
  19457. createForPullRequestReviewComment: {
  19458. headers: {
  19459. accept: "application/vnd.github.squirrel-girl-preview+json"
  19460. },
  19461. method: "POST",
  19462. params: {
  19463. comment_id: {
  19464. required: true,
  19465. type: "integer"
  19466. },
  19467. content: {
  19468. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19469. required: true,
  19470. type: "string"
  19471. },
  19472. owner: {
  19473. required: true,
  19474. type: "string"
  19475. },
  19476. repo: {
  19477. required: true,
  19478. type: "string"
  19479. }
  19480. },
  19481. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19482. },
  19483. createForTeamDiscussion: {
  19484. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19485. headers: {
  19486. accept: "application/vnd.github.squirrel-girl-preview+json"
  19487. },
  19488. method: "POST",
  19489. params: {
  19490. content: {
  19491. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19492. required: true,
  19493. type: "string"
  19494. },
  19495. discussion_number: {
  19496. required: true,
  19497. type: "integer"
  19498. },
  19499. team_id: {
  19500. required: true,
  19501. type: "integer"
  19502. }
  19503. },
  19504. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19505. },
  19506. createForTeamDiscussionComment: {
  19507. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19508. headers: {
  19509. accept: "application/vnd.github.squirrel-girl-preview+json"
  19510. },
  19511. method: "POST",
  19512. params: {
  19513. comment_number: {
  19514. required: true,
  19515. type: "integer"
  19516. },
  19517. content: {
  19518. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19519. required: true,
  19520. type: "string"
  19521. },
  19522. discussion_number: {
  19523. required: true,
  19524. type: "integer"
  19525. },
  19526. team_id: {
  19527. required: true,
  19528. type: "integer"
  19529. }
  19530. },
  19531. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19532. },
  19533. createForTeamDiscussionCommentInOrg: {
  19534. headers: {
  19535. accept: "application/vnd.github.squirrel-girl-preview+json"
  19536. },
  19537. method: "POST",
  19538. params: {
  19539. comment_number: {
  19540. required: true,
  19541. type: "integer"
  19542. },
  19543. content: {
  19544. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19545. required: true,
  19546. type: "string"
  19547. },
  19548. discussion_number: {
  19549. required: true,
  19550. type: "integer"
  19551. },
  19552. org: {
  19553. required: true,
  19554. type: "string"
  19555. },
  19556. team_slug: {
  19557. required: true,
  19558. type: "string"
  19559. }
  19560. },
  19561. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19562. },
  19563. createForTeamDiscussionCommentLegacy: {
  19564. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19565. headers: {
  19566. accept: "application/vnd.github.squirrel-girl-preview+json"
  19567. },
  19568. method: "POST",
  19569. params: {
  19570. comment_number: {
  19571. required: true,
  19572. type: "integer"
  19573. },
  19574. content: {
  19575. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19576. required: true,
  19577. type: "string"
  19578. },
  19579. discussion_number: {
  19580. required: true,
  19581. type: "integer"
  19582. },
  19583. team_id: {
  19584. required: true,
  19585. type: "integer"
  19586. }
  19587. },
  19588. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19589. },
  19590. createForTeamDiscussionInOrg: {
  19591. headers: {
  19592. accept: "application/vnd.github.squirrel-girl-preview+json"
  19593. },
  19594. method: "POST",
  19595. params: {
  19596. content: {
  19597. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19598. required: true,
  19599. type: "string"
  19600. },
  19601. discussion_number: {
  19602. required: true,
  19603. type: "integer"
  19604. },
  19605. org: {
  19606. required: true,
  19607. type: "string"
  19608. },
  19609. team_slug: {
  19610. required: true,
  19611. type: "string"
  19612. }
  19613. },
  19614. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19615. },
  19616. createForTeamDiscussionLegacy: {
  19617. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19618. headers: {
  19619. accept: "application/vnd.github.squirrel-girl-preview+json"
  19620. },
  19621. method: "POST",
  19622. params: {
  19623. content: {
  19624. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19625. required: true,
  19626. type: "string"
  19627. },
  19628. discussion_number: {
  19629. required: true,
  19630. type: "integer"
  19631. },
  19632. team_id: {
  19633. required: true,
  19634. type: "integer"
  19635. }
  19636. },
  19637. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19638. },
  19639. delete: {
  19640. headers: {
  19641. accept: "application/vnd.github.squirrel-girl-preview+json"
  19642. },
  19643. method: "DELETE",
  19644. params: {
  19645. reaction_id: {
  19646. required: true,
  19647. type: "integer"
  19648. }
  19649. },
  19650. url: "/reactions/:reaction_id"
  19651. },
  19652. listForCommitComment: {
  19653. headers: {
  19654. accept: "application/vnd.github.squirrel-girl-preview+json"
  19655. },
  19656. method: "GET",
  19657. params: {
  19658. comment_id: {
  19659. required: true,
  19660. type: "integer"
  19661. },
  19662. content: {
  19663. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19664. type: "string"
  19665. },
  19666. owner: {
  19667. required: true,
  19668. type: "string"
  19669. },
  19670. page: {
  19671. type: "integer"
  19672. },
  19673. per_page: {
  19674. type: "integer"
  19675. },
  19676. repo: {
  19677. required: true,
  19678. type: "string"
  19679. }
  19680. },
  19681. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19682. },
  19683. listForIssue: {
  19684. headers: {
  19685. accept: "application/vnd.github.squirrel-girl-preview+json"
  19686. },
  19687. method: "GET",
  19688. params: {
  19689. content: {
  19690. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19691. type: "string"
  19692. },
  19693. issue_number: {
  19694. required: true,
  19695. type: "integer"
  19696. },
  19697. number: {
  19698. alias: "issue_number",
  19699. deprecated: true,
  19700. type: "integer"
  19701. },
  19702. owner: {
  19703. required: true,
  19704. type: "string"
  19705. },
  19706. page: {
  19707. type: "integer"
  19708. },
  19709. per_page: {
  19710. type: "integer"
  19711. },
  19712. repo: {
  19713. required: true,
  19714. type: "string"
  19715. }
  19716. },
  19717. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19718. },
  19719. listForIssueComment: {
  19720. headers: {
  19721. accept: "application/vnd.github.squirrel-girl-preview+json"
  19722. },
  19723. method: "GET",
  19724. params: {
  19725. comment_id: {
  19726. required: true,
  19727. type: "integer"
  19728. },
  19729. content: {
  19730. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19731. type: "string"
  19732. },
  19733. owner: {
  19734. required: true,
  19735. type: "string"
  19736. },
  19737. page: {
  19738. type: "integer"
  19739. },
  19740. per_page: {
  19741. type: "integer"
  19742. },
  19743. repo: {
  19744. required: true,
  19745. type: "string"
  19746. }
  19747. },
  19748. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19749. },
  19750. listForPullRequestReviewComment: {
  19751. headers: {
  19752. accept: "application/vnd.github.squirrel-girl-preview+json"
  19753. },
  19754. method: "GET",
  19755. params: {
  19756. comment_id: {
  19757. required: true,
  19758. type: "integer"
  19759. },
  19760. content: {
  19761. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19762. type: "string"
  19763. },
  19764. owner: {
  19765. required: true,
  19766. type: "string"
  19767. },
  19768. page: {
  19769. type: "integer"
  19770. },
  19771. per_page: {
  19772. type: "integer"
  19773. },
  19774. repo: {
  19775. required: true,
  19776. type: "string"
  19777. }
  19778. },
  19779. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19780. },
  19781. listForTeamDiscussion: {
  19782. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19783. headers: {
  19784. accept: "application/vnd.github.squirrel-girl-preview+json"
  19785. },
  19786. method: "GET",
  19787. params: {
  19788. content: {
  19789. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19790. type: "string"
  19791. },
  19792. discussion_number: {
  19793. required: true,
  19794. type: "integer"
  19795. },
  19796. page: {
  19797. type: "integer"
  19798. },
  19799. per_page: {
  19800. type: "integer"
  19801. },
  19802. team_id: {
  19803. required: true,
  19804. type: "integer"
  19805. }
  19806. },
  19807. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19808. },
  19809. listForTeamDiscussionComment: {
  19810. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19811. headers: {
  19812. accept: "application/vnd.github.squirrel-girl-preview+json"
  19813. },
  19814. method: "GET",
  19815. params: {
  19816. comment_number: {
  19817. required: true,
  19818. type: "integer"
  19819. },
  19820. content: {
  19821. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19822. type: "string"
  19823. },
  19824. discussion_number: {
  19825. required: true,
  19826. type: "integer"
  19827. },
  19828. page: {
  19829. type: "integer"
  19830. },
  19831. per_page: {
  19832. type: "integer"
  19833. },
  19834. team_id: {
  19835. required: true,
  19836. type: "integer"
  19837. }
  19838. },
  19839. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19840. },
  19841. listForTeamDiscussionCommentInOrg: {
  19842. headers: {
  19843. accept: "application/vnd.github.squirrel-girl-preview+json"
  19844. },
  19845. method: "GET",
  19846. params: {
  19847. comment_number: {
  19848. required: true,
  19849. type: "integer"
  19850. },
  19851. content: {
  19852. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19853. type: "string"
  19854. },
  19855. discussion_number: {
  19856. required: true,
  19857. type: "integer"
  19858. },
  19859. org: {
  19860. required: true,
  19861. type: "string"
  19862. },
  19863. page: {
  19864. type: "integer"
  19865. },
  19866. per_page: {
  19867. type: "integer"
  19868. },
  19869. team_slug: {
  19870. required: true,
  19871. type: "string"
  19872. }
  19873. },
  19874. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19875. },
  19876. listForTeamDiscussionCommentLegacy: {
  19877. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19878. headers: {
  19879. accept: "application/vnd.github.squirrel-girl-preview+json"
  19880. },
  19881. method: "GET",
  19882. params: {
  19883. comment_number: {
  19884. required: true,
  19885. type: "integer"
  19886. },
  19887. content: {
  19888. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19889. type: "string"
  19890. },
  19891. discussion_number: {
  19892. required: true,
  19893. type: "integer"
  19894. },
  19895. page: {
  19896. type: "integer"
  19897. },
  19898. per_page: {
  19899. type: "integer"
  19900. },
  19901. team_id: {
  19902. required: true,
  19903. type: "integer"
  19904. }
  19905. },
  19906. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19907. },
  19908. listForTeamDiscussionInOrg: {
  19909. headers: {
  19910. accept: "application/vnd.github.squirrel-girl-preview+json"
  19911. },
  19912. method: "GET",
  19913. params: {
  19914. content: {
  19915. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19916. type: "string"
  19917. },
  19918. discussion_number: {
  19919. required: true,
  19920. type: "integer"
  19921. },
  19922. org: {
  19923. required: true,
  19924. type: "string"
  19925. },
  19926. page: {
  19927. type: "integer"
  19928. },
  19929. per_page: {
  19930. type: "integer"
  19931. },
  19932. team_slug: {
  19933. required: true,
  19934. type: "string"
  19935. }
  19936. },
  19937. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19938. },
  19939. listForTeamDiscussionLegacy: {
  19940. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  19941. headers: {
  19942. accept: "application/vnd.github.squirrel-girl-preview+json"
  19943. },
  19944. method: "GET",
  19945. params: {
  19946. content: {
  19947. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19948. type: "string"
  19949. },
  19950. discussion_number: {
  19951. required: true,
  19952. type: "integer"
  19953. },
  19954. page: {
  19955. type: "integer"
  19956. },
  19957. per_page: {
  19958. type: "integer"
  19959. },
  19960. team_id: {
  19961. required: true,
  19962. type: "integer"
  19963. }
  19964. },
  19965. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19966. }
  19967. },
  19968. repos: {
  19969. acceptInvitation: {
  19970. method: "PATCH",
  19971. params: {
  19972. invitation_id: {
  19973. required: true,
  19974. type: "integer"
  19975. }
  19976. },
  19977. url: "/user/repository_invitations/:invitation_id"
  19978. },
  19979. addCollaborator: {
  19980. method: "PUT",
  19981. params: {
  19982. owner: {
  19983. required: true,
  19984. type: "string"
  19985. },
  19986. permission: {
  19987. enum: ["pull", "push", "admin"],
  19988. type: "string"
  19989. },
  19990. repo: {
  19991. required: true,
  19992. type: "string"
  19993. },
  19994. username: {
  19995. required: true,
  19996. type: "string"
  19997. }
  19998. },
  19999. url: "/repos/:owner/:repo/collaborators/:username"
  20000. },
  20001. addDeployKey: {
  20002. method: "POST",
  20003. params: {
  20004. key: {
  20005. required: true,
  20006. type: "string"
  20007. },
  20008. owner: {
  20009. required: true,
  20010. type: "string"
  20011. },
  20012. read_only: {
  20013. type: "boolean"
  20014. },
  20015. repo: {
  20016. required: true,
  20017. type: "string"
  20018. },
  20019. title: {
  20020. type: "string"
  20021. }
  20022. },
  20023. url: "/repos/:owner/:repo/keys"
  20024. },
  20025. addProtectedBranchAdminEnforcement: {
  20026. method: "POST",
  20027. params: {
  20028. branch: {
  20029. required: true,
  20030. type: "string"
  20031. },
  20032. owner: {
  20033. required: true,
  20034. type: "string"
  20035. },
  20036. repo: {
  20037. required: true,
  20038. type: "string"
  20039. }
  20040. },
  20041. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20042. },
  20043. addProtectedBranchAppRestrictions: {
  20044. method: "POST",
  20045. params: {
  20046. apps: {
  20047. mapTo: "data",
  20048. required: true,
  20049. type: "string[]"
  20050. },
  20051. branch: {
  20052. required: true,
  20053. type: "string"
  20054. },
  20055. owner: {
  20056. required: true,
  20057. type: "string"
  20058. },
  20059. repo: {
  20060. required: true,
  20061. type: "string"
  20062. }
  20063. },
  20064. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20065. },
  20066. addProtectedBranchRequiredSignatures: {
  20067. headers: {
  20068. accept: "application/vnd.github.zzzax-preview+json"
  20069. },
  20070. method: "POST",
  20071. params: {
  20072. branch: {
  20073. required: true,
  20074. type: "string"
  20075. },
  20076. owner: {
  20077. required: true,
  20078. type: "string"
  20079. },
  20080. repo: {
  20081. required: true,
  20082. type: "string"
  20083. }
  20084. },
  20085. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20086. },
  20087. addProtectedBranchRequiredStatusChecksContexts: {
  20088. method: "POST",
  20089. params: {
  20090. branch: {
  20091. required: true,
  20092. type: "string"
  20093. },
  20094. contexts: {
  20095. mapTo: "data",
  20096. required: true,
  20097. type: "string[]"
  20098. },
  20099. owner: {
  20100. required: true,
  20101. type: "string"
  20102. },
  20103. repo: {
  20104. required: true,
  20105. type: "string"
  20106. }
  20107. },
  20108. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20109. },
  20110. addProtectedBranchTeamRestrictions: {
  20111. method: "POST",
  20112. params: {
  20113. branch: {
  20114. required: true,
  20115. type: "string"
  20116. },
  20117. owner: {
  20118. required: true,
  20119. type: "string"
  20120. },
  20121. repo: {
  20122. required: true,
  20123. type: "string"
  20124. },
  20125. teams: {
  20126. mapTo: "data",
  20127. required: true,
  20128. type: "string[]"
  20129. }
  20130. },
  20131. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20132. },
  20133. addProtectedBranchUserRestrictions: {
  20134. method: "POST",
  20135. params: {
  20136. branch: {
  20137. required: true,
  20138. type: "string"
  20139. },
  20140. owner: {
  20141. required: true,
  20142. type: "string"
  20143. },
  20144. repo: {
  20145. required: true,
  20146. type: "string"
  20147. },
  20148. users: {
  20149. mapTo: "data",
  20150. required: true,
  20151. type: "string[]"
  20152. }
  20153. },
  20154. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20155. },
  20156. checkCollaborator: {
  20157. method: "GET",
  20158. params: {
  20159. owner: {
  20160. required: true,
  20161. type: "string"
  20162. },
  20163. repo: {
  20164. required: true,
  20165. type: "string"
  20166. },
  20167. username: {
  20168. required: true,
  20169. type: "string"
  20170. }
  20171. },
  20172. url: "/repos/:owner/:repo/collaborators/:username"
  20173. },
  20174. checkVulnerabilityAlerts: {
  20175. headers: {
  20176. accept: "application/vnd.github.dorian-preview+json"
  20177. },
  20178. method: "GET",
  20179. params: {
  20180. owner: {
  20181. required: true,
  20182. type: "string"
  20183. },
  20184. repo: {
  20185. required: true,
  20186. type: "string"
  20187. }
  20188. },
  20189. url: "/repos/:owner/:repo/vulnerability-alerts"
  20190. },
  20191. compareCommits: {
  20192. method: "GET",
  20193. params: {
  20194. base: {
  20195. required: true,
  20196. type: "string"
  20197. },
  20198. head: {
  20199. required: true,
  20200. type: "string"
  20201. },
  20202. owner: {
  20203. required: true,
  20204. type: "string"
  20205. },
  20206. repo: {
  20207. required: true,
  20208. type: "string"
  20209. }
  20210. },
  20211. url: "/repos/:owner/:repo/compare/:base...:head"
  20212. },
  20213. createCommitComment: {
  20214. method: "POST",
  20215. params: {
  20216. body: {
  20217. required: true,
  20218. type: "string"
  20219. },
  20220. commit_sha: {
  20221. required: true,
  20222. type: "string"
  20223. },
  20224. line: {
  20225. type: "integer"
  20226. },
  20227. owner: {
  20228. required: true,
  20229. type: "string"
  20230. },
  20231. path: {
  20232. type: "string"
  20233. },
  20234. position: {
  20235. type: "integer"
  20236. },
  20237. repo: {
  20238. required: true,
  20239. type: "string"
  20240. },
  20241. sha: {
  20242. alias: "commit_sha",
  20243. deprecated: true,
  20244. type: "string"
  20245. }
  20246. },
  20247. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20248. },
  20249. createDeployment: {
  20250. method: "POST",
  20251. params: {
  20252. auto_merge: {
  20253. type: "boolean"
  20254. },
  20255. description: {
  20256. type: "string"
  20257. },
  20258. environment: {
  20259. type: "string"
  20260. },
  20261. owner: {
  20262. required: true,
  20263. type: "string"
  20264. },
  20265. payload: {
  20266. type: "string"
  20267. },
  20268. production_environment: {
  20269. type: "boolean"
  20270. },
  20271. ref: {
  20272. required: true,
  20273. type: "string"
  20274. },
  20275. repo: {
  20276. required: true,
  20277. type: "string"
  20278. },
  20279. required_contexts: {
  20280. type: "string[]"
  20281. },
  20282. task: {
  20283. type: "string"
  20284. },
  20285. transient_environment: {
  20286. type: "boolean"
  20287. }
  20288. },
  20289. url: "/repos/:owner/:repo/deployments"
  20290. },
  20291. createDeploymentStatus: {
  20292. method: "POST",
  20293. params: {
  20294. auto_inactive: {
  20295. type: "boolean"
  20296. },
  20297. deployment_id: {
  20298. required: true,
  20299. type: "integer"
  20300. },
  20301. description: {
  20302. type: "string"
  20303. },
  20304. environment: {
  20305. enum: ["production", "staging", "qa"],
  20306. type: "string"
  20307. },
  20308. environment_url: {
  20309. type: "string"
  20310. },
  20311. log_url: {
  20312. type: "string"
  20313. },
  20314. owner: {
  20315. required: true,
  20316. type: "string"
  20317. },
  20318. repo: {
  20319. required: true,
  20320. type: "string"
  20321. },
  20322. state: {
  20323. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20324. required: true,
  20325. type: "string"
  20326. },
  20327. target_url: {
  20328. type: "string"
  20329. }
  20330. },
  20331. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20332. },
  20333. createDispatchEvent: {
  20334. method: "POST",
  20335. params: {
  20336. client_payload: {
  20337. type: "object"
  20338. },
  20339. event_type: {
  20340. type: "string"
  20341. },
  20342. owner: {
  20343. required: true,
  20344. type: "string"
  20345. },
  20346. repo: {
  20347. required: true,
  20348. type: "string"
  20349. }
  20350. },
  20351. url: "/repos/:owner/:repo/dispatches"
  20352. },
  20353. createFile: {
  20354. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20355. method: "PUT",
  20356. params: {
  20357. author: {
  20358. type: "object"
  20359. },
  20360. "author.email": {
  20361. required: true,
  20362. type: "string"
  20363. },
  20364. "author.name": {
  20365. required: true,
  20366. type: "string"
  20367. },
  20368. branch: {
  20369. type: "string"
  20370. },
  20371. committer: {
  20372. type: "object"
  20373. },
  20374. "committer.email": {
  20375. required: true,
  20376. type: "string"
  20377. },
  20378. "committer.name": {
  20379. required: true,
  20380. type: "string"
  20381. },
  20382. content: {
  20383. required: true,
  20384. type: "string"
  20385. },
  20386. message: {
  20387. required: true,
  20388. type: "string"
  20389. },
  20390. owner: {
  20391. required: true,
  20392. type: "string"
  20393. },
  20394. path: {
  20395. required: true,
  20396. type: "string"
  20397. },
  20398. repo: {
  20399. required: true,
  20400. type: "string"
  20401. },
  20402. sha: {
  20403. type: "string"
  20404. }
  20405. },
  20406. url: "/repos/:owner/:repo/contents/:path"
  20407. },
  20408. createForAuthenticatedUser: {
  20409. method: "POST",
  20410. params: {
  20411. allow_merge_commit: {
  20412. type: "boolean"
  20413. },
  20414. allow_rebase_merge: {
  20415. type: "boolean"
  20416. },
  20417. allow_squash_merge: {
  20418. type: "boolean"
  20419. },
  20420. auto_init: {
  20421. type: "boolean"
  20422. },
  20423. delete_branch_on_merge: {
  20424. type: "boolean"
  20425. },
  20426. description: {
  20427. type: "string"
  20428. },
  20429. gitignore_template: {
  20430. type: "string"
  20431. },
  20432. has_issues: {
  20433. type: "boolean"
  20434. },
  20435. has_projects: {
  20436. type: "boolean"
  20437. },
  20438. has_wiki: {
  20439. type: "boolean"
  20440. },
  20441. homepage: {
  20442. type: "string"
  20443. },
  20444. is_template: {
  20445. type: "boolean"
  20446. },
  20447. license_template: {
  20448. type: "string"
  20449. },
  20450. name: {
  20451. required: true,
  20452. type: "string"
  20453. },
  20454. private: {
  20455. type: "boolean"
  20456. },
  20457. team_id: {
  20458. type: "integer"
  20459. },
  20460. visibility: {
  20461. enum: ["public", "private", "visibility", "internal"],
  20462. type: "string"
  20463. }
  20464. },
  20465. url: "/user/repos"
  20466. },
  20467. createFork: {
  20468. method: "POST",
  20469. params: {
  20470. organization: {
  20471. type: "string"
  20472. },
  20473. owner: {
  20474. required: true,
  20475. type: "string"
  20476. },
  20477. repo: {
  20478. required: true,
  20479. type: "string"
  20480. }
  20481. },
  20482. url: "/repos/:owner/:repo/forks"
  20483. },
  20484. createHook: {
  20485. method: "POST",
  20486. params: {
  20487. active: {
  20488. type: "boolean"
  20489. },
  20490. config: {
  20491. required: true,
  20492. type: "object"
  20493. },
  20494. "config.content_type": {
  20495. type: "string"
  20496. },
  20497. "config.insecure_ssl": {
  20498. type: "string"
  20499. },
  20500. "config.secret": {
  20501. type: "string"
  20502. },
  20503. "config.url": {
  20504. required: true,
  20505. type: "string"
  20506. },
  20507. events: {
  20508. type: "string[]"
  20509. },
  20510. name: {
  20511. type: "string"
  20512. },
  20513. owner: {
  20514. required: true,
  20515. type: "string"
  20516. },
  20517. repo: {
  20518. required: true,
  20519. type: "string"
  20520. }
  20521. },
  20522. url: "/repos/:owner/:repo/hooks"
  20523. },
  20524. createInOrg: {
  20525. method: "POST",
  20526. params: {
  20527. allow_merge_commit: {
  20528. type: "boolean"
  20529. },
  20530. allow_rebase_merge: {
  20531. type: "boolean"
  20532. },
  20533. allow_squash_merge: {
  20534. type: "boolean"
  20535. },
  20536. auto_init: {
  20537. type: "boolean"
  20538. },
  20539. delete_branch_on_merge: {
  20540. type: "boolean"
  20541. },
  20542. description: {
  20543. type: "string"
  20544. },
  20545. gitignore_template: {
  20546. type: "string"
  20547. },
  20548. has_issues: {
  20549. type: "boolean"
  20550. },
  20551. has_projects: {
  20552. type: "boolean"
  20553. },
  20554. has_wiki: {
  20555. type: "boolean"
  20556. },
  20557. homepage: {
  20558. type: "string"
  20559. },
  20560. is_template: {
  20561. type: "boolean"
  20562. },
  20563. license_template: {
  20564. type: "string"
  20565. },
  20566. name: {
  20567. required: true,
  20568. type: "string"
  20569. },
  20570. org: {
  20571. required: true,
  20572. type: "string"
  20573. },
  20574. private: {
  20575. type: "boolean"
  20576. },
  20577. team_id: {
  20578. type: "integer"
  20579. },
  20580. visibility: {
  20581. enum: ["public", "private", "visibility", "internal"],
  20582. type: "string"
  20583. }
  20584. },
  20585. url: "/orgs/:org/repos"
  20586. },
  20587. createOrUpdateFile: {
  20588. method: "PUT",
  20589. params: {
  20590. author: {
  20591. type: "object"
  20592. },
  20593. "author.email": {
  20594. required: true,
  20595. type: "string"
  20596. },
  20597. "author.name": {
  20598. required: true,
  20599. type: "string"
  20600. },
  20601. branch: {
  20602. type: "string"
  20603. },
  20604. committer: {
  20605. type: "object"
  20606. },
  20607. "committer.email": {
  20608. required: true,
  20609. type: "string"
  20610. },
  20611. "committer.name": {
  20612. required: true,
  20613. type: "string"
  20614. },
  20615. content: {
  20616. required: true,
  20617. type: "string"
  20618. },
  20619. message: {
  20620. required: true,
  20621. type: "string"
  20622. },
  20623. owner: {
  20624. required: true,
  20625. type: "string"
  20626. },
  20627. path: {
  20628. required: true,
  20629. type: "string"
  20630. },
  20631. repo: {
  20632. required: true,
  20633. type: "string"
  20634. },
  20635. sha: {
  20636. type: "string"
  20637. }
  20638. },
  20639. url: "/repos/:owner/:repo/contents/:path"
  20640. },
  20641. createRelease: {
  20642. method: "POST",
  20643. params: {
  20644. body: {
  20645. type: "string"
  20646. },
  20647. draft: {
  20648. type: "boolean"
  20649. },
  20650. name: {
  20651. type: "string"
  20652. },
  20653. owner: {
  20654. required: true,
  20655. type: "string"
  20656. },
  20657. prerelease: {
  20658. type: "boolean"
  20659. },
  20660. repo: {
  20661. required: true,
  20662. type: "string"
  20663. },
  20664. tag_name: {
  20665. required: true,
  20666. type: "string"
  20667. },
  20668. target_commitish: {
  20669. type: "string"
  20670. }
  20671. },
  20672. url: "/repos/:owner/:repo/releases"
  20673. },
  20674. createStatus: {
  20675. method: "POST",
  20676. params: {
  20677. context: {
  20678. type: "string"
  20679. },
  20680. description: {
  20681. type: "string"
  20682. },
  20683. owner: {
  20684. required: true,
  20685. type: "string"
  20686. },
  20687. repo: {
  20688. required: true,
  20689. type: "string"
  20690. },
  20691. sha: {
  20692. required: true,
  20693. type: "string"
  20694. },
  20695. state: {
  20696. enum: ["error", "failure", "pending", "success"],
  20697. required: true,
  20698. type: "string"
  20699. },
  20700. target_url: {
  20701. type: "string"
  20702. }
  20703. },
  20704. url: "/repos/:owner/:repo/statuses/:sha"
  20705. },
  20706. createUsingTemplate: {
  20707. headers: {
  20708. accept: "application/vnd.github.baptiste-preview+json"
  20709. },
  20710. method: "POST",
  20711. params: {
  20712. description: {
  20713. type: "string"
  20714. },
  20715. name: {
  20716. required: true,
  20717. type: "string"
  20718. },
  20719. owner: {
  20720. type: "string"
  20721. },
  20722. private: {
  20723. type: "boolean"
  20724. },
  20725. template_owner: {
  20726. required: true,
  20727. type: "string"
  20728. },
  20729. template_repo: {
  20730. required: true,
  20731. type: "string"
  20732. }
  20733. },
  20734. url: "/repos/:template_owner/:template_repo/generate"
  20735. },
  20736. declineInvitation: {
  20737. method: "DELETE",
  20738. params: {
  20739. invitation_id: {
  20740. required: true,
  20741. type: "integer"
  20742. }
  20743. },
  20744. url: "/user/repository_invitations/:invitation_id"
  20745. },
  20746. delete: {
  20747. method: "DELETE",
  20748. params: {
  20749. owner: {
  20750. required: true,
  20751. type: "string"
  20752. },
  20753. repo: {
  20754. required: true,
  20755. type: "string"
  20756. }
  20757. },
  20758. url: "/repos/:owner/:repo"
  20759. },
  20760. deleteCommitComment: {
  20761. method: "DELETE",
  20762. params: {
  20763. comment_id: {
  20764. required: true,
  20765. type: "integer"
  20766. },
  20767. owner: {
  20768. required: true,
  20769. type: "string"
  20770. },
  20771. repo: {
  20772. required: true,
  20773. type: "string"
  20774. }
  20775. },
  20776. url: "/repos/:owner/:repo/comments/:comment_id"
  20777. },
  20778. deleteDownload: {
  20779. method: "DELETE",
  20780. params: {
  20781. download_id: {
  20782. required: true,
  20783. type: "integer"
  20784. },
  20785. owner: {
  20786. required: true,
  20787. type: "string"
  20788. },
  20789. repo: {
  20790. required: true,
  20791. type: "string"
  20792. }
  20793. },
  20794. url: "/repos/:owner/:repo/downloads/:download_id"
  20795. },
  20796. deleteFile: {
  20797. method: "DELETE",
  20798. params: {
  20799. author: {
  20800. type: "object"
  20801. },
  20802. "author.email": {
  20803. type: "string"
  20804. },
  20805. "author.name": {
  20806. type: "string"
  20807. },
  20808. branch: {
  20809. type: "string"
  20810. },
  20811. committer: {
  20812. type: "object"
  20813. },
  20814. "committer.email": {
  20815. type: "string"
  20816. },
  20817. "committer.name": {
  20818. type: "string"
  20819. },
  20820. message: {
  20821. required: true,
  20822. type: "string"
  20823. },
  20824. owner: {
  20825. required: true,
  20826. type: "string"
  20827. },
  20828. path: {
  20829. required: true,
  20830. type: "string"
  20831. },
  20832. repo: {
  20833. required: true,
  20834. type: "string"
  20835. },
  20836. sha: {
  20837. required: true,
  20838. type: "string"
  20839. }
  20840. },
  20841. url: "/repos/:owner/:repo/contents/:path"
  20842. },
  20843. deleteHook: {
  20844. method: "DELETE",
  20845. params: {
  20846. hook_id: {
  20847. required: true,
  20848. type: "integer"
  20849. },
  20850. owner: {
  20851. required: true,
  20852. type: "string"
  20853. },
  20854. repo: {
  20855. required: true,
  20856. type: "string"
  20857. }
  20858. },
  20859. url: "/repos/:owner/:repo/hooks/:hook_id"
  20860. },
  20861. deleteInvitation: {
  20862. method: "DELETE",
  20863. params: {
  20864. invitation_id: {
  20865. required: true,
  20866. type: "integer"
  20867. },
  20868. owner: {
  20869. required: true,
  20870. type: "string"
  20871. },
  20872. repo: {
  20873. required: true,
  20874. type: "string"
  20875. }
  20876. },
  20877. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20878. },
  20879. deleteRelease: {
  20880. method: "DELETE",
  20881. params: {
  20882. owner: {
  20883. required: true,
  20884. type: "string"
  20885. },
  20886. release_id: {
  20887. required: true,
  20888. type: "integer"
  20889. },
  20890. repo: {
  20891. required: true,
  20892. type: "string"
  20893. }
  20894. },
  20895. url: "/repos/:owner/:repo/releases/:release_id"
  20896. },
  20897. deleteReleaseAsset: {
  20898. method: "DELETE",
  20899. params: {
  20900. asset_id: {
  20901. required: true,
  20902. type: "integer"
  20903. },
  20904. owner: {
  20905. required: true,
  20906. type: "string"
  20907. },
  20908. repo: {
  20909. required: true,
  20910. type: "string"
  20911. }
  20912. },
  20913. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20914. },
  20915. disableAutomatedSecurityFixes: {
  20916. headers: {
  20917. accept: "application/vnd.github.london-preview+json"
  20918. },
  20919. method: "DELETE",
  20920. params: {
  20921. owner: {
  20922. required: true,
  20923. type: "string"
  20924. },
  20925. repo: {
  20926. required: true,
  20927. type: "string"
  20928. }
  20929. },
  20930. url: "/repos/:owner/:repo/automated-security-fixes"
  20931. },
  20932. disablePagesSite: {
  20933. headers: {
  20934. accept: "application/vnd.github.switcheroo-preview+json"
  20935. },
  20936. method: "DELETE",
  20937. params: {
  20938. owner: {
  20939. required: true,
  20940. type: "string"
  20941. },
  20942. repo: {
  20943. required: true,
  20944. type: "string"
  20945. }
  20946. },
  20947. url: "/repos/:owner/:repo/pages"
  20948. },
  20949. disableVulnerabilityAlerts: {
  20950. headers: {
  20951. accept: "application/vnd.github.dorian-preview+json"
  20952. },
  20953. method: "DELETE",
  20954. params: {
  20955. owner: {
  20956. required: true,
  20957. type: "string"
  20958. },
  20959. repo: {
  20960. required: true,
  20961. type: "string"
  20962. }
  20963. },
  20964. url: "/repos/:owner/:repo/vulnerability-alerts"
  20965. },
  20966. enableAutomatedSecurityFixes: {
  20967. headers: {
  20968. accept: "application/vnd.github.london-preview+json"
  20969. },
  20970. method: "PUT",
  20971. params: {
  20972. owner: {
  20973. required: true,
  20974. type: "string"
  20975. },
  20976. repo: {
  20977. required: true,
  20978. type: "string"
  20979. }
  20980. },
  20981. url: "/repos/:owner/:repo/automated-security-fixes"
  20982. },
  20983. enablePagesSite: {
  20984. headers: {
  20985. accept: "application/vnd.github.switcheroo-preview+json"
  20986. },
  20987. method: "POST",
  20988. params: {
  20989. owner: {
  20990. required: true,
  20991. type: "string"
  20992. },
  20993. repo: {
  20994. required: true,
  20995. type: "string"
  20996. },
  20997. source: {
  20998. type: "object"
  20999. },
  21000. "source.branch": {
  21001. enum: ["master", "gh-pages"],
  21002. type: "string"
  21003. },
  21004. "source.path": {
  21005. type: "string"
  21006. }
  21007. },
  21008. url: "/repos/:owner/:repo/pages"
  21009. },
  21010. enableVulnerabilityAlerts: {
  21011. headers: {
  21012. accept: "application/vnd.github.dorian-preview+json"
  21013. },
  21014. method: "PUT",
  21015. params: {
  21016. owner: {
  21017. required: true,
  21018. type: "string"
  21019. },
  21020. repo: {
  21021. required: true,
  21022. type: "string"
  21023. }
  21024. },
  21025. url: "/repos/:owner/:repo/vulnerability-alerts"
  21026. },
  21027. get: {
  21028. method: "GET",
  21029. params: {
  21030. owner: {
  21031. required: true,
  21032. type: "string"
  21033. },
  21034. repo: {
  21035. required: true,
  21036. type: "string"
  21037. }
  21038. },
  21039. url: "/repos/:owner/:repo"
  21040. },
  21041. getAppsWithAccessToProtectedBranch: {
  21042. method: "GET",
  21043. params: {
  21044. branch: {
  21045. required: true,
  21046. type: "string"
  21047. },
  21048. owner: {
  21049. required: true,
  21050. type: "string"
  21051. },
  21052. repo: {
  21053. required: true,
  21054. type: "string"
  21055. }
  21056. },
  21057. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21058. },
  21059. getArchiveLink: {
  21060. method: "GET",
  21061. params: {
  21062. archive_format: {
  21063. required: true,
  21064. type: "string"
  21065. },
  21066. owner: {
  21067. required: true,
  21068. type: "string"
  21069. },
  21070. ref: {
  21071. required: true,
  21072. type: "string"
  21073. },
  21074. repo: {
  21075. required: true,
  21076. type: "string"
  21077. }
  21078. },
  21079. url: "/repos/:owner/:repo/:archive_format/:ref"
  21080. },
  21081. getBranch: {
  21082. method: "GET",
  21083. params: {
  21084. branch: {
  21085. required: true,
  21086. type: "string"
  21087. },
  21088. owner: {
  21089. required: true,
  21090. type: "string"
  21091. },
  21092. repo: {
  21093. required: true,
  21094. type: "string"
  21095. }
  21096. },
  21097. url: "/repos/:owner/:repo/branches/:branch"
  21098. },
  21099. getBranchProtection: {
  21100. method: "GET",
  21101. params: {
  21102. branch: {
  21103. required: true,
  21104. type: "string"
  21105. },
  21106. owner: {
  21107. required: true,
  21108. type: "string"
  21109. },
  21110. repo: {
  21111. required: true,
  21112. type: "string"
  21113. }
  21114. },
  21115. url: "/repos/:owner/:repo/branches/:branch/protection"
  21116. },
  21117. getClones: {
  21118. method: "GET",
  21119. params: {
  21120. owner: {
  21121. required: true,
  21122. type: "string"
  21123. },
  21124. per: {
  21125. enum: ["day", "week"],
  21126. type: "string"
  21127. },
  21128. repo: {
  21129. required: true,
  21130. type: "string"
  21131. }
  21132. },
  21133. url: "/repos/:owner/:repo/traffic/clones"
  21134. },
  21135. getCodeFrequencyStats: {
  21136. method: "GET",
  21137. params: {
  21138. owner: {
  21139. required: true,
  21140. type: "string"
  21141. },
  21142. repo: {
  21143. required: true,
  21144. type: "string"
  21145. }
  21146. },
  21147. url: "/repos/:owner/:repo/stats/code_frequency"
  21148. },
  21149. getCollaboratorPermissionLevel: {
  21150. method: "GET",
  21151. params: {
  21152. owner: {
  21153. required: true,
  21154. type: "string"
  21155. },
  21156. repo: {
  21157. required: true,
  21158. type: "string"
  21159. },
  21160. username: {
  21161. required: true,
  21162. type: "string"
  21163. }
  21164. },
  21165. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21166. },
  21167. getCombinedStatusForRef: {
  21168. method: "GET",
  21169. params: {
  21170. owner: {
  21171. required: true,
  21172. type: "string"
  21173. },
  21174. ref: {
  21175. required: true,
  21176. type: "string"
  21177. },
  21178. repo: {
  21179. required: true,
  21180. type: "string"
  21181. }
  21182. },
  21183. url: "/repos/:owner/:repo/commits/:ref/status"
  21184. },
  21185. getCommit: {
  21186. method: "GET",
  21187. params: {
  21188. commit_sha: {
  21189. alias: "ref",
  21190. deprecated: true,
  21191. type: "string"
  21192. },
  21193. owner: {
  21194. required: true,
  21195. type: "string"
  21196. },
  21197. ref: {
  21198. required: true,
  21199. type: "string"
  21200. },
  21201. repo: {
  21202. required: true,
  21203. type: "string"
  21204. },
  21205. sha: {
  21206. alias: "ref",
  21207. deprecated: true,
  21208. type: "string"
  21209. }
  21210. },
  21211. url: "/repos/:owner/:repo/commits/:ref"
  21212. },
  21213. getCommitActivityStats: {
  21214. method: "GET",
  21215. params: {
  21216. owner: {
  21217. required: true,
  21218. type: "string"
  21219. },
  21220. repo: {
  21221. required: true,
  21222. type: "string"
  21223. }
  21224. },
  21225. url: "/repos/:owner/:repo/stats/commit_activity"
  21226. },
  21227. getCommitComment: {
  21228. method: "GET",
  21229. params: {
  21230. comment_id: {
  21231. required: true,
  21232. type: "integer"
  21233. },
  21234. owner: {
  21235. required: true,
  21236. type: "string"
  21237. },
  21238. repo: {
  21239. required: true,
  21240. type: "string"
  21241. }
  21242. },
  21243. url: "/repos/:owner/:repo/comments/:comment_id"
  21244. },
  21245. getCommitRefSha: {
  21246. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21247. headers: {
  21248. accept: "application/vnd.github.v3.sha"
  21249. },
  21250. method: "GET",
  21251. params: {
  21252. owner: {
  21253. required: true,
  21254. type: "string"
  21255. },
  21256. ref: {
  21257. required: true,
  21258. type: "string"
  21259. },
  21260. repo: {
  21261. required: true,
  21262. type: "string"
  21263. }
  21264. },
  21265. url: "/repos/:owner/:repo/commits/:ref"
  21266. },
  21267. getContents: {
  21268. method: "GET",
  21269. params: {
  21270. owner: {
  21271. required: true,
  21272. type: "string"
  21273. },
  21274. path: {
  21275. required: true,
  21276. type: "string"
  21277. },
  21278. ref: {
  21279. type: "string"
  21280. },
  21281. repo: {
  21282. required: true,
  21283. type: "string"
  21284. }
  21285. },
  21286. url: "/repos/:owner/:repo/contents/:path"
  21287. },
  21288. getContributorsStats: {
  21289. method: "GET",
  21290. params: {
  21291. owner: {
  21292. required: true,
  21293. type: "string"
  21294. },
  21295. repo: {
  21296. required: true,
  21297. type: "string"
  21298. }
  21299. },
  21300. url: "/repos/:owner/:repo/stats/contributors"
  21301. },
  21302. getDeployKey: {
  21303. method: "GET",
  21304. params: {
  21305. key_id: {
  21306. required: true,
  21307. type: "integer"
  21308. },
  21309. owner: {
  21310. required: true,
  21311. type: "string"
  21312. },
  21313. repo: {
  21314. required: true,
  21315. type: "string"
  21316. }
  21317. },
  21318. url: "/repos/:owner/:repo/keys/:key_id"
  21319. },
  21320. getDeployment: {
  21321. method: "GET",
  21322. params: {
  21323. deployment_id: {
  21324. required: true,
  21325. type: "integer"
  21326. },
  21327. owner: {
  21328. required: true,
  21329. type: "string"
  21330. },
  21331. repo: {
  21332. required: true,
  21333. type: "string"
  21334. }
  21335. },
  21336. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21337. },
  21338. getDeploymentStatus: {
  21339. method: "GET",
  21340. params: {
  21341. deployment_id: {
  21342. required: true,
  21343. type: "integer"
  21344. },
  21345. owner: {
  21346. required: true,
  21347. type: "string"
  21348. },
  21349. repo: {
  21350. required: true,
  21351. type: "string"
  21352. },
  21353. status_id: {
  21354. required: true,
  21355. type: "integer"
  21356. }
  21357. },
  21358. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21359. },
  21360. getDownload: {
  21361. method: "GET",
  21362. params: {
  21363. download_id: {
  21364. required: true,
  21365. type: "integer"
  21366. },
  21367. owner: {
  21368. required: true,
  21369. type: "string"
  21370. },
  21371. repo: {
  21372. required: true,
  21373. type: "string"
  21374. }
  21375. },
  21376. url: "/repos/:owner/:repo/downloads/:download_id"
  21377. },
  21378. getHook: {
  21379. method: "GET",
  21380. params: {
  21381. hook_id: {
  21382. required: true,
  21383. type: "integer"
  21384. },
  21385. owner: {
  21386. required: true,
  21387. type: "string"
  21388. },
  21389. repo: {
  21390. required: true,
  21391. type: "string"
  21392. }
  21393. },
  21394. url: "/repos/:owner/:repo/hooks/:hook_id"
  21395. },
  21396. getLatestPagesBuild: {
  21397. method: "GET",
  21398. params: {
  21399. owner: {
  21400. required: true,
  21401. type: "string"
  21402. },
  21403. repo: {
  21404. required: true,
  21405. type: "string"
  21406. }
  21407. },
  21408. url: "/repos/:owner/:repo/pages/builds/latest"
  21409. },
  21410. getLatestRelease: {
  21411. method: "GET",
  21412. params: {
  21413. owner: {
  21414. required: true,
  21415. type: "string"
  21416. },
  21417. repo: {
  21418. required: true,
  21419. type: "string"
  21420. }
  21421. },
  21422. url: "/repos/:owner/:repo/releases/latest"
  21423. },
  21424. getPages: {
  21425. method: "GET",
  21426. params: {
  21427. owner: {
  21428. required: true,
  21429. type: "string"
  21430. },
  21431. repo: {
  21432. required: true,
  21433. type: "string"
  21434. }
  21435. },
  21436. url: "/repos/:owner/:repo/pages"
  21437. },
  21438. getPagesBuild: {
  21439. method: "GET",
  21440. params: {
  21441. build_id: {
  21442. required: true,
  21443. type: "integer"
  21444. },
  21445. owner: {
  21446. required: true,
  21447. type: "string"
  21448. },
  21449. repo: {
  21450. required: true,
  21451. type: "string"
  21452. }
  21453. },
  21454. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21455. },
  21456. getParticipationStats: {
  21457. method: "GET",
  21458. params: {
  21459. owner: {
  21460. required: true,
  21461. type: "string"
  21462. },
  21463. repo: {
  21464. required: true,
  21465. type: "string"
  21466. }
  21467. },
  21468. url: "/repos/:owner/:repo/stats/participation"
  21469. },
  21470. getProtectedBranchAdminEnforcement: {
  21471. method: "GET",
  21472. params: {
  21473. branch: {
  21474. required: true,
  21475. type: "string"
  21476. },
  21477. owner: {
  21478. required: true,
  21479. type: "string"
  21480. },
  21481. repo: {
  21482. required: true,
  21483. type: "string"
  21484. }
  21485. },
  21486. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21487. },
  21488. getProtectedBranchPullRequestReviewEnforcement: {
  21489. method: "GET",
  21490. params: {
  21491. branch: {
  21492. required: true,
  21493. type: "string"
  21494. },
  21495. owner: {
  21496. required: true,
  21497. type: "string"
  21498. },
  21499. repo: {
  21500. required: true,
  21501. type: "string"
  21502. }
  21503. },
  21504. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21505. },
  21506. getProtectedBranchRequiredSignatures: {
  21507. headers: {
  21508. accept: "application/vnd.github.zzzax-preview+json"
  21509. },
  21510. method: "GET",
  21511. params: {
  21512. branch: {
  21513. required: true,
  21514. type: "string"
  21515. },
  21516. owner: {
  21517. required: true,
  21518. type: "string"
  21519. },
  21520. repo: {
  21521. required: true,
  21522. type: "string"
  21523. }
  21524. },
  21525. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21526. },
  21527. getProtectedBranchRequiredStatusChecks: {
  21528. method: "GET",
  21529. params: {
  21530. branch: {
  21531. required: true,
  21532. type: "string"
  21533. },
  21534. owner: {
  21535. required: true,
  21536. type: "string"
  21537. },
  21538. repo: {
  21539. required: true,
  21540. type: "string"
  21541. }
  21542. },
  21543. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21544. },
  21545. getProtectedBranchRestrictions: {
  21546. method: "GET",
  21547. params: {
  21548. branch: {
  21549. required: true,
  21550. type: "string"
  21551. },
  21552. owner: {
  21553. required: true,
  21554. type: "string"
  21555. },
  21556. repo: {
  21557. required: true,
  21558. type: "string"
  21559. }
  21560. },
  21561. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21562. },
  21563. getPunchCardStats: {
  21564. method: "GET",
  21565. params: {
  21566. owner: {
  21567. required: true,
  21568. type: "string"
  21569. },
  21570. repo: {
  21571. required: true,
  21572. type: "string"
  21573. }
  21574. },
  21575. url: "/repos/:owner/:repo/stats/punch_card"
  21576. },
  21577. getReadme: {
  21578. method: "GET",
  21579. params: {
  21580. owner: {
  21581. required: true,
  21582. type: "string"
  21583. },
  21584. ref: {
  21585. type: "string"
  21586. },
  21587. repo: {
  21588. required: true,
  21589. type: "string"
  21590. }
  21591. },
  21592. url: "/repos/:owner/:repo/readme"
  21593. },
  21594. getRelease: {
  21595. method: "GET",
  21596. params: {
  21597. owner: {
  21598. required: true,
  21599. type: "string"
  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"
  21611. },
  21612. getReleaseAsset: {
  21613. method: "GET",
  21614. params: {
  21615. asset_id: {
  21616. required: true,
  21617. type: "integer"
  21618. },
  21619. owner: {
  21620. required: true,
  21621. type: "string"
  21622. },
  21623. repo: {
  21624. required: true,
  21625. type: "string"
  21626. }
  21627. },
  21628. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21629. },
  21630. getReleaseByTag: {
  21631. method: "GET",
  21632. params: {
  21633. owner: {
  21634. required: true,
  21635. type: "string"
  21636. },
  21637. repo: {
  21638. required: true,
  21639. type: "string"
  21640. },
  21641. tag: {
  21642. required: true,
  21643. type: "string"
  21644. }
  21645. },
  21646. url: "/repos/:owner/:repo/releases/tags/:tag"
  21647. },
  21648. getTeamsWithAccessToProtectedBranch: {
  21649. method: "GET",
  21650. params: {
  21651. branch: {
  21652. required: true,
  21653. type: "string"
  21654. },
  21655. owner: {
  21656. required: true,
  21657. type: "string"
  21658. },
  21659. repo: {
  21660. required: true,
  21661. type: "string"
  21662. }
  21663. },
  21664. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21665. },
  21666. getTopPaths: {
  21667. method: "GET",
  21668. params: {
  21669. owner: {
  21670. required: true,
  21671. type: "string"
  21672. },
  21673. repo: {
  21674. required: true,
  21675. type: "string"
  21676. }
  21677. },
  21678. url: "/repos/:owner/:repo/traffic/popular/paths"
  21679. },
  21680. getTopReferrers: {
  21681. method: "GET",
  21682. params: {
  21683. owner: {
  21684. required: true,
  21685. type: "string"
  21686. },
  21687. repo: {
  21688. required: true,
  21689. type: "string"
  21690. }
  21691. },
  21692. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21693. },
  21694. getUsersWithAccessToProtectedBranch: {
  21695. method: "GET",
  21696. params: {
  21697. branch: {
  21698. required: true,
  21699. type: "string"
  21700. },
  21701. owner: {
  21702. required: true,
  21703. type: "string"
  21704. },
  21705. repo: {
  21706. required: true,
  21707. type: "string"
  21708. }
  21709. },
  21710. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21711. },
  21712. getViews: {
  21713. method: "GET",
  21714. params: {
  21715. owner: {
  21716. required: true,
  21717. type: "string"
  21718. },
  21719. per: {
  21720. enum: ["day", "week"],
  21721. type: "string"
  21722. },
  21723. repo: {
  21724. required: true,
  21725. type: "string"
  21726. }
  21727. },
  21728. url: "/repos/:owner/:repo/traffic/views"
  21729. },
  21730. list: {
  21731. method: "GET",
  21732. params: {
  21733. affiliation: {
  21734. type: "string"
  21735. },
  21736. direction: {
  21737. enum: ["asc", "desc"],
  21738. type: "string"
  21739. },
  21740. page: {
  21741. type: "integer"
  21742. },
  21743. per_page: {
  21744. type: "integer"
  21745. },
  21746. sort: {
  21747. enum: ["created", "updated", "pushed", "full_name"],
  21748. type: "string"
  21749. },
  21750. type: {
  21751. enum: ["all", "owner", "public", "private", "member"],
  21752. type: "string"
  21753. },
  21754. visibility: {
  21755. enum: ["all", "public", "private"],
  21756. type: "string"
  21757. }
  21758. },
  21759. url: "/user/repos"
  21760. },
  21761. listAppsWithAccessToProtectedBranch: {
  21762. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21763. method: "GET",
  21764. params: {
  21765. branch: {
  21766. required: true,
  21767. type: "string"
  21768. },
  21769. owner: {
  21770. required: true,
  21771. type: "string"
  21772. },
  21773. repo: {
  21774. required: true,
  21775. type: "string"
  21776. }
  21777. },
  21778. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21779. },
  21780. listAssetsForRelease: {
  21781. method: "GET",
  21782. params: {
  21783. owner: {
  21784. required: true,
  21785. type: "string"
  21786. },
  21787. page: {
  21788. type: "integer"
  21789. },
  21790. per_page: {
  21791. type: "integer"
  21792. },
  21793. release_id: {
  21794. required: true,
  21795. type: "integer"
  21796. },
  21797. repo: {
  21798. required: true,
  21799. type: "string"
  21800. }
  21801. },
  21802. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21803. },
  21804. listBranches: {
  21805. method: "GET",
  21806. params: {
  21807. owner: {
  21808. required: true,
  21809. type: "string"
  21810. },
  21811. page: {
  21812. type: "integer"
  21813. },
  21814. per_page: {
  21815. type: "integer"
  21816. },
  21817. protected: {
  21818. type: "boolean"
  21819. },
  21820. repo: {
  21821. required: true,
  21822. type: "string"
  21823. }
  21824. },
  21825. url: "/repos/:owner/:repo/branches"
  21826. },
  21827. listBranchesForHeadCommit: {
  21828. headers: {
  21829. accept: "application/vnd.github.groot-preview+json"
  21830. },
  21831. method: "GET",
  21832. params: {
  21833. commit_sha: {
  21834. required: true,
  21835. type: "string"
  21836. },
  21837. owner: {
  21838. required: true,
  21839. type: "string"
  21840. },
  21841. repo: {
  21842. required: true,
  21843. type: "string"
  21844. }
  21845. },
  21846. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21847. },
  21848. listCollaborators: {
  21849. method: "GET",
  21850. params: {
  21851. affiliation: {
  21852. enum: ["outside", "direct", "all"],
  21853. type: "string"
  21854. },
  21855. owner: {
  21856. required: true,
  21857. type: "string"
  21858. },
  21859. page: {
  21860. type: "integer"
  21861. },
  21862. per_page: {
  21863. type: "integer"
  21864. },
  21865. repo: {
  21866. required: true,
  21867. type: "string"
  21868. }
  21869. },
  21870. url: "/repos/:owner/:repo/collaborators"
  21871. },
  21872. listCommentsForCommit: {
  21873. method: "GET",
  21874. params: {
  21875. commit_sha: {
  21876. required: true,
  21877. type: "string"
  21878. },
  21879. owner: {
  21880. required: true,
  21881. type: "string"
  21882. },
  21883. page: {
  21884. type: "integer"
  21885. },
  21886. per_page: {
  21887. type: "integer"
  21888. },
  21889. ref: {
  21890. alias: "commit_sha",
  21891. deprecated: true,
  21892. type: "string"
  21893. },
  21894. repo: {
  21895. required: true,
  21896. type: "string"
  21897. }
  21898. },
  21899. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21900. },
  21901. listCommitComments: {
  21902. method: "GET",
  21903. params: {
  21904. owner: {
  21905. required: true,
  21906. type: "string"
  21907. },
  21908. page: {
  21909. type: "integer"
  21910. },
  21911. per_page: {
  21912. type: "integer"
  21913. },
  21914. repo: {
  21915. required: true,
  21916. type: "string"
  21917. }
  21918. },
  21919. url: "/repos/:owner/:repo/comments"
  21920. },
  21921. listCommits: {
  21922. method: "GET",
  21923. params: {
  21924. author: {
  21925. type: "string"
  21926. },
  21927. owner: {
  21928. required: true,
  21929. type: "string"
  21930. },
  21931. page: {
  21932. type: "integer"
  21933. },
  21934. path: {
  21935. type: "string"
  21936. },
  21937. per_page: {
  21938. type: "integer"
  21939. },
  21940. repo: {
  21941. required: true,
  21942. type: "string"
  21943. },
  21944. sha: {
  21945. type: "string"
  21946. },
  21947. since: {
  21948. type: "string"
  21949. },
  21950. until: {
  21951. type: "string"
  21952. }
  21953. },
  21954. url: "/repos/:owner/:repo/commits"
  21955. },
  21956. listContributors: {
  21957. method: "GET",
  21958. params: {
  21959. anon: {
  21960. type: "string"
  21961. },
  21962. owner: {
  21963. required: true,
  21964. type: "string"
  21965. },
  21966. page: {
  21967. type: "integer"
  21968. },
  21969. per_page: {
  21970. type: "integer"
  21971. },
  21972. repo: {
  21973. required: true,
  21974. type: "string"
  21975. }
  21976. },
  21977. url: "/repos/:owner/:repo/contributors"
  21978. },
  21979. listDeployKeys: {
  21980. method: "GET",
  21981. params: {
  21982. owner: {
  21983. required: true,
  21984. type: "string"
  21985. },
  21986. page: {
  21987. type: "integer"
  21988. },
  21989. per_page: {
  21990. type: "integer"
  21991. },
  21992. repo: {
  21993. required: true,
  21994. type: "string"
  21995. }
  21996. },
  21997. url: "/repos/:owner/:repo/keys"
  21998. },
  21999. listDeploymentStatuses: {
  22000. method: "GET",
  22001. params: {
  22002. deployment_id: {
  22003. required: true,
  22004. type: "integer"
  22005. },
  22006. owner: {
  22007. required: true,
  22008. type: "string"
  22009. },
  22010. page: {
  22011. type: "integer"
  22012. },
  22013. per_page: {
  22014. type: "integer"
  22015. },
  22016. repo: {
  22017. required: true,
  22018. type: "string"
  22019. }
  22020. },
  22021. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22022. },
  22023. listDeployments: {
  22024. method: "GET",
  22025. params: {
  22026. environment: {
  22027. type: "string"
  22028. },
  22029. owner: {
  22030. required: true,
  22031. type: "string"
  22032. },
  22033. page: {
  22034. type: "integer"
  22035. },
  22036. per_page: {
  22037. type: "integer"
  22038. },
  22039. ref: {
  22040. type: "string"
  22041. },
  22042. repo: {
  22043. required: true,
  22044. type: "string"
  22045. },
  22046. sha: {
  22047. type: "string"
  22048. },
  22049. task: {
  22050. type: "string"
  22051. }
  22052. },
  22053. url: "/repos/:owner/:repo/deployments"
  22054. },
  22055. listDownloads: {
  22056. method: "GET",
  22057. params: {
  22058. owner: {
  22059. required: true,
  22060. type: "string"
  22061. },
  22062. page: {
  22063. type: "integer"
  22064. },
  22065. per_page: {
  22066. type: "integer"
  22067. },
  22068. repo: {
  22069. required: true,
  22070. type: "string"
  22071. }
  22072. },
  22073. url: "/repos/:owner/:repo/downloads"
  22074. },
  22075. listForOrg: {
  22076. method: "GET",
  22077. params: {
  22078. direction: {
  22079. enum: ["asc", "desc"],
  22080. type: "string"
  22081. },
  22082. org: {
  22083. required: true,
  22084. type: "string"
  22085. },
  22086. page: {
  22087. type: "integer"
  22088. },
  22089. per_page: {
  22090. type: "integer"
  22091. },
  22092. sort: {
  22093. enum: ["created", "updated", "pushed", "full_name"],
  22094. type: "string"
  22095. },
  22096. type: {
  22097. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22098. type: "string"
  22099. }
  22100. },
  22101. url: "/orgs/:org/repos"
  22102. },
  22103. listForUser: {
  22104. method: "GET",
  22105. params: {
  22106. direction: {
  22107. enum: ["asc", "desc"],
  22108. type: "string"
  22109. },
  22110. page: {
  22111. type: "integer"
  22112. },
  22113. per_page: {
  22114. type: "integer"
  22115. },
  22116. sort: {
  22117. enum: ["created", "updated", "pushed", "full_name"],
  22118. type: "string"
  22119. },
  22120. type: {
  22121. enum: ["all", "owner", "member"],
  22122. type: "string"
  22123. },
  22124. username: {
  22125. required: true,
  22126. type: "string"
  22127. }
  22128. },
  22129. url: "/users/:username/repos"
  22130. },
  22131. listForks: {
  22132. method: "GET",
  22133. params: {
  22134. owner: {
  22135. required: true,
  22136. type: "string"
  22137. },
  22138. page: {
  22139. type: "integer"
  22140. },
  22141. per_page: {
  22142. type: "integer"
  22143. },
  22144. repo: {
  22145. required: true,
  22146. type: "string"
  22147. },
  22148. sort: {
  22149. enum: ["newest", "oldest", "stargazers"],
  22150. type: "string"
  22151. }
  22152. },
  22153. url: "/repos/:owner/:repo/forks"
  22154. },
  22155. listHooks: {
  22156. method: "GET",
  22157. params: {
  22158. owner: {
  22159. required: true,
  22160. type: "string"
  22161. },
  22162. page: {
  22163. type: "integer"
  22164. },
  22165. per_page: {
  22166. type: "integer"
  22167. },
  22168. repo: {
  22169. required: true,
  22170. type: "string"
  22171. }
  22172. },
  22173. url: "/repos/:owner/:repo/hooks"
  22174. },
  22175. listInvitations: {
  22176. method: "GET",
  22177. params: {
  22178. owner: {
  22179. required: true,
  22180. type: "string"
  22181. },
  22182. page: {
  22183. type: "integer"
  22184. },
  22185. per_page: {
  22186. type: "integer"
  22187. },
  22188. repo: {
  22189. required: true,
  22190. type: "string"
  22191. }
  22192. },
  22193. url: "/repos/:owner/:repo/invitations"
  22194. },
  22195. listInvitationsForAuthenticatedUser: {
  22196. method: "GET",
  22197. params: {
  22198. page: {
  22199. type: "integer"
  22200. },
  22201. per_page: {
  22202. type: "integer"
  22203. }
  22204. },
  22205. url: "/user/repository_invitations"
  22206. },
  22207. listLanguages: {
  22208. method: "GET",
  22209. params: {
  22210. owner: {
  22211. required: true,
  22212. type: "string"
  22213. },
  22214. repo: {
  22215. required: true,
  22216. type: "string"
  22217. }
  22218. },
  22219. url: "/repos/:owner/:repo/languages"
  22220. },
  22221. listPagesBuilds: {
  22222. method: "GET",
  22223. params: {
  22224. owner: {
  22225. required: true,
  22226. type: "string"
  22227. },
  22228. page: {
  22229. type: "integer"
  22230. },
  22231. per_page: {
  22232. type: "integer"
  22233. },
  22234. repo: {
  22235. required: true,
  22236. type: "string"
  22237. }
  22238. },
  22239. url: "/repos/:owner/:repo/pages/builds"
  22240. },
  22241. listProtectedBranchRequiredStatusChecksContexts: {
  22242. method: "GET",
  22243. params: {
  22244. branch: {
  22245. required: true,
  22246. type: "string"
  22247. },
  22248. owner: {
  22249. required: true,
  22250. type: "string"
  22251. },
  22252. repo: {
  22253. required: true,
  22254. type: "string"
  22255. }
  22256. },
  22257. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22258. },
  22259. listProtectedBranchTeamRestrictions: {
  22260. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22261. method: "GET",
  22262. params: {
  22263. branch: {
  22264. required: true,
  22265. type: "string"
  22266. },
  22267. owner: {
  22268. required: true,
  22269. type: "string"
  22270. },
  22271. repo: {
  22272. required: true,
  22273. type: "string"
  22274. }
  22275. },
  22276. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22277. },
  22278. listProtectedBranchUserRestrictions: {
  22279. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22280. method: "GET",
  22281. params: {
  22282. branch: {
  22283. required: true,
  22284. type: "string"
  22285. },
  22286. owner: {
  22287. required: true,
  22288. type: "string"
  22289. },
  22290. repo: {
  22291. required: true,
  22292. type: "string"
  22293. }
  22294. },
  22295. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22296. },
  22297. listPublic: {
  22298. method: "GET",
  22299. params: {
  22300. page: {
  22301. type: "integer"
  22302. },
  22303. per_page: {
  22304. type: "integer"
  22305. },
  22306. since: {
  22307. type: "integer"
  22308. }
  22309. },
  22310. url: "/repositories"
  22311. },
  22312. listPullRequestsAssociatedWithCommit: {
  22313. headers: {
  22314. accept: "application/vnd.github.groot-preview+json"
  22315. },
  22316. method: "GET",
  22317. params: {
  22318. commit_sha: {
  22319. required: true,
  22320. type: "string"
  22321. },
  22322. owner: {
  22323. required: true,
  22324. type: "string"
  22325. },
  22326. page: {
  22327. type: "integer"
  22328. },
  22329. per_page: {
  22330. type: "integer"
  22331. },
  22332. repo: {
  22333. required: true,
  22334. type: "string"
  22335. }
  22336. },
  22337. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22338. },
  22339. listReleases: {
  22340. method: "GET",
  22341. params: {
  22342. owner: {
  22343. required: true,
  22344. type: "string"
  22345. },
  22346. page: {
  22347. type: "integer"
  22348. },
  22349. per_page: {
  22350. type: "integer"
  22351. },
  22352. repo: {
  22353. required: true,
  22354. type: "string"
  22355. }
  22356. },
  22357. url: "/repos/:owner/:repo/releases"
  22358. },
  22359. listStatusesForRef: {
  22360. method: "GET",
  22361. params: {
  22362. owner: {
  22363. required: true,
  22364. type: "string"
  22365. },
  22366. page: {
  22367. type: "integer"
  22368. },
  22369. per_page: {
  22370. type: "integer"
  22371. },
  22372. ref: {
  22373. required: true,
  22374. type: "string"
  22375. },
  22376. repo: {
  22377. required: true,
  22378. type: "string"
  22379. }
  22380. },
  22381. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22382. },
  22383. listTags: {
  22384. method: "GET",
  22385. params: {
  22386. owner: {
  22387. required: true,
  22388. type: "string"
  22389. },
  22390. page: {
  22391. type: "integer"
  22392. },
  22393. per_page: {
  22394. type: "integer"
  22395. },
  22396. repo: {
  22397. required: true,
  22398. type: "string"
  22399. }
  22400. },
  22401. url: "/repos/:owner/:repo/tags"
  22402. },
  22403. listTeams: {
  22404. method: "GET",
  22405. params: {
  22406. owner: {
  22407. required: true,
  22408. type: "string"
  22409. },
  22410. page: {
  22411. type: "integer"
  22412. },
  22413. per_page: {
  22414. type: "integer"
  22415. },
  22416. repo: {
  22417. required: true,
  22418. type: "string"
  22419. }
  22420. },
  22421. url: "/repos/:owner/:repo/teams"
  22422. },
  22423. listTeamsWithAccessToProtectedBranch: {
  22424. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22425. method: "GET",
  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/restrictions/teams"
  22441. },
  22442. listTopics: {
  22443. headers: {
  22444. accept: "application/vnd.github.mercy-preview+json"
  22445. },
  22446. method: "GET",
  22447. params: {
  22448. owner: {
  22449. required: true,
  22450. type: "string"
  22451. },
  22452. repo: {
  22453. required: true,
  22454. type: "string"
  22455. }
  22456. },
  22457. url: "/repos/:owner/:repo/topics"
  22458. },
  22459. listUsersWithAccessToProtectedBranch: {
  22460. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22461. method: "GET",
  22462. params: {
  22463. branch: {
  22464. required: true,
  22465. type: "string"
  22466. },
  22467. owner: {
  22468. required: true,
  22469. type: "string"
  22470. },
  22471. repo: {
  22472. required: true,
  22473. type: "string"
  22474. }
  22475. },
  22476. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22477. },
  22478. merge: {
  22479. method: "POST",
  22480. params: {
  22481. base: {
  22482. required: true,
  22483. type: "string"
  22484. },
  22485. commit_message: {
  22486. type: "string"
  22487. },
  22488. head: {
  22489. required: true,
  22490. type: "string"
  22491. },
  22492. owner: {
  22493. required: true,
  22494. type: "string"
  22495. },
  22496. repo: {
  22497. required: true,
  22498. type: "string"
  22499. }
  22500. },
  22501. url: "/repos/:owner/:repo/merges"
  22502. },
  22503. pingHook: {
  22504. method: "POST",
  22505. params: {
  22506. hook_id: {
  22507. required: true,
  22508. type: "integer"
  22509. },
  22510. owner: {
  22511. required: true,
  22512. type: "string"
  22513. },
  22514. repo: {
  22515. required: true,
  22516. type: "string"
  22517. }
  22518. },
  22519. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22520. },
  22521. removeBranchProtection: {
  22522. method: "DELETE",
  22523. params: {
  22524. branch: {
  22525. required: true,
  22526. type: "string"
  22527. },
  22528. owner: {
  22529. required: true,
  22530. type: "string"
  22531. },
  22532. repo: {
  22533. required: true,
  22534. type: "string"
  22535. }
  22536. },
  22537. url: "/repos/:owner/:repo/branches/:branch/protection"
  22538. },
  22539. removeCollaborator: {
  22540. method: "DELETE",
  22541. params: {
  22542. owner: {
  22543. required: true,
  22544. type: "string"
  22545. },
  22546. repo: {
  22547. required: true,
  22548. type: "string"
  22549. },
  22550. username: {
  22551. required: true,
  22552. type: "string"
  22553. }
  22554. },
  22555. url: "/repos/:owner/:repo/collaborators/:username"
  22556. },
  22557. removeDeployKey: {
  22558. method: "DELETE",
  22559. params: {
  22560. key_id: {
  22561. required: true,
  22562. type: "integer"
  22563. },
  22564. owner: {
  22565. required: true,
  22566. type: "string"
  22567. },
  22568. repo: {
  22569. required: true,
  22570. type: "string"
  22571. }
  22572. },
  22573. url: "/repos/:owner/:repo/keys/:key_id"
  22574. },
  22575. removeProtectedBranchAdminEnforcement: {
  22576. method: "DELETE",
  22577. params: {
  22578. branch: {
  22579. required: true,
  22580. type: "string"
  22581. },
  22582. owner: {
  22583. required: true,
  22584. type: "string"
  22585. },
  22586. repo: {
  22587. required: true,
  22588. type: "string"
  22589. }
  22590. },
  22591. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22592. },
  22593. removeProtectedBranchAppRestrictions: {
  22594. method: "DELETE",
  22595. params: {
  22596. apps: {
  22597. mapTo: "data",
  22598. required: true,
  22599. type: "string[]"
  22600. },
  22601. branch: {
  22602. required: true,
  22603. type: "string"
  22604. },
  22605. owner: {
  22606. required: true,
  22607. type: "string"
  22608. },
  22609. repo: {
  22610. required: true,
  22611. type: "string"
  22612. }
  22613. },
  22614. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22615. },
  22616. removeProtectedBranchPullRequestReviewEnforcement: {
  22617. method: "DELETE",
  22618. params: {
  22619. branch: {
  22620. required: true,
  22621. type: "string"
  22622. },
  22623. owner: {
  22624. required: true,
  22625. type: "string"
  22626. },
  22627. repo: {
  22628. required: true,
  22629. type: "string"
  22630. }
  22631. },
  22632. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22633. },
  22634. removeProtectedBranchRequiredSignatures: {
  22635. headers: {
  22636. accept: "application/vnd.github.zzzax-preview+json"
  22637. },
  22638. method: "DELETE",
  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. },
  22653. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22654. },
  22655. removeProtectedBranchRequiredStatusChecks: {
  22656. method: "DELETE",
  22657. params: {
  22658. branch: {
  22659. required: true,
  22660. type: "string"
  22661. },
  22662. owner: {
  22663. required: true,
  22664. type: "string"
  22665. },
  22666. repo: {
  22667. required: true,
  22668. type: "string"
  22669. }
  22670. },
  22671. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22672. },
  22673. removeProtectedBranchRequiredStatusChecksContexts: {
  22674. method: "DELETE",
  22675. params: {
  22676. branch: {
  22677. required: true,
  22678. type: "string"
  22679. },
  22680. contexts: {
  22681. mapTo: "data",
  22682. required: true,
  22683. type: "string[]"
  22684. },
  22685. owner: {
  22686. required: true,
  22687. type: "string"
  22688. },
  22689. repo: {
  22690. required: true,
  22691. type: "string"
  22692. }
  22693. },
  22694. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22695. },
  22696. removeProtectedBranchRestrictions: {
  22697. method: "DELETE",
  22698. params: {
  22699. branch: {
  22700. required: true,
  22701. type: "string"
  22702. },
  22703. owner: {
  22704. required: true,
  22705. type: "string"
  22706. },
  22707. repo: {
  22708. required: true,
  22709. type: "string"
  22710. }
  22711. },
  22712. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22713. },
  22714. removeProtectedBranchTeamRestrictions: {
  22715. method: "DELETE",
  22716. params: {
  22717. branch: {
  22718. required: true,
  22719. type: "string"
  22720. },
  22721. owner: {
  22722. required: true,
  22723. type: "string"
  22724. },
  22725. repo: {
  22726. required: true,
  22727. type: "string"
  22728. },
  22729. teams: {
  22730. mapTo: "data",
  22731. required: true,
  22732. type: "string[]"
  22733. }
  22734. },
  22735. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22736. },
  22737. removeProtectedBranchUserRestrictions: {
  22738. method: "DELETE",
  22739. params: {
  22740. branch: {
  22741. required: true,
  22742. type: "string"
  22743. },
  22744. owner: {
  22745. required: true,
  22746. type: "string"
  22747. },
  22748. repo: {
  22749. required: true,
  22750. type: "string"
  22751. },
  22752. users: {
  22753. mapTo: "data",
  22754. required: true,
  22755. type: "string[]"
  22756. }
  22757. },
  22758. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22759. },
  22760. replaceProtectedBranchAppRestrictions: {
  22761. method: "PUT",
  22762. params: {
  22763. apps: {
  22764. mapTo: "data",
  22765. required: true,
  22766. type: "string[]"
  22767. },
  22768. branch: {
  22769. required: true,
  22770. type: "string"
  22771. },
  22772. owner: {
  22773. required: true,
  22774. type: "string"
  22775. },
  22776. repo: {
  22777. required: true,
  22778. type: "string"
  22779. }
  22780. },
  22781. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22782. },
  22783. replaceProtectedBranchRequiredStatusChecksContexts: {
  22784. method: "PUT",
  22785. params: {
  22786. branch: {
  22787. required: true,
  22788. type: "string"
  22789. },
  22790. contexts: {
  22791. mapTo: "data",
  22792. required: true,
  22793. type: "string[]"
  22794. },
  22795. owner: {
  22796. required: true,
  22797. type: "string"
  22798. },
  22799. repo: {
  22800. required: true,
  22801. type: "string"
  22802. }
  22803. },
  22804. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22805. },
  22806. replaceProtectedBranchTeamRestrictions: {
  22807. method: "PUT",
  22808. params: {
  22809. branch: {
  22810. required: true,
  22811. type: "string"
  22812. },
  22813. owner: {
  22814. required: true,
  22815. type: "string"
  22816. },
  22817. repo: {
  22818. required: true,
  22819. type: "string"
  22820. },
  22821. teams: {
  22822. mapTo: "data",
  22823. required: true,
  22824. type: "string[]"
  22825. }
  22826. },
  22827. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22828. },
  22829. replaceProtectedBranchUserRestrictions: {
  22830. method: "PUT",
  22831. params: {
  22832. branch: {
  22833. required: true,
  22834. type: "string"
  22835. },
  22836. owner: {
  22837. required: true,
  22838. type: "string"
  22839. },
  22840. repo: {
  22841. required: true,
  22842. type: "string"
  22843. },
  22844. users: {
  22845. mapTo: "data",
  22846. required: true,
  22847. type: "string[]"
  22848. }
  22849. },
  22850. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22851. },
  22852. replaceTopics: {
  22853. headers: {
  22854. accept: "application/vnd.github.mercy-preview+json"
  22855. },
  22856. method: "PUT",
  22857. params: {
  22858. names: {
  22859. required: true,
  22860. type: "string[]"
  22861. },
  22862. owner: {
  22863. required: true,
  22864. type: "string"
  22865. },
  22866. repo: {
  22867. required: true,
  22868. type: "string"
  22869. }
  22870. },
  22871. url: "/repos/:owner/:repo/topics"
  22872. },
  22873. requestPageBuild: {
  22874. method: "POST",
  22875. params: {
  22876. owner: {
  22877. required: true,
  22878. type: "string"
  22879. },
  22880. repo: {
  22881. required: true,
  22882. type: "string"
  22883. }
  22884. },
  22885. url: "/repos/:owner/:repo/pages/builds"
  22886. },
  22887. retrieveCommunityProfileMetrics: {
  22888. method: "GET",
  22889. params: {
  22890. owner: {
  22891. required: true,
  22892. type: "string"
  22893. },
  22894. repo: {
  22895. required: true,
  22896. type: "string"
  22897. }
  22898. },
  22899. url: "/repos/:owner/:repo/community/profile"
  22900. },
  22901. testPushHook: {
  22902. method: "POST",
  22903. params: {
  22904. hook_id: {
  22905. required: true,
  22906. type: "integer"
  22907. },
  22908. owner: {
  22909. required: true,
  22910. type: "string"
  22911. },
  22912. repo: {
  22913. required: true,
  22914. type: "string"
  22915. }
  22916. },
  22917. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22918. },
  22919. transfer: {
  22920. method: "POST",
  22921. params: {
  22922. new_owner: {
  22923. type: "string"
  22924. },
  22925. owner: {
  22926. required: true,
  22927. type: "string"
  22928. },
  22929. repo: {
  22930. required: true,
  22931. type: "string"
  22932. },
  22933. team_ids: {
  22934. type: "integer[]"
  22935. }
  22936. },
  22937. url: "/repos/:owner/:repo/transfer"
  22938. },
  22939. update: {
  22940. method: "PATCH",
  22941. params: {
  22942. allow_merge_commit: {
  22943. type: "boolean"
  22944. },
  22945. allow_rebase_merge: {
  22946. type: "boolean"
  22947. },
  22948. allow_squash_merge: {
  22949. type: "boolean"
  22950. },
  22951. archived: {
  22952. type: "boolean"
  22953. },
  22954. default_branch: {
  22955. type: "string"
  22956. },
  22957. delete_branch_on_merge: {
  22958. type: "boolean"
  22959. },
  22960. description: {
  22961. type: "string"
  22962. },
  22963. has_issues: {
  22964. type: "boolean"
  22965. },
  22966. has_projects: {
  22967. type: "boolean"
  22968. },
  22969. has_wiki: {
  22970. type: "boolean"
  22971. },
  22972. homepage: {
  22973. type: "string"
  22974. },
  22975. is_template: {
  22976. type: "boolean"
  22977. },
  22978. name: {
  22979. type: "string"
  22980. },
  22981. owner: {
  22982. required: true,
  22983. type: "string"
  22984. },
  22985. private: {
  22986. type: "boolean"
  22987. },
  22988. repo: {
  22989. required: true,
  22990. type: "string"
  22991. },
  22992. visibility: {
  22993. enum: ["public", "private", "visibility", "internal"],
  22994. type: "string"
  22995. }
  22996. },
  22997. url: "/repos/:owner/:repo"
  22998. },
  22999. updateBranchProtection: {
  23000. method: "PUT",
  23001. params: {
  23002. allow_deletions: {
  23003. type: "boolean"
  23004. },
  23005. allow_force_pushes: {
  23006. allowNull: true,
  23007. type: "boolean"
  23008. },
  23009. branch: {
  23010. required: true,
  23011. type: "string"
  23012. },
  23013. enforce_admins: {
  23014. allowNull: true,
  23015. required: true,
  23016. type: "boolean"
  23017. },
  23018. owner: {
  23019. required: true,
  23020. type: "string"
  23021. },
  23022. repo: {
  23023. required: true,
  23024. type: "string"
  23025. },
  23026. required_linear_history: {
  23027. type: "boolean"
  23028. },
  23029. required_pull_request_reviews: {
  23030. allowNull: true,
  23031. required: true,
  23032. type: "object"
  23033. },
  23034. "required_pull_request_reviews.dismiss_stale_reviews": {
  23035. type: "boolean"
  23036. },
  23037. "required_pull_request_reviews.dismissal_restrictions": {
  23038. type: "object"
  23039. },
  23040. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23041. type: "string[]"
  23042. },
  23043. "required_pull_request_reviews.dismissal_restrictions.users": {
  23044. type: "string[]"
  23045. },
  23046. "required_pull_request_reviews.require_code_owner_reviews": {
  23047. type: "boolean"
  23048. },
  23049. "required_pull_request_reviews.required_approving_review_count": {
  23050. type: "integer"
  23051. },
  23052. required_status_checks: {
  23053. allowNull: true,
  23054. required: true,
  23055. type: "object"
  23056. },
  23057. "required_status_checks.contexts": {
  23058. required: true,
  23059. type: "string[]"
  23060. },
  23061. "required_status_checks.strict": {
  23062. required: true,
  23063. type: "boolean"
  23064. },
  23065. restrictions: {
  23066. allowNull: true,
  23067. required: true,
  23068. type: "object"
  23069. },
  23070. "restrictions.apps": {
  23071. type: "string[]"
  23072. },
  23073. "restrictions.teams": {
  23074. required: true,
  23075. type: "string[]"
  23076. },
  23077. "restrictions.users": {
  23078. required: true,
  23079. type: "string[]"
  23080. }
  23081. },
  23082. url: "/repos/:owner/:repo/branches/:branch/protection"
  23083. },
  23084. updateCommitComment: {
  23085. method: "PATCH",
  23086. params: {
  23087. body: {
  23088. required: true,
  23089. type: "string"
  23090. },
  23091. comment_id: {
  23092. required: true,
  23093. type: "integer"
  23094. },
  23095. owner: {
  23096. required: true,
  23097. type: "string"
  23098. },
  23099. repo: {
  23100. required: true,
  23101. type: "string"
  23102. }
  23103. },
  23104. url: "/repos/:owner/:repo/comments/:comment_id"
  23105. },
  23106. updateFile: {
  23107. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23108. method: "PUT",
  23109. params: {
  23110. author: {
  23111. type: "object"
  23112. },
  23113. "author.email": {
  23114. required: true,
  23115. type: "string"
  23116. },
  23117. "author.name": {
  23118. required: true,
  23119. type: "string"
  23120. },
  23121. branch: {
  23122. type: "string"
  23123. },
  23124. committer: {
  23125. type: "object"
  23126. },
  23127. "committer.email": {
  23128. required: true,
  23129. type: "string"
  23130. },
  23131. "committer.name": {
  23132. required: true,
  23133. type: "string"
  23134. },
  23135. content: {
  23136. required: true,
  23137. type: "string"
  23138. },
  23139. message: {
  23140. required: true,
  23141. type: "string"
  23142. },
  23143. owner: {
  23144. required: true,
  23145. type: "string"
  23146. },
  23147. path: {
  23148. required: true,
  23149. type: "string"
  23150. },
  23151. repo: {
  23152. required: true,
  23153. type: "string"
  23154. },
  23155. sha: {
  23156. type: "string"
  23157. }
  23158. },
  23159. url: "/repos/:owner/:repo/contents/:path"
  23160. },
  23161. updateHook: {
  23162. method: "PATCH",
  23163. params: {
  23164. active: {
  23165. type: "boolean"
  23166. },
  23167. add_events: {
  23168. type: "string[]"
  23169. },
  23170. config: {
  23171. type: "object"
  23172. },
  23173. "config.content_type": {
  23174. type: "string"
  23175. },
  23176. "config.insecure_ssl": {
  23177. type: "string"
  23178. },
  23179. "config.secret": {
  23180. type: "string"
  23181. },
  23182. "config.url": {
  23183. required: true,
  23184. type: "string"
  23185. },
  23186. events: {
  23187. type: "string[]"
  23188. },
  23189. hook_id: {
  23190. required: true,
  23191. type: "integer"
  23192. },
  23193. owner: {
  23194. required: true,
  23195. type: "string"
  23196. },
  23197. remove_events: {
  23198. type: "string[]"
  23199. },
  23200. repo: {
  23201. required: true,
  23202. type: "string"
  23203. }
  23204. },
  23205. url: "/repos/:owner/:repo/hooks/:hook_id"
  23206. },
  23207. updateInformationAboutPagesSite: {
  23208. method: "PUT",
  23209. params: {
  23210. cname: {
  23211. type: "string"
  23212. },
  23213. owner: {
  23214. required: true,
  23215. type: "string"
  23216. },
  23217. repo: {
  23218. required: true,
  23219. type: "string"
  23220. },
  23221. source: {
  23222. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23223. type: "string"
  23224. }
  23225. },
  23226. url: "/repos/:owner/:repo/pages"
  23227. },
  23228. updateInvitation: {
  23229. method: "PATCH",
  23230. params: {
  23231. invitation_id: {
  23232. required: true,
  23233. type: "integer"
  23234. },
  23235. owner: {
  23236. required: true,
  23237. type: "string"
  23238. },
  23239. permissions: {
  23240. enum: ["read", "write", "admin"],
  23241. type: "string"
  23242. },
  23243. repo: {
  23244. required: true,
  23245. type: "string"
  23246. }
  23247. },
  23248. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23249. },
  23250. updateProtectedBranchPullRequestReviewEnforcement: {
  23251. method: "PATCH",
  23252. params: {
  23253. branch: {
  23254. required: true,
  23255. type: "string"
  23256. },
  23257. dismiss_stale_reviews: {
  23258. type: "boolean"
  23259. },
  23260. dismissal_restrictions: {
  23261. type: "object"
  23262. },
  23263. "dismissal_restrictions.teams": {
  23264. type: "string[]"
  23265. },
  23266. "dismissal_restrictions.users": {
  23267. type: "string[]"
  23268. },
  23269. owner: {
  23270. required: true,
  23271. type: "string"
  23272. },
  23273. repo: {
  23274. required: true,
  23275. type: "string"
  23276. },
  23277. require_code_owner_reviews: {
  23278. type: "boolean"
  23279. },
  23280. required_approving_review_count: {
  23281. type: "integer"
  23282. }
  23283. },
  23284. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23285. },
  23286. updateProtectedBranchRequiredStatusChecks: {
  23287. method: "PATCH",
  23288. params: {
  23289. branch: {
  23290. required: true,
  23291. type: "string"
  23292. },
  23293. contexts: {
  23294. type: "string[]"
  23295. },
  23296. owner: {
  23297. required: true,
  23298. type: "string"
  23299. },
  23300. repo: {
  23301. required: true,
  23302. type: "string"
  23303. },
  23304. strict: {
  23305. type: "boolean"
  23306. }
  23307. },
  23308. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23309. },
  23310. updateRelease: {
  23311. method: "PATCH",
  23312. params: {
  23313. body: {
  23314. type: "string"
  23315. },
  23316. draft: {
  23317. type: "boolean"
  23318. },
  23319. name: {
  23320. type: "string"
  23321. },
  23322. owner: {
  23323. required: true,
  23324. type: "string"
  23325. },
  23326. prerelease: {
  23327. type: "boolean"
  23328. },
  23329. release_id: {
  23330. required: true,
  23331. type: "integer"
  23332. },
  23333. repo: {
  23334. required: true,
  23335. type: "string"
  23336. },
  23337. tag_name: {
  23338. type: "string"
  23339. },
  23340. target_commitish: {
  23341. type: "string"
  23342. }
  23343. },
  23344. url: "/repos/:owner/:repo/releases/:release_id"
  23345. },
  23346. updateReleaseAsset: {
  23347. method: "PATCH",
  23348. params: {
  23349. asset_id: {
  23350. required: true,
  23351. type: "integer"
  23352. },
  23353. label: {
  23354. type: "string"
  23355. },
  23356. name: {
  23357. type: "string"
  23358. },
  23359. owner: {
  23360. required: true,
  23361. type: "string"
  23362. },
  23363. repo: {
  23364. required: true,
  23365. type: "string"
  23366. }
  23367. },
  23368. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23369. },
  23370. uploadReleaseAsset: {
  23371. method: "POST",
  23372. params: {
  23373. data: {
  23374. mapTo: "data",
  23375. required: true,
  23376. type: "string | object"
  23377. },
  23378. file: {
  23379. alias: "data",
  23380. deprecated: true,
  23381. type: "string | object"
  23382. },
  23383. headers: {
  23384. required: true,
  23385. type: "object"
  23386. },
  23387. "headers.content-length": {
  23388. required: true,
  23389. type: "integer"
  23390. },
  23391. "headers.content-type": {
  23392. required: true,
  23393. type: "string"
  23394. },
  23395. label: {
  23396. type: "string"
  23397. },
  23398. name: {
  23399. required: true,
  23400. type: "string"
  23401. },
  23402. url: {
  23403. required: true,
  23404. type: "string"
  23405. }
  23406. },
  23407. url: ":url"
  23408. }
  23409. },
  23410. search: {
  23411. code: {
  23412. method: "GET",
  23413. params: {
  23414. order: {
  23415. enum: ["desc", "asc"],
  23416. type: "string"
  23417. },
  23418. page: {
  23419. type: "integer"
  23420. },
  23421. per_page: {
  23422. type: "integer"
  23423. },
  23424. q: {
  23425. required: true,
  23426. type: "string"
  23427. },
  23428. sort: {
  23429. enum: ["indexed"],
  23430. type: "string"
  23431. }
  23432. },
  23433. url: "/search/code"
  23434. },
  23435. commits: {
  23436. headers: {
  23437. accept: "application/vnd.github.cloak-preview+json"
  23438. },
  23439. method: "GET",
  23440. params: {
  23441. order: {
  23442. enum: ["desc", "asc"],
  23443. type: "string"
  23444. },
  23445. page: {
  23446. type: "integer"
  23447. },
  23448. per_page: {
  23449. type: "integer"
  23450. },
  23451. q: {
  23452. required: true,
  23453. type: "string"
  23454. },
  23455. sort: {
  23456. enum: ["author-date", "committer-date"],
  23457. type: "string"
  23458. }
  23459. },
  23460. url: "/search/commits"
  23461. },
  23462. issues: {
  23463. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23464. method: "GET",
  23465. params: {
  23466. order: {
  23467. enum: ["desc", "asc"],
  23468. type: "string"
  23469. },
  23470. page: {
  23471. type: "integer"
  23472. },
  23473. per_page: {
  23474. type: "integer"
  23475. },
  23476. q: {
  23477. required: true,
  23478. type: "string"
  23479. },
  23480. sort: {
  23481. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23482. type: "string"
  23483. }
  23484. },
  23485. url: "/search/issues"
  23486. },
  23487. issuesAndPullRequests: {
  23488. method: "GET",
  23489. params: {
  23490. order: {
  23491. enum: ["desc", "asc"],
  23492. type: "string"
  23493. },
  23494. page: {
  23495. type: "integer"
  23496. },
  23497. per_page: {
  23498. type: "integer"
  23499. },
  23500. q: {
  23501. required: true,
  23502. type: "string"
  23503. },
  23504. sort: {
  23505. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23506. type: "string"
  23507. }
  23508. },
  23509. url: "/search/issues"
  23510. },
  23511. labels: {
  23512. method: "GET",
  23513. params: {
  23514. order: {
  23515. enum: ["desc", "asc"],
  23516. type: "string"
  23517. },
  23518. q: {
  23519. required: true,
  23520. type: "string"
  23521. },
  23522. repository_id: {
  23523. required: true,
  23524. type: "integer"
  23525. },
  23526. sort: {
  23527. enum: ["created", "updated"],
  23528. type: "string"
  23529. }
  23530. },
  23531. url: "/search/labels"
  23532. },
  23533. repos: {
  23534. method: "GET",
  23535. params: {
  23536. order: {
  23537. enum: ["desc", "asc"],
  23538. type: "string"
  23539. },
  23540. page: {
  23541. type: "integer"
  23542. },
  23543. per_page: {
  23544. type: "integer"
  23545. },
  23546. q: {
  23547. required: true,
  23548. type: "string"
  23549. },
  23550. sort: {
  23551. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23552. type: "string"
  23553. }
  23554. },
  23555. url: "/search/repositories"
  23556. },
  23557. topics: {
  23558. method: "GET",
  23559. params: {
  23560. q: {
  23561. required: true,
  23562. type: "string"
  23563. }
  23564. },
  23565. url: "/search/topics"
  23566. },
  23567. users: {
  23568. method: "GET",
  23569. params: {
  23570. order: {
  23571. enum: ["desc", "asc"],
  23572. type: "string"
  23573. },
  23574. page: {
  23575. type: "integer"
  23576. },
  23577. per_page: {
  23578. type: "integer"
  23579. },
  23580. q: {
  23581. required: true,
  23582. type: "string"
  23583. },
  23584. sort: {
  23585. enum: ["followers", "repositories", "joined"],
  23586. type: "string"
  23587. }
  23588. },
  23589. url: "/search/users"
  23590. }
  23591. },
  23592. teams: {
  23593. addMember: {
  23594. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23595. method: "PUT",
  23596. params: {
  23597. team_id: {
  23598. required: true,
  23599. type: "integer"
  23600. },
  23601. username: {
  23602. required: true,
  23603. type: "string"
  23604. }
  23605. },
  23606. url: "/teams/:team_id/members/:username"
  23607. },
  23608. addMemberLegacy: {
  23609. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23610. method: "PUT",
  23611. params: {
  23612. team_id: {
  23613. required: true,
  23614. type: "integer"
  23615. },
  23616. username: {
  23617. required: true,
  23618. type: "string"
  23619. }
  23620. },
  23621. url: "/teams/:team_id/members/:username"
  23622. },
  23623. addOrUpdateMembership: {
  23624. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23625. method: "PUT",
  23626. params: {
  23627. role: {
  23628. enum: ["member", "maintainer"],
  23629. type: "string"
  23630. },
  23631. team_id: {
  23632. required: true,
  23633. type: "integer"
  23634. },
  23635. username: {
  23636. required: true,
  23637. type: "string"
  23638. }
  23639. },
  23640. url: "/teams/:team_id/memberships/:username"
  23641. },
  23642. addOrUpdateMembershipInOrg: {
  23643. method: "PUT",
  23644. params: {
  23645. org: {
  23646. required: true,
  23647. type: "string"
  23648. },
  23649. role: {
  23650. enum: ["member", "maintainer"],
  23651. type: "string"
  23652. },
  23653. team_slug: {
  23654. required: true,
  23655. type: "string"
  23656. },
  23657. username: {
  23658. required: true,
  23659. type: "string"
  23660. }
  23661. },
  23662. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23663. },
  23664. addOrUpdateMembershipLegacy: {
  23665. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23666. method: "PUT",
  23667. params: {
  23668. role: {
  23669. enum: ["member", "maintainer"],
  23670. type: "string"
  23671. },
  23672. team_id: {
  23673. required: true,
  23674. type: "integer"
  23675. },
  23676. username: {
  23677. required: true,
  23678. type: "string"
  23679. }
  23680. },
  23681. url: "/teams/:team_id/memberships/:username"
  23682. },
  23683. addOrUpdateProject: {
  23684. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23685. headers: {
  23686. accept: "application/vnd.github.inertia-preview+json"
  23687. },
  23688. method: "PUT",
  23689. params: {
  23690. permission: {
  23691. enum: ["read", "write", "admin"],
  23692. type: "string"
  23693. },
  23694. project_id: {
  23695. required: true,
  23696. type: "integer"
  23697. },
  23698. team_id: {
  23699. required: true,
  23700. type: "integer"
  23701. }
  23702. },
  23703. url: "/teams/:team_id/projects/:project_id"
  23704. },
  23705. addOrUpdateProjectInOrg: {
  23706. headers: {
  23707. accept: "application/vnd.github.inertia-preview+json"
  23708. },
  23709. method: "PUT",
  23710. params: {
  23711. org: {
  23712. required: true,
  23713. type: "string"
  23714. },
  23715. permission: {
  23716. enum: ["read", "write", "admin"],
  23717. type: "string"
  23718. },
  23719. project_id: {
  23720. required: true,
  23721. type: "integer"
  23722. },
  23723. team_slug: {
  23724. required: true,
  23725. type: "string"
  23726. }
  23727. },
  23728. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23729. },
  23730. addOrUpdateProjectLegacy: {
  23731. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23732. headers: {
  23733. accept: "application/vnd.github.inertia-preview+json"
  23734. },
  23735. method: "PUT",
  23736. params: {
  23737. permission: {
  23738. enum: ["read", "write", "admin"],
  23739. type: "string"
  23740. },
  23741. project_id: {
  23742. required: true,
  23743. type: "integer"
  23744. },
  23745. team_id: {
  23746. required: true,
  23747. type: "integer"
  23748. }
  23749. },
  23750. url: "/teams/:team_id/projects/:project_id"
  23751. },
  23752. addOrUpdateRepo: {
  23753. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23754. method: "PUT",
  23755. params: {
  23756. owner: {
  23757. required: true,
  23758. type: "string"
  23759. },
  23760. permission: {
  23761. enum: ["pull", "push", "admin"],
  23762. type: "string"
  23763. },
  23764. repo: {
  23765. required: true,
  23766. type: "string"
  23767. },
  23768. team_id: {
  23769. required: true,
  23770. type: "integer"
  23771. }
  23772. },
  23773. url: "/teams/:team_id/repos/:owner/:repo"
  23774. },
  23775. addOrUpdateRepoInOrg: {
  23776. method: "PUT",
  23777. params: {
  23778. org: {
  23779. required: true,
  23780. type: "string"
  23781. },
  23782. owner: {
  23783. required: true,
  23784. type: "string"
  23785. },
  23786. permission: {
  23787. enum: ["pull", "push", "admin"],
  23788. type: "string"
  23789. },
  23790. repo: {
  23791. required: true,
  23792. type: "string"
  23793. },
  23794. team_slug: {
  23795. required: true,
  23796. type: "string"
  23797. }
  23798. },
  23799. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23800. },
  23801. addOrUpdateRepoLegacy: {
  23802. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23803. method: "PUT",
  23804. params: {
  23805. owner: {
  23806. required: true,
  23807. type: "string"
  23808. },
  23809. permission: {
  23810. enum: ["pull", "push", "admin"],
  23811. type: "string"
  23812. },
  23813. repo: {
  23814. required: true,
  23815. type: "string"
  23816. },
  23817. team_id: {
  23818. required: true,
  23819. type: "integer"
  23820. }
  23821. },
  23822. url: "/teams/:team_id/repos/:owner/:repo"
  23823. },
  23824. checkManagesRepo: {
  23825. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23826. method: "GET",
  23827. params: {
  23828. owner: {
  23829. required: true,
  23830. type: "string"
  23831. },
  23832. repo: {
  23833. required: true,
  23834. type: "string"
  23835. },
  23836. team_id: {
  23837. required: true,
  23838. type: "integer"
  23839. }
  23840. },
  23841. url: "/teams/:team_id/repos/:owner/:repo"
  23842. },
  23843. checkManagesRepoInOrg: {
  23844. method: "GET",
  23845. params: {
  23846. org: {
  23847. required: true,
  23848. type: "string"
  23849. },
  23850. owner: {
  23851. required: true,
  23852. type: "string"
  23853. },
  23854. repo: {
  23855. required: true,
  23856. type: "string"
  23857. },
  23858. team_slug: {
  23859. required: true,
  23860. type: "string"
  23861. }
  23862. },
  23863. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23864. },
  23865. checkManagesRepoLegacy: {
  23866. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23867. method: "GET",
  23868. params: {
  23869. owner: {
  23870. required: true,
  23871. type: "string"
  23872. },
  23873. repo: {
  23874. required: true,
  23875. type: "string"
  23876. },
  23877. team_id: {
  23878. required: true,
  23879. type: "integer"
  23880. }
  23881. },
  23882. url: "/teams/:team_id/repos/:owner/:repo"
  23883. },
  23884. create: {
  23885. method: "POST",
  23886. params: {
  23887. description: {
  23888. type: "string"
  23889. },
  23890. maintainers: {
  23891. type: "string[]"
  23892. },
  23893. name: {
  23894. required: true,
  23895. type: "string"
  23896. },
  23897. org: {
  23898. required: true,
  23899. type: "string"
  23900. },
  23901. parent_team_id: {
  23902. type: "integer"
  23903. },
  23904. permission: {
  23905. enum: ["pull", "push", "admin"],
  23906. type: "string"
  23907. },
  23908. privacy: {
  23909. enum: ["secret", "closed"],
  23910. type: "string"
  23911. },
  23912. repo_names: {
  23913. type: "string[]"
  23914. }
  23915. },
  23916. url: "/orgs/:org/teams"
  23917. },
  23918. createDiscussion: {
  23919. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23920. method: "POST",
  23921. params: {
  23922. body: {
  23923. required: true,
  23924. type: "string"
  23925. },
  23926. private: {
  23927. type: "boolean"
  23928. },
  23929. team_id: {
  23930. required: true,
  23931. type: "integer"
  23932. },
  23933. title: {
  23934. required: true,
  23935. type: "string"
  23936. }
  23937. },
  23938. url: "/teams/:team_id/discussions"
  23939. },
  23940. createDiscussionComment: {
  23941. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  23942. method: "POST",
  23943. params: {
  23944. body: {
  23945. required: true,
  23946. type: "string"
  23947. },
  23948. discussion_number: {
  23949. required: true,
  23950. type: "integer"
  23951. },
  23952. team_id: {
  23953. required: true,
  23954. type: "integer"
  23955. }
  23956. },
  23957. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23958. },
  23959. createDiscussionCommentInOrg: {
  23960. method: "POST",
  23961. params: {
  23962. body: {
  23963. required: true,
  23964. type: "string"
  23965. },
  23966. discussion_number: {
  23967. required: true,
  23968. type: "integer"
  23969. },
  23970. org: {
  23971. required: true,
  23972. type: "string"
  23973. },
  23974. team_slug: {
  23975. required: true,
  23976. type: "string"
  23977. }
  23978. },
  23979. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  23980. },
  23981. createDiscussionCommentLegacy: {
  23982. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  23983. method: "POST",
  23984. params: {
  23985. body: {
  23986. required: true,
  23987. type: "string"
  23988. },
  23989. discussion_number: {
  23990. required: true,
  23991. type: "integer"
  23992. },
  23993. team_id: {
  23994. required: true,
  23995. type: "integer"
  23996. }
  23997. },
  23998. url: "/teams/:team_id/discussions/:discussion_number/comments"
  23999. },
  24000. createDiscussionInOrg: {
  24001. method: "POST",
  24002. params: {
  24003. body: {
  24004. required: true,
  24005. type: "string"
  24006. },
  24007. org: {
  24008. required: true,
  24009. type: "string"
  24010. },
  24011. private: {
  24012. type: "boolean"
  24013. },
  24014. team_slug: {
  24015. required: true,
  24016. type: "string"
  24017. },
  24018. title: {
  24019. required: true,
  24020. type: "string"
  24021. }
  24022. },
  24023. url: "/orgs/:org/teams/:team_slug/discussions"
  24024. },
  24025. createDiscussionLegacy: {
  24026. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24027. method: "POST",
  24028. params: {
  24029. body: {
  24030. required: true,
  24031. type: "string"
  24032. },
  24033. private: {
  24034. type: "boolean"
  24035. },
  24036. team_id: {
  24037. required: true,
  24038. type: "integer"
  24039. },
  24040. title: {
  24041. required: true,
  24042. type: "string"
  24043. }
  24044. },
  24045. url: "/teams/:team_id/discussions"
  24046. },
  24047. delete: {
  24048. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24049. method: "DELETE",
  24050. params: {
  24051. team_id: {
  24052. required: true,
  24053. type: "integer"
  24054. }
  24055. },
  24056. url: "/teams/:team_id"
  24057. },
  24058. deleteDiscussion: {
  24059. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24060. method: "DELETE",
  24061. params: {
  24062. discussion_number: {
  24063. required: true,
  24064. type: "integer"
  24065. },
  24066. team_id: {
  24067. required: true,
  24068. type: "integer"
  24069. }
  24070. },
  24071. url: "/teams/:team_id/discussions/:discussion_number"
  24072. },
  24073. deleteDiscussionComment: {
  24074. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24075. method: "DELETE",
  24076. params: {
  24077. comment_number: {
  24078. required: true,
  24079. type: "integer"
  24080. },
  24081. discussion_number: {
  24082. required: true,
  24083. type: "integer"
  24084. },
  24085. team_id: {
  24086. required: true,
  24087. type: "integer"
  24088. }
  24089. },
  24090. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24091. },
  24092. deleteDiscussionCommentInOrg: {
  24093. method: "DELETE",
  24094. params: {
  24095. comment_number: {
  24096. required: true,
  24097. type: "integer"
  24098. },
  24099. discussion_number: {
  24100. required: true,
  24101. type: "integer"
  24102. },
  24103. org: {
  24104. required: true,
  24105. type: "string"
  24106. },
  24107. team_slug: {
  24108. required: true,
  24109. type: "string"
  24110. }
  24111. },
  24112. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24113. },
  24114. deleteDiscussionCommentLegacy: {
  24115. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24116. method: "DELETE",
  24117. params: {
  24118. comment_number: {
  24119. required: true,
  24120. type: "integer"
  24121. },
  24122. discussion_number: {
  24123. required: true,
  24124. type: "integer"
  24125. },
  24126. team_id: {
  24127. required: true,
  24128. type: "integer"
  24129. }
  24130. },
  24131. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24132. },
  24133. deleteDiscussionInOrg: {
  24134. method: "DELETE",
  24135. params: {
  24136. discussion_number: {
  24137. required: true,
  24138. type: "integer"
  24139. },
  24140. org: {
  24141. required: true,
  24142. type: "string"
  24143. },
  24144. team_slug: {
  24145. required: true,
  24146. type: "string"
  24147. }
  24148. },
  24149. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24150. },
  24151. deleteDiscussionLegacy: {
  24152. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24153. method: "DELETE",
  24154. params: {
  24155. discussion_number: {
  24156. required: true,
  24157. type: "integer"
  24158. },
  24159. team_id: {
  24160. required: true,
  24161. type: "integer"
  24162. }
  24163. },
  24164. url: "/teams/:team_id/discussions/:discussion_number"
  24165. },
  24166. deleteInOrg: {
  24167. method: "DELETE",
  24168. params: {
  24169. org: {
  24170. required: true,
  24171. type: "string"
  24172. },
  24173. team_slug: {
  24174. required: true,
  24175. type: "string"
  24176. }
  24177. },
  24178. url: "/orgs/:org/teams/:team_slug"
  24179. },
  24180. deleteLegacy: {
  24181. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24182. method: "DELETE",
  24183. params: {
  24184. team_id: {
  24185. required: true,
  24186. type: "integer"
  24187. }
  24188. },
  24189. url: "/teams/:team_id"
  24190. },
  24191. get: {
  24192. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24193. method: "GET",
  24194. params: {
  24195. team_id: {
  24196. required: true,
  24197. type: "integer"
  24198. }
  24199. },
  24200. url: "/teams/:team_id"
  24201. },
  24202. getByName: {
  24203. method: "GET",
  24204. params: {
  24205. org: {
  24206. required: true,
  24207. type: "string"
  24208. },
  24209. team_slug: {
  24210. required: true,
  24211. type: "string"
  24212. }
  24213. },
  24214. url: "/orgs/:org/teams/:team_slug"
  24215. },
  24216. getDiscussion: {
  24217. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24218. method: "GET",
  24219. params: {
  24220. discussion_number: {
  24221. required: true,
  24222. type: "integer"
  24223. },
  24224. team_id: {
  24225. required: true,
  24226. type: "integer"
  24227. }
  24228. },
  24229. url: "/teams/:team_id/discussions/:discussion_number"
  24230. },
  24231. getDiscussionComment: {
  24232. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24233. method: "GET",
  24234. params: {
  24235. comment_number: {
  24236. required: true,
  24237. type: "integer"
  24238. },
  24239. discussion_number: {
  24240. required: true,
  24241. type: "integer"
  24242. },
  24243. team_id: {
  24244. required: true,
  24245. type: "integer"
  24246. }
  24247. },
  24248. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24249. },
  24250. getDiscussionCommentInOrg: {
  24251. method: "GET",
  24252. params: {
  24253. comment_number: {
  24254. required: true,
  24255. type: "integer"
  24256. },
  24257. discussion_number: {
  24258. required: true,
  24259. type: "integer"
  24260. },
  24261. org: {
  24262. required: true,
  24263. type: "string"
  24264. },
  24265. team_slug: {
  24266. required: true,
  24267. type: "string"
  24268. }
  24269. },
  24270. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24271. },
  24272. getDiscussionCommentLegacy: {
  24273. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24274. method: "GET",
  24275. params: {
  24276. comment_number: {
  24277. required: true,
  24278. type: "integer"
  24279. },
  24280. discussion_number: {
  24281. required: true,
  24282. type: "integer"
  24283. },
  24284. team_id: {
  24285. required: true,
  24286. type: "integer"
  24287. }
  24288. },
  24289. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24290. },
  24291. getDiscussionInOrg: {
  24292. method: "GET",
  24293. params: {
  24294. discussion_number: {
  24295. required: true,
  24296. type: "integer"
  24297. },
  24298. org: {
  24299. required: true,
  24300. type: "string"
  24301. },
  24302. team_slug: {
  24303. required: true,
  24304. type: "string"
  24305. }
  24306. },
  24307. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24308. },
  24309. getDiscussionLegacy: {
  24310. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24311. method: "GET",
  24312. params: {
  24313. discussion_number: {
  24314. required: true,
  24315. type: "integer"
  24316. },
  24317. team_id: {
  24318. required: true,
  24319. type: "integer"
  24320. }
  24321. },
  24322. url: "/teams/:team_id/discussions/:discussion_number"
  24323. },
  24324. getLegacy: {
  24325. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24326. method: "GET",
  24327. params: {
  24328. team_id: {
  24329. required: true,
  24330. type: "integer"
  24331. }
  24332. },
  24333. url: "/teams/:team_id"
  24334. },
  24335. getMember: {
  24336. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24337. method: "GET",
  24338. params: {
  24339. team_id: {
  24340. required: true,
  24341. type: "integer"
  24342. },
  24343. username: {
  24344. required: true,
  24345. type: "string"
  24346. }
  24347. },
  24348. url: "/teams/:team_id/members/:username"
  24349. },
  24350. getMemberLegacy: {
  24351. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24352. method: "GET",
  24353. params: {
  24354. team_id: {
  24355. required: true,
  24356. type: "integer"
  24357. },
  24358. username: {
  24359. required: true,
  24360. type: "string"
  24361. }
  24362. },
  24363. url: "/teams/:team_id/members/:username"
  24364. },
  24365. getMembership: {
  24366. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24367. method: "GET",
  24368. params: {
  24369. team_id: {
  24370. required: true,
  24371. type: "integer"
  24372. },
  24373. username: {
  24374. required: true,
  24375. type: "string"
  24376. }
  24377. },
  24378. url: "/teams/:team_id/memberships/:username"
  24379. },
  24380. getMembershipInOrg: {
  24381. method: "GET",
  24382. params: {
  24383. org: {
  24384. required: true,
  24385. type: "string"
  24386. },
  24387. team_slug: {
  24388. required: true,
  24389. type: "string"
  24390. },
  24391. username: {
  24392. required: true,
  24393. type: "string"
  24394. }
  24395. },
  24396. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24397. },
  24398. getMembershipLegacy: {
  24399. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24400. method: "GET",
  24401. params: {
  24402. team_id: {
  24403. required: true,
  24404. type: "integer"
  24405. },
  24406. username: {
  24407. required: true,
  24408. type: "string"
  24409. }
  24410. },
  24411. url: "/teams/:team_id/memberships/:username"
  24412. },
  24413. list: {
  24414. method: "GET",
  24415. params: {
  24416. org: {
  24417. required: true,
  24418. type: "string"
  24419. },
  24420. page: {
  24421. type: "integer"
  24422. },
  24423. per_page: {
  24424. type: "integer"
  24425. }
  24426. },
  24427. url: "/orgs/:org/teams"
  24428. },
  24429. listChild: {
  24430. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24431. method: "GET",
  24432. params: {
  24433. page: {
  24434. type: "integer"
  24435. },
  24436. per_page: {
  24437. type: "integer"
  24438. },
  24439. team_id: {
  24440. required: true,
  24441. type: "integer"
  24442. }
  24443. },
  24444. url: "/teams/:team_id/teams"
  24445. },
  24446. listChildInOrg: {
  24447. method: "GET",
  24448. params: {
  24449. org: {
  24450. required: true,
  24451. type: "string"
  24452. },
  24453. page: {
  24454. type: "integer"
  24455. },
  24456. per_page: {
  24457. type: "integer"
  24458. },
  24459. team_slug: {
  24460. required: true,
  24461. type: "string"
  24462. }
  24463. },
  24464. url: "/orgs/:org/teams/:team_slug/teams"
  24465. },
  24466. listChildLegacy: {
  24467. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24468. method: "GET",
  24469. params: {
  24470. page: {
  24471. type: "integer"
  24472. },
  24473. per_page: {
  24474. type: "integer"
  24475. },
  24476. team_id: {
  24477. required: true,
  24478. type: "integer"
  24479. }
  24480. },
  24481. url: "/teams/:team_id/teams"
  24482. },
  24483. listDiscussionComments: {
  24484. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24485. method: "GET",
  24486. params: {
  24487. direction: {
  24488. enum: ["asc", "desc"],
  24489. type: "string"
  24490. },
  24491. discussion_number: {
  24492. required: true,
  24493. type: "integer"
  24494. },
  24495. page: {
  24496. type: "integer"
  24497. },
  24498. per_page: {
  24499. type: "integer"
  24500. },
  24501. team_id: {
  24502. required: true,
  24503. type: "integer"
  24504. }
  24505. },
  24506. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24507. },
  24508. listDiscussionCommentsInOrg: {
  24509. method: "GET",
  24510. params: {
  24511. direction: {
  24512. enum: ["asc", "desc"],
  24513. type: "string"
  24514. },
  24515. discussion_number: {
  24516. required: true,
  24517. type: "integer"
  24518. },
  24519. org: {
  24520. required: true,
  24521. type: "string"
  24522. },
  24523. page: {
  24524. type: "integer"
  24525. },
  24526. per_page: {
  24527. type: "integer"
  24528. },
  24529. team_slug: {
  24530. required: true,
  24531. type: "string"
  24532. }
  24533. },
  24534. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24535. },
  24536. listDiscussionCommentsLegacy: {
  24537. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24538. method: "GET",
  24539. params: {
  24540. direction: {
  24541. enum: ["asc", "desc"],
  24542. type: "string"
  24543. },
  24544. discussion_number: {
  24545. required: true,
  24546. type: "integer"
  24547. },
  24548. page: {
  24549. type: "integer"
  24550. },
  24551. per_page: {
  24552. type: "integer"
  24553. },
  24554. team_id: {
  24555. required: true,
  24556. type: "integer"
  24557. }
  24558. },
  24559. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24560. },
  24561. listDiscussions: {
  24562. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24563. method: "GET",
  24564. params: {
  24565. direction: {
  24566. enum: ["asc", "desc"],
  24567. type: "string"
  24568. },
  24569. page: {
  24570. type: "integer"
  24571. },
  24572. per_page: {
  24573. type: "integer"
  24574. },
  24575. team_id: {
  24576. required: true,
  24577. type: "integer"
  24578. }
  24579. },
  24580. url: "/teams/:team_id/discussions"
  24581. },
  24582. listDiscussionsInOrg: {
  24583. method: "GET",
  24584. params: {
  24585. direction: {
  24586. enum: ["asc", "desc"],
  24587. type: "string"
  24588. },
  24589. org: {
  24590. required: true,
  24591. type: "string"
  24592. },
  24593. page: {
  24594. type: "integer"
  24595. },
  24596. per_page: {
  24597. type: "integer"
  24598. },
  24599. team_slug: {
  24600. required: true,
  24601. type: "string"
  24602. }
  24603. },
  24604. url: "/orgs/:org/teams/:team_slug/discussions"
  24605. },
  24606. listDiscussionsLegacy: {
  24607. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24608. method: "GET",
  24609. params: {
  24610. direction: {
  24611. enum: ["asc", "desc"],
  24612. type: "string"
  24613. },
  24614. page: {
  24615. type: "integer"
  24616. },
  24617. per_page: {
  24618. type: "integer"
  24619. },
  24620. team_id: {
  24621. required: true,
  24622. type: "integer"
  24623. }
  24624. },
  24625. url: "/teams/:team_id/discussions"
  24626. },
  24627. listForAuthenticatedUser: {
  24628. method: "GET",
  24629. params: {
  24630. page: {
  24631. type: "integer"
  24632. },
  24633. per_page: {
  24634. type: "integer"
  24635. }
  24636. },
  24637. url: "/user/teams"
  24638. },
  24639. listMembers: {
  24640. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24641. method: "GET",
  24642. params: {
  24643. page: {
  24644. type: "integer"
  24645. },
  24646. per_page: {
  24647. type: "integer"
  24648. },
  24649. role: {
  24650. enum: ["member", "maintainer", "all"],
  24651. type: "string"
  24652. },
  24653. team_id: {
  24654. required: true,
  24655. type: "integer"
  24656. }
  24657. },
  24658. url: "/teams/:team_id/members"
  24659. },
  24660. listMembersInOrg: {
  24661. method: "GET",
  24662. params: {
  24663. org: {
  24664. required: true,
  24665. type: "string"
  24666. },
  24667. page: {
  24668. type: "integer"
  24669. },
  24670. per_page: {
  24671. type: "integer"
  24672. },
  24673. role: {
  24674. enum: ["member", "maintainer", "all"],
  24675. type: "string"
  24676. },
  24677. team_slug: {
  24678. required: true,
  24679. type: "string"
  24680. }
  24681. },
  24682. url: "/orgs/:org/teams/:team_slug/members"
  24683. },
  24684. listMembersLegacy: {
  24685. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24686. method: "GET",
  24687. params: {
  24688. page: {
  24689. type: "integer"
  24690. },
  24691. per_page: {
  24692. type: "integer"
  24693. },
  24694. role: {
  24695. enum: ["member", "maintainer", "all"],
  24696. type: "string"
  24697. },
  24698. team_id: {
  24699. required: true,
  24700. type: "integer"
  24701. }
  24702. },
  24703. url: "/teams/:team_id/members"
  24704. },
  24705. listPendingInvitations: {
  24706. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24707. method: "GET",
  24708. params: {
  24709. page: {
  24710. type: "integer"
  24711. },
  24712. per_page: {
  24713. type: "integer"
  24714. },
  24715. team_id: {
  24716. required: true,
  24717. type: "integer"
  24718. }
  24719. },
  24720. url: "/teams/:team_id/invitations"
  24721. },
  24722. listPendingInvitationsInOrg: {
  24723. method: "GET",
  24724. params: {
  24725. org: {
  24726. required: true,
  24727. type: "string"
  24728. },
  24729. page: {
  24730. type: "integer"
  24731. },
  24732. per_page: {
  24733. type: "integer"
  24734. },
  24735. team_slug: {
  24736. required: true,
  24737. type: "string"
  24738. }
  24739. },
  24740. url: "/orgs/:org/teams/:team_slug/invitations"
  24741. },
  24742. listPendingInvitationsLegacy: {
  24743. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24744. method: "GET",
  24745. params: {
  24746. page: {
  24747. type: "integer"
  24748. },
  24749. per_page: {
  24750. type: "integer"
  24751. },
  24752. team_id: {
  24753. required: true,
  24754. type: "integer"
  24755. }
  24756. },
  24757. url: "/teams/:team_id/invitations"
  24758. },
  24759. listProjects: {
  24760. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24761. headers: {
  24762. accept: "application/vnd.github.inertia-preview+json"
  24763. },
  24764. method: "GET",
  24765. params: {
  24766. page: {
  24767. type: "integer"
  24768. },
  24769. per_page: {
  24770. type: "integer"
  24771. },
  24772. team_id: {
  24773. required: true,
  24774. type: "integer"
  24775. }
  24776. },
  24777. url: "/teams/:team_id/projects"
  24778. },
  24779. listProjectsInOrg: {
  24780. headers: {
  24781. accept: "application/vnd.github.inertia-preview+json"
  24782. },
  24783. method: "GET",
  24784. params: {
  24785. org: {
  24786. required: true,
  24787. type: "string"
  24788. },
  24789. page: {
  24790. type: "integer"
  24791. },
  24792. per_page: {
  24793. type: "integer"
  24794. },
  24795. team_slug: {
  24796. required: true,
  24797. type: "string"
  24798. }
  24799. },
  24800. url: "/orgs/:org/teams/:team_slug/projects"
  24801. },
  24802. listProjectsLegacy: {
  24803. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24804. headers: {
  24805. accept: "application/vnd.github.inertia-preview+json"
  24806. },
  24807. method: "GET",
  24808. params: {
  24809. page: {
  24810. type: "integer"
  24811. },
  24812. per_page: {
  24813. type: "integer"
  24814. },
  24815. team_id: {
  24816. required: true,
  24817. type: "integer"
  24818. }
  24819. },
  24820. url: "/teams/:team_id/projects"
  24821. },
  24822. listRepos: {
  24823. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24824. method: "GET",
  24825. params: {
  24826. page: {
  24827. type: "integer"
  24828. },
  24829. per_page: {
  24830. type: "integer"
  24831. },
  24832. team_id: {
  24833. required: true,
  24834. type: "integer"
  24835. }
  24836. },
  24837. url: "/teams/:team_id/repos"
  24838. },
  24839. listReposInOrg: {
  24840. method: "GET",
  24841. params: {
  24842. org: {
  24843. required: true,
  24844. type: "string"
  24845. },
  24846. page: {
  24847. type: "integer"
  24848. },
  24849. per_page: {
  24850. type: "integer"
  24851. },
  24852. team_slug: {
  24853. required: true,
  24854. type: "string"
  24855. }
  24856. },
  24857. url: "/orgs/:org/teams/:team_slug/repos"
  24858. },
  24859. listReposLegacy: {
  24860. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24861. method: "GET",
  24862. params: {
  24863. page: {
  24864. type: "integer"
  24865. },
  24866. per_page: {
  24867. type: "integer"
  24868. },
  24869. team_id: {
  24870. required: true,
  24871. type: "integer"
  24872. }
  24873. },
  24874. url: "/teams/:team_id/repos"
  24875. },
  24876. removeMember: {
  24877. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24878. method: "DELETE",
  24879. params: {
  24880. team_id: {
  24881. required: true,
  24882. type: "integer"
  24883. },
  24884. username: {
  24885. required: true,
  24886. type: "string"
  24887. }
  24888. },
  24889. url: "/teams/:team_id/members/:username"
  24890. },
  24891. removeMemberLegacy: {
  24892. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24893. method: "DELETE",
  24894. params: {
  24895. team_id: {
  24896. required: true,
  24897. type: "integer"
  24898. },
  24899. username: {
  24900. required: true,
  24901. type: "string"
  24902. }
  24903. },
  24904. url: "/teams/:team_id/members/:username"
  24905. },
  24906. removeMembership: {
  24907. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24908. method: "DELETE",
  24909. params: {
  24910. team_id: {
  24911. required: true,
  24912. type: "integer"
  24913. },
  24914. username: {
  24915. required: true,
  24916. type: "string"
  24917. }
  24918. },
  24919. url: "/teams/:team_id/memberships/:username"
  24920. },
  24921. removeMembershipInOrg: {
  24922. method: "DELETE",
  24923. params: {
  24924. org: {
  24925. required: true,
  24926. type: "string"
  24927. },
  24928. team_slug: {
  24929. required: true,
  24930. type: "string"
  24931. },
  24932. username: {
  24933. required: true,
  24934. type: "string"
  24935. }
  24936. },
  24937. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24938. },
  24939. removeMembershipLegacy: {
  24940. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  24941. method: "DELETE",
  24942. params: {
  24943. team_id: {
  24944. required: true,
  24945. type: "integer"
  24946. },
  24947. username: {
  24948. required: true,
  24949. type: "string"
  24950. }
  24951. },
  24952. url: "/teams/:team_id/memberships/:username"
  24953. },
  24954. removeProject: {
  24955. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  24956. method: "DELETE",
  24957. params: {
  24958. project_id: {
  24959. required: true,
  24960. type: "integer"
  24961. },
  24962. team_id: {
  24963. required: true,
  24964. type: "integer"
  24965. }
  24966. },
  24967. url: "/teams/:team_id/projects/:project_id"
  24968. },
  24969. removeProjectInOrg: {
  24970. method: "DELETE",
  24971. params: {
  24972. org: {
  24973. required: true,
  24974. type: "string"
  24975. },
  24976. project_id: {
  24977. required: true,
  24978. type: "integer"
  24979. },
  24980. team_slug: {
  24981. required: true,
  24982. type: "string"
  24983. }
  24984. },
  24985. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24986. },
  24987. removeProjectLegacy: {
  24988. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  24989. method: "DELETE",
  24990. params: {
  24991. project_id: {
  24992. required: true,
  24993. type: "integer"
  24994. },
  24995. team_id: {
  24996. required: true,
  24997. type: "integer"
  24998. }
  24999. },
  25000. url: "/teams/:team_id/projects/:project_id"
  25001. },
  25002. removeRepo: {
  25003. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25004. method: "DELETE",
  25005. params: {
  25006. owner: {
  25007. required: true,
  25008. type: "string"
  25009. },
  25010. repo: {
  25011. required: true,
  25012. type: "string"
  25013. },
  25014. team_id: {
  25015. required: true,
  25016. type: "integer"
  25017. }
  25018. },
  25019. url: "/teams/:team_id/repos/:owner/:repo"
  25020. },
  25021. removeRepoInOrg: {
  25022. method: "DELETE",
  25023. params: {
  25024. org: {
  25025. required: true,
  25026. type: "string"
  25027. },
  25028. owner: {
  25029. required: true,
  25030. type: "string"
  25031. },
  25032. repo: {
  25033. required: true,
  25034. type: "string"
  25035. },
  25036. team_slug: {
  25037. required: true,
  25038. type: "string"
  25039. }
  25040. },
  25041. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25042. },
  25043. removeRepoLegacy: {
  25044. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25045. method: "DELETE",
  25046. params: {
  25047. owner: {
  25048. required: true,
  25049. type: "string"
  25050. },
  25051. repo: {
  25052. required: true,
  25053. type: "string"
  25054. },
  25055. team_id: {
  25056. required: true,
  25057. type: "integer"
  25058. }
  25059. },
  25060. url: "/teams/:team_id/repos/:owner/:repo"
  25061. },
  25062. reviewProject: {
  25063. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25064. headers: {
  25065. accept: "application/vnd.github.inertia-preview+json"
  25066. },
  25067. method: "GET",
  25068. params: {
  25069. project_id: {
  25070. required: true,
  25071. type: "integer"
  25072. },
  25073. team_id: {
  25074. required: true,
  25075. type: "integer"
  25076. }
  25077. },
  25078. url: "/teams/:team_id/projects/:project_id"
  25079. },
  25080. reviewProjectInOrg: {
  25081. headers: {
  25082. accept: "application/vnd.github.inertia-preview+json"
  25083. },
  25084. method: "GET",
  25085. params: {
  25086. org: {
  25087. required: true,
  25088. type: "string"
  25089. },
  25090. project_id: {
  25091. required: true,
  25092. type: "integer"
  25093. },
  25094. team_slug: {
  25095. required: true,
  25096. type: "string"
  25097. }
  25098. },
  25099. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25100. },
  25101. reviewProjectLegacy: {
  25102. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25103. headers: {
  25104. accept: "application/vnd.github.inertia-preview+json"
  25105. },
  25106. method: "GET",
  25107. params: {
  25108. project_id: {
  25109. required: true,
  25110. type: "integer"
  25111. },
  25112. team_id: {
  25113. required: true,
  25114. type: "integer"
  25115. }
  25116. },
  25117. url: "/teams/:team_id/projects/:project_id"
  25118. },
  25119. update: {
  25120. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25121. method: "PATCH",
  25122. params: {
  25123. description: {
  25124. type: "string"
  25125. },
  25126. name: {
  25127. required: true,
  25128. type: "string"
  25129. },
  25130. parent_team_id: {
  25131. type: "integer"
  25132. },
  25133. permission: {
  25134. enum: ["pull", "push", "admin"],
  25135. type: "string"
  25136. },
  25137. privacy: {
  25138. enum: ["secret", "closed"],
  25139. type: "string"
  25140. },
  25141. team_id: {
  25142. required: true,
  25143. type: "integer"
  25144. }
  25145. },
  25146. url: "/teams/:team_id"
  25147. },
  25148. updateDiscussion: {
  25149. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25150. method: "PATCH",
  25151. params: {
  25152. body: {
  25153. type: "string"
  25154. },
  25155. discussion_number: {
  25156. required: true,
  25157. type: "integer"
  25158. },
  25159. team_id: {
  25160. required: true,
  25161. type: "integer"
  25162. },
  25163. title: {
  25164. type: "string"
  25165. }
  25166. },
  25167. url: "/teams/:team_id/discussions/:discussion_number"
  25168. },
  25169. updateDiscussionComment: {
  25170. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25171. method: "PATCH",
  25172. params: {
  25173. body: {
  25174. required: true,
  25175. type: "string"
  25176. },
  25177. comment_number: {
  25178. required: true,
  25179. type: "integer"
  25180. },
  25181. discussion_number: {
  25182. required: true,
  25183. type: "integer"
  25184. },
  25185. team_id: {
  25186. required: true,
  25187. type: "integer"
  25188. }
  25189. },
  25190. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25191. },
  25192. updateDiscussionCommentInOrg: {
  25193. method: "PATCH",
  25194. params: {
  25195. body: {
  25196. required: true,
  25197. type: "string"
  25198. },
  25199. comment_number: {
  25200. required: true,
  25201. type: "integer"
  25202. },
  25203. discussion_number: {
  25204. required: true,
  25205. type: "integer"
  25206. },
  25207. org: {
  25208. required: true,
  25209. type: "string"
  25210. },
  25211. team_slug: {
  25212. required: true,
  25213. type: "string"
  25214. }
  25215. },
  25216. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25217. },
  25218. updateDiscussionCommentLegacy: {
  25219. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25220. method: "PATCH",
  25221. params: {
  25222. body: {
  25223. required: true,
  25224. type: "string"
  25225. },
  25226. comment_number: {
  25227. required: true,
  25228. type: "integer"
  25229. },
  25230. discussion_number: {
  25231. required: true,
  25232. type: "integer"
  25233. },
  25234. team_id: {
  25235. required: true,
  25236. type: "integer"
  25237. }
  25238. },
  25239. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25240. },
  25241. updateDiscussionInOrg: {
  25242. method: "PATCH",
  25243. params: {
  25244. body: {
  25245. type: "string"
  25246. },
  25247. discussion_number: {
  25248. required: true,
  25249. type: "integer"
  25250. },
  25251. org: {
  25252. required: true,
  25253. type: "string"
  25254. },
  25255. team_slug: {
  25256. required: true,
  25257. type: "string"
  25258. },
  25259. title: {
  25260. type: "string"
  25261. }
  25262. },
  25263. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25264. },
  25265. updateDiscussionLegacy: {
  25266. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25267. method: "PATCH",
  25268. params: {
  25269. body: {
  25270. type: "string"
  25271. },
  25272. discussion_number: {
  25273. required: true,
  25274. type: "integer"
  25275. },
  25276. team_id: {
  25277. required: true,
  25278. type: "integer"
  25279. },
  25280. title: {
  25281. type: "string"
  25282. }
  25283. },
  25284. url: "/teams/:team_id/discussions/:discussion_number"
  25285. },
  25286. updateInOrg: {
  25287. method: "PATCH",
  25288. params: {
  25289. description: {
  25290. type: "string"
  25291. },
  25292. name: {
  25293. required: true,
  25294. type: "string"
  25295. },
  25296. org: {
  25297. required: true,
  25298. type: "string"
  25299. },
  25300. parent_team_id: {
  25301. type: "integer"
  25302. },
  25303. permission: {
  25304. enum: ["pull", "push", "admin"],
  25305. type: "string"
  25306. },
  25307. privacy: {
  25308. enum: ["secret", "closed"],
  25309. type: "string"
  25310. },
  25311. team_slug: {
  25312. required: true,
  25313. type: "string"
  25314. }
  25315. },
  25316. url: "/orgs/:org/teams/:team_slug"
  25317. },
  25318. updateLegacy: {
  25319. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25320. method: "PATCH",
  25321. params: {
  25322. description: {
  25323. type: "string"
  25324. },
  25325. name: {
  25326. required: true,
  25327. type: "string"
  25328. },
  25329. parent_team_id: {
  25330. type: "integer"
  25331. },
  25332. permission: {
  25333. enum: ["pull", "push", "admin"],
  25334. type: "string"
  25335. },
  25336. privacy: {
  25337. enum: ["secret", "closed"],
  25338. type: "string"
  25339. },
  25340. team_id: {
  25341. required: true,
  25342. type: "integer"
  25343. }
  25344. },
  25345. url: "/teams/:team_id"
  25346. }
  25347. },
  25348. users: {
  25349. addEmails: {
  25350. method: "POST",
  25351. params: {
  25352. emails: {
  25353. required: true,
  25354. type: "string[]"
  25355. }
  25356. },
  25357. url: "/user/emails"
  25358. },
  25359. block: {
  25360. method: "PUT",
  25361. params: {
  25362. username: {
  25363. required: true,
  25364. type: "string"
  25365. }
  25366. },
  25367. url: "/user/blocks/:username"
  25368. },
  25369. checkBlocked: {
  25370. method: "GET",
  25371. params: {
  25372. username: {
  25373. required: true,
  25374. type: "string"
  25375. }
  25376. },
  25377. url: "/user/blocks/:username"
  25378. },
  25379. checkFollowing: {
  25380. method: "GET",
  25381. params: {
  25382. username: {
  25383. required: true,
  25384. type: "string"
  25385. }
  25386. },
  25387. url: "/user/following/:username"
  25388. },
  25389. checkFollowingForUser: {
  25390. method: "GET",
  25391. params: {
  25392. target_user: {
  25393. required: true,
  25394. type: "string"
  25395. },
  25396. username: {
  25397. required: true,
  25398. type: "string"
  25399. }
  25400. },
  25401. url: "/users/:username/following/:target_user"
  25402. },
  25403. createGpgKey: {
  25404. method: "POST",
  25405. params: {
  25406. armored_public_key: {
  25407. type: "string"
  25408. }
  25409. },
  25410. url: "/user/gpg_keys"
  25411. },
  25412. createPublicKey: {
  25413. method: "POST",
  25414. params: {
  25415. key: {
  25416. type: "string"
  25417. },
  25418. title: {
  25419. type: "string"
  25420. }
  25421. },
  25422. url: "/user/keys"
  25423. },
  25424. deleteEmails: {
  25425. method: "DELETE",
  25426. params: {
  25427. emails: {
  25428. required: true,
  25429. type: "string[]"
  25430. }
  25431. },
  25432. url: "/user/emails"
  25433. },
  25434. deleteGpgKey: {
  25435. method: "DELETE",
  25436. params: {
  25437. gpg_key_id: {
  25438. required: true,
  25439. type: "integer"
  25440. }
  25441. },
  25442. url: "/user/gpg_keys/:gpg_key_id"
  25443. },
  25444. deletePublicKey: {
  25445. method: "DELETE",
  25446. params: {
  25447. key_id: {
  25448. required: true,
  25449. type: "integer"
  25450. }
  25451. },
  25452. url: "/user/keys/:key_id"
  25453. },
  25454. follow: {
  25455. method: "PUT",
  25456. params: {
  25457. username: {
  25458. required: true,
  25459. type: "string"
  25460. }
  25461. },
  25462. url: "/user/following/:username"
  25463. },
  25464. getAuthenticated: {
  25465. method: "GET",
  25466. params: {},
  25467. url: "/user"
  25468. },
  25469. getByUsername: {
  25470. method: "GET",
  25471. params: {
  25472. username: {
  25473. required: true,
  25474. type: "string"
  25475. }
  25476. },
  25477. url: "/users/:username"
  25478. },
  25479. getContextForUser: {
  25480. method: "GET",
  25481. params: {
  25482. subject_id: {
  25483. type: "string"
  25484. },
  25485. subject_type: {
  25486. enum: ["organization", "repository", "issue", "pull_request"],
  25487. type: "string"
  25488. },
  25489. username: {
  25490. required: true,
  25491. type: "string"
  25492. }
  25493. },
  25494. url: "/users/:username/hovercard"
  25495. },
  25496. getGpgKey: {
  25497. method: "GET",
  25498. params: {
  25499. gpg_key_id: {
  25500. required: true,
  25501. type: "integer"
  25502. }
  25503. },
  25504. url: "/user/gpg_keys/:gpg_key_id"
  25505. },
  25506. getPublicKey: {
  25507. method: "GET",
  25508. params: {
  25509. key_id: {
  25510. required: true,
  25511. type: "integer"
  25512. }
  25513. },
  25514. url: "/user/keys/:key_id"
  25515. },
  25516. list: {
  25517. method: "GET",
  25518. params: {
  25519. page: {
  25520. type: "integer"
  25521. },
  25522. per_page: {
  25523. type: "integer"
  25524. },
  25525. since: {
  25526. type: "string"
  25527. }
  25528. },
  25529. url: "/users"
  25530. },
  25531. listBlocked: {
  25532. method: "GET",
  25533. params: {},
  25534. url: "/user/blocks"
  25535. },
  25536. listEmails: {
  25537. method: "GET",
  25538. params: {
  25539. page: {
  25540. type: "integer"
  25541. },
  25542. per_page: {
  25543. type: "integer"
  25544. }
  25545. },
  25546. url: "/user/emails"
  25547. },
  25548. listFollowersForAuthenticatedUser: {
  25549. method: "GET",
  25550. params: {
  25551. page: {
  25552. type: "integer"
  25553. },
  25554. per_page: {
  25555. type: "integer"
  25556. }
  25557. },
  25558. url: "/user/followers"
  25559. },
  25560. listFollowersForUser: {
  25561. method: "GET",
  25562. params: {
  25563. page: {
  25564. type: "integer"
  25565. },
  25566. per_page: {
  25567. type: "integer"
  25568. },
  25569. username: {
  25570. required: true,
  25571. type: "string"
  25572. }
  25573. },
  25574. url: "/users/:username/followers"
  25575. },
  25576. listFollowingForAuthenticatedUser: {
  25577. method: "GET",
  25578. params: {
  25579. page: {
  25580. type: "integer"
  25581. },
  25582. per_page: {
  25583. type: "integer"
  25584. }
  25585. },
  25586. url: "/user/following"
  25587. },
  25588. listFollowingForUser: {
  25589. method: "GET",
  25590. params: {
  25591. page: {
  25592. type: "integer"
  25593. },
  25594. per_page: {
  25595. type: "integer"
  25596. },
  25597. username: {
  25598. required: true,
  25599. type: "string"
  25600. }
  25601. },
  25602. url: "/users/:username/following"
  25603. },
  25604. listGpgKeys: {
  25605. method: "GET",
  25606. params: {
  25607. page: {
  25608. type: "integer"
  25609. },
  25610. per_page: {
  25611. type: "integer"
  25612. }
  25613. },
  25614. url: "/user/gpg_keys"
  25615. },
  25616. listGpgKeysForUser: {
  25617. method: "GET",
  25618. params: {
  25619. page: {
  25620. type: "integer"
  25621. },
  25622. per_page: {
  25623. type: "integer"
  25624. },
  25625. username: {
  25626. required: true,
  25627. type: "string"
  25628. }
  25629. },
  25630. url: "/users/:username/gpg_keys"
  25631. },
  25632. listPublicEmails: {
  25633. method: "GET",
  25634. params: {
  25635. page: {
  25636. type: "integer"
  25637. },
  25638. per_page: {
  25639. type: "integer"
  25640. }
  25641. },
  25642. url: "/user/public_emails"
  25643. },
  25644. listPublicKeys: {
  25645. method: "GET",
  25646. params: {
  25647. page: {
  25648. type: "integer"
  25649. },
  25650. per_page: {
  25651. type: "integer"
  25652. }
  25653. },
  25654. url: "/user/keys"
  25655. },
  25656. listPublicKeysForUser: {
  25657. method: "GET",
  25658. params: {
  25659. page: {
  25660. type: "integer"
  25661. },
  25662. per_page: {
  25663. type: "integer"
  25664. },
  25665. username: {
  25666. required: true,
  25667. type: "string"
  25668. }
  25669. },
  25670. url: "/users/:username/keys"
  25671. },
  25672. togglePrimaryEmailVisibility: {
  25673. method: "PATCH",
  25674. params: {
  25675. email: {
  25676. required: true,
  25677. type: "string"
  25678. },
  25679. visibility: {
  25680. required: true,
  25681. type: "string"
  25682. }
  25683. },
  25684. url: "/user/email/visibility"
  25685. },
  25686. unblock: {
  25687. method: "DELETE",
  25688. params: {
  25689. username: {
  25690. required: true,
  25691. type: "string"
  25692. }
  25693. },
  25694. url: "/user/blocks/:username"
  25695. },
  25696. unfollow: {
  25697. method: "DELETE",
  25698. params: {
  25699. username: {
  25700. required: true,
  25701. type: "string"
  25702. }
  25703. },
  25704. url: "/user/following/:username"
  25705. },
  25706. updateAuthenticated: {
  25707. method: "PATCH",
  25708. params: {
  25709. bio: {
  25710. type: "string"
  25711. },
  25712. blog: {
  25713. type: "string"
  25714. },
  25715. company: {
  25716. type: "string"
  25717. },
  25718. email: {
  25719. type: "string"
  25720. },
  25721. hireable: {
  25722. type: "boolean"
  25723. },
  25724. location: {
  25725. type: "string"
  25726. },
  25727. name: {
  25728. type: "string"
  25729. }
  25730. },
  25731. url: "/user"
  25732. }
  25733. }
  25734. };
  25735. const VERSION = "2.4.0";
  25736. function registerEndpoints(octokit, routes) {
  25737. Object.keys(routes).forEach(namespaceName => {
  25738. if (!octokit[namespaceName]) {
  25739. octokit[namespaceName] = {};
  25740. }
  25741. Object.keys(routes[namespaceName]).forEach(apiName => {
  25742. const apiOptions = routes[namespaceName][apiName];
  25743. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25744. if (typeof apiOptions[key] !== "undefined") {
  25745. map[key] = apiOptions[key];
  25746. }
  25747. return map;
  25748. }, {});
  25749. endpointDefaults.request = {
  25750. validate: apiOptions.params
  25751. };
  25752. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25753. // Not the most elegant solution, but we don’t want to move deprecation
  25754. // logic into octokit/endpoint.js as it’s out of scope
  25755. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25756. if (hasDeprecatedParam) {
  25757. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25758. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25759. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25760. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25761. }
  25762. if (apiOptions.deprecated) {
  25763. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25764. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25765. octokit[namespaceName][apiName] = request;
  25766. return request.apply(null, arguments);
  25767. }, request);
  25768. return;
  25769. }
  25770. octokit[namespaceName][apiName] = request;
  25771. });
  25772. });
  25773. }
  25774. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25775. const patchedMethod = options => {
  25776. options = Object.assign({}, options);
  25777. Object.keys(options).forEach(key => {
  25778. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25779. const aliasKey = apiOptions.params[key].alias;
  25780. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25781. if (!(aliasKey in options)) {
  25782. options[aliasKey] = options[key];
  25783. }
  25784. delete options[key];
  25785. }
  25786. });
  25787. return method(options);
  25788. };
  25789. Object.keys(method).forEach(key => {
  25790. patchedMethod[key] = method[key];
  25791. });
  25792. return patchedMethod;
  25793. }
  25794. /**
  25795. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25796. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25797. * done, we will remove the registerEndpoints methods and return the methods
  25798. * directly as with the other plugins. At that point we will also remove the
  25799. * legacy workarounds and deprecations.
  25800. *
  25801. * See the plan at
  25802. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25803. */
  25804. function restEndpointMethods(octokit) {
  25805. // @ts-ignore
  25806. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25807. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25808. // See https://github.com/octokit/rest.js/pull/1134
  25809. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25810. Object.defineProperty(octokit, deprecatedScope, {
  25811. get() {
  25812. octokit.log.warn( // @ts-ignore
  25813. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25814. return octokit[scope];
  25815. }
  25816. });
  25817. });
  25818. return {};
  25819. }
  25820. restEndpointMethods.VERSION = VERSION;
  25821. exports.restEndpointMethods = restEndpointMethods;
  25822. //# sourceMappingURL=index.js.map
  25823. /***/ }),
  25824. /***/ 850:
  25825. /***/ (function(module, __unusedexports, __webpack_require__) {
  25826. module.exports = paginationMethodsPlugin
  25827. function paginationMethodsPlugin (octokit) {
  25828. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25829. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25830. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25831. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25832. octokit.hasFirstPage = __webpack_require__(536)
  25833. octokit.hasLastPage = __webpack_require__(336)
  25834. octokit.hasNextPage = __webpack_require__(929)
  25835. octokit.hasPreviousPage = __webpack_require__(558)
  25836. }
  25837. /***/ }),
  25838. /***/ 854:
  25839. /***/ (function(module) {
  25840. /**
  25841. * lodash (Custom Build) <https://lodash.com/>
  25842. * Build: `lodash modularize exports="npm" -o ./`
  25843. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25844. * Released under MIT license <https://lodash.com/license>
  25845. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25846. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25847. */
  25848. /** Used as the `TypeError` message for "Functions" methods. */
  25849. var FUNC_ERROR_TEXT = 'Expected a function';
  25850. /** Used to stand-in for `undefined` hash values. */
  25851. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25852. /** Used as references for various `Number` constants. */
  25853. var INFINITY = 1 / 0;
  25854. /** `Object#toString` result references. */
  25855. var funcTag = '[object Function]',
  25856. genTag = '[object GeneratorFunction]',
  25857. symbolTag = '[object Symbol]';
  25858. /** Used to match property names within property paths. */
  25859. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25860. reIsPlainProp = /^\w*$/,
  25861. reLeadingDot = /^\./,
  25862. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25863. /**
  25864. * Used to match `RegExp`
  25865. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25866. */
  25867. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25868. /** Used to match backslashes in property paths. */
  25869. var reEscapeChar = /\\(\\)?/g;
  25870. /** Used to detect host constructors (Safari). */
  25871. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25872. /** Detect free variable `global` from Node.js. */
  25873. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25874. /** Detect free variable `self`. */
  25875. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25876. /** Used as a reference to the global object. */
  25877. var root = freeGlobal || freeSelf || Function('return this')();
  25878. /**
  25879. * Gets the value at `key` of `object`.
  25880. *
  25881. * @private
  25882. * @param {Object} [object] The object to query.
  25883. * @param {string} key The key of the property to get.
  25884. * @returns {*} Returns the property value.
  25885. */
  25886. function getValue(object, key) {
  25887. return object == null ? undefined : object[key];
  25888. }
  25889. /**
  25890. * Checks if `value` is a host object in IE < 9.
  25891. *
  25892. * @private
  25893. * @param {*} value The value to check.
  25894. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25895. */
  25896. function isHostObject(value) {
  25897. // Many host objects are `Object` objects that can coerce to strings
  25898. // despite having improperly defined `toString` methods.
  25899. var result = false;
  25900. if (value != null && typeof value.toString != 'function') {
  25901. try {
  25902. result = !!(value + '');
  25903. } catch (e) {}
  25904. }
  25905. return result;
  25906. }
  25907. /** Used for built-in method references. */
  25908. var arrayProto = Array.prototype,
  25909. funcProto = Function.prototype,
  25910. objectProto = Object.prototype;
  25911. /** Used to detect overreaching core-js shims. */
  25912. var coreJsData = root['__core-js_shared__'];
  25913. /** Used to detect methods masquerading as native. */
  25914. var maskSrcKey = (function() {
  25915. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25916. return uid ? ('Symbol(src)_1.' + uid) : '';
  25917. }());
  25918. /** Used to resolve the decompiled source of functions. */
  25919. var funcToString = funcProto.toString;
  25920. /** Used to check objects for own properties. */
  25921. var hasOwnProperty = objectProto.hasOwnProperty;
  25922. /**
  25923. * Used to resolve the
  25924. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25925. * of values.
  25926. */
  25927. var objectToString = objectProto.toString;
  25928. /** Used to detect if a method is native. */
  25929. var reIsNative = RegExp('^' +
  25930. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25931. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25932. );
  25933. /** Built-in value references. */
  25934. var Symbol = root.Symbol,
  25935. splice = arrayProto.splice;
  25936. /* Built-in method references that are verified to be native. */
  25937. var Map = getNative(root, 'Map'),
  25938. nativeCreate = getNative(Object, 'create');
  25939. /** Used to convert symbols to primitives and strings. */
  25940. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25941. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25942. /**
  25943. * Creates a hash object.
  25944. *
  25945. * @private
  25946. * @constructor
  25947. * @param {Array} [entries] The key-value pairs to cache.
  25948. */
  25949. function Hash(entries) {
  25950. var index = -1,
  25951. length = entries ? entries.length : 0;
  25952. this.clear();
  25953. while (++index < length) {
  25954. var entry = entries[index];
  25955. this.set(entry[0], entry[1]);
  25956. }
  25957. }
  25958. /**
  25959. * Removes all key-value entries from the hash.
  25960. *
  25961. * @private
  25962. * @name clear
  25963. * @memberOf Hash
  25964. */
  25965. function hashClear() {
  25966. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25967. }
  25968. /**
  25969. * Removes `key` and its value from the hash.
  25970. *
  25971. * @private
  25972. * @name delete
  25973. * @memberOf Hash
  25974. * @param {Object} hash The hash to modify.
  25975. * @param {string} key The key of the value to remove.
  25976. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25977. */
  25978. function hashDelete(key) {
  25979. return this.has(key) && delete this.__data__[key];
  25980. }
  25981. /**
  25982. * Gets the hash value for `key`.
  25983. *
  25984. * @private
  25985. * @name get
  25986. * @memberOf Hash
  25987. * @param {string} key The key of the value to get.
  25988. * @returns {*} Returns the entry value.
  25989. */
  25990. function hashGet(key) {
  25991. var data = this.__data__;
  25992. if (nativeCreate) {
  25993. var result = data[key];
  25994. return result === HASH_UNDEFINED ? undefined : result;
  25995. }
  25996. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  25997. }
  25998. /**
  25999. * Checks if a hash value for `key` exists.
  26000. *
  26001. * @private
  26002. * @name has
  26003. * @memberOf Hash
  26004. * @param {string} key The key of the entry to check.
  26005. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26006. */
  26007. function hashHas(key) {
  26008. var data = this.__data__;
  26009. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26010. }
  26011. /**
  26012. * Sets the hash `key` to `value`.
  26013. *
  26014. * @private
  26015. * @name set
  26016. * @memberOf Hash
  26017. * @param {string} key The key of the value to set.
  26018. * @param {*} value The value to set.
  26019. * @returns {Object} Returns the hash instance.
  26020. */
  26021. function hashSet(key, value) {
  26022. var data = this.__data__;
  26023. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26024. return this;
  26025. }
  26026. // Add methods to `Hash`.
  26027. Hash.prototype.clear = hashClear;
  26028. Hash.prototype['delete'] = hashDelete;
  26029. Hash.prototype.get = hashGet;
  26030. Hash.prototype.has = hashHas;
  26031. Hash.prototype.set = hashSet;
  26032. /**
  26033. * Creates an list cache object.
  26034. *
  26035. * @private
  26036. * @constructor
  26037. * @param {Array} [entries] The key-value pairs to cache.
  26038. */
  26039. function ListCache(entries) {
  26040. var index = -1,
  26041. length = entries ? entries.length : 0;
  26042. this.clear();
  26043. while (++index < length) {
  26044. var entry = entries[index];
  26045. this.set(entry[0], entry[1]);
  26046. }
  26047. }
  26048. /**
  26049. * Removes all key-value entries from the list cache.
  26050. *
  26051. * @private
  26052. * @name clear
  26053. * @memberOf ListCache
  26054. */
  26055. function listCacheClear() {
  26056. this.__data__ = [];
  26057. }
  26058. /**
  26059. * Removes `key` and its value from the list cache.
  26060. *
  26061. * @private
  26062. * @name delete
  26063. * @memberOf ListCache
  26064. * @param {string} key The key of the value to remove.
  26065. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26066. */
  26067. function listCacheDelete(key) {
  26068. var data = this.__data__,
  26069. index = assocIndexOf(data, key);
  26070. if (index < 0) {
  26071. return false;
  26072. }
  26073. var lastIndex = data.length - 1;
  26074. if (index == lastIndex) {
  26075. data.pop();
  26076. } else {
  26077. splice.call(data, index, 1);
  26078. }
  26079. return true;
  26080. }
  26081. /**
  26082. * Gets the list cache value for `key`.
  26083. *
  26084. * @private
  26085. * @name get
  26086. * @memberOf ListCache
  26087. * @param {string} key The key of the value to get.
  26088. * @returns {*} Returns the entry value.
  26089. */
  26090. function listCacheGet(key) {
  26091. var data = this.__data__,
  26092. index = assocIndexOf(data, key);
  26093. return index < 0 ? undefined : data[index][1];
  26094. }
  26095. /**
  26096. * Checks if a list cache value for `key` exists.
  26097. *
  26098. * @private
  26099. * @name has
  26100. * @memberOf ListCache
  26101. * @param {string} key The key of the entry to check.
  26102. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26103. */
  26104. function listCacheHas(key) {
  26105. return assocIndexOf(this.__data__, key) > -1;
  26106. }
  26107. /**
  26108. * Sets the list cache `key` to `value`.
  26109. *
  26110. * @private
  26111. * @name set
  26112. * @memberOf ListCache
  26113. * @param {string} key The key of the value to set.
  26114. * @param {*} value The value to set.
  26115. * @returns {Object} Returns the list cache instance.
  26116. */
  26117. function listCacheSet(key, value) {
  26118. var data = this.__data__,
  26119. index = assocIndexOf(data, key);
  26120. if (index < 0) {
  26121. data.push([key, value]);
  26122. } else {
  26123. data[index][1] = value;
  26124. }
  26125. return this;
  26126. }
  26127. // Add methods to `ListCache`.
  26128. ListCache.prototype.clear = listCacheClear;
  26129. ListCache.prototype['delete'] = listCacheDelete;
  26130. ListCache.prototype.get = listCacheGet;
  26131. ListCache.prototype.has = listCacheHas;
  26132. ListCache.prototype.set = listCacheSet;
  26133. /**
  26134. * Creates a map cache object to store key-value pairs.
  26135. *
  26136. * @private
  26137. * @constructor
  26138. * @param {Array} [entries] The key-value pairs to cache.
  26139. */
  26140. function MapCache(entries) {
  26141. var index = -1,
  26142. length = entries ? entries.length : 0;
  26143. this.clear();
  26144. while (++index < length) {
  26145. var entry = entries[index];
  26146. this.set(entry[0], entry[1]);
  26147. }
  26148. }
  26149. /**
  26150. * Removes all key-value entries from the map.
  26151. *
  26152. * @private
  26153. * @name clear
  26154. * @memberOf MapCache
  26155. */
  26156. function mapCacheClear() {
  26157. this.__data__ = {
  26158. 'hash': new Hash,
  26159. 'map': new (Map || ListCache),
  26160. 'string': new Hash
  26161. };
  26162. }
  26163. /**
  26164. * Removes `key` and its value from the map.
  26165. *
  26166. * @private
  26167. * @name delete
  26168. * @memberOf MapCache
  26169. * @param {string} key The key of the value to remove.
  26170. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26171. */
  26172. function mapCacheDelete(key) {
  26173. return getMapData(this, key)['delete'](key);
  26174. }
  26175. /**
  26176. * Gets the map value for `key`.
  26177. *
  26178. * @private
  26179. * @name get
  26180. * @memberOf MapCache
  26181. * @param {string} key The key of the value to get.
  26182. * @returns {*} Returns the entry value.
  26183. */
  26184. function mapCacheGet(key) {
  26185. return getMapData(this, key).get(key);
  26186. }
  26187. /**
  26188. * Checks if a map value for `key` exists.
  26189. *
  26190. * @private
  26191. * @name has
  26192. * @memberOf MapCache
  26193. * @param {string} key The key of the entry to check.
  26194. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26195. */
  26196. function mapCacheHas(key) {
  26197. return getMapData(this, key).has(key);
  26198. }
  26199. /**
  26200. * Sets the map `key` to `value`.
  26201. *
  26202. * @private
  26203. * @name set
  26204. * @memberOf MapCache
  26205. * @param {string} key The key of the value to set.
  26206. * @param {*} value The value to set.
  26207. * @returns {Object} Returns the map cache instance.
  26208. */
  26209. function mapCacheSet(key, value) {
  26210. getMapData(this, key).set(key, value);
  26211. return this;
  26212. }
  26213. // Add methods to `MapCache`.
  26214. MapCache.prototype.clear = mapCacheClear;
  26215. MapCache.prototype['delete'] = mapCacheDelete;
  26216. MapCache.prototype.get = mapCacheGet;
  26217. MapCache.prototype.has = mapCacheHas;
  26218. MapCache.prototype.set = mapCacheSet;
  26219. /**
  26220. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26221. *
  26222. * @private
  26223. * @param {Array} array The array to inspect.
  26224. * @param {*} key The key to search for.
  26225. * @returns {number} Returns the index of the matched value, else `-1`.
  26226. */
  26227. function assocIndexOf(array, key) {
  26228. var length = array.length;
  26229. while (length--) {
  26230. if (eq(array[length][0], key)) {
  26231. return length;
  26232. }
  26233. }
  26234. return -1;
  26235. }
  26236. /**
  26237. * The base implementation of `_.get` without support for default values.
  26238. *
  26239. * @private
  26240. * @param {Object} object The object to query.
  26241. * @param {Array|string} path The path of the property to get.
  26242. * @returns {*} Returns the resolved value.
  26243. */
  26244. function baseGet(object, path) {
  26245. path = isKey(path, object) ? [path] : castPath(path);
  26246. var index = 0,
  26247. length = path.length;
  26248. while (object != null && index < length) {
  26249. object = object[toKey(path[index++])];
  26250. }
  26251. return (index && index == length) ? object : undefined;
  26252. }
  26253. /**
  26254. * The base implementation of `_.isNative` without bad shim checks.
  26255. *
  26256. * @private
  26257. * @param {*} value The value to check.
  26258. * @returns {boolean} Returns `true` if `value` is a native function,
  26259. * else `false`.
  26260. */
  26261. function baseIsNative(value) {
  26262. if (!isObject(value) || isMasked(value)) {
  26263. return false;
  26264. }
  26265. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26266. return pattern.test(toSource(value));
  26267. }
  26268. /**
  26269. * The base implementation of `_.toString` which doesn't convert nullish
  26270. * values to empty strings.
  26271. *
  26272. * @private
  26273. * @param {*} value The value to process.
  26274. * @returns {string} Returns the string.
  26275. */
  26276. function baseToString(value) {
  26277. // Exit early for strings to avoid a performance hit in some environments.
  26278. if (typeof value == 'string') {
  26279. return value;
  26280. }
  26281. if (isSymbol(value)) {
  26282. return symbolToString ? symbolToString.call(value) : '';
  26283. }
  26284. var result = (value + '');
  26285. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26286. }
  26287. /**
  26288. * Casts `value` to a path array if it's not one.
  26289. *
  26290. * @private
  26291. * @param {*} value The value to inspect.
  26292. * @returns {Array} Returns the cast property path array.
  26293. */
  26294. function castPath(value) {
  26295. return isArray(value) ? value : stringToPath(value);
  26296. }
  26297. /**
  26298. * Gets the data for `map`.
  26299. *
  26300. * @private
  26301. * @param {Object} map The map to query.
  26302. * @param {string} key The reference key.
  26303. * @returns {*} Returns the map data.
  26304. */
  26305. function getMapData(map, key) {
  26306. var data = map.__data__;
  26307. return isKeyable(key)
  26308. ? data[typeof key == 'string' ? 'string' : 'hash']
  26309. : data.map;
  26310. }
  26311. /**
  26312. * Gets the native function at `key` of `object`.
  26313. *
  26314. * @private
  26315. * @param {Object} object The object to query.
  26316. * @param {string} key The key of the method to get.
  26317. * @returns {*} Returns the function if it's native, else `undefined`.
  26318. */
  26319. function getNative(object, key) {
  26320. var value = getValue(object, key);
  26321. return baseIsNative(value) ? value : undefined;
  26322. }
  26323. /**
  26324. * Checks if `value` is a property name and not a property path.
  26325. *
  26326. * @private
  26327. * @param {*} value The value to check.
  26328. * @param {Object} [object] The object to query keys on.
  26329. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26330. */
  26331. function isKey(value, object) {
  26332. if (isArray(value)) {
  26333. return false;
  26334. }
  26335. var type = typeof value;
  26336. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26337. value == null || isSymbol(value)) {
  26338. return true;
  26339. }
  26340. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26341. (object != null && value in Object(object));
  26342. }
  26343. /**
  26344. * Checks if `value` is suitable for use as unique object key.
  26345. *
  26346. * @private
  26347. * @param {*} value The value to check.
  26348. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26349. */
  26350. function isKeyable(value) {
  26351. var type = typeof value;
  26352. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26353. ? (value !== '__proto__')
  26354. : (value === null);
  26355. }
  26356. /**
  26357. * Checks if `func` has its source masked.
  26358. *
  26359. * @private
  26360. * @param {Function} func The function to check.
  26361. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26362. */
  26363. function isMasked(func) {
  26364. return !!maskSrcKey && (maskSrcKey in func);
  26365. }
  26366. /**
  26367. * Converts `string` to a property path array.
  26368. *
  26369. * @private
  26370. * @param {string} string The string to convert.
  26371. * @returns {Array} Returns the property path array.
  26372. */
  26373. var stringToPath = memoize(function(string) {
  26374. string = toString(string);
  26375. var result = [];
  26376. if (reLeadingDot.test(string)) {
  26377. result.push('');
  26378. }
  26379. string.replace(rePropName, function(match, number, quote, string) {
  26380. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26381. });
  26382. return result;
  26383. });
  26384. /**
  26385. * Converts `value` to a string key if it's not a string or symbol.
  26386. *
  26387. * @private
  26388. * @param {*} value The value to inspect.
  26389. * @returns {string|symbol} Returns the key.
  26390. */
  26391. function toKey(value) {
  26392. if (typeof value == 'string' || isSymbol(value)) {
  26393. return value;
  26394. }
  26395. var result = (value + '');
  26396. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26397. }
  26398. /**
  26399. * Converts `func` to its source code.
  26400. *
  26401. * @private
  26402. * @param {Function} func The function to process.
  26403. * @returns {string} Returns the source code.
  26404. */
  26405. function toSource(func) {
  26406. if (func != null) {
  26407. try {
  26408. return funcToString.call(func);
  26409. } catch (e) {}
  26410. try {
  26411. return (func + '');
  26412. } catch (e) {}
  26413. }
  26414. return '';
  26415. }
  26416. /**
  26417. * Creates a function that memoizes the result of `func`. If `resolver` is
  26418. * provided, it determines the cache key for storing the result based on the
  26419. * arguments provided to the memoized function. By default, the first argument
  26420. * provided to the memoized function is used as the map cache key. The `func`
  26421. * is invoked with the `this` binding of the memoized function.
  26422. *
  26423. * **Note:** The cache is exposed as the `cache` property on the memoized
  26424. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26425. * constructor with one whose instances implement the
  26426. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26427. * method interface of `delete`, `get`, `has`, and `set`.
  26428. *
  26429. * @static
  26430. * @memberOf _
  26431. * @since 0.1.0
  26432. * @category Function
  26433. * @param {Function} func The function to have its output memoized.
  26434. * @param {Function} [resolver] The function to resolve the cache key.
  26435. * @returns {Function} Returns the new memoized function.
  26436. * @example
  26437. *
  26438. * var object = { 'a': 1, 'b': 2 };
  26439. * var other = { 'c': 3, 'd': 4 };
  26440. *
  26441. * var values = _.memoize(_.values);
  26442. * values(object);
  26443. * // => [1, 2]
  26444. *
  26445. * values(other);
  26446. * // => [3, 4]
  26447. *
  26448. * object.a = 2;
  26449. * values(object);
  26450. * // => [1, 2]
  26451. *
  26452. * // Modify the result cache.
  26453. * values.cache.set(object, ['a', 'b']);
  26454. * values(object);
  26455. * // => ['a', 'b']
  26456. *
  26457. * // Replace `_.memoize.Cache`.
  26458. * _.memoize.Cache = WeakMap;
  26459. */
  26460. function memoize(func, resolver) {
  26461. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26462. throw new TypeError(FUNC_ERROR_TEXT);
  26463. }
  26464. var memoized = function() {
  26465. var args = arguments,
  26466. key = resolver ? resolver.apply(this, args) : args[0],
  26467. cache = memoized.cache;
  26468. if (cache.has(key)) {
  26469. return cache.get(key);
  26470. }
  26471. var result = func.apply(this, args);
  26472. memoized.cache = cache.set(key, result);
  26473. return result;
  26474. };
  26475. memoized.cache = new (memoize.Cache || MapCache);
  26476. return memoized;
  26477. }
  26478. // Assign cache to `_.memoize`.
  26479. memoize.Cache = MapCache;
  26480. /**
  26481. * Performs a
  26482. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26483. * comparison between two values to determine if they are equivalent.
  26484. *
  26485. * @static
  26486. * @memberOf _
  26487. * @since 4.0.0
  26488. * @category Lang
  26489. * @param {*} value The value to compare.
  26490. * @param {*} other The other value to compare.
  26491. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26492. * @example
  26493. *
  26494. * var object = { 'a': 1 };
  26495. * var other = { 'a': 1 };
  26496. *
  26497. * _.eq(object, object);
  26498. * // => true
  26499. *
  26500. * _.eq(object, other);
  26501. * // => false
  26502. *
  26503. * _.eq('a', 'a');
  26504. * // => true
  26505. *
  26506. * _.eq('a', Object('a'));
  26507. * // => false
  26508. *
  26509. * _.eq(NaN, NaN);
  26510. * // => true
  26511. */
  26512. function eq(value, other) {
  26513. return value === other || (value !== value && other !== other);
  26514. }
  26515. /**
  26516. * Checks if `value` is classified as an `Array` object.
  26517. *
  26518. * @static
  26519. * @memberOf _
  26520. * @since 0.1.0
  26521. * @category Lang
  26522. * @param {*} value The value to check.
  26523. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26524. * @example
  26525. *
  26526. * _.isArray([1, 2, 3]);
  26527. * // => true
  26528. *
  26529. * _.isArray(document.body.children);
  26530. * // => false
  26531. *
  26532. * _.isArray('abc');
  26533. * // => false
  26534. *
  26535. * _.isArray(_.noop);
  26536. * // => false
  26537. */
  26538. var isArray = Array.isArray;
  26539. /**
  26540. * Checks if `value` is classified as a `Function` object.
  26541. *
  26542. * @static
  26543. * @memberOf _
  26544. * @since 0.1.0
  26545. * @category Lang
  26546. * @param {*} value The value to check.
  26547. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26548. * @example
  26549. *
  26550. * _.isFunction(_);
  26551. * // => true
  26552. *
  26553. * _.isFunction(/abc/);
  26554. * // => false
  26555. */
  26556. function isFunction(value) {
  26557. // The use of `Object#toString` avoids issues with the `typeof` operator
  26558. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26559. var tag = isObject(value) ? objectToString.call(value) : '';
  26560. return tag == funcTag || tag == genTag;
  26561. }
  26562. /**
  26563. * Checks if `value` is the
  26564. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26565. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26566. *
  26567. * @static
  26568. * @memberOf _
  26569. * @since 0.1.0
  26570. * @category Lang
  26571. * @param {*} value The value to check.
  26572. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26573. * @example
  26574. *
  26575. * _.isObject({});
  26576. * // => true
  26577. *
  26578. * _.isObject([1, 2, 3]);
  26579. * // => true
  26580. *
  26581. * _.isObject(_.noop);
  26582. * // => true
  26583. *
  26584. * _.isObject(null);
  26585. * // => false
  26586. */
  26587. function isObject(value) {
  26588. var type = typeof value;
  26589. return !!value && (type == 'object' || type == 'function');
  26590. }
  26591. /**
  26592. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26593. * and has a `typeof` result of "object".
  26594. *
  26595. * @static
  26596. * @memberOf _
  26597. * @since 4.0.0
  26598. * @category Lang
  26599. * @param {*} value The value to check.
  26600. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26601. * @example
  26602. *
  26603. * _.isObjectLike({});
  26604. * // => true
  26605. *
  26606. * _.isObjectLike([1, 2, 3]);
  26607. * // => true
  26608. *
  26609. * _.isObjectLike(_.noop);
  26610. * // => false
  26611. *
  26612. * _.isObjectLike(null);
  26613. * // => false
  26614. */
  26615. function isObjectLike(value) {
  26616. return !!value && typeof value == 'object';
  26617. }
  26618. /**
  26619. * Checks if `value` is classified as a `Symbol` primitive or object.
  26620. *
  26621. * @static
  26622. * @memberOf _
  26623. * @since 4.0.0
  26624. * @category Lang
  26625. * @param {*} value The value to check.
  26626. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26627. * @example
  26628. *
  26629. * _.isSymbol(Symbol.iterator);
  26630. * // => true
  26631. *
  26632. * _.isSymbol('abc');
  26633. * // => false
  26634. */
  26635. function isSymbol(value) {
  26636. return typeof value == 'symbol' ||
  26637. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26638. }
  26639. /**
  26640. * Converts `value` to a string. An empty string is returned for `null`
  26641. * and `undefined` values. The sign of `-0` is preserved.
  26642. *
  26643. * @static
  26644. * @memberOf _
  26645. * @since 4.0.0
  26646. * @category Lang
  26647. * @param {*} value The value to process.
  26648. * @returns {string} Returns the string.
  26649. * @example
  26650. *
  26651. * _.toString(null);
  26652. * // => ''
  26653. *
  26654. * _.toString(-0);
  26655. * // => '-0'
  26656. *
  26657. * _.toString([1, 2, 3]);
  26658. * // => '1,2,3'
  26659. */
  26660. function toString(value) {
  26661. return value == null ? '' : baseToString(value);
  26662. }
  26663. /**
  26664. * Gets the value at `path` of `object`. If the resolved value is
  26665. * `undefined`, the `defaultValue` is returned in its place.
  26666. *
  26667. * @static
  26668. * @memberOf _
  26669. * @since 3.7.0
  26670. * @category Object
  26671. * @param {Object} object The object to query.
  26672. * @param {Array|string} path The path of the property to get.
  26673. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26674. * @returns {*} Returns the resolved value.
  26675. * @example
  26676. *
  26677. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26678. *
  26679. * _.get(object, 'a[0].b.c');
  26680. * // => 3
  26681. *
  26682. * _.get(object, ['a', '0', 'b', 'c']);
  26683. * // => 3
  26684. *
  26685. * _.get(object, 'a.b.c', 'default');
  26686. * // => 'default'
  26687. */
  26688. function get(object, path, defaultValue) {
  26689. var result = object == null ? undefined : baseGet(object, path);
  26690. return result === undefined ? defaultValue : result;
  26691. }
  26692. module.exports = get;
  26693. /***/ }),
  26694. /***/ 855:
  26695. /***/ (function(module, __unusedexports, __webpack_require__) {
  26696. module.exports = registerPlugin;
  26697. const factory = __webpack_require__(47);
  26698. function registerPlugin(plugins, pluginFunction) {
  26699. return factory(
  26700. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26701. );
  26702. }
  26703. /***/ }),
  26704. /***/ 856:
  26705. /***/ (function(module, __unusedexports, __webpack_require__) {
  26706. module.exports = __webpack_require__(141);
  26707. /***/ }),
  26708. /***/ 863:
  26709. /***/ (function(module, __unusedexports, __webpack_require__) {
  26710. module.exports = authenticationBeforeRequest;
  26711. const btoa = __webpack_require__(675);
  26712. const withAuthorizationPrefix = __webpack_require__(143);
  26713. function authenticationBeforeRequest(state, options) {
  26714. if (typeof state.auth === "string") {
  26715. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26716. return;
  26717. }
  26718. if (state.auth.username) {
  26719. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26720. options.headers.authorization = `Basic ${hash}`;
  26721. if (state.otp) {
  26722. options.headers["x-github-otp"] = state.otp;
  26723. }
  26724. return;
  26725. }
  26726. if (state.auth.clientId) {
  26727. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26728. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26729. // URL though: `/applications/:client_id/tokens/:access_token`.
  26730. //
  26731. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26732. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26733. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26734. //
  26735. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26736. // as well as "/applications/123/tokens/token456"
  26737. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26738. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26739. options.headers.authorization = `Basic ${hash}`;
  26740. return;
  26741. }
  26742. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26743. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26744. return;
  26745. }
  26746. return Promise.resolve()
  26747. .then(() => {
  26748. return state.auth();
  26749. })
  26750. .then(authorization => {
  26751. options.headers.authorization = withAuthorizationPrefix(authorization);
  26752. });
  26753. }
  26754. /***/ }),
  26755. /***/ 866:
  26756. /***/ (function(module, __unusedexports, __webpack_require__) {
  26757. "use strict";
  26758. var shebangRegex = __webpack_require__(816);
  26759. module.exports = function (str) {
  26760. var match = str.match(shebangRegex);
  26761. if (!match) {
  26762. return null;
  26763. }
  26764. var arr = match[0].replace(/#! ?/, '').split(' ');
  26765. var bin = arr[0].split('/').pop();
  26766. var arg = arr[1];
  26767. return (bin === 'env' ?
  26768. arg :
  26769. bin + (arg ? ' ' + arg : '')
  26770. );
  26771. };
  26772. /***/ }),
  26773. /***/ 874:
  26774. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26775. "use strict";
  26776. // Copyright (c) Microsoft. All rights reserved.
  26777. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26778. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26779. return new (P || (P = Promise))(function (resolve, reject) {
  26780. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26781. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26782. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26783. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26784. });
  26785. };
  26786. Object.defineProperty(exports, "__esModule", { value: true });
  26787. const url = __webpack_require__(835);
  26788. const http = __webpack_require__(605);
  26789. const https = __webpack_require__(34);
  26790. let fs;
  26791. let tunnel;
  26792. var HttpCodes;
  26793. (function (HttpCodes) {
  26794. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26795. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26796. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26797. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26798. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26799. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26800. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26801. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26802. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26803. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26804. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26805. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26806. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26807. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26808. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26809. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26810. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26811. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26812. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26813. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26814. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26815. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26816. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26817. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26818. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26819. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26820. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26821. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26822. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26823. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26824. const ExponentialBackoffCeiling = 10;
  26825. const ExponentialBackoffTimeSlice = 5;
  26826. class HttpClientResponse {
  26827. constructor(message) {
  26828. this.message = message;
  26829. }
  26830. readBody() {
  26831. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26832. let output = '';
  26833. this.message.on('data', (chunk) => {
  26834. output += chunk;
  26835. });
  26836. this.message.on('end', () => {
  26837. resolve(output);
  26838. });
  26839. }));
  26840. }
  26841. }
  26842. exports.HttpClientResponse = HttpClientResponse;
  26843. function isHttps(requestUrl) {
  26844. let parsedUrl = url.parse(requestUrl);
  26845. return parsedUrl.protocol === 'https:';
  26846. }
  26847. exports.isHttps = isHttps;
  26848. var EnvironmentVariables;
  26849. (function (EnvironmentVariables) {
  26850. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26851. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26852. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26853. class HttpClient {
  26854. constructor(userAgent, handlers, requestOptions) {
  26855. this._ignoreSslError = false;
  26856. this._allowRedirects = true;
  26857. this._maxRedirects = 50;
  26858. this._allowRetries = false;
  26859. this._maxRetries = 1;
  26860. this._keepAlive = false;
  26861. this._disposed = false;
  26862. this.userAgent = userAgent;
  26863. this.handlers = handlers || [];
  26864. this.requestOptions = requestOptions;
  26865. if (requestOptions) {
  26866. if (requestOptions.ignoreSslError != null) {
  26867. this._ignoreSslError = requestOptions.ignoreSslError;
  26868. }
  26869. this._socketTimeout = requestOptions.socketTimeout;
  26870. this._httpProxy = requestOptions.proxy;
  26871. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26872. this._httpProxyBypassHosts = [];
  26873. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26874. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26875. });
  26876. }
  26877. this._certConfig = requestOptions.cert;
  26878. if (this._certConfig) {
  26879. // If using cert, need fs
  26880. fs = __webpack_require__(747);
  26881. // cache the cert content into memory, so we don't have to read it from disk every time
  26882. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26883. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26884. }
  26885. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26886. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26887. }
  26888. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26889. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26890. }
  26891. }
  26892. if (requestOptions.allowRedirects != null) {
  26893. this._allowRedirects = requestOptions.allowRedirects;
  26894. }
  26895. if (requestOptions.maxRedirects != null) {
  26896. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26897. }
  26898. if (requestOptions.keepAlive != null) {
  26899. this._keepAlive = requestOptions.keepAlive;
  26900. }
  26901. if (requestOptions.allowRetries != null) {
  26902. this._allowRetries = requestOptions.allowRetries;
  26903. }
  26904. if (requestOptions.maxRetries != null) {
  26905. this._maxRetries = requestOptions.maxRetries;
  26906. }
  26907. }
  26908. }
  26909. options(requestUrl, additionalHeaders) {
  26910. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26911. }
  26912. get(requestUrl, additionalHeaders) {
  26913. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26914. }
  26915. del(requestUrl, additionalHeaders) {
  26916. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26917. }
  26918. post(requestUrl, data, additionalHeaders) {
  26919. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26920. }
  26921. patch(requestUrl, data, additionalHeaders) {
  26922. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26923. }
  26924. put(requestUrl, data, additionalHeaders) {
  26925. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  26926. }
  26927. head(requestUrl, additionalHeaders) {
  26928. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  26929. }
  26930. sendStream(verb, requestUrl, stream, additionalHeaders) {
  26931. return this.request(verb, requestUrl, stream, additionalHeaders);
  26932. }
  26933. /**
  26934. * Makes a raw http request.
  26935. * All other methods such as get, post, patch, and request ultimately call this.
  26936. * Prefer get, del, post and patch
  26937. */
  26938. request(verb, requestUrl, data, headers) {
  26939. return __awaiter(this, void 0, void 0, function* () {
  26940. if (this._disposed) {
  26941. throw new Error("Client has already been disposed.");
  26942. }
  26943. let info = this._prepareRequest(verb, requestUrl, headers);
  26944. // Only perform retries on reads since writes may not be idempotent.
  26945. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  26946. let numTries = 0;
  26947. let response;
  26948. while (numTries < maxTries) {
  26949. response = yield this.requestRaw(info, data);
  26950. // Check if it's an authentication challenge
  26951. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  26952. let authenticationHandler;
  26953. for (let i = 0; i < this.handlers.length; i++) {
  26954. if (this.handlers[i].canHandleAuthentication(response)) {
  26955. authenticationHandler = this.handlers[i];
  26956. break;
  26957. }
  26958. }
  26959. if (authenticationHandler) {
  26960. return authenticationHandler.handleAuthentication(this, info, data);
  26961. }
  26962. else {
  26963. // We have received an unauthorized response but have no handlers to handle it.
  26964. // Let the response return to the caller.
  26965. return response;
  26966. }
  26967. }
  26968. let redirectsRemaining = this._maxRedirects;
  26969. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  26970. && this._allowRedirects
  26971. && redirectsRemaining > 0) {
  26972. const redirectUrl = response.message.headers["location"];
  26973. if (!redirectUrl) {
  26974. // if there's no location to redirect to, we won't
  26975. break;
  26976. }
  26977. // we need to finish reading the response before reassigning response
  26978. // which will leak the open socket.
  26979. yield response.readBody();
  26980. // let's make the request with the new redirectUrl
  26981. info = this._prepareRequest(verb, redirectUrl, headers);
  26982. response = yield this.requestRaw(info, data);
  26983. redirectsRemaining--;
  26984. }
  26985. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  26986. // If not a retry code, return immediately instead of retrying
  26987. return response;
  26988. }
  26989. numTries += 1;
  26990. if (numTries < maxTries) {
  26991. yield response.readBody();
  26992. yield this._performExponentialBackoff(numTries);
  26993. }
  26994. }
  26995. return response;
  26996. });
  26997. }
  26998. /**
  26999. * Needs to be called if keepAlive is set to true in request options.
  27000. */
  27001. dispose() {
  27002. if (this._agent) {
  27003. this._agent.destroy();
  27004. }
  27005. this._disposed = true;
  27006. }
  27007. /**
  27008. * Raw request.
  27009. * @param info
  27010. * @param data
  27011. */
  27012. requestRaw(info, data) {
  27013. return new Promise((resolve, reject) => {
  27014. let callbackForResult = function (err, res) {
  27015. if (err) {
  27016. reject(err);
  27017. }
  27018. resolve(res);
  27019. };
  27020. this.requestRawWithCallback(info, data, callbackForResult);
  27021. });
  27022. }
  27023. /**
  27024. * Raw request with callback.
  27025. * @param info
  27026. * @param data
  27027. * @param onResult
  27028. */
  27029. requestRawWithCallback(info, data, onResult) {
  27030. let socket;
  27031. let isDataString = typeof (data) === 'string';
  27032. if (typeof (data) === 'string') {
  27033. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27034. }
  27035. let callbackCalled = false;
  27036. let handleResult = (err, res) => {
  27037. if (!callbackCalled) {
  27038. callbackCalled = true;
  27039. onResult(err, res);
  27040. }
  27041. };
  27042. let req = info.httpModule.request(info.options, (msg) => {
  27043. let res = new HttpClientResponse(msg);
  27044. handleResult(null, res);
  27045. });
  27046. req.on('socket', (sock) => {
  27047. socket = sock;
  27048. });
  27049. // If we ever get disconnected, we want the socket to timeout eventually
  27050. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27051. if (socket) {
  27052. socket.end();
  27053. }
  27054. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27055. });
  27056. req.on('error', function (err) {
  27057. // err has statusCode property
  27058. // res should have headers
  27059. handleResult(err, null);
  27060. });
  27061. if (data && typeof (data) === 'string') {
  27062. req.write(data, 'utf8');
  27063. }
  27064. if (data && typeof (data) !== 'string') {
  27065. data.on('close', function () {
  27066. req.end();
  27067. });
  27068. data.pipe(req);
  27069. }
  27070. else {
  27071. req.end();
  27072. }
  27073. }
  27074. _prepareRequest(method, requestUrl, headers) {
  27075. const info = {};
  27076. info.parsedUrl = url.parse(requestUrl);
  27077. const usingSsl = info.parsedUrl.protocol === 'https:';
  27078. info.httpModule = usingSsl ? https : http;
  27079. const defaultPort = usingSsl ? 443 : 80;
  27080. info.options = {};
  27081. info.options.host = info.parsedUrl.hostname;
  27082. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27083. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27084. info.options.method = method;
  27085. info.options.headers = this._mergeHeaders(headers);
  27086. info.options.headers["user-agent"] = this.userAgent;
  27087. info.options.agent = this._getAgent(requestUrl);
  27088. // gives handlers an opportunity to participate
  27089. if (this.handlers && !this._isPresigned(requestUrl)) {
  27090. this.handlers.forEach((handler) => {
  27091. handler.prepareRequest(info.options);
  27092. });
  27093. }
  27094. return info;
  27095. }
  27096. _isPresigned(requestUrl) {
  27097. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27098. const patterns = this.requestOptions.presignedUrlPatterns;
  27099. for (let i = 0; i < patterns.length; i++) {
  27100. if (requestUrl.match(patterns[i])) {
  27101. return true;
  27102. }
  27103. }
  27104. }
  27105. return false;
  27106. }
  27107. _mergeHeaders(headers) {
  27108. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27109. if (this.requestOptions && this.requestOptions.headers) {
  27110. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27111. }
  27112. return lowercaseKeys(headers || {});
  27113. }
  27114. _getAgent(requestUrl) {
  27115. let agent;
  27116. let proxy = this._getProxy(requestUrl);
  27117. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27118. if (this._keepAlive && useProxy) {
  27119. agent = this._proxyAgent;
  27120. }
  27121. if (this._keepAlive && !useProxy) {
  27122. agent = this._agent;
  27123. }
  27124. // if agent is already assigned use that agent.
  27125. if (!!agent) {
  27126. return agent;
  27127. }
  27128. let parsedUrl = url.parse(requestUrl);
  27129. const usingSsl = parsedUrl.protocol === 'https:';
  27130. let maxSockets = 100;
  27131. if (!!this.requestOptions) {
  27132. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27133. }
  27134. if (useProxy) {
  27135. // If using proxy, need tunnel
  27136. if (!tunnel) {
  27137. tunnel = __webpack_require__(856);
  27138. }
  27139. const agentOptions = {
  27140. maxSockets: maxSockets,
  27141. keepAlive: this._keepAlive,
  27142. proxy: {
  27143. proxyAuth: proxy.proxyAuth,
  27144. host: proxy.proxyUrl.hostname,
  27145. port: proxy.proxyUrl.port
  27146. },
  27147. };
  27148. let tunnelAgent;
  27149. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27150. if (usingSsl) {
  27151. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27152. }
  27153. else {
  27154. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27155. }
  27156. agent = tunnelAgent(agentOptions);
  27157. this._proxyAgent = agent;
  27158. }
  27159. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27160. if (this._keepAlive && !agent) {
  27161. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27162. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27163. this._agent = agent;
  27164. }
  27165. // if not using private agent and tunnel agent isn't setup then use global agent
  27166. if (!agent) {
  27167. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27168. }
  27169. if (usingSsl && this._ignoreSslError) {
  27170. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27171. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27172. // we have to cast it to any and change it directly
  27173. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27174. }
  27175. if (usingSsl && this._certConfig) {
  27176. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27177. }
  27178. return agent;
  27179. }
  27180. _getProxy(requestUrl) {
  27181. const parsedUrl = url.parse(requestUrl);
  27182. let usingSsl = parsedUrl.protocol === 'https:';
  27183. let proxyConfig = this._httpProxy;
  27184. // fallback to http_proxy and https_proxy env
  27185. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27186. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27187. if (!proxyConfig) {
  27188. if (https_proxy && usingSsl) {
  27189. proxyConfig = {
  27190. proxyUrl: https_proxy
  27191. };
  27192. }
  27193. else if (http_proxy) {
  27194. proxyConfig = {
  27195. proxyUrl: http_proxy
  27196. };
  27197. }
  27198. }
  27199. let proxyUrl;
  27200. let proxyAuth;
  27201. if (proxyConfig) {
  27202. if (proxyConfig.proxyUrl.length > 0) {
  27203. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27204. }
  27205. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27206. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27207. }
  27208. }
  27209. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27210. }
  27211. _isBypassProxy(requestUrl) {
  27212. if (!this._httpProxyBypassHosts) {
  27213. return false;
  27214. }
  27215. let bypass = false;
  27216. this._httpProxyBypassHosts.forEach(bypassHost => {
  27217. if (bypassHost.test(requestUrl)) {
  27218. bypass = true;
  27219. }
  27220. });
  27221. return bypass;
  27222. }
  27223. _performExponentialBackoff(retryNumber) {
  27224. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27225. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27226. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27227. }
  27228. }
  27229. exports.HttpClient = HttpClient;
  27230. /***/ }),
  27231. /***/ 881:
  27232. /***/ (function(module) {
  27233. "use strict";
  27234. const isWin = process.platform === 'win32';
  27235. function notFoundError(original, syscall) {
  27236. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27237. code: 'ENOENT',
  27238. errno: 'ENOENT',
  27239. syscall: `${syscall} ${original.command}`,
  27240. path: original.command,
  27241. spawnargs: original.args,
  27242. });
  27243. }
  27244. function hookChildProcess(cp, parsed) {
  27245. if (!isWin) {
  27246. return;
  27247. }
  27248. const originalEmit = cp.emit;
  27249. cp.emit = function (name, arg1) {
  27250. // If emitting "exit" event and exit code is 1, we need to check if
  27251. // the command exists and emit an "error" instead
  27252. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27253. if (name === 'exit') {
  27254. const err = verifyENOENT(arg1, parsed, 'spawn');
  27255. if (err) {
  27256. return originalEmit.call(cp, 'error', err);
  27257. }
  27258. }
  27259. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27260. };
  27261. }
  27262. function verifyENOENT(status, parsed) {
  27263. if (isWin && status === 1 && !parsed.file) {
  27264. return notFoundError(parsed.original, 'spawn');
  27265. }
  27266. return null;
  27267. }
  27268. function verifyENOENTSync(status, parsed) {
  27269. if (isWin && status === 1 && !parsed.file) {
  27270. return notFoundError(parsed.original, 'spawnSync');
  27271. }
  27272. return null;
  27273. }
  27274. module.exports = {
  27275. hookChildProcess,
  27276. verifyENOENT,
  27277. verifyENOENTSync,
  27278. notFoundError,
  27279. };
  27280. /***/ }),
  27281. /***/ 883:
  27282. /***/ (function(module) {
  27283. /**
  27284. * lodash (Custom Build) <https://lodash.com/>
  27285. * Build: `lodash modularize exports="npm" -o ./`
  27286. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27287. * Released under MIT license <https://lodash.com/license>
  27288. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27289. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27290. */
  27291. /** Used as the `TypeError` message for "Functions" methods. */
  27292. var FUNC_ERROR_TEXT = 'Expected a function';
  27293. /** Used to stand-in for `undefined` hash values. */
  27294. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27295. /** Used as references for various `Number` constants. */
  27296. var INFINITY = 1 / 0,
  27297. MAX_SAFE_INTEGER = 9007199254740991;
  27298. /** `Object#toString` result references. */
  27299. var funcTag = '[object Function]',
  27300. genTag = '[object GeneratorFunction]',
  27301. symbolTag = '[object Symbol]';
  27302. /** Used to match property names within property paths. */
  27303. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27304. reIsPlainProp = /^\w*$/,
  27305. reLeadingDot = /^\./,
  27306. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27307. /**
  27308. * Used to match `RegExp`
  27309. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27310. */
  27311. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27312. /** Used to match backslashes in property paths. */
  27313. var reEscapeChar = /\\(\\)?/g;
  27314. /** Used to detect host constructors (Safari). */
  27315. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27316. /** Used to detect unsigned integer values. */
  27317. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27318. /** Detect free variable `global` from Node.js. */
  27319. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27320. /** Detect free variable `self`. */
  27321. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27322. /** Used as a reference to the global object. */
  27323. var root = freeGlobal || freeSelf || Function('return this')();
  27324. /**
  27325. * Gets the value at `key` of `object`.
  27326. *
  27327. * @private
  27328. * @param {Object} [object] The object to query.
  27329. * @param {string} key The key of the property to get.
  27330. * @returns {*} Returns the property value.
  27331. */
  27332. function getValue(object, key) {
  27333. return object == null ? undefined : object[key];
  27334. }
  27335. /**
  27336. * Checks if `value` is a host object in IE < 9.
  27337. *
  27338. * @private
  27339. * @param {*} value The value to check.
  27340. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27341. */
  27342. function isHostObject(value) {
  27343. // Many host objects are `Object` objects that can coerce to strings
  27344. // despite having improperly defined `toString` methods.
  27345. var result = false;
  27346. if (value != null && typeof value.toString != 'function') {
  27347. try {
  27348. result = !!(value + '');
  27349. } catch (e) {}
  27350. }
  27351. return result;
  27352. }
  27353. /** Used for built-in method references. */
  27354. var arrayProto = Array.prototype,
  27355. funcProto = Function.prototype,
  27356. objectProto = Object.prototype;
  27357. /** Used to detect overreaching core-js shims. */
  27358. var coreJsData = root['__core-js_shared__'];
  27359. /** Used to detect methods masquerading as native. */
  27360. var maskSrcKey = (function() {
  27361. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27362. return uid ? ('Symbol(src)_1.' + uid) : '';
  27363. }());
  27364. /** Used to resolve the decompiled source of functions. */
  27365. var funcToString = funcProto.toString;
  27366. /** Used to check objects for own properties. */
  27367. var hasOwnProperty = objectProto.hasOwnProperty;
  27368. /**
  27369. * Used to resolve the
  27370. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27371. * of values.
  27372. */
  27373. var objectToString = objectProto.toString;
  27374. /** Used to detect if a method is native. */
  27375. var reIsNative = RegExp('^' +
  27376. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27377. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27378. );
  27379. /** Built-in value references. */
  27380. var Symbol = root.Symbol,
  27381. splice = arrayProto.splice;
  27382. /* Built-in method references that are verified to be native. */
  27383. var Map = getNative(root, 'Map'),
  27384. nativeCreate = getNative(Object, 'create');
  27385. /** Used to convert symbols to primitives and strings. */
  27386. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27387. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27388. /**
  27389. * Creates a hash object.
  27390. *
  27391. * @private
  27392. * @constructor
  27393. * @param {Array} [entries] The key-value pairs to cache.
  27394. */
  27395. function Hash(entries) {
  27396. var index = -1,
  27397. length = entries ? entries.length : 0;
  27398. this.clear();
  27399. while (++index < length) {
  27400. var entry = entries[index];
  27401. this.set(entry[0], entry[1]);
  27402. }
  27403. }
  27404. /**
  27405. * Removes all key-value entries from the hash.
  27406. *
  27407. * @private
  27408. * @name clear
  27409. * @memberOf Hash
  27410. */
  27411. function hashClear() {
  27412. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27413. }
  27414. /**
  27415. * Removes `key` and its value from the hash.
  27416. *
  27417. * @private
  27418. * @name delete
  27419. * @memberOf Hash
  27420. * @param {Object} hash The hash to modify.
  27421. * @param {string} key The key of the value to remove.
  27422. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27423. */
  27424. function hashDelete(key) {
  27425. return this.has(key) && delete this.__data__[key];
  27426. }
  27427. /**
  27428. * Gets the hash value for `key`.
  27429. *
  27430. * @private
  27431. * @name get
  27432. * @memberOf Hash
  27433. * @param {string} key The key of the value to get.
  27434. * @returns {*} Returns the entry value.
  27435. */
  27436. function hashGet(key) {
  27437. var data = this.__data__;
  27438. if (nativeCreate) {
  27439. var result = data[key];
  27440. return result === HASH_UNDEFINED ? undefined : result;
  27441. }
  27442. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27443. }
  27444. /**
  27445. * Checks if a hash value for `key` exists.
  27446. *
  27447. * @private
  27448. * @name has
  27449. * @memberOf Hash
  27450. * @param {string} key The key of the entry to check.
  27451. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27452. */
  27453. function hashHas(key) {
  27454. var data = this.__data__;
  27455. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27456. }
  27457. /**
  27458. * Sets the hash `key` to `value`.
  27459. *
  27460. * @private
  27461. * @name set
  27462. * @memberOf Hash
  27463. * @param {string} key The key of the value to set.
  27464. * @param {*} value The value to set.
  27465. * @returns {Object} Returns the hash instance.
  27466. */
  27467. function hashSet(key, value) {
  27468. var data = this.__data__;
  27469. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27470. return this;
  27471. }
  27472. // Add methods to `Hash`.
  27473. Hash.prototype.clear = hashClear;
  27474. Hash.prototype['delete'] = hashDelete;
  27475. Hash.prototype.get = hashGet;
  27476. Hash.prototype.has = hashHas;
  27477. Hash.prototype.set = hashSet;
  27478. /**
  27479. * Creates an list cache object.
  27480. *
  27481. * @private
  27482. * @constructor
  27483. * @param {Array} [entries] The key-value pairs to cache.
  27484. */
  27485. function ListCache(entries) {
  27486. var index = -1,
  27487. length = entries ? entries.length : 0;
  27488. this.clear();
  27489. while (++index < length) {
  27490. var entry = entries[index];
  27491. this.set(entry[0], entry[1]);
  27492. }
  27493. }
  27494. /**
  27495. * Removes all key-value entries from the list cache.
  27496. *
  27497. * @private
  27498. * @name clear
  27499. * @memberOf ListCache
  27500. */
  27501. function listCacheClear() {
  27502. this.__data__ = [];
  27503. }
  27504. /**
  27505. * Removes `key` and its value from the list cache.
  27506. *
  27507. * @private
  27508. * @name delete
  27509. * @memberOf ListCache
  27510. * @param {string} key The key of the value to remove.
  27511. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27512. */
  27513. function listCacheDelete(key) {
  27514. var data = this.__data__,
  27515. index = assocIndexOf(data, key);
  27516. if (index < 0) {
  27517. return false;
  27518. }
  27519. var lastIndex = data.length - 1;
  27520. if (index == lastIndex) {
  27521. data.pop();
  27522. } else {
  27523. splice.call(data, index, 1);
  27524. }
  27525. return true;
  27526. }
  27527. /**
  27528. * Gets the list cache value for `key`.
  27529. *
  27530. * @private
  27531. * @name get
  27532. * @memberOf ListCache
  27533. * @param {string} key The key of the value to get.
  27534. * @returns {*} Returns the entry value.
  27535. */
  27536. function listCacheGet(key) {
  27537. var data = this.__data__,
  27538. index = assocIndexOf(data, key);
  27539. return index < 0 ? undefined : data[index][1];
  27540. }
  27541. /**
  27542. * Checks if a list cache value for `key` exists.
  27543. *
  27544. * @private
  27545. * @name has
  27546. * @memberOf ListCache
  27547. * @param {string} key The key of the entry to check.
  27548. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27549. */
  27550. function listCacheHas(key) {
  27551. return assocIndexOf(this.__data__, key) > -1;
  27552. }
  27553. /**
  27554. * Sets the list cache `key` to `value`.
  27555. *
  27556. * @private
  27557. * @name set
  27558. * @memberOf ListCache
  27559. * @param {string} key The key of the value to set.
  27560. * @param {*} value The value to set.
  27561. * @returns {Object} Returns the list cache instance.
  27562. */
  27563. function listCacheSet(key, value) {
  27564. var data = this.__data__,
  27565. index = assocIndexOf(data, key);
  27566. if (index < 0) {
  27567. data.push([key, value]);
  27568. } else {
  27569. data[index][1] = value;
  27570. }
  27571. return this;
  27572. }
  27573. // Add methods to `ListCache`.
  27574. ListCache.prototype.clear = listCacheClear;
  27575. ListCache.prototype['delete'] = listCacheDelete;
  27576. ListCache.prototype.get = listCacheGet;
  27577. ListCache.prototype.has = listCacheHas;
  27578. ListCache.prototype.set = listCacheSet;
  27579. /**
  27580. * Creates a map cache object to store key-value pairs.
  27581. *
  27582. * @private
  27583. * @constructor
  27584. * @param {Array} [entries] The key-value pairs to cache.
  27585. */
  27586. function MapCache(entries) {
  27587. var index = -1,
  27588. length = entries ? entries.length : 0;
  27589. this.clear();
  27590. while (++index < length) {
  27591. var entry = entries[index];
  27592. this.set(entry[0], entry[1]);
  27593. }
  27594. }
  27595. /**
  27596. * Removes all key-value entries from the map.
  27597. *
  27598. * @private
  27599. * @name clear
  27600. * @memberOf MapCache
  27601. */
  27602. function mapCacheClear() {
  27603. this.__data__ = {
  27604. 'hash': new Hash,
  27605. 'map': new (Map || ListCache),
  27606. 'string': new Hash
  27607. };
  27608. }
  27609. /**
  27610. * Removes `key` and its value from the map.
  27611. *
  27612. * @private
  27613. * @name delete
  27614. * @memberOf MapCache
  27615. * @param {string} key The key of the value to remove.
  27616. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27617. */
  27618. function mapCacheDelete(key) {
  27619. return getMapData(this, key)['delete'](key);
  27620. }
  27621. /**
  27622. * Gets the map value for `key`.
  27623. *
  27624. * @private
  27625. * @name get
  27626. * @memberOf MapCache
  27627. * @param {string} key The key of the value to get.
  27628. * @returns {*} Returns the entry value.
  27629. */
  27630. function mapCacheGet(key) {
  27631. return getMapData(this, key).get(key);
  27632. }
  27633. /**
  27634. * Checks if a map value for `key` exists.
  27635. *
  27636. * @private
  27637. * @name has
  27638. * @memberOf MapCache
  27639. * @param {string} key The key of the entry to check.
  27640. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27641. */
  27642. function mapCacheHas(key) {
  27643. return getMapData(this, key).has(key);
  27644. }
  27645. /**
  27646. * Sets the map `key` to `value`.
  27647. *
  27648. * @private
  27649. * @name set
  27650. * @memberOf MapCache
  27651. * @param {string} key The key of the value to set.
  27652. * @param {*} value The value to set.
  27653. * @returns {Object} Returns the map cache instance.
  27654. */
  27655. function mapCacheSet(key, value) {
  27656. getMapData(this, key).set(key, value);
  27657. return this;
  27658. }
  27659. // Add methods to `MapCache`.
  27660. MapCache.prototype.clear = mapCacheClear;
  27661. MapCache.prototype['delete'] = mapCacheDelete;
  27662. MapCache.prototype.get = mapCacheGet;
  27663. MapCache.prototype.has = mapCacheHas;
  27664. MapCache.prototype.set = mapCacheSet;
  27665. /**
  27666. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27667. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27668. * for equality comparisons.
  27669. *
  27670. * @private
  27671. * @param {Object} object The object to modify.
  27672. * @param {string} key The key of the property to assign.
  27673. * @param {*} value The value to assign.
  27674. */
  27675. function assignValue(object, key, value) {
  27676. var objValue = object[key];
  27677. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27678. (value === undefined && !(key in object))) {
  27679. object[key] = value;
  27680. }
  27681. }
  27682. /**
  27683. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27684. *
  27685. * @private
  27686. * @param {Array} array The array to inspect.
  27687. * @param {*} key The key to search for.
  27688. * @returns {number} Returns the index of the matched value, else `-1`.
  27689. */
  27690. function assocIndexOf(array, key) {
  27691. var length = array.length;
  27692. while (length--) {
  27693. if (eq(array[length][0], key)) {
  27694. return length;
  27695. }
  27696. }
  27697. return -1;
  27698. }
  27699. /**
  27700. * The base implementation of `_.isNative` without bad shim checks.
  27701. *
  27702. * @private
  27703. * @param {*} value The value to check.
  27704. * @returns {boolean} Returns `true` if `value` is a native function,
  27705. * else `false`.
  27706. */
  27707. function baseIsNative(value) {
  27708. if (!isObject(value) || isMasked(value)) {
  27709. return false;
  27710. }
  27711. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27712. return pattern.test(toSource(value));
  27713. }
  27714. /**
  27715. * The base implementation of `_.set`.
  27716. *
  27717. * @private
  27718. * @param {Object} object The object to modify.
  27719. * @param {Array|string} path The path of the property to set.
  27720. * @param {*} value The value to set.
  27721. * @param {Function} [customizer] The function to customize path creation.
  27722. * @returns {Object} Returns `object`.
  27723. */
  27724. function baseSet(object, path, value, customizer) {
  27725. if (!isObject(object)) {
  27726. return object;
  27727. }
  27728. path = isKey(path, object) ? [path] : castPath(path);
  27729. var index = -1,
  27730. length = path.length,
  27731. lastIndex = length - 1,
  27732. nested = object;
  27733. while (nested != null && ++index < length) {
  27734. var key = toKey(path[index]),
  27735. newValue = value;
  27736. if (index != lastIndex) {
  27737. var objValue = nested[key];
  27738. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27739. if (newValue === undefined) {
  27740. newValue = isObject(objValue)
  27741. ? objValue
  27742. : (isIndex(path[index + 1]) ? [] : {});
  27743. }
  27744. }
  27745. assignValue(nested, key, newValue);
  27746. nested = nested[key];
  27747. }
  27748. return object;
  27749. }
  27750. /**
  27751. * The base implementation of `_.toString` which doesn't convert nullish
  27752. * values to empty strings.
  27753. *
  27754. * @private
  27755. * @param {*} value The value to process.
  27756. * @returns {string} Returns the string.
  27757. */
  27758. function baseToString(value) {
  27759. // Exit early for strings to avoid a performance hit in some environments.
  27760. if (typeof value == 'string') {
  27761. return value;
  27762. }
  27763. if (isSymbol(value)) {
  27764. return symbolToString ? symbolToString.call(value) : '';
  27765. }
  27766. var result = (value + '');
  27767. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27768. }
  27769. /**
  27770. * Casts `value` to a path array if it's not one.
  27771. *
  27772. * @private
  27773. * @param {*} value The value to inspect.
  27774. * @returns {Array} Returns the cast property path array.
  27775. */
  27776. function castPath(value) {
  27777. return isArray(value) ? value : stringToPath(value);
  27778. }
  27779. /**
  27780. * Gets the data for `map`.
  27781. *
  27782. * @private
  27783. * @param {Object} map The map to query.
  27784. * @param {string} key The reference key.
  27785. * @returns {*} Returns the map data.
  27786. */
  27787. function getMapData(map, key) {
  27788. var data = map.__data__;
  27789. return isKeyable(key)
  27790. ? data[typeof key == 'string' ? 'string' : 'hash']
  27791. : data.map;
  27792. }
  27793. /**
  27794. * Gets the native function at `key` of `object`.
  27795. *
  27796. * @private
  27797. * @param {Object} object The object to query.
  27798. * @param {string} key The key of the method to get.
  27799. * @returns {*} Returns the function if it's native, else `undefined`.
  27800. */
  27801. function getNative(object, key) {
  27802. var value = getValue(object, key);
  27803. return baseIsNative(value) ? value : undefined;
  27804. }
  27805. /**
  27806. * Checks if `value` is a valid array-like index.
  27807. *
  27808. * @private
  27809. * @param {*} value The value to check.
  27810. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27811. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27812. */
  27813. function isIndex(value, length) {
  27814. length = length == null ? MAX_SAFE_INTEGER : length;
  27815. return !!length &&
  27816. (typeof value == 'number' || reIsUint.test(value)) &&
  27817. (value > -1 && value % 1 == 0 && value < length);
  27818. }
  27819. /**
  27820. * Checks if `value` is a property name and not a property path.
  27821. *
  27822. * @private
  27823. * @param {*} value The value to check.
  27824. * @param {Object} [object] The object to query keys on.
  27825. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27826. */
  27827. function isKey(value, object) {
  27828. if (isArray(value)) {
  27829. return false;
  27830. }
  27831. var type = typeof value;
  27832. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27833. value == null || isSymbol(value)) {
  27834. return true;
  27835. }
  27836. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27837. (object != null && value in Object(object));
  27838. }
  27839. /**
  27840. * Checks if `value` is suitable for use as unique object key.
  27841. *
  27842. * @private
  27843. * @param {*} value The value to check.
  27844. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27845. */
  27846. function isKeyable(value) {
  27847. var type = typeof value;
  27848. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27849. ? (value !== '__proto__')
  27850. : (value === null);
  27851. }
  27852. /**
  27853. * Checks if `func` has its source masked.
  27854. *
  27855. * @private
  27856. * @param {Function} func The function to check.
  27857. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27858. */
  27859. function isMasked(func) {
  27860. return !!maskSrcKey && (maskSrcKey in func);
  27861. }
  27862. /**
  27863. * Converts `string` to a property path array.
  27864. *
  27865. * @private
  27866. * @param {string} string The string to convert.
  27867. * @returns {Array} Returns the property path array.
  27868. */
  27869. var stringToPath = memoize(function(string) {
  27870. string = toString(string);
  27871. var result = [];
  27872. if (reLeadingDot.test(string)) {
  27873. result.push('');
  27874. }
  27875. string.replace(rePropName, function(match, number, quote, string) {
  27876. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27877. });
  27878. return result;
  27879. });
  27880. /**
  27881. * Converts `value` to a string key if it's not a string or symbol.
  27882. *
  27883. * @private
  27884. * @param {*} value The value to inspect.
  27885. * @returns {string|symbol} Returns the key.
  27886. */
  27887. function toKey(value) {
  27888. if (typeof value == 'string' || isSymbol(value)) {
  27889. return value;
  27890. }
  27891. var result = (value + '');
  27892. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27893. }
  27894. /**
  27895. * Converts `func` to its source code.
  27896. *
  27897. * @private
  27898. * @param {Function} func The function to process.
  27899. * @returns {string} Returns the source code.
  27900. */
  27901. function toSource(func) {
  27902. if (func != null) {
  27903. try {
  27904. return funcToString.call(func);
  27905. } catch (e) {}
  27906. try {
  27907. return (func + '');
  27908. } catch (e) {}
  27909. }
  27910. return '';
  27911. }
  27912. /**
  27913. * Creates a function that memoizes the result of `func`. If `resolver` is
  27914. * provided, it determines the cache key for storing the result based on the
  27915. * arguments provided to the memoized function. By default, the first argument
  27916. * provided to the memoized function is used as the map cache key. The `func`
  27917. * is invoked with the `this` binding of the memoized function.
  27918. *
  27919. * **Note:** The cache is exposed as the `cache` property on the memoized
  27920. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27921. * constructor with one whose instances implement the
  27922. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27923. * method interface of `delete`, `get`, `has`, and `set`.
  27924. *
  27925. * @static
  27926. * @memberOf _
  27927. * @since 0.1.0
  27928. * @category Function
  27929. * @param {Function} func The function to have its output memoized.
  27930. * @param {Function} [resolver] The function to resolve the cache key.
  27931. * @returns {Function} Returns the new memoized function.
  27932. * @example
  27933. *
  27934. * var object = { 'a': 1, 'b': 2 };
  27935. * var other = { 'c': 3, 'd': 4 };
  27936. *
  27937. * var values = _.memoize(_.values);
  27938. * values(object);
  27939. * // => [1, 2]
  27940. *
  27941. * values(other);
  27942. * // => [3, 4]
  27943. *
  27944. * object.a = 2;
  27945. * values(object);
  27946. * // => [1, 2]
  27947. *
  27948. * // Modify the result cache.
  27949. * values.cache.set(object, ['a', 'b']);
  27950. * values(object);
  27951. * // => ['a', 'b']
  27952. *
  27953. * // Replace `_.memoize.Cache`.
  27954. * _.memoize.Cache = WeakMap;
  27955. */
  27956. function memoize(func, resolver) {
  27957. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  27958. throw new TypeError(FUNC_ERROR_TEXT);
  27959. }
  27960. var memoized = function() {
  27961. var args = arguments,
  27962. key = resolver ? resolver.apply(this, args) : args[0],
  27963. cache = memoized.cache;
  27964. if (cache.has(key)) {
  27965. return cache.get(key);
  27966. }
  27967. var result = func.apply(this, args);
  27968. memoized.cache = cache.set(key, result);
  27969. return result;
  27970. };
  27971. memoized.cache = new (memoize.Cache || MapCache);
  27972. return memoized;
  27973. }
  27974. // Assign cache to `_.memoize`.
  27975. memoize.Cache = MapCache;
  27976. /**
  27977. * Performs a
  27978. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27979. * comparison between two values to determine if they are equivalent.
  27980. *
  27981. * @static
  27982. * @memberOf _
  27983. * @since 4.0.0
  27984. * @category Lang
  27985. * @param {*} value The value to compare.
  27986. * @param {*} other The other value to compare.
  27987. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  27988. * @example
  27989. *
  27990. * var object = { 'a': 1 };
  27991. * var other = { 'a': 1 };
  27992. *
  27993. * _.eq(object, object);
  27994. * // => true
  27995. *
  27996. * _.eq(object, other);
  27997. * // => false
  27998. *
  27999. * _.eq('a', 'a');
  28000. * // => true
  28001. *
  28002. * _.eq('a', Object('a'));
  28003. * // => false
  28004. *
  28005. * _.eq(NaN, NaN);
  28006. * // => true
  28007. */
  28008. function eq(value, other) {
  28009. return value === other || (value !== value && other !== other);
  28010. }
  28011. /**
  28012. * Checks if `value` is classified as an `Array` object.
  28013. *
  28014. * @static
  28015. * @memberOf _
  28016. * @since 0.1.0
  28017. * @category Lang
  28018. * @param {*} value The value to check.
  28019. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28020. * @example
  28021. *
  28022. * _.isArray([1, 2, 3]);
  28023. * // => true
  28024. *
  28025. * _.isArray(document.body.children);
  28026. * // => false
  28027. *
  28028. * _.isArray('abc');
  28029. * // => false
  28030. *
  28031. * _.isArray(_.noop);
  28032. * // => false
  28033. */
  28034. var isArray = Array.isArray;
  28035. /**
  28036. * Checks if `value` is classified as a `Function` object.
  28037. *
  28038. * @static
  28039. * @memberOf _
  28040. * @since 0.1.0
  28041. * @category Lang
  28042. * @param {*} value The value to check.
  28043. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28044. * @example
  28045. *
  28046. * _.isFunction(_);
  28047. * // => true
  28048. *
  28049. * _.isFunction(/abc/);
  28050. * // => false
  28051. */
  28052. function isFunction(value) {
  28053. // The use of `Object#toString` avoids issues with the `typeof` operator
  28054. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28055. var tag = isObject(value) ? objectToString.call(value) : '';
  28056. return tag == funcTag || tag == genTag;
  28057. }
  28058. /**
  28059. * Checks if `value` is the
  28060. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28061. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28062. *
  28063. * @static
  28064. * @memberOf _
  28065. * @since 0.1.0
  28066. * @category Lang
  28067. * @param {*} value The value to check.
  28068. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28069. * @example
  28070. *
  28071. * _.isObject({});
  28072. * // => true
  28073. *
  28074. * _.isObject([1, 2, 3]);
  28075. * // => true
  28076. *
  28077. * _.isObject(_.noop);
  28078. * // => true
  28079. *
  28080. * _.isObject(null);
  28081. * // => false
  28082. */
  28083. function isObject(value) {
  28084. var type = typeof value;
  28085. return !!value && (type == 'object' || type == 'function');
  28086. }
  28087. /**
  28088. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28089. * and has a `typeof` result of "object".
  28090. *
  28091. * @static
  28092. * @memberOf _
  28093. * @since 4.0.0
  28094. * @category Lang
  28095. * @param {*} value The value to check.
  28096. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28097. * @example
  28098. *
  28099. * _.isObjectLike({});
  28100. * // => true
  28101. *
  28102. * _.isObjectLike([1, 2, 3]);
  28103. * // => true
  28104. *
  28105. * _.isObjectLike(_.noop);
  28106. * // => false
  28107. *
  28108. * _.isObjectLike(null);
  28109. * // => false
  28110. */
  28111. function isObjectLike(value) {
  28112. return !!value && typeof value == 'object';
  28113. }
  28114. /**
  28115. * Checks if `value` is classified as a `Symbol` primitive or object.
  28116. *
  28117. * @static
  28118. * @memberOf _
  28119. * @since 4.0.0
  28120. * @category Lang
  28121. * @param {*} value The value to check.
  28122. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28123. * @example
  28124. *
  28125. * _.isSymbol(Symbol.iterator);
  28126. * // => true
  28127. *
  28128. * _.isSymbol('abc');
  28129. * // => false
  28130. */
  28131. function isSymbol(value) {
  28132. return typeof value == 'symbol' ||
  28133. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28134. }
  28135. /**
  28136. * Converts `value` to a string. An empty string is returned for `null`
  28137. * and `undefined` values. The sign of `-0` is preserved.
  28138. *
  28139. * @static
  28140. * @memberOf _
  28141. * @since 4.0.0
  28142. * @category Lang
  28143. * @param {*} value The value to process.
  28144. * @returns {string} Returns the string.
  28145. * @example
  28146. *
  28147. * _.toString(null);
  28148. * // => ''
  28149. *
  28150. * _.toString(-0);
  28151. * // => '-0'
  28152. *
  28153. * _.toString([1, 2, 3]);
  28154. * // => '1,2,3'
  28155. */
  28156. function toString(value) {
  28157. return value == null ? '' : baseToString(value);
  28158. }
  28159. /**
  28160. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28161. * it's created. Arrays are created for missing index properties while objects
  28162. * are created for all other missing properties. Use `_.setWith` to customize
  28163. * `path` creation.
  28164. *
  28165. * **Note:** This method mutates `object`.
  28166. *
  28167. * @static
  28168. * @memberOf _
  28169. * @since 3.7.0
  28170. * @category Object
  28171. * @param {Object} object The object to modify.
  28172. * @param {Array|string} path The path of the property to set.
  28173. * @param {*} value The value to set.
  28174. * @returns {Object} Returns `object`.
  28175. * @example
  28176. *
  28177. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28178. *
  28179. * _.set(object, 'a[0].b.c', 4);
  28180. * console.log(object.a[0].b.c);
  28181. * // => 4
  28182. *
  28183. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28184. * console.log(object.x[0].y.z);
  28185. * // => 5
  28186. */
  28187. function set(object, path, value) {
  28188. return object == null ? object : baseSet(object, path, value);
  28189. }
  28190. module.exports = set;
  28191. /***/ }),
  28192. /***/ 898:
  28193. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28194. "use strict";
  28195. Object.defineProperty(exports, '__esModule', { value: true });
  28196. var request = __webpack_require__(753);
  28197. var universalUserAgent = __webpack_require__(796);
  28198. const VERSION = "4.3.1";
  28199. class GraphqlError extends Error {
  28200. constructor(request, response) {
  28201. const message = response.data.errors[0].message;
  28202. super(message);
  28203. Object.assign(this, response.data);
  28204. this.name = "GraphqlError";
  28205. this.request = request; // Maintains proper stack trace (only available on V8)
  28206. /* istanbul ignore next */
  28207. if (Error.captureStackTrace) {
  28208. Error.captureStackTrace(this, this.constructor);
  28209. }
  28210. }
  28211. }
  28212. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28213. function graphql(request, query, options) {
  28214. options = typeof query === "string" ? options = Object.assign({
  28215. query
  28216. }, options) : options = query;
  28217. const requestOptions = Object.keys(options).reduce((result, key) => {
  28218. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28219. result[key] = options[key];
  28220. return result;
  28221. }
  28222. if (!result.variables) {
  28223. result.variables = {};
  28224. }
  28225. result.variables[key] = options[key];
  28226. return result;
  28227. }, {});
  28228. return request(requestOptions).then(response => {
  28229. if (response.data.errors) {
  28230. throw new GraphqlError(requestOptions, {
  28231. data: response.data
  28232. });
  28233. }
  28234. return response.data.data;
  28235. });
  28236. }
  28237. function withDefaults(request$1, newDefaults) {
  28238. const newRequest = request$1.defaults(newDefaults);
  28239. const newApi = (query, options) => {
  28240. return graphql(newRequest, query, options);
  28241. };
  28242. return Object.assign(newApi, {
  28243. defaults: withDefaults.bind(null, newRequest),
  28244. endpoint: request.request.endpoint
  28245. });
  28246. }
  28247. const graphql$1 = withDefaults(request.request, {
  28248. headers: {
  28249. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28250. },
  28251. method: "POST",
  28252. url: "/graphql"
  28253. });
  28254. function withCustomRequest(customRequest) {
  28255. return withDefaults(customRequest, {
  28256. method: "POST",
  28257. url: "/graphql"
  28258. });
  28259. }
  28260. exports.graphql = graphql$1;
  28261. exports.withCustomRequest = withCustomRequest;
  28262. //# sourceMappingURL=index.js.map
  28263. /***/ }),
  28264. /***/ 916:
  28265. /***/ (function(__unusedmodule, exports) {
  28266. "use strict";
  28267. Object.defineProperty(exports, '__esModule', { value: true });
  28268. const VERSION = "1.0.0";
  28269. /**
  28270. * @param octokit Octokit instance
  28271. * @param options Options passed to Octokit constructor
  28272. */
  28273. function requestLog(octokit) {
  28274. octokit.hook.wrap("request", (request, options) => {
  28275. octokit.log.debug("request", options);
  28276. const start = Date.now();
  28277. const requestOptions = octokit.request.endpoint.parse(options);
  28278. const path = requestOptions.url.replace(options.baseUrl, "");
  28279. return request(options).then(response => {
  28280. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28281. return response;
  28282. }).catch(error => {
  28283. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28284. throw error;
  28285. });
  28286. });
  28287. }
  28288. requestLog.VERSION = VERSION;
  28289. exports.requestLog = requestLog;
  28290. //# sourceMappingURL=index.js.map
  28291. /***/ }),
  28292. /***/ 929:
  28293. /***/ (function(module, __unusedexports, __webpack_require__) {
  28294. module.exports = hasNextPage
  28295. const deprecate = __webpack_require__(370)
  28296. const getPageLinks = __webpack_require__(577)
  28297. function hasNextPage (link) {
  28298. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28299. return getPageLinks(link).next
  28300. }
  28301. /***/ }),
  28302. /***/ 948:
  28303. /***/ (function(module) {
  28304. "use strict";
  28305. /**
  28306. * Tries to execute a function and discards any error that occurs.
  28307. * @param {Function} fn - Function that might or might not throw an error.
  28308. * @returns {?*} Return-value of the function when no error occurred.
  28309. */
  28310. module.exports = function(fn) {
  28311. try { return fn() } catch (e) {}
  28312. }
  28313. /***/ }),
  28314. /***/ 950:
  28315. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28316. "use strict";
  28317. Object.defineProperty(exports, "__esModule", { value: true });
  28318. const url = __webpack_require__(835);
  28319. function getProxyUrl(reqUrl) {
  28320. let usingSsl = reqUrl.protocol === 'https:';
  28321. let proxyUrl;
  28322. if (checkBypass(reqUrl)) {
  28323. return proxyUrl;
  28324. }
  28325. let proxyVar;
  28326. if (usingSsl) {
  28327. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28328. }
  28329. else {
  28330. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28331. }
  28332. if (proxyVar) {
  28333. proxyUrl = url.parse(proxyVar);
  28334. }
  28335. return proxyUrl;
  28336. }
  28337. exports.getProxyUrl = getProxyUrl;
  28338. function checkBypass(reqUrl) {
  28339. if (!reqUrl.hostname) {
  28340. return false;
  28341. }
  28342. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28343. if (!noProxy) {
  28344. return false;
  28345. }
  28346. // Determine the request port
  28347. let reqPort;
  28348. if (reqUrl.port) {
  28349. reqPort = Number(reqUrl.port);
  28350. }
  28351. else if (reqUrl.protocol === 'http:') {
  28352. reqPort = 80;
  28353. }
  28354. else if (reqUrl.protocol === 'https:') {
  28355. reqPort = 443;
  28356. }
  28357. // Format the request hostname and hostname with port
  28358. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28359. if (typeof reqPort === 'number') {
  28360. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28361. }
  28362. // Compare request host against noproxy
  28363. for (let upperNoProxyItem of noProxy
  28364. .split(',')
  28365. .map(x => x.trim().toUpperCase())
  28366. .filter(x => x)) {
  28367. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28368. return true;
  28369. }
  28370. }
  28371. return false;
  28372. }
  28373. exports.checkBypass = checkBypass;
  28374. /***/ }),
  28375. /***/ 954:
  28376. /***/ (function(module) {
  28377. module.exports = validateAuth;
  28378. function validateAuth(auth) {
  28379. if (typeof auth === "string") {
  28380. return;
  28381. }
  28382. if (typeof auth === "function") {
  28383. return;
  28384. }
  28385. if (auth.username && auth.password) {
  28386. return;
  28387. }
  28388. if (auth.clientId && auth.clientSecret) {
  28389. return;
  28390. }
  28391. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28392. }
  28393. /***/ }),
  28394. /***/ 955:
  28395. /***/ (function(module, __unusedexports, __webpack_require__) {
  28396. "use strict";
  28397. const path = __webpack_require__(622);
  28398. const childProcess = __webpack_require__(129);
  28399. const crossSpawn = __webpack_require__(20);
  28400. const stripEof = __webpack_require__(768);
  28401. const npmRunPath = __webpack_require__(621);
  28402. const isStream = __webpack_require__(323);
  28403. const _getStream = __webpack_require__(145);
  28404. const pFinally = __webpack_require__(697);
  28405. const onExit = __webpack_require__(260);
  28406. const errname = __webpack_require__(427);
  28407. const stdio = __webpack_require__(168);
  28408. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28409. function handleArgs(cmd, args, opts) {
  28410. let parsed;
  28411. opts = Object.assign({
  28412. extendEnv: true,
  28413. env: {}
  28414. }, opts);
  28415. if (opts.extendEnv) {
  28416. opts.env = Object.assign({}, process.env, opts.env);
  28417. }
  28418. if (opts.__winShell === true) {
  28419. delete opts.__winShell;
  28420. parsed = {
  28421. command: cmd,
  28422. args,
  28423. options: opts,
  28424. file: cmd,
  28425. original: {
  28426. cmd,
  28427. args
  28428. }
  28429. };
  28430. } else {
  28431. parsed = crossSpawn._parse(cmd, args, opts);
  28432. }
  28433. opts = Object.assign({
  28434. maxBuffer: TEN_MEGABYTES,
  28435. buffer: true,
  28436. stripEof: true,
  28437. preferLocal: true,
  28438. localDir: parsed.options.cwd || process.cwd(),
  28439. encoding: 'utf8',
  28440. reject: true,
  28441. cleanup: true
  28442. }, parsed.options);
  28443. opts.stdio = stdio(opts);
  28444. if (opts.preferLocal) {
  28445. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28446. }
  28447. if (opts.detached) {
  28448. // #115
  28449. opts.cleanup = false;
  28450. }
  28451. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28452. // #116
  28453. parsed.args.unshift('/q');
  28454. }
  28455. return {
  28456. cmd: parsed.command,
  28457. args: parsed.args,
  28458. opts,
  28459. parsed
  28460. };
  28461. }
  28462. function handleInput(spawned, input) {
  28463. if (input === null || input === undefined) {
  28464. return;
  28465. }
  28466. if (isStream(input)) {
  28467. input.pipe(spawned.stdin);
  28468. } else {
  28469. spawned.stdin.end(input);
  28470. }
  28471. }
  28472. function handleOutput(opts, val) {
  28473. if (val && opts.stripEof) {
  28474. val = stripEof(val);
  28475. }
  28476. return val;
  28477. }
  28478. function handleShell(fn, cmd, opts) {
  28479. let file = '/bin/sh';
  28480. let args = ['-c', cmd];
  28481. opts = Object.assign({}, opts);
  28482. if (process.platform === 'win32') {
  28483. opts.__winShell = true;
  28484. file = process.env.comspec || 'cmd.exe';
  28485. args = ['/s', '/c', `"${cmd}"`];
  28486. opts.windowsVerbatimArguments = true;
  28487. }
  28488. if (opts.shell) {
  28489. file = opts.shell;
  28490. delete opts.shell;
  28491. }
  28492. return fn(file, args, opts);
  28493. }
  28494. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28495. if (!process[stream]) {
  28496. return null;
  28497. }
  28498. let ret;
  28499. if (!buffer) {
  28500. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28501. ret = new Promise((resolve, reject) => {
  28502. process[stream]
  28503. .once('end', resolve)
  28504. .once('error', reject);
  28505. });
  28506. } else if (encoding) {
  28507. ret = _getStream(process[stream], {
  28508. encoding,
  28509. maxBuffer
  28510. });
  28511. } else {
  28512. ret = _getStream.buffer(process[stream], {maxBuffer});
  28513. }
  28514. return ret.catch(err => {
  28515. err.stream = stream;
  28516. err.message = `${stream} ${err.message}`;
  28517. throw err;
  28518. });
  28519. }
  28520. function makeError(result, options) {
  28521. const {stdout, stderr} = result;
  28522. let err = result.error;
  28523. const {code, signal} = result;
  28524. const {parsed, joinedCmd} = options;
  28525. const timedOut = options.timedOut || false;
  28526. if (!err) {
  28527. let output = '';
  28528. if (Array.isArray(parsed.opts.stdio)) {
  28529. if (parsed.opts.stdio[2] !== 'inherit') {
  28530. output += output.length > 0 ? stderr : `\n${stderr}`;
  28531. }
  28532. if (parsed.opts.stdio[1] !== 'inherit') {
  28533. output += `\n${stdout}`;
  28534. }
  28535. } else if (parsed.opts.stdio !== 'inherit') {
  28536. output = `\n${stderr}${stdout}`;
  28537. }
  28538. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28539. err.code = code < 0 ? errname(code) : code;
  28540. }
  28541. err.stdout = stdout;
  28542. err.stderr = stderr;
  28543. err.failed = true;
  28544. err.signal = signal || null;
  28545. err.cmd = joinedCmd;
  28546. err.timedOut = timedOut;
  28547. return err;
  28548. }
  28549. function joinCmd(cmd, args) {
  28550. let joinedCmd = cmd;
  28551. if (Array.isArray(args) && args.length > 0) {
  28552. joinedCmd += ' ' + args.join(' ');
  28553. }
  28554. return joinedCmd;
  28555. }
  28556. module.exports = (cmd, args, opts) => {
  28557. const parsed = handleArgs(cmd, args, opts);
  28558. const {encoding, buffer, maxBuffer} = parsed.opts;
  28559. const joinedCmd = joinCmd(cmd, args);
  28560. let spawned;
  28561. try {
  28562. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28563. } catch (err) {
  28564. return Promise.reject(err);
  28565. }
  28566. let removeExitHandler;
  28567. if (parsed.opts.cleanup) {
  28568. removeExitHandler = onExit(() => {
  28569. spawned.kill();
  28570. });
  28571. }
  28572. let timeoutId = null;
  28573. let timedOut = false;
  28574. const cleanup = () => {
  28575. if (timeoutId) {
  28576. clearTimeout(timeoutId);
  28577. timeoutId = null;
  28578. }
  28579. if (removeExitHandler) {
  28580. removeExitHandler();
  28581. }
  28582. };
  28583. if (parsed.opts.timeout > 0) {
  28584. timeoutId = setTimeout(() => {
  28585. timeoutId = null;
  28586. timedOut = true;
  28587. spawned.kill(parsed.opts.killSignal);
  28588. }, parsed.opts.timeout);
  28589. }
  28590. const processDone = new Promise(resolve => {
  28591. spawned.on('exit', (code, signal) => {
  28592. cleanup();
  28593. resolve({code, signal});
  28594. });
  28595. spawned.on('error', err => {
  28596. cleanup();
  28597. resolve({error: err});
  28598. });
  28599. if (spawned.stdin) {
  28600. spawned.stdin.on('error', err => {
  28601. cleanup();
  28602. resolve({error: err});
  28603. });
  28604. }
  28605. });
  28606. function destroy() {
  28607. if (spawned.stdout) {
  28608. spawned.stdout.destroy();
  28609. }
  28610. if (spawned.stderr) {
  28611. spawned.stderr.destroy();
  28612. }
  28613. }
  28614. const handlePromise = () => pFinally(Promise.all([
  28615. processDone,
  28616. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28617. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28618. ]).then(arr => {
  28619. const result = arr[0];
  28620. result.stdout = arr[1];
  28621. result.stderr = arr[2];
  28622. if (result.error || result.code !== 0 || result.signal !== null) {
  28623. const err = makeError(result, {
  28624. joinedCmd,
  28625. parsed,
  28626. timedOut
  28627. });
  28628. // TODO: missing some timeout logic for killed
  28629. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28630. // err.killed = spawned.killed || killed;
  28631. err.killed = err.killed || spawned.killed;
  28632. if (!parsed.opts.reject) {
  28633. return err;
  28634. }
  28635. throw err;
  28636. }
  28637. return {
  28638. stdout: handleOutput(parsed.opts, result.stdout),
  28639. stderr: handleOutput(parsed.opts, result.stderr),
  28640. code: 0,
  28641. failed: false,
  28642. killed: false,
  28643. signal: null,
  28644. cmd: joinedCmd,
  28645. timedOut: false
  28646. };
  28647. }), destroy);
  28648. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28649. handleInput(spawned, parsed.opts.input);
  28650. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28651. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28652. return spawned;
  28653. };
  28654. // TODO: set `stderr: 'ignore'` when that option is implemented
  28655. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28656. // TODO: set `stdout: 'ignore'` when that option is implemented
  28657. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28658. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28659. module.exports.sync = (cmd, args, opts) => {
  28660. const parsed = handleArgs(cmd, args, opts);
  28661. const joinedCmd = joinCmd(cmd, args);
  28662. if (isStream(parsed.opts.input)) {
  28663. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28664. }
  28665. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28666. result.code = result.status;
  28667. if (result.error || result.status !== 0 || result.signal !== null) {
  28668. const err = makeError(result, {
  28669. joinedCmd,
  28670. parsed
  28671. });
  28672. if (!parsed.opts.reject) {
  28673. return err;
  28674. }
  28675. throw err;
  28676. }
  28677. return {
  28678. stdout: handleOutput(parsed.opts, result.stdout),
  28679. stderr: handleOutput(parsed.opts, result.stderr),
  28680. code: 0,
  28681. failed: false,
  28682. signal: null,
  28683. cmd: joinedCmd,
  28684. timedOut: false
  28685. };
  28686. };
  28687. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28688. /***/ }),
  28689. /***/ 966:
  28690. /***/ (function(module, __unusedexports, __webpack_require__) {
  28691. "use strict";
  28692. const {PassThrough} = __webpack_require__(413);
  28693. module.exports = options => {
  28694. options = Object.assign({}, options);
  28695. const {array} = options;
  28696. let {encoding} = options;
  28697. const buffer = encoding === 'buffer';
  28698. let objectMode = false;
  28699. if (array) {
  28700. objectMode = !(encoding || buffer);
  28701. } else {
  28702. encoding = encoding || 'utf8';
  28703. }
  28704. if (buffer) {
  28705. encoding = null;
  28706. }
  28707. let len = 0;
  28708. const ret = [];
  28709. const stream = new PassThrough({objectMode});
  28710. if (encoding) {
  28711. stream.setEncoding(encoding);
  28712. }
  28713. stream.on('data', chunk => {
  28714. ret.push(chunk);
  28715. if (objectMode) {
  28716. len = ret.length;
  28717. } else {
  28718. len += chunk.length;
  28719. }
  28720. });
  28721. stream.getBufferedValue = () => {
  28722. if (array) {
  28723. return ret;
  28724. }
  28725. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28726. };
  28727. stream.getBufferedLength = () => len;
  28728. return stream;
  28729. };
  28730. /***/ }),
  28731. /***/ 969:
  28732. /***/ (function(module, __unusedexports, __webpack_require__) {
  28733. var wrappy = __webpack_require__(11)
  28734. module.exports = wrappy(once)
  28735. module.exports.strict = wrappy(onceStrict)
  28736. once.proto = once(function () {
  28737. Object.defineProperty(Function.prototype, 'once', {
  28738. value: function () {
  28739. return once(this)
  28740. },
  28741. configurable: true
  28742. })
  28743. Object.defineProperty(Function.prototype, 'onceStrict', {
  28744. value: function () {
  28745. return onceStrict(this)
  28746. },
  28747. configurable: true
  28748. })
  28749. })
  28750. function once (fn) {
  28751. var f = function () {
  28752. if (f.called) return f.value
  28753. f.called = true
  28754. return f.value = fn.apply(this, arguments)
  28755. }
  28756. f.called = false
  28757. return f
  28758. }
  28759. function onceStrict (fn) {
  28760. var f = function () {
  28761. if (f.called)
  28762. throw new Error(f.onceError)
  28763. f.called = true
  28764. return f.value = fn.apply(this, arguments)
  28765. }
  28766. var name = fn.name || 'Function wrapped with `once`'
  28767. f.onceError = name + " shouldn't be called more than once"
  28768. f.called = false
  28769. return f
  28770. }
  28771. /***/ }),
  28772. /***/ 986:
  28773. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28774. "use strict";
  28775. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28776. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28777. return new (P || (P = Promise))(function (resolve, reject) {
  28778. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28779. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28780. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28781. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28782. });
  28783. };
  28784. Object.defineProperty(exports, "__esModule", { value: true });
  28785. const tr = __webpack_require__(9);
  28786. /**
  28787. * Exec a command.
  28788. * Output will be streamed to the live console.
  28789. * Returns promise with return code
  28790. *
  28791. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28792. * @param args optional arguments for tool. Escaping is handled by the lib.
  28793. * @param options optional exec options. See ExecOptions
  28794. * @returns Promise<number> exit code
  28795. */
  28796. function exec(commandLine, args, options) {
  28797. return __awaiter(this, void 0, void 0, function* () {
  28798. const commandArgs = tr.argStringToArray(commandLine);
  28799. if (commandArgs.length === 0) {
  28800. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28801. }
  28802. // Path to tool to execute should be first arg
  28803. const toolPath = commandArgs[0];
  28804. args = commandArgs.slice(1).concat(args || []);
  28805. const runner = new tr.ToolRunner(toolPath, args, options);
  28806. return runner.exec();
  28807. });
  28808. }
  28809. exports.exec = exec;
  28810. //# sourceMappingURL=exec.js.map
  28811. /***/ }),
  28812. /***/ 991:
  28813. /***/ (function(module, __unusedexports, __webpack_require__) {
  28814. module.exports = authenticationRequestError;
  28815. const { RequestError } = __webpack_require__(497);
  28816. function authenticationRequestError(state, error, options) {
  28817. if (!error.headers) throw error;
  28818. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28819. // handle "2FA required" error only
  28820. if (error.status !== 401 || !otpRequired) {
  28821. throw error;
  28822. }
  28823. if (
  28824. error.status === 401 &&
  28825. otpRequired &&
  28826. error.request &&
  28827. error.request.headers["x-github-otp"]
  28828. ) {
  28829. if (state.otp) {
  28830. delete state.otp; // no longer valid, request again
  28831. } else {
  28832. throw new RequestError(
  28833. "Invalid one-time password for two-factor authentication",
  28834. 401,
  28835. {
  28836. headers: error.headers,
  28837. request: options
  28838. }
  28839. );
  28840. }
  28841. }
  28842. if (typeof state.auth.on2fa !== "function") {
  28843. throw new RequestError(
  28844. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28845. 401,
  28846. {
  28847. headers: error.headers,
  28848. request: options
  28849. }
  28850. );
  28851. }
  28852. return Promise.resolve()
  28853. .then(() => {
  28854. return state.auth.on2fa();
  28855. })
  28856. .then(oneTimePassword => {
  28857. const newOptions = Object.assign(options, {
  28858. headers: Object.assign(options.headers, {
  28859. "x-github-otp": oneTimePassword
  28860. })
  28861. });
  28862. return state.octokit.request(newOptions).then(response => {
  28863. // If OTP still valid, then persist it for following requests
  28864. state.otp = oneTimePassword;
  28865. return response;
  28866. });
  28867. });
  28868. }
  28869. /***/ })
  28870. /******/ });