index.js 810 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299
  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. getDefaultBranch(repositoryUrl) {
  5144. return __awaiter(this, void 0, void 0, function* () {
  5145. let output;
  5146. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5147. output = yield this.execGit([
  5148. 'ls-remote',
  5149. '--quiet',
  5150. '--exit-code',
  5151. '--symref',
  5152. repositoryUrl,
  5153. 'HEAD'
  5154. ]);
  5155. }));
  5156. if (output) {
  5157. // Satisfy compiler, will always be set
  5158. for (let line of output.stdout.trim().split('\n')) {
  5159. line = line.trim();
  5160. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  5161. return line
  5162. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  5163. .trim();
  5164. }
  5165. }
  5166. }
  5167. throw new Error('Unexpected output when retrieving default branch');
  5168. });
  5169. }
  5170. getWorkingDirectory() {
  5171. return this.workingDirectory;
  5172. }
  5173. init() {
  5174. return __awaiter(this, void 0, void 0, function* () {
  5175. yield this.execGit(['init', this.workingDirectory]);
  5176. });
  5177. }
  5178. isDetached() {
  5179. return __awaiter(this, void 0, void 0, function* () {
  5180. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5181. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5182. return !output.stdout.trim().startsWith('refs/heads/');
  5183. });
  5184. }
  5185. lfsFetch(ref) {
  5186. return __awaiter(this, void 0, void 0, function* () {
  5187. const args = ['lfs', 'fetch', 'origin', ref];
  5188. const that = this;
  5189. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5190. yield that.execGit(args);
  5191. }));
  5192. });
  5193. }
  5194. lfsInstall() {
  5195. return __awaiter(this, void 0, void 0, function* () {
  5196. yield this.execGit(['lfs', 'install', '--local']);
  5197. });
  5198. }
  5199. log1(format) {
  5200. return __awaiter(this, void 0, void 0, function* () {
  5201. var args = format ? ['log', '-1', format] : ['log', '-1'];
  5202. var silent = format ? false : true;
  5203. const output = yield this.execGit(args, false, silent);
  5204. return output.stdout;
  5205. });
  5206. }
  5207. remoteAdd(remoteName, remoteUrl) {
  5208. return __awaiter(this, void 0, void 0, function* () {
  5209. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5210. });
  5211. }
  5212. removeEnvironmentVariable(name) {
  5213. delete this.gitEnv[name];
  5214. }
  5215. /**
  5216. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5217. * For an annotated tag, the tag SHA is returned.
  5218. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  5219. * @returns {Promise<string>}
  5220. */
  5221. revParse(ref) {
  5222. return __awaiter(this, void 0, void 0, function* () {
  5223. const output = yield this.execGit(['rev-parse', ref]);
  5224. return output.stdout.trim();
  5225. });
  5226. }
  5227. setEnvironmentVariable(name, value) {
  5228. this.gitEnv[name] = value;
  5229. }
  5230. shaExists(sha) {
  5231. return __awaiter(this, void 0, void 0, function* () {
  5232. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5233. const output = yield this.execGit(args, true);
  5234. return output.exitCode === 0;
  5235. });
  5236. }
  5237. submoduleForeach(command, recursive) {
  5238. return __awaiter(this, void 0, void 0, function* () {
  5239. const args = ['submodule', 'foreach'];
  5240. if (recursive) {
  5241. args.push('--recursive');
  5242. }
  5243. args.push(command);
  5244. const output = yield this.execGit(args);
  5245. return output.stdout;
  5246. });
  5247. }
  5248. submoduleSync(recursive) {
  5249. return __awaiter(this, void 0, void 0, function* () {
  5250. const args = ['submodule', 'sync'];
  5251. if (recursive) {
  5252. args.push('--recursive');
  5253. }
  5254. yield this.execGit(args);
  5255. });
  5256. }
  5257. submoduleUpdate(fetchDepth, recursive) {
  5258. return __awaiter(this, void 0, void 0, function* () {
  5259. const args = ['-c', 'protocol.version=2'];
  5260. args.push('submodule', 'update', '--init', '--force');
  5261. if (fetchDepth > 0) {
  5262. args.push(`--depth=${fetchDepth}`);
  5263. }
  5264. if (recursive) {
  5265. args.push('--recursive');
  5266. }
  5267. yield this.execGit(args);
  5268. });
  5269. }
  5270. tagExists(pattern) {
  5271. return __awaiter(this, void 0, void 0, function* () {
  5272. const output = yield this.execGit(['tag', '--list', pattern]);
  5273. return !!output.stdout.trim();
  5274. });
  5275. }
  5276. tryClean() {
  5277. return __awaiter(this, void 0, void 0, function* () {
  5278. const output = yield this.execGit(['clean', '-ffdx'], true);
  5279. return output.exitCode === 0;
  5280. });
  5281. }
  5282. tryConfigUnset(configKey, globalConfig) {
  5283. return __awaiter(this, void 0, void 0, function* () {
  5284. const output = yield this.execGit([
  5285. 'config',
  5286. globalConfig ? '--global' : '--local',
  5287. '--unset-all',
  5288. configKey
  5289. ], true);
  5290. return output.exitCode === 0;
  5291. });
  5292. }
  5293. tryDisableAutomaticGarbageCollection() {
  5294. return __awaiter(this, void 0, void 0, function* () {
  5295. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5296. return output.exitCode === 0;
  5297. });
  5298. }
  5299. tryGetFetchUrl() {
  5300. return __awaiter(this, void 0, void 0, function* () {
  5301. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5302. if (output.exitCode !== 0) {
  5303. return '';
  5304. }
  5305. const stdout = output.stdout.trim();
  5306. if (stdout.includes('\n')) {
  5307. return '';
  5308. }
  5309. return stdout;
  5310. });
  5311. }
  5312. tryReset() {
  5313. return __awaiter(this, void 0, void 0, function* () {
  5314. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5315. return output.exitCode === 0;
  5316. });
  5317. }
  5318. static createCommandManager(workingDirectory, lfs) {
  5319. return __awaiter(this, void 0, void 0, function* () {
  5320. const result = new GitCommandManager();
  5321. yield result.initializeCommandManager(workingDirectory, lfs);
  5322. return result;
  5323. });
  5324. }
  5325. execGit(args, allowAllExitCodes = false, silent = false) {
  5326. return __awaiter(this, void 0, void 0, function* () {
  5327. fshelper.directoryExistsSync(this.workingDirectory, true);
  5328. const result = new GitOutput();
  5329. const env = {};
  5330. for (const key of Object.keys(process.env)) {
  5331. env[key] = process.env[key];
  5332. }
  5333. for (const key of Object.keys(this.gitEnv)) {
  5334. env[key] = this.gitEnv[key];
  5335. }
  5336. const stdout = [];
  5337. const options = {
  5338. cwd: this.workingDirectory,
  5339. env,
  5340. silent,
  5341. ignoreReturnCode: allowAllExitCodes,
  5342. listeners: {
  5343. stdout: (data) => {
  5344. stdout.push(data.toString());
  5345. }
  5346. }
  5347. };
  5348. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5349. result.stdout = stdout.join('');
  5350. return result;
  5351. });
  5352. }
  5353. initializeCommandManager(workingDirectory, lfs) {
  5354. return __awaiter(this, void 0, void 0, function* () {
  5355. this.workingDirectory = workingDirectory;
  5356. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5357. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5358. this.lfs = lfs;
  5359. if (!this.lfs) {
  5360. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5361. }
  5362. this.gitPath = yield io.which('git', true);
  5363. // Git version
  5364. core.debug('Getting git version');
  5365. let gitVersion = new git_version_1.GitVersion();
  5366. let gitOutput = yield this.execGit(['version']);
  5367. let stdout = gitOutput.stdout.trim();
  5368. if (!stdout.includes('\n')) {
  5369. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5370. if (match) {
  5371. gitVersion = new git_version_1.GitVersion(match[0]);
  5372. }
  5373. }
  5374. if (!gitVersion.isValid()) {
  5375. throw new Error('Unable to determine git version');
  5376. }
  5377. // Minimum git version
  5378. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5379. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5380. }
  5381. if (this.lfs) {
  5382. // Git-lfs version
  5383. core.debug('Getting git-lfs version');
  5384. let gitLfsVersion = new git_version_1.GitVersion();
  5385. const gitLfsPath = yield io.which('git-lfs', true);
  5386. gitOutput = yield this.execGit(['lfs', 'version']);
  5387. stdout = gitOutput.stdout.trim();
  5388. if (!stdout.includes('\n')) {
  5389. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5390. if (match) {
  5391. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5392. }
  5393. }
  5394. if (!gitLfsVersion.isValid()) {
  5395. throw new Error('Unable to determine git-lfs version');
  5396. }
  5397. // Minimum git-lfs version
  5398. // Note:
  5399. // - Auth header not supported before 2.1
  5400. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5401. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5402. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5403. }
  5404. }
  5405. // Set the user agent
  5406. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5407. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5408. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5409. });
  5410. }
  5411. }
  5412. class GitOutput {
  5413. constructor() {
  5414. this.stdout = '';
  5415. this.exitCode = 0;
  5416. }
  5417. }
  5418. /***/ }),
  5419. /***/ 293:
  5420. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5421. "use strict";
  5422. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5423. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5424. return new (P || (P = Promise))(function (resolve, reject) {
  5425. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5426. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5427. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5428. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5429. });
  5430. };
  5431. var __importStar = (this && this.__importStar) || function (mod) {
  5432. if (mod && mod.__esModule) return mod;
  5433. var result = {};
  5434. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5435. result["default"] = mod;
  5436. return result;
  5437. };
  5438. Object.defineProperty(exports, "__esModule", { value: true });
  5439. const core = __importStar(__webpack_require__(470));
  5440. const fsHelper = __importStar(__webpack_require__(618));
  5441. const gitAuthHelper = __importStar(__webpack_require__(287));
  5442. const gitCommandManager = __importStar(__webpack_require__(289));
  5443. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5444. const githubApiHelper = __importStar(__webpack_require__(464));
  5445. const io = __importStar(__webpack_require__(1));
  5446. const path = __importStar(__webpack_require__(622));
  5447. const refHelper = __importStar(__webpack_require__(227));
  5448. const stateHelper = __importStar(__webpack_require__(153));
  5449. const urlHelper = __importStar(__webpack_require__(81));
  5450. function getSource(settings) {
  5451. return __awaiter(this, void 0, void 0, function* () {
  5452. // Repository URL
  5453. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5454. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5455. // Remove conflicting file path
  5456. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5457. yield io.rmRF(settings.repositoryPath);
  5458. }
  5459. // Create directory
  5460. let isExisting = true;
  5461. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5462. isExisting = false;
  5463. yield io.mkdirP(settings.repositoryPath);
  5464. }
  5465. // Git command manager
  5466. core.startGroup('Getting Git version info');
  5467. const git = yield getGitCommandManager(settings);
  5468. core.endGroup();
  5469. // Prepare existing directory, otherwise recreate
  5470. if (isExisting) {
  5471. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5472. }
  5473. if (!git) {
  5474. // Downloading using REST API
  5475. core.info(`The repository will be downloaded using the GitHub REST API`);
  5476. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5477. if (settings.submodules) {
  5478. 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.`);
  5479. }
  5480. else if (settings.sshKey) {
  5481. 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.`);
  5482. }
  5483. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5484. return;
  5485. }
  5486. // Save state for POST action
  5487. stateHelper.setRepositoryPath(settings.repositoryPath);
  5488. // Initialize the repository
  5489. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5490. core.startGroup('Initializing the repository');
  5491. yield git.init();
  5492. yield git.remoteAdd('origin', repositoryUrl);
  5493. core.endGroup();
  5494. }
  5495. // Disable automatic garbage collection
  5496. core.startGroup('Disabling automatic garbage collection');
  5497. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5498. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5499. }
  5500. core.endGroup();
  5501. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5502. try {
  5503. // Configure auth
  5504. core.startGroup('Setting up auth');
  5505. yield authHelper.configureAuth();
  5506. core.endGroup();
  5507. // Determine the default branch
  5508. if (!settings.ref && !settings.commit) {
  5509. core.startGroup('Determining the default branch');
  5510. if (settings.sshKey) {
  5511. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  5512. }
  5513. else {
  5514. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5515. }
  5516. core.endGroup();
  5517. }
  5518. // LFS install
  5519. if (settings.lfs) {
  5520. yield git.lfsInstall();
  5521. }
  5522. // Fetch
  5523. core.startGroup('Fetching the repository');
  5524. if (settings.fetchDepth <= 0) {
  5525. // Fetch all branches and tags
  5526. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5527. yield git.fetch(refSpec);
  5528. // When all history is fetched, the ref we're interested in may have moved to a different
  5529. // commit (push or force push). If so, fetch again with a targeted refspec.
  5530. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5531. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5532. yield git.fetch(refSpec);
  5533. }
  5534. }
  5535. else {
  5536. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5537. yield git.fetch(refSpec, settings.fetchDepth);
  5538. }
  5539. core.endGroup();
  5540. // Checkout info
  5541. core.startGroup('Determining the checkout info');
  5542. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5543. core.endGroup();
  5544. // LFS fetch
  5545. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5546. // Explicit lfs fetch will fetch lfs objects in parallel.
  5547. if (settings.lfs) {
  5548. core.startGroup('Fetching LFS objects');
  5549. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5550. core.endGroup();
  5551. }
  5552. // Checkout
  5553. core.startGroup('Checking out the ref');
  5554. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5555. core.endGroup();
  5556. // Submodules
  5557. if (settings.submodules) {
  5558. try {
  5559. // Temporarily override global config
  5560. core.startGroup('Setting up auth for fetching submodules');
  5561. yield authHelper.configureGlobalAuth();
  5562. core.endGroup();
  5563. // Checkout submodules
  5564. core.startGroup('Fetching submodules');
  5565. yield git.submoduleSync(settings.nestedSubmodules);
  5566. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5567. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5568. core.endGroup();
  5569. // Persist credentials
  5570. if (settings.persistCredentials) {
  5571. core.startGroup('Persisting credentials for submodules');
  5572. yield authHelper.configureSubmoduleAuth();
  5573. core.endGroup();
  5574. }
  5575. }
  5576. finally {
  5577. // Remove temporary global config override
  5578. yield authHelper.removeGlobalAuth();
  5579. }
  5580. }
  5581. // Get commit information
  5582. const commitInfo = yield git.log1();
  5583. // Log commit sha
  5584. yield git.log1("--format='%H'");
  5585. // Check for incorrect pull request merge commit
  5586. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5587. }
  5588. finally {
  5589. // Remove auth
  5590. if (!settings.persistCredentials) {
  5591. core.startGroup('Removing auth');
  5592. yield authHelper.removeAuth();
  5593. core.endGroup();
  5594. }
  5595. }
  5596. });
  5597. }
  5598. exports.getSource = getSource;
  5599. function cleanup(repositoryPath) {
  5600. return __awaiter(this, void 0, void 0, function* () {
  5601. // Repo exists?
  5602. if (!repositoryPath ||
  5603. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5604. return;
  5605. }
  5606. let git;
  5607. try {
  5608. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5609. }
  5610. catch (_a) {
  5611. return;
  5612. }
  5613. // Remove auth
  5614. const authHelper = gitAuthHelper.createAuthHelper(git);
  5615. yield authHelper.removeAuth();
  5616. });
  5617. }
  5618. exports.cleanup = cleanup;
  5619. function getGitCommandManager(settings) {
  5620. return __awaiter(this, void 0, void 0, function* () {
  5621. core.info(`Working directory is '${settings.repositoryPath}'`);
  5622. try {
  5623. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5624. }
  5625. catch (err) {
  5626. // Git is required for LFS
  5627. if (settings.lfs) {
  5628. throw err;
  5629. }
  5630. // Otherwise fallback to REST API
  5631. return undefined;
  5632. }
  5633. });
  5634. }
  5635. /***/ }),
  5636. /***/ 294:
  5637. /***/ (function(module, __unusedexports, __webpack_require__) {
  5638. module.exports = parseOptions;
  5639. const { Deprecation } = __webpack_require__(692);
  5640. const { getUserAgent } = __webpack_require__(796);
  5641. const once = __webpack_require__(969);
  5642. const pkg = __webpack_require__(215);
  5643. const deprecateOptionsTimeout = once((log, deprecation) =>
  5644. log.warn(deprecation)
  5645. );
  5646. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5647. const deprecateOptionsHeaders = once((log, deprecation) =>
  5648. log.warn(deprecation)
  5649. );
  5650. function parseOptions(options, log, hook) {
  5651. if (options.headers) {
  5652. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5653. newObj[key.toLowerCase()] = options.headers[key];
  5654. return newObj;
  5655. }, {});
  5656. }
  5657. const clientDefaults = {
  5658. headers: options.headers || {},
  5659. request: options.request || {},
  5660. mediaType: {
  5661. previews: [],
  5662. format: ""
  5663. }
  5664. };
  5665. if (options.baseUrl) {
  5666. clientDefaults.baseUrl = options.baseUrl;
  5667. }
  5668. if (options.userAgent) {
  5669. clientDefaults.headers["user-agent"] = options.userAgent;
  5670. }
  5671. if (options.previews) {
  5672. clientDefaults.mediaType.previews = options.previews;
  5673. }
  5674. if (options.timeZone) {
  5675. clientDefaults.headers["time-zone"] = options.timeZone;
  5676. }
  5677. if (options.timeout) {
  5678. deprecateOptionsTimeout(
  5679. log,
  5680. new Deprecation(
  5681. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5682. )
  5683. );
  5684. clientDefaults.request.timeout = options.timeout;
  5685. }
  5686. if (options.agent) {
  5687. deprecateOptionsAgent(
  5688. log,
  5689. new Deprecation(
  5690. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5691. )
  5692. );
  5693. clientDefaults.request.agent = options.agent;
  5694. }
  5695. if (options.headers) {
  5696. deprecateOptionsHeaders(
  5697. log,
  5698. new Deprecation(
  5699. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5700. )
  5701. );
  5702. }
  5703. const userAgentOption = clientDefaults.headers["user-agent"];
  5704. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5705. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5706. .filter(Boolean)
  5707. .join(" ");
  5708. clientDefaults.request.hook = hook.bind(null, "request");
  5709. return clientDefaults;
  5710. }
  5711. /***/ }),
  5712. /***/ 297:
  5713. /***/ (function(module) {
  5714. module.exports = class HttpError extends Error {
  5715. constructor (message, code, headers) {
  5716. super(message)
  5717. // Maintains proper stack trace (only available on V8)
  5718. /* istanbul ignore next */
  5719. if (Error.captureStackTrace) {
  5720. Error.captureStackTrace(this, this.constructor)
  5721. }
  5722. this.name = 'HttpError'
  5723. this.code = code
  5724. this.headers = headers
  5725. }
  5726. }
  5727. /***/ }),
  5728. /***/ 299:
  5729. /***/ (function(__unusedmodule, exports) {
  5730. "use strict";
  5731. Object.defineProperty(exports, '__esModule', { value: true });
  5732. const VERSION = "1.1.2";
  5733. /**
  5734. * Some “list” response that can be paginated have a different response structure
  5735. *
  5736. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5737. * /installation/repositories also has `repository_selection`), as well as a key with
  5738. * the list of the items which name varies from endpoint to endpoint:
  5739. *
  5740. * - https://developer.github.com/v3/search/#example (key `items`)
  5741. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5742. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5743. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5744. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5745. *
  5746. * Octokit normalizes these responses so that paginated results are always returned following
  5747. * the same structure. One challenge is that if the list response has only one page, no Link
  5748. * header is provided, so this header alone is not sufficient to check wether a response is
  5749. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5750. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5751. * property because it also exists in the response of Get the combined status for a specific ref.
  5752. */
  5753. 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))?([^/]|$)/];
  5754. function normalizePaginatedListResponse(octokit, url, response) {
  5755. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5756. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5757. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5758. // to retrieve the same information.
  5759. const incompleteResults = response.data.incomplete_results;
  5760. const repositorySelection = response.data.repository_selection;
  5761. const totalCount = response.data.total_count;
  5762. delete response.data.incomplete_results;
  5763. delete response.data.repository_selection;
  5764. delete response.data.total_count;
  5765. const namespaceKey = Object.keys(response.data)[0];
  5766. const data = response.data[namespaceKey];
  5767. response.data = data;
  5768. if (typeof incompleteResults !== "undefined") {
  5769. response.data.incomplete_results = incompleteResults;
  5770. }
  5771. if (typeof repositorySelection !== "undefined") {
  5772. response.data.repository_selection = repositorySelection;
  5773. }
  5774. response.data.total_count = totalCount;
  5775. Object.defineProperty(response.data, namespaceKey, {
  5776. get() {
  5777. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5778. return Array.from(data);
  5779. }
  5780. });
  5781. }
  5782. function iterator(octokit, route, parameters) {
  5783. const options = octokit.request.endpoint(route, parameters);
  5784. const method = options.method;
  5785. const headers = options.headers;
  5786. let url = options.url;
  5787. return {
  5788. [Symbol.asyncIterator]: () => ({
  5789. next() {
  5790. if (!url) {
  5791. return Promise.resolve({
  5792. done: true
  5793. });
  5794. }
  5795. return octokit.request({
  5796. method,
  5797. url,
  5798. headers
  5799. }).then(response => {
  5800. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5801. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5802. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5803. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5804. return {
  5805. value: response
  5806. };
  5807. });
  5808. }
  5809. })
  5810. };
  5811. }
  5812. function paginate(octokit, route, parameters, mapFn) {
  5813. if (typeof parameters === "function") {
  5814. mapFn = parameters;
  5815. parameters = undefined;
  5816. }
  5817. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5818. }
  5819. function gather(octokit, results, iterator, mapFn) {
  5820. return iterator.next().then(result => {
  5821. if (result.done) {
  5822. return results;
  5823. }
  5824. let earlyExit = false;
  5825. function done() {
  5826. earlyExit = true;
  5827. }
  5828. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5829. if (earlyExit) {
  5830. return results;
  5831. }
  5832. return gather(octokit, results, iterator, mapFn);
  5833. });
  5834. }
  5835. /**
  5836. * @param octokit Octokit instance
  5837. * @param options Options passed to Octokit constructor
  5838. */
  5839. function paginateRest(octokit) {
  5840. return {
  5841. paginate: Object.assign(paginate.bind(null, octokit), {
  5842. iterator: iterator.bind(null, octokit)
  5843. })
  5844. };
  5845. }
  5846. paginateRest.VERSION = VERSION;
  5847. exports.paginateRest = paginateRest;
  5848. //# sourceMappingURL=index.js.map
  5849. /***/ }),
  5850. /***/ 323:
  5851. /***/ (function(module) {
  5852. "use strict";
  5853. var isStream = module.exports = function (stream) {
  5854. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5855. };
  5856. isStream.writable = function (stream) {
  5857. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5858. };
  5859. isStream.readable = function (stream) {
  5860. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5861. };
  5862. isStream.duplex = function (stream) {
  5863. return isStream.writable(stream) && isStream.readable(stream);
  5864. };
  5865. isStream.transform = function (stream) {
  5866. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5867. };
  5868. /***/ }),
  5869. /***/ 335:
  5870. /***/ (function(module, __unusedexports, __webpack_require__) {
  5871. module.exports = __webpack_require__(179);
  5872. /***/ }),
  5873. /***/ 336:
  5874. /***/ (function(module, __unusedexports, __webpack_require__) {
  5875. module.exports = hasLastPage
  5876. const deprecate = __webpack_require__(370)
  5877. const getPageLinks = __webpack_require__(577)
  5878. function hasLastPage (link) {
  5879. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5880. return getPageLinks(link).last
  5881. }
  5882. /***/ }),
  5883. /***/ 348:
  5884. /***/ (function(module, __unusedexports, __webpack_require__) {
  5885. "use strict";
  5886. module.exports = validate;
  5887. const { RequestError } = __webpack_require__(497);
  5888. const get = __webpack_require__(854);
  5889. const set = __webpack_require__(883);
  5890. function validate(octokit, options) {
  5891. if (!options.request.validate) {
  5892. return;
  5893. }
  5894. const { validate: params } = options.request;
  5895. Object.keys(params).forEach(parameterName => {
  5896. const parameter = get(params, parameterName);
  5897. const expectedType = parameter.type;
  5898. let parentParameterName;
  5899. let parentValue;
  5900. let parentParamIsPresent = true;
  5901. let parentParameterIsArray = false;
  5902. if (/\./.test(parameterName)) {
  5903. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5904. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5905. if (parentParameterIsArray) {
  5906. parentParameterName = parentParameterName.slice(0, -2);
  5907. }
  5908. parentValue = get(options, parentParameterName);
  5909. parentParamIsPresent =
  5910. parentParameterName === "headers" ||
  5911. (typeof parentValue === "object" && parentValue !== null);
  5912. }
  5913. const values = parentParameterIsArray
  5914. ? (get(options, parentParameterName) || []).map(
  5915. value => value[parameterName.split(/\./).pop()]
  5916. )
  5917. : [get(options, parameterName)];
  5918. values.forEach((value, i) => {
  5919. const valueIsPresent = typeof value !== "undefined";
  5920. const valueIsNull = value === null;
  5921. const currentParameterName = parentParameterIsArray
  5922. ? parameterName.replace(/\[\]/, `[${i}]`)
  5923. : parameterName;
  5924. if (!parameter.required && !valueIsPresent) {
  5925. return;
  5926. }
  5927. // if the parent parameter is of type object but allows null
  5928. // then the child parameters can be ignored
  5929. if (!parentParamIsPresent) {
  5930. return;
  5931. }
  5932. if (parameter.allowNull && valueIsNull) {
  5933. return;
  5934. }
  5935. if (!parameter.allowNull && valueIsNull) {
  5936. throw new RequestError(
  5937. `'${currentParameterName}' cannot be null`,
  5938. 400,
  5939. {
  5940. request: options
  5941. }
  5942. );
  5943. }
  5944. if (parameter.required && !valueIsPresent) {
  5945. throw new RequestError(
  5946. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5947. value
  5948. )}`,
  5949. 400,
  5950. {
  5951. request: options
  5952. }
  5953. );
  5954. }
  5955. // parse to integer before checking for enum
  5956. // so that string "1" will match enum with number 1
  5957. if (expectedType === "integer") {
  5958. const unparsedValue = value;
  5959. value = parseInt(value, 10);
  5960. if (isNaN(value)) {
  5961. throw new RequestError(
  5962. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5963. unparsedValue
  5964. )} is NaN`,
  5965. 400,
  5966. {
  5967. request: options
  5968. }
  5969. );
  5970. }
  5971. }
  5972. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5973. throw new RequestError(
  5974. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5975. value
  5976. )}`,
  5977. 400,
  5978. {
  5979. request: options
  5980. }
  5981. );
  5982. }
  5983. if (parameter.validation) {
  5984. const regex = new RegExp(parameter.validation);
  5985. if (!regex.test(value)) {
  5986. throw new RequestError(
  5987. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5988. value
  5989. )}`,
  5990. 400,
  5991. {
  5992. request: options
  5993. }
  5994. );
  5995. }
  5996. }
  5997. if (expectedType === "object" && typeof value === "string") {
  5998. try {
  5999. value = JSON.parse(value);
  6000. } catch (exception) {
  6001. throw new RequestError(
  6002. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  6003. value
  6004. )}`,
  6005. 400,
  6006. {
  6007. request: options
  6008. }
  6009. );
  6010. }
  6011. }
  6012. set(options, parameter.mapTo || currentParameterName, value);
  6013. });
  6014. });
  6015. return options;
  6016. }
  6017. /***/ }),
  6018. /***/ 349:
  6019. /***/ (function(module, __unusedexports, __webpack_require__) {
  6020. module.exports = authenticationRequestError;
  6021. const { RequestError } = __webpack_require__(497);
  6022. function authenticationRequestError(state, error, options) {
  6023. /* istanbul ignore next */
  6024. if (!error.headers) throw error;
  6025. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  6026. // handle "2FA required" error only
  6027. if (error.status !== 401 || !otpRequired) {
  6028. throw error;
  6029. }
  6030. if (
  6031. error.status === 401 &&
  6032. otpRequired &&
  6033. error.request &&
  6034. error.request.headers["x-github-otp"]
  6035. ) {
  6036. throw new RequestError(
  6037. "Invalid one-time password for two-factor authentication",
  6038. 401,
  6039. {
  6040. headers: error.headers,
  6041. request: options
  6042. }
  6043. );
  6044. }
  6045. if (typeof state.auth.on2fa !== "function") {
  6046. throw new RequestError(
  6047. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6048. 401,
  6049. {
  6050. headers: error.headers,
  6051. request: options
  6052. }
  6053. );
  6054. }
  6055. return Promise.resolve()
  6056. .then(() => {
  6057. return state.auth.on2fa();
  6058. })
  6059. .then(oneTimePassword => {
  6060. const newOptions = Object.assign(options, {
  6061. headers: Object.assign(
  6062. { "x-github-otp": oneTimePassword },
  6063. options.headers
  6064. )
  6065. });
  6066. return state.octokit.request(newOptions);
  6067. });
  6068. }
  6069. /***/ }),
  6070. /***/ 357:
  6071. /***/ (function(module) {
  6072. module.exports = require("assert");
  6073. /***/ }),
  6074. /***/ 363:
  6075. /***/ (function(module) {
  6076. module.exports = register
  6077. function register (state, name, method, options) {
  6078. if (typeof method !== 'function') {
  6079. throw new Error('method for before hook must be a function')
  6080. }
  6081. if (!options) {
  6082. options = {}
  6083. }
  6084. if (Array.isArray(name)) {
  6085. return name.reverse().reduce(function (callback, name) {
  6086. return register.bind(null, state, name, callback, options)
  6087. }, method)()
  6088. }
  6089. return Promise.resolve()
  6090. .then(function () {
  6091. if (!state.registry[name]) {
  6092. return method(options)
  6093. }
  6094. return (state.registry[name]).reduce(function (method, registered) {
  6095. return registered.hook.bind(null, method, options)
  6096. }, method)()
  6097. })
  6098. }
  6099. /***/ }),
  6100. /***/ 368:
  6101. /***/ (function(module) {
  6102. module.exports = function atob(str) {
  6103. return Buffer.from(str, 'base64').toString('binary')
  6104. }
  6105. /***/ }),
  6106. /***/ 370:
  6107. /***/ (function(module) {
  6108. module.exports = deprecate
  6109. const loggedMessages = {}
  6110. function deprecate (message) {
  6111. if (loggedMessages[message]) {
  6112. return
  6113. }
  6114. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6115. loggedMessages[message] = 1
  6116. }
  6117. /***/ }),
  6118. /***/ 385:
  6119. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6120. "use strict";
  6121. Object.defineProperty(exports, '__esModule', { value: true });
  6122. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6123. var isPlainObject = _interopDefault(__webpack_require__(696));
  6124. var universalUserAgent = __webpack_require__(562);
  6125. function lowercaseKeys(object) {
  6126. if (!object) {
  6127. return {};
  6128. }
  6129. return Object.keys(object).reduce((newObj, key) => {
  6130. newObj[key.toLowerCase()] = object[key];
  6131. return newObj;
  6132. }, {});
  6133. }
  6134. function mergeDeep(defaults, options) {
  6135. const result = Object.assign({}, defaults);
  6136. Object.keys(options).forEach(key => {
  6137. if (isPlainObject(options[key])) {
  6138. if (!(key in defaults)) Object.assign(result, {
  6139. [key]: options[key]
  6140. });else result[key] = mergeDeep(defaults[key], options[key]);
  6141. } else {
  6142. Object.assign(result, {
  6143. [key]: options[key]
  6144. });
  6145. }
  6146. });
  6147. return result;
  6148. }
  6149. function merge(defaults, route, options) {
  6150. if (typeof route === "string") {
  6151. let [method, url] = route.split(" ");
  6152. options = Object.assign(url ? {
  6153. method,
  6154. url
  6155. } : {
  6156. url: method
  6157. }, options);
  6158. } else {
  6159. options = Object.assign({}, route);
  6160. } // lowercase header names before merging with defaults to avoid duplicates
  6161. options.headers = lowercaseKeys(options.headers);
  6162. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6163. if (defaults && defaults.mediaType.previews.length) {
  6164. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6165. }
  6166. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6167. return mergedOptions;
  6168. }
  6169. function addQueryParameters(url, parameters) {
  6170. const separator = /\?/.test(url) ? "&" : "?";
  6171. const names = Object.keys(parameters);
  6172. if (names.length === 0) {
  6173. return url;
  6174. }
  6175. return url + separator + names.map(name => {
  6176. if (name === "q") {
  6177. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6178. }
  6179. return `${name}=${encodeURIComponent(parameters[name])}`;
  6180. }).join("&");
  6181. }
  6182. const urlVariableRegex = /\{[^}]+\}/g;
  6183. function removeNonChars(variableName) {
  6184. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6185. }
  6186. function extractUrlVariableNames(url) {
  6187. const matches = url.match(urlVariableRegex);
  6188. if (!matches) {
  6189. return [];
  6190. }
  6191. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6192. }
  6193. function omit(object, keysToOmit) {
  6194. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6195. obj[key] = object[key];
  6196. return obj;
  6197. }, {});
  6198. }
  6199. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6200. // TODO: create separate package.
  6201. //
  6202. // Copyright (c) 2012-2014, Bram Stein
  6203. // All rights reserved.
  6204. // Redistribution and use in source and binary forms, with or without
  6205. // modification, are permitted provided that the following conditions
  6206. // are met:
  6207. // 1. Redistributions of source code must retain the above copyright
  6208. // notice, this list of conditions and the following disclaimer.
  6209. // 2. Redistributions in binary form must reproduce the above copyright
  6210. // notice, this list of conditions and the following disclaimer in the
  6211. // documentation and/or other materials provided with the distribution.
  6212. // 3. The name of the author may not be used to endorse or promote products
  6213. // derived from this software without specific prior written permission.
  6214. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6215. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6216. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6217. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6218. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6219. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6220. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6221. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6222. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6223. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6224. /* istanbul ignore file */
  6225. function encodeReserved(str) {
  6226. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6227. if (!/%[0-9A-Fa-f]/.test(part)) {
  6228. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6229. }
  6230. return part;
  6231. }).join("");
  6232. }
  6233. function encodeUnreserved(str) {
  6234. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6235. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6236. });
  6237. }
  6238. function encodeValue(operator, value, key) {
  6239. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6240. if (key) {
  6241. return encodeUnreserved(key) + "=" + value;
  6242. } else {
  6243. return value;
  6244. }
  6245. }
  6246. function isDefined(value) {
  6247. return value !== undefined && value !== null;
  6248. }
  6249. function isKeyOperator(operator) {
  6250. return operator === ";" || operator === "&" || operator === "?";
  6251. }
  6252. function getValues(context, operator, key, modifier) {
  6253. var value = context[key],
  6254. result = [];
  6255. if (isDefined(value) && value !== "") {
  6256. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6257. value = value.toString();
  6258. if (modifier && modifier !== "*") {
  6259. value = value.substring(0, parseInt(modifier, 10));
  6260. }
  6261. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6262. } else {
  6263. if (modifier === "*") {
  6264. if (Array.isArray(value)) {
  6265. value.filter(isDefined).forEach(function (value) {
  6266. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6267. });
  6268. } else {
  6269. Object.keys(value).forEach(function (k) {
  6270. if (isDefined(value[k])) {
  6271. result.push(encodeValue(operator, value[k], k));
  6272. }
  6273. });
  6274. }
  6275. } else {
  6276. const tmp = [];
  6277. if (Array.isArray(value)) {
  6278. value.filter(isDefined).forEach(function (value) {
  6279. tmp.push(encodeValue(operator, value));
  6280. });
  6281. } else {
  6282. Object.keys(value).forEach(function (k) {
  6283. if (isDefined(value[k])) {
  6284. tmp.push(encodeUnreserved(k));
  6285. tmp.push(encodeValue(operator, value[k].toString()));
  6286. }
  6287. });
  6288. }
  6289. if (isKeyOperator(operator)) {
  6290. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6291. } else if (tmp.length !== 0) {
  6292. result.push(tmp.join(","));
  6293. }
  6294. }
  6295. }
  6296. } else {
  6297. if (operator === ";") {
  6298. if (isDefined(value)) {
  6299. result.push(encodeUnreserved(key));
  6300. }
  6301. } else if (value === "" && (operator === "&" || operator === "?")) {
  6302. result.push(encodeUnreserved(key) + "=");
  6303. } else if (value === "") {
  6304. result.push("");
  6305. }
  6306. }
  6307. return result;
  6308. }
  6309. function parseUrl(template) {
  6310. return {
  6311. expand: expand.bind(null, template)
  6312. };
  6313. }
  6314. function expand(template, context) {
  6315. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6316. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6317. if (expression) {
  6318. let operator = "";
  6319. const values = [];
  6320. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6321. operator = expression.charAt(0);
  6322. expression = expression.substr(1);
  6323. }
  6324. expression.split(/,/g).forEach(function (variable) {
  6325. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6326. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6327. });
  6328. if (operator && operator !== "+") {
  6329. var separator = ",";
  6330. if (operator === "?") {
  6331. separator = "&";
  6332. } else if (operator !== "#") {
  6333. separator = operator;
  6334. }
  6335. return (values.length !== 0 ? operator : "") + values.join(separator);
  6336. } else {
  6337. return values.join(",");
  6338. }
  6339. } else {
  6340. return encodeReserved(literal);
  6341. }
  6342. });
  6343. }
  6344. function parse(options) {
  6345. // https://fetch.spec.whatwg.org/#methods
  6346. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6347. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6348. let headers = Object.assign({}, options.headers);
  6349. let body;
  6350. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6351. const urlVariableNames = extractUrlVariableNames(url);
  6352. url = parseUrl(url).expand(parameters);
  6353. if (!/^http/.test(url)) {
  6354. url = options.baseUrl + url;
  6355. }
  6356. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6357. const remainingParameters = omit(parameters, omittedParameters);
  6358. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6359. if (!isBinaryRequset) {
  6360. if (options.mediaType.format) {
  6361. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6362. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6363. }
  6364. if (options.mediaType.previews.length) {
  6365. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6366. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6367. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6368. return `application/vnd.github.${preview}-preview${format}`;
  6369. }).join(",");
  6370. }
  6371. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6372. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6373. if (["GET", "HEAD"].includes(method)) {
  6374. url = addQueryParameters(url, remainingParameters);
  6375. } else {
  6376. if ("data" in remainingParameters) {
  6377. body = remainingParameters.data;
  6378. } else {
  6379. if (Object.keys(remainingParameters).length) {
  6380. body = remainingParameters;
  6381. } else {
  6382. headers["content-length"] = 0;
  6383. }
  6384. }
  6385. } // default content-type for JSON if body is set
  6386. if (!headers["content-type"] && typeof body !== "undefined") {
  6387. headers["content-type"] = "application/json; charset=utf-8";
  6388. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6389. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6390. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6391. body = "";
  6392. } // Only return body/request keys if present
  6393. return Object.assign({
  6394. method,
  6395. url,
  6396. headers
  6397. }, typeof body !== "undefined" ? {
  6398. body
  6399. } : null, options.request ? {
  6400. request: options.request
  6401. } : null);
  6402. }
  6403. function endpointWithDefaults(defaults, route, options) {
  6404. return parse(merge(defaults, route, options));
  6405. }
  6406. function withDefaults(oldDefaults, newDefaults) {
  6407. const DEFAULTS = merge(oldDefaults, newDefaults);
  6408. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6409. return Object.assign(endpoint, {
  6410. DEFAULTS,
  6411. defaults: withDefaults.bind(null, DEFAULTS),
  6412. merge: merge.bind(null, DEFAULTS),
  6413. parse
  6414. });
  6415. }
  6416. const VERSION = "6.0.1";
  6417. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6418. // So we use RequestParameters and add method as additional required property.
  6419. const DEFAULTS = {
  6420. method: "GET",
  6421. baseUrl: "https://api.github.com",
  6422. headers: {
  6423. accept: "application/vnd.github.v3+json",
  6424. "user-agent": userAgent
  6425. },
  6426. mediaType: {
  6427. format: "",
  6428. previews: []
  6429. }
  6430. };
  6431. const endpoint = withDefaults(null, DEFAULTS);
  6432. exports.endpoint = endpoint;
  6433. //# sourceMappingURL=index.js.map
  6434. /***/ }),
  6435. /***/ 389:
  6436. /***/ (function(module, __unusedexports, __webpack_require__) {
  6437. "use strict";
  6438. const fs = __webpack_require__(747);
  6439. const shebangCommand = __webpack_require__(866);
  6440. function readShebang(command) {
  6441. // Read the first 150 bytes from the file
  6442. const size = 150;
  6443. let buffer;
  6444. if (Buffer.alloc) {
  6445. // Node.js v4.5+ / v5.10+
  6446. buffer = Buffer.alloc(size);
  6447. } else {
  6448. // Old Node.js API
  6449. buffer = new Buffer(size);
  6450. buffer.fill(0); // zero-fill
  6451. }
  6452. let fd;
  6453. try {
  6454. fd = fs.openSync(command, 'r');
  6455. fs.readSync(fd, buffer, 0, size, 0);
  6456. fs.closeSync(fd);
  6457. } catch (e) { /* Empty */ }
  6458. // Attempt to extract shebang (null is returned if not a shebang)
  6459. return shebangCommand(buffer.toString());
  6460. }
  6461. module.exports = readShebang;
  6462. /***/ }),
  6463. /***/ 402:
  6464. /***/ (function(module, __unusedexports, __webpack_require__) {
  6465. module.exports = Octokit;
  6466. const { request } = __webpack_require__(753);
  6467. const Hook = __webpack_require__(523);
  6468. const parseClientOptions = __webpack_require__(294);
  6469. function Octokit(plugins, options) {
  6470. options = options || {};
  6471. const hook = new Hook.Collection();
  6472. const log = Object.assign(
  6473. {
  6474. debug: () => {},
  6475. info: () => {},
  6476. warn: console.warn,
  6477. error: console.error
  6478. },
  6479. options && options.log
  6480. );
  6481. const api = {
  6482. hook,
  6483. log,
  6484. request: request.defaults(parseClientOptions(options, log, hook))
  6485. };
  6486. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6487. return api;
  6488. }
  6489. /***/ }),
  6490. /***/ 413:
  6491. /***/ (function(module) {
  6492. module.exports = require("stream");
  6493. /***/ }),
  6494. /***/ 417:
  6495. /***/ (function(module) {
  6496. module.exports = require("crypto");
  6497. /***/ }),
  6498. /***/ 427:
  6499. /***/ (function(module, __unusedexports, __webpack_require__) {
  6500. "use strict";
  6501. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6502. // In that case, fall back to a deprecated internal.
  6503. const util = __webpack_require__(669);
  6504. let uv;
  6505. if (typeof util.getSystemErrorName === 'function') {
  6506. module.exports = util.getSystemErrorName;
  6507. } else {
  6508. try {
  6509. uv = process.binding('uv');
  6510. if (typeof uv.errname !== 'function') {
  6511. throw new TypeError('uv.errname is not a function');
  6512. }
  6513. } catch (err) {
  6514. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6515. uv = null;
  6516. }
  6517. module.exports = code => errname(uv, code);
  6518. }
  6519. // Used for testing the fallback behavior
  6520. module.exports.__test__ = errname;
  6521. function errname(uv, code) {
  6522. if (uv) {
  6523. return uv.errname(code);
  6524. }
  6525. if (!(code < 0)) {
  6526. throw new Error('err >= 0');
  6527. }
  6528. return `Unknown system error ${code}`;
  6529. }
  6530. /***/ }),
  6531. /***/ 430:
  6532. /***/ (function(module, __unusedexports, __webpack_require__) {
  6533. module.exports = octokitValidate;
  6534. const validate = __webpack_require__(348);
  6535. function octokitValidate(octokit) {
  6536. octokit.hook.before("request", validate.bind(null, octokit));
  6537. }
  6538. /***/ }),
  6539. /***/ 431:
  6540. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6541. "use strict";
  6542. Object.defineProperty(exports, "__esModule", { value: true });
  6543. const os = __webpack_require__(87);
  6544. /**
  6545. * Commands
  6546. *
  6547. * Command Format:
  6548. * ##[name key=value;key=value]message
  6549. *
  6550. * Examples:
  6551. * ##[warning]This is the user warning message
  6552. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6553. */
  6554. function issueCommand(command, properties, message) {
  6555. const cmd = new Command(command, properties, message);
  6556. process.stdout.write(cmd.toString() + os.EOL);
  6557. }
  6558. exports.issueCommand = issueCommand;
  6559. function issue(name, message = '') {
  6560. issueCommand(name, {}, message);
  6561. }
  6562. exports.issue = issue;
  6563. const CMD_STRING = '::';
  6564. class Command {
  6565. constructor(command, properties, message) {
  6566. if (!command) {
  6567. command = 'missing.command';
  6568. }
  6569. this.command = command;
  6570. this.properties = properties;
  6571. this.message = message;
  6572. }
  6573. toString() {
  6574. let cmdStr = CMD_STRING + this.command;
  6575. if (this.properties && Object.keys(this.properties).length > 0) {
  6576. cmdStr += ' ';
  6577. for (const key in this.properties) {
  6578. if (this.properties.hasOwnProperty(key)) {
  6579. const val = this.properties[key];
  6580. if (val) {
  6581. // safely append the val - avoid blowing up when attempting to
  6582. // call .replace() if message is not a string for some reason
  6583. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6584. }
  6585. }
  6586. }
  6587. }
  6588. cmdStr += CMD_STRING;
  6589. // safely append the message - avoid blowing up when attempting to
  6590. // call .replace() if message is not a string for some reason
  6591. const message = `${this.message || ''}`;
  6592. cmdStr += escapeData(message);
  6593. return cmdStr;
  6594. }
  6595. }
  6596. function escapeData(s) {
  6597. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6598. }
  6599. function escape(s) {
  6600. return s
  6601. .replace(/\r/g, '%0D')
  6602. .replace(/\n/g, '%0A')
  6603. .replace(/]/g, '%5D')
  6604. .replace(/;/g, '%3B');
  6605. }
  6606. //# sourceMappingURL=command.js.map
  6607. /***/ }),
  6608. /***/ 438:
  6609. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6610. "use strict";
  6611. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6612. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6613. return new (P || (P = Promise))(function (resolve, reject) {
  6614. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6615. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6616. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6617. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6618. });
  6619. };
  6620. var __importStar = (this && this.__importStar) || function (mod) {
  6621. if (mod && mod.__esModule) return mod;
  6622. var result = {};
  6623. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6624. result["default"] = mod;
  6625. return result;
  6626. };
  6627. Object.defineProperty(exports, "__esModule", { value: true });
  6628. const assert = __importStar(__webpack_require__(357));
  6629. const core = __importStar(__webpack_require__(470));
  6630. const fs = __importStar(__webpack_require__(747));
  6631. const fsHelper = __importStar(__webpack_require__(618));
  6632. const io = __importStar(__webpack_require__(1));
  6633. const path = __importStar(__webpack_require__(622));
  6634. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6635. return __awaiter(this, void 0, void 0, function* () {
  6636. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6637. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6638. // Indicates whether to delete the directory contents
  6639. let remove = false;
  6640. // Check whether using git or REST API
  6641. if (!git) {
  6642. remove = true;
  6643. }
  6644. // Fetch URL does not match
  6645. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6646. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6647. remove = true;
  6648. }
  6649. else {
  6650. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6651. const lockPaths = [
  6652. path.join(repositoryPath, '.git', 'index.lock'),
  6653. path.join(repositoryPath, '.git', 'shallow.lock')
  6654. ];
  6655. for (const lockPath of lockPaths) {
  6656. try {
  6657. yield io.rmRF(lockPath);
  6658. }
  6659. catch (error) {
  6660. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6661. }
  6662. }
  6663. try {
  6664. core.startGroup('Removing previously created refs, to avoid conflicts');
  6665. // Checkout detached HEAD
  6666. if (!(yield git.isDetached())) {
  6667. yield git.checkoutDetach();
  6668. }
  6669. // Remove all refs/heads/*
  6670. let branches = yield git.branchList(false);
  6671. for (const branch of branches) {
  6672. yield git.branchDelete(false, branch);
  6673. }
  6674. // Remove any conflicting refs/remotes/origin/*
  6675. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6676. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6677. if (ref) {
  6678. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6679. if (ref.startsWith('refs/heads/')) {
  6680. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6681. const upperName1Slash = `${upperName1}/`;
  6682. branches = yield git.branchList(true);
  6683. for (const branch of branches) {
  6684. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6685. const upperName2Slash = `${upperName2}/`;
  6686. if (upperName1.startsWith(upperName2Slash) ||
  6687. upperName2.startsWith(upperName1Slash)) {
  6688. yield git.branchDelete(true, branch);
  6689. }
  6690. }
  6691. }
  6692. }
  6693. core.endGroup();
  6694. // Clean
  6695. if (clean) {
  6696. core.startGroup('Cleaning the repository');
  6697. if (!(yield git.tryClean())) {
  6698. 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}'.`);
  6699. remove = true;
  6700. }
  6701. else if (!(yield git.tryReset())) {
  6702. remove = true;
  6703. }
  6704. core.endGroup();
  6705. if (remove) {
  6706. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6707. }
  6708. }
  6709. }
  6710. catch (error) {
  6711. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6712. remove = true;
  6713. }
  6714. }
  6715. if (remove) {
  6716. // Delete the contents of the directory. Don't delete the directory itself
  6717. // since it might be the current working directory.
  6718. core.info(`Deleting the contents of '${repositoryPath}'`);
  6719. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6720. yield io.rmRF(path.join(repositoryPath, file));
  6721. }
  6722. }
  6723. });
  6724. }
  6725. exports.prepareExistingDirectory = prepareExistingDirectory;
  6726. /***/ }),
  6727. /***/ 453:
  6728. /***/ (function(module, __unusedexports, __webpack_require__) {
  6729. var once = __webpack_require__(969)
  6730. var eos = __webpack_require__(3)
  6731. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6732. var noop = function () {}
  6733. var ancient = /^v?\.0/.test(process.version)
  6734. var isFn = function (fn) {
  6735. return typeof fn === 'function'
  6736. }
  6737. var isFS = function (stream) {
  6738. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6739. if (!fs) return false // browser
  6740. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6741. }
  6742. var isRequest = function (stream) {
  6743. return stream.setHeader && isFn(stream.abort)
  6744. }
  6745. var destroyer = function (stream, reading, writing, callback) {
  6746. callback = once(callback)
  6747. var closed = false
  6748. stream.on('close', function () {
  6749. closed = true
  6750. })
  6751. eos(stream, {readable: reading, writable: writing}, function (err) {
  6752. if (err) return callback(err)
  6753. closed = true
  6754. callback()
  6755. })
  6756. var destroyed = false
  6757. return function (err) {
  6758. if (closed) return
  6759. if (destroyed) return
  6760. destroyed = true
  6761. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6762. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6763. if (isFn(stream.destroy)) return stream.destroy()
  6764. callback(err || new Error('stream was destroyed'))
  6765. }
  6766. }
  6767. var call = function (fn) {
  6768. fn()
  6769. }
  6770. var pipe = function (from, to) {
  6771. return from.pipe(to)
  6772. }
  6773. var pump = function () {
  6774. var streams = Array.prototype.slice.call(arguments)
  6775. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6776. if (Array.isArray(streams[0])) streams = streams[0]
  6777. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6778. var error
  6779. var destroys = streams.map(function (stream, i) {
  6780. var reading = i < streams.length - 1
  6781. var writing = i > 0
  6782. return destroyer(stream, reading, writing, function (err) {
  6783. if (!error) error = err
  6784. if (err) destroys.forEach(call)
  6785. if (reading) return
  6786. destroys.forEach(call)
  6787. callback(error)
  6788. })
  6789. })
  6790. return streams.reduce(pipe)
  6791. }
  6792. module.exports = pump
  6793. /***/ }),
  6794. /***/ 454:
  6795. /***/ (function(module, exports, __webpack_require__) {
  6796. "use strict";
  6797. Object.defineProperty(exports, '__esModule', { value: true });
  6798. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6799. var Stream = _interopDefault(__webpack_require__(413));
  6800. var http = _interopDefault(__webpack_require__(605));
  6801. var Url = _interopDefault(__webpack_require__(835));
  6802. var https = _interopDefault(__webpack_require__(34));
  6803. var zlib = _interopDefault(__webpack_require__(761));
  6804. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6805. // fix for "Readable" isn't a named export issue
  6806. const Readable = Stream.Readable;
  6807. const BUFFER = Symbol('buffer');
  6808. const TYPE = Symbol('type');
  6809. class Blob {
  6810. constructor() {
  6811. this[TYPE] = '';
  6812. const blobParts = arguments[0];
  6813. const options = arguments[1];
  6814. const buffers = [];
  6815. let size = 0;
  6816. if (blobParts) {
  6817. const a = blobParts;
  6818. const length = Number(a.length);
  6819. for (let i = 0; i < length; i++) {
  6820. const element = a[i];
  6821. let buffer;
  6822. if (element instanceof Buffer) {
  6823. buffer = element;
  6824. } else if (ArrayBuffer.isView(element)) {
  6825. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6826. } else if (element instanceof ArrayBuffer) {
  6827. buffer = Buffer.from(element);
  6828. } else if (element instanceof Blob) {
  6829. buffer = element[BUFFER];
  6830. } else {
  6831. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6832. }
  6833. size += buffer.length;
  6834. buffers.push(buffer);
  6835. }
  6836. }
  6837. this[BUFFER] = Buffer.concat(buffers);
  6838. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6839. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6840. this[TYPE] = type;
  6841. }
  6842. }
  6843. get size() {
  6844. return this[BUFFER].length;
  6845. }
  6846. get type() {
  6847. return this[TYPE];
  6848. }
  6849. text() {
  6850. return Promise.resolve(this[BUFFER].toString());
  6851. }
  6852. arrayBuffer() {
  6853. const buf = this[BUFFER];
  6854. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6855. return Promise.resolve(ab);
  6856. }
  6857. stream() {
  6858. const readable = new Readable();
  6859. readable._read = function () {};
  6860. readable.push(this[BUFFER]);
  6861. readable.push(null);
  6862. return readable;
  6863. }
  6864. toString() {
  6865. return '[object Blob]';
  6866. }
  6867. slice() {
  6868. const size = this.size;
  6869. const start = arguments[0];
  6870. const end = arguments[1];
  6871. let relativeStart, relativeEnd;
  6872. if (start === undefined) {
  6873. relativeStart = 0;
  6874. } else if (start < 0) {
  6875. relativeStart = Math.max(size + start, 0);
  6876. } else {
  6877. relativeStart = Math.min(start, size);
  6878. }
  6879. if (end === undefined) {
  6880. relativeEnd = size;
  6881. } else if (end < 0) {
  6882. relativeEnd = Math.max(size + end, 0);
  6883. } else {
  6884. relativeEnd = Math.min(end, size);
  6885. }
  6886. const span = Math.max(relativeEnd - relativeStart, 0);
  6887. const buffer = this[BUFFER];
  6888. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6889. const blob = new Blob([], { type: arguments[2] });
  6890. blob[BUFFER] = slicedBuffer;
  6891. return blob;
  6892. }
  6893. }
  6894. Object.defineProperties(Blob.prototype, {
  6895. size: { enumerable: true },
  6896. type: { enumerable: true },
  6897. slice: { enumerable: true }
  6898. });
  6899. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6900. value: 'Blob',
  6901. writable: false,
  6902. enumerable: false,
  6903. configurable: true
  6904. });
  6905. /**
  6906. * fetch-error.js
  6907. *
  6908. * FetchError interface for operational errors
  6909. */
  6910. /**
  6911. * Create FetchError instance
  6912. *
  6913. * @param String message Error message for human
  6914. * @param String type Error type for machine
  6915. * @param String systemError For Node.js system error
  6916. * @return FetchError
  6917. */
  6918. function FetchError(message, type, systemError) {
  6919. Error.call(this, message);
  6920. this.message = message;
  6921. this.type = type;
  6922. // when err.type is `system`, err.code contains system error code
  6923. if (systemError) {
  6924. this.code = this.errno = systemError.code;
  6925. }
  6926. // hide custom error implementation details from end-users
  6927. Error.captureStackTrace(this, this.constructor);
  6928. }
  6929. FetchError.prototype = Object.create(Error.prototype);
  6930. FetchError.prototype.constructor = FetchError;
  6931. FetchError.prototype.name = 'FetchError';
  6932. let convert;
  6933. try {
  6934. convert = __webpack_require__(18).convert;
  6935. } catch (e) {}
  6936. const INTERNALS = Symbol('Body internals');
  6937. // fix an issue where "PassThrough" isn't a named export for node <10
  6938. const PassThrough = Stream.PassThrough;
  6939. /**
  6940. * Body mixin
  6941. *
  6942. * Ref: https://fetch.spec.whatwg.org/#body
  6943. *
  6944. * @param Stream body Readable stream
  6945. * @param Object opts Response options
  6946. * @return Void
  6947. */
  6948. function Body(body) {
  6949. var _this = this;
  6950. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6951. _ref$size = _ref.size;
  6952. let size = _ref$size === undefined ? 0 : _ref$size;
  6953. var _ref$timeout = _ref.timeout;
  6954. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6955. if (body == null) {
  6956. // body is undefined or null
  6957. body = null;
  6958. } else if (isURLSearchParams(body)) {
  6959. // body is a URLSearchParams
  6960. body = Buffer.from(body.toString());
  6961. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6962. // body is ArrayBuffer
  6963. body = Buffer.from(body);
  6964. } else if (ArrayBuffer.isView(body)) {
  6965. // body is ArrayBufferView
  6966. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6967. } else if (body instanceof Stream) ; else {
  6968. // none of the above
  6969. // coerce to string then buffer
  6970. body = Buffer.from(String(body));
  6971. }
  6972. this[INTERNALS] = {
  6973. body,
  6974. disturbed: false,
  6975. error: null
  6976. };
  6977. this.size = size;
  6978. this.timeout = timeout;
  6979. if (body instanceof Stream) {
  6980. body.on('error', function (err) {
  6981. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6982. _this[INTERNALS].error = error;
  6983. });
  6984. }
  6985. }
  6986. Body.prototype = {
  6987. get body() {
  6988. return this[INTERNALS].body;
  6989. },
  6990. get bodyUsed() {
  6991. return this[INTERNALS].disturbed;
  6992. },
  6993. /**
  6994. * Decode response as ArrayBuffer
  6995. *
  6996. * @return Promise
  6997. */
  6998. arrayBuffer() {
  6999. return consumeBody.call(this).then(function (buf) {
  7000. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  7001. });
  7002. },
  7003. /**
  7004. * Return raw response as Blob
  7005. *
  7006. * @return Promise
  7007. */
  7008. blob() {
  7009. let ct = this.headers && this.headers.get('content-type') || '';
  7010. return consumeBody.call(this).then(function (buf) {
  7011. return Object.assign(
  7012. // Prevent copying
  7013. new Blob([], {
  7014. type: ct.toLowerCase()
  7015. }), {
  7016. [BUFFER]: buf
  7017. });
  7018. });
  7019. },
  7020. /**
  7021. * Decode response as json
  7022. *
  7023. * @return Promise
  7024. */
  7025. json() {
  7026. var _this2 = this;
  7027. return consumeBody.call(this).then(function (buffer) {
  7028. try {
  7029. return JSON.parse(buffer.toString());
  7030. } catch (err) {
  7031. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  7032. }
  7033. });
  7034. },
  7035. /**
  7036. * Decode response as text
  7037. *
  7038. * @return Promise
  7039. */
  7040. text() {
  7041. return consumeBody.call(this).then(function (buffer) {
  7042. return buffer.toString();
  7043. });
  7044. },
  7045. /**
  7046. * Decode response as buffer (non-spec api)
  7047. *
  7048. * @return Promise
  7049. */
  7050. buffer() {
  7051. return consumeBody.call(this);
  7052. },
  7053. /**
  7054. * Decode response as text, while automatically detecting the encoding and
  7055. * trying to decode to UTF-8 (non-spec api)
  7056. *
  7057. * @return Promise
  7058. */
  7059. textConverted() {
  7060. var _this3 = this;
  7061. return consumeBody.call(this).then(function (buffer) {
  7062. return convertBody(buffer, _this3.headers);
  7063. });
  7064. }
  7065. };
  7066. // In browsers, all properties are enumerable.
  7067. Object.defineProperties(Body.prototype, {
  7068. body: { enumerable: true },
  7069. bodyUsed: { enumerable: true },
  7070. arrayBuffer: { enumerable: true },
  7071. blob: { enumerable: true },
  7072. json: { enumerable: true },
  7073. text: { enumerable: true }
  7074. });
  7075. Body.mixIn = function (proto) {
  7076. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7077. // istanbul ignore else: future proof
  7078. if (!(name in proto)) {
  7079. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7080. Object.defineProperty(proto, name, desc);
  7081. }
  7082. }
  7083. };
  7084. /**
  7085. * Consume and convert an entire Body to a Buffer.
  7086. *
  7087. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7088. *
  7089. * @return Promise
  7090. */
  7091. function consumeBody() {
  7092. var _this4 = this;
  7093. if (this[INTERNALS].disturbed) {
  7094. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7095. }
  7096. this[INTERNALS].disturbed = true;
  7097. if (this[INTERNALS].error) {
  7098. return Body.Promise.reject(this[INTERNALS].error);
  7099. }
  7100. let body = this.body;
  7101. // body is null
  7102. if (body === null) {
  7103. return Body.Promise.resolve(Buffer.alloc(0));
  7104. }
  7105. // body is blob
  7106. if (isBlob(body)) {
  7107. body = body.stream();
  7108. }
  7109. // body is buffer
  7110. if (Buffer.isBuffer(body)) {
  7111. return Body.Promise.resolve(body);
  7112. }
  7113. // istanbul ignore if: should never happen
  7114. if (!(body instanceof Stream)) {
  7115. return Body.Promise.resolve(Buffer.alloc(0));
  7116. }
  7117. // body is stream
  7118. // get ready to actually consume the body
  7119. let accum = [];
  7120. let accumBytes = 0;
  7121. let abort = false;
  7122. return new Body.Promise(function (resolve, reject) {
  7123. let resTimeout;
  7124. // allow timeout on slow response body
  7125. if (_this4.timeout) {
  7126. resTimeout = setTimeout(function () {
  7127. abort = true;
  7128. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7129. }, _this4.timeout);
  7130. }
  7131. // handle stream errors
  7132. body.on('error', function (err) {
  7133. if (err.name === 'AbortError') {
  7134. // if the request was aborted, reject with this Error
  7135. abort = true;
  7136. reject(err);
  7137. } else {
  7138. // other errors, such as incorrect content-encoding
  7139. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7140. }
  7141. });
  7142. body.on('data', function (chunk) {
  7143. if (abort || chunk === null) {
  7144. return;
  7145. }
  7146. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7147. abort = true;
  7148. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7149. return;
  7150. }
  7151. accumBytes += chunk.length;
  7152. accum.push(chunk);
  7153. });
  7154. body.on('end', function () {
  7155. if (abort) {
  7156. return;
  7157. }
  7158. clearTimeout(resTimeout);
  7159. try {
  7160. resolve(Buffer.concat(accum, accumBytes));
  7161. } catch (err) {
  7162. // handle streams that have accumulated too much data (issue #414)
  7163. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7164. }
  7165. });
  7166. });
  7167. }
  7168. /**
  7169. * Detect buffer encoding and convert to target encoding
  7170. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7171. *
  7172. * @param Buffer buffer Incoming buffer
  7173. * @param String encoding Target encoding
  7174. * @return String
  7175. */
  7176. function convertBody(buffer, headers) {
  7177. if (typeof convert !== 'function') {
  7178. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7179. }
  7180. const ct = headers.get('content-type');
  7181. let charset = 'utf-8';
  7182. let res, str;
  7183. // header
  7184. if (ct) {
  7185. res = /charset=([^;]*)/i.exec(ct);
  7186. }
  7187. // no charset in content type, peek at response body for at most 1024 bytes
  7188. str = buffer.slice(0, 1024).toString();
  7189. // html5
  7190. if (!res && str) {
  7191. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7192. }
  7193. // html4
  7194. if (!res && str) {
  7195. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7196. if (res) {
  7197. res = /charset=(.*)/i.exec(res.pop());
  7198. }
  7199. }
  7200. // xml
  7201. if (!res && str) {
  7202. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7203. }
  7204. // found charset
  7205. if (res) {
  7206. charset = res.pop();
  7207. // prevent decode issues when sites use incorrect encoding
  7208. // ref: https://hsivonen.fi/encoding-menu/
  7209. if (charset === 'gb2312' || charset === 'gbk') {
  7210. charset = 'gb18030';
  7211. }
  7212. }
  7213. // turn raw buffers into a single utf-8 buffer
  7214. return convert(buffer, 'UTF-8', charset).toString();
  7215. }
  7216. /**
  7217. * Detect a URLSearchParams object
  7218. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7219. *
  7220. * @param Object obj Object to detect by type or brand
  7221. * @return String
  7222. */
  7223. function isURLSearchParams(obj) {
  7224. // Duck-typing as a necessary condition.
  7225. 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') {
  7226. return false;
  7227. }
  7228. // Brand-checking and more duck-typing as optional condition.
  7229. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7230. }
  7231. /**
  7232. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7233. * @param {*} obj
  7234. * @return {boolean}
  7235. */
  7236. function isBlob(obj) {
  7237. 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]);
  7238. }
  7239. /**
  7240. * Clone body given Res/Req instance
  7241. *
  7242. * @param Mixed instance Response or Request instance
  7243. * @return Mixed
  7244. */
  7245. function clone(instance) {
  7246. let p1, p2;
  7247. let body = instance.body;
  7248. // don't allow cloning a used body
  7249. if (instance.bodyUsed) {
  7250. throw new Error('cannot clone body after it is used');
  7251. }
  7252. // check that body is a stream and not form-data object
  7253. // note: we can't clone the form-data object without having it as a dependency
  7254. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7255. // tee instance body
  7256. p1 = new PassThrough();
  7257. p2 = new PassThrough();
  7258. body.pipe(p1);
  7259. body.pipe(p2);
  7260. // set instance body to teed body and return the other teed body
  7261. instance[INTERNALS].body = p1;
  7262. body = p2;
  7263. }
  7264. return body;
  7265. }
  7266. /**
  7267. * Performs the operation "extract a `Content-Type` value from |object|" as
  7268. * specified in the specification:
  7269. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7270. *
  7271. * This function assumes that instance.body is present.
  7272. *
  7273. * @param Mixed instance Any options.body input
  7274. */
  7275. function extractContentType(body) {
  7276. if (body === null) {
  7277. // body is null
  7278. return null;
  7279. } else if (typeof body === 'string') {
  7280. // body is string
  7281. return 'text/plain;charset=UTF-8';
  7282. } else if (isURLSearchParams(body)) {
  7283. // body is a URLSearchParams
  7284. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7285. } else if (isBlob(body)) {
  7286. // body is blob
  7287. return body.type || null;
  7288. } else if (Buffer.isBuffer(body)) {
  7289. // body is buffer
  7290. return null;
  7291. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7292. // body is ArrayBuffer
  7293. return null;
  7294. } else if (ArrayBuffer.isView(body)) {
  7295. // body is ArrayBufferView
  7296. return null;
  7297. } else if (typeof body.getBoundary === 'function') {
  7298. // detect form data input from form-data module
  7299. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7300. } else if (body instanceof Stream) {
  7301. // body is stream
  7302. // can't really do much about this
  7303. return null;
  7304. } else {
  7305. // Body constructor defaults other things to string
  7306. return 'text/plain;charset=UTF-8';
  7307. }
  7308. }
  7309. /**
  7310. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7311. * For us, we have to explicitly get it with a function.
  7312. *
  7313. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7314. *
  7315. * @param Body instance Instance of Body
  7316. * @return Number? Number of bytes, or null if not possible
  7317. */
  7318. function getTotalBytes(instance) {
  7319. const body = instance.body;
  7320. if (body === null) {
  7321. // body is null
  7322. return 0;
  7323. } else if (isBlob(body)) {
  7324. return body.size;
  7325. } else if (Buffer.isBuffer(body)) {
  7326. // body is buffer
  7327. return body.length;
  7328. } else if (body && typeof body.getLengthSync === 'function') {
  7329. // detect form data input from form-data module
  7330. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7331. body.hasKnownLength && body.hasKnownLength()) {
  7332. // 2.x
  7333. return body.getLengthSync();
  7334. }
  7335. return null;
  7336. } else {
  7337. // body is stream
  7338. return null;
  7339. }
  7340. }
  7341. /**
  7342. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7343. *
  7344. * @param Body instance Instance of Body
  7345. * @return Void
  7346. */
  7347. function writeToStream(dest, instance) {
  7348. const body = instance.body;
  7349. if (body === null) {
  7350. // body is null
  7351. dest.end();
  7352. } else if (isBlob(body)) {
  7353. body.stream().pipe(dest);
  7354. } else if (Buffer.isBuffer(body)) {
  7355. // body is buffer
  7356. dest.write(body);
  7357. dest.end();
  7358. } else {
  7359. // body is stream
  7360. body.pipe(dest);
  7361. }
  7362. }
  7363. // expose Promise
  7364. Body.Promise = global.Promise;
  7365. /**
  7366. * headers.js
  7367. *
  7368. * Headers class offers convenient helpers
  7369. */
  7370. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7371. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7372. function validateName(name) {
  7373. name = `${name}`;
  7374. if (invalidTokenRegex.test(name) || name === '') {
  7375. throw new TypeError(`${name} is not a legal HTTP header name`);
  7376. }
  7377. }
  7378. function validateValue(value) {
  7379. value = `${value}`;
  7380. if (invalidHeaderCharRegex.test(value)) {
  7381. throw new TypeError(`${value} is not a legal HTTP header value`);
  7382. }
  7383. }
  7384. /**
  7385. * Find the key in the map object given a header name.
  7386. *
  7387. * Returns undefined if not found.
  7388. *
  7389. * @param String name Header name
  7390. * @return String|Undefined
  7391. */
  7392. function find(map, name) {
  7393. name = name.toLowerCase();
  7394. for (const key in map) {
  7395. if (key.toLowerCase() === name) {
  7396. return key;
  7397. }
  7398. }
  7399. return undefined;
  7400. }
  7401. const MAP = Symbol('map');
  7402. class Headers {
  7403. /**
  7404. * Headers class
  7405. *
  7406. * @param Object headers Response headers
  7407. * @return Void
  7408. */
  7409. constructor() {
  7410. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7411. this[MAP] = Object.create(null);
  7412. if (init instanceof Headers) {
  7413. const rawHeaders = init.raw();
  7414. const headerNames = Object.keys(rawHeaders);
  7415. for (const headerName of headerNames) {
  7416. for (const value of rawHeaders[headerName]) {
  7417. this.append(headerName, value);
  7418. }
  7419. }
  7420. return;
  7421. }
  7422. // We don't worry about converting prop to ByteString here as append()
  7423. // will handle it.
  7424. if (init == null) ; else if (typeof init === 'object') {
  7425. const method = init[Symbol.iterator];
  7426. if (method != null) {
  7427. if (typeof method !== 'function') {
  7428. throw new TypeError('Header pairs must be iterable');
  7429. }
  7430. // sequence<sequence<ByteString>>
  7431. // Note: per spec we have to first exhaust the lists then process them
  7432. const pairs = [];
  7433. for (const pair of init) {
  7434. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7435. throw new TypeError('Each header pair must be iterable');
  7436. }
  7437. pairs.push(Array.from(pair));
  7438. }
  7439. for (const pair of pairs) {
  7440. if (pair.length !== 2) {
  7441. throw new TypeError('Each header pair must be a name/value tuple');
  7442. }
  7443. this.append(pair[0], pair[1]);
  7444. }
  7445. } else {
  7446. // record<ByteString, ByteString>
  7447. for (const key of Object.keys(init)) {
  7448. const value = init[key];
  7449. this.append(key, value);
  7450. }
  7451. }
  7452. } else {
  7453. throw new TypeError('Provided initializer must be an object');
  7454. }
  7455. }
  7456. /**
  7457. * Return combined header value given name
  7458. *
  7459. * @param String name Header name
  7460. * @return Mixed
  7461. */
  7462. get(name) {
  7463. name = `${name}`;
  7464. validateName(name);
  7465. const key = find(this[MAP], name);
  7466. if (key === undefined) {
  7467. return null;
  7468. }
  7469. return this[MAP][key].join(', ');
  7470. }
  7471. /**
  7472. * Iterate over all headers
  7473. *
  7474. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7475. * @param Boolean thisArg `this` context for callback function
  7476. * @return Void
  7477. */
  7478. forEach(callback) {
  7479. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7480. let pairs = getHeaders(this);
  7481. let i = 0;
  7482. while (i < pairs.length) {
  7483. var _pairs$i = pairs[i];
  7484. const name = _pairs$i[0],
  7485. value = _pairs$i[1];
  7486. callback.call(thisArg, value, name, this);
  7487. pairs = getHeaders(this);
  7488. i++;
  7489. }
  7490. }
  7491. /**
  7492. * Overwrite header values given name
  7493. *
  7494. * @param String name Header name
  7495. * @param String value Header value
  7496. * @return Void
  7497. */
  7498. set(name, value) {
  7499. name = `${name}`;
  7500. value = `${value}`;
  7501. validateName(name);
  7502. validateValue(value);
  7503. const key = find(this[MAP], name);
  7504. this[MAP][key !== undefined ? key : name] = [value];
  7505. }
  7506. /**
  7507. * Append a value onto existing header
  7508. *
  7509. * @param String name Header name
  7510. * @param String value Header value
  7511. * @return Void
  7512. */
  7513. append(name, value) {
  7514. name = `${name}`;
  7515. value = `${value}`;
  7516. validateName(name);
  7517. validateValue(value);
  7518. const key = find(this[MAP], name);
  7519. if (key !== undefined) {
  7520. this[MAP][key].push(value);
  7521. } else {
  7522. this[MAP][name] = [value];
  7523. }
  7524. }
  7525. /**
  7526. * Check for header name existence
  7527. *
  7528. * @param String name Header name
  7529. * @return Boolean
  7530. */
  7531. has(name) {
  7532. name = `${name}`;
  7533. validateName(name);
  7534. return find(this[MAP], name) !== undefined;
  7535. }
  7536. /**
  7537. * Delete all header values given name
  7538. *
  7539. * @param String name Header name
  7540. * @return Void
  7541. */
  7542. delete(name) {
  7543. name = `${name}`;
  7544. validateName(name);
  7545. const key = find(this[MAP], name);
  7546. if (key !== undefined) {
  7547. delete this[MAP][key];
  7548. }
  7549. }
  7550. /**
  7551. * Return raw headers (non-spec api)
  7552. *
  7553. * @return Object
  7554. */
  7555. raw() {
  7556. return this[MAP];
  7557. }
  7558. /**
  7559. * Get an iterator on keys.
  7560. *
  7561. * @return Iterator
  7562. */
  7563. keys() {
  7564. return createHeadersIterator(this, 'key');
  7565. }
  7566. /**
  7567. * Get an iterator on values.
  7568. *
  7569. * @return Iterator
  7570. */
  7571. values() {
  7572. return createHeadersIterator(this, 'value');
  7573. }
  7574. /**
  7575. * Get an iterator on entries.
  7576. *
  7577. * This is the default iterator of the Headers object.
  7578. *
  7579. * @return Iterator
  7580. */
  7581. [Symbol.iterator]() {
  7582. return createHeadersIterator(this, 'key+value');
  7583. }
  7584. }
  7585. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7586. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7587. value: 'Headers',
  7588. writable: false,
  7589. enumerable: false,
  7590. configurable: true
  7591. });
  7592. Object.defineProperties(Headers.prototype, {
  7593. get: { enumerable: true },
  7594. forEach: { enumerable: true },
  7595. set: { enumerable: true },
  7596. append: { enumerable: true },
  7597. has: { enumerable: true },
  7598. delete: { enumerable: true },
  7599. keys: { enumerable: true },
  7600. values: { enumerable: true },
  7601. entries: { enumerable: true }
  7602. });
  7603. function getHeaders(headers) {
  7604. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7605. const keys = Object.keys(headers[MAP]).sort();
  7606. return keys.map(kind === 'key' ? function (k) {
  7607. return k.toLowerCase();
  7608. } : kind === 'value' ? function (k) {
  7609. return headers[MAP][k].join(', ');
  7610. } : function (k) {
  7611. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7612. });
  7613. }
  7614. const INTERNAL = Symbol('internal');
  7615. function createHeadersIterator(target, kind) {
  7616. const iterator = Object.create(HeadersIteratorPrototype);
  7617. iterator[INTERNAL] = {
  7618. target,
  7619. kind,
  7620. index: 0
  7621. };
  7622. return iterator;
  7623. }
  7624. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7625. next() {
  7626. // istanbul ignore if
  7627. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7628. throw new TypeError('Value of `this` is not a HeadersIterator');
  7629. }
  7630. var _INTERNAL = this[INTERNAL];
  7631. const target = _INTERNAL.target,
  7632. kind = _INTERNAL.kind,
  7633. index = _INTERNAL.index;
  7634. const values = getHeaders(target, kind);
  7635. const len = values.length;
  7636. if (index >= len) {
  7637. return {
  7638. value: undefined,
  7639. done: true
  7640. };
  7641. }
  7642. this[INTERNAL].index = index + 1;
  7643. return {
  7644. value: values[index],
  7645. done: false
  7646. };
  7647. }
  7648. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7649. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7650. value: 'HeadersIterator',
  7651. writable: false,
  7652. enumerable: false,
  7653. configurable: true
  7654. });
  7655. /**
  7656. * Export the Headers object in a form that Node.js can consume.
  7657. *
  7658. * @param Headers headers
  7659. * @return Object
  7660. */
  7661. function exportNodeCompatibleHeaders(headers) {
  7662. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7663. // http.request() only supports string as Host header. This hack makes
  7664. // specifying custom Host header possible.
  7665. const hostHeaderKey = find(headers[MAP], 'Host');
  7666. if (hostHeaderKey !== undefined) {
  7667. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7668. }
  7669. return obj;
  7670. }
  7671. /**
  7672. * Create a Headers object from an object of headers, ignoring those that do
  7673. * not conform to HTTP grammar productions.
  7674. *
  7675. * @param Object obj Object of headers
  7676. * @return Headers
  7677. */
  7678. function createHeadersLenient(obj) {
  7679. const headers = new Headers();
  7680. for (const name of Object.keys(obj)) {
  7681. if (invalidTokenRegex.test(name)) {
  7682. continue;
  7683. }
  7684. if (Array.isArray(obj[name])) {
  7685. for (const val of obj[name]) {
  7686. if (invalidHeaderCharRegex.test(val)) {
  7687. continue;
  7688. }
  7689. if (headers[MAP][name] === undefined) {
  7690. headers[MAP][name] = [val];
  7691. } else {
  7692. headers[MAP][name].push(val);
  7693. }
  7694. }
  7695. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7696. headers[MAP][name] = [obj[name]];
  7697. }
  7698. }
  7699. return headers;
  7700. }
  7701. const INTERNALS$1 = Symbol('Response internals');
  7702. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7703. const STATUS_CODES = http.STATUS_CODES;
  7704. /**
  7705. * Response class
  7706. *
  7707. * @param Stream body Readable stream
  7708. * @param Object opts Response options
  7709. * @return Void
  7710. */
  7711. class Response {
  7712. constructor() {
  7713. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7714. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7715. Body.call(this, body, opts);
  7716. const status = opts.status || 200;
  7717. const headers = new Headers(opts.headers);
  7718. if (body != null && !headers.has('Content-Type')) {
  7719. const contentType = extractContentType(body);
  7720. if (contentType) {
  7721. headers.append('Content-Type', contentType);
  7722. }
  7723. }
  7724. this[INTERNALS$1] = {
  7725. url: opts.url,
  7726. status,
  7727. statusText: opts.statusText || STATUS_CODES[status],
  7728. headers,
  7729. counter: opts.counter
  7730. };
  7731. }
  7732. get url() {
  7733. return this[INTERNALS$1].url || '';
  7734. }
  7735. get status() {
  7736. return this[INTERNALS$1].status;
  7737. }
  7738. /**
  7739. * Convenience property representing if the request ended normally
  7740. */
  7741. get ok() {
  7742. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7743. }
  7744. get redirected() {
  7745. return this[INTERNALS$1].counter > 0;
  7746. }
  7747. get statusText() {
  7748. return this[INTERNALS$1].statusText;
  7749. }
  7750. get headers() {
  7751. return this[INTERNALS$1].headers;
  7752. }
  7753. /**
  7754. * Clone this response
  7755. *
  7756. * @return Response
  7757. */
  7758. clone() {
  7759. return new Response(clone(this), {
  7760. url: this.url,
  7761. status: this.status,
  7762. statusText: this.statusText,
  7763. headers: this.headers,
  7764. ok: this.ok,
  7765. redirected: this.redirected
  7766. });
  7767. }
  7768. }
  7769. Body.mixIn(Response.prototype);
  7770. Object.defineProperties(Response.prototype, {
  7771. url: { enumerable: true },
  7772. status: { enumerable: true },
  7773. ok: { enumerable: true },
  7774. redirected: { enumerable: true },
  7775. statusText: { enumerable: true },
  7776. headers: { enumerable: true },
  7777. clone: { enumerable: true }
  7778. });
  7779. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7780. value: 'Response',
  7781. writable: false,
  7782. enumerable: false,
  7783. configurable: true
  7784. });
  7785. const INTERNALS$2 = Symbol('Request internals');
  7786. // fix an issue where "format", "parse" aren't a named export for node <10
  7787. const parse_url = Url.parse;
  7788. const format_url = Url.format;
  7789. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7790. /**
  7791. * Check if a value is an instance of Request.
  7792. *
  7793. * @param Mixed input
  7794. * @return Boolean
  7795. */
  7796. function isRequest(input) {
  7797. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7798. }
  7799. function isAbortSignal(signal) {
  7800. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7801. return !!(proto && proto.constructor.name === 'AbortSignal');
  7802. }
  7803. /**
  7804. * Request class
  7805. *
  7806. * @param Mixed input Url or Request instance
  7807. * @param Object init Custom options
  7808. * @return Void
  7809. */
  7810. class Request {
  7811. constructor(input) {
  7812. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7813. let parsedURL;
  7814. // normalize input
  7815. if (!isRequest(input)) {
  7816. if (input && input.href) {
  7817. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7818. // will fall into this branch also (since their `toString()` will return
  7819. // `href` property anyway)
  7820. parsedURL = parse_url(input.href);
  7821. } else {
  7822. // coerce input to a string before attempting to parse
  7823. parsedURL = parse_url(`${input}`);
  7824. }
  7825. input = {};
  7826. } else {
  7827. parsedURL = parse_url(input.url);
  7828. }
  7829. let method = init.method || input.method || 'GET';
  7830. method = method.toUpperCase();
  7831. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7832. throw new TypeError('Request with GET/HEAD method cannot have body');
  7833. }
  7834. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7835. Body.call(this, inputBody, {
  7836. timeout: init.timeout || input.timeout || 0,
  7837. size: init.size || input.size || 0
  7838. });
  7839. const headers = new Headers(init.headers || input.headers || {});
  7840. if (inputBody != null && !headers.has('Content-Type')) {
  7841. const contentType = extractContentType(inputBody);
  7842. if (contentType) {
  7843. headers.append('Content-Type', contentType);
  7844. }
  7845. }
  7846. let signal = isRequest(input) ? input.signal : null;
  7847. if ('signal' in init) signal = init.signal;
  7848. if (signal != null && !isAbortSignal(signal)) {
  7849. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7850. }
  7851. this[INTERNALS$2] = {
  7852. method,
  7853. redirect: init.redirect || input.redirect || 'follow',
  7854. headers,
  7855. parsedURL,
  7856. signal
  7857. };
  7858. // node-fetch-only options
  7859. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7860. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7861. this.counter = init.counter || input.counter || 0;
  7862. this.agent = init.agent || input.agent;
  7863. }
  7864. get method() {
  7865. return this[INTERNALS$2].method;
  7866. }
  7867. get url() {
  7868. return format_url(this[INTERNALS$2].parsedURL);
  7869. }
  7870. get headers() {
  7871. return this[INTERNALS$2].headers;
  7872. }
  7873. get redirect() {
  7874. return this[INTERNALS$2].redirect;
  7875. }
  7876. get signal() {
  7877. return this[INTERNALS$2].signal;
  7878. }
  7879. /**
  7880. * Clone this request
  7881. *
  7882. * @return Request
  7883. */
  7884. clone() {
  7885. return new Request(this);
  7886. }
  7887. }
  7888. Body.mixIn(Request.prototype);
  7889. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7890. value: 'Request',
  7891. writable: false,
  7892. enumerable: false,
  7893. configurable: true
  7894. });
  7895. Object.defineProperties(Request.prototype, {
  7896. method: { enumerable: true },
  7897. url: { enumerable: true },
  7898. headers: { enumerable: true },
  7899. redirect: { enumerable: true },
  7900. clone: { enumerable: true },
  7901. signal: { enumerable: true }
  7902. });
  7903. /**
  7904. * Convert a Request to Node.js http request options.
  7905. *
  7906. * @param Request A Request instance
  7907. * @return Object The options object to be passed to http.request
  7908. */
  7909. function getNodeRequestOptions(request) {
  7910. const parsedURL = request[INTERNALS$2].parsedURL;
  7911. const headers = new Headers(request[INTERNALS$2].headers);
  7912. // fetch step 1.3
  7913. if (!headers.has('Accept')) {
  7914. headers.set('Accept', '*/*');
  7915. }
  7916. // Basic fetch
  7917. if (!parsedURL.protocol || !parsedURL.hostname) {
  7918. throw new TypeError('Only absolute URLs are supported');
  7919. }
  7920. if (!/^https?:$/.test(parsedURL.protocol)) {
  7921. throw new TypeError('Only HTTP(S) protocols are supported');
  7922. }
  7923. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7924. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7925. }
  7926. // HTTP-network-or-cache fetch steps 2.4-2.7
  7927. let contentLengthValue = null;
  7928. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7929. contentLengthValue = '0';
  7930. }
  7931. if (request.body != null) {
  7932. const totalBytes = getTotalBytes(request);
  7933. if (typeof totalBytes === 'number') {
  7934. contentLengthValue = String(totalBytes);
  7935. }
  7936. }
  7937. if (contentLengthValue) {
  7938. headers.set('Content-Length', contentLengthValue);
  7939. }
  7940. // HTTP-network-or-cache fetch step 2.11
  7941. if (!headers.has('User-Agent')) {
  7942. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7943. }
  7944. // HTTP-network-or-cache fetch step 2.15
  7945. if (request.compress && !headers.has('Accept-Encoding')) {
  7946. headers.set('Accept-Encoding', 'gzip,deflate');
  7947. }
  7948. let agent = request.agent;
  7949. if (typeof agent === 'function') {
  7950. agent = agent(parsedURL);
  7951. }
  7952. if (!headers.has('Connection') && !agent) {
  7953. headers.set('Connection', 'close');
  7954. }
  7955. // HTTP-network fetch step 4.2
  7956. // chunked encoding is handled by Node.js
  7957. return Object.assign({}, parsedURL, {
  7958. method: request.method,
  7959. headers: exportNodeCompatibleHeaders(headers),
  7960. agent
  7961. });
  7962. }
  7963. /**
  7964. * abort-error.js
  7965. *
  7966. * AbortError interface for cancelled requests
  7967. */
  7968. /**
  7969. * Create AbortError instance
  7970. *
  7971. * @param String message Error message for human
  7972. * @return AbortError
  7973. */
  7974. function AbortError(message) {
  7975. Error.call(this, message);
  7976. this.type = 'aborted';
  7977. this.message = message;
  7978. // hide custom error implementation details from end-users
  7979. Error.captureStackTrace(this, this.constructor);
  7980. }
  7981. AbortError.prototype = Object.create(Error.prototype);
  7982. AbortError.prototype.constructor = AbortError;
  7983. AbortError.prototype.name = 'AbortError';
  7984. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7985. const PassThrough$1 = Stream.PassThrough;
  7986. const resolve_url = Url.resolve;
  7987. /**
  7988. * Fetch function
  7989. *
  7990. * @param Mixed url Absolute url or Request instance
  7991. * @param Object opts Fetch options
  7992. * @return Promise
  7993. */
  7994. function fetch(url, opts) {
  7995. // allow custom promise
  7996. if (!fetch.Promise) {
  7997. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7998. }
  7999. Body.Promise = fetch.Promise;
  8000. // wrap http.request into fetch
  8001. return new fetch.Promise(function (resolve, reject) {
  8002. // build request object
  8003. const request = new Request(url, opts);
  8004. const options = getNodeRequestOptions(request);
  8005. const send = (options.protocol === 'https:' ? https : http).request;
  8006. const signal = request.signal;
  8007. let response = null;
  8008. const abort = function abort() {
  8009. let error = new AbortError('The user aborted a request.');
  8010. reject(error);
  8011. if (request.body && request.body instanceof Stream.Readable) {
  8012. request.body.destroy(error);
  8013. }
  8014. if (!response || !response.body) return;
  8015. response.body.emit('error', error);
  8016. };
  8017. if (signal && signal.aborted) {
  8018. abort();
  8019. return;
  8020. }
  8021. const abortAndFinalize = function abortAndFinalize() {
  8022. abort();
  8023. finalize();
  8024. };
  8025. // send request
  8026. const req = send(options);
  8027. let reqTimeout;
  8028. if (signal) {
  8029. signal.addEventListener('abort', abortAndFinalize);
  8030. }
  8031. function finalize() {
  8032. req.abort();
  8033. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8034. clearTimeout(reqTimeout);
  8035. }
  8036. if (request.timeout) {
  8037. req.once('socket', function (socket) {
  8038. reqTimeout = setTimeout(function () {
  8039. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8040. finalize();
  8041. }, request.timeout);
  8042. });
  8043. }
  8044. req.on('error', function (err) {
  8045. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8046. finalize();
  8047. });
  8048. req.on('response', function (res) {
  8049. clearTimeout(reqTimeout);
  8050. const headers = createHeadersLenient(res.headers);
  8051. // HTTP fetch step 5
  8052. if (fetch.isRedirect(res.statusCode)) {
  8053. // HTTP fetch step 5.2
  8054. const location = headers.get('Location');
  8055. // HTTP fetch step 5.3
  8056. const locationURL = location === null ? null : resolve_url(request.url, location);
  8057. // HTTP fetch step 5.5
  8058. switch (request.redirect) {
  8059. case 'error':
  8060. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8061. finalize();
  8062. return;
  8063. case 'manual':
  8064. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8065. if (locationURL !== null) {
  8066. // handle corrupted header
  8067. try {
  8068. headers.set('Location', locationURL);
  8069. } catch (err) {
  8070. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8071. reject(err);
  8072. }
  8073. }
  8074. break;
  8075. case 'follow':
  8076. // HTTP-redirect fetch step 2
  8077. if (locationURL === null) {
  8078. break;
  8079. }
  8080. // HTTP-redirect fetch step 5
  8081. if (request.counter >= request.follow) {
  8082. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8083. finalize();
  8084. return;
  8085. }
  8086. // HTTP-redirect fetch step 6 (counter increment)
  8087. // Create a new Request object.
  8088. const requestOpts = {
  8089. headers: new Headers(request.headers),
  8090. follow: request.follow,
  8091. counter: request.counter + 1,
  8092. agent: request.agent,
  8093. compress: request.compress,
  8094. method: request.method,
  8095. body: request.body,
  8096. signal: request.signal,
  8097. timeout: request.timeout
  8098. };
  8099. // HTTP-redirect fetch step 9
  8100. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8101. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8102. finalize();
  8103. return;
  8104. }
  8105. // HTTP-redirect fetch step 11
  8106. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8107. requestOpts.method = 'GET';
  8108. requestOpts.body = undefined;
  8109. requestOpts.headers.delete('content-length');
  8110. }
  8111. // HTTP-redirect fetch step 15
  8112. resolve(fetch(new Request(locationURL, requestOpts)));
  8113. finalize();
  8114. return;
  8115. }
  8116. }
  8117. // prepare response
  8118. res.once('end', function () {
  8119. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8120. });
  8121. let body = res.pipe(new PassThrough$1());
  8122. const response_options = {
  8123. url: request.url,
  8124. status: res.statusCode,
  8125. statusText: res.statusMessage,
  8126. headers: headers,
  8127. size: request.size,
  8128. timeout: request.timeout,
  8129. counter: request.counter
  8130. };
  8131. // HTTP-network fetch step 12.1.1.3
  8132. const codings = headers.get('Content-Encoding');
  8133. // HTTP-network fetch step 12.1.1.4: handle content codings
  8134. // in following scenarios we ignore compression support
  8135. // 1. compression support is disabled
  8136. // 2. HEAD request
  8137. // 3. no Content-Encoding header
  8138. // 4. no content response (204)
  8139. // 5. content not modified response (304)
  8140. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8141. response = new Response(body, response_options);
  8142. resolve(response);
  8143. return;
  8144. }
  8145. // For Node v6+
  8146. // Be less strict when decoding compressed responses, since sometimes
  8147. // servers send slightly invalid responses that are still accepted
  8148. // by common browsers.
  8149. // Always using Z_SYNC_FLUSH is what cURL does.
  8150. const zlibOptions = {
  8151. flush: zlib.Z_SYNC_FLUSH,
  8152. finishFlush: zlib.Z_SYNC_FLUSH
  8153. };
  8154. // for gzip
  8155. if (codings == 'gzip' || codings == 'x-gzip') {
  8156. body = body.pipe(zlib.createGunzip(zlibOptions));
  8157. response = new Response(body, response_options);
  8158. resolve(response);
  8159. return;
  8160. }
  8161. // for deflate
  8162. if (codings == 'deflate' || codings == 'x-deflate') {
  8163. // handle the infamous raw deflate response from old servers
  8164. // a hack for old IIS and Apache servers
  8165. const raw = res.pipe(new PassThrough$1());
  8166. raw.once('data', function (chunk) {
  8167. // see http://stackoverflow.com/questions/37519828
  8168. if ((chunk[0] & 0x0F) === 0x08) {
  8169. body = body.pipe(zlib.createInflate());
  8170. } else {
  8171. body = body.pipe(zlib.createInflateRaw());
  8172. }
  8173. response = new Response(body, response_options);
  8174. resolve(response);
  8175. });
  8176. return;
  8177. }
  8178. // for br
  8179. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8180. body = body.pipe(zlib.createBrotliDecompress());
  8181. response = new Response(body, response_options);
  8182. resolve(response);
  8183. return;
  8184. }
  8185. // otherwise, use response as-is
  8186. response = new Response(body, response_options);
  8187. resolve(response);
  8188. });
  8189. writeToStream(req, request);
  8190. });
  8191. }
  8192. /**
  8193. * Redirect code matching
  8194. *
  8195. * @param Number code Status code
  8196. * @return Boolean
  8197. */
  8198. fetch.isRedirect = function (code) {
  8199. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8200. };
  8201. // expose Promise
  8202. fetch.Promise = global.Promise;
  8203. module.exports = exports = fetch;
  8204. Object.defineProperty(exports, "__esModule", { value: true });
  8205. exports.default = exports;
  8206. exports.Headers = Headers;
  8207. exports.Request = Request;
  8208. exports.Response = Response;
  8209. exports.FetchError = FetchError;
  8210. /***/ }),
  8211. /***/ 462:
  8212. /***/ (function(module) {
  8213. "use strict";
  8214. // See http://www.robvanderwoude.com/escapechars.php
  8215. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8216. function escapeCommand(arg) {
  8217. // Escape meta chars
  8218. arg = arg.replace(metaCharsRegExp, '^$1');
  8219. return arg;
  8220. }
  8221. function escapeArgument(arg, doubleEscapeMetaChars) {
  8222. // Convert to string
  8223. arg = `${arg}`;
  8224. // Algorithm below is based on https://qntm.org/cmd
  8225. // Sequence of backslashes followed by a double quote:
  8226. // double up all the backslashes and escape the double quote
  8227. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8228. // Sequence of backslashes followed by the end of the string
  8229. // (which will become a double quote later):
  8230. // double up all the backslashes
  8231. arg = arg.replace(/(\\*)$/, '$1$1');
  8232. // All other backslashes occur literally
  8233. // Quote the whole thing:
  8234. arg = `"${arg}"`;
  8235. // Escape meta chars
  8236. arg = arg.replace(metaCharsRegExp, '^$1');
  8237. // Double escape meta chars if necessary
  8238. if (doubleEscapeMetaChars) {
  8239. arg = arg.replace(metaCharsRegExp, '^$1');
  8240. }
  8241. return arg;
  8242. }
  8243. module.exports.command = escapeCommand;
  8244. module.exports.argument = escapeArgument;
  8245. /***/ }),
  8246. /***/ 463:
  8247. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8248. "use strict";
  8249. Object.defineProperty(exports, '__esModule', { value: true });
  8250. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8251. var deprecation = __webpack_require__(692);
  8252. var once = _interopDefault(__webpack_require__(969));
  8253. const logOnce = once(deprecation => console.warn(deprecation));
  8254. /**
  8255. * Error with extra properties to help with debugging
  8256. */
  8257. class RequestError extends Error {
  8258. constructor(message, statusCode, options) {
  8259. super(message); // Maintains proper stack trace (only available on V8)
  8260. /* istanbul ignore next */
  8261. if (Error.captureStackTrace) {
  8262. Error.captureStackTrace(this, this.constructor);
  8263. }
  8264. this.name = "HttpError";
  8265. this.status = statusCode;
  8266. Object.defineProperty(this, "code", {
  8267. get() {
  8268. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8269. return statusCode;
  8270. }
  8271. });
  8272. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8273. const requestCopy = Object.assign({}, options.request);
  8274. if (options.request.headers.authorization) {
  8275. requestCopy.headers = Object.assign({}, options.request.headers, {
  8276. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8277. });
  8278. }
  8279. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8280. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8281. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8282. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8283. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8284. this.request = requestCopy;
  8285. }
  8286. }
  8287. exports.RequestError = RequestError;
  8288. //# sourceMappingURL=index.js.map
  8289. /***/ }),
  8290. /***/ 464:
  8291. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8292. "use strict";
  8293. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8294. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8295. return new (P || (P = Promise))(function (resolve, reject) {
  8296. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8297. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8298. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8299. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8300. });
  8301. };
  8302. var __importStar = (this && this.__importStar) || function (mod) {
  8303. if (mod && mod.__esModule) return mod;
  8304. var result = {};
  8305. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8306. result["default"] = mod;
  8307. return result;
  8308. };
  8309. var __importDefault = (this && this.__importDefault) || function (mod) {
  8310. return (mod && mod.__esModule) ? mod : { "default": mod };
  8311. };
  8312. Object.defineProperty(exports, "__esModule", { value: true });
  8313. const assert = __importStar(__webpack_require__(357));
  8314. const core = __importStar(__webpack_require__(470));
  8315. const fs = __importStar(__webpack_require__(747));
  8316. const github = __importStar(__webpack_require__(469));
  8317. const io = __importStar(__webpack_require__(1));
  8318. const path = __importStar(__webpack_require__(622));
  8319. const retryHelper = __importStar(__webpack_require__(587));
  8320. const toolCache = __importStar(__webpack_require__(533));
  8321. const v4_1 = __importDefault(__webpack_require__(826));
  8322. const IS_WINDOWS = process.platform === 'win32';
  8323. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8324. return __awaiter(this, void 0, void 0, function* () {
  8325. // Determine the default branch
  8326. if (!ref && !commit) {
  8327. core.info('Determining the default branch');
  8328. ref = yield getDefaultBranch(authToken, owner, repo);
  8329. }
  8330. // Download the archive
  8331. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8332. core.info('Downloading the archive');
  8333. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8334. }));
  8335. // Write archive to disk
  8336. core.info('Writing archive to disk');
  8337. const uniqueId = v4_1.default();
  8338. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8339. yield fs.promises.writeFile(archivePath, archiveData);
  8340. archiveData = Buffer.from(''); // Free memory
  8341. // Extract archive
  8342. core.info('Extracting the archive');
  8343. const extractPath = path.join(repositoryPath, uniqueId);
  8344. yield io.mkdirP(extractPath);
  8345. if (IS_WINDOWS) {
  8346. yield toolCache.extractZip(archivePath, extractPath);
  8347. }
  8348. else {
  8349. yield toolCache.extractTar(archivePath, extractPath);
  8350. }
  8351. io.rmRF(archivePath);
  8352. // Determine the path of the repository content. The archive contains
  8353. // a top-level folder and the repository content is inside.
  8354. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8355. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8356. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8357. core.info(`Resolved version ${archiveVersion}`);
  8358. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8359. // Move the files
  8360. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8361. const sourcePath = path.join(tempRepositoryPath, fileName);
  8362. const targetPath = path.join(repositoryPath, fileName);
  8363. if (IS_WINDOWS) {
  8364. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8365. }
  8366. else {
  8367. yield io.mv(sourcePath, targetPath);
  8368. }
  8369. }
  8370. io.rmRF(extractPath);
  8371. });
  8372. }
  8373. exports.downloadRepository = downloadRepository;
  8374. /**
  8375. * Looks up the default branch name
  8376. */
  8377. function getDefaultBranch(authToken, owner, repo) {
  8378. return __awaiter(this, void 0, void 0, function* () {
  8379. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8380. core.info('Retrieving the default branch name');
  8381. const octokit = new github.GitHub(authToken);
  8382. let result;
  8383. try {
  8384. // Get the default branch from the repo info
  8385. const response = yield octokit.repos.get({ owner, repo });
  8386. result = response.data.default_branch;
  8387. assert.ok(result, 'default_branch cannot be empty');
  8388. }
  8389. catch (err) {
  8390. // Handle .wiki repo
  8391. if (err['status'] === 404 && repo.toUpperCase().endsWith('.WIKI')) {
  8392. result = 'master';
  8393. }
  8394. // Otherwise error
  8395. else {
  8396. throw err;
  8397. }
  8398. }
  8399. // Print the default branch
  8400. core.info(`Default branch '${result}'`);
  8401. // Prefix with 'refs/heads'
  8402. if (!result.startsWith('refs/')) {
  8403. result = `refs/heads/${result}`;
  8404. }
  8405. return result;
  8406. }));
  8407. });
  8408. }
  8409. exports.getDefaultBranch = getDefaultBranch;
  8410. function downloadArchive(authToken, owner, repo, ref, commit) {
  8411. return __awaiter(this, void 0, void 0, function* () {
  8412. const octokit = new github.GitHub(authToken);
  8413. const params = {
  8414. owner: owner,
  8415. repo: repo,
  8416. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8417. ref: commit || ref
  8418. };
  8419. const response = yield octokit.repos.getArchiveLink(params);
  8420. if (response.status != 200) {
  8421. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8422. }
  8423. return Buffer.from(response.data); // response.data is ArrayBuffer
  8424. });
  8425. }
  8426. /***/ }),
  8427. /***/ 469:
  8428. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8429. "use strict";
  8430. var __importStar = (this && this.__importStar) || function (mod) {
  8431. if (mod && mod.__esModule) return mod;
  8432. var result = {};
  8433. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8434. result["default"] = mod;
  8435. return result;
  8436. };
  8437. Object.defineProperty(exports, "__esModule", { value: true });
  8438. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8439. const graphql_1 = __webpack_require__(898);
  8440. const rest_1 = __webpack_require__(0);
  8441. const Context = __importStar(__webpack_require__(262));
  8442. const httpClient = __importStar(__webpack_require__(539));
  8443. // We need this in order to extend Octokit
  8444. rest_1.Octokit.prototype = new rest_1.Octokit();
  8445. exports.context = new Context.Context();
  8446. class GitHub extends rest_1.Octokit {
  8447. constructor(token, opts) {
  8448. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8449. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8450. }
  8451. /**
  8452. * Disambiguates the constructor overload parameters
  8453. */
  8454. static disambiguate(token, opts) {
  8455. return [
  8456. typeof token === 'string' ? token : '',
  8457. typeof token === 'object' ? token : opts || {}
  8458. ];
  8459. }
  8460. static getOctokitOptions(args) {
  8461. const token = args[0];
  8462. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8463. // Base URL - GHES or Dotcom
  8464. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8465. // Auth
  8466. const auth = GitHub.getAuthString(token, options);
  8467. if (auth) {
  8468. options.auth = auth;
  8469. }
  8470. // Proxy
  8471. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8472. if (agent) {
  8473. // Shallow clone - don't mutate the object provided by the caller
  8474. options.request = options.request ? Object.assign({}, options.request) : {};
  8475. // Set the agent
  8476. options.request.agent = agent;
  8477. }
  8478. return options;
  8479. }
  8480. static getGraphQL(args) {
  8481. const defaults = {};
  8482. defaults.baseUrl = this.getGraphQLBaseUrl();
  8483. const token = args[0];
  8484. const options = args[1];
  8485. // Authorization
  8486. const auth = this.getAuthString(token, options);
  8487. if (auth) {
  8488. defaults.headers = {
  8489. authorization: auth
  8490. };
  8491. }
  8492. // Proxy
  8493. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8494. if (agent) {
  8495. defaults.request = { agent };
  8496. }
  8497. return graphql_1.graphql.defaults(defaults);
  8498. }
  8499. static getAuthString(token, options) {
  8500. // Validate args
  8501. if (!token && !options.auth) {
  8502. throw new Error('Parameter token or opts.auth is required');
  8503. }
  8504. else if (token && options.auth) {
  8505. throw new Error('Parameters token and opts.auth may not both be specified');
  8506. }
  8507. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8508. }
  8509. static getProxyAgent(destinationUrl, options) {
  8510. var _a;
  8511. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8512. if (httpClient.getProxyUrl(destinationUrl)) {
  8513. const hc = new httpClient.HttpClient();
  8514. return hc.getAgent(destinationUrl);
  8515. }
  8516. }
  8517. return undefined;
  8518. }
  8519. static getApiBaseUrl() {
  8520. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8521. }
  8522. static getGraphQLBaseUrl() {
  8523. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8524. // Shouldn't be a trailing slash, but remove if so
  8525. if (url.endsWith('/')) {
  8526. url = url.substr(0, url.length - 1);
  8527. }
  8528. // Remove trailing "/graphql"
  8529. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8530. url = url.substr(0, url.length - '/graphql'.length);
  8531. }
  8532. return url;
  8533. }
  8534. }
  8535. exports.GitHub = GitHub;
  8536. //# sourceMappingURL=github.js.map
  8537. /***/ }),
  8538. /***/ 470:
  8539. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8540. "use strict";
  8541. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8542. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8543. return new (P || (P = Promise))(function (resolve, reject) {
  8544. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8545. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8546. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8547. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8548. });
  8549. };
  8550. Object.defineProperty(exports, "__esModule", { value: true });
  8551. const command_1 = __webpack_require__(431);
  8552. const os = __webpack_require__(87);
  8553. const path = __webpack_require__(622);
  8554. /**
  8555. * The code to exit an action
  8556. */
  8557. var ExitCode;
  8558. (function (ExitCode) {
  8559. /**
  8560. * A code indicating that the action was successful
  8561. */
  8562. ExitCode[ExitCode["Success"] = 0] = "Success";
  8563. /**
  8564. * A code indicating that the action was a failure
  8565. */
  8566. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8567. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8568. //-----------------------------------------------------------------------
  8569. // Variables
  8570. //-----------------------------------------------------------------------
  8571. /**
  8572. * Sets env variable for this action and future actions in the job
  8573. * @param name the name of the variable to set
  8574. * @param val the value of the variable
  8575. */
  8576. function exportVariable(name, val) {
  8577. process.env[name] = val;
  8578. command_1.issueCommand('set-env', { name }, val);
  8579. }
  8580. exports.exportVariable = exportVariable;
  8581. /**
  8582. * Registers a secret which will get masked from logs
  8583. * @param secret value of the secret
  8584. */
  8585. function setSecret(secret) {
  8586. command_1.issueCommand('add-mask', {}, secret);
  8587. }
  8588. exports.setSecret = setSecret;
  8589. /**
  8590. * Prepends inputPath to the PATH (for this action and future actions)
  8591. * @param inputPath
  8592. */
  8593. function addPath(inputPath) {
  8594. command_1.issueCommand('add-path', {}, inputPath);
  8595. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8596. }
  8597. exports.addPath = addPath;
  8598. /**
  8599. * Gets the value of an input. The value is also trimmed.
  8600. *
  8601. * @param name name of the input to get
  8602. * @param options optional. See InputOptions.
  8603. * @returns string
  8604. */
  8605. function getInput(name, options) {
  8606. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8607. if (options && options.required && !val) {
  8608. throw new Error(`Input required and not supplied: ${name}`);
  8609. }
  8610. return val.trim();
  8611. }
  8612. exports.getInput = getInput;
  8613. /**
  8614. * Sets the value of an output.
  8615. *
  8616. * @param name name of the output to set
  8617. * @param value value to store
  8618. */
  8619. function setOutput(name, value) {
  8620. command_1.issueCommand('set-output', { name }, value);
  8621. }
  8622. exports.setOutput = setOutput;
  8623. //-----------------------------------------------------------------------
  8624. // Results
  8625. //-----------------------------------------------------------------------
  8626. /**
  8627. * Sets the action status to failed.
  8628. * When the action exits it will be with an exit code of 1
  8629. * @param message add error issue message
  8630. */
  8631. function setFailed(message) {
  8632. process.exitCode = ExitCode.Failure;
  8633. error(message);
  8634. }
  8635. exports.setFailed = setFailed;
  8636. //-----------------------------------------------------------------------
  8637. // Logging Commands
  8638. //-----------------------------------------------------------------------
  8639. /**
  8640. * Writes debug message to user log
  8641. * @param message debug message
  8642. */
  8643. function debug(message) {
  8644. command_1.issueCommand('debug', {}, message);
  8645. }
  8646. exports.debug = debug;
  8647. /**
  8648. * Adds an error issue
  8649. * @param message error issue message
  8650. */
  8651. function error(message) {
  8652. command_1.issue('error', message);
  8653. }
  8654. exports.error = error;
  8655. /**
  8656. * Adds an warning issue
  8657. * @param message warning issue message
  8658. */
  8659. function warning(message) {
  8660. command_1.issue('warning', message);
  8661. }
  8662. exports.warning = warning;
  8663. /**
  8664. * Writes info to log with console.log.
  8665. * @param message info message
  8666. */
  8667. function info(message) {
  8668. process.stdout.write(message + os.EOL);
  8669. }
  8670. exports.info = info;
  8671. /**
  8672. * Begin an output group.
  8673. *
  8674. * Output until the next `groupEnd` will be foldable in this group
  8675. *
  8676. * @param name The name of the output group
  8677. */
  8678. function startGroup(name) {
  8679. command_1.issue('group', name);
  8680. }
  8681. exports.startGroup = startGroup;
  8682. /**
  8683. * End an output group.
  8684. */
  8685. function endGroup() {
  8686. command_1.issue('endgroup');
  8687. }
  8688. exports.endGroup = endGroup;
  8689. /**
  8690. * Wrap an asynchronous function call in a group.
  8691. *
  8692. * Returns the same type as the function itself.
  8693. *
  8694. * @param name The name of the group
  8695. * @param fn The function to wrap in the group
  8696. */
  8697. function group(name, fn) {
  8698. return __awaiter(this, void 0, void 0, function* () {
  8699. startGroup(name);
  8700. let result;
  8701. try {
  8702. result = yield fn();
  8703. }
  8704. finally {
  8705. endGroup();
  8706. }
  8707. return result;
  8708. });
  8709. }
  8710. exports.group = group;
  8711. //# sourceMappingURL=core.js.map
  8712. /***/ }),
  8713. /***/ 471:
  8714. /***/ (function(module, __unusedexports, __webpack_require__) {
  8715. module.exports = authenticationBeforeRequest;
  8716. const btoa = __webpack_require__(675);
  8717. const uniq = __webpack_require__(126);
  8718. function authenticationBeforeRequest(state, options) {
  8719. if (!state.auth.type) {
  8720. return;
  8721. }
  8722. if (state.auth.type === "basic") {
  8723. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8724. options.headers.authorization = `Basic ${hash}`;
  8725. return;
  8726. }
  8727. if (state.auth.type === "token") {
  8728. options.headers.authorization = `token ${state.auth.token}`;
  8729. return;
  8730. }
  8731. if (state.auth.type === "app") {
  8732. options.headers.authorization = `Bearer ${state.auth.token}`;
  8733. const acceptHeaders = options.headers.accept
  8734. .split(",")
  8735. .concat("application/vnd.github.machine-man-preview+json");
  8736. options.headers.accept = uniq(acceptHeaders)
  8737. .filter(Boolean)
  8738. .join(",");
  8739. return;
  8740. }
  8741. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8742. if (state.auth.token) {
  8743. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8744. return;
  8745. }
  8746. const key = encodeURIComponent(state.auth.key);
  8747. const secret = encodeURIComponent(state.auth.secret);
  8748. options.url += `client_id=${key}&client_secret=${secret}`;
  8749. }
  8750. /***/ }),
  8751. /***/ 489:
  8752. /***/ (function(module, __unusedexports, __webpack_require__) {
  8753. "use strict";
  8754. const path = __webpack_require__(622);
  8755. const which = __webpack_require__(814);
  8756. const pathKey = __webpack_require__(39)();
  8757. function resolveCommandAttempt(parsed, withoutPathExt) {
  8758. const cwd = process.cwd();
  8759. const hasCustomCwd = parsed.options.cwd != null;
  8760. // If a custom `cwd` was specified, we need to change the process cwd
  8761. // because `which` will do stat calls but does not support a custom cwd
  8762. if (hasCustomCwd) {
  8763. try {
  8764. process.chdir(parsed.options.cwd);
  8765. } catch (err) {
  8766. /* Empty */
  8767. }
  8768. }
  8769. let resolved;
  8770. try {
  8771. resolved = which.sync(parsed.command, {
  8772. path: (parsed.options.env || process.env)[pathKey],
  8773. pathExt: withoutPathExt ? path.delimiter : undefined,
  8774. });
  8775. } catch (e) {
  8776. /* Empty */
  8777. } finally {
  8778. process.chdir(cwd);
  8779. }
  8780. // If we successfully resolved, ensure that an absolute path is returned
  8781. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8782. if (resolved) {
  8783. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8784. }
  8785. return resolved;
  8786. }
  8787. function resolveCommand(parsed) {
  8788. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8789. }
  8790. module.exports = resolveCommand;
  8791. /***/ }),
  8792. /***/ 497:
  8793. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8794. "use strict";
  8795. Object.defineProperty(exports, '__esModule', { value: true });
  8796. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8797. var deprecation = __webpack_require__(692);
  8798. var once = _interopDefault(__webpack_require__(969));
  8799. const logOnce = once(deprecation => console.warn(deprecation));
  8800. /**
  8801. * Error with extra properties to help with debugging
  8802. */
  8803. class RequestError extends Error {
  8804. constructor(message, statusCode, options) {
  8805. super(message); // Maintains proper stack trace (only available on V8)
  8806. /* istanbul ignore next */
  8807. if (Error.captureStackTrace) {
  8808. Error.captureStackTrace(this, this.constructor);
  8809. }
  8810. this.name = "HttpError";
  8811. this.status = statusCode;
  8812. Object.defineProperty(this, "code", {
  8813. get() {
  8814. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8815. return statusCode;
  8816. }
  8817. });
  8818. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8819. const requestCopy = Object.assign({}, options.request);
  8820. if (options.request.headers.authorization) {
  8821. requestCopy.headers = Object.assign({}, options.request.headers, {
  8822. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8823. });
  8824. }
  8825. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8826. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8827. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8828. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8829. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8830. this.request = requestCopy;
  8831. }
  8832. }
  8833. exports.RequestError = RequestError;
  8834. //# sourceMappingURL=index.js.map
  8835. /***/ }),
  8836. /***/ 510:
  8837. /***/ (function(module) {
  8838. module.exports = addHook
  8839. function addHook (state, kind, name, hook) {
  8840. var orig = hook
  8841. if (!state.registry[name]) {
  8842. state.registry[name] = []
  8843. }
  8844. if (kind === 'before') {
  8845. hook = function (method, options) {
  8846. return Promise.resolve()
  8847. .then(orig.bind(null, options))
  8848. .then(method.bind(null, options))
  8849. }
  8850. }
  8851. if (kind === 'after') {
  8852. hook = function (method, options) {
  8853. var result
  8854. return Promise.resolve()
  8855. .then(method.bind(null, options))
  8856. .then(function (result_) {
  8857. result = result_
  8858. return orig(result, options)
  8859. })
  8860. .then(function () {
  8861. return result
  8862. })
  8863. }
  8864. }
  8865. if (kind === 'error') {
  8866. hook = function (method, options) {
  8867. return Promise.resolve()
  8868. .then(method.bind(null, options))
  8869. .catch(function (error) {
  8870. return orig(error, options)
  8871. })
  8872. }
  8873. }
  8874. state.registry[name].push({
  8875. hook: hook,
  8876. orig: orig
  8877. })
  8878. }
  8879. /***/ }),
  8880. /***/ 523:
  8881. /***/ (function(module, __unusedexports, __webpack_require__) {
  8882. var register = __webpack_require__(363)
  8883. var addHook = __webpack_require__(510)
  8884. var removeHook = __webpack_require__(763)
  8885. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8886. var bind = Function.bind
  8887. var bindable = bind.bind(bind)
  8888. function bindApi (hook, state, name) {
  8889. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8890. hook.api = { remove: removeHookRef }
  8891. hook.remove = removeHookRef
  8892. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8893. var args = name ? [state, kind, name] : [state, kind]
  8894. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8895. })
  8896. }
  8897. function HookSingular () {
  8898. var singularHookName = 'h'
  8899. var singularHookState = {
  8900. registry: {}
  8901. }
  8902. var singularHook = register.bind(null, singularHookState, singularHookName)
  8903. bindApi(singularHook, singularHookState, singularHookName)
  8904. return singularHook
  8905. }
  8906. function HookCollection () {
  8907. var state = {
  8908. registry: {}
  8909. }
  8910. var hook = register.bind(null, state)
  8911. bindApi(hook, state)
  8912. return hook
  8913. }
  8914. var collectionHookDeprecationMessageDisplayed = false
  8915. function Hook () {
  8916. if (!collectionHookDeprecationMessageDisplayed) {
  8917. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8918. collectionHookDeprecationMessageDisplayed = true
  8919. }
  8920. return HookCollection()
  8921. }
  8922. Hook.Singular = HookSingular.bind()
  8923. Hook.Collection = HookCollection.bind()
  8924. module.exports = Hook
  8925. // expose constructors as a named property for TypeScript
  8926. module.exports.Hook = Hook
  8927. module.exports.Singular = Hook.Singular
  8928. module.exports.Collection = Hook.Collection
  8929. /***/ }),
  8930. /***/ 528:
  8931. /***/ (function(__unusedmodule, exports) {
  8932. "use strict";
  8933. Object.defineProperty(exports, "__esModule", { value: true });
  8934. function escape(value) {
  8935. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8936. return `\\${x}`;
  8937. });
  8938. }
  8939. exports.escape = escape;
  8940. /***/ }),
  8941. /***/ 529:
  8942. /***/ (function(module, __unusedexports, __webpack_require__) {
  8943. const factory = __webpack_require__(47);
  8944. module.exports = factory();
  8945. /***/ }),
  8946. /***/ 533:
  8947. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8948. "use strict";
  8949. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8950. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8951. return new (P || (P = Promise))(function (resolve, reject) {
  8952. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8953. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8954. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8955. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8956. });
  8957. };
  8958. Object.defineProperty(exports, "__esModule", { value: true });
  8959. const core = __webpack_require__(470);
  8960. const io = __webpack_require__(1);
  8961. const fs = __webpack_require__(747);
  8962. const os = __webpack_require__(87);
  8963. const path = __webpack_require__(622);
  8964. const httpm = __webpack_require__(874);
  8965. const semver = __webpack_require__(656);
  8966. const uuidV4 = __webpack_require__(826);
  8967. const exec_1 = __webpack_require__(986);
  8968. const assert_1 = __webpack_require__(357);
  8969. class HTTPError extends Error {
  8970. constructor(httpStatusCode) {
  8971. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8972. this.httpStatusCode = httpStatusCode;
  8973. Object.setPrototypeOf(this, new.target.prototype);
  8974. }
  8975. }
  8976. exports.HTTPError = HTTPError;
  8977. const IS_WINDOWS = process.platform === 'win32';
  8978. const userAgent = 'actions/tool-cache';
  8979. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8980. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8981. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8982. // If directories not found, place them in common temp locations
  8983. if (!tempDirectory || !cacheRoot) {
  8984. let baseLocation;
  8985. if (IS_WINDOWS) {
  8986. // On windows use the USERPROFILE env variable
  8987. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8988. }
  8989. else {
  8990. if (process.platform === 'darwin') {
  8991. baseLocation = '/Users';
  8992. }
  8993. else {
  8994. baseLocation = '/home';
  8995. }
  8996. }
  8997. if (!tempDirectory) {
  8998. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8999. }
  9000. if (!cacheRoot) {
  9001. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  9002. }
  9003. }
  9004. /**
  9005. * Download a tool from an url and stream it into a file
  9006. *
  9007. * @param url url of tool to download
  9008. * @returns path to downloaded tool
  9009. */
  9010. function downloadTool(url) {
  9011. return __awaiter(this, void 0, void 0, function* () {
  9012. // Wrap in a promise so that we can resolve from within stream callbacks
  9013. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  9014. try {
  9015. const http = new httpm.HttpClient(userAgent, [], {
  9016. allowRetries: true,
  9017. maxRetries: 3
  9018. });
  9019. const destPath = path.join(tempDirectory, uuidV4());
  9020. yield io.mkdirP(tempDirectory);
  9021. core.debug(`Downloading ${url}`);
  9022. core.debug(`Downloading ${destPath}`);
  9023. if (fs.existsSync(destPath)) {
  9024. throw new Error(`Destination file path ${destPath} already exists`);
  9025. }
  9026. const response = yield http.get(url);
  9027. if (response.message.statusCode !== 200) {
  9028. const err = new HTTPError(response.message.statusCode);
  9029. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9030. throw err;
  9031. }
  9032. const file = fs.createWriteStream(destPath);
  9033. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  9034. try {
  9035. const stream = response.message.pipe(file);
  9036. stream.on('close', () => {
  9037. core.debug('download complete');
  9038. resolve(destPath);
  9039. });
  9040. }
  9041. catch (err) {
  9042. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9043. reject(err);
  9044. }
  9045. }));
  9046. file.on('error', err => {
  9047. file.end();
  9048. reject(err);
  9049. });
  9050. }
  9051. catch (err) {
  9052. reject(err);
  9053. }
  9054. }));
  9055. });
  9056. }
  9057. exports.downloadTool = downloadTool;
  9058. /**
  9059. * Extract a .7z file
  9060. *
  9061. * @param file path to the .7z file
  9062. * @param dest destination directory. Optional.
  9063. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9064. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9065. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9066. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9067. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9068. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9069. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9070. * to 7zr.exe can be pass to this function.
  9071. * @returns path to the destination directory
  9072. */
  9073. function extract7z(file, dest, _7zPath) {
  9074. return __awaiter(this, void 0, void 0, function* () {
  9075. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9076. assert_1.ok(file, 'parameter "file" is required');
  9077. dest = dest || (yield _createExtractFolder(dest));
  9078. const originalCwd = process.cwd();
  9079. process.chdir(dest);
  9080. if (_7zPath) {
  9081. try {
  9082. const args = [
  9083. 'x',
  9084. '-bb1',
  9085. '-bd',
  9086. '-sccUTF-8',
  9087. file
  9088. ];
  9089. const options = {
  9090. silent: true
  9091. };
  9092. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9093. }
  9094. finally {
  9095. process.chdir(originalCwd);
  9096. }
  9097. }
  9098. else {
  9099. const escapedScript = path
  9100. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9101. .replace(/'/g, "''")
  9102. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9103. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9104. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9105. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9106. const args = [
  9107. '-NoLogo',
  9108. '-Sta',
  9109. '-NoProfile',
  9110. '-NonInteractive',
  9111. '-ExecutionPolicy',
  9112. 'Unrestricted',
  9113. '-Command',
  9114. command
  9115. ];
  9116. const options = {
  9117. silent: true
  9118. };
  9119. try {
  9120. const powershellPath = yield io.which('powershell', true);
  9121. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9122. }
  9123. finally {
  9124. process.chdir(originalCwd);
  9125. }
  9126. }
  9127. return dest;
  9128. });
  9129. }
  9130. exports.extract7z = extract7z;
  9131. /**
  9132. * Extract a tar
  9133. *
  9134. * @param file path to the tar
  9135. * @param dest destination directory. Optional.
  9136. * @param flags flags for the tar. Optional.
  9137. * @returns path to the destination directory
  9138. */
  9139. function extractTar(file, dest, flags = 'xz') {
  9140. return __awaiter(this, void 0, void 0, function* () {
  9141. if (!file) {
  9142. throw new Error("parameter 'file' is required");
  9143. }
  9144. dest = dest || (yield _createExtractFolder(dest));
  9145. const tarPath = yield io.which('tar', true);
  9146. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9147. return dest;
  9148. });
  9149. }
  9150. exports.extractTar = extractTar;
  9151. /**
  9152. * Extract a zip
  9153. *
  9154. * @param file path to the zip
  9155. * @param dest destination directory. Optional.
  9156. * @returns path to the destination directory
  9157. */
  9158. function extractZip(file, dest) {
  9159. return __awaiter(this, void 0, void 0, function* () {
  9160. if (!file) {
  9161. throw new Error("parameter 'file' is required");
  9162. }
  9163. dest = dest || (yield _createExtractFolder(dest));
  9164. if (IS_WINDOWS) {
  9165. yield extractZipWin(file, dest);
  9166. }
  9167. else {
  9168. yield extractZipNix(file, dest);
  9169. }
  9170. return dest;
  9171. });
  9172. }
  9173. exports.extractZip = extractZip;
  9174. function extractZipWin(file, dest) {
  9175. return __awaiter(this, void 0, void 0, function* () {
  9176. // build the powershell command
  9177. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9178. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9179. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9180. // run powershell
  9181. const powershellPath = yield io.which('powershell');
  9182. const args = [
  9183. '-NoLogo',
  9184. '-Sta',
  9185. '-NoProfile',
  9186. '-NonInteractive',
  9187. '-ExecutionPolicy',
  9188. 'Unrestricted',
  9189. '-Command',
  9190. command
  9191. ];
  9192. yield exec_1.exec(`"${powershellPath}"`, args);
  9193. });
  9194. }
  9195. function extractZipNix(file, dest) {
  9196. return __awaiter(this, void 0, void 0, function* () {
  9197. const unzipPath = yield io.which('unzip');
  9198. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9199. });
  9200. }
  9201. /**
  9202. * Caches a directory and installs it into the tool cacheDir
  9203. *
  9204. * @param sourceDir the directory to cache into tools
  9205. * @param tool tool name
  9206. * @param version version of the tool. semver format
  9207. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9208. */
  9209. function cacheDir(sourceDir, tool, version, arch) {
  9210. return __awaiter(this, void 0, void 0, function* () {
  9211. version = semver.clean(version) || version;
  9212. arch = arch || os.arch();
  9213. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9214. core.debug(`source dir: ${sourceDir}`);
  9215. if (!fs.statSync(sourceDir).isDirectory()) {
  9216. throw new Error('sourceDir is not a directory');
  9217. }
  9218. // Create the tool dir
  9219. const destPath = yield _createToolPath(tool, version, arch);
  9220. // copy each child item. do not move. move can fail on Windows
  9221. // due to anti-virus software having an open handle on a file.
  9222. for (const itemName of fs.readdirSync(sourceDir)) {
  9223. const s = path.join(sourceDir, itemName);
  9224. yield io.cp(s, destPath, { recursive: true });
  9225. }
  9226. // write .complete
  9227. _completeToolPath(tool, version, arch);
  9228. return destPath;
  9229. });
  9230. }
  9231. exports.cacheDir = cacheDir;
  9232. /**
  9233. * Caches a downloaded file (GUID) and installs it
  9234. * into the tool cache with a given targetName
  9235. *
  9236. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9237. * @param targetFile the name of the file name in the tools directory
  9238. * @param tool tool name
  9239. * @param version version of the tool. semver format
  9240. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9241. */
  9242. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9243. return __awaiter(this, void 0, void 0, function* () {
  9244. version = semver.clean(version) || version;
  9245. arch = arch || os.arch();
  9246. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9247. core.debug(`source file: ${sourceFile}`);
  9248. if (!fs.statSync(sourceFile).isFile()) {
  9249. throw new Error('sourceFile is not a file');
  9250. }
  9251. // create the tool dir
  9252. const destFolder = yield _createToolPath(tool, version, arch);
  9253. // copy instead of move. move can fail on Windows due to
  9254. // anti-virus software having an open handle on a file.
  9255. const destPath = path.join(destFolder, targetFile);
  9256. core.debug(`destination file ${destPath}`);
  9257. yield io.cp(sourceFile, destPath);
  9258. // write .complete
  9259. _completeToolPath(tool, version, arch);
  9260. return destFolder;
  9261. });
  9262. }
  9263. exports.cacheFile = cacheFile;
  9264. /**
  9265. * Finds the path to a tool version in the local installed tool cache
  9266. *
  9267. * @param toolName name of the tool
  9268. * @param versionSpec version of the tool
  9269. * @param arch optional arch. defaults to arch of computer
  9270. */
  9271. function find(toolName, versionSpec, arch) {
  9272. if (!toolName) {
  9273. throw new Error('toolName parameter is required');
  9274. }
  9275. if (!versionSpec) {
  9276. throw new Error('versionSpec parameter is required');
  9277. }
  9278. arch = arch || os.arch();
  9279. // attempt to resolve an explicit version
  9280. if (!_isExplicitVersion(versionSpec)) {
  9281. const localVersions = findAllVersions(toolName, arch);
  9282. const match = _evaluateVersions(localVersions, versionSpec);
  9283. versionSpec = match;
  9284. }
  9285. // check for the explicit version in the cache
  9286. let toolPath = '';
  9287. if (versionSpec) {
  9288. versionSpec = semver.clean(versionSpec) || '';
  9289. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9290. core.debug(`checking cache: ${cachePath}`);
  9291. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9292. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9293. toolPath = cachePath;
  9294. }
  9295. else {
  9296. core.debug('not found');
  9297. }
  9298. }
  9299. return toolPath;
  9300. }
  9301. exports.find = find;
  9302. /**
  9303. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9304. *
  9305. * @param toolName name of the tool
  9306. * @param arch optional arch. defaults to arch of computer
  9307. */
  9308. function findAllVersions(toolName, arch) {
  9309. const versions = [];
  9310. arch = arch || os.arch();
  9311. const toolPath = path.join(cacheRoot, toolName);
  9312. if (fs.existsSync(toolPath)) {
  9313. const children = fs.readdirSync(toolPath);
  9314. for (const child of children) {
  9315. if (_isExplicitVersion(child)) {
  9316. const fullPath = path.join(toolPath, child, arch || '');
  9317. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9318. versions.push(child);
  9319. }
  9320. }
  9321. }
  9322. }
  9323. return versions;
  9324. }
  9325. exports.findAllVersions = findAllVersions;
  9326. function _createExtractFolder(dest) {
  9327. return __awaiter(this, void 0, void 0, function* () {
  9328. if (!dest) {
  9329. // create a temp dir
  9330. dest = path.join(tempDirectory, uuidV4());
  9331. }
  9332. yield io.mkdirP(dest);
  9333. return dest;
  9334. });
  9335. }
  9336. function _createToolPath(tool, version, arch) {
  9337. return __awaiter(this, void 0, void 0, function* () {
  9338. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9339. core.debug(`destination ${folderPath}`);
  9340. const markerPath = `${folderPath}.complete`;
  9341. yield io.rmRF(folderPath);
  9342. yield io.rmRF(markerPath);
  9343. yield io.mkdirP(folderPath);
  9344. return folderPath;
  9345. });
  9346. }
  9347. function _completeToolPath(tool, version, arch) {
  9348. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9349. const markerPath = `${folderPath}.complete`;
  9350. fs.writeFileSync(markerPath, '');
  9351. core.debug('finished caching tool');
  9352. }
  9353. function _isExplicitVersion(versionSpec) {
  9354. const c = semver.clean(versionSpec) || '';
  9355. core.debug(`isExplicit: ${c}`);
  9356. const valid = semver.valid(c) != null;
  9357. core.debug(`explicit? ${valid}`);
  9358. return valid;
  9359. }
  9360. function _evaluateVersions(versions, versionSpec) {
  9361. let version = '';
  9362. core.debug(`evaluating ${versions.length} versions`);
  9363. versions = versions.sort((a, b) => {
  9364. if (semver.gt(a, b)) {
  9365. return 1;
  9366. }
  9367. return -1;
  9368. });
  9369. for (let i = versions.length - 1; i >= 0; i--) {
  9370. const potential = versions[i];
  9371. const satisfied = semver.satisfies(potential, versionSpec);
  9372. if (satisfied) {
  9373. version = potential;
  9374. break;
  9375. }
  9376. }
  9377. if (version) {
  9378. core.debug(`matched: ${version}`);
  9379. }
  9380. else {
  9381. core.debug('match not found');
  9382. }
  9383. return version;
  9384. }
  9385. //# sourceMappingURL=tool-cache.js.map
  9386. /***/ }),
  9387. /***/ 536:
  9388. /***/ (function(module, __unusedexports, __webpack_require__) {
  9389. module.exports = hasFirstPage
  9390. const deprecate = __webpack_require__(370)
  9391. const getPageLinks = __webpack_require__(577)
  9392. function hasFirstPage (link) {
  9393. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9394. return getPageLinks(link).first
  9395. }
  9396. /***/ }),
  9397. /***/ 539:
  9398. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9399. "use strict";
  9400. Object.defineProperty(exports, "__esModule", { value: true });
  9401. const url = __webpack_require__(835);
  9402. const http = __webpack_require__(605);
  9403. const https = __webpack_require__(34);
  9404. const pm = __webpack_require__(950);
  9405. let tunnel;
  9406. var HttpCodes;
  9407. (function (HttpCodes) {
  9408. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9409. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9410. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9411. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9412. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9413. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9414. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9415. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9416. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9417. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9418. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9419. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9420. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9421. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9422. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9423. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9424. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9425. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9426. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9427. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9428. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9429. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9430. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9431. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9432. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9433. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9434. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9435. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9436. var Headers;
  9437. (function (Headers) {
  9438. Headers["Accept"] = "accept";
  9439. Headers["ContentType"] = "content-type";
  9440. })(Headers = exports.Headers || (exports.Headers = {}));
  9441. var MediaTypes;
  9442. (function (MediaTypes) {
  9443. MediaTypes["ApplicationJson"] = "application/json";
  9444. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9445. /**
  9446. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9447. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9448. */
  9449. function getProxyUrl(serverUrl) {
  9450. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9451. return proxyUrl ? proxyUrl.href : '';
  9452. }
  9453. exports.getProxyUrl = getProxyUrl;
  9454. const HttpRedirectCodes = [
  9455. HttpCodes.MovedPermanently,
  9456. HttpCodes.ResourceMoved,
  9457. HttpCodes.SeeOther,
  9458. HttpCodes.TemporaryRedirect,
  9459. HttpCodes.PermanentRedirect
  9460. ];
  9461. const HttpResponseRetryCodes = [
  9462. HttpCodes.BadGateway,
  9463. HttpCodes.ServiceUnavailable,
  9464. HttpCodes.GatewayTimeout
  9465. ];
  9466. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9467. const ExponentialBackoffCeiling = 10;
  9468. const ExponentialBackoffTimeSlice = 5;
  9469. class HttpClientResponse {
  9470. constructor(message) {
  9471. this.message = message;
  9472. }
  9473. readBody() {
  9474. return new Promise(async (resolve, reject) => {
  9475. let output = Buffer.alloc(0);
  9476. this.message.on('data', (chunk) => {
  9477. output = Buffer.concat([output, chunk]);
  9478. });
  9479. this.message.on('end', () => {
  9480. resolve(output.toString());
  9481. });
  9482. });
  9483. }
  9484. }
  9485. exports.HttpClientResponse = HttpClientResponse;
  9486. function isHttps(requestUrl) {
  9487. let parsedUrl = url.parse(requestUrl);
  9488. return parsedUrl.protocol === 'https:';
  9489. }
  9490. exports.isHttps = isHttps;
  9491. class HttpClient {
  9492. constructor(userAgent, handlers, requestOptions) {
  9493. this._ignoreSslError = false;
  9494. this._allowRedirects = true;
  9495. this._allowRedirectDowngrade = false;
  9496. this._maxRedirects = 50;
  9497. this._allowRetries = false;
  9498. this._maxRetries = 1;
  9499. this._keepAlive = false;
  9500. this._disposed = false;
  9501. this.userAgent = userAgent;
  9502. this.handlers = handlers || [];
  9503. this.requestOptions = requestOptions;
  9504. if (requestOptions) {
  9505. if (requestOptions.ignoreSslError != null) {
  9506. this._ignoreSslError = requestOptions.ignoreSslError;
  9507. }
  9508. this._socketTimeout = requestOptions.socketTimeout;
  9509. if (requestOptions.allowRedirects != null) {
  9510. this._allowRedirects = requestOptions.allowRedirects;
  9511. }
  9512. if (requestOptions.allowRedirectDowngrade != null) {
  9513. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9514. }
  9515. if (requestOptions.maxRedirects != null) {
  9516. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9517. }
  9518. if (requestOptions.keepAlive != null) {
  9519. this._keepAlive = requestOptions.keepAlive;
  9520. }
  9521. if (requestOptions.allowRetries != null) {
  9522. this._allowRetries = requestOptions.allowRetries;
  9523. }
  9524. if (requestOptions.maxRetries != null) {
  9525. this._maxRetries = requestOptions.maxRetries;
  9526. }
  9527. }
  9528. }
  9529. options(requestUrl, additionalHeaders) {
  9530. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9531. }
  9532. get(requestUrl, additionalHeaders) {
  9533. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9534. }
  9535. del(requestUrl, additionalHeaders) {
  9536. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9537. }
  9538. post(requestUrl, data, additionalHeaders) {
  9539. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9540. }
  9541. patch(requestUrl, data, additionalHeaders) {
  9542. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9543. }
  9544. put(requestUrl, data, additionalHeaders) {
  9545. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9546. }
  9547. head(requestUrl, additionalHeaders) {
  9548. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9549. }
  9550. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9551. return this.request(verb, requestUrl, stream, additionalHeaders);
  9552. }
  9553. /**
  9554. * Gets a typed object from an endpoint
  9555. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9556. */
  9557. async getJson(requestUrl, additionalHeaders = {}) {
  9558. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9559. let res = await this.get(requestUrl, additionalHeaders);
  9560. return this._processResponse(res, this.requestOptions);
  9561. }
  9562. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9563. let data = JSON.stringify(obj, null, 2);
  9564. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9565. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9566. let res = await this.post(requestUrl, data, additionalHeaders);
  9567. return this._processResponse(res, this.requestOptions);
  9568. }
  9569. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9570. let data = JSON.stringify(obj, null, 2);
  9571. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9572. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9573. let res = await this.put(requestUrl, data, additionalHeaders);
  9574. return this._processResponse(res, this.requestOptions);
  9575. }
  9576. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9577. let data = JSON.stringify(obj, null, 2);
  9578. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9579. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9580. let res = await this.patch(requestUrl, data, additionalHeaders);
  9581. return this._processResponse(res, this.requestOptions);
  9582. }
  9583. /**
  9584. * Makes a raw http request.
  9585. * All other methods such as get, post, patch, and request ultimately call this.
  9586. * Prefer get, del, post and patch
  9587. */
  9588. async request(verb, requestUrl, data, headers) {
  9589. if (this._disposed) {
  9590. throw new Error('Client has already been disposed.');
  9591. }
  9592. let parsedUrl = url.parse(requestUrl);
  9593. let info = this._prepareRequest(verb, parsedUrl, headers);
  9594. // Only perform retries on reads since writes may not be idempotent.
  9595. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9596. ? this._maxRetries + 1
  9597. : 1;
  9598. let numTries = 0;
  9599. let response;
  9600. while (numTries < maxTries) {
  9601. response = await this.requestRaw(info, data);
  9602. // Check if it's an authentication challenge
  9603. if (response &&
  9604. response.message &&
  9605. response.message.statusCode === HttpCodes.Unauthorized) {
  9606. let authenticationHandler;
  9607. for (let i = 0; i < this.handlers.length; i++) {
  9608. if (this.handlers[i].canHandleAuthentication(response)) {
  9609. authenticationHandler = this.handlers[i];
  9610. break;
  9611. }
  9612. }
  9613. if (authenticationHandler) {
  9614. return authenticationHandler.handleAuthentication(this, info, data);
  9615. }
  9616. else {
  9617. // We have received an unauthorized response but have no handlers to handle it.
  9618. // Let the response return to the caller.
  9619. return response;
  9620. }
  9621. }
  9622. let redirectsRemaining = this._maxRedirects;
  9623. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9624. this._allowRedirects &&
  9625. redirectsRemaining > 0) {
  9626. const redirectUrl = response.message.headers['location'];
  9627. if (!redirectUrl) {
  9628. // if there's no location to redirect to, we won't
  9629. break;
  9630. }
  9631. let parsedRedirectUrl = url.parse(redirectUrl);
  9632. if (parsedUrl.protocol == 'https:' &&
  9633. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9634. !this._allowRedirectDowngrade) {
  9635. 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.');
  9636. }
  9637. // we need to finish reading the response before reassigning response
  9638. // which will leak the open socket.
  9639. await response.readBody();
  9640. // strip authorization header if redirected to a different hostname
  9641. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9642. for (let header in headers) {
  9643. // header names are case insensitive
  9644. if (header.toLowerCase() === 'authorization') {
  9645. delete headers[header];
  9646. }
  9647. }
  9648. }
  9649. // let's make the request with the new redirectUrl
  9650. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9651. response = await this.requestRaw(info, data);
  9652. redirectsRemaining--;
  9653. }
  9654. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9655. // If not a retry code, return immediately instead of retrying
  9656. return response;
  9657. }
  9658. numTries += 1;
  9659. if (numTries < maxTries) {
  9660. await response.readBody();
  9661. await this._performExponentialBackoff(numTries);
  9662. }
  9663. }
  9664. return response;
  9665. }
  9666. /**
  9667. * Needs to be called if keepAlive is set to true in request options.
  9668. */
  9669. dispose() {
  9670. if (this._agent) {
  9671. this._agent.destroy();
  9672. }
  9673. this._disposed = true;
  9674. }
  9675. /**
  9676. * Raw request.
  9677. * @param info
  9678. * @param data
  9679. */
  9680. requestRaw(info, data) {
  9681. return new Promise((resolve, reject) => {
  9682. let callbackForResult = function (err, res) {
  9683. if (err) {
  9684. reject(err);
  9685. }
  9686. resolve(res);
  9687. };
  9688. this.requestRawWithCallback(info, data, callbackForResult);
  9689. });
  9690. }
  9691. /**
  9692. * Raw request with callback.
  9693. * @param info
  9694. * @param data
  9695. * @param onResult
  9696. */
  9697. requestRawWithCallback(info, data, onResult) {
  9698. let socket;
  9699. if (typeof data === 'string') {
  9700. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9701. }
  9702. let callbackCalled = false;
  9703. let handleResult = (err, res) => {
  9704. if (!callbackCalled) {
  9705. callbackCalled = true;
  9706. onResult(err, res);
  9707. }
  9708. };
  9709. let req = info.httpModule.request(info.options, (msg) => {
  9710. let res = new HttpClientResponse(msg);
  9711. handleResult(null, res);
  9712. });
  9713. req.on('socket', sock => {
  9714. socket = sock;
  9715. });
  9716. // If we ever get disconnected, we want the socket to timeout eventually
  9717. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9718. if (socket) {
  9719. socket.end();
  9720. }
  9721. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9722. });
  9723. req.on('error', function (err) {
  9724. // err has statusCode property
  9725. // res should have headers
  9726. handleResult(err, null);
  9727. });
  9728. if (data && typeof data === 'string') {
  9729. req.write(data, 'utf8');
  9730. }
  9731. if (data && typeof data !== 'string') {
  9732. data.on('close', function () {
  9733. req.end();
  9734. });
  9735. data.pipe(req);
  9736. }
  9737. else {
  9738. req.end();
  9739. }
  9740. }
  9741. /**
  9742. * Gets an http agent. This function is useful when you need an http agent that handles
  9743. * routing through a proxy server - depending upon the url and proxy environment variables.
  9744. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9745. */
  9746. getAgent(serverUrl) {
  9747. let parsedUrl = url.parse(serverUrl);
  9748. return this._getAgent(parsedUrl);
  9749. }
  9750. _prepareRequest(method, requestUrl, headers) {
  9751. const info = {};
  9752. info.parsedUrl = requestUrl;
  9753. const usingSsl = info.parsedUrl.protocol === 'https:';
  9754. info.httpModule = usingSsl ? https : http;
  9755. const defaultPort = usingSsl ? 443 : 80;
  9756. info.options = {};
  9757. info.options.host = info.parsedUrl.hostname;
  9758. info.options.port = info.parsedUrl.port
  9759. ? parseInt(info.parsedUrl.port)
  9760. : defaultPort;
  9761. info.options.path =
  9762. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9763. info.options.method = method;
  9764. info.options.headers = this._mergeHeaders(headers);
  9765. if (this.userAgent != null) {
  9766. info.options.headers['user-agent'] = this.userAgent;
  9767. }
  9768. info.options.agent = this._getAgent(info.parsedUrl);
  9769. // gives handlers an opportunity to participate
  9770. if (this.handlers) {
  9771. this.handlers.forEach(handler => {
  9772. handler.prepareRequest(info.options);
  9773. });
  9774. }
  9775. return info;
  9776. }
  9777. _mergeHeaders(headers) {
  9778. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9779. if (this.requestOptions && this.requestOptions.headers) {
  9780. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9781. }
  9782. return lowercaseKeys(headers || {});
  9783. }
  9784. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9785. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9786. let clientHeader;
  9787. if (this.requestOptions && this.requestOptions.headers) {
  9788. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9789. }
  9790. return additionalHeaders[header] || clientHeader || _default;
  9791. }
  9792. _getAgent(parsedUrl) {
  9793. let agent;
  9794. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9795. let useProxy = proxyUrl && proxyUrl.hostname;
  9796. if (this._keepAlive && useProxy) {
  9797. agent = this._proxyAgent;
  9798. }
  9799. if (this._keepAlive && !useProxy) {
  9800. agent = this._agent;
  9801. }
  9802. // if agent is already assigned use that agent.
  9803. if (!!agent) {
  9804. return agent;
  9805. }
  9806. const usingSsl = parsedUrl.protocol === 'https:';
  9807. let maxSockets = 100;
  9808. if (!!this.requestOptions) {
  9809. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9810. }
  9811. if (useProxy) {
  9812. // If using proxy, need tunnel
  9813. if (!tunnel) {
  9814. tunnel = __webpack_require__(335);
  9815. }
  9816. const agentOptions = {
  9817. maxSockets: maxSockets,
  9818. keepAlive: this._keepAlive,
  9819. proxy: {
  9820. proxyAuth: proxyUrl.auth,
  9821. host: proxyUrl.hostname,
  9822. port: proxyUrl.port
  9823. }
  9824. };
  9825. let tunnelAgent;
  9826. const overHttps = proxyUrl.protocol === 'https:';
  9827. if (usingSsl) {
  9828. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9829. }
  9830. else {
  9831. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9832. }
  9833. agent = tunnelAgent(agentOptions);
  9834. this._proxyAgent = agent;
  9835. }
  9836. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9837. if (this._keepAlive && !agent) {
  9838. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9839. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9840. this._agent = agent;
  9841. }
  9842. // if not using private agent and tunnel agent isn't setup then use global agent
  9843. if (!agent) {
  9844. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9845. }
  9846. if (usingSsl && this._ignoreSslError) {
  9847. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9848. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9849. // we have to cast it to any and change it directly
  9850. agent.options = Object.assign(agent.options || {}, {
  9851. rejectUnauthorized: false
  9852. });
  9853. }
  9854. return agent;
  9855. }
  9856. _performExponentialBackoff(retryNumber) {
  9857. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9858. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9859. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9860. }
  9861. static dateTimeDeserializer(key, value) {
  9862. if (typeof value === 'string') {
  9863. let a = new Date(value);
  9864. if (!isNaN(a.valueOf())) {
  9865. return a;
  9866. }
  9867. }
  9868. return value;
  9869. }
  9870. async _processResponse(res, options) {
  9871. return new Promise(async (resolve, reject) => {
  9872. const statusCode = res.message.statusCode;
  9873. const response = {
  9874. statusCode: statusCode,
  9875. result: null,
  9876. headers: {}
  9877. };
  9878. // not found leads to null obj returned
  9879. if (statusCode == HttpCodes.NotFound) {
  9880. resolve(response);
  9881. }
  9882. let obj;
  9883. let contents;
  9884. // get the result from the body
  9885. try {
  9886. contents = await res.readBody();
  9887. if (contents && contents.length > 0) {
  9888. if (options && options.deserializeDates) {
  9889. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9890. }
  9891. else {
  9892. obj = JSON.parse(contents);
  9893. }
  9894. response.result = obj;
  9895. }
  9896. response.headers = res.message.headers;
  9897. }
  9898. catch (err) {
  9899. // Invalid resource (contents not json); leaving result obj null
  9900. }
  9901. // note that 3xx redirects are handled by the http layer.
  9902. if (statusCode > 299) {
  9903. let msg;
  9904. // if exception/error in body, attempt to get better error
  9905. if (obj && obj.message) {
  9906. msg = obj.message;
  9907. }
  9908. else if (contents && contents.length > 0) {
  9909. // it may be the case that the exception is in the body message as string
  9910. msg = contents;
  9911. }
  9912. else {
  9913. msg = 'Failed request: (' + statusCode + ')';
  9914. }
  9915. let err = new Error(msg);
  9916. // attach statusCode and body obj (if available) to the error object
  9917. err['statusCode'] = statusCode;
  9918. if (response.result) {
  9919. err['result'] = response.result;
  9920. }
  9921. reject(err);
  9922. }
  9923. else {
  9924. resolve(response);
  9925. }
  9926. });
  9927. }
  9928. }
  9929. exports.HttpClient = HttpClient;
  9930. /***/ }),
  9931. /***/ 550:
  9932. /***/ (function(module, __unusedexports, __webpack_require__) {
  9933. module.exports = getNextPage
  9934. const getPage = __webpack_require__(265)
  9935. function getNextPage (octokit, link, headers) {
  9936. return getPage(octokit, link, 'next', headers)
  9937. }
  9938. /***/ }),
  9939. /***/ 558:
  9940. /***/ (function(module, __unusedexports, __webpack_require__) {
  9941. module.exports = hasPreviousPage
  9942. const deprecate = __webpack_require__(370)
  9943. const getPageLinks = __webpack_require__(577)
  9944. function hasPreviousPage (link) {
  9945. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9946. return getPageLinks(link).prev
  9947. }
  9948. /***/ }),
  9949. /***/ 559:
  9950. /***/ (function(__unusedmodule, exports) {
  9951. "use strict";
  9952. Object.defineProperty(exports, "__esModule", { value: true });
  9953. class GitVersion {
  9954. /**
  9955. * Used for comparing the version of git and git-lfs against the minimum required version
  9956. * @param version the version string, e.g. 1.2 or 1.2.3
  9957. */
  9958. constructor(version) {
  9959. this.major = NaN;
  9960. this.minor = NaN;
  9961. this.patch = NaN;
  9962. if (version) {
  9963. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9964. if (match) {
  9965. this.major = Number(match[1]);
  9966. this.minor = Number(match[2]);
  9967. if (match[4]) {
  9968. this.patch = Number(match[4]);
  9969. }
  9970. }
  9971. }
  9972. }
  9973. /**
  9974. * Compares the instance against a minimum required version
  9975. * @param minimum Minimum version
  9976. */
  9977. checkMinimum(minimum) {
  9978. if (!minimum.isValid()) {
  9979. throw new Error('Arg minimum is not a valid version');
  9980. }
  9981. // Major is insufficient
  9982. if (this.major < minimum.major) {
  9983. return false;
  9984. }
  9985. // Major is equal
  9986. if (this.major === minimum.major) {
  9987. // Minor is insufficient
  9988. if (this.minor < minimum.minor) {
  9989. return false;
  9990. }
  9991. // Minor is equal
  9992. if (this.minor === minimum.minor) {
  9993. // Patch is insufficient
  9994. if (this.patch && this.patch < (minimum.patch || 0)) {
  9995. return false;
  9996. }
  9997. }
  9998. }
  9999. return true;
  10000. }
  10001. /**
  10002. * Indicates whether the instance was constructed from a valid version string
  10003. */
  10004. isValid() {
  10005. return !isNaN(this.major);
  10006. }
  10007. /**
  10008. * Returns the version as a string, e.g. 1.2 or 1.2.3
  10009. */
  10010. toString() {
  10011. let result = '';
  10012. if (this.isValid()) {
  10013. result = `${this.major}.${this.minor}`;
  10014. if (!isNaN(this.patch)) {
  10015. result += `.${this.patch}`;
  10016. }
  10017. }
  10018. return result;
  10019. }
  10020. }
  10021. exports.GitVersion = GitVersion;
  10022. /***/ }),
  10023. /***/ 562:
  10024. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10025. "use strict";
  10026. Object.defineProperty(exports, '__esModule', { value: true });
  10027. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10028. var osName = _interopDefault(__webpack_require__(2));
  10029. function getUserAgent() {
  10030. try {
  10031. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10032. } catch (error) {
  10033. if (/wmic os get Caption/.test(error.message)) {
  10034. return "Windows <version undetectable>";
  10035. }
  10036. return "<environment undetectable>";
  10037. }
  10038. }
  10039. exports.getUserAgent = getUserAgent;
  10040. //# sourceMappingURL=index.js.map
  10041. /***/ }),
  10042. /***/ 563:
  10043. /***/ (function(module, __unusedexports, __webpack_require__) {
  10044. module.exports = getPreviousPage
  10045. const getPage = __webpack_require__(265)
  10046. function getPreviousPage (octokit, link, headers) {
  10047. return getPage(octokit, link, 'prev', headers)
  10048. }
  10049. /***/ }),
  10050. /***/ 568:
  10051. /***/ (function(module, __unusedexports, __webpack_require__) {
  10052. "use strict";
  10053. const path = __webpack_require__(622);
  10054. const niceTry = __webpack_require__(948);
  10055. const resolveCommand = __webpack_require__(489);
  10056. const escape = __webpack_require__(462);
  10057. const readShebang = __webpack_require__(389);
  10058. const semver = __webpack_require__(280);
  10059. const isWin = process.platform === 'win32';
  10060. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10061. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10062. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10063. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10064. function detectShebang(parsed) {
  10065. parsed.file = resolveCommand(parsed);
  10066. const shebang = parsed.file && readShebang(parsed.file);
  10067. if (shebang) {
  10068. parsed.args.unshift(parsed.file);
  10069. parsed.command = shebang;
  10070. return resolveCommand(parsed);
  10071. }
  10072. return parsed.file;
  10073. }
  10074. function parseNonShell(parsed) {
  10075. if (!isWin) {
  10076. return parsed;
  10077. }
  10078. // Detect & add support for shebangs
  10079. const commandFile = detectShebang(parsed);
  10080. // We don't need a shell if the command filename is an executable
  10081. const needsShell = !isExecutableRegExp.test(commandFile);
  10082. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10083. // Note that `forceShell` is an hidden option used only in tests
  10084. if (parsed.options.forceShell || needsShell) {
  10085. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10086. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10087. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10088. // we need to double escape them
  10089. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10090. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10091. // This is necessary otherwise it will always fail with ENOENT in those cases
  10092. parsed.command = path.normalize(parsed.command);
  10093. // Escape command & arguments
  10094. parsed.command = escape.command(parsed.command);
  10095. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10096. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10097. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10098. parsed.command = process.env.comspec || 'cmd.exe';
  10099. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10100. }
  10101. return parsed;
  10102. }
  10103. function parseShell(parsed) {
  10104. // If node supports the shell option, there's no need to mimic its behavior
  10105. if (supportsShellOption) {
  10106. return parsed;
  10107. }
  10108. // Mimic node shell option
  10109. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10110. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10111. if (isWin) {
  10112. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10113. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10114. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10115. } else {
  10116. if (typeof parsed.options.shell === 'string') {
  10117. parsed.command = parsed.options.shell;
  10118. } else if (process.platform === 'android') {
  10119. parsed.command = '/system/bin/sh';
  10120. } else {
  10121. parsed.command = '/bin/sh';
  10122. }
  10123. parsed.args = ['-c', shellCommand];
  10124. }
  10125. return parsed;
  10126. }
  10127. function parse(command, args, options) {
  10128. // Normalize arguments, similar to nodejs
  10129. if (args && !Array.isArray(args)) {
  10130. options = args;
  10131. args = null;
  10132. }
  10133. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10134. options = Object.assign({}, options); // Clone object to avoid changing the original
  10135. // Build our parsed object
  10136. const parsed = {
  10137. command,
  10138. args,
  10139. options,
  10140. file: undefined,
  10141. original: {
  10142. command,
  10143. args,
  10144. },
  10145. };
  10146. // Delegate further parsing to shell or non-shell
  10147. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10148. }
  10149. module.exports = parse;
  10150. /***/ }),
  10151. /***/ 577:
  10152. /***/ (function(module) {
  10153. module.exports = getPageLinks
  10154. function getPageLinks (link) {
  10155. link = link.link || link.headers.link || ''
  10156. const links = {}
  10157. // link format:
  10158. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10159. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10160. links[type] = uri
  10161. })
  10162. return links
  10163. }
  10164. /***/ }),
  10165. /***/ 587:
  10166. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10167. "use strict";
  10168. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10169. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10170. return new (P || (P = Promise))(function (resolve, reject) {
  10171. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10172. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10173. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10174. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10175. });
  10176. };
  10177. var __importStar = (this && this.__importStar) || function (mod) {
  10178. if (mod && mod.__esModule) return mod;
  10179. var result = {};
  10180. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10181. result["default"] = mod;
  10182. return result;
  10183. };
  10184. Object.defineProperty(exports, "__esModule", { value: true });
  10185. const core = __importStar(__webpack_require__(470));
  10186. const defaultMaxAttempts = 3;
  10187. const defaultMinSeconds = 10;
  10188. const defaultMaxSeconds = 20;
  10189. class RetryHelper {
  10190. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10191. this.maxAttempts = maxAttempts;
  10192. this.minSeconds = Math.floor(minSeconds);
  10193. this.maxSeconds = Math.floor(maxSeconds);
  10194. if (this.minSeconds > this.maxSeconds) {
  10195. throw new Error('min seconds should be less than or equal to max seconds');
  10196. }
  10197. }
  10198. execute(action) {
  10199. return __awaiter(this, void 0, void 0, function* () {
  10200. let attempt = 1;
  10201. while (attempt < this.maxAttempts) {
  10202. // Try
  10203. try {
  10204. return yield action();
  10205. }
  10206. catch (err) {
  10207. core.info(err.message);
  10208. }
  10209. // Sleep
  10210. const seconds = this.getSleepAmount();
  10211. core.info(`Waiting ${seconds} seconds before trying again`);
  10212. yield this.sleep(seconds);
  10213. attempt++;
  10214. }
  10215. // Last attempt
  10216. return yield action();
  10217. });
  10218. }
  10219. getSleepAmount() {
  10220. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10221. this.minSeconds);
  10222. }
  10223. sleep(seconds) {
  10224. return __awaiter(this, void 0, void 0, function* () {
  10225. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10226. });
  10227. }
  10228. }
  10229. exports.RetryHelper = RetryHelper;
  10230. function execute(action) {
  10231. return __awaiter(this, void 0, void 0, function* () {
  10232. const retryHelper = new RetryHelper();
  10233. return yield retryHelper.execute(action);
  10234. });
  10235. }
  10236. exports.execute = execute;
  10237. /***/ }),
  10238. /***/ 605:
  10239. /***/ (function(module) {
  10240. module.exports = require("http");
  10241. /***/ }),
  10242. /***/ 614:
  10243. /***/ (function(module) {
  10244. module.exports = require("events");
  10245. /***/ }),
  10246. /***/ 618:
  10247. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10248. "use strict";
  10249. var __importStar = (this && this.__importStar) || function (mod) {
  10250. if (mod && mod.__esModule) return mod;
  10251. var result = {};
  10252. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10253. result["default"] = mod;
  10254. return result;
  10255. };
  10256. Object.defineProperty(exports, "__esModule", { value: true });
  10257. const fs = __importStar(__webpack_require__(747));
  10258. function directoryExistsSync(path, required) {
  10259. if (!path) {
  10260. throw new Error("Arg 'path' must not be empty");
  10261. }
  10262. let stats;
  10263. try {
  10264. stats = fs.statSync(path);
  10265. }
  10266. catch (error) {
  10267. if (error.code === 'ENOENT') {
  10268. if (!required) {
  10269. return false;
  10270. }
  10271. throw new Error(`Directory '${path}' does not exist`);
  10272. }
  10273. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10274. }
  10275. if (stats.isDirectory()) {
  10276. return true;
  10277. }
  10278. else if (!required) {
  10279. return false;
  10280. }
  10281. throw new Error(`Directory '${path}' does not exist`);
  10282. }
  10283. exports.directoryExistsSync = directoryExistsSync;
  10284. function existsSync(path) {
  10285. if (!path) {
  10286. throw new Error("Arg 'path' must not be empty");
  10287. }
  10288. try {
  10289. fs.statSync(path);
  10290. }
  10291. catch (error) {
  10292. if (error.code === 'ENOENT') {
  10293. return false;
  10294. }
  10295. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10296. }
  10297. return true;
  10298. }
  10299. exports.existsSync = existsSync;
  10300. function fileExistsSync(path) {
  10301. if (!path) {
  10302. throw new Error("Arg 'path' must not be empty");
  10303. }
  10304. let stats;
  10305. try {
  10306. stats = fs.statSync(path);
  10307. }
  10308. catch (error) {
  10309. if (error.code === 'ENOENT') {
  10310. return false;
  10311. }
  10312. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10313. }
  10314. if (!stats.isDirectory()) {
  10315. return true;
  10316. }
  10317. return false;
  10318. }
  10319. exports.fileExistsSync = fileExistsSync;
  10320. /***/ }),
  10321. /***/ 621:
  10322. /***/ (function(module, __unusedexports, __webpack_require__) {
  10323. "use strict";
  10324. const path = __webpack_require__(622);
  10325. const pathKey = __webpack_require__(39);
  10326. module.exports = opts => {
  10327. opts = Object.assign({
  10328. cwd: process.cwd(),
  10329. path: process.env[pathKey()]
  10330. }, opts);
  10331. let prev;
  10332. let pth = path.resolve(opts.cwd);
  10333. const ret = [];
  10334. while (prev !== pth) {
  10335. ret.push(path.join(pth, 'node_modules/.bin'));
  10336. prev = pth;
  10337. pth = path.resolve(pth, '..');
  10338. }
  10339. // ensure the running `node` binary is used
  10340. ret.push(path.dirname(process.execPath));
  10341. return ret.concat(opts.path).join(path.delimiter);
  10342. };
  10343. module.exports.env = opts => {
  10344. opts = Object.assign({
  10345. env: process.env
  10346. }, opts);
  10347. const env = Object.assign({}, opts.env);
  10348. const path = pathKey({env});
  10349. opts.path = env[path];
  10350. env[path] = module.exports(opts);
  10351. return env;
  10352. };
  10353. /***/ }),
  10354. /***/ 622:
  10355. /***/ (function(module) {
  10356. module.exports = require("path");
  10357. /***/ }),
  10358. /***/ 631:
  10359. /***/ (function(module) {
  10360. module.exports = require("net");
  10361. /***/ }),
  10362. /***/ 649:
  10363. /***/ (function(module, __unusedexports, __webpack_require__) {
  10364. module.exports = getLastPage
  10365. const getPage = __webpack_require__(265)
  10366. function getLastPage (octokit, link, headers) {
  10367. return getPage(octokit, link, 'last', headers)
  10368. }
  10369. /***/ }),
  10370. /***/ 654:
  10371. /***/ (function(module) {
  10372. // This is not the set of all possible signals.
  10373. //
  10374. // It IS, however, the set of all signals that trigger
  10375. // an exit on either Linux or BSD systems. Linux is a
  10376. // superset of the signal names supported on BSD, and
  10377. // the unknown signals just fail to register, so we can
  10378. // catch that easily enough.
  10379. //
  10380. // Don't bother with SIGKILL. It's uncatchable, which
  10381. // means that we can't fire any callbacks anyway.
  10382. //
  10383. // If a user does happen to register a handler on a non-
  10384. // fatal signal like SIGWINCH or something, and then
  10385. // exit, it'll end up firing `process.emit('exit')`, so
  10386. // the handler will be fired anyway.
  10387. //
  10388. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10389. // artificially, inherently leave the process in a
  10390. // state from which it is not safe to try and enter JS
  10391. // listeners.
  10392. module.exports = [
  10393. 'SIGABRT',
  10394. 'SIGALRM',
  10395. 'SIGHUP',
  10396. 'SIGINT',
  10397. 'SIGTERM'
  10398. ]
  10399. if (process.platform !== 'win32') {
  10400. module.exports.push(
  10401. 'SIGVTALRM',
  10402. 'SIGXCPU',
  10403. 'SIGXFSZ',
  10404. 'SIGUSR2',
  10405. 'SIGTRAP',
  10406. 'SIGSYS',
  10407. 'SIGQUIT',
  10408. 'SIGIOT'
  10409. // should detect profiler and enable/disable accordingly.
  10410. // see #21
  10411. // 'SIGPROF'
  10412. )
  10413. }
  10414. if (process.platform === 'linux') {
  10415. module.exports.push(
  10416. 'SIGIO',
  10417. 'SIGPOLL',
  10418. 'SIGPWR',
  10419. 'SIGSTKFLT',
  10420. 'SIGUNUSED'
  10421. )
  10422. }
  10423. /***/ }),
  10424. /***/ 656:
  10425. /***/ (function(module, exports) {
  10426. exports = module.exports = SemVer
  10427. var debug
  10428. /* istanbul ignore next */
  10429. if (typeof process === 'object' &&
  10430. process.env &&
  10431. process.env.NODE_DEBUG &&
  10432. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10433. debug = function () {
  10434. var args = Array.prototype.slice.call(arguments, 0)
  10435. args.unshift('SEMVER')
  10436. console.log.apply(console, args)
  10437. }
  10438. } else {
  10439. debug = function () {}
  10440. }
  10441. // Note: this is the semver.org version of the spec that it implements
  10442. // Not necessarily the package version of this code.
  10443. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10444. var MAX_LENGTH = 256
  10445. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10446. /* istanbul ignore next */ 9007199254740991
  10447. // Max safe segment length for coercion.
  10448. var MAX_SAFE_COMPONENT_LENGTH = 16
  10449. // The actual regexps go on exports.re
  10450. var re = exports.re = []
  10451. var src = exports.src = []
  10452. var t = exports.tokens = {}
  10453. var R = 0
  10454. function tok (n) {
  10455. t[n] = R++
  10456. }
  10457. // The following Regular Expressions can be used for tokenizing,
  10458. // validating, and parsing SemVer version strings.
  10459. // ## Numeric Identifier
  10460. // A single `0`, or a non-zero digit followed by zero or more digits.
  10461. tok('NUMERICIDENTIFIER')
  10462. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10463. tok('NUMERICIDENTIFIERLOOSE')
  10464. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10465. // ## Non-numeric Identifier
  10466. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10467. // more letters, digits, or hyphens.
  10468. tok('NONNUMERICIDENTIFIER')
  10469. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10470. // ## Main Version
  10471. // Three dot-separated numeric identifiers.
  10472. tok('MAINVERSION')
  10473. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10474. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10475. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10476. tok('MAINVERSIONLOOSE')
  10477. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10478. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10479. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10480. // ## Pre-release Version Identifier
  10481. // A numeric identifier, or a non-numeric identifier.
  10482. tok('PRERELEASEIDENTIFIER')
  10483. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10484. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10485. tok('PRERELEASEIDENTIFIERLOOSE')
  10486. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10487. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10488. // ## Pre-release Version
  10489. // Hyphen, followed by one or more dot-separated pre-release version
  10490. // identifiers.
  10491. tok('PRERELEASE')
  10492. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10493. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10494. tok('PRERELEASELOOSE')
  10495. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10496. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10497. // ## Build Metadata Identifier
  10498. // Any combination of digits, letters, or hyphens.
  10499. tok('BUILDIDENTIFIER')
  10500. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10501. // ## Build Metadata
  10502. // Plus sign, followed by one or more period-separated build metadata
  10503. // identifiers.
  10504. tok('BUILD')
  10505. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10506. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10507. // ## Full Version String
  10508. // A main version, followed optionally by a pre-release version and
  10509. // build metadata.
  10510. // Note that the only major, minor, patch, and pre-release sections of
  10511. // the version string are capturing groups. The build metadata is not a
  10512. // capturing group, because it should not ever be used in version
  10513. // comparison.
  10514. tok('FULL')
  10515. tok('FULLPLAIN')
  10516. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10517. src[t.PRERELEASE] + '?' +
  10518. src[t.BUILD] + '?'
  10519. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10520. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10521. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10522. // common in the npm registry.
  10523. tok('LOOSEPLAIN')
  10524. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10525. src[t.PRERELEASELOOSE] + '?' +
  10526. src[t.BUILD] + '?'
  10527. tok('LOOSE')
  10528. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10529. tok('GTLT')
  10530. src[t.GTLT] = '((?:<|>)?=?)'
  10531. // Something like "2.*" or "1.2.x".
  10532. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10533. // Only the first item is strictly required.
  10534. tok('XRANGEIDENTIFIERLOOSE')
  10535. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10536. tok('XRANGEIDENTIFIER')
  10537. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10538. tok('XRANGEPLAIN')
  10539. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10540. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10541. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10542. '(?:' + src[t.PRERELEASE] + ')?' +
  10543. src[t.BUILD] + '?' +
  10544. ')?)?'
  10545. tok('XRANGEPLAINLOOSE')
  10546. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10547. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10548. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10549. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10550. src[t.BUILD] + '?' +
  10551. ')?)?'
  10552. tok('XRANGE')
  10553. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10554. tok('XRANGELOOSE')
  10555. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10556. // Coercion.
  10557. // Extract anything that could conceivably be a part of a valid semver
  10558. tok('COERCE')
  10559. src[t.COERCE] = '(^|[^\\d])' +
  10560. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10561. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10562. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10563. '(?:$|[^\\d])'
  10564. tok('COERCERTL')
  10565. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10566. // Tilde ranges.
  10567. // Meaning is "reasonably at or greater than"
  10568. tok('LONETILDE')
  10569. src[t.LONETILDE] = '(?:~>?)'
  10570. tok('TILDETRIM')
  10571. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10572. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10573. var tildeTrimReplace = '$1~'
  10574. tok('TILDE')
  10575. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10576. tok('TILDELOOSE')
  10577. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10578. // Caret ranges.
  10579. // Meaning is "at least and backwards compatible with"
  10580. tok('LONECARET')
  10581. src[t.LONECARET] = '(?:\\^)'
  10582. tok('CARETTRIM')
  10583. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10584. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10585. var caretTrimReplace = '$1^'
  10586. tok('CARET')
  10587. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10588. tok('CARETLOOSE')
  10589. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10590. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10591. tok('COMPARATORLOOSE')
  10592. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10593. tok('COMPARATOR')
  10594. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10595. // An expression to strip any whitespace between the gtlt and the thing
  10596. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10597. tok('COMPARATORTRIM')
  10598. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10599. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10600. // this one has to use the /g flag
  10601. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10602. var comparatorTrimReplace = '$1$2$3'
  10603. // Something like `1.2.3 - 1.2.4`
  10604. // Note that these all use the loose form, because they'll be
  10605. // checked against either the strict or loose comparator form
  10606. // later.
  10607. tok('HYPHENRANGE')
  10608. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10609. '\\s+-\\s+' +
  10610. '(' + src[t.XRANGEPLAIN] + ')' +
  10611. '\\s*$'
  10612. tok('HYPHENRANGELOOSE')
  10613. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10614. '\\s+-\\s+' +
  10615. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10616. '\\s*$'
  10617. // Star ranges basically just allow anything at all.
  10618. tok('STAR')
  10619. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10620. // Compile to actual regexp objects.
  10621. // All are flag-free, unless they were created above with a flag.
  10622. for (var i = 0; i < R; i++) {
  10623. debug(i, src[i])
  10624. if (!re[i]) {
  10625. re[i] = new RegExp(src[i])
  10626. }
  10627. }
  10628. exports.parse = parse
  10629. function parse (version, options) {
  10630. if (!options || typeof options !== 'object') {
  10631. options = {
  10632. loose: !!options,
  10633. includePrerelease: false
  10634. }
  10635. }
  10636. if (version instanceof SemVer) {
  10637. return version
  10638. }
  10639. if (typeof version !== 'string') {
  10640. return null
  10641. }
  10642. if (version.length > MAX_LENGTH) {
  10643. return null
  10644. }
  10645. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10646. if (!r.test(version)) {
  10647. return null
  10648. }
  10649. try {
  10650. return new SemVer(version, options)
  10651. } catch (er) {
  10652. return null
  10653. }
  10654. }
  10655. exports.valid = valid
  10656. function valid (version, options) {
  10657. var v = parse(version, options)
  10658. return v ? v.version : null
  10659. }
  10660. exports.clean = clean
  10661. function clean (version, options) {
  10662. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10663. return s ? s.version : null
  10664. }
  10665. exports.SemVer = SemVer
  10666. function SemVer (version, options) {
  10667. if (!options || typeof options !== 'object') {
  10668. options = {
  10669. loose: !!options,
  10670. includePrerelease: false
  10671. }
  10672. }
  10673. if (version instanceof SemVer) {
  10674. if (version.loose === options.loose) {
  10675. return version
  10676. } else {
  10677. version = version.version
  10678. }
  10679. } else if (typeof version !== 'string') {
  10680. throw new TypeError('Invalid Version: ' + version)
  10681. }
  10682. if (version.length > MAX_LENGTH) {
  10683. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10684. }
  10685. if (!(this instanceof SemVer)) {
  10686. return new SemVer(version, options)
  10687. }
  10688. debug('SemVer', version, options)
  10689. this.options = options
  10690. this.loose = !!options.loose
  10691. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10692. if (!m) {
  10693. throw new TypeError('Invalid Version: ' + version)
  10694. }
  10695. this.raw = version
  10696. // these are actually numbers
  10697. this.major = +m[1]
  10698. this.minor = +m[2]
  10699. this.patch = +m[3]
  10700. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10701. throw new TypeError('Invalid major version')
  10702. }
  10703. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10704. throw new TypeError('Invalid minor version')
  10705. }
  10706. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10707. throw new TypeError('Invalid patch version')
  10708. }
  10709. // numberify any prerelease numeric ids
  10710. if (!m[4]) {
  10711. this.prerelease = []
  10712. } else {
  10713. this.prerelease = m[4].split('.').map(function (id) {
  10714. if (/^[0-9]+$/.test(id)) {
  10715. var num = +id
  10716. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10717. return num
  10718. }
  10719. }
  10720. return id
  10721. })
  10722. }
  10723. this.build = m[5] ? m[5].split('.') : []
  10724. this.format()
  10725. }
  10726. SemVer.prototype.format = function () {
  10727. this.version = this.major + '.' + this.minor + '.' + this.patch
  10728. if (this.prerelease.length) {
  10729. this.version += '-' + this.prerelease.join('.')
  10730. }
  10731. return this.version
  10732. }
  10733. SemVer.prototype.toString = function () {
  10734. return this.version
  10735. }
  10736. SemVer.prototype.compare = function (other) {
  10737. debug('SemVer.compare', this.version, this.options, other)
  10738. if (!(other instanceof SemVer)) {
  10739. other = new SemVer(other, this.options)
  10740. }
  10741. return this.compareMain(other) || this.comparePre(other)
  10742. }
  10743. SemVer.prototype.compareMain = function (other) {
  10744. if (!(other instanceof SemVer)) {
  10745. other = new SemVer(other, this.options)
  10746. }
  10747. return compareIdentifiers(this.major, other.major) ||
  10748. compareIdentifiers(this.minor, other.minor) ||
  10749. compareIdentifiers(this.patch, other.patch)
  10750. }
  10751. SemVer.prototype.comparePre = function (other) {
  10752. if (!(other instanceof SemVer)) {
  10753. other = new SemVer(other, this.options)
  10754. }
  10755. // NOT having a prerelease is > having one
  10756. if (this.prerelease.length && !other.prerelease.length) {
  10757. return -1
  10758. } else if (!this.prerelease.length && other.prerelease.length) {
  10759. return 1
  10760. } else if (!this.prerelease.length && !other.prerelease.length) {
  10761. return 0
  10762. }
  10763. var i = 0
  10764. do {
  10765. var a = this.prerelease[i]
  10766. var b = other.prerelease[i]
  10767. debug('prerelease compare', i, a, b)
  10768. if (a === undefined && b === undefined) {
  10769. return 0
  10770. } else if (b === undefined) {
  10771. return 1
  10772. } else if (a === undefined) {
  10773. return -1
  10774. } else if (a === b) {
  10775. continue
  10776. } else {
  10777. return compareIdentifiers(a, b)
  10778. }
  10779. } while (++i)
  10780. }
  10781. SemVer.prototype.compareBuild = function (other) {
  10782. if (!(other instanceof SemVer)) {
  10783. other = new SemVer(other, this.options)
  10784. }
  10785. var i = 0
  10786. do {
  10787. var a = this.build[i]
  10788. var b = other.build[i]
  10789. debug('prerelease compare', i, a, b)
  10790. if (a === undefined && b === undefined) {
  10791. return 0
  10792. } else if (b === undefined) {
  10793. return 1
  10794. } else if (a === undefined) {
  10795. return -1
  10796. } else if (a === b) {
  10797. continue
  10798. } else {
  10799. return compareIdentifiers(a, b)
  10800. }
  10801. } while (++i)
  10802. }
  10803. // preminor will bump the version up to the next minor release, and immediately
  10804. // down to pre-release. premajor and prepatch work the same way.
  10805. SemVer.prototype.inc = function (release, identifier) {
  10806. switch (release) {
  10807. case 'premajor':
  10808. this.prerelease.length = 0
  10809. this.patch = 0
  10810. this.minor = 0
  10811. this.major++
  10812. this.inc('pre', identifier)
  10813. break
  10814. case 'preminor':
  10815. this.prerelease.length = 0
  10816. this.patch = 0
  10817. this.minor++
  10818. this.inc('pre', identifier)
  10819. break
  10820. case 'prepatch':
  10821. // If this is already a prerelease, it will bump to the next version
  10822. // drop any prereleases that might already exist, since they are not
  10823. // relevant at this point.
  10824. this.prerelease.length = 0
  10825. this.inc('patch', identifier)
  10826. this.inc('pre', identifier)
  10827. break
  10828. // If the input is a non-prerelease version, this acts the same as
  10829. // prepatch.
  10830. case 'prerelease':
  10831. if (this.prerelease.length === 0) {
  10832. this.inc('patch', identifier)
  10833. }
  10834. this.inc('pre', identifier)
  10835. break
  10836. case 'major':
  10837. // If this is a pre-major version, bump up to the same major version.
  10838. // Otherwise increment major.
  10839. // 1.0.0-5 bumps to 1.0.0
  10840. // 1.1.0 bumps to 2.0.0
  10841. if (this.minor !== 0 ||
  10842. this.patch !== 0 ||
  10843. this.prerelease.length === 0) {
  10844. this.major++
  10845. }
  10846. this.minor = 0
  10847. this.patch = 0
  10848. this.prerelease = []
  10849. break
  10850. case 'minor':
  10851. // If this is a pre-minor version, bump up to the same minor version.
  10852. // Otherwise increment minor.
  10853. // 1.2.0-5 bumps to 1.2.0
  10854. // 1.2.1 bumps to 1.3.0
  10855. if (this.patch !== 0 || this.prerelease.length === 0) {
  10856. this.minor++
  10857. }
  10858. this.patch = 0
  10859. this.prerelease = []
  10860. break
  10861. case 'patch':
  10862. // If this is not a pre-release version, it will increment the patch.
  10863. // If it is a pre-release it will bump up to the same patch version.
  10864. // 1.2.0-5 patches to 1.2.0
  10865. // 1.2.0 patches to 1.2.1
  10866. if (this.prerelease.length === 0) {
  10867. this.patch++
  10868. }
  10869. this.prerelease = []
  10870. break
  10871. // This probably shouldn't be used publicly.
  10872. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10873. case 'pre':
  10874. if (this.prerelease.length === 0) {
  10875. this.prerelease = [0]
  10876. } else {
  10877. var i = this.prerelease.length
  10878. while (--i >= 0) {
  10879. if (typeof this.prerelease[i] === 'number') {
  10880. this.prerelease[i]++
  10881. i = -2
  10882. }
  10883. }
  10884. if (i === -1) {
  10885. // didn't increment anything
  10886. this.prerelease.push(0)
  10887. }
  10888. }
  10889. if (identifier) {
  10890. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10891. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10892. if (this.prerelease[0] === identifier) {
  10893. if (isNaN(this.prerelease[1])) {
  10894. this.prerelease = [identifier, 0]
  10895. }
  10896. } else {
  10897. this.prerelease = [identifier, 0]
  10898. }
  10899. }
  10900. break
  10901. default:
  10902. throw new Error('invalid increment argument: ' + release)
  10903. }
  10904. this.format()
  10905. this.raw = this.version
  10906. return this
  10907. }
  10908. exports.inc = inc
  10909. function inc (version, release, loose, identifier) {
  10910. if (typeof (loose) === 'string') {
  10911. identifier = loose
  10912. loose = undefined
  10913. }
  10914. try {
  10915. return new SemVer(version, loose).inc(release, identifier).version
  10916. } catch (er) {
  10917. return null
  10918. }
  10919. }
  10920. exports.diff = diff
  10921. function diff (version1, version2) {
  10922. if (eq(version1, version2)) {
  10923. return null
  10924. } else {
  10925. var v1 = parse(version1)
  10926. var v2 = parse(version2)
  10927. var prefix = ''
  10928. if (v1.prerelease.length || v2.prerelease.length) {
  10929. prefix = 'pre'
  10930. var defaultResult = 'prerelease'
  10931. }
  10932. for (var key in v1) {
  10933. if (key === 'major' || key === 'minor' || key === 'patch') {
  10934. if (v1[key] !== v2[key]) {
  10935. return prefix + key
  10936. }
  10937. }
  10938. }
  10939. return defaultResult // may be undefined
  10940. }
  10941. }
  10942. exports.compareIdentifiers = compareIdentifiers
  10943. var numeric = /^[0-9]+$/
  10944. function compareIdentifiers (a, b) {
  10945. var anum = numeric.test(a)
  10946. var bnum = numeric.test(b)
  10947. if (anum && bnum) {
  10948. a = +a
  10949. b = +b
  10950. }
  10951. return a === b ? 0
  10952. : (anum && !bnum) ? -1
  10953. : (bnum && !anum) ? 1
  10954. : a < b ? -1
  10955. : 1
  10956. }
  10957. exports.rcompareIdentifiers = rcompareIdentifiers
  10958. function rcompareIdentifiers (a, b) {
  10959. return compareIdentifiers(b, a)
  10960. }
  10961. exports.major = major
  10962. function major (a, loose) {
  10963. return new SemVer(a, loose).major
  10964. }
  10965. exports.minor = minor
  10966. function minor (a, loose) {
  10967. return new SemVer(a, loose).minor
  10968. }
  10969. exports.patch = patch
  10970. function patch (a, loose) {
  10971. return new SemVer(a, loose).patch
  10972. }
  10973. exports.compare = compare
  10974. function compare (a, b, loose) {
  10975. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10976. }
  10977. exports.compareLoose = compareLoose
  10978. function compareLoose (a, b) {
  10979. return compare(a, b, true)
  10980. }
  10981. exports.compareBuild = compareBuild
  10982. function compareBuild (a, b, loose) {
  10983. var versionA = new SemVer(a, loose)
  10984. var versionB = new SemVer(b, loose)
  10985. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10986. }
  10987. exports.rcompare = rcompare
  10988. function rcompare (a, b, loose) {
  10989. return compare(b, a, loose)
  10990. }
  10991. exports.sort = sort
  10992. function sort (list, loose) {
  10993. return list.sort(function (a, b) {
  10994. return exports.compareBuild(a, b, loose)
  10995. })
  10996. }
  10997. exports.rsort = rsort
  10998. function rsort (list, loose) {
  10999. return list.sort(function (a, b) {
  11000. return exports.compareBuild(b, a, loose)
  11001. })
  11002. }
  11003. exports.gt = gt
  11004. function gt (a, b, loose) {
  11005. return compare(a, b, loose) > 0
  11006. }
  11007. exports.lt = lt
  11008. function lt (a, b, loose) {
  11009. return compare(a, b, loose) < 0
  11010. }
  11011. exports.eq = eq
  11012. function eq (a, b, loose) {
  11013. return compare(a, b, loose) === 0
  11014. }
  11015. exports.neq = neq
  11016. function neq (a, b, loose) {
  11017. return compare(a, b, loose) !== 0
  11018. }
  11019. exports.gte = gte
  11020. function gte (a, b, loose) {
  11021. return compare(a, b, loose) >= 0
  11022. }
  11023. exports.lte = lte
  11024. function lte (a, b, loose) {
  11025. return compare(a, b, loose) <= 0
  11026. }
  11027. exports.cmp = cmp
  11028. function cmp (a, op, b, loose) {
  11029. switch (op) {
  11030. case '===':
  11031. if (typeof a === 'object')
  11032. a = a.version
  11033. if (typeof b === 'object')
  11034. b = b.version
  11035. return a === b
  11036. case '!==':
  11037. if (typeof a === 'object')
  11038. a = a.version
  11039. if (typeof b === 'object')
  11040. b = b.version
  11041. return a !== b
  11042. case '':
  11043. case '=':
  11044. case '==':
  11045. return eq(a, b, loose)
  11046. case '!=':
  11047. return neq(a, b, loose)
  11048. case '>':
  11049. return gt(a, b, loose)
  11050. case '>=':
  11051. return gte(a, b, loose)
  11052. case '<':
  11053. return lt(a, b, loose)
  11054. case '<=':
  11055. return lte(a, b, loose)
  11056. default:
  11057. throw new TypeError('Invalid operator: ' + op)
  11058. }
  11059. }
  11060. exports.Comparator = Comparator
  11061. function Comparator (comp, options) {
  11062. if (!options || typeof options !== 'object') {
  11063. options = {
  11064. loose: !!options,
  11065. includePrerelease: false
  11066. }
  11067. }
  11068. if (comp instanceof Comparator) {
  11069. if (comp.loose === !!options.loose) {
  11070. return comp
  11071. } else {
  11072. comp = comp.value
  11073. }
  11074. }
  11075. if (!(this instanceof Comparator)) {
  11076. return new Comparator(comp, options)
  11077. }
  11078. debug('comparator', comp, options)
  11079. this.options = options
  11080. this.loose = !!options.loose
  11081. this.parse(comp)
  11082. if (this.semver === ANY) {
  11083. this.value = ''
  11084. } else {
  11085. this.value = this.operator + this.semver.version
  11086. }
  11087. debug('comp', this)
  11088. }
  11089. var ANY = {}
  11090. Comparator.prototype.parse = function (comp) {
  11091. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11092. var m = comp.match(r)
  11093. if (!m) {
  11094. throw new TypeError('Invalid comparator: ' + comp)
  11095. }
  11096. this.operator = m[1] !== undefined ? m[1] : ''
  11097. if (this.operator === '=') {
  11098. this.operator = ''
  11099. }
  11100. // if it literally is just '>' or '' then allow anything.
  11101. if (!m[2]) {
  11102. this.semver = ANY
  11103. } else {
  11104. this.semver = new SemVer(m[2], this.options.loose)
  11105. }
  11106. }
  11107. Comparator.prototype.toString = function () {
  11108. return this.value
  11109. }
  11110. Comparator.prototype.test = function (version) {
  11111. debug('Comparator.test', version, this.options.loose)
  11112. if (this.semver === ANY || version === ANY) {
  11113. return true
  11114. }
  11115. if (typeof version === 'string') {
  11116. try {
  11117. version = new SemVer(version, this.options)
  11118. } catch (er) {
  11119. return false
  11120. }
  11121. }
  11122. return cmp(version, this.operator, this.semver, this.options)
  11123. }
  11124. Comparator.prototype.intersects = function (comp, options) {
  11125. if (!(comp instanceof Comparator)) {
  11126. throw new TypeError('a Comparator is required')
  11127. }
  11128. if (!options || typeof options !== 'object') {
  11129. options = {
  11130. loose: !!options,
  11131. includePrerelease: false
  11132. }
  11133. }
  11134. var rangeTmp
  11135. if (this.operator === '') {
  11136. if (this.value === '') {
  11137. return true
  11138. }
  11139. rangeTmp = new Range(comp.value, options)
  11140. return satisfies(this.value, rangeTmp, options)
  11141. } else if (comp.operator === '') {
  11142. if (comp.value === '') {
  11143. return true
  11144. }
  11145. rangeTmp = new Range(this.value, options)
  11146. return satisfies(comp.semver, rangeTmp, options)
  11147. }
  11148. var sameDirectionIncreasing =
  11149. (this.operator === '>=' || this.operator === '>') &&
  11150. (comp.operator === '>=' || comp.operator === '>')
  11151. var sameDirectionDecreasing =
  11152. (this.operator === '<=' || this.operator === '<') &&
  11153. (comp.operator === '<=' || comp.operator === '<')
  11154. var sameSemVer = this.semver.version === comp.semver.version
  11155. var differentDirectionsInclusive =
  11156. (this.operator === '>=' || this.operator === '<=') &&
  11157. (comp.operator === '>=' || comp.operator === '<=')
  11158. var oppositeDirectionsLessThan =
  11159. cmp(this.semver, '<', comp.semver, options) &&
  11160. ((this.operator === '>=' || this.operator === '>') &&
  11161. (comp.operator === '<=' || comp.operator === '<'))
  11162. var oppositeDirectionsGreaterThan =
  11163. cmp(this.semver, '>', comp.semver, options) &&
  11164. ((this.operator === '<=' || this.operator === '<') &&
  11165. (comp.operator === '>=' || comp.operator === '>'))
  11166. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11167. (sameSemVer && differentDirectionsInclusive) ||
  11168. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11169. }
  11170. exports.Range = Range
  11171. function Range (range, options) {
  11172. if (!options || typeof options !== 'object') {
  11173. options = {
  11174. loose: !!options,
  11175. includePrerelease: false
  11176. }
  11177. }
  11178. if (range instanceof Range) {
  11179. if (range.loose === !!options.loose &&
  11180. range.includePrerelease === !!options.includePrerelease) {
  11181. return range
  11182. } else {
  11183. return new Range(range.raw, options)
  11184. }
  11185. }
  11186. if (range instanceof Comparator) {
  11187. return new Range(range.value, options)
  11188. }
  11189. if (!(this instanceof Range)) {
  11190. return new Range(range, options)
  11191. }
  11192. this.options = options
  11193. this.loose = !!options.loose
  11194. this.includePrerelease = !!options.includePrerelease
  11195. // First, split based on boolean or ||
  11196. this.raw = range
  11197. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11198. return this.parseRange(range.trim())
  11199. }, this).filter(function (c) {
  11200. // throw out any that are not relevant for whatever reason
  11201. return c.length
  11202. })
  11203. if (!this.set.length) {
  11204. throw new TypeError('Invalid SemVer Range: ' + range)
  11205. }
  11206. this.format()
  11207. }
  11208. Range.prototype.format = function () {
  11209. this.range = this.set.map(function (comps) {
  11210. return comps.join(' ').trim()
  11211. }).join('||').trim()
  11212. return this.range
  11213. }
  11214. Range.prototype.toString = function () {
  11215. return this.range
  11216. }
  11217. Range.prototype.parseRange = function (range) {
  11218. var loose = this.options.loose
  11219. range = range.trim()
  11220. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11221. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11222. range = range.replace(hr, hyphenReplace)
  11223. debug('hyphen replace', range)
  11224. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11225. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11226. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11227. // `~ 1.2.3` => `~1.2.3`
  11228. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11229. // `^ 1.2.3` => `^1.2.3`
  11230. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11231. // normalize spaces
  11232. range = range.split(/\s+/).join(' ')
  11233. // At this point, the range is completely trimmed and
  11234. // ready to be split into comparators.
  11235. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11236. var set = range.split(' ').map(function (comp) {
  11237. return parseComparator(comp, this.options)
  11238. }, this).join(' ').split(/\s+/)
  11239. if (this.options.loose) {
  11240. // in loose mode, throw out any that are not valid comparators
  11241. set = set.filter(function (comp) {
  11242. return !!comp.match(compRe)
  11243. })
  11244. }
  11245. set = set.map(function (comp) {
  11246. return new Comparator(comp, this.options)
  11247. }, this)
  11248. return set
  11249. }
  11250. Range.prototype.intersects = function (range, options) {
  11251. if (!(range instanceof Range)) {
  11252. throw new TypeError('a Range is required')
  11253. }
  11254. return this.set.some(function (thisComparators) {
  11255. return (
  11256. isSatisfiable(thisComparators, options) &&
  11257. range.set.some(function (rangeComparators) {
  11258. return (
  11259. isSatisfiable(rangeComparators, options) &&
  11260. thisComparators.every(function (thisComparator) {
  11261. return rangeComparators.every(function (rangeComparator) {
  11262. return thisComparator.intersects(rangeComparator, options)
  11263. })
  11264. })
  11265. )
  11266. })
  11267. )
  11268. })
  11269. }
  11270. // take a set of comparators and determine whether there
  11271. // exists a version which can satisfy it
  11272. function isSatisfiable (comparators, options) {
  11273. var result = true
  11274. var remainingComparators = comparators.slice()
  11275. var testComparator = remainingComparators.pop()
  11276. while (result && remainingComparators.length) {
  11277. result = remainingComparators.every(function (otherComparator) {
  11278. return testComparator.intersects(otherComparator, options)
  11279. })
  11280. testComparator = remainingComparators.pop()
  11281. }
  11282. return result
  11283. }
  11284. // Mostly just for testing and legacy API reasons
  11285. exports.toComparators = toComparators
  11286. function toComparators (range, options) {
  11287. return new Range(range, options).set.map(function (comp) {
  11288. return comp.map(function (c) {
  11289. return c.value
  11290. }).join(' ').trim().split(' ')
  11291. })
  11292. }
  11293. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11294. // already replaced the hyphen ranges
  11295. // turn into a set of JUST comparators.
  11296. function parseComparator (comp, options) {
  11297. debug('comp', comp, options)
  11298. comp = replaceCarets(comp, options)
  11299. debug('caret', comp)
  11300. comp = replaceTildes(comp, options)
  11301. debug('tildes', comp)
  11302. comp = replaceXRanges(comp, options)
  11303. debug('xrange', comp)
  11304. comp = replaceStars(comp, options)
  11305. debug('stars', comp)
  11306. return comp
  11307. }
  11308. function isX (id) {
  11309. return !id || id.toLowerCase() === 'x' || id === '*'
  11310. }
  11311. // ~, ~> --> * (any, kinda silly)
  11312. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11313. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11314. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11315. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11316. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11317. function replaceTildes (comp, options) {
  11318. return comp.trim().split(/\s+/).map(function (comp) {
  11319. return replaceTilde(comp, options)
  11320. }).join(' ')
  11321. }
  11322. function replaceTilde (comp, options) {
  11323. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11324. return comp.replace(r, function (_, M, m, p, pr) {
  11325. debug('tilde', comp, _, M, m, p, pr)
  11326. var ret
  11327. if (isX(M)) {
  11328. ret = ''
  11329. } else if (isX(m)) {
  11330. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11331. } else if (isX(p)) {
  11332. // ~1.2 == >=1.2.0 <1.3.0
  11333. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11334. } else if (pr) {
  11335. debug('replaceTilde pr', pr)
  11336. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11337. ' <' + M + '.' + (+m + 1) + '.0'
  11338. } else {
  11339. // ~1.2.3 == >=1.2.3 <1.3.0
  11340. ret = '>=' + M + '.' + m + '.' + p +
  11341. ' <' + M + '.' + (+m + 1) + '.0'
  11342. }
  11343. debug('tilde return', ret)
  11344. return ret
  11345. })
  11346. }
  11347. // ^ --> * (any, kinda silly)
  11348. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11349. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11350. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11351. // ^1.2.3 --> >=1.2.3 <2.0.0
  11352. // ^1.2.0 --> >=1.2.0 <2.0.0
  11353. function replaceCarets (comp, options) {
  11354. return comp.trim().split(/\s+/).map(function (comp) {
  11355. return replaceCaret(comp, options)
  11356. }).join(' ')
  11357. }
  11358. function replaceCaret (comp, options) {
  11359. debug('caret', comp, options)
  11360. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11361. return comp.replace(r, function (_, M, m, p, pr) {
  11362. debug('caret', comp, _, M, m, p, pr)
  11363. var ret
  11364. if (isX(M)) {
  11365. ret = ''
  11366. } else if (isX(m)) {
  11367. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11368. } else if (isX(p)) {
  11369. if (M === '0') {
  11370. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11371. } else {
  11372. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11373. }
  11374. } else if (pr) {
  11375. debug('replaceCaret pr', pr)
  11376. if (M === '0') {
  11377. if (m === '0') {
  11378. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11379. ' <' + M + '.' + m + '.' + (+p + 1)
  11380. } else {
  11381. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11382. ' <' + M + '.' + (+m + 1) + '.0'
  11383. }
  11384. } else {
  11385. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11386. ' <' + (+M + 1) + '.0.0'
  11387. }
  11388. } else {
  11389. debug('no pr')
  11390. if (M === '0') {
  11391. if (m === '0') {
  11392. ret = '>=' + M + '.' + m + '.' + p +
  11393. ' <' + M + '.' + m + '.' + (+p + 1)
  11394. } else {
  11395. ret = '>=' + M + '.' + m + '.' + p +
  11396. ' <' + M + '.' + (+m + 1) + '.0'
  11397. }
  11398. } else {
  11399. ret = '>=' + M + '.' + m + '.' + p +
  11400. ' <' + (+M + 1) + '.0.0'
  11401. }
  11402. }
  11403. debug('caret return', ret)
  11404. return ret
  11405. })
  11406. }
  11407. function replaceXRanges (comp, options) {
  11408. debug('replaceXRanges', comp, options)
  11409. return comp.split(/\s+/).map(function (comp) {
  11410. return replaceXRange(comp, options)
  11411. }).join(' ')
  11412. }
  11413. function replaceXRange (comp, options) {
  11414. comp = comp.trim()
  11415. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11416. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11417. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11418. var xM = isX(M)
  11419. var xm = xM || isX(m)
  11420. var xp = xm || isX(p)
  11421. var anyX = xp
  11422. if (gtlt === '=' && anyX) {
  11423. gtlt = ''
  11424. }
  11425. // if we're including prereleases in the match, then we need
  11426. // to fix this to -0, the lowest possible prerelease value
  11427. pr = options.includePrerelease ? '-0' : ''
  11428. if (xM) {
  11429. if (gtlt === '>' || gtlt === '<') {
  11430. // nothing is allowed
  11431. ret = '<0.0.0-0'
  11432. } else {
  11433. // nothing is forbidden
  11434. ret = '*'
  11435. }
  11436. } else if (gtlt && anyX) {
  11437. // we know patch is an x, because we have any x at all.
  11438. // replace X with 0
  11439. if (xm) {
  11440. m = 0
  11441. }
  11442. p = 0
  11443. if (gtlt === '>') {
  11444. // >1 => >=2.0.0
  11445. // >1.2 => >=1.3.0
  11446. // >1.2.3 => >= 1.2.4
  11447. gtlt = '>='
  11448. if (xm) {
  11449. M = +M + 1
  11450. m = 0
  11451. p = 0
  11452. } else {
  11453. m = +m + 1
  11454. p = 0
  11455. }
  11456. } else if (gtlt === '<=') {
  11457. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11458. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11459. gtlt = '<'
  11460. if (xm) {
  11461. M = +M + 1
  11462. } else {
  11463. m = +m + 1
  11464. }
  11465. }
  11466. ret = gtlt + M + '.' + m + '.' + p + pr
  11467. } else if (xm) {
  11468. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11469. } else if (xp) {
  11470. ret = '>=' + M + '.' + m + '.0' + pr +
  11471. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11472. }
  11473. debug('xRange return', ret)
  11474. return ret
  11475. })
  11476. }
  11477. // Because * is AND-ed with everything else in the comparator,
  11478. // and '' means "any version", just remove the *s entirely.
  11479. function replaceStars (comp, options) {
  11480. debug('replaceStars', comp, options)
  11481. // Looseness is ignored here. star is always as loose as it gets!
  11482. return comp.trim().replace(re[t.STAR], '')
  11483. }
  11484. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11485. // M, m, patch, prerelease, build
  11486. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11487. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11488. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11489. function hyphenReplace ($0,
  11490. from, fM, fm, fp, fpr, fb,
  11491. to, tM, tm, tp, tpr, tb) {
  11492. if (isX(fM)) {
  11493. from = ''
  11494. } else if (isX(fm)) {
  11495. from = '>=' + fM + '.0.0'
  11496. } else if (isX(fp)) {
  11497. from = '>=' + fM + '.' + fm + '.0'
  11498. } else {
  11499. from = '>=' + from
  11500. }
  11501. if (isX(tM)) {
  11502. to = ''
  11503. } else if (isX(tm)) {
  11504. to = '<' + (+tM + 1) + '.0.0'
  11505. } else if (isX(tp)) {
  11506. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11507. } else if (tpr) {
  11508. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11509. } else {
  11510. to = '<=' + to
  11511. }
  11512. return (from + ' ' + to).trim()
  11513. }
  11514. // if ANY of the sets match ALL of its comparators, then pass
  11515. Range.prototype.test = function (version) {
  11516. if (!version) {
  11517. return false
  11518. }
  11519. if (typeof version === 'string') {
  11520. try {
  11521. version = new SemVer(version, this.options)
  11522. } catch (er) {
  11523. return false
  11524. }
  11525. }
  11526. for (var i = 0; i < this.set.length; i++) {
  11527. if (testSet(this.set[i], version, this.options)) {
  11528. return true
  11529. }
  11530. }
  11531. return false
  11532. }
  11533. function testSet (set, version, options) {
  11534. for (var i = 0; i < set.length; i++) {
  11535. if (!set[i].test(version)) {
  11536. return false
  11537. }
  11538. }
  11539. if (version.prerelease.length && !options.includePrerelease) {
  11540. // Find the set of versions that are allowed to have prereleases
  11541. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11542. // That should allow `1.2.3-pr.2` to pass.
  11543. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11544. // even though it's within the range set by the comparators.
  11545. for (i = 0; i < set.length; i++) {
  11546. debug(set[i].semver)
  11547. if (set[i].semver === ANY) {
  11548. continue
  11549. }
  11550. if (set[i].semver.prerelease.length > 0) {
  11551. var allowed = set[i].semver
  11552. if (allowed.major === version.major &&
  11553. allowed.minor === version.minor &&
  11554. allowed.patch === version.patch) {
  11555. return true
  11556. }
  11557. }
  11558. }
  11559. // Version has a -pre, but it's not one of the ones we like.
  11560. return false
  11561. }
  11562. return true
  11563. }
  11564. exports.satisfies = satisfies
  11565. function satisfies (version, range, options) {
  11566. try {
  11567. range = new Range(range, options)
  11568. } catch (er) {
  11569. return false
  11570. }
  11571. return range.test(version)
  11572. }
  11573. exports.maxSatisfying = maxSatisfying
  11574. function maxSatisfying (versions, range, options) {
  11575. var max = null
  11576. var maxSV = null
  11577. try {
  11578. var rangeObj = new Range(range, options)
  11579. } catch (er) {
  11580. return null
  11581. }
  11582. versions.forEach(function (v) {
  11583. if (rangeObj.test(v)) {
  11584. // satisfies(v, range, options)
  11585. if (!max || maxSV.compare(v) === -1) {
  11586. // compare(max, v, true)
  11587. max = v
  11588. maxSV = new SemVer(max, options)
  11589. }
  11590. }
  11591. })
  11592. return max
  11593. }
  11594. exports.minSatisfying = minSatisfying
  11595. function minSatisfying (versions, range, options) {
  11596. var min = null
  11597. var minSV = null
  11598. try {
  11599. var rangeObj = new Range(range, options)
  11600. } catch (er) {
  11601. return null
  11602. }
  11603. versions.forEach(function (v) {
  11604. if (rangeObj.test(v)) {
  11605. // satisfies(v, range, options)
  11606. if (!min || minSV.compare(v) === 1) {
  11607. // compare(min, v, true)
  11608. min = v
  11609. minSV = new SemVer(min, options)
  11610. }
  11611. }
  11612. })
  11613. return min
  11614. }
  11615. exports.minVersion = minVersion
  11616. function minVersion (range, loose) {
  11617. range = new Range(range, loose)
  11618. var minver = new SemVer('0.0.0')
  11619. if (range.test(minver)) {
  11620. return minver
  11621. }
  11622. minver = new SemVer('0.0.0-0')
  11623. if (range.test(minver)) {
  11624. return minver
  11625. }
  11626. minver = null
  11627. for (var i = 0; i < range.set.length; ++i) {
  11628. var comparators = range.set[i]
  11629. comparators.forEach(function (comparator) {
  11630. // Clone to avoid manipulating the comparator's semver object.
  11631. var compver = new SemVer(comparator.semver.version)
  11632. switch (comparator.operator) {
  11633. case '>':
  11634. if (compver.prerelease.length === 0) {
  11635. compver.patch++
  11636. } else {
  11637. compver.prerelease.push(0)
  11638. }
  11639. compver.raw = compver.format()
  11640. /* fallthrough */
  11641. case '':
  11642. case '>=':
  11643. if (!minver || gt(minver, compver)) {
  11644. minver = compver
  11645. }
  11646. break
  11647. case '<':
  11648. case '<=':
  11649. /* Ignore maximum versions */
  11650. break
  11651. /* istanbul ignore next */
  11652. default:
  11653. throw new Error('Unexpected operation: ' + comparator.operator)
  11654. }
  11655. })
  11656. }
  11657. if (minver && range.test(minver)) {
  11658. return minver
  11659. }
  11660. return null
  11661. }
  11662. exports.validRange = validRange
  11663. function validRange (range, options) {
  11664. try {
  11665. // Return '*' instead of '' so that truthiness works.
  11666. // This will throw if it's invalid anyway
  11667. return new Range(range, options).range || '*'
  11668. } catch (er) {
  11669. return null
  11670. }
  11671. }
  11672. // Determine if version is less than all the versions possible in the range
  11673. exports.ltr = ltr
  11674. function ltr (version, range, options) {
  11675. return outside(version, range, '<', options)
  11676. }
  11677. // Determine if version is greater than all the versions possible in the range.
  11678. exports.gtr = gtr
  11679. function gtr (version, range, options) {
  11680. return outside(version, range, '>', options)
  11681. }
  11682. exports.outside = outside
  11683. function outside (version, range, hilo, options) {
  11684. version = new SemVer(version, options)
  11685. range = new Range(range, options)
  11686. var gtfn, ltefn, ltfn, comp, ecomp
  11687. switch (hilo) {
  11688. case '>':
  11689. gtfn = gt
  11690. ltefn = lte
  11691. ltfn = lt
  11692. comp = '>'
  11693. ecomp = '>='
  11694. break
  11695. case '<':
  11696. gtfn = lt
  11697. ltefn = gte
  11698. ltfn = gt
  11699. comp = '<'
  11700. ecomp = '<='
  11701. break
  11702. default:
  11703. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11704. }
  11705. // If it satisifes the range it is not outside
  11706. if (satisfies(version, range, options)) {
  11707. return false
  11708. }
  11709. // From now on, variable terms are as if we're in "gtr" mode.
  11710. // but note that everything is flipped for the "ltr" function.
  11711. for (var i = 0; i < range.set.length; ++i) {
  11712. var comparators = range.set[i]
  11713. var high = null
  11714. var low = null
  11715. comparators.forEach(function (comparator) {
  11716. if (comparator.semver === ANY) {
  11717. comparator = new Comparator('>=0.0.0')
  11718. }
  11719. high = high || comparator
  11720. low = low || comparator
  11721. if (gtfn(comparator.semver, high.semver, options)) {
  11722. high = comparator
  11723. } else if (ltfn(comparator.semver, low.semver, options)) {
  11724. low = comparator
  11725. }
  11726. })
  11727. // If the edge version comparator has a operator then our version
  11728. // isn't outside it
  11729. if (high.operator === comp || high.operator === ecomp) {
  11730. return false
  11731. }
  11732. // If the lowest version comparator has an operator and our version
  11733. // is less than it then it isn't higher than the range
  11734. if ((!low.operator || low.operator === comp) &&
  11735. ltefn(version, low.semver)) {
  11736. return false
  11737. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11738. return false
  11739. }
  11740. }
  11741. return true
  11742. }
  11743. exports.prerelease = prerelease
  11744. function prerelease (version, options) {
  11745. var parsed = parse(version, options)
  11746. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11747. }
  11748. exports.intersects = intersects
  11749. function intersects (r1, r2, options) {
  11750. r1 = new Range(r1, options)
  11751. r2 = new Range(r2, options)
  11752. return r1.intersects(r2)
  11753. }
  11754. exports.coerce = coerce
  11755. function coerce (version, options) {
  11756. if (version instanceof SemVer) {
  11757. return version
  11758. }
  11759. if (typeof version === 'number') {
  11760. version = String(version)
  11761. }
  11762. if (typeof version !== 'string') {
  11763. return null
  11764. }
  11765. options = options || {}
  11766. var match = null
  11767. if (!options.rtl) {
  11768. match = version.match(re[t.COERCE])
  11769. } else {
  11770. // Find the right-most coercible string that does not share
  11771. // a terminus with a more left-ward coercible string.
  11772. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11773. //
  11774. // Walk through the string checking with a /g regexp
  11775. // Manually set the index so as to pick up overlapping matches.
  11776. // Stop when we get a match that ends at the string end, since no
  11777. // coercible string can be more right-ward without the same terminus.
  11778. var next
  11779. while ((next = re[t.COERCERTL].exec(version)) &&
  11780. (!match || match.index + match[0].length !== version.length)
  11781. ) {
  11782. if (!match ||
  11783. next.index + next[0].length !== match.index + match[0].length) {
  11784. match = next
  11785. }
  11786. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11787. }
  11788. // leave it in a clean state
  11789. re[t.COERCERTL].lastIndex = -1
  11790. }
  11791. if (match === null) {
  11792. return null
  11793. }
  11794. return parse(match[2] +
  11795. '.' + (match[3] || '0') +
  11796. '.' + (match[4] || '0'), options)
  11797. }
  11798. /***/ }),
  11799. /***/ 669:
  11800. /***/ (function(module) {
  11801. module.exports = require("util");
  11802. /***/ }),
  11803. /***/ 672:
  11804. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11805. "use strict";
  11806. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11807. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11808. return new (P || (P = Promise))(function (resolve, reject) {
  11809. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11810. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11811. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11812. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11813. });
  11814. };
  11815. var _a;
  11816. Object.defineProperty(exports, "__esModule", { value: true });
  11817. const assert_1 = __webpack_require__(357);
  11818. const fs = __webpack_require__(747);
  11819. const path = __webpack_require__(622);
  11820. _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;
  11821. exports.IS_WINDOWS = process.platform === 'win32';
  11822. function exists(fsPath) {
  11823. return __awaiter(this, void 0, void 0, function* () {
  11824. try {
  11825. yield exports.stat(fsPath);
  11826. }
  11827. catch (err) {
  11828. if (err.code === 'ENOENT') {
  11829. return false;
  11830. }
  11831. throw err;
  11832. }
  11833. return true;
  11834. });
  11835. }
  11836. exports.exists = exists;
  11837. function isDirectory(fsPath, useStat = false) {
  11838. return __awaiter(this, void 0, void 0, function* () {
  11839. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11840. return stats.isDirectory();
  11841. });
  11842. }
  11843. exports.isDirectory = isDirectory;
  11844. /**
  11845. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11846. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11847. */
  11848. function isRooted(p) {
  11849. p = normalizeSeparators(p);
  11850. if (!p) {
  11851. throw new Error('isRooted() parameter "p" cannot be empty');
  11852. }
  11853. if (exports.IS_WINDOWS) {
  11854. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11855. ); // e.g. C: or C:\hello
  11856. }
  11857. return p.startsWith('/');
  11858. }
  11859. exports.isRooted = isRooted;
  11860. /**
  11861. * Recursively create a directory at `fsPath`.
  11862. *
  11863. * This implementation is optimistic, meaning it attempts to create the full
  11864. * path first, and backs up the path stack from there.
  11865. *
  11866. * @param fsPath The path to create
  11867. * @param maxDepth The maximum recursion depth
  11868. * @param depth The current recursion depth
  11869. */
  11870. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11871. return __awaiter(this, void 0, void 0, function* () {
  11872. assert_1.ok(fsPath, 'a path argument must be provided');
  11873. fsPath = path.resolve(fsPath);
  11874. if (depth >= maxDepth)
  11875. return exports.mkdir(fsPath);
  11876. try {
  11877. yield exports.mkdir(fsPath);
  11878. return;
  11879. }
  11880. catch (err) {
  11881. switch (err.code) {
  11882. case 'ENOENT': {
  11883. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11884. yield exports.mkdir(fsPath);
  11885. return;
  11886. }
  11887. default: {
  11888. let stats;
  11889. try {
  11890. stats = yield exports.stat(fsPath);
  11891. }
  11892. catch (err2) {
  11893. throw err;
  11894. }
  11895. if (!stats.isDirectory())
  11896. throw err;
  11897. }
  11898. }
  11899. }
  11900. });
  11901. }
  11902. exports.mkdirP = mkdirP;
  11903. /**
  11904. * Best effort attempt to determine whether a file exists and is executable.
  11905. * @param filePath file path to check
  11906. * @param extensions additional file extensions to try
  11907. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11908. */
  11909. function tryGetExecutablePath(filePath, extensions) {
  11910. return __awaiter(this, void 0, void 0, function* () {
  11911. let stats = undefined;
  11912. try {
  11913. // test file exists
  11914. stats = yield exports.stat(filePath);
  11915. }
  11916. catch (err) {
  11917. if (err.code !== 'ENOENT') {
  11918. // eslint-disable-next-line no-console
  11919. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11920. }
  11921. }
  11922. if (stats && stats.isFile()) {
  11923. if (exports.IS_WINDOWS) {
  11924. // on Windows, test for valid extension
  11925. const upperExt = path.extname(filePath).toUpperCase();
  11926. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11927. return filePath;
  11928. }
  11929. }
  11930. else {
  11931. if (isUnixExecutable(stats)) {
  11932. return filePath;
  11933. }
  11934. }
  11935. }
  11936. // try each extension
  11937. const originalFilePath = filePath;
  11938. for (const extension of extensions) {
  11939. filePath = originalFilePath + extension;
  11940. stats = undefined;
  11941. try {
  11942. stats = yield exports.stat(filePath);
  11943. }
  11944. catch (err) {
  11945. if (err.code !== 'ENOENT') {
  11946. // eslint-disable-next-line no-console
  11947. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11948. }
  11949. }
  11950. if (stats && stats.isFile()) {
  11951. if (exports.IS_WINDOWS) {
  11952. // preserve the case of the actual file (since an extension was appended)
  11953. try {
  11954. const directory = path.dirname(filePath);
  11955. const upperName = path.basename(filePath).toUpperCase();
  11956. for (const actualName of yield exports.readdir(directory)) {
  11957. if (upperName === actualName.toUpperCase()) {
  11958. filePath = path.join(directory, actualName);
  11959. break;
  11960. }
  11961. }
  11962. }
  11963. catch (err) {
  11964. // eslint-disable-next-line no-console
  11965. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11966. }
  11967. return filePath;
  11968. }
  11969. else {
  11970. if (isUnixExecutable(stats)) {
  11971. return filePath;
  11972. }
  11973. }
  11974. }
  11975. }
  11976. return '';
  11977. });
  11978. }
  11979. exports.tryGetExecutablePath = tryGetExecutablePath;
  11980. function normalizeSeparators(p) {
  11981. p = p || '';
  11982. if (exports.IS_WINDOWS) {
  11983. // convert slashes on Windows
  11984. p = p.replace(/\//g, '\\');
  11985. // remove redundant slashes
  11986. return p.replace(/\\\\+/g, '\\');
  11987. }
  11988. // remove redundant slashes
  11989. return p.replace(/\/\/+/g, '/');
  11990. }
  11991. // on Mac/Linux, test the execute bit
  11992. // R W X R W X R W X
  11993. // 256 128 64 32 16 8 4 2 1
  11994. function isUnixExecutable(stats) {
  11995. return ((stats.mode & 1) > 0 ||
  11996. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11997. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11998. }
  11999. //# sourceMappingURL=io-util.js.map
  12000. /***/ }),
  12001. /***/ 674:
  12002. /***/ (function(module, __unusedexports, __webpack_require__) {
  12003. module.exports = authenticate;
  12004. const { Deprecation } = __webpack_require__(692);
  12005. const once = __webpack_require__(969);
  12006. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  12007. function authenticate(state, options) {
  12008. deprecateAuthenticate(
  12009. state.octokit.log,
  12010. new Deprecation(
  12011. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  12012. )
  12013. );
  12014. if (!options) {
  12015. state.auth = false;
  12016. return;
  12017. }
  12018. switch (options.type) {
  12019. case "basic":
  12020. if (!options.username || !options.password) {
  12021. throw new Error(
  12022. "Basic authentication requires both a username and password to be set"
  12023. );
  12024. }
  12025. break;
  12026. case "oauth":
  12027. if (!options.token && !(options.key && options.secret)) {
  12028. throw new Error(
  12029. "OAuth2 authentication requires a token or key & secret to be set"
  12030. );
  12031. }
  12032. break;
  12033. case "token":
  12034. case "app":
  12035. if (!options.token) {
  12036. throw new Error("Token authentication requires a token to be set");
  12037. }
  12038. break;
  12039. default:
  12040. throw new Error(
  12041. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  12042. );
  12043. }
  12044. state.auth = options;
  12045. }
  12046. /***/ }),
  12047. /***/ 675:
  12048. /***/ (function(module) {
  12049. module.exports = function btoa(str) {
  12050. return new Buffer(str).toString('base64')
  12051. }
  12052. /***/ }),
  12053. /***/ 692:
  12054. /***/ (function(__unusedmodule, exports) {
  12055. "use strict";
  12056. Object.defineProperty(exports, '__esModule', { value: true });
  12057. class Deprecation extends Error {
  12058. constructor(message) {
  12059. super(message); // Maintains proper stack trace (only available on V8)
  12060. /* istanbul ignore next */
  12061. if (Error.captureStackTrace) {
  12062. Error.captureStackTrace(this, this.constructor);
  12063. }
  12064. this.name = 'Deprecation';
  12065. }
  12066. }
  12067. exports.Deprecation = Deprecation;
  12068. /***/ }),
  12069. /***/ 696:
  12070. /***/ (function(module) {
  12071. "use strict";
  12072. /*!
  12073. * isobject <https://github.com/jonschlinkert/isobject>
  12074. *
  12075. * Copyright (c) 2014-2017, Jon Schlinkert.
  12076. * Released under the MIT License.
  12077. */
  12078. function isObject(val) {
  12079. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12080. }
  12081. /*!
  12082. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12083. *
  12084. * Copyright (c) 2014-2017, Jon Schlinkert.
  12085. * Released under the MIT License.
  12086. */
  12087. function isObjectObject(o) {
  12088. return isObject(o) === true
  12089. && Object.prototype.toString.call(o) === '[object Object]';
  12090. }
  12091. function isPlainObject(o) {
  12092. var ctor,prot;
  12093. if (isObjectObject(o) === false) return false;
  12094. // If has modified constructor
  12095. ctor = o.constructor;
  12096. if (typeof ctor !== 'function') return false;
  12097. // If has modified prototype
  12098. prot = ctor.prototype;
  12099. if (isObjectObject(prot) === false) return false;
  12100. // If constructor does not have an Object-specific method
  12101. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12102. return false;
  12103. }
  12104. // Most likely a plain Object
  12105. return true;
  12106. }
  12107. module.exports = isPlainObject;
  12108. /***/ }),
  12109. /***/ 697:
  12110. /***/ (function(module) {
  12111. "use strict";
  12112. module.exports = (promise, onFinally) => {
  12113. onFinally = onFinally || (() => {});
  12114. return promise.then(
  12115. val => new Promise(resolve => {
  12116. resolve(onFinally());
  12117. }).then(() => val),
  12118. err => new Promise(resolve => {
  12119. resolve(onFinally());
  12120. }).then(() => {
  12121. throw err;
  12122. })
  12123. );
  12124. };
  12125. /***/ }),
  12126. /***/ 722:
  12127. /***/ (function(module) {
  12128. /**
  12129. * Convert array of 16 byte values to UUID string format of the form:
  12130. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12131. */
  12132. var byteToHex = [];
  12133. for (var i = 0; i < 256; ++i) {
  12134. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12135. }
  12136. function bytesToUuid(buf, offset) {
  12137. var i = offset || 0;
  12138. var bth = byteToHex;
  12139. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12140. return ([bth[buf[i++]], bth[buf[i++]],
  12141. bth[buf[i++]], bth[buf[i++]], '-',
  12142. bth[buf[i++]], bth[buf[i++]], '-',
  12143. bth[buf[i++]], bth[buf[i++]], '-',
  12144. bth[buf[i++]], bth[buf[i++]], '-',
  12145. bth[buf[i++]], bth[buf[i++]],
  12146. bth[buf[i++]], bth[buf[i++]],
  12147. bth[buf[i++]], bth[buf[i++]]]).join('');
  12148. }
  12149. module.exports = bytesToUuid;
  12150. /***/ }),
  12151. /***/ 742:
  12152. /***/ (function(module, __unusedexports, __webpack_require__) {
  12153. var fs = __webpack_require__(747)
  12154. var core
  12155. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12156. core = __webpack_require__(818)
  12157. } else {
  12158. core = __webpack_require__(197)
  12159. }
  12160. module.exports = isexe
  12161. isexe.sync = sync
  12162. function isexe (path, options, cb) {
  12163. if (typeof options === 'function') {
  12164. cb = options
  12165. options = {}
  12166. }
  12167. if (!cb) {
  12168. if (typeof Promise !== 'function') {
  12169. throw new TypeError('callback not provided')
  12170. }
  12171. return new Promise(function (resolve, reject) {
  12172. isexe(path, options || {}, function (er, is) {
  12173. if (er) {
  12174. reject(er)
  12175. } else {
  12176. resolve(is)
  12177. }
  12178. })
  12179. })
  12180. }
  12181. core(path, options || {}, function (er, is) {
  12182. // ignore EACCES because that just means we aren't allowed to run it
  12183. if (er) {
  12184. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12185. er = null
  12186. is = false
  12187. }
  12188. }
  12189. cb(er, is)
  12190. })
  12191. }
  12192. function sync (path, options) {
  12193. // my kingdom for a filtered catch
  12194. try {
  12195. return core.sync(path, options || {})
  12196. } catch (er) {
  12197. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12198. return false
  12199. } else {
  12200. throw er
  12201. }
  12202. }
  12203. }
  12204. /***/ }),
  12205. /***/ 747:
  12206. /***/ (function(module) {
  12207. module.exports = require("fs");
  12208. /***/ }),
  12209. /***/ 753:
  12210. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12211. "use strict";
  12212. Object.defineProperty(exports, '__esModule', { value: true });
  12213. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12214. var endpoint = __webpack_require__(385);
  12215. var universalUserAgent = __webpack_require__(211);
  12216. var isPlainObject = _interopDefault(__webpack_require__(696));
  12217. var nodeFetch = _interopDefault(__webpack_require__(454));
  12218. var requestError = __webpack_require__(463);
  12219. const VERSION = "5.4.2";
  12220. function getBufferResponse(response) {
  12221. return response.arrayBuffer();
  12222. }
  12223. function fetchWrapper(requestOptions) {
  12224. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12225. requestOptions.body = JSON.stringify(requestOptions.body);
  12226. }
  12227. let headers = {};
  12228. let status;
  12229. let url;
  12230. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12231. return fetch(requestOptions.url, Object.assign({
  12232. method: requestOptions.method,
  12233. body: requestOptions.body,
  12234. headers: requestOptions.headers,
  12235. redirect: requestOptions.redirect
  12236. }, requestOptions.request)).then(response => {
  12237. url = response.url;
  12238. status = response.status;
  12239. for (const keyAndValue of response.headers) {
  12240. headers[keyAndValue[0]] = keyAndValue[1];
  12241. }
  12242. if (status === 204 || status === 205) {
  12243. return;
  12244. } // GitHub API returns 200 for HEAD requests
  12245. if (requestOptions.method === "HEAD") {
  12246. if (status < 400) {
  12247. return;
  12248. }
  12249. throw new requestError.RequestError(response.statusText, status, {
  12250. headers,
  12251. request: requestOptions
  12252. });
  12253. }
  12254. if (status === 304) {
  12255. throw new requestError.RequestError("Not modified", status, {
  12256. headers,
  12257. request: requestOptions
  12258. });
  12259. }
  12260. if (status >= 400) {
  12261. return response.text().then(message => {
  12262. const error = new requestError.RequestError(message, status, {
  12263. headers,
  12264. request: requestOptions
  12265. });
  12266. try {
  12267. let responseBody = JSON.parse(error.message);
  12268. Object.assign(error, responseBody);
  12269. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12270. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12271. } catch (e) {// ignore, see octokit/rest.js#684
  12272. }
  12273. throw error;
  12274. });
  12275. }
  12276. const contentType = response.headers.get("content-type");
  12277. if (/application\/json/.test(contentType)) {
  12278. return response.json();
  12279. }
  12280. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12281. return response.text();
  12282. }
  12283. return getBufferResponse(response);
  12284. }).then(data => {
  12285. return {
  12286. status,
  12287. url,
  12288. headers,
  12289. data
  12290. };
  12291. }).catch(error => {
  12292. if (error instanceof requestError.RequestError) {
  12293. throw error;
  12294. }
  12295. throw new requestError.RequestError(error.message, 500, {
  12296. headers,
  12297. request: requestOptions
  12298. });
  12299. });
  12300. }
  12301. function withDefaults(oldEndpoint, newDefaults) {
  12302. const endpoint = oldEndpoint.defaults(newDefaults);
  12303. const newApi = function (route, parameters) {
  12304. const endpointOptions = endpoint.merge(route, parameters);
  12305. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12306. return fetchWrapper(endpoint.parse(endpointOptions));
  12307. }
  12308. const request = (route, parameters) => {
  12309. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12310. };
  12311. Object.assign(request, {
  12312. endpoint,
  12313. defaults: withDefaults.bind(null, endpoint)
  12314. });
  12315. return endpointOptions.request.hook(request, endpointOptions);
  12316. };
  12317. return Object.assign(newApi, {
  12318. endpoint,
  12319. defaults: withDefaults.bind(null, endpoint)
  12320. });
  12321. }
  12322. const request = withDefaults(endpoint.endpoint, {
  12323. headers: {
  12324. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12325. }
  12326. });
  12327. exports.request = request;
  12328. //# sourceMappingURL=index.js.map
  12329. /***/ }),
  12330. /***/ 761:
  12331. /***/ (function(module) {
  12332. module.exports = require("zlib");
  12333. /***/ }),
  12334. /***/ 763:
  12335. /***/ (function(module) {
  12336. module.exports = removeHook
  12337. function removeHook (state, name, method) {
  12338. if (!state.registry[name]) {
  12339. return
  12340. }
  12341. var index = state.registry[name]
  12342. .map(function (registered) { return registered.orig })
  12343. .indexOf(method)
  12344. if (index === -1) {
  12345. return
  12346. }
  12347. state.registry[name].splice(index, 1)
  12348. }
  12349. /***/ }),
  12350. /***/ 768:
  12351. /***/ (function(module) {
  12352. "use strict";
  12353. module.exports = function (x) {
  12354. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12355. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12356. if (x[x.length - 1] === lf) {
  12357. x = x.slice(0, x.length - 1);
  12358. }
  12359. if (x[x.length - 1] === cr) {
  12360. x = x.slice(0, x.length - 1);
  12361. }
  12362. return x;
  12363. };
  12364. /***/ }),
  12365. /***/ 777:
  12366. /***/ (function(module, __unusedexports, __webpack_require__) {
  12367. module.exports = getFirstPage
  12368. const getPage = __webpack_require__(265)
  12369. function getFirstPage (octokit, link, headers) {
  12370. return getPage(octokit, link, 'first', headers)
  12371. }
  12372. /***/ }),
  12373. /***/ 796:
  12374. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12375. "use strict";
  12376. Object.defineProperty(exports, '__esModule', { value: true });
  12377. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12378. var osName = _interopDefault(__webpack_require__(2));
  12379. function getUserAgent() {
  12380. try {
  12381. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12382. } catch (error) {
  12383. if (/wmic os get Caption/.test(error.message)) {
  12384. return "Windows <version undetectable>";
  12385. }
  12386. throw error;
  12387. }
  12388. }
  12389. exports.getUserAgent = getUserAgent;
  12390. //# sourceMappingURL=index.js.map
  12391. /***/ }),
  12392. /***/ 813:
  12393. /***/ (function(__unusedmodule, exports) {
  12394. "use strict";
  12395. Object.defineProperty(exports, '__esModule', { value: true });
  12396. async function auth(token) {
  12397. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12398. return {
  12399. type: "token",
  12400. token: token,
  12401. tokenType
  12402. };
  12403. }
  12404. /**
  12405. * Prefix token for usage in the Authorization header
  12406. *
  12407. * @param token OAuth token or JSON Web Token
  12408. */
  12409. function withAuthorizationPrefix(token) {
  12410. if (token.split(/\./).length === 3) {
  12411. return `bearer ${token}`;
  12412. }
  12413. return `token ${token}`;
  12414. }
  12415. async function hook(token, request, route, parameters) {
  12416. const endpoint = request.endpoint.merge(route, parameters);
  12417. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12418. return request(endpoint);
  12419. }
  12420. const createTokenAuth = function createTokenAuth(token) {
  12421. if (!token) {
  12422. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12423. }
  12424. if (typeof token !== "string") {
  12425. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12426. }
  12427. token = token.replace(/^(token|bearer) +/i, "");
  12428. return Object.assign(auth.bind(null, token), {
  12429. hook: hook.bind(null, token)
  12430. });
  12431. };
  12432. exports.createTokenAuth = createTokenAuth;
  12433. //# sourceMappingURL=index.js.map
  12434. /***/ }),
  12435. /***/ 814:
  12436. /***/ (function(module, __unusedexports, __webpack_require__) {
  12437. module.exports = which
  12438. which.sync = whichSync
  12439. var isWindows = process.platform === 'win32' ||
  12440. process.env.OSTYPE === 'cygwin' ||
  12441. process.env.OSTYPE === 'msys'
  12442. var path = __webpack_require__(622)
  12443. var COLON = isWindows ? ';' : ':'
  12444. var isexe = __webpack_require__(742)
  12445. function getNotFoundError (cmd) {
  12446. var er = new Error('not found: ' + cmd)
  12447. er.code = 'ENOENT'
  12448. return er
  12449. }
  12450. function getPathInfo (cmd, opt) {
  12451. var colon = opt.colon || COLON
  12452. var pathEnv = opt.path || process.env.PATH || ''
  12453. var pathExt = ['']
  12454. pathEnv = pathEnv.split(colon)
  12455. var pathExtExe = ''
  12456. if (isWindows) {
  12457. pathEnv.unshift(process.cwd())
  12458. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12459. pathExt = pathExtExe.split(colon)
  12460. // Always test the cmd itself first. isexe will check to make sure
  12461. // it's found in the pathExt set.
  12462. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12463. pathExt.unshift('')
  12464. }
  12465. // If it has a slash, then we don't bother searching the pathenv.
  12466. // just check the file itself, and that's it.
  12467. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12468. pathEnv = ['']
  12469. return {
  12470. env: pathEnv,
  12471. ext: pathExt,
  12472. extExe: pathExtExe
  12473. }
  12474. }
  12475. function which (cmd, opt, cb) {
  12476. if (typeof opt === 'function') {
  12477. cb = opt
  12478. opt = {}
  12479. }
  12480. var info = getPathInfo(cmd, opt)
  12481. var pathEnv = info.env
  12482. var pathExt = info.ext
  12483. var pathExtExe = info.extExe
  12484. var found = []
  12485. ;(function F (i, l) {
  12486. if (i === l) {
  12487. if (opt.all && found.length)
  12488. return cb(null, found)
  12489. else
  12490. return cb(getNotFoundError(cmd))
  12491. }
  12492. var pathPart = pathEnv[i]
  12493. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12494. pathPart = pathPart.slice(1, -1)
  12495. var p = path.join(pathPart, cmd)
  12496. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12497. p = cmd.slice(0, 2) + p
  12498. }
  12499. ;(function E (ii, ll) {
  12500. if (ii === ll) return F(i + 1, l)
  12501. var ext = pathExt[ii]
  12502. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12503. if (!er && is) {
  12504. if (opt.all)
  12505. found.push(p + ext)
  12506. else
  12507. return cb(null, p + ext)
  12508. }
  12509. return E(ii + 1, ll)
  12510. })
  12511. })(0, pathExt.length)
  12512. })(0, pathEnv.length)
  12513. }
  12514. function whichSync (cmd, opt) {
  12515. opt = opt || {}
  12516. var info = getPathInfo(cmd, opt)
  12517. var pathEnv = info.env
  12518. var pathExt = info.ext
  12519. var pathExtExe = info.extExe
  12520. var found = []
  12521. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12522. var pathPart = pathEnv[i]
  12523. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12524. pathPart = pathPart.slice(1, -1)
  12525. var p = path.join(pathPart, cmd)
  12526. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12527. p = cmd.slice(0, 2) + p
  12528. }
  12529. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12530. var cur = p + pathExt[j]
  12531. var is
  12532. try {
  12533. is = isexe.sync(cur, { pathExt: pathExtExe })
  12534. if (is) {
  12535. if (opt.all)
  12536. found.push(cur)
  12537. else
  12538. return cur
  12539. }
  12540. } catch (ex) {}
  12541. }
  12542. }
  12543. if (opt.all && found.length)
  12544. return found
  12545. if (opt.nothrow)
  12546. return null
  12547. throw getNotFoundError(cmd)
  12548. }
  12549. /***/ }),
  12550. /***/ 816:
  12551. /***/ (function(module) {
  12552. "use strict";
  12553. module.exports = /^#!.*/;
  12554. /***/ }),
  12555. /***/ 818:
  12556. /***/ (function(module, __unusedexports, __webpack_require__) {
  12557. module.exports = isexe
  12558. isexe.sync = sync
  12559. var fs = __webpack_require__(747)
  12560. function checkPathExt (path, options) {
  12561. var pathext = options.pathExt !== undefined ?
  12562. options.pathExt : process.env.PATHEXT
  12563. if (!pathext) {
  12564. return true
  12565. }
  12566. pathext = pathext.split(';')
  12567. if (pathext.indexOf('') !== -1) {
  12568. return true
  12569. }
  12570. for (var i = 0; i < pathext.length; i++) {
  12571. var p = pathext[i].toLowerCase()
  12572. if (p && path.substr(-p.length).toLowerCase() === p) {
  12573. return true
  12574. }
  12575. }
  12576. return false
  12577. }
  12578. function checkStat (stat, path, options) {
  12579. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12580. return false
  12581. }
  12582. return checkPathExt(path, options)
  12583. }
  12584. function isexe (path, options, cb) {
  12585. fs.stat(path, function (er, stat) {
  12586. cb(er, er ? false : checkStat(stat, path, options))
  12587. })
  12588. }
  12589. function sync (path, options) {
  12590. return checkStat(fs.statSync(path), path, options)
  12591. }
  12592. /***/ }),
  12593. /***/ 821:
  12594. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12595. "use strict";
  12596. var __importStar = (this && this.__importStar) || function (mod) {
  12597. if (mod && mod.__esModule) return mod;
  12598. var result = {};
  12599. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12600. result["default"] = mod;
  12601. return result;
  12602. };
  12603. Object.defineProperty(exports, "__esModule", { value: true });
  12604. const core = __importStar(__webpack_require__(470));
  12605. const fsHelper = __importStar(__webpack_require__(618));
  12606. const github = __importStar(__webpack_require__(469));
  12607. const path = __importStar(__webpack_require__(622));
  12608. function getInputs() {
  12609. const result = {};
  12610. // GitHub workspace
  12611. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12612. if (!githubWorkspacePath) {
  12613. throw new Error('GITHUB_WORKSPACE not defined');
  12614. }
  12615. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12616. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12617. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12618. // Qualified repository
  12619. const qualifiedRepository = core.getInput('repository') ||
  12620. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12621. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12622. const splitRepository = qualifiedRepository.split('/');
  12623. if (splitRepository.length !== 2 ||
  12624. !splitRepository[0] ||
  12625. !splitRepository[1]) {
  12626. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12627. }
  12628. result.repositoryOwner = splitRepository[0];
  12629. result.repositoryName = splitRepository[1];
  12630. // Repository path
  12631. result.repositoryPath = core.getInput('path') || '.';
  12632. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12633. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12634. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12635. }
  12636. // Workflow repository?
  12637. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12638. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12639. // Source branch, source version
  12640. result.ref = core.getInput('ref');
  12641. if (!result.ref) {
  12642. if (isWorkflowRepository) {
  12643. result.ref = github.context.ref;
  12644. result.commit = github.context.sha;
  12645. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12646. // the ref is unqualifed like "main" instead of "refs/heads/main".
  12647. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12648. result.ref = `refs/heads/${result.ref}`;
  12649. }
  12650. }
  12651. }
  12652. // SHA?
  12653. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12654. result.commit = result.ref;
  12655. result.ref = '';
  12656. }
  12657. core.debug(`ref = '${result.ref}'`);
  12658. core.debug(`commit = '${result.commit}'`);
  12659. // Clean
  12660. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12661. core.debug(`clean = ${result.clean}`);
  12662. // Fetch depth
  12663. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12664. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12665. result.fetchDepth = 0;
  12666. }
  12667. core.debug(`fetch depth = ${result.fetchDepth}`);
  12668. // LFS
  12669. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12670. core.debug(`lfs = ${result.lfs}`);
  12671. // Submodules
  12672. result.submodules = false;
  12673. result.nestedSubmodules = false;
  12674. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12675. if (submodulesString == 'RECURSIVE') {
  12676. result.submodules = true;
  12677. result.nestedSubmodules = true;
  12678. }
  12679. else if (submodulesString == 'TRUE') {
  12680. result.submodules = true;
  12681. }
  12682. core.debug(`submodules = ${result.submodules}`);
  12683. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12684. // Auth token
  12685. result.authToken = core.getInput('token', { required: true });
  12686. // SSH
  12687. result.sshKey = core.getInput('ssh-key');
  12688. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12689. result.sshStrict =
  12690. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12691. // Persist credentials
  12692. result.persistCredentials =
  12693. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12694. return result;
  12695. }
  12696. exports.getInputs = getInputs;
  12697. /***/ }),
  12698. /***/ 826:
  12699. /***/ (function(module, __unusedexports, __webpack_require__) {
  12700. var rng = __webpack_require__(139);
  12701. var bytesToUuid = __webpack_require__(722);
  12702. function v4(options, buf, offset) {
  12703. var i = buf && offset || 0;
  12704. if (typeof(options) == 'string') {
  12705. buf = options === 'binary' ? new Array(16) : null;
  12706. options = null;
  12707. }
  12708. options = options || {};
  12709. var rnds = options.random || (options.rng || rng)();
  12710. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12711. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12712. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12713. // Copy bytes to buffer, if provided
  12714. if (buf) {
  12715. for (var ii = 0; ii < 16; ++ii) {
  12716. buf[i + ii] = rnds[ii];
  12717. }
  12718. }
  12719. return buf || bytesToUuid(rnds);
  12720. }
  12721. module.exports = v4;
  12722. /***/ }),
  12723. /***/ 835:
  12724. /***/ (function(module) {
  12725. module.exports = require("url");
  12726. /***/ }),
  12727. /***/ 842:
  12728. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12729. "use strict";
  12730. Object.defineProperty(exports, '__esModule', { value: true });
  12731. var deprecation = __webpack_require__(692);
  12732. var endpointsByScope = {
  12733. actions: {
  12734. cancelWorkflowRun: {
  12735. method: "POST",
  12736. params: {
  12737. owner: {
  12738. required: true,
  12739. type: "string"
  12740. },
  12741. repo: {
  12742. required: true,
  12743. type: "string"
  12744. },
  12745. run_id: {
  12746. required: true,
  12747. type: "integer"
  12748. }
  12749. },
  12750. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12751. },
  12752. createOrUpdateSecretForRepo: {
  12753. method: "PUT",
  12754. params: {
  12755. encrypted_value: {
  12756. type: "string"
  12757. },
  12758. key_id: {
  12759. type: "string"
  12760. },
  12761. name: {
  12762. required: true,
  12763. type: "string"
  12764. },
  12765. owner: {
  12766. required: true,
  12767. type: "string"
  12768. },
  12769. repo: {
  12770. required: true,
  12771. type: "string"
  12772. }
  12773. },
  12774. url: "/repos/:owner/:repo/actions/secrets/:name"
  12775. },
  12776. createRegistrationToken: {
  12777. method: "POST",
  12778. params: {
  12779. owner: {
  12780. required: true,
  12781. type: "string"
  12782. },
  12783. repo: {
  12784. required: true,
  12785. type: "string"
  12786. }
  12787. },
  12788. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12789. },
  12790. createRemoveToken: {
  12791. method: "POST",
  12792. params: {
  12793. owner: {
  12794. required: true,
  12795. type: "string"
  12796. },
  12797. repo: {
  12798. required: true,
  12799. type: "string"
  12800. }
  12801. },
  12802. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12803. },
  12804. deleteArtifact: {
  12805. method: "DELETE",
  12806. params: {
  12807. artifact_id: {
  12808. required: true,
  12809. type: "integer"
  12810. },
  12811. owner: {
  12812. required: true,
  12813. type: "string"
  12814. },
  12815. repo: {
  12816. required: true,
  12817. type: "string"
  12818. }
  12819. },
  12820. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12821. },
  12822. deleteSecretFromRepo: {
  12823. method: "DELETE",
  12824. params: {
  12825. name: {
  12826. required: true,
  12827. type: "string"
  12828. },
  12829. owner: {
  12830. required: true,
  12831. type: "string"
  12832. },
  12833. repo: {
  12834. required: true,
  12835. type: "string"
  12836. }
  12837. },
  12838. url: "/repos/:owner/:repo/actions/secrets/:name"
  12839. },
  12840. downloadArtifact: {
  12841. method: "GET",
  12842. params: {
  12843. archive_format: {
  12844. required: true,
  12845. type: "string"
  12846. },
  12847. artifact_id: {
  12848. required: true,
  12849. type: "integer"
  12850. },
  12851. owner: {
  12852. required: true,
  12853. type: "string"
  12854. },
  12855. repo: {
  12856. required: true,
  12857. type: "string"
  12858. }
  12859. },
  12860. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12861. },
  12862. getArtifact: {
  12863. method: "GET",
  12864. params: {
  12865. artifact_id: {
  12866. required: true,
  12867. type: "integer"
  12868. },
  12869. owner: {
  12870. required: true,
  12871. type: "string"
  12872. },
  12873. repo: {
  12874. required: true,
  12875. type: "string"
  12876. }
  12877. },
  12878. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12879. },
  12880. getPublicKey: {
  12881. method: "GET",
  12882. params: {
  12883. owner: {
  12884. required: true,
  12885. type: "string"
  12886. },
  12887. repo: {
  12888. required: true,
  12889. type: "string"
  12890. }
  12891. },
  12892. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12893. },
  12894. getSecret: {
  12895. method: "GET",
  12896. params: {
  12897. name: {
  12898. required: true,
  12899. type: "string"
  12900. },
  12901. owner: {
  12902. required: true,
  12903. type: "string"
  12904. },
  12905. page: {
  12906. type: "integer"
  12907. },
  12908. per_page: {
  12909. type: "integer"
  12910. },
  12911. repo: {
  12912. required: true,
  12913. type: "string"
  12914. }
  12915. },
  12916. url: "/repos/:owner/:repo/actions/secrets/:name"
  12917. },
  12918. getSelfHostedRunner: {
  12919. method: "GET",
  12920. params: {
  12921. owner: {
  12922. required: true,
  12923. type: "string"
  12924. },
  12925. repo: {
  12926. required: true,
  12927. type: "string"
  12928. },
  12929. runner_id: {
  12930. required: true,
  12931. type: "integer"
  12932. }
  12933. },
  12934. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12935. },
  12936. getWorkflow: {
  12937. method: "GET",
  12938. params: {
  12939. owner: {
  12940. required: true,
  12941. type: "string"
  12942. },
  12943. repo: {
  12944. required: true,
  12945. type: "string"
  12946. },
  12947. workflow_id: {
  12948. required: true,
  12949. type: "integer"
  12950. }
  12951. },
  12952. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12953. },
  12954. getWorkflowJob: {
  12955. method: "GET",
  12956. params: {
  12957. job_id: {
  12958. required: true,
  12959. type: "integer"
  12960. },
  12961. owner: {
  12962. required: true,
  12963. type: "string"
  12964. },
  12965. repo: {
  12966. required: true,
  12967. type: "string"
  12968. }
  12969. },
  12970. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12971. },
  12972. getWorkflowRun: {
  12973. method: "GET",
  12974. params: {
  12975. owner: {
  12976. required: true,
  12977. type: "string"
  12978. },
  12979. repo: {
  12980. required: true,
  12981. type: "string"
  12982. },
  12983. run_id: {
  12984. required: true,
  12985. type: "integer"
  12986. }
  12987. },
  12988. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12989. },
  12990. listDownloadsForSelfHostedRunnerApplication: {
  12991. method: "GET",
  12992. params: {
  12993. owner: {
  12994. required: true,
  12995. type: "string"
  12996. },
  12997. repo: {
  12998. required: true,
  12999. type: "string"
  13000. }
  13001. },
  13002. url: "/repos/:owner/:repo/actions/runners/downloads"
  13003. },
  13004. listJobsForWorkflowRun: {
  13005. method: "GET",
  13006. params: {
  13007. owner: {
  13008. required: true,
  13009. type: "string"
  13010. },
  13011. page: {
  13012. type: "integer"
  13013. },
  13014. per_page: {
  13015. type: "integer"
  13016. },
  13017. repo: {
  13018. required: true,
  13019. type: "string"
  13020. },
  13021. run_id: {
  13022. required: true,
  13023. type: "integer"
  13024. }
  13025. },
  13026. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  13027. },
  13028. listRepoWorkflowRuns: {
  13029. method: "GET",
  13030. params: {
  13031. actor: {
  13032. type: "string"
  13033. },
  13034. branch: {
  13035. type: "string"
  13036. },
  13037. event: {
  13038. type: "string"
  13039. },
  13040. owner: {
  13041. required: true,
  13042. type: "string"
  13043. },
  13044. page: {
  13045. type: "integer"
  13046. },
  13047. per_page: {
  13048. type: "integer"
  13049. },
  13050. repo: {
  13051. required: true,
  13052. type: "string"
  13053. },
  13054. status: {
  13055. enum: ["completed", "status", "conclusion"],
  13056. type: "string"
  13057. }
  13058. },
  13059. url: "/repos/:owner/:repo/actions/runs"
  13060. },
  13061. listRepoWorkflows: {
  13062. method: "GET",
  13063. params: {
  13064. owner: {
  13065. required: true,
  13066. type: "string"
  13067. },
  13068. page: {
  13069. type: "integer"
  13070. },
  13071. per_page: {
  13072. type: "integer"
  13073. },
  13074. repo: {
  13075. required: true,
  13076. type: "string"
  13077. }
  13078. },
  13079. url: "/repos/:owner/:repo/actions/workflows"
  13080. },
  13081. listSecretsForRepo: {
  13082. method: "GET",
  13083. params: {
  13084. owner: {
  13085. required: true,
  13086. type: "string"
  13087. },
  13088. page: {
  13089. type: "integer"
  13090. },
  13091. per_page: {
  13092. type: "integer"
  13093. },
  13094. repo: {
  13095. required: true,
  13096. type: "string"
  13097. }
  13098. },
  13099. url: "/repos/:owner/:repo/actions/secrets"
  13100. },
  13101. listSelfHostedRunnersForRepo: {
  13102. method: "GET",
  13103. params: {
  13104. owner: {
  13105. required: true,
  13106. type: "string"
  13107. },
  13108. page: {
  13109. type: "integer"
  13110. },
  13111. per_page: {
  13112. type: "integer"
  13113. },
  13114. repo: {
  13115. required: true,
  13116. type: "string"
  13117. }
  13118. },
  13119. url: "/repos/:owner/:repo/actions/runners"
  13120. },
  13121. listWorkflowJobLogs: {
  13122. method: "GET",
  13123. params: {
  13124. job_id: {
  13125. required: true,
  13126. type: "integer"
  13127. },
  13128. owner: {
  13129. required: true,
  13130. type: "string"
  13131. },
  13132. page: {
  13133. type: "integer"
  13134. },
  13135. per_page: {
  13136. type: "integer"
  13137. },
  13138. repo: {
  13139. required: true,
  13140. type: "string"
  13141. }
  13142. },
  13143. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13144. },
  13145. listWorkflowRunArtifacts: {
  13146. method: "GET",
  13147. params: {
  13148. owner: {
  13149. required: true,
  13150. type: "string"
  13151. },
  13152. page: {
  13153. type: "integer"
  13154. },
  13155. per_page: {
  13156. type: "integer"
  13157. },
  13158. repo: {
  13159. required: true,
  13160. type: "string"
  13161. },
  13162. run_id: {
  13163. required: true,
  13164. type: "integer"
  13165. }
  13166. },
  13167. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13168. },
  13169. listWorkflowRunLogs: {
  13170. method: "GET",
  13171. params: {
  13172. owner: {
  13173. required: true,
  13174. type: "string"
  13175. },
  13176. page: {
  13177. type: "integer"
  13178. },
  13179. per_page: {
  13180. type: "integer"
  13181. },
  13182. repo: {
  13183. required: true,
  13184. type: "string"
  13185. },
  13186. run_id: {
  13187. required: true,
  13188. type: "integer"
  13189. }
  13190. },
  13191. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13192. },
  13193. listWorkflowRuns: {
  13194. method: "GET",
  13195. params: {
  13196. actor: {
  13197. type: "string"
  13198. },
  13199. branch: {
  13200. type: "string"
  13201. },
  13202. event: {
  13203. type: "string"
  13204. },
  13205. owner: {
  13206. required: true,
  13207. type: "string"
  13208. },
  13209. page: {
  13210. type: "integer"
  13211. },
  13212. per_page: {
  13213. type: "integer"
  13214. },
  13215. repo: {
  13216. required: true,
  13217. type: "string"
  13218. },
  13219. status: {
  13220. enum: ["completed", "status", "conclusion"],
  13221. type: "string"
  13222. },
  13223. workflow_id: {
  13224. required: true,
  13225. type: "integer"
  13226. }
  13227. },
  13228. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13229. },
  13230. reRunWorkflow: {
  13231. method: "POST",
  13232. params: {
  13233. owner: {
  13234. required: true,
  13235. type: "string"
  13236. },
  13237. repo: {
  13238. required: true,
  13239. type: "string"
  13240. },
  13241. run_id: {
  13242. required: true,
  13243. type: "integer"
  13244. }
  13245. },
  13246. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13247. },
  13248. removeSelfHostedRunner: {
  13249. method: "DELETE",
  13250. params: {
  13251. owner: {
  13252. required: true,
  13253. type: "string"
  13254. },
  13255. repo: {
  13256. required: true,
  13257. type: "string"
  13258. },
  13259. runner_id: {
  13260. required: true,
  13261. type: "integer"
  13262. }
  13263. },
  13264. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13265. }
  13266. },
  13267. activity: {
  13268. checkStarringRepo: {
  13269. method: "GET",
  13270. params: {
  13271. owner: {
  13272. required: true,
  13273. type: "string"
  13274. },
  13275. repo: {
  13276. required: true,
  13277. type: "string"
  13278. }
  13279. },
  13280. url: "/user/starred/:owner/:repo"
  13281. },
  13282. deleteRepoSubscription: {
  13283. method: "DELETE",
  13284. params: {
  13285. owner: {
  13286. required: true,
  13287. type: "string"
  13288. },
  13289. repo: {
  13290. required: true,
  13291. type: "string"
  13292. }
  13293. },
  13294. url: "/repos/:owner/:repo/subscription"
  13295. },
  13296. deleteThreadSubscription: {
  13297. method: "DELETE",
  13298. params: {
  13299. thread_id: {
  13300. required: true,
  13301. type: "integer"
  13302. }
  13303. },
  13304. url: "/notifications/threads/:thread_id/subscription"
  13305. },
  13306. getRepoSubscription: {
  13307. method: "GET",
  13308. params: {
  13309. owner: {
  13310. required: true,
  13311. type: "string"
  13312. },
  13313. repo: {
  13314. required: true,
  13315. type: "string"
  13316. }
  13317. },
  13318. url: "/repos/:owner/:repo/subscription"
  13319. },
  13320. getThread: {
  13321. method: "GET",
  13322. params: {
  13323. thread_id: {
  13324. required: true,
  13325. type: "integer"
  13326. }
  13327. },
  13328. url: "/notifications/threads/:thread_id"
  13329. },
  13330. getThreadSubscription: {
  13331. method: "GET",
  13332. params: {
  13333. thread_id: {
  13334. required: true,
  13335. type: "integer"
  13336. }
  13337. },
  13338. url: "/notifications/threads/:thread_id/subscription"
  13339. },
  13340. listEventsForOrg: {
  13341. method: "GET",
  13342. params: {
  13343. org: {
  13344. required: true,
  13345. type: "string"
  13346. },
  13347. page: {
  13348. type: "integer"
  13349. },
  13350. per_page: {
  13351. type: "integer"
  13352. },
  13353. username: {
  13354. required: true,
  13355. type: "string"
  13356. }
  13357. },
  13358. url: "/users/:username/events/orgs/:org"
  13359. },
  13360. listEventsForUser: {
  13361. method: "GET",
  13362. params: {
  13363. page: {
  13364. type: "integer"
  13365. },
  13366. per_page: {
  13367. type: "integer"
  13368. },
  13369. username: {
  13370. required: true,
  13371. type: "string"
  13372. }
  13373. },
  13374. url: "/users/:username/events"
  13375. },
  13376. listFeeds: {
  13377. method: "GET",
  13378. params: {},
  13379. url: "/feeds"
  13380. },
  13381. listNotifications: {
  13382. method: "GET",
  13383. params: {
  13384. all: {
  13385. type: "boolean"
  13386. },
  13387. before: {
  13388. type: "string"
  13389. },
  13390. page: {
  13391. type: "integer"
  13392. },
  13393. participating: {
  13394. type: "boolean"
  13395. },
  13396. per_page: {
  13397. type: "integer"
  13398. },
  13399. since: {
  13400. type: "string"
  13401. }
  13402. },
  13403. url: "/notifications"
  13404. },
  13405. listNotificationsForRepo: {
  13406. method: "GET",
  13407. params: {
  13408. all: {
  13409. type: "boolean"
  13410. },
  13411. before: {
  13412. type: "string"
  13413. },
  13414. owner: {
  13415. required: true,
  13416. type: "string"
  13417. },
  13418. page: {
  13419. type: "integer"
  13420. },
  13421. participating: {
  13422. type: "boolean"
  13423. },
  13424. per_page: {
  13425. type: "integer"
  13426. },
  13427. repo: {
  13428. required: true,
  13429. type: "string"
  13430. },
  13431. since: {
  13432. type: "string"
  13433. }
  13434. },
  13435. url: "/repos/:owner/:repo/notifications"
  13436. },
  13437. listPublicEvents: {
  13438. method: "GET",
  13439. params: {
  13440. page: {
  13441. type: "integer"
  13442. },
  13443. per_page: {
  13444. type: "integer"
  13445. }
  13446. },
  13447. url: "/events"
  13448. },
  13449. listPublicEventsForOrg: {
  13450. method: "GET",
  13451. params: {
  13452. org: {
  13453. required: true,
  13454. type: "string"
  13455. },
  13456. page: {
  13457. type: "integer"
  13458. },
  13459. per_page: {
  13460. type: "integer"
  13461. }
  13462. },
  13463. url: "/orgs/:org/events"
  13464. },
  13465. listPublicEventsForRepoNetwork: {
  13466. method: "GET",
  13467. params: {
  13468. owner: {
  13469. required: true,
  13470. type: "string"
  13471. },
  13472. page: {
  13473. type: "integer"
  13474. },
  13475. per_page: {
  13476. type: "integer"
  13477. },
  13478. repo: {
  13479. required: true,
  13480. type: "string"
  13481. }
  13482. },
  13483. url: "/networks/:owner/:repo/events"
  13484. },
  13485. listPublicEventsForUser: {
  13486. method: "GET",
  13487. params: {
  13488. page: {
  13489. type: "integer"
  13490. },
  13491. per_page: {
  13492. type: "integer"
  13493. },
  13494. username: {
  13495. required: true,
  13496. type: "string"
  13497. }
  13498. },
  13499. url: "/users/:username/events/public"
  13500. },
  13501. listReceivedEventsForUser: {
  13502. method: "GET",
  13503. params: {
  13504. page: {
  13505. type: "integer"
  13506. },
  13507. per_page: {
  13508. type: "integer"
  13509. },
  13510. username: {
  13511. required: true,
  13512. type: "string"
  13513. }
  13514. },
  13515. url: "/users/:username/received_events"
  13516. },
  13517. listReceivedPublicEventsForUser: {
  13518. method: "GET",
  13519. params: {
  13520. page: {
  13521. type: "integer"
  13522. },
  13523. per_page: {
  13524. type: "integer"
  13525. },
  13526. username: {
  13527. required: true,
  13528. type: "string"
  13529. }
  13530. },
  13531. url: "/users/:username/received_events/public"
  13532. },
  13533. listRepoEvents: {
  13534. method: "GET",
  13535. params: {
  13536. owner: {
  13537. required: true,
  13538. type: "string"
  13539. },
  13540. page: {
  13541. type: "integer"
  13542. },
  13543. per_page: {
  13544. type: "integer"
  13545. },
  13546. repo: {
  13547. required: true,
  13548. type: "string"
  13549. }
  13550. },
  13551. url: "/repos/:owner/:repo/events"
  13552. },
  13553. listReposStarredByAuthenticatedUser: {
  13554. method: "GET",
  13555. params: {
  13556. direction: {
  13557. enum: ["asc", "desc"],
  13558. type: "string"
  13559. },
  13560. page: {
  13561. type: "integer"
  13562. },
  13563. per_page: {
  13564. type: "integer"
  13565. },
  13566. sort: {
  13567. enum: ["created", "updated"],
  13568. type: "string"
  13569. }
  13570. },
  13571. url: "/user/starred"
  13572. },
  13573. listReposStarredByUser: {
  13574. method: "GET",
  13575. params: {
  13576. direction: {
  13577. enum: ["asc", "desc"],
  13578. type: "string"
  13579. },
  13580. page: {
  13581. type: "integer"
  13582. },
  13583. per_page: {
  13584. type: "integer"
  13585. },
  13586. sort: {
  13587. enum: ["created", "updated"],
  13588. type: "string"
  13589. },
  13590. username: {
  13591. required: true,
  13592. type: "string"
  13593. }
  13594. },
  13595. url: "/users/:username/starred"
  13596. },
  13597. listReposWatchedByUser: {
  13598. method: "GET",
  13599. params: {
  13600. page: {
  13601. type: "integer"
  13602. },
  13603. per_page: {
  13604. type: "integer"
  13605. },
  13606. username: {
  13607. required: true,
  13608. type: "string"
  13609. }
  13610. },
  13611. url: "/users/:username/subscriptions"
  13612. },
  13613. listStargazersForRepo: {
  13614. method: "GET",
  13615. params: {
  13616. owner: {
  13617. required: true,
  13618. type: "string"
  13619. },
  13620. page: {
  13621. type: "integer"
  13622. },
  13623. per_page: {
  13624. type: "integer"
  13625. },
  13626. repo: {
  13627. required: true,
  13628. type: "string"
  13629. }
  13630. },
  13631. url: "/repos/:owner/:repo/stargazers"
  13632. },
  13633. listWatchedReposForAuthenticatedUser: {
  13634. method: "GET",
  13635. params: {
  13636. page: {
  13637. type: "integer"
  13638. },
  13639. per_page: {
  13640. type: "integer"
  13641. }
  13642. },
  13643. url: "/user/subscriptions"
  13644. },
  13645. listWatchersForRepo: {
  13646. method: "GET",
  13647. params: {
  13648. owner: {
  13649. required: true,
  13650. type: "string"
  13651. },
  13652. page: {
  13653. type: "integer"
  13654. },
  13655. per_page: {
  13656. type: "integer"
  13657. },
  13658. repo: {
  13659. required: true,
  13660. type: "string"
  13661. }
  13662. },
  13663. url: "/repos/:owner/:repo/subscribers"
  13664. },
  13665. markAsRead: {
  13666. method: "PUT",
  13667. params: {
  13668. last_read_at: {
  13669. type: "string"
  13670. }
  13671. },
  13672. url: "/notifications"
  13673. },
  13674. markNotificationsAsReadForRepo: {
  13675. method: "PUT",
  13676. params: {
  13677. last_read_at: {
  13678. type: "string"
  13679. },
  13680. owner: {
  13681. required: true,
  13682. type: "string"
  13683. },
  13684. repo: {
  13685. required: true,
  13686. type: "string"
  13687. }
  13688. },
  13689. url: "/repos/:owner/:repo/notifications"
  13690. },
  13691. markThreadAsRead: {
  13692. method: "PATCH",
  13693. params: {
  13694. thread_id: {
  13695. required: true,
  13696. type: "integer"
  13697. }
  13698. },
  13699. url: "/notifications/threads/:thread_id"
  13700. },
  13701. setRepoSubscription: {
  13702. method: "PUT",
  13703. params: {
  13704. ignored: {
  13705. type: "boolean"
  13706. },
  13707. owner: {
  13708. required: true,
  13709. type: "string"
  13710. },
  13711. repo: {
  13712. required: true,
  13713. type: "string"
  13714. },
  13715. subscribed: {
  13716. type: "boolean"
  13717. }
  13718. },
  13719. url: "/repos/:owner/:repo/subscription"
  13720. },
  13721. setThreadSubscription: {
  13722. method: "PUT",
  13723. params: {
  13724. ignored: {
  13725. type: "boolean"
  13726. },
  13727. thread_id: {
  13728. required: true,
  13729. type: "integer"
  13730. }
  13731. },
  13732. url: "/notifications/threads/:thread_id/subscription"
  13733. },
  13734. starRepo: {
  13735. method: "PUT",
  13736. params: {
  13737. owner: {
  13738. required: true,
  13739. type: "string"
  13740. },
  13741. repo: {
  13742. required: true,
  13743. type: "string"
  13744. }
  13745. },
  13746. url: "/user/starred/:owner/:repo"
  13747. },
  13748. unstarRepo: {
  13749. method: "DELETE",
  13750. params: {
  13751. owner: {
  13752. required: true,
  13753. type: "string"
  13754. },
  13755. repo: {
  13756. required: true,
  13757. type: "string"
  13758. }
  13759. },
  13760. url: "/user/starred/:owner/:repo"
  13761. }
  13762. },
  13763. apps: {
  13764. addRepoToInstallation: {
  13765. headers: {
  13766. accept: "application/vnd.github.machine-man-preview+json"
  13767. },
  13768. method: "PUT",
  13769. params: {
  13770. installation_id: {
  13771. required: true,
  13772. type: "integer"
  13773. },
  13774. repository_id: {
  13775. required: true,
  13776. type: "integer"
  13777. }
  13778. },
  13779. url: "/user/installations/:installation_id/repositories/:repository_id"
  13780. },
  13781. checkAccountIsAssociatedWithAny: {
  13782. method: "GET",
  13783. params: {
  13784. account_id: {
  13785. required: true,
  13786. type: "integer"
  13787. }
  13788. },
  13789. url: "/marketplace_listing/accounts/:account_id"
  13790. },
  13791. checkAccountIsAssociatedWithAnyStubbed: {
  13792. method: "GET",
  13793. params: {
  13794. account_id: {
  13795. required: true,
  13796. type: "integer"
  13797. }
  13798. },
  13799. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13800. },
  13801. checkAuthorization: {
  13802. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13803. method: "GET",
  13804. params: {
  13805. access_token: {
  13806. required: true,
  13807. type: "string"
  13808. },
  13809. client_id: {
  13810. required: true,
  13811. type: "string"
  13812. }
  13813. },
  13814. url: "/applications/:client_id/tokens/:access_token"
  13815. },
  13816. checkToken: {
  13817. headers: {
  13818. accept: "application/vnd.github.doctor-strange-preview+json"
  13819. },
  13820. method: "POST",
  13821. params: {
  13822. access_token: {
  13823. type: "string"
  13824. },
  13825. client_id: {
  13826. required: true,
  13827. type: "string"
  13828. }
  13829. },
  13830. url: "/applications/:client_id/token"
  13831. },
  13832. createContentAttachment: {
  13833. headers: {
  13834. accept: "application/vnd.github.corsair-preview+json"
  13835. },
  13836. method: "POST",
  13837. params: {
  13838. body: {
  13839. required: true,
  13840. type: "string"
  13841. },
  13842. content_reference_id: {
  13843. required: true,
  13844. type: "integer"
  13845. },
  13846. title: {
  13847. required: true,
  13848. type: "string"
  13849. }
  13850. },
  13851. url: "/content_references/:content_reference_id/attachments"
  13852. },
  13853. createFromManifest: {
  13854. headers: {
  13855. accept: "application/vnd.github.fury-preview+json"
  13856. },
  13857. method: "POST",
  13858. params: {
  13859. code: {
  13860. required: true,
  13861. type: "string"
  13862. }
  13863. },
  13864. url: "/app-manifests/:code/conversions"
  13865. },
  13866. createInstallationToken: {
  13867. headers: {
  13868. accept: "application/vnd.github.machine-man-preview+json"
  13869. },
  13870. method: "POST",
  13871. params: {
  13872. installation_id: {
  13873. required: true,
  13874. type: "integer"
  13875. },
  13876. permissions: {
  13877. type: "object"
  13878. },
  13879. repository_ids: {
  13880. type: "integer[]"
  13881. }
  13882. },
  13883. url: "/app/installations/:installation_id/access_tokens"
  13884. },
  13885. deleteAuthorization: {
  13886. headers: {
  13887. accept: "application/vnd.github.doctor-strange-preview+json"
  13888. },
  13889. method: "DELETE",
  13890. params: {
  13891. access_token: {
  13892. type: "string"
  13893. },
  13894. client_id: {
  13895. required: true,
  13896. type: "string"
  13897. }
  13898. },
  13899. url: "/applications/:client_id/grant"
  13900. },
  13901. deleteInstallation: {
  13902. headers: {
  13903. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13904. },
  13905. method: "DELETE",
  13906. params: {
  13907. installation_id: {
  13908. required: true,
  13909. type: "integer"
  13910. }
  13911. },
  13912. url: "/app/installations/:installation_id"
  13913. },
  13914. deleteToken: {
  13915. headers: {
  13916. accept: "application/vnd.github.doctor-strange-preview+json"
  13917. },
  13918. method: "DELETE",
  13919. params: {
  13920. access_token: {
  13921. type: "string"
  13922. },
  13923. client_id: {
  13924. required: true,
  13925. type: "string"
  13926. }
  13927. },
  13928. url: "/applications/:client_id/token"
  13929. },
  13930. findOrgInstallation: {
  13931. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13932. headers: {
  13933. accept: "application/vnd.github.machine-man-preview+json"
  13934. },
  13935. method: "GET",
  13936. params: {
  13937. org: {
  13938. required: true,
  13939. type: "string"
  13940. }
  13941. },
  13942. url: "/orgs/:org/installation"
  13943. },
  13944. findRepoInstallation: {
  13945. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13946. headers: {
  13947. accept: "application/vnd.github.machine-man-preview+json"
  13948. },
  13949. method: "GET",
  13950. params: {
  13951. owner: {
  13952. required: true,
  13953. type: "string"
  13954. },
  13955. repo: {
  13956. required: true,
  13957. type: "string"
  13958. }
  13959. },
  13960. url: "/repos/:owner/:repo/installation"
  13961. },
  13962. findUserInstallation: {
  13963. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13964. headers: {
  13965. accept: "application/vnd.github.machine-man-preview+json"
  13966. },
  13967. method: "GET",
  13968. params: {
  13969. username: {
  13970. required: true,
  13971. type: "string"
  13972. }
  13973. },
  13974. url: "/users/:username/installation"
  13975. },
  13976. getAuthenticated: {
  13977. headers: {
  13978. accept: "application/vnd.github.machine-man-preview+json"
  13979. },
  13980. method: "GET",
  13981. params: {},
  13982. url: "/app"
  13983. },
  13984. getBySlug: {
  13985. headers: {
  13986. accept: "application/vnd.github.machine-man-preview+json"
  13987. },
  13988. method: "GET",
  13989. params: {
  13990. app_slug: {
  13991. required: true,
  13992. type: "string"
  13993. }
  13994. },
  13995. url: "/apps/:app_slug"
  13996. },
  13997. getInstallation: {
  13998. headers: {
  13999. accept: "application/vnd.github.machine-man-preview+json"
  14000. },
  14001. method: "GET",
  14002. params: {
  14003. installation_id: {
  14004. required: true,
  14005. type: "integer"
  14006. }
  14007. },
  14008. url: "/app/installations/:installation_id"
  14009. },
  14010. getOrgInstallation: {
  14011. headers: {
  14012. accept: "application/vnd.github.machine-man-preview+json"
  14013. },
  14014. method: "GET",
  14015. params: {
  14016. org: {
  14017. required: true,
  14018. type: "string"
  14019. }
  14020. },
  14021. url: "/orgs/:org/installation"
  14022. },
  14023. getRepoInstallation: {
  14024. headers: {
  14025. accept: "application/vnd.github.machine-man-preview+json"
  14026. },
  14027. method: "GET",
  14028. params: {
  14029. owner: {
  14030. required: true,
  14031. type: "string"
  14032. },
  14033. repo: {
  14034. required: true,
  14035. type: "string"
  14036. }
  14037. },
  14038. url: "/repos/:owner/:repo/installation"
  14039. },
  14040. getUserInstallation: {
  14041. headers: {
  14042. accept: "application/vnd.github.machine-man-preview+json"
  14043. },
  14044. method: "GET",
  14045. params: {
  14046. username: {
  14047. required: true,
  14048. type: "string"
  14049. }
  14050. },
  14051. url: "/users/:username/installation"
  14052. },
  14053. listAccountsUserOrOrgOnPlan: {
  14054. method: "GET",
  14055. params: {
  14056. direction: {
  14057. enum: ["asc", "desc"],
  14058. type: "string"
  14059. },
  14060. page: {
  14061. type: "integer"
  14062. },
  14063. per_page: {
  14064. type: "integer"
  14065. },
  14066. plan_id: {
  14067. required: true,
  14068. type: "integer"
  14069. },
  14070. sort: {
  14071. enum: ["created", "updated"],
  14072. type: "string"
  14073. }
  14074. },
  14075. url: "/marketplace_listing/plans/:plan_id/accounts"
  14076. },
  14077. listAccountsUserOrOrgOnPlanStubbed: {
  14078. method: "GET",
  14079. params: {
  14080. direction: {
  14081. enum: ["asc", "desc"],
  14082. type: "string"
  14083. },
  14084. page: {
  14085. type: "integer"
  14086. },
  14087. per_page: {
  14088. type: "integer"
  14089. },
  14090. plan_id: {
  14091. required: true,
  14092. type: "integer"
  14093. },
  14094. sort: {
  14095. enum: ["created", "updated"],
  14096. type: "string"
  14097. }
  14098. },
  14099. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14100. },
  14101. listInstallationReposForAuthenticatedUser: {
  14102. headers: {
  14103. accept: "application/vnd.github.machine-man-preview+json"
  14104. },
  14105. method: "GET",
  14106. params: {
  14107. installation_id: {
  14108. required: true,
  14109. type: "integer"
  14110. },
  14111. page: {
  14112. type: "integer"
  14113. },
  14114. per_page: {
  14115. type: "integer"
  14116. }
  14117. },
  14118. url: "/user/installations/:installation_id/repositories"
  14119. },
  14120. listInstallations: {
  14121. headers: {
  14122. accept: "application/vnd.github.machine-man-preview+json"
  14123. },
  14124. method: "GET",
  14125. params: {
  14126. page: {
  14127. type: "integer"
  14128. },
  14129. per_page: {
  14130. type: "integer"
  14131. }
  14132. },
  14133. url: "/app/installations"
  14134. },
  14135. listInstallationsForAuthenticatedUser: {
  14136. headers: {
  14137. accept: "application/vnd.github.machine-man-preview+json"
  14138. },
  14139. method: "GET",
  14140. params: {
  14141. page: {
  14142. type: "integer"
  14143. },
  14144. per_page: {
  14145. type: "integer"
  14146. }
  14147. },
  14148. url: "/user/installations"
  14149. },
  14150. listMarketplacePurchasesForAuthenticatedUser: {
  14151. method: "GET",
  14152. params: {
  14153. page: {
  14154. type: "integer"
  14155. },
  14156. per_page: {
  14157. type: "integer"
  14158. }
  14159. },
  14160. url: "/user/marketplace_purchases"
  14161. },
  14162. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14163. method: "GET",
  14164. params: {
  14165. page: {
  14166. type: "integer"
  14167. },
  14168. per_page: {
  14169. type: "integer"
  14170. }
  14171. },
  14172. url: "/user/marketplace_purchases/stubbed"
  14173. },
  14174. listPlans: {
  14175. method: "GET",
  14176. params: {
  14177. page: {
  14178. type: "integer"
  14179. },
  14180. per_page: {
  14181. type: "integer"
  14182. }
  14183. },
  14184. url: "/marketplace_listing/plans"
  14185. },
  14186. listPlansStubbed: {
  14187. method: "GET",
  14188. params: {
  14189. page: {
  14190. type: "integer"
  14191. },
  14192. per_page: {
  14193. type: "integer"
  14194. }
  14195. },
  14196. url: "/marketplace_listing/stubbed/plans"
  14197. },
  14198. listRepos: {
  14199. headers: {
  14200. accept: "application/vnd.github.machine-man-preview+json"
  14201. },
  14202. method: "GET",
  14203. params: {
  14204. page: {
  14205. type: "integer"
  14206. },
  14207. per_page: {
  14208. type: "integer"
  14209. }
  14210. },
  14211. url: "/installation/repositories"
  14212. },
  14213. removeRepoFromInstallation: {
  14214. headers: {
  14215. accept: "application/vnd.github.machine-man-preview+json"
  14216. },
  14217. method: "DELETE",
  14218. params: {
  14219. installation_id: {
  14220. required: true,
  14221. type: "integer"
  14222. },
  14223. repository_id: {
  14224. required: true,
  14225. type: "integer"
  14226. }
  14227. },
  14228. url: "/user/installations/:installation_id/repositories/:repository_id"
  14229. },
  14230. resetAuthorization: {
  14231. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14232. method: "POST",
  14233. params: {
  14234. access_token: {
  14235. required: true,
  14236. type: "string"
  14237. },
  14238. client_id: {
  14239. required: true,
  14240. type: "string"
  14241. }
  14242. },
  14243. url: "/applications/:client_id/tokens/:access_token"
  14244. },
  14245. resetToken: {
  14246. headers: {
  14247. accept: "application/vnd.github.doctor-strange-preview+json"
  14248. },
  14249. method: "PATCH",
  14250. params: {
  14251. access_token: {
  14252. type: "string"
  14253. },
  14254. client_id: {
  14255. required: true,
  14256. type: "string"
  14257. }
  14258. },
  14259. url: "/applications/:client_id/token"
  14260. },
  14261. revokeAuthorizationForApplication: {
  14262. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14263. method: "DELETE",
  14264. params: {
  14265. access_token: {
  14266. required: true,
  14267. type: "string"
  14268. },
  14269. client_id: {
  14270. required: true,
  14271. type: "string"
  14272. }
  14273. },
  14274. url: "/applications/:client_id/tokens/:access_token"
  14275. },
  14276. revokeGrantForApplication: {
  14277. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14278. method: "DELETE",
  14279. params: {
  14280. access_token: {
  14281. required: true,
  14282. type: "string"
  14283. },
  14284. client_id: {
  14285. required: true,
  14286. type: "string"
  14287. }
  14288. },
  14289. url: "/applications/:client_id/grants/:access_token"
  14290. },
  14291. revokeInstallationToken: {
  14292. headers: {
  14293. accept: "application/vnd.github.gambit-preview+json"
  14294. },
  14295. method: "DELETE",
  14296. params: {},
  14297. url: "/installation/token"
  14298. }
  14299. },
  14300. checks: {
  14301. create: {
  14302. headers: {
  14303. accept: "application/vnd.github.antiope-preview+json"
  14304. },
  14305. method: "POST",
  14306. params: {
  14307. actions: {
  14308. type: "object[]"
  14309. },
  14310. "actions[].description": {
  14311. required: true,
  14312. type: "string"
  14313. },
  14314. "actions[].identifier": {
  14315. required: true,
  14316. type: "string"
  14317. },
  14318. "actions[].label": {
  14319. required: true,
  14320. type: "string"
  14321. },
  14322. completed_at: {
  14323. type: "string"
  14324. },
  14325. conclusion: {
  14326. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14327. type: "string"
  14328. },
  14329. details_url: {
  14330. type: "string"
  14331. },
  14332. external_id: {
  14333. type: "string"
  14334. },
  14335. head_sha: {
  14336. required: true,
  14337. type: "string"
  14338. },
  14339. name: {
  14340. required: true,
  14341. type: "string"
  14342. },
  14343. output: {
  14344. type: "object"
  14345. },
  14346. "output.annotations": {
  14347. type: "object[]"
  14348. },
  14349. "output.annotations[].annotation_level": {
  14350. enum: ["notice", "warning", "failure"],
  14351. required: true,
  14352. type: "string"
  14353. },
  14354. "output.annotations[].end_column": {
  14355. type: "integer"
  14356. },
  14357. "output.annotations[].end_line": {
  14358. required: true,
  14359. type: "integer"
  14360. },
  14361. "output.annotations[].message": {
  14362. required: true,
  14363. type: "string"
  14364. },
  14365. "output.annotations[].path": {
  14366. required: true,
  14367. type: "string"
  14368. },
  14369. "output.annotations[].raw_details": {
  14370. type: "string"
  14371. },
  14372. "output.annotations[].start_column": {
  14373. type: "integer"
  14374. },
  14375. "output.annotations[].start_line": {
  14376. required: true,
  14377. type: "integer"
  14378. },
  14379. "output.annotations[].title": {
  14380. type: "string"
  14381. },
  14382. "output.images": {
  14383. type: "object[]"
  14384. },
  14385. "output.images[].alt": {
  14386. required: true,
  14387. type: "string"
  14388. },
  14389. "output.images[].caption": {
  14390. type: "string"
  14391. },
  14392. "output.images[].image_url": {
  14393. required: true,
  14394. type: "string"
  14395. },
  14396. "output.summary": {
  14397. required: true,
  14398. type: "string"
  14399. },
  14400. "output.text": {
  14401. type: "string"
  14402. },
  14403. "output.title": {
  14404. required: true,
  14405. type: "string"
  14406. },
  14407. owner: {
  14408. required: true,
  14409. type: "string"
  14410. },
  14411. repo: {
  14412. required: true,
  14413. type: "string"
  14414. },
  14415. started_at: {
  14416. type: "string"
  14417. },
  14418. status: {
  14419. enum: ["queued", "in_progress", "completed"],
  14420. type: "string"
  14421. }
  14422. },
  14423. url: "/repos/:owner/:repo/check-runs"
  14424. },
  14425. createSuite: {
  14426. headers: {
  14427. accept: "application/vnd.github.antiope-preview+json"
  14428. },
  14429. method: "POST",
  14430. params: {
  14431. head_sha: {
  14432. required: true,
  14433. type: "string"
  14434. },
  14435. owner: {
  14436. required: true,
  14437. type: "string"
  14438. },
  14439. repo: {
  14440. required: true,
  14441. type: "string"
  14442. }
  14443. },
  14444. url: "/repos/:owner/:repo/check-suites"
  14445. },
  14446. get: {
  14447. headers: {
  14448. accept: "application/vnd.github.antiope-preview+json"
  14449. },
  14450. method: "GET",
  14451. params: {
  14452. check_run_id: {
  14453. required: true,
  14454. type: "integer"
  14455. },
  14456. owner: {
  14457. required: true,
  14458. type: "string"
  14459. },
  14460. repo: {
  14461. required: true,
  14462. type: "string"
  14463. }
  14464. },
  14465. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14466. },
  14467. getSuite: {
  14468. headers: {
  14469. accept: "application/vnd.github.antiope-preview+json"
  14470. },
  14471. method: "GET",
  14472. params: {
  14473. check_suite_id: {
  14474. required: true,
  14475. type: "integer"
  14476. },
  14477. owner: {
  14478. required: true,
  14479. type: "string"
  14480. },
  14481. repo: {
  14482. required: true,
  14483. type: "string"
  14484. }
  14485. },
  14486. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14487. },
  14488. listAnnotations: {
  14489. headers: {
  14490. accept: "application/vnd.github.antiope-preview+json"
  14491. },
  14492. method: "GET",
  14493. params: {
  14494. check_run_id: {
  14495. required: true,
  14496. type: "integer"
  14497. },
  14498. owner: {
  14499. required: true,
  14500. type: "string"
  14501. },
  14502. page: {
  14503. type: "integer"
  14504. },
  14505. per_page: {
  14506. type: "integer"
  14507. },
  14508. repo: {
  14509. required: true,
  14510. type: "string"
  14511. }
  14512. },
  14513. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14514. },
  14515. listForRef: {
  14516. headers: {
  14517. accept: "application/vnd.github.antiope-preview+json"
  14518. },
  14519. method: "GET",
  14520. params: {
  14521. check_name: {
  14522. type: "string"
  14523. },
  14524. filter: {
  14525. enum: ["latest", "all"],
  14526. type: "string"
  14527. },
  14528. owner: {
  14529. required: true,
  14530. type: "string"
  14531. },
  14532. page: {
  14533. type: "integer"
  14534. },
  14535. per_page: {
  14536. type: "integer"
  14537. },
  14538. ref: {
  14539. required: true,
  14540. type: "string"
  14541. },
  14542. repo: {
  14543. required: true,
  14544. type: "string"
  14545. },
  14546. status: {
  14547. enum: ["queued", "in_progress", "completed"],
  14548. type: "string"
  14549. }
  14550. },
  14551. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14552. },
  14553. listForSuite: {
  14554. headers: {
  14555. accept: "application/vnd.github.antiope-preview+json"
  14556. },
  14557. method: "GET",
  14558. params: {
  14559. check_name: {
  14560. type: "string"
  14561. },
  14562. check_suite_id: {
  14563. required: true,
  14564. type: "integer"
  14565. },
  14566. filter: {
  14567. enum: ["latest", "all"],
  14568. type: "string"
  14569. },
  14570. owner: {
  14571. required: true,
  14572. type: "string"
  14573. },
  14574. page: {
  14575. type: "integer"
  14576. },
  14577. per_page: {
  14578. type: "integer"
  14579. },
  14580. repo: {
  14581. required: true,
  14582. type: "string"
  14583. },
  14584. status: {
  14585. enum: ["queued", "in_progress", "completed"],
  14586. type: "string"
  14587. }
  14588. },
  14589. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14590. },
  14591. listSuitesForRef: {
  14592. headers: {
  14593. accept: "application/vnd.github.antiope-preview+json"
  14594. },
  14595. method: "GET",
  14596. params: {
  14597. app_id: {
  14598. type: "integer"
  14599. },
  14600. check_name: {
  14601. type: "string"
  14602. },
  14603. owner: {
  14604. required: true,
  14605. type: "string"
  14606. },
  14607. page: {
  14608. type: "integer"
  14609. },
  14610. per_page: {
  14611. type: "integer"
  14612. },
  14613. ref: {
  14614. required: true,
  14615. type: "string"
  14616. },
  14617. repo: {
  14618. required: true,
  14619. type: "string"
  14620. }
  14621. },
  14622. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14623. },
  14624. rerequestSuite: {
  14625. headers: {
  14626. accept: "application/vnd.github.antiope-preview+json"
  14627. },
  14628. method: "POST",
  14629. params: {
  14630. check_suite_id: {
  14631. required: true,
  14632. type: "integer"
  14633. },
  14634. owner: {
  14635. required: true,
  14636. type: "string"
  14637. },
  14638. repo: {
  14639. required: true,
  14640. type: "string"
  14641. }
  14642. },
  14643. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14644. },
  14645. setSuitesPreferences: {
  14646. headers: {
  14647. accept: "application/vnd.github.antiope-preview+json"
  14648. },
  14649. method: "PATCH",
  14650. params: {
  14651. auto_trigger_checks: {
  14652. type: "object[]"
  14653. },
  14654. "auto_trigger_checks[].app_id": {
  14655. required: true,
  14656. type: "integer"
  14657. },
  14658. "auto_trigger_checks[].setting": {
  14659. required: true,
  14660. type: "boolean"
  14661. },
  14662. owner: {
  14663. required: true,
  14664. type: "string"
  14665. },
  14666. repo: {
  14667. required: true,
  14668. type: "string"
  14669. }
  14670. },
  14671. url: "/repos/:owner/:repo/check-suites/preferences"
  14672. },
  14673. update: {
  14674. headers: {
  14675. accept: "application/vnd.github.antiope-preview+json"
  14676. },
  14677. method: "PATCH",
  14678. params: {
  14679. actions: {
  14680. type: "object[]"
  14681. },
  14682. "actions[].description": {
  14683. required: true,
  14684. type: "string"
  14685. },
  14686. "actions[].identifier": {
  14687. required: true,
  14688. type: "string"
  14689. },
  14690. "actions[].label": {
  14691. required: true,
  14692. type: "string"
  14693. },
  14694. check_run_id: {
  14695. required: true,
  14696. type: "integer"
  14697. },
  14698. completed_at: {
  14699. type: "string"
  14700. },
  14701. conclusion: {
  14702. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14703. type: "string"
  14704. },
  14705. details_url: {
  14706. type: "string"
  14707. },
  14708. external_id: {
  14709. type: "string"
  14710. },
  14711. name: {
  14712. type: "string"
  14713. },
  14714. output: {
  14715. type: "object"
  14716. },
  14717. "output.annotations": {
  14718. type: "object[]"
  14719. },
  14720. "output.annotations[].annotation_level": {
  14721. enum: ["notice", "warning", "failure"],
  14722. required: true,
  14723. type: "string"
  14724. },
  14725. "output.annotations[].end_column": {
  14726. type: "integer"
  14727. },
  14728. "output.annotations[].end_line": {
  14729. required: true,
  14730. type: "integer"
  14731. },
  14732. "output.annotations[].message": {
  14733. required: true,
  14734. type: "string"
  14735. },
  14736. "output.annotations[].path": {
  14737. required: true,
  14738. type: "string"
  14739. },
  14740. "output.annotations[].raw_details": {
  14741. type: "string"
  14742. },
  14743. "output.annotations[].start_column": {
  14744. type: "integer"
  14745. },
  14746. "output.annotations[].start_line": {
  14747. required: true,
  14748. type: "integer"
  14749. },
  14750. "output.annotations[].title": {
  14751. type: "string"
  14752. },
  14753. "output.images": {
  14754. type: "object[]"
  14755. },
  14756. "output.images[].alt": {
  14757. required: true,
  14758. type: "string"
  14759. },
  14760. "output.images[].caption": {
  14761. type: "string"
  14762. },
  14763. "output.images[].image_url": {
  14764. required: true,
  14765. type: "string"
  14766. },
  14767. "output.summary": {
  14768. required: true,
  14769. type: "string"
  14770. },
  14771. "output.text": {
  14772. type: "string"
  14773. },
  14774. "output.title": {
  14775. type: "string"
  14776. },
  14777. owner: {
  14778. required: true,
  14779. type: "string"
  14780. },
  14781. repo: {
  14782. required: true,
  14783. type: "string"
  14784. },
  14785. started_at: {
  14786. type: "string"
  14787. },
  14788. status: {
  14789. enum: ["queued", "in_progress", "completed"],
  14790. type: "string"
  14791. }
  14792. },
  14793. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14794. }
  14795. },
  14796. codesOfConduct: {
  14797. getConductCode: {
  14798. headers: {
  14799. accept: "application/vnd.github.scarlet-witch-preview+json"
  14800. },
  14801. method: "GET",
  14802. params: {
  14803. key: {
  14804. required: true,
  14805. type: "string"
  14806. }
  14807. },
  14808. url: "/codes_of_conduct/:key"
  14809. },
  14810. getForRepo: {
  14811. headers: {
  14812. accept: "application/vnd.github.scarlet-witch-preview+json"
  14813. },
  14814. method: "GET",
  14815. params: {
  14816. owner: {
  14817. required: true,
  14818. type: "string"
  14819. },
  14820. repo: {
  14821. required: true,
  14822. type: "string"
  14823. }
  14824. },
  14825. url: "/repos/:owner/:repo/community/code_of_conduct"
  14826. },
  14827. listConductCodes: {
  14828. headers: {
  14829. accept: "application/vnd.github.scarlet-witch-preview+json"
  14830. },
  14831. method: "GET",
  14832. params: {},
  14833. url: "/codes_of_conduct"
  14834. }
  14835. },
  14836. emojis: {
  14837. get: {
  14838. method: "GET",
  14839. params: {},
  14840. url: "/emojis"
  14841. }
  14842. },
  14843. gists: {
  14844. checkIsStarred: {
  14845. method: "GET",
  14846. params: {
  14847. gist_id: {
  14848. required: true,
  14849. type: "string"
  14850. }
  14851. },
  14852. url: "/gists/:gist_id/star"
  14853. },
  14854. create: {
  14855. method: "POST",
  14856. params: {
  14857. description: {
  14858. type: "string"
  14859. },
  14860. files: {
  14861. required: true,
  14862. type: "object"
  14863. },
  14864. "files.content": {
  14865. type: "string"
  14866. },
  14867. public: {
  14868. type: "boolean"
  14869. }
  14870. },
  14871. url: "/gists"
  14872. },
  14873. createComment: {
  14874. method: "POST",
  14875. params: {
  14876. body: {
  14877. required: true,
  14878. type: "string"
  14879. },
  14880. gist_id: {
  14881. required: true,
  14882. type: "string"
  14883. }
  14884. },
  14885. url: "/gists/:gist_id/comments"
  14886. },
  14887. delete: {
  14888. method: "DELETE",
  14889. params: {
  14890. gist_id: {
  14891. required: true,
  14892. type: "string"
  14893. }
  14894. },
  14895. url: "/gists/:gist_id"
  14896. },
  14897. deleteComment: {
  14898. method: "DELETE",
  14899. params: {
  14900. comment_id: {
  14901. required: true,
  14902. type: "integer"
  14903. },
  14904. gist_id: {
  14905. required: true,
  14906. type: "string"
  14907. }
  14908. },
  14909. url: "/gists/:gist_id/comments/:comment_id"
  14910. },
  14911. fork: {
  14912. method: "POST",
  14913. params: {
  14914. gist_id: {
  14915. required: true,
  14916. type: "string"
  14917. }
  14918. },
  14919. url: "/gists/:gist_id/forks"
  14920. },
  14921. get: {
  14922. method: "GET",
  14923. params: {
  14924. gist_id: {
  14925. required: true,
  14926. type: "string"
  14927. }
  14928. },
  14929. url: "/gists/:gist_id"
  14930. },
  14931. getComment: {
  14932. method: "GET",
  14933. params: {
  14934. comment_id: {
  14935. required: true,
  14936. type: "integer"
  14937. },
  14938. gist_id: {
  14939. required: true,
  14940. type: "string"
  14941. }
  14942. },
  14943. url: "/gists/:gist_id/comments/:comment_id"
  14944. },
  14945. getRevision: {
  14946. method: "GET",
  14947. params: {
  14948. gist_id: {
  14949. required: true,
  14950. type: "string"
  14951. },
  14952. sha: {
  14953. required: true,
  14954. type: "string"
  14955. }
  14956. },
  14957. url: "/gists/:gist_id/:sha"
  14958. },
  14959. list: {
  14960. method: "GET",
  14961. params: {
  14962. page: {
  14963. type: "integer"
  14964. },
  14965. per_page: {
  14966. type: "integer"
  14967. },
  14968. since: {
  14969. type: "string"
  14970. }
  14971. },
  14972. url: "/gists"
  14973. },
  14974. listComments: {
  14975. method: "GET",
  14976. params: {
  14977. gist_id: {
  14978. required: true,
  14979. type: "string"
  14980. },
  14981. page: {
  14982. type: "integer"
  14983. },
  14984. per_page: {
  14985. type: "integer"
  14986. }
  14987. },
  14988. url: "/gists/:gist_id/comments"
  14989. },
  14990. listCommits: {
  14991. method: "GET",
  14992. params: {
  14993. gist_id: {
  14994. required: true,
  14995. type: "string"
  14996. },
  14997. page: {
  14998. type: "integer"
  14999. },
  15000. per_page: {
  15001. type: "integer"
  15002. }
  15003. },
  15004. url: "/gists/:gist_id/commits"
  15005. },
  15006. listForks: {
  15007. method: "GET",
  15008. params: {
  15009. gist_id: {
  15010. required: true,
  15011. type: "string"
  15012. },
  15013. page: {
  15014. type: "integer"
  15015. },
  15016. per_page: {
  15017. type: "integer"
  15018. }
  15019. },
  15020. url: "/gists/:gist_id/forks"
  15021. },
  15022. listPublic: {
  15023. method: "GET",
  15024. params: {
  15025. page: {
  15026. type: "integer"
  15027. },
  15028. per_page: {
  15029. type: "integer"
  15030. },
  15031. since: {
  15032. type: "string"
  15033. }
  15034. },
  15035. url: "/gists/public"
  15036. },
  15037. listPublicForUser: {
  15038. method: "GET",
  15039. params: {
  15040. page: {
  15041. type: "integer"
  15042. },
  15043. per_page: {
  15044. type: "integer"
  15045. },
  15046. since: {
  15047. type: "string"
  15048. },
  15049. username: {
  15050. required: true,
  15051. type: "string"
  15052. }
  15053. },
  15054. url: "/users/:username/gists"
  15055. },
  15056. listStarred: {
  15057. method: "GET",
  15058. params: {
  15059. page: {
  15060. type: "integer"
  15061. },
  15062. per_page: {
  15063. type: "integer"
  15064. },
  15065. since: {
  15066. type: "string"
  15067. }
  15068. },
  15069. url: "/gists/starred"
  15070. },
  15071. star: {
  15072. method: "PUT",
  15073. params: {
  15074. gist_id: {
  15075. required: true,
  15076. type: "string"
  15077. }
  15078. },
  15079. url: "/gists/:gist_id/star"
  15080. },
  15081. unstar: {
  15082. method: "DELETE",
  15083. params: {
  15084. gist_id: {
  15085. required: true,
  15086. type: "string"
  15087. }
  15088. },
  15089. url: "/gists/:gist_id/star"
  15090. },
  15091. update: {
  15092. method: "PATCH",
  15093. params: {
  15094. description: {
  15095. type: "string"
  15096. },
  15097. files: {
  15098. type: "object"
  15099. },
  15100. "files.content": {
  15101. type: "string"
  15102. },
  15103. "files.filename": {
  15104. type: "string"
  15105. },
  15106. gist_id: {
  15107. required: true,
  15108. type: "string"
  15109. }
  15110. },
  15111. url: "/gists/:gist_id"
  15112. },
  15113. updateComment: {
  15114. method: "PATCH",
  15115. params: {
  15116. body: {
  15117. required: true,
  15118. type: "string"
  15119. },
  15120. comment_id: {
  15121. required: true,
  15122. type: "integer"
  15123. },
  15124. gist_id: {
  15125. required: true,
  15126. type: "string"
  15127. }
  15128. },
  15129. url: "/gists/:gist_id/comments/:comment_id"
  15130. }
  15131. },
  15132. git: {
  15133. createBlob: {
  15134. method: "POST",
  15135. params: {
  15136. content: {
  15137. required: true,
  15138. type: "string"
  15139. },
  15140. encoding: {
  15141. type: "string"
  15142. },
  15143. owner: {
  15144. required: true,
  15145. type: "string"
  15146. },
  15147. repo: {
  15148. required: true,
  15149. type: "string"
  15150. }
  15151. },
  15152. url: "/repos/:owner/:repo/git/blobs"
  15153. },
  15154. createCommit: {
  15155. method: "POST",
  15156. params: {
  15157. author: {
  15158. type: "object"
  15159. },
  15160. "author.date": {
  15161. type: "string"
  15162. },
  15163. "author.email": {
  15164. type: "string"
  15165. },
  15166. "author.name": {
  15167. type: "string"
  15168. },
  15169. committer: {
  15170. type: "object"
  15171. },
  15172. "committer.date": {
  15173. type: "string"
  15174. },
  15175. "committer.email": {
  15176. type: "string"
  15177. },
  15178. "committer.name": {
  15179. type: "string"
  15180. },
  15181. message: {
  15182. required: true,
  15183. type: "string"
  15184. },
  15185. owner: {
  15186. required: true,
  15187. type: "string"
  15188. },
  15189. parents: {
  15190. required: true,
  15191. type: "string[]"
  15192. },
  15193. repo: {
  15194. required: true,
  15195. type: "string"
  15196. },
  15197. signature: {
  15198. type: "string"
  15199. },
  15200. tree: {
  15201. required: true,
  15202. type: "string"
  15203. }
  15204. },
  15205. url: "/repos/:owner/:repo/git/commits"
  15206. },
  15207. createRef: {
  15208. method: "POST",
  15209. params: {
  15210. owner: {
  15211. required: true,
  15212. type: "string"
  15213. },
  15214. ref: {
  15215. required: true,
  15216. type: "string"
  15217. },
  15218. repo: {
  15219. required: true,
  15220. type: "string"
  15221. },
  15222. sha: {
  15223. required: true,
  15224. type: "string"
  15225. }
  15226. },
  15227. url: "/repos/:owner/:repo/git/refs"
  15228. },
  15229. createTag: {
  15230. method: "POST",
  15231. params: {
  15232. message: {
  15233. required: true,
  15234. type: "string"
  15235. },
  15236. object: {
  15237. required: true,
  15238. type: "string"
  15239. },
  15240. owner: {
  15241. required: true,
  15242. type: "string"
  15243. },
  15244. repo: {
  15245. required: true,
  15246. type: "string"
  15247. },
  15248. tag: {
  15249. required: true,
  15250. type: "string"
  15251. },
  15252. tagger: {
  15253. type: "object"
  15254. },
  15255. "tagger.date": {
  15256. type: "string"
  15257. },
  15258. "tagger.email": {
  15259. type: "string"
  15260. },
  15261. "tagger.name": {
  15262. type: "string"
  15263. },
  15264. type: {
  15265. enum: ["commit", "tree", "blob"],
  15266. required: true,
  15267. type: "string"
  15268. }
  15269. },
  15270. url: "/repos/:owner/:repo/git/tags"
  15271. },
  15272. createTree: {
  15273. method: "POST",
  15274. params: {
  15275. base_tree: {
  15276. type: "string"
  15277. },
  15278. owner: {
  15279. required: true,
  15280. type: "string"
  15281. },
  15282. repo: {
  15283. required: true,
  15284. type: "string"
  15285. },
  15286. tree: {
  15287. required: true,
  15288. type: "object[]"
  15289. },
  15290. "tree[].content": {
  15291. type: "string"
  15292. },
  15293. "tree[].mode": {
  15294. enum: ["100644", "100755", "040000", "160000", "120000"],
  15295. type: "string"
  15296. },
  15297. "tree[].path": {
  15298. type: "string"
  15299. },
  15300. "tree[].sha": {
  15301. allowNull: true,
  15302. type: "string"
  15303. },
  15304. "tree[].type": {
  15305. enum: ["blob", "tree", "commit"],
  15306. type: "string"
  15307. }
  15308. },
  15309. url: "/repos/:owner/:repo/git/trees"
  15310. },
  15311. deleteRef: {
  15312. method: "DELETE",
  15313. params: {
  15314. owner: {
  15315. required: true,
  15316. type: "string"
  15317. },
  15318. ref: {
  15319. required: true,
  15320. type: "string"
  15321. },
  15322. repo: {
  15323. required: true,
  15324. type: "string"
  15325. }
  15326. },
  15327. url: "/repos/:owner/:repo/git/refs/:ref"
  15328. },
  15329. getBlob: {
  15330. method: "GET",
  15331. params: {
  15332. file_sha: {
  15333. required: true,
  15334. type: "string"
  15335. },
  15336. owner: {
  15337. required: true,
  15338. type: "string"
  15339. },
  15340. repo: {
  15341. required: true,
  15342. type: "string"
  15343. }
  15344. },
  15345. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15346. },
  15347. getCommit: {
  15348. method: "GET",
  15349. params: {
  15350. commit_sha: {
  15351. required: true,
  15352. type: "string"
  15353. },
  15354. owner: {
  15355. required: true,
  15356. type: "string"
  15357. },
  15358. repo: {
  15359. required: true,
  15360. type: "string"
  15361. }
  15362. },
  15363. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15364. },
  15365. getRef: {
  15366. method: "GET",
  15367. params: {
  15368. owner: {
  15369. required: true,
  15370. type: "string"
  15371. },
  15372. ref: {
  15373. required: true,
  15374. type: "string"
  15375. },
  15376. repo: {
  15377. required: true,
  15378. type: "string"
  15379. }
  15380. },
  15381. url: "/repos/:owner/:repo/git/ref/:ref"
  15382. },
  15383. getTag: {
  15384. method: "GET",
  15385. params: {
  15386. owner: {
  15387. required: true,
  15388. type: "string"
  15389. },
  15390. repo: {
  15391. required: true,
  15392. type: "string"
  15393. },
  15394. tag_sha: {
  15395. required: true,
  15396. type: "string"
  15397. }
  15398. },
  15399. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15400. },
  15401. getTree: {
  15402. method: "GET",
  15403. params: {
  15404. owner: {
  15405. required: true,
  15406. type: "string"
  15407. },
  15408. recursive: {
  15409. enum: ["1"],
  15410. type: "integer"
  15411. },
  15412. repo: {
  15413. required: true,
  15414. type: "string"
  15415. },
  15416. tree_sha: {
  15417. required: true,
  15418. type: "string"
  15419. }
  15420. },
  15421. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15422. },
  15423. listMatchingRefs: {
  15424. method: "GET",
  15425. params: {
  15426. owner: {
  15427. required: true,
  15428. type: "string"
  15429. },
  15430. page: {
  15431. type: "integer"
  15432. },
  15433. per_page: {
  15434. type: "integer"
  15435. },
  15436. ref: {
  15437. required: true,
  15438. type: "string"
  15439. },
  15440. repo: {
  15441. required: true,
  15442. type: "string"
  15443. }
  15444. },
  15445. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15446. },
  15447. listRefs: {
  15448. method: "GET",
  15449. params: {
  15450. namespace: {
  15451. type: "string"
  15452. },
  15453. owner: {
  15454. required: true,
  15455. type: "string"
  15456. },
  15457. page: {
  15458. type: "integer"
  15459. },
  15460. per_page: {
  15461. type: "integer"
  15462. },
  15463. repo: {
  15464. required: true,
  15465. type: "string"
  15466. }
  15467. },
  15468. url: "/repos/:owner/:repo/git/refs/:namespace"
  15469. },
  15470. updateRef: {
  15471. method: "PATCH",
  15472. params: {
  15473. force: {
  15474. type: "boolean"
  15475. },
  15476. owner: {
  15477. required: true,
  15478. type: "string"
  15479. },
  15480. ref: {
  15481. required: true,
  15482. type: "string"
  15483. },
  15484. repo: {
  15485. required: true,
  15486. type: "string"
  15487. },
  15488. sha: {
  15489. required: true,
  15490. type: "string"
  15491. }
  15492. },
  15493. url: "/repos/:owner/:repo/git/refs/:ref"
  15494. }
  15495. },
  15496. gitignore: {
  15497. getTemplate: {
  15498. method: "GET",
  15499. params: {
  15500. name: {
  15501. required: true,
  15502. type: "string"
  15503. }
  15504. },
  15505. url: "/gitignore/templates/:name"
  15506. },
  15507. listTemplates: {
  15508. method: "GET",
  15509. params: {},
  15510. url: "/gitignore/templates"
  15511. }
  15512. },
  15513. interactions: {
  15514. addOrUpdateRestrictionsForOrg: {
  15515. headers: {
  15516. accept: "application/vnd.github.sombra-preview+json"
  15517. },
  15518. method: "PUT",
  15519. params: {
  15520. limit: {
  15521. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15522. required: true,
  15523. type: "string"
  15524. },
  15525. org: {
  15526. required: true,
  15527. type: "string"
  15528. }
  15529. },
  15530. url: "/orgs/:org/interaction-limits"
  15531. },
  15532. addOrUpdateRestrictionsForRepo: {
  15533. headers: {
  15534. accept: "application/vnd.github.sombra-preview+json"
  15535. },
  15536. method: "PUT",
  15537. params: {
  15538. limit: {
  15539. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15540. required: true,
  15541. type: "string"
  15542. },
  15543. owner: {
  15544. required: true,
  15545. type: "string"
  15546. },
  15547. repo: {
  15548. required: true,
  15549. type: "string"
  15550. }
  15551. },
  15552. url: "/repos/:owner/:repo/interaction-limits"
  15553. },
  15554. getRestrictionsForOrg: {
  15555. headers: {
  15556. accept: "application/vnd.github.sombra-preview+json"
  15557. },
  15558. method: "GET",
  15559. params: {
  15560. org: {
  15561. required: true,
  15562. type: "string"
  15563. }
  15564. },
  15565. url: "/orgs/:org/interaction-limits"
  15566. },
  15567. getRestrictionsForRepo: {
  15568. headers: {
  15569. accept: "application/vnd.github.sombra-preview+json"
  15570. },
  15571. method: "GET",
  15572. params: {
  15573. owner: {
  15574. required: true,
  15575. type: "string"
  15576. },
  15577. repo: {
  15578. required: true,
  15579. type: "string"
  15580. }
  15581. },
  15582. url: "/repos/:owner/:repo/interaction-limits"
  15583. },
  15584. removeRestrictionsForOrg: {
  15585. headers: {
  15586. accept: "application/vnd.github.sombra-preview+json"
  15587. },
  15588. method: "DELETE",
  15589. params: {
  15590. org: {
  15591. required: true,
  15592. type: "string"
  15593. }
  15594. },
  15595. url: "/orgs/:org/interaction-limits"
  15596. },
  15597. removeRestrictionsForRepo: {
  15598. headers: {
  15599. accept: "application/vnd.github.sombra-preview+json"
  15600. },
  15601. method: "DELETE",
  15602. params: {
  15603. owner: {
  15604. required: true,
  15605. type: "string"
  15606. },
  15607. repo: {
  15608. required: true,
  15609. type: "string"
  15610. }
  15611. },
  15612. url: "/repos/:owner/:repo/interaction-limits"
  15613. }
  15614. },
  15615. issues: {
  15616. addAssignees: {
  15617. method: "POST",
  15618. params: {
  15619. assignees: {
  15620. type: "string[]"
  15621. },
  15622. issue_number: {
  15623. required: true,
  15624. type: "integer"
  15625. },
  15626. number: {
  15627. alias: "issue_number",
  15628. deprecated: true,
  15629. type: "integer"
  15630. },
  15631. owner: {
  15632. required: true,
  15633. type: "string"
  15634. },
  15635. repo: {
  15636. required: true,
  15637. type: "string"
  15638. }
  15639. },
  15640. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15641. },
  15642. addLabels: {
  15643. method: "POST",
  15644. params: {
  15645. issue_number: {
  15646. required: true,
  15647. type: "integer"
  15648. },
  15649. labels: {
  15650. required: true,
  15651. type: "string[]"
  15652. },
  15653. number: {
  15654. alias: "issue_number",
  15655. deprecated: true,
  15656. type: "integer"
  15657. },
  15658. owner: {
  15659. required: true,
  15660. type: "string"
  15661. },
  15662. repo: {
  15663. required: true,
  15664. type: "string"
  15665. }
  15666. },
  15667. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15668. },
  15669. checkAssignee: {
  15670. method: "GET",
  15671. params: {
  15672. assignee: {
  15673. required: true,
  15674. type: "string"
  15675. },
  15676. owner: {
  15677. required: true,
  15678. type: "string"
  15679. },
  15680. repo: {
  15681. required: true,
  15682. type: "string"
  15683. }
  15684. },
  15685. url: "/repos/:owner/:repo/assignees/:assignee"
  15686. },
  15687. create: {
  15688. method: "POST",
  15689. params: {
  15690. assignee: {
  15691. type: "string"
  15692. },
  15693. assignees: {
  15694. type: "string[]"
  15695. },
  15696. body: {
  15697. type: "string"
  15698. },
  15699. labels: {
  15700. type: "string[]"
  15701. },
  15702. milestone: {
  15703. type: "integer"
  15704. },
  15705. owner: {
  15706. required: true,
  15707. type: "string"
  15708. },
  15709. repo: {
  15710. required: true,
  15711. type: "string"
  15712. },
  15713. title: {
  15714. required: true,
  15715. type: "string"
  15716. }
  15717. },
  15718. url: "/repos/:owner/:repo/issues"
  15719. },
  15720. createComment: {
  15721. method: "POST",
  15722. params: {
  15723. body: {
  15724. required: true,
  15725. type: "string"
  15726. },
  15727. issue_number: {
  15728. required: true,
  15729. type: "integer"
  15730. },
  15731. number: {
  15732. alias: "issue_number",
  15733. deprecated: true,
  15734. type: "integer"
  15735. },
  15736. owner: {
  15737. required: true,
  15738. type: "string"
  15739. },
  15740. repo: {
  15741. required: true,
  15742. type: "string"
  15743. }
  15744. },
  15745. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15746. },
  15747. createLabel: {
  15748. method: "POST",
  15749. params: {
  15750. color: {
  15751. required: true,
  15752. type: "string"
  15753. },
  15754. description: {
  15755. type: "string"
  15756. },
  15757. name: {
  15758. required: true,
  15759. type: "string"
  15760. },
  15761. owner: {
  15762. required: true,
  15763. type: "string"
  15764. },
  15765. repo: {
  15766. required: true,
  15767. type: "string"
  15768. }
  15769. },
  15770. url: "/repos/:owner/:repo/labels"
  15771. },
  15772. createMilestone: {
  15773. method: "POST",
  15774. params: {
  15775. description: {
  15776. type: "string"
  15777. },
  15778. due_on: {
  15779. type: "string"
  15780. },
  15781. owner: {
  15782. required: true,
  15783. type: "string"
  15784. },
  15785. repo: {
  15786. required: true,
  15787. type: "string"
  15788. },
  15789. state: {
  15790. enum: ["open", "closed"],
  15791. type: "string"
  15792. },
  15793. title: {
  15794. required: true,
  15795. type: "string"
  15796. }
  15797. },
  15798. url: "/repos/:owner/:repo/milestones"
  15799. },
  15800. deleteComment: {
  15801. method: "DELETE",
  15802. params: {
  15803. comment_id: {
  15804. required: true,
  15805. type: "integer"
  15806. },
  15807. owner: {
  15808. required: true,
  15809. type: "string"
  15810. },
  15811. repo: {
  15812. required: true,
  15813. type: "string"
  15814. }
  15815. },
  15816. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15817. },
  15818. deleteLabel: {
  15819. method: "DELETE",
  15820. params: {
  15821. name: {
  15822. required: true,
  15823. type: "string"
  15824. },
  15825. owner: {
  15826. required: true,
  15827. type: "string"
  15828. },
  15829. repo: {
  15830. required: true,
  15831. type: "string"
  15832. }
  15833. },
  15834. url: "/repos/:owner/:repo/labels/:name"
  15835. },
  15836. deleteMilestone: {
  15837. method: "DELETE",
  15838. params: {
  15839. milestone_number: {
  15840. required: true,
  15841. type: "integer"
  15842. },
  15843. number: {
  15844. alias: "milestone_number",
  15845. deprecated: true,
  15846. type: "integer"
  15847. },
  15848. owner: {
  15849. required: true,
  15850. type: "string"
  15851. },
  15852. repo: {
  15853. required: true,
  15854. type: "string"
  15855. }
  15856. },
  15857. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15858. },
  15859. get: {
  15860. method: "GET",
  15861. params: {
  15862. issue_number: {
  15863. required: true,
  15864. type: "integer"
  15865. },
  15866. number: {
  15867. alias: "issue_number",
  15868. deprecated: true,
  15869. type: "integer"
  15870. },
  15871. owner: {
  15872. required: true,
  15873. type: "string"
  15874. },
  15875. repo: {
  15876. required: true,
  15877. type: "string"
  15878. }
  15879. },
  15880. url: "/repos/:owner/:repo/issues/:issue_number"
  15881. },
  15882. getComment: {
  15883. method: "GET",
  15884. params: {
  15885. comment_id: {
  15886. required: true,
  15887. type: "integer"
  15888. },
  15889. owner: {
  15890. required: true,
  15891. type: "string"
  15892. },
  15893. repo: {
  15894. required: true,
  15895. type: "string"
  15896. }
  15897. },
  15898. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15899. },
  15900. getEvent: {
  15901. method: "GET",
  15902. params: {
  15903. event_id: {
  15904. required: true,
  15905. type: "integer"
  15906. },
  15907. owner: {
  15908. required: true,
  15909. type: "string"
  15910. },
  15911. repo: {
  15912. required: true,
  15913. type: "string"
  15914. }
  15915. },
  15916. url: "/repos/:owner/:repo/issues/events/:event_id"
  15917. },
  15918. getLabel: {
  15919. method: "GET",
  15920. params: {
  15921. name: {
  15922. required: true,
  15923. type: "string"
  15924. },
  15925. owner: {
  15926. required: true,
  15927. type: "string"
  15928. },
  15929. repo: {
  15930. required: true,
  15931. type: "string"
  15932. }
  15933. },
  15934. url: "/repos/:owner/:repo/labels/:name"
  15935. },
  15936. getMilestone: {
  15937. method: "GET",
  15938. params: {
  15939. milestone_number: {
  15940. required: true,
  15941. type: "integer"
  15942. },
  15943. number: {
  15944. alias: "milestone_number",
  15945. deprecated: true,
  15946. type: "integer"
  15947. },
  15948. owner: {
  15949. required: true,
  15950. type: "string"
  15951. },
  15952. repo: {
  15953. required: true,
  15954. type: "string"
  15955. }
  15956. },
  15957. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15958. },
  15959. list: {
  15960. method: "GET",
  15961. params: {
  15962. direction: {
  15963. enum: ["asc", "desc"],
  15964. type: "string"
  15965. },
  15966. filter: {
  15967. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15968. type: "string"
  15969. },
  15970. labels: {
  15971. type: "string"
  15972. },
  15973. page: {
  15974. type: "integer"
  15975. },
  15976. per_page: {
  15977. type: "integer"
  15978. },
  15979. since: {
  15980. type: "string"
  15981. },
  15982. sort: {
  15983. enum: ["created", "updated", "comments"],
  15984. type: "string"
  15985. },
  15986. state: {
  15987. enum: ["open", "closed", "all"],
  15988. type: "string"
  15989. }
  15990. },
  15991. url: "/issues"
  15992. },
  15993. listAssignees: {
  15994. method: "GET",
  15995. params: {
  15996. owner: {
  15997. required: true,
  15998. type: "string"
  15999. },
  16000. page: {
  16001. type: "integer"
  16002. },
  16003. per_page: {
  16004. type: "integer"
  16005. },
  16006. repo: {
  16007. required: true,
  16008. type: "string"
  16009. }
  16010. },
  16011. url: "/repos/:owner/:repo/assignees"
  16012. },
  16013. listComments: {
  16014. method: "GET",
  16015. params: {
  16016. issue_number: {
  16017. required: true,
  16018. type: "integer"
  16019. },
  16020. number: {
  16021. alias: "issue_number",
  16022. deprecated: true,
  16023. type: "integer"
  16024. },
  16025. owner: {
  16026. required: true,
  16027. type: "string"
  16028. },
  16029. page: {
  16030. type: "integer"
  16031. },
  16032. per_page: {
  16033. type: "integer"
  16034. },
  16035. repo: {
  16036. required: true,
  16037. type: "string"
  16038. },
  16039. since: {
  16040. type: "string"
  16041. }
  16042. },
  16043. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16044. },
  16045. listCommentsForRepo: {
  16046. method: "GET",
  16047. params: {
  16048. direction: {
  16049. enum: ["asc", "desc"],
  16050. type: "string"
  16051. },
  16052. owner: {
  16053. required: true,
  16054. type: "string"
  16055. },
  16056. repo: {
  16057. required: true,
  16058. type: "string"
  16059. },
  16060. since: {
  16061. type: "string"
  16062. },
  16063. sort: {
  16064. enum: ["created", "updated"],
  16065. type: "string"
  16066. }
  16067. },
  16068. url: "/repos/:owner/:repo/issues/comments"
  16069. },
  16070. listEvents: {
  16071. method: "GET",
  16072. params: {
  16073. issue_number: {
  16074. required: true,
  16075. type: "integer"
  16076. },
  16077. number: {
  16078. alias: "issue_number",
  16079. deprecated: true,
  16080. type: "integer"
  16081. },
  16082. owner: {
  16083. required: true,
  16084. type: "string"
  16085. },
  16086. page: {
  16087. type: "integer"
  16088. },
  16089. per_page: {
  16090. type: "integer"
  16091. },
  16092. repo: {
  16093. required: true,
  16094. type: "string"
  16095. }
  16096. },
  16097. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16098. },
  16099. listEventsForRepo: {
  16100. method: "GET",
  16101. params: {
  16102. owner: {
  16103. required: true,
  16104. type: "string"
  16105. },
  16106. page: {
  16107. type: "integer"
  16108. },
  16109. per_page: {
  16110. type: "integer"
  16111. },
  16112. repo: {
  16113. required: true,
  16114. type: "string"
  16115. }
  16116. },
  16117. url: "/repos/:owner/:repo/issues/events"
  16118. },
  16119. listEventsForTimeline: {
  16120. headers: {
  16121. accept: "application/vnd.github.mockingbird-preview+json"
  16122. },
  16123. method: "GET",
  16124. params: {
  16125. issue_number: {
  16126. required: true,
  16127. type: "integer"
  16128. },
  16129. number: {
  16130. alias: "issue_number",
  16131. deprecated: true,
  16132. type: "integer"
  16133. },
  16134. owner: {
  16135. required: true,
  16136. type: "string"
  16137. },
  16138. page: {
  16139. type: "integer"
  16140. },
  16141. per_page: {
  16142. type: "integer"
  16143. },
  16144. repo: {
  16145. required: true,
  16146. type: "string"
  16147. }
  16148. },
  16149. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16150. },
  16151. listForAuthenticatedUser: {
  16152. method: "GET",
  16153. params: {
  16154. direction: {
  16155. enum: ["asc", "desc"],
  16156. type: "string"
  16157. },
  16158. filter: {
  16159. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16160. type: "string"
  16161. },
  16162. labels: {
  16163. type: "string"
  16164. },
  16165. page: {
  16166. type: "integer"
  16167. },
  16168. per_page: {
  16169. type: "integer"
  16170. },
  16171. since: {
  16172. type: "string"
  16173. },
  16174. sort: {
  16175. enum: ["created", "updated", "comments"],
  16176. type: "string"
  16177. },
  16178. state: {
  16179. enum: ["open", "closed", "all"],
  16180. type: "string"
  16181. }
  16182. },
  16183. url: "/user/issues"
  16184. },
  16185. listForOrg: {
  16186. method: "GET",
  16187. params: {
  16188. direction: {
  16189. enum: ["asc", "desc"],
  16190. type: "string"
  16191. },
  16192. filter: {
  16193. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16194. type: "string"
  16195. },
  16196. labels: {
  16197. type: "string"
  16198. },
  16199. org: {
  16200. required: true,
  16201. type: "string"
  16202. },
  16203. page: {
  16204. type: "integer"
  16205. },
  16206. per_page: {
  16207. type: "integer"
  16208. },
  16209. since: {
  16210. type: "string"
  16211. },
  16212. sort: {
  16213. enum: ["created", "updated", "comments"],
  16214. type: "string"
  16215. },
  16216. state: {
  16217. enum: ["open", "closed", "all"],
  16218. type: "string"
  16219. }
  16220. },
  16221. url: "/orgs/:org/issues"
  16222. },
  16223. listForRepo: {
  16224. method: "GET",
  16225. params: {
  16226. assignee: {
  16227. type: "string"
  16228. },
  16229. creator: {
  16230. type: "string"
  16231. },
  16232. direction: {
  16233. enum: ["asc", "desc"],
  16234. type: "string"
  16235. },
  16236. labels: {
  16237. type: "string"
  16238. },
  16239. mentioned: {
  16240. type: "string"
  16241. },
  16242. milestone: {
  16243. type: "string"
  16244. },
  16245. owner: {
  16246. required: true,
  16247. type: "string"
  16248. },
  16249. page: {
  16250. type: "integer"
  16251. },
  16252. per_page: {
  16253. type: "integer"
  16254. },
  16255. repo: {
  16256. required: true,
  16257. type: "string"
  16258. },
  16259. since: {
  16260. type: "string"
  16261. },
  16262. sort: {
  16263. enum: ["created", "updated", "comments"],
  16264. type: "string"
  16265. },
  16266. state: {
  16267. enum: ["open", "closed", "all"],
  16268. type: "string"
  16269. }
  16270. },
  16271. url: "/repos/:owner/:repo/issues"
  16272. },
  16273. listLabelsForMilestone: {
  16274. method: "GET",
  16275. params: {
  16276. milestone_number: {
  16277. required: true,
  16278. type: "integer"
  16279. },
  16280. number: {
  16281. alias: "milestone_number",
  16282. deprecated: true,
  16283. type: "integer"
  16284. },
  16285. owner: {
  16286. required: true,
  16287. type: "string"
  16288. },
  16289. page: {
  16290. type: "integer"
  16291. },
  16292. per_page: {
  16293. type: "integer"
  16294. },
  16295. repo: {
  16296. required: true,
  16297. type: "string"
  16298. }
  16299. },
  16300. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16301. },
  16302. listLabelsForRepo: {
  16303. method: "GET",
  16304. params: {
  16305. owner: {
  16306. required: true,
  16307. type: "string"
  16308. },
  16309. page: {
  16310. type: "integer"
  16311. },
  16312. per_page: {
  16313. type: "integer"
  16314. },
  16315. repo: {
  16316. required: true,
  16317. type: "string"
  16318. }
  16319. },
  16320. url: "/repos/:owner/:repo/labels"
  16321. },
  16322. listLabelsOnIssue: {
  16323. method: "GET",
  16324. params: {
  16325. issue_number: {
  16326. required: true,
  16327. type: "integer"
  16328. },
  16329. number: {
  16330. alias: "issue_number",
  16331. deprecated: true,
  16332. type: "integer"
  16333. },
  16334. owner: {
  16335. required: true,
  16336. type: "string"
  16337. },
  16338. page: {
  16339. type: "integer"
  16340. },
  16341. per_page: {
  16342. type: "integer"
  16343. },
  16344. repo: {
  16345. required: true,
  16346. type: "string"
  16347. }
  16348. },
  16349. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16350. },
  16351. listMilestonesForRepo: {
  16352. method: "GET",
  16353. params: {
  16354. direction: {
  16355. enum: ["asc", "desc"],
  16356. type: "string"
  16357. },
  16358. owner: {
  16359. required: true,
  16360. type: "string"
  16361. },
  16362. page: {
  16363. type: "integer"
  16364. },
  16365. per_page: {
  16366. type: "integer"
  16367. },
  16368. repo: {
  16369. required: true,
  16370. type: "string"
  16371. },
  16372. sort: {
  16373. enum: ["due_on", "completeness"],
  16374. type: "string"
  16375. },
  16376. state: {
  16377. enum: ["open", "closed", "all"],
  16378. type: "string"
  16379. }
  16380. },
  16381. url: "/repos/:owner/:repo/milestones"
  16382. },
  16383. lock: {
  16384. method: "PUT",
  16385. params: {
  16386. issue_number: {
  16387. required: true,
  16388. type: "integer"
  16389. },
  16390. lock_reason: {
  16391. enum: ["off-topic", "too heated", "resolved", "spam"],
  16392. type: "string"
  16393. },
  16394. number: {
  16395. alias: "issue_number",
  16396. deprecated: true,
  16397. type: "integer"
  16398. },
  16399. owner: {
  16400. required: true,
  16401. type: "string"
  16402. },
  16403. repo: {
  16404. required: true,
  16405. type: "string"
  16406. }
  16407. },
  16408. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16409. },
  16410. removeAssignees: {
  16411. method: "DELETE",
  16412. params: {
  16413. assignees: {
  16414. type: "string[]"
  16415. },
  16416. issue_number: {
  16417. required: true,
  16418. type: "integer"
  16419. },
  16420. number: {
  16421. alias: "issue_number",
  16422. deprecated: true,
  16423. type: "integer"
  16424. },
  16425. owner: {
  16426. required: true,
  16427. type: "string"
  16428. },
  16429. repo: {
  16430. required: true,
  16431. type: "string"
  16432. }
  16433. },
  16434. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16435. },
  16436. removeLabel: {
  16437. method: "DELETE",
  16438. params: {
  16439. issue_number: {
  16440. required: true,
  16441. type: "integer"
  16442. },
  16443. name: {
  16444. required: true,
  16445. type: "string"
  16446. },
  16447. number: {
  16448. alias: "issue_number",
  16449. deprecated: true,
  16450. type: "integer"
  16451. },
  16452. owner: {
  16453. required: true,
  16454. type: "string"
  16455. },
  16456. repo: {
  16457. required: true,
  16458. type: "string"
  16459. }
  16460. },
  16461. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16462. },
  16463. removeLabels: {
  16464. method: "DELETE",
  16465. params: {
  16466. issue_number: {
  16467. required: true,
  16468. type: "integer"
  16469. },
  16470. number: {
  16471. alias: "issue_number",
  16472. deprecated: true,
  16473. type: "integer"
  16474. },
  16475. owner: {
  16476. required: true,
  16477. type: "string"
  16478. },
  16479. repo: {
  16480. required: true,
  16481. type: "string"
  16482. }
  16483. },
  16484. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16485. },
  16486. replaceLabels: {
  16487. method: "PUT",
  16488. params: {
  16489. issue_number: {
  16490. required: true,
  16491. type: "integer"
  16492. },
  16493. labels: {
  16494. type: "string[]"
  16495. },
  16496. number: {
  16497. alias: "issue_number",
  16498. deprecated: true,
  16499. type: "integer"
  16500. },
  16501. owner: {
  16502. required: true,
  16503. type: "string"
  16504. },
  16505. repo: {
  16506. required: true,
  16507. type: "string"
  16508. }
  16509. },
  16510. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16511. },
  16512. unlock: {
  16513. method: "DELETE",
  16514. params: {
  16515. issue_number: {
  16516. required: true,
  16517. type: "integer"
  16518. },
  16519. number: {
  16520. alias: "issue_number",
  16521. deprecated: true,
  16522. type: "integer"
  16523. },
  16524. owner: {
  16525. required: true,
  16526. type: "string"
  16527. },
  16528. repo: {
  16529. required: true,
  16530. type: "string"
  16531. }
  16532. },
  16533. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16534. },
  16535. update: {
  16536. method: "PATCH",
  16537. params: {
  16538. assignee: {
  16539. type: "string"
  16540. },
  16541. assignees: {
  16542. type: "string[]"
  16543. },
  16544. body: {
  16545. type: "string"
  16546. },
  16547. issue_number: {
  16548. required: true,
  16549. type: "integer"
  16550. },
  16551. labels: {
  16552. type: "string[]"
  16553. },
  16554. milestone: {
  16555. allowNull: true,
  16556. type: "integer"
  16557. },
  16558. number: {
  16559. alias: "issue_number",
  16560. deprecated: true,
  16561. type: "integer"
  16562. },
  16563. owner: {
  16564. required: true,
  16565. type: "string"
  16566. },
  16567. repo: {
  16568. required: true,
  16569. type: "string"
  16570. },
  16571. state: {
  16572. enum: ["open", "closed"],
  16573. type: "string"
  16574. },
  16575. title: {
  16576. type: "string"
  16577. }
  16578. },
  16579. url: "/repos/:owner/:repo/issues/:issue_number"
  16580. },
  16581. updateComment: {
  16582. method: "PATCH",
  16583. params: {
  16584. body: {
  16585. required: true,
  16586. type: "string"
  16587. },
  16588. comment_id: {
  16589. required: true,
  16590. type: "integer"
  16591. },
  16592. owner: {
  16593. required: true,
  16594. type: "string"
  16595. },
  16596. repo: {
  16597. required: true,
  16598. type: "string"
  16599. }
  16600. },
  16601. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16602. },
  16603. updateLabel: {
  16604. method: "PATCH",
  16605. params: {
  16606. color: {
  16607. type: "string"
  16608. },
  16609. current_name: {
  16610. required: true,
  16611. type: "string"
  16612. },
  16613. description: {
  16614. type: "string"
  16615. },
  16616. name: {
  16617. type: "string"
  16618. },
  16619. owner: {
  16620. required: true,
  16621. type: "string"
  16622. },
  16623. repo: {
  16624. required: true,
  16625. type: "string"
  16626. }
  16627. },
  16628. url: "/repos/:owner/:repo/labels/:current_name"
  16629. },
  16630. updateMilestone: {
  16631. method: "PATCH",
  16632. params: {
  16633. description: {
  16634. type: "string"
  16635. },
  16636. due_on: {
  16637. type: "string"
  16638. },
  16639. milestone_number: {
  16640. required: true,
  16641. type: "integer"
  16642. },
  16643. number: {
  16644. alias: "milestone_number",
  16645. deprecated: true,
  16646. type: "integer"
  16647. },
  16648. owner: {
  16649. required: true,
  16650. type: "string"
  16651. },
  16652. repo: {
  16653. required: true,
  16654. type: "string"
  16655. },
  16656. state: {
  16657. enum: ["open", "closed"],
  16658. type: "string"
  16659. },
  16660. title: {
  16661. type: "string"
  16662. }
  16663. },
  16664. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16665. }
  16666. },
  16667. licenses: {
  16668. get: {
  16669. method: "GET",
  16670. params: {
  16671. license: {
  16672. required: true,
  16673. type: "string"
  16674. }
  16675. },
  16676. url: "/licenses/:license"
  16677. },
  16678. getForRepo: {
  16679. method: "GET",
  16680. params: {
  16681. owner: {
  16682. required: true,
  16683. type: "string"
  16684. },
  16685. repo: {
  16686. required: true,
  16687. type: "string"
  16688. }
  16689. },
  16690. url: "/repos/:owner/:repo/license"
  16691. },
  16692. list: {
  16693. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16694. method: "GET",
  16695. params: {},
  16696. url: "/licenses"
  16697. },
  16698. listCommonlyUsed: {
  16699. method: "GET",
  16700. params: {},
  16701. url: "/licenses"
  16702. }
  16703. },
  16704. markdown: {
  16705. render: {
  16706. method: "POST",
  16707. params: {
  16708. context: {
  16709. type: "string"
  16710. },
  16711. mode: {
  16712. enum: ["markdown", "gfm"],
  16713. type: "string"
  16714. },
  16715. text: {
  16716. required: true,
  16717. type: "string"
  16718. }
  16719. },
  16720. url: "/markdown"
  16721. },
  16722. renderRaw: {
  16723. headers: {
  16724. "content-type": "text/plain; charset=utf-8"
  16725. },
  16726. method: "POST",
  16727. params: {
  16728. data: {
  16729. mapTo: "data",
  16730. required: true,
  16731. type: "string"
  16732. }
  16733. },
  16734. url: "/markdown/raw"
  16735. }
  16736. },
  16737. meta: {
  16738. get: {
  16739. method: "GET",
  16740. params: {},
  16741. url: "/meta"
  16742. }
  16743. },
  16744. migrations: {
  16745. cancelImport: {
  16746. method: "DELETE",
  16747. params: {
  16748. owner: {
  16749. required: true,
  16750. type: "string"
  16751. },
  16752. repo: {
  16753. required: true,
  16754. type: "string"
  16755. }
  16756. },
  16757. url: "/repos/:owner/:repo/import"
  16758. },
  16759. deleteArchiveForAuthenticatedUser: {
  16760. headers: {
  16761. accept: "application/vnd.github.wyandotte-preview+json"
  16762. },
  16763. method: "DELETE",
  16764. params: {
  16765. migration_id: {
  16766. required: true,
  16767. type: "integer"
  16768. }
  16769. },
  16770. url: "/user/migrations/:migration_id/archive"
  16771. },
  16772. deleteArchiveForOrg: {
  16773. headers: {
  16774. accept: "application/vnd.github.wyandotte-preview+json"
  16775. },
  16776. method: "DELETE",
  16777. params: {
  16778. migration_id: {
  16779. required: true,
  16780. type: "integer"
  16781. },
  16782. org: {
  16783. required: true,
  16784. type: "string"
  16785. }
  16786. },
  16787. url: "/orgs/:org/migrations/:migration_id/archive"
  16788. },
  16789. downloadArchiveForOrg: {
  16790. headers: {
  16791. accept: "application/vnd.github.wyandotte-preview+json"
  16792. },
  16793. method: "GET",
  16794. params: {
  16795. migration_id: {
  16796. required: true,
  16797. type: "integer"
  16798. },
  16799. org: {
  16800. required: true,
  16801. type: "string"
  16802. }
  16803. },
  16804. url: "/orgs/:org/migrations/:migration_id/archive"
  16805. },
  16806. getArchiveForAuthenticatedUser: {
  16807. headers: {
  16808. accept: "application/vnd.github.wyandotte-preview+json"
  16809. },
  16810. method: "GET",
  16811. params: {
  16812. migration_id: {
  16813. required: true,
  16814. type: "integer"
  16815. }
  16816. },
  16817. url: "/user/migrations/:migration_id/archive"
  16818. },
  16819. getArchiveForOrg: {
  16820. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16821. headers: {
  16822. accept: "application/vnd.github.wyandotte-preview+json"
  16823. },
  16824. method: "GET",
  16825. params: {
  16826. migration_id: {
  16827. required: true,
  16828. type: "integer"
  16829. },
  16830. org: {
  16831. required: true,
  16832. type: "string"
  16833. }
  16834. },
  16835. url: "/orgs/:org/migrations/:migration_id/archive"
  16836. },
  16837. getCommitAuthors: {
  16838. method: "GET",
  16839. params: {
  16840. owner: {
  16841. required: true,
  16842. type: "string"
  16843. },
  16844. repo: {
  16845. required: true,
  16846. type: "string"
  16847. },
  16848. since: {
  16849. type: "string"
  16850. }
  16851. },
  16852. url: "/repos/:owner/:repo/import/authors"
  16853. },
  16854. getImportProgress: {
  16855. method: "GET",
  16856. params: {
  16857. owner: {
  16858. required: true,
  16859. type: "string"
  16860. },
  16861. repo: {
  16862. required: true,
  16863. type: "string"
  16864. }
  16865. },
  16866. url: "/repos/:owner/:repo/import"
  16867. },
  16868. getLargeFiles: {
  16869. method: "GET",
  16870. params: {
  16871. owner: {
  16872. required: true,
  16873. type: "string"
  16874. },
  16875. repo: {
  16876. required: true,
  16877. type: "string"
  16878. }
  16879. },
  16880. url: "/repos/:owner/:repo/import/large_files"
  16881. },
  16882. getStatusForAuthenticatedUser: {
  16883. headers: {
  16884. accept: "application/vnd.github.wyandotte-preview+json"
  16885. },
  16886. method: "GET",
  16887. params: {
  16888. migration_id: {
  16889. required: true,
  16890. type: "integer"
  16891. }
  16892. },
  16893. url: "/user/migrations/:migration_id"
  16894. },
  16895. getStatusForOrg: {
  16896. headers: {
  16897. accept: "application/vnd.github.wyandotte-preview+json"
  16898. },
  16899. method: "GET",
  16900. params: {
  16901. migration_id: {
  16902. required: true,
  16903. type: "integer"
  16904. },
  16905. org: {
  16906. required: true,
  16907. type: "string"
  16908. }
  16909. },
  16910. url: "/orgs/:org/migrations/:migration_id"
  16911. },
  16912. listForAuthenticatedUser: {
  16913. headers: {
  16914. accept: "application/vnd.github.wyandotte-preview+json"
  16915. },
  16916. method: "GET",
  16917. params: {
  16918. page: {
  16919. type: "integer"
  16920. },
  16921. per_page: {
  16922. type: "integer"
  16923. }
  16924. },
  16925. url: "/user/migrations"
  16926. },
  16927. listForOrg: {
  16928. headers: {
  16929. accept: "application/vnd.github.wyandotte-preview+json"
  16930. },
  16931. method: "GET",
  16932. params: {
  16933. org: {
  16934. required: true,
  16935. type: "string"
  16936. },
  16937. page: {
  16938. type: "integer"
  16939. },
  16940. per_page: {
  16941. type: "integer"
  16942. }
  16943. },
  16944. url: "/orgs/:org/migrations"
  16945. },
  16946. listReposForOrg: {
  16947. headers: {
  16948. accept: "application/vnd.github.wyandotte-preview+json"
  16949. },
  16950. method: "GET",
  16951. params: {
  16952. migration_id: {
  16953. required: true,
  16954. type: "integer"
  16955. },
  16956. org: {
  16957. required: true,
  16958. type: "string"
  16959. },
  16960. page: {
  16961. type: "integer"
  16962. },
  16963. per_page: {
  16964. type: "integer"
  16965. }
  16966. },
  16967. url: "/orgs/:org/migrations/:migration_id/repositories"
  16968. },
  16969. listReposForUser: {
  16970. headers: {
  16971. accept: "application/vnd.github.wyandotte-preview+json"
  16972. },
  16973. method: "GET",
  16974. params: {
  16975. migration_id: {
  16976. required: true,
  16977. type: "integer"
  16978. },
  16979. page: {
  16980. type: "integer"
  16981. },
  16982. per_page: {
  16983. type: "integer"
  16984. }
  16985. },
  16986. url: "/user/:migration_id/repositories"
  16987. },
  16988. mapCommitAuthor: {
  16989. method: "PATCH",
  16990. params: {
  16991. author_id: {
  16992. required: true,
  16993. type: "integer"
  16994. },
  16995. email: {
  16996. type: "string"
  16997. },
  16998. name: {
  16999. type: "string"
  17000. },
  17001. owner: {
  17002. required: true,
  17003. type: "string"
  17004. },
  17005. repo: {
  17006. required: true,
  17007. type: "string"
  17008. }
  17009. },
  17010. url: "/repos/:owner/:repo/import/authors/:author_id"
  17011. },
  17012. setLfsPreference: {
  17013. method: "PATCH",
  17014. params: {
  17015. owner: {
  17016. required: true,
  17017. type: "string"
  17018. },
  17019. repo: {
  17020. required: true,
  17021. type: "string"
  17022. },
  17023. use_lfs: {
  17024. enum: ["opt_in", "opt_out"],
  17025. required: true,
  17026. type: "string"
  17027. }
  17028. },
  17029. url: "/repos/:owner/:repo/import/lfs"
  17030. },
  17031. startForAuthenticatedUser: {
  17032. method: "POST",
  17033. params: {
  17034. exclude_attachments: {
  17035. type: "boolean"
  17036. },
  17037. lock_repositories: {
  17038. type: "boolean"
  17039. },
  17040. repositories: {
  17041. required: true,
  17042. type: "string[]"
  17043. }
  17044. },
  17045. url: "/user/migrations"
  17046. },
  17047. startForOrg: {
  17048. method: "POST",
  17049. params: {
  17050. exclude_attachments: {
  17051. type: "boolean"
  17052. },
  17053. lock_repositories: {
  17054. type: "boolean"
  17055. },
  17056. org: {
  17057. required: true,
  17058. type: "string"
  17059. },
  17060. repositories: {
  17061. required: true,
  17062. type: "string[]"
  17063. }
  17064. },
  17065. url: "/orgs/:org/migrations"
  17066. },
  17067. startImport: {
  17068. method: "PUT",
  17069. params: {
  17070. owner: {
  17071. required: true,
  17072. type: "string"
  17073. },
  17074. repo: {
  17075. required: true,
  17076. type: "string"
  17077. },
  17078. tfvc_project: {
  17079. type: "string"
  17080. },
  17081. vcs: {
  17082. enum: ["subversion", "git", "mercurial", "tfvc"],
  17083. type: "string"
  17084. },
  17085. vcs_password: {
  17086. type: "string"
  17087. },
  17088. vcs_url: {
  17089. required: true,
  17090. type: "string"
  17091. },
  17092. vcs_username: {
  17093. type: "string"
  17094. }
  17095. },
  17096. url: "/repos/:owner/:repo/import"
  17097. },
  17098. unlockRepoForAuthenticatedUser: {
  17099. headers: {
  17100. accept: "application/vnd.github.wyandotte-preview+json"
  17101. },
  17102. method: "DELETE",
  17103. params: {
  17104. migration_id: {
  17105. required: true,
  17106. type: "integer"
  17107. },
  17108. repo_name: {
  17109. required: true,
  17110. type: "string"
  17111. }
  17112. },
  17113. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17114. },
  17115. unlockRepoForOrg: {
  17116. headers: {
  17117. accept: "application/vnd.github.wyandotte-preview+json"
  17118. },
  17119. method: "DELETE",
  17120. params: {
  17121. migration_id: {
  17122. required: true,
  17123. type: "integer"
  17124. },
  17125. org: {
  17126. required: true,
  17127. type: "string"
  17128. },
  17129. repo_name: {
  17130. required: true,
  17131. type: "string"
  17132. }
  17133. },
  17134. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17135. },
  17136. updateImport: {
  17137. method: "PATCH",
  17138. params: {
  17139. owner: {
  17140. required: true,
  17141. type: "string"
  17142. },
  17143. repo: {
  17144. required: true,
  17145. type: "string"
  17146. },
  17147. vcs_password: {
  17148. type: "string"
  17149. },
  17150. vcs_username: {
  17151. type: "string"
  17152. }
  17153. },
  17154. url: "/repos/:owner/:repo/import"
  17155. }
  17156. },
  17157. oauthAuthorizations: {
  17158. checkAuthorization: {
  17159. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17160. method: "GET",
  17161. params: {
  17162. access_token: {
  17163. required: true,
  17164. type: "string"
  17165. },
  17166. client_id: {
  17167. required: true,
  17168. type: "string"
  17169. }
  17170. },
  17171. url: "/applications/:client_id/tokens/:access_token"
  17172. },
  17173. createAuthorization: {
  17174. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17175. method: "POST",
  17176. params: {
  17177. client_id: {
  17178. type: "string"
  17179. },
  17180. client_secret: {
  17181. type: "string"
  17182. },
  17183. fingerprint: {
  17184. type: "string"
  17185. },
  17186. note: {
  17187. required: true,
  17188. type: "string"
  17189. },
  17190. note_url: {
  17191. type: "string"
  17192. },
  17193. scopes: {
  17194. type: "string[]"
  17195. }
  17196. },
  17197. url: "/authorizations"
  17198. },
  17199. deleteAuthorization: {
  17200. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17201. method: "DELETE",
  17202. params: {
  17203. authorization_id: {
  17204. required: true,
  17205. type: "integer"
  17206. }
  17207. },
  17208. url: "/authorizations/:authorization_id"
  17209. },
  17210. deleteGrant: {
  17211. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17212. method: "DELETE",
  17213. params: {
  17214. grant_id: {
  17215. required: true,
  17216. type: "integer"
  17217. }
  17218. },
  17219. url: "/applications/grants/:grant_id"
  17220. },
  17221. getAuthorization: {
  17222. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17223. method: "GET",
  17224. params: {
  17225. authorization_id: {
  17226. required: true,
  17227. type: "integer"
  17228. }
  17229. },
  17230. url: "/authorizations/:authorization_id"
  17231. },
  17232. getGrant: {
  17233. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17234. method: "GET",
  17235. params: {
  17236. grant_id: {
  17237. required: true,
  17238. type: "integer"
  17239. }
  17240. },
  17241. url: "/applications/grants/:grant_id"
  17242. },
  17243. getOrCreateAuthorizationForApp: {
  17244. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17245. method: "PUT",
  17246. params: {
  17247. client_id: {
  17248. required: true,
  17249. type: "string"
  17250. },
  17251. client_secret: {
  17252. required: true,
  17253. type: "string"
  17254. },
  17255. fingerprint: {
  17256. type: "string"
  17257. },
  17258. note: {
  17259. type: "string"
  17260. },
  17261. note_url: {
  17262. type: "string"
  17263. },
  17264. scopes: {
  17265. type: "string[]"
  17266. }
  17267. },
  17268. url: "/authorizations/clients/:client_id"
  17269. },
  17270. getOrCreateAuthorizationForAppAndFingerprint: {
  17271. 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",
  17272. method: "PUT",
  17273. params: {
  17274. client_id: {
  17275. required: true,
  17276. type: "string"
  17277. },
  17278. client_secret: {
  17279. required: true,
  17280. type: "string"
  17281. },
  17282. fingerprint: {
  17283. required: true,
  17284. type: "string"
  17285. },
  17286. note: {
  17287. type: "string"
  17288. },
  17289. note_url: {
  17290. type: "string"
  17291. },
  17292. scopes: {
  17293. type: "string[]"
  17294. }
  17295. },
  17296. url: "/authorizations/clients/:client_id/:fingerprint"
  17297. },
  17298. getOrCreateAuthorizationForAppFingerprint: {
  17299. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17300. method: "PUT",
  17301. params: {
  17302. client_id: {
  17303. required: true,
  17304. type: "string"
  17305. },
  17306. client_secret: {
  17307. required: true,
  17308. type: "string"
  17309. },
  17310. fingerprint: {
  17311. required: true,
  17312. type: "string"
  17313. },
  17314. note: {
  17315. type: "string"
  17316. },
  17317. note_url: {
  17318. type: "string"
  17319. },
  17320. scopes: {
  17321. type: "string[]"
  17322. }
  17323. },
  17324. url: "/authorizations/clients/:client_id/:fingerprint"
  17325. },
  17326. listAuthorizations: {
  17327. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17328. method: "GET",
  17329. params: {
  17330. page: {
  17331. type: "integer"
  17332. },
  17333. per_page: {
  17334. type: "integer"
  17335. }
  17336. },
  17337. url: "/authorizations"
  17338. },
  17339. listGrants: {
  17340. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17341. method: "GET",
  17342. params: {
  17343. page: {
  17344. type: "integer"
  17345. },
  17346. per_page: {
  17347. type: "integer"
  17348. }
  17349. },
  17350. url: "/applications/grants"
  17351. },
  17352. resetAuthorization: {
  17353. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17354. method: "POST",
  17355. params: {
  17356. access_token: {
  17357. required: true,
  17358. type: "string"
  17359. },
  17360. client_id: {
  17361. required: true,
  17362. type: "string"
  17363. }
  17364. },
  17365. url: "/applications/:client_id/tokens/:access_token"
  17366. },
  17367. revokeAuthorizationForApplication: {
  17368. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17369. method: "DELETE",
  17370. params: {
  17371. access_token: {
  17372. required: true,
  17373. type: "string"
  17374. },
  17375. client_id: {
  17376. required: true,
  17377. type: "string"
  17378. }
  17379. },
  17380. url: "/applications/:client_id/tokens/:access_token"
  17381. },
  17382. revokeGrantForApplication: {
  17383. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17384. method: "DELETE",
  17385. params: {
  17386. access_token: {
  17387. required: true,
  17388. type: "string"
  17389. },
  17390. client_id: {
  17391. required: true,
  17392. type: "string"
  17393. }
  17394. },
  17395. url: "/applications/:client_id/grants/:access_token"
  17396. },
  17397. updateAuthorization: {
  17398. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17399. method: "PATCH",
  17400. params: {
  17401. add_scopes: {
  17402. type: "string[]"
  17403. },
  17404. authorization_id: {
  17405. required: true,
  17406. type: "integer"
  17407. },
  17408. fingerprint: {
  17409. type: "string"
  17410. },
  17411. note: {
  17412. type: "string"
  17413. },
  17414. note_url: {
  17415. type: "string"
  17416. },
  17417. remove_scopes: {
  17418. type: "string[]"
  17419. },
  17420. scopes: {
  17421. type: "string[]"
  17422. }
  17423. },
  17424. url: "/authorizations/:authorization_id"
  17425. }
  17426. },
  17427. orgs: {
  17428. addOrUpdateMembership: {
  17429. method: "PUT",
  17430. params: {
  17431. org: {
  17432. required: true,
  17433. type: "string"
  17434. },
  17435. role: {
  17436. enum: ["admin", "member"],
  17437. type: "string"
  17438. },
  17439. username: {
  17440. required: true,
  17441. type: "string"
  17442. }
  17443. },
  17444. url: "/orgs/:org/memberships/:username"
  17445. },
  17446. blockUser: {
  17447. method: "PUT",
  17448. params: {
  17449. org: {
  17450. required: true,
  17451. type: "string"
  17452. },
  17453. username: {
  17454. required: true,
  17455. type: "string"
  17456. }
  17457. },
  17458. url: "/orgs/:org/blocks/:username"
  17459. },
  17460. checkBlockedUser: {
  17461. method: "GET",
  17462. params: {
  17463. org: {
  17464. required: true,
  17465. type: "string"
  17466. },
  17467. username: {
  17468. required: true,
  17469. type: "string"
  17470. }
  17471. },
  17472. url: "/orgs/:org/blocks/:username"
  17473. },
  17474. checkMembership: {
  17475. method: "GET",
  17476. params: {
  17477. org: {
  17478. required: true,
  17479. type: "string"
  17480. },
  17481. username: {
  17482. required: true,
  17483. type: "string"
  17484. }
  17485. },
  17486. url: "/orgs/:org/members/:username"
  17487. },
  17488. checkPublicMembership: {
  17489. method: "GET",
  17490. params: {
  17491. org: {
  17492. required: true,
  17493. type: "string"
  17494. },
  17495. username: {
  17496. required: true,
  17497. type: "string"
  17498. }
  17499. },
  17500. url: "/orgs/:org/public_members/:username"
  17501. },
  17502. concealMembership: {
  17503. method: "DELETE",
  17504. params: {
  17505. org: {
  17506. required: true,
  17507. type: "string"
  17508. },
  17509. username: {
  17510. required: true,
  17511. type: "string"
  17512. }
  17513. },
  17514. url: "/orgs/:org/public_members/:username"
  17515. },
  17516. convertMemberToOutsideCollaborator: {
  17517. method: "PUT",
  17518. params: {
  17519. org: {
  17520. required: true,
  17521. type: "string"
  17522. },
  17523. username: {
  17524. required: true,
  17525. type: "string"
  17526. }
  17527. },
  17528. url: "/orgs/:org/outside_collaborators/:username"
  17529. },
  17530. createHook: {
  17531. method: "POST",
  17532. params: {
  17533. active: {
  17534. type: "boolean"
  17535. },
  17536. config: {
  17537. required: true,
  17538. type: "object"
  17539. },
  17540. "config.content_type": {
  17541. type: "string"
  17542. },
  17543. "config.insecure_ssl": {
  17544. type: "string"
  17545. },
  17546. "config.secret": {
  17547. type: "string"
  17548. },
  17549. "config.url": {
  17550. required: true,
  17551. type: "string"
  17552. },
  17553. events: {
  17554. type: "string[]"
  17555. },
  17556. name: {
  17557. required: true,
  17558. type: "string"
  17559. },
  17560. org: {
  17561. required: true,
  17562. type: "string"
  17563. }
  17564. },
  17565. url: "/orgs/:org/hooks"
  17566. },
  17567. createInvitation: {
  17568. method: "POST",
  17569. params: {
  17570. email: {
  17571. type: "string"
  17572. },
  17573. invitee_id: {
  17574. type: "integer"
  17575. },
  17576. org: {
  17577. required: true,
  17578. type: "string"
  17579. },
  17580. role: {
  17581. enum: ["admin", "direct_member", "billing_manager"],
  17582. type: "string"
  17583. },
  17584. team_ids: {
  17585. type: "integer[]"
  17586. }
  17587. },
  17588. url: "/orgs/:org/invitations"
  17589. },
  17590. deleteHook: {
  17591. method: "DELETE",
  17592. params: {
  17593. hook_id: {
  17594. required: true,
  17595. type: "integer"
  17596. },
  17597. org: {
  17598. required: true,
  17599. type: "string"
  17600. }
  17601. },
  17602. url: "/orgs/:org/hooks/:hook_id"
  17603. },
  17604. get: {
  17605. method: "GET",
  17606. params: {
  17607. org: {
  17608. required: true,
  17609. type: "string"
  17610. }
  17611. },
  17612. url: "/orgs/:org"
  17613. },
  17614. getHook: {
  17615. method: "GET",
  17616. params: {
  17617. hook_id: {
  17618. required: true,
  17619. type: "integer"
  17620. },
  17621. org: {
  17622. required: true,
  17623. type: "string"
  17624. }
  17625. },
  17626. url: "/orgs/:org/hooks/:hook_id"
  17627. },
  17628. getMembership: {
  17629. method: "GET",
  17630. params: {
  17631. org: {
  17632. required: true,
  17633. type: "string"
  17634. },
  17635. username: {
  17636. required: true,
  17637. type: "string"
  17638. }
  17639. },
  17640. url: "/orgs/:org/memberships/:username"
  17641. },
  17642. getMembershipForAuthenticatedUser: {
  17643. method: "GET",
  17644. params: {
  17645. org: {
  17646. required: true,
  17647. type: "string"
  17648. }
  17649. },
  17650. url: "/user/memberships/orgs/:org"
  17651. },
  17652. list: {
  17653. method: "GET",
  17654. params: {
  17655. page: {
  17656. type: "integer"
  17657. },
  17658. per_page: {
  17659. type: "integer"
  17660. },
  17661. since: {
  17662. type: "integer"
  17663. }
  17664. },
  17665. url: "/organizations"
  17666. },
  17667. listBlockedUsers: {
  17668. method: "GET",
  17669. params: {
  17670. org: {
  17671. required: true,
  17672. type: "string"
  17673. }
  17674. },
  17675. url: "/orgs/:org/blocks"
  17676. },
  17677. listForAuthenticatedUser: {
  17678. method: "GET",
  17679. params: {
  17680. page: {
  17681. type: "integer"
  17682. },
  17683. per_page: {
  17684. type: "integer"
  17685. }
  17686. },
  17687. url: "/user/orgs"
  17688. },
  17689. listForUser: {
  17690. method: "GET",
  17691. params: {
  17692. page: {
  17693. type: "integer"
  17694. },
  17695. per_page: {
  17696. type: "integer"
  17697. },
  17698. username: {
  17699. required: true,
  17700. type: "string"
  17701. }
  17702. },
  17703. url: "/users/:username/orgs"
  17704. },
  17705. listHooks: {
  17706. method: "GET",
  17707. params: {
  17708. org: {
  17709. required: true,
  17710. type: "string"
  17711. },
  17712. page: {
  17713. type: "integer"
  17714. },
  17715. per_page: {
  17716. type: "integer"
  17717. }
  17718. },
  17719. url: "/orgs/:org/hooks"
  17720. },
  17721. listInstallations: {
  17722. headers: {
  17723. accept: "application/vnd.github.machine-man-preview+json"
  17724. },
  17725. method: "GET",
  17726. params: {
  17727. org: {
  17728. required: true,
  17729. type: "string"
  17730. },
  17731. page: {
  17732. type: "integer"
  17733. },
  17734. per_page: {
  17735. type: "integer"
  17736. }
  17737. },
  17738. url: "/orgs/:org/installations"
  17739. },
  17740. listInvitationTeams: {
  17741. method: "GET",
  17742. params: {
  17743. invitation_id: {
  17744. required: true,
  17745. type: "integer"
  17746. },
  17747. org: {
  17748. required: true,
  17749. type: "string"
  17750. },
  17751. page: {
  17752. type: "integer"
  17753. },
  17754. per_page: {
  17755. type: "integer"
  17756. }
  17757. },
  17758. url: "/orgs/:org/invitations/:invitation_id/teams"
  17759. },
  17760. listMembers: {
  17761. method: "GET",
  17762. params: {
  17763. filter: {
  17764. enum: ["2fa_disabled", "all"],
  17765. type: "string"
  17766. },
  17767. org: {
  17768. required: true,
  17769. type: "string"
  17770. },
  17771. page: {
  17772. type: "integer"
  17773. },
  17774. per_page: {
  17775. type: "integer"
  17776. },
  17777. role: {
  17778. enum: ["all", "admin", "member"],
  17779. type: "string"
  17780. }
  17781. },
  17782. url: "/orgs/:org/members"
  17783. },
  17784. listMemberships: {
  17785. method: "GET",
  17786. params: {
  17787. page: {
  17788. type: "integer"
  17789. },
  17790. per_page: {
  17791. type: "integer"
  17792. },
  17793. state: {
  17794. enum: ["active", "pending"],
  17795. type: "string"
  17796. }
  17797. },
  17798. url: "/user/memberships/orgs"
  17799. },
  17800. listOutsideCollaborators: {
  17801. method: "GET",
  17802. params: {
  17803. filter: {
  17804. enum: ["2fa_disabled", "all"],
  17805. type: "string"
  17806. },
  17807. org: {
  17808. required: true,
  17809. type: "string"
  17810. },
  17811. page: {
  17812. type: "integer"
  17813. },
  17814. per_page: {
  17815. type: "integer"
  17816. }
  17817. },
  17818. url: "/orgs/:org/outside_collaborators"
  17819. },
  17820. listPendingInvitations: {
  17821. method: "GET",
  17822. params: {
  17823. org: {
  17824. required: true,
  17825. type: "string"
  17826. },
  17827. page: {
  17828. type: "integer"
  17829. },
  17830. per_page: {
  17831. type: "integer"
  17832. }
  17833. },
  17834. url: "/orgs/:org/invitations"
  17835. },
  17836. listPublicMembers: {
  17837. method: "GET",
  17838. params: {
  17839. org: {
  17840. required: true,
  17841. type: "string"
  17842. },
  17843. page: {
  17844. type: "integer"
  17845. },
  17846. per_page: {
  17847. type: "integer"
  17848. }
  17849. },
  17850. url: "/orgs/:org/public_members"
  17851. },
  17852. pingHook: {
  17853. method: "POST",
  17854. params: {
  17855. hook_id: {
  17856. required: true,
  17857. type: "integer"
  17858. },
  17859. org: {
  17860. required: true,
  17861. type: "string"
  17862. }
  17863. },
  17864. url: "/orgs/:org/hooks/:hook_id/pings"
  17865. },
  17866. publicizeMembership: {
  17867. method: "PUT",
  17868. params: {
  17869. org: {
  17870. required: true,
  17871. type: "string"
  17872. },
  17873. username: {
  17874. required: true,
  17875. type: "string"
  17876. }
  17877. },
  17878. url: "/orgs/:org/public_members/:username"
  17879. },
  17880. removeMember: {
  17881. method: "DELETE",
  17882. params: {
  17883. org: {
  17884. required: true,
  17885. type: "string"
  17886. },
  17887. username: {
  17888. required: true,
  17889. type: "string"
  17890. }
  17891. },
  17892. url: "/orgs/:org/members/:username"
  17893. },
  17894. removeMembership: {
  17895. method: "DELETE",
  17896. params: {
  17897. org: {
  17898. required: true,
  17899. type: "string"
  17900. },
  17901. username: {
  17902. required: true,
  17903. type: "string"
  17904. }
  17905. },
  17906. url: "/orgs/:org/memberships/:username"
  17907. },
  17908. removeOutsideCollaborator: {
  17909. method: "DELETE",
  17910. params: {
  17911. org: {
  17912. required: true,
  17913. type: "string"
  17914. },
  17915. username: {
  17916. required: true,
  17917. type: "string"
  17918. }
  17919. },
  17920. url: "/orgs/:org/outside_collaborators/:username"
  17921. },
  17922. unblockUser: {
  17923. method: "DELETE",
  17924. params: {
  17925. org: {
  17926. required: true,
  17927. type: "string"
  17928. },
  17929. username: {
  17930. required: true,
  17931. type: "string"
  17932. }
  17933. },
  17934. url: "/orgs/:org/blocks/:username"
  17935. },
  17936. update: {
  17937. method: "PATCH",
  17938. params: {
  17939. billing_email: {
  17940. type: "string"
  17941. },
  17942. company: {
  17943. type: "string"
  17944. },
  17945. default_repository_permission: {
  17946. enum: ["read", "write", "admin", "none"],
  17947. type: "string"
  17948. },
  17949. description: {
  17950. type: "string"
  17951. },
  17952. email: {
  17953. type: "string"
  17954. },
  17955. has_organization_projects: {
  17956. type: "boolean"
  17957. },
  17958. has_repository_projects: {
  17959. type: "boolean"
  17960. },
  17961. location: {
  17962. type: "string"
  17963. },
  17964. members_allowed_repository_creation_type: {
  17965. enum: ["all", "private", "none"],
  17966. type: "string"
  17967. },
  17968. members_can_create_internal_repositories: {
  17969. type: "boolean"
  17970. },
  17971. members_can_create_private_repositories: {
  17972. type: "boolean"
  17973. },
  17974. members_can_create_public_repositories: {
  17975. type: "boolean"
  17976. },
  17977. members_can_create_repositories: {
  17978. type: "boolean"
  17979. },
  17980. name: {
  17981. type: "string"
  17982. },
  17983. org: {
  17984. required: true,
  17985. type: "string"
  17986. }
  17987. },
  17988. url: "/orgs/:org"
  17989. },
  17990. updateHook: {
  17991. method: "PATCH",
  17992. params: {
  17993. active: {
  17994. type: "boolean"
  17995. },
  17996. config: {
  17997. type: "object"
  17998. },
  17999. "config.content_type": {
  18000. type: "string"
  18001. },
  18002. "config.insecure_ssl": {
  18003. type: "string"
  18004. },
  18005. "config.secret": {
  18006. type: "string"
  18007. },
  18008. "config.url": {
  18009. required: true,
  18010. type: "string"
  18011. },
  18012. events: {
  18013. type: "string[]"
  18014. },
  18015. hook_id: {
  18016. required: true,
  18017. type: "integer"
  18018. },
  18019. org: {
  18020. required: true,
  18021. type: "string"
  18022. }
  18023. },
  18024. url: "/orgs/:org/hooks/:hook_id"
  18025. },
  18026. updateMembership: {
  18027. method: "PATCH",
  18028. params: {
  18029. org: {
  18030. required: true,
  18031. type: "string"
  18032. },
  18033. state: {
  18034. enum: ["active"],
  18035. required: true,
  18036. type: "string"
  18037. }
  18038. },
  18039. url: "/user/memberships/orgs/:org"
  18040. }
  18041. },
  18042. projects: {
  18043. addCollaborator: {
  18044. headers: {
  18045. accept: "application/vnd.github.inertia-preview+json"
  18046. },
  18047. method: "PUT",
  18048. params: {
  18049. permission: {
  18050. enum: ["read", "write", "admin"],
  18051. type: "string"
  18052. },
  18053. project_id: {
  18054. required: true,
  18055. type: "integer"
  18056. },
  18057. username: {
  18058. required: true,
  18059. type: "string"
  18060. }
  18061. },
  18062. url: "/projects/:project_id/collaborators/:username"
  18063. },
  18064. createCard: {
  18065. headers: {
  18066. accept: "application/vnd.github.inertia-preview+json"
  18067. },
  18068. method: "POST",
  18069. params: {
  18070. column_id: {
  18071. required: true,
  18072. type: "integer"
  18073. },
  18074. content_id: {
  18075. type: "integer"
  18076. },
  18077. content_type: {
  18078. type: "string"
  18079. },
  18080. note: {
  18081. type: "string"
  18082. }
  18083. },
  18084. url: "/projects/columns/:column_id/cards"
  18085. },
  18086. createColumn: {
  18087. headers: {
  18088. accept: "application/vnd.github.inertia-preview+json"
  18089. },
  18090. method: "POST",
  18091. params: {
  18092. name: {
  18093. required: true,
  18094. type: "string"
  18095. },
  18096. project_id: {
  18097. required: true,
  18098. type: "integer"
  18099. }
  18100. },
  18101. url: "/projects/:project_id/columns"
  18102. },
  18103. createForAuthenticatedUser: {
  18104. headers: {
  18105. accept: "application/vnd.github.inertia-preview+json"
  18106. },
  18107. method: "POST",
  18108. params: {
  18109. body: {
  18110. type: "string"
  18111. },
  18112. name: {
  18113. required: true,
  18114. type: "string"
  18115. }
  18116. },
  18117. url: "/user/projects"
  18118. },
  18119. createForOrg: {
  18120. headers: {
  18121. accept: "application/vnd.github.inertia-preview+json"
  18122. },
  18123. method: "POST",
  18124. params: {
  18125. body: {
  18126. type: "string"
  18127. },
  18128. name: {
  18129. required: true,
  18130. type: "string"
  18131. },
  18132. org: {
  18133. required: true,
  18134. type: "string"
  18135. }
  18136. },
  18137. url: "/orgs/:org/projects"
  18138. },
  18139. createForRepo: {
  18140. headers: {
  18141. accept: "application/vnd.github.inertia-preview+json"
  18142. },
  18143. method: "POST",
  18144. params: {
  18145. body: {
  18146. type: "string"
  18147. },
  18148. name: {
  18149. required: true,
  18150. type: "string"
  18151. },
  18152. owner: {
  18153. required: true,
  18154. type: "string"
  18155. },
  18156. repo: {
  18157. required: true,
  18158. type: "string"
  18159. }
  18160. },
  18161. url: "/repos/:owner/:repo/projects"
  18162. },
  18163. delete: {
  18164. headers: {
  18165. accept: "application/vnd.github.inertia-preview+json"
  18166. },
  18167. method: "DELETE",
  18168. params: {
  18169. project_id: {
  18170. required: true,
  18171. type: "integer"
  18172. }
  18173. },
  18174. url: "/projects/:project_id"
  18175. },
  18176. deleteCard: {
  18177. headers: {
  18178. accept: "application/vnd.github.inertia-preview+json"
  18179. },
  18180. method: "DELETE",
  18181. params: {
  18182. card_id: {
  18183. required: true,
  18184. type: "integer"
  18185. }
  18186. },
  18187. url: "/projects/columns/cards/:card_id"
  18188. },
  18189. deleteColumn: {
  18190. headers: {
  18191. accept: "application/vnd.github.inertia-preview+json"
  18192. },
  18193. method: "DELETE",
  18194. params: {
  18195. column_id: {
  18196. required: true,
  18197. type: "integer"
  18198. }
  18199. },
  18200. url: "/projects/columns/:column_id"
  18201. },
  18202. get: {
  18203. headers: {
  18204. accept: "application/vnd.github.inertia-preview+json"
  18205. },
  18206. method: "GET",
  18207. params: {
  18208. project_id: {
  18209. required: true,
  18210. type: "integer"
  18211. }
  18212. },
  18213. url: "/projects/:project_id"
  18214. },
  18215. getCard: {
  18216. headers: {
  18217. accept: "application/vnd.github.inertia-preview+json"
  18218. },
  18219. method: "GET",
  18220. params: {
  18221. card_id: {
  18222. required: true,
  18223. type: "integer"
  18224. }
  18225. },
  18226. url: "/projects/columns/cards/:card_id"
  18227. },
  18228. getColumn: {
  18229. headers: {
  18230. accept: "application/vnd.github.inertia-preview+json"
  18231. },
  18232. method: "GET",
  18233. params: {
  18234. column_id: {
  18235. required: true,
  18236. type: "integer"
  18237. }
  18238. },
  18239. url: "/projects/columns/:column_id"
  18240. },
  18241. listCards: {
  18242. headers: {
  18243. accept: "application/vnd.github.inertia-preview+json"
  18244. },
  18245. method: "GET",
  18246. params: {
  18247. archived_state: {
  18248. enum: ["all", "archived", "not_archived"],
  18249. type: "string"
  18250. },
  18251. column_id: {
  18252. required: true,
  18253. type: "integer"
  18254. },
  18255. page: {
  18256. type: "integer"
  18257. },
  18258. per_page: {
  18259. type: "integer"
  18260. }
  18261. },
  18262. url: "/projects/columns/:column_id/cards"
  18263. },
  18264. listCollaborators: {
  18265. headers: {
  18266. accept: "application/vnd.github.inertia-preview+json"
  18267. },
  18268. method: "GET",
  18269. params: {
  18270. affiliation: {
  18271. enum: ["outside", "direct", "all"],
  18272. type: "string"
  18273. },
  18274. page: {
  18275. type: "integer"
  18276. },
  18277. per_page: {
  18278. type: "integer"
  18279. },
  18280. project_id: {
  18281. required: true,
  18282. type: "integer"
  18283. }
  18284. },
  18285. url: "/projects/:project_id/collaborators"
  18286. },
  18287. listColumns: {
  18288. headers: {
  18289. accept: "application/vnd.github.inertia-preview+json"
  18290. },
  18291. method: "GET",
  18292. params: {
  18293. page: {
  18294. type: "integer"
  18295. },
  18296. per_page: {
  18297. type: "integer"
  18298. },
  18299. project_id: {
  18300. required: true,
  18301. type: "integer"
  18302. }
  18303. },
  18304. url: "/projects/:project_id/columns"
  18305. },
  18306. listForOrg: {
  18307. headers: {
  18308. accept: "application/vnd.github.inertia-preview+json"
  18309. },
  18310. method: "GET",
  18311. params: {
  18312. org: {
  18313. required: true,
  18314. type: "string"
  18315. },
  18316. page: {
  18317. type: "integer"
  18318. },
  18319. per_page: {
  18320. type: "integer"
  18321. },
  18322. state: {
  18323. enum: ["open", "closed", "all"],
  18324. type: "string"
  18325. }
  18326. },
  18327. url: "/orgs/:org/projects"
  18328. },
  18329. listForRepo: {
  18330. headers: {
  18331. accept: "application/vnd.github.inertia-preview+json"
  18332. },
  18333. method: "GET",
  18334. params: {
  18335. owner: {
  18336. required: true,
  18337. type: "string"
  18338. },
  18339. page: {
  18340. type: "integer"
  18341. },
  18342. per_page: {
  18343. type: "integer"
  18344. },
  18345. repo: {
  18346. required: true,
  18347. type: "string"
  18348. },
  18349. state: {
  18350. enum: ["open", "closed", "all"],
  18351. type: "string"
  18352. }
  18353. },
  18354. url: "/repos/:owner/:repo/projects"
  18355. },
  18356. listForUser: {
  18357. headers: {
  18358. accept: "application/vnd.github.inertia-preview+json"
  18359. },
  18360. method: "GET",
  18361. params: {
  18362. page: {
  18363. type: "integer"
  18364. },
  18365. per_page: {
  18366. type: "integer"
  18367. },
  18368. state: {
  18369. enum: ["open", "closed", "all"],
  18370. type: "string"
  18371. },
  18372. username: {
  18373. required: true,
  18374. type: "string"
  18375. }
  18376. },
  18377. url: "/users/:username/projects"
  18378. },
  18379. moveCard: {
  18380. headers: {
  18381. accept: "application/vnd.github.inertia-preview+json"
  18382. },
  18383. method: "POST",
  18384. params: {
  18385. card_id: {
  18386. required: true,
  18387. type: "integer"
  18388. },
  18389. column_id: {
  18390. type: "integer"
  18391. },
  18392. position: {
  18393. required: true,
  18394. type: "string",
  18395. validation: "^(top|bottom|after:\\d+)$"
  18396. }
  18397. },
  18398. url: "/projects/columns/cards/:card_id/moves"
  18399. },
  18400. moveColumn: {
  18401. headers: {
  18402. accept: "application/vnd.github.inertia-preview+json"
  18403. },
  18404. method: "POST",
  18405. params: {
  18406. column_id: {
  18407. required: true,
  18408. type: "integer"
  18409. },
  18410. position: {
  18411. required: true,
  18412. type: "string",
  18413. validation: "^(first|last|after:\\d+)$"
  18414. }
  18415. },
  18416. url: "/projects/columns/:column_id/moves"
  18417. },
  18418. removeCollaborator: {
  18419. headers: {
  18420. accept: "application/vnd.github.inertia-preview+json"
  18421. },
  18422. method: "DELETE",
  18423. params: {
  18424. project_id: {
  18425. required: true,
  18426. type: "integer"
  18427. },
  18428. username: {
  18429. required: true,
  18430. type: "string"
  18431. }
  18432. },
  18433. url: "/projects/:project_id/collaborators/:username"
  18434. },
  18435. reviewUserPermissionLevel: {
  18436. headers: {
  18437. accept: "application/vnd.github.inertia-preview+json"
  18438. },
  18439. method: "GET",
  18440. params: {
  18441. project_id: {
  18442. required: true,
  18443. type: "integer"
  18444. },
  18445. username: {
  18446. required: true,
  18447. type: "string"
  18448. }
  18449. },
  18450. url: "/projects/:project_id/collaborators/:username/permission"
  18451. },
  18452. update: {
  18453. headers: {
  18454. accept: "application/vnd.github.inertia-preview+json"
  18455. },
  18456. method: "PATCH",
  18457. params: {
  18458. body: {
  18459. type: "string"
  18460. },
  18461. name: {
  18462. type: "string"
  18463. },
  18464. organization_permission: {
  18465. type: "string"
  18466. },
  18467. private: {
  18468. type: "boolean"
  18469. },
  18470. project_id: {
  18471. required: true,
  18472. type: "integer"
  18473. },
  18474. state: {
  18475. enum: ["open", "closed"],
  18476. type: "string"
  18477. }
  18478. },
  18479. url: "/projects/:project_id"
  18480. },
  18481. updateCard: {
  18482. headers: {
  18483. accept: "application/vnd.github.inertia-preview+json"
  18484. },
  18485. method: "PATCH",
  18486. params: {
  18487. archived: {
  18488. type: "boolean"
  18489. },
  18490. card_id: {
  18491. required: true,
  18492. type: "integer"
  18493. },
  18494. note: {
  18495. type: "string"
  18496. }
  18497. },
  18498. url: "/projects/columns/cards/:card_id"
  18499. },
  18500. updateColumn: {
  18501. headers: {
  18502. accept: "application/vnd.github.inertia-preview+json"
  18503. },
  18504. method: "PATCH",
  18505. params: {
  18506. column_id: {
  18507. required: true,
  18508. type: "integer"
  18509. },
  18510. name: {
  18511. required: true,
  18512. type: "string"
  18513. }
  18514. },
  18515. url: "/projects/columns/:column_id"
  18516. }
  18517. },
  18518. pulls: {
  18519. checkIfMerged: {
  18520. method: "GET",
  18521. params: {
  18522. number: {
  18523. alias: "pull_number",
  18524. deprecated: true,
  18525. type: "integer"
  18526. },
  18527. owner: {
  18528. required: true,
  18529. type: "string"
  18530. },
  18531. pull_number: {
  18532. required: true,
  18533. type: "integer"
  18534. },
  18535. repo: {
  18536. required: true,
  18537. type: "string"
  18538. }
  18539. },
  18540. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18541. },
  18542. create: {
  18543. method: "POST",
  18544. params: {
  18545. base: {
  18546. required: true,
  18547. type: "string"
  18548. },
  18549. body: {
  18550. type: "string"
  18551. },
  18552. draft: {
  18553. type: "boolean"
  18554. },
  18555. head: {
  18556. required: true,
  18557. type: "string"
  18558. },
  18559. maintainer_can_modify: {
  18560. type: "boolean"
  18561. },
  18562. owner: {
  18563. required: true,
  18564. type: "string"
  18565. },
  18566. repo: {
  18567. required: true,
  18568. type: "string"
  18569. },
  18570. title: {
  18571. required: true,
  18572. type: "string"
  18573. }
  18574. },
  18575. url: "/repos/:owner/:repo/pulls"
  18576. },
  18577. createComment: {
  18578. method: "POST",
  18579. params: {
  18580. body: {
  18581. required: true,
  18582. type: "string"
  18583. },
  18584. commit_id: {
  18585. required: true,
  18586. type: "string"
  18587. },
  18588. in_reply_to: {
  18589. deprecated: true,
  18590. 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.",
  18591. type: "integer"
  18592. },
  18593. line: {
  18594. type: "integer"
  18595. },
  18596. number: {
  18597. alias: "pull_number",
  18598. deprecated: true,
  18599. type: "integer"
  18600. },
  18601. owner: {
  18602. required: true,
  18603. type: "string"
  18604. },
  18605. path: {
  18606. required: true,
  18607. type: "string"
  18608. },
  18609. position: {
  18610. type: "integer"
  18611. },
  18612. pull_number: {
  18613. required: true,
  18614. type: "integer"
  18615. },
  18616. repo: {
  18617. required: true,
  18618. type: "string"
  18619. },
  18620. side: {
  18621. enum: ["LEFT", "RIGHT"],
  18622. type: "string"
  18623. },
  18624. start_line: {
  18625. type: "integer"
  18626. },
  18627. start_side: {
  18628. enum: ["LEFT", "RIGHT", "side"],
  18629. type: "string"
  18630. }
  18631. },
  18632. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18633. },
  18634. createCommentReply: {
  18635. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18636. method: "POST",
  18637. params: {
  18638. body: {
  18639. required: true,
  18640. type: "string"
  18641. },
  18642. commit_id: {
  18643. required: true,
  18644. type: "string"
  18645. },
  18646. in_reply_to: {
  18647. deprecated: true,
  18648. 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.",
  18649. type: "integer"
  18650. },
  18651. line: {
  18652. type: "integer"
  18653. },
  18654. number: {
  18655. alias: "pull_number",
  18656. deprecated: true,
  18657. type: "integer"
  18658. },
  18659. owner: {
  18660. required: true,
  18661. type: "string"
  18662. },
  18663. path: {
  18664. required: true,
  18665. type: "string"
  18666. },
  18667. position: {
  18668. type: "integer"
  18669. },
  18670. pull_number: {
  18671. required: true,
  18672. type: "integer"
  18673. },
  18674. repo: {
  18675. required: true,
  18676. type: "string"
  18677. },
  18678. side: {
  18679. enum: ["LEFT", "RIGHT"],
  18680. type: "string"
  18681. },
  18682. start_line: {
  18683. type: "integer"
  18684. },
  18685. start_side: {
  18686. enum: ["LEFT", "RIGHT", "side"],
  18687. type: "string"
  18688. }
  18689. },
  18690. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18691. },
  18692. createFromIssue: {
  18693. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18694. method: "POST",
  18695. params: {
  18696. base: {
  18697. required: true,
  18698. type: "string"
  18699. },
  18700. draft: {
  18701. type: "boolean"
  18702. },
  18703. head: {
  18704. required: true,
  18705. type: "string"
  18706. },
  18707. issue: {
  18708. required: true,
  18709. type: "integer"
  18710. },
  18711. maintainer_can_modify: {
  18712. type: "boolean"
  18713. },
  18714. owner: {
  18715. required: true,
  18716. type: "string"
  18717. },
  18718. repo: {
  18719. required: true,
  18720. type: "string"
  18721. }
  18722. },
  18723. url: "/repos/:owner/:repo/pulls"
  18724. },
  18725. createReview: {
  18726. method: "POST",
  18727. params: {
  18728. body: {
  18729. type: "string"
  18730. },
  18731. comments: {
  18732. type: "object[]"
  18733. },
  18734. "comments[].body": {
  18735. required: true,
  18736. type: "string"
  18737. },
  18738. "comments[].path": {
  18739. required: true,
  18740. type: "string"
  18741. },
  18742. "comments[].position": {
  18743. required: true,
  18744. type: "integer"
  18745. },
  18746. commit_id: {
  18747. type: "string"
  18748. },
  18749. event: {
  18750. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18751. type: "string"
  18752. },
  18753. number: {
  18754. alias: "pull_number",
  18755. deprecated: true,
  18756. type: "integer"
  18757. },
  18758. owner: {
  18759. required: true,
  18760. type: "string"
  18761. },
  18762. pull_number: {
  18763. required: true,
  18764. type: "integer"
  18765. },
  18766. repo: {
  18767. required: true,
  18768. type: "string"
  18769. }
  18770. },
  18771. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18772. },
  18773. createReviewCommentReply: {
  18774. method: "POST",
  18775. params: {
  18776. body: {
  18777. required: true,
  18778. type: "string"
  18779. },
  18780. comment_id: {
  18781. required: true,
  18782. type: "integer"
  18783. },
  18784. owner: {
  18785. required: true,
  18786. type: "string"
  18787. },
  18788. pull_number: {
  18789. required: true,
  18790. type: "integer"
  18791. },
  18792. repo: {
  18793. required: true,
  18794. type: "string"
  18795. }
  18796. },
  18797. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18798. },
  18799. createReviewRequest: {
  18800. method: "POST",
  18801. params: {
  18802. number: {
  18803. alias: "pull_number",
  18804. deprecated: true,
  18805. type: "integer"
  18806. },
  18807. owner: {
  18808. required: true,
  18809. type: "string"
  18810. },
  18811. pull_number: {
  18812. required: true,
  18813. type: "integer"
  18814. },
  18815. repo: {
  18816. required: true,
  18817. type: "string"
  18818. },
  18819. reviewers: {
  18820. type: "string[]"
  18821. },
  18822. team_reviewers: {
  18823. type: "string[]"
  18824. }
  18825. },
  18826. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18827. },
  18828. deleteComment: {
  18829. method: "DELETE",
  18830. params: {
  18831. comment_id: {
  18832. required: true,
  18833. type: "integer"
  18834. },
  18835. owner: {
  18836. required: true,
  18837. type: "string"
  18838. },
  18839. repo: {
  18840. required: true,
  18841. type: "string"
  18842. }
  18843. },
  18844. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18845. },
  18846. deletePendingReview: {
  18847. method: "DELETE",
  18848. params: {
  18849. number: {
  18850. alias: "pull_number",
  18851. deprecated: true,
  18852. type: "integer"
  18853. },
  18854. owner: {
  18855. required: true,
  18856. type: "string"
  18857. },
  18858. pull_number: {
  18859. required: true,
  18860. type: "integer"
  18861. },
  18862. repo: {
  18863. required: true,
  18864. type: "string"
  18865. },
  18866. review_id: {
  18867. required: true,
  18868. type: "integer"
  18869. }
  18870. },
  18871. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18872. },
  18873. deleteReviewRequest: {
  18874. method: "DELETE",
  18875. params: {
  18876. number: {
  18877. alias: "pull_number",
  18878. deprecated: true,
  18879. type: "integer"
  18880. },
  18881. owner: {
  18882. required: true,
  18883. type: "string"
  18884. },
  18885. pull_number: {
  18886. required: true,
  18887. type: "integer"
  18888. },
  18889. repo: {
  18890. required: true,
  18891. type: "string"
  18892. },
  18893. reviewers: {
  18894. type: "string[]"
  18895. },
  18896. team_reviewers: {
  18897. type: "string[]"
  18898. }
  18899. },
  18900. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18901. },
  18902. dismissReview: {
  18903. method: "PUT",
  18904. params: {
  18905. message: {
  18906. required: true,
  18907. type: "string"
  18908. },
  18909. number: {
  18910. alias: "pull_number",
  18911. deprecated: true,
  18912. type: "integer"
  18913. },
  18914. owner: {
  18915. required: true,
  18916. type: "string"
  18917. },
  18918. pull_number: {
  18919. required: true,
  18920. type: "integer"
  18921. },
  18922. repo: {
  18923. required: true,
  18924. type: "string"
  18925. },
  18926. review_id: {
  18927. required: true,
  18928. type: "integer"
  18929. }
  18930. },
  18931. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18932. },
  18933. get: {
  18934. method: "GET",
  18935. params: {
  18936. number: {
  18937. alias: "pull_number",
  18938. deprecated: true,
  18939. type: "integer"
  18940. },
  18941. owner: {
  18942. required: true,
  18943. type: "string"
  18944. },
  18945. pull_number: {
  18946. required: true,
  18947. type: "integer"
  18948. },
  18949. repo: {
  18950. required: true,
  18951. type: "string"
  18952. }
  18953. },
  18954. url: "/repos/:owner/:repo/pulls/:pull_number"
  18955. },
  18956. getComment: {
  18957. method: "GET",
  18958. params: {
  18959. comment_id: {
  18960. required: true,
  18961. type: "integer"
  18962. },
  18963. owner: {
  18964. required: true,
  18965. type: "string"
  18966. },
  18967. repo: {
  18968. required: true,
  18969. type: "string"
  18970. }
  18971. },
  18972. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18973. },
  18974. getCommentsForReview: {
  18975. method: "GET",
  18976. params: {
  18977. number: {
  18978. alias: "pull_number",
  18979. deprecated: true,
  18980. type: "integer"
  18981. },
  18982. owner: {
  18983. required: true,
  18984. type: "string"
  18985. },
  18986. page: {
  18987. type: "integer"
  18988. },
  18989. per_page: {
  18990. type: "integer"
  18991. },
  18992. pull_number: {
  18993. required: true,
  18994. type: "integer"
  18995. },
  18996. repo: {
  18997. required: true,
  18998. type: "string"
  18999. },
  19000. review_id: {
  19001. required: true,
  19002. type: "integer"
  19003. }
  19004. },
  19005. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  19006. },
  19007. getReview: {
  19008. method: "GET",
  19009. params: {
  19010. number: {
  19011. alias: "pull_number",
  19012. deprecated: true,
  19013. type: "integer"
  19014. },
  19015. owner: {
  19016. required: true,
  19017. type: "string"
  19018. },
  19019. pull_number: {
  19020. required: true,
  19021. type: "integer"
  19022. },
  19023. repo: {
  19024. required: true,
  19025. type: "string"
  19026. },
  19027. review_id: {
  19028. required: true,
  19029. type: "integer"
  19030. }
  19031. },
  19032. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19033. },
  19034. list: {
  19035. method: "GET",
  19036. params: {
  19037. base: {
  19038. type: "string"
  19039. },
  19040. direction: {
  19041. enum: ["asc", "desc"],
  19042. type: "string"
  19043. },
  19044. head: {
  19045. type: "string"
  19046. },
  19047. owner: {
  19048. required: true,
  19049. type: "string"
  19050. },
  19051. page: {
  19052. type: "integer"
  19053. },
  19054. per_page: {
  19055. type: "integer"
  19056. },
  19057. repo: {
  19058. required: true,
  19059. type: "string"
  19060. },
  19061. sort: {
  19062. enum: ["created", "updated", "popularity", "long-running"],
  19063. type: "string"
  19064. },
  19065. state: {
  19066. enum: ["open", "closed", "all"],
  19067. type: "string"
  19068. }
  19069. },
  19070. url: "/repos/:owner/:repo/pulls"
  19071. },
  19072. listComments: {
  19073. method: "GET",
  19074. params: {
  19075. direction: {
  19076. enum: ["asc", "desc"],
  19077. type: "string"
  19078. },
  19079. number: {
  19080. alias: "pull_number",
  19081. deprecated: true,
  19082. type: "integer"
  19083. },
  19084. owner: {
  19085. required: true,
  19086. type: "string"
  19087. },
  19088. page: {
  19089. type: "integer"
  19090. },
  19091. per_page: {
  19092. type: "integer"
  19093. },
  19094. pull_number: {
  19095. required: true,
  19096. type: "integer"
  19097. },
  19098. repo: {
  19099. required: true,
  19100. type: "string"
  19101. },
  19102. since: {
  19103. type: "string"
  19104. },
  19105. sort: {
  19106. enum: ["created", "updated"],
  19107. type: "string"
  19108. }
  19109. },
  19110. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19111. },
  19112. listCommentsForRepo: {
  19113. method: "GET",
  19114. params: {
  19115. direction: {
  19116. enum: ["asc", "desc"],
  19117. type: "string"
  19118. },
  19119. owner: {
  19120. required: true,
  19121. type: "string"
  19122. },
  19123. page: {
  19124. type: "integer"
  19125. },
  19126. per_page: {
  19127. type: "integer"
  19128. },
  19129. repo: {
  19130. required: true,
  19131. type: "string"
  19132. },
  19133. since: {
  19134. type: "string"
  19135. },
  19136. sort: {
  19137. enum: ["created", "updated"],
  19138. type: "string"
  19139. }
  19140. },
  19141. url: "/repos/:owner/:repo/pulls/comments"
  19142. },
  19143. listCommits: {
  19144. method: "GET",
  19145. params: {
  19146. number: {
  19147. alias: "pull_number",
  19148. deprecated: true,
  19149. type: "integer"
  19150. },
  19151. owner: {
  19152. required: true,
  19153. type: "string"
  19154. },
  19155. page: {
  19156. type: "integer"
  19157. },
  19158. per_page: {
  19159. type: "integer"
  19160. },
  19161. pull_number: {
  19162. required: true,
  19163. type: "integer"
  19164. },
  19165. repo: {
  19166. required: true,
  19167. type: "string"
  19168. }
  19169. },
  19170. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19171. },
  19172. listFiles: {
  19173. method: "GET",
  19174. params: {
  19175. number: {
  19176. alias: "pull_number",
  19177. deprecated: true,
  19178. type: "integer"
  19179. },
  19180. owner: {
  19181. required: true,
  19182. type: "string"
  19183. },
  19184. page: {
  19185. type: "integer"
  19186. },
  19187. per_page: {
  19188. type: "integer"
  19189. },
  19190. pull_number: {
  19191. required: true,
  19192. type: "integer"
  19193. },
  19194. repo: {
  19195. required: true,
  19196. type: "string"
  19197. }
  19198. },
  19199. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19200. },
  19201. listReviewRequests: {
  19202. method: "GET",
  19203. params: {
  19204. number: {
  19205. alias: "pull_number",
  19206. deprecated: true,
  19207. type: "integer"
  19208. },
  19209. owner: {
  19210. required: true,
  19211. type: "string"
  19212. },
  19213. page: {
  19214. type: "integer"
  19215. },
  19216. per_page: {
  19217. type: "integer"
  19218. },
  19219. pull_number: {
  19220. required: true,
  19221. type: "integer"
  19222. },
  19223. repo: {
  19224. required: true,
  19225. type: "string"
  19226. }
  19227. },
  19228. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19229. },
  19230. listReviews: {
  19231. method: "GET",
  19232. params: {
  19233. number: {
  19234. alias: "pull_number",
  19235. deprecated: true,
  19236. type: "integer"
  19237. },
  19238. owner: {
  19239. required: true,
  19240. type: "string"
  19241. },
  19242. page: {
  19243. type: "integer"
  19244. },
  19245. per_page: {
  19246. type: "integer"
  19247. },
  19248. pull_number: {
  19249. required: true,
  19250. type: "integer"
  19251. },
  19252. repo: {
  19253. required: true,
  19254. type: "string"
  19255. }
  19256. },
  19257. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19258. },
  19259. merge: {
  19260. method: "PUT",
  19261. params: {
  19262. commit_message: {
  19263. type: "string"
  19264. },
  19265. commit_title: {
  19266. type: "string"
  19267. },
  19268. merge_method: {
  19269. enum: ["merge", "squash", "rebase"],
  19270. type: "string"
  19271. },
  19272. number: {
  19273. alias: "pull_number",
  19274. deprecated: true,
  19275. type: "integer"
  19276. },
  19277. owner: {
  19278. required: true,
  19279. type: "string"
  19280. },
  19281. pull_number: {
  19282. required: true,
  19283. type: "integer"
  19284. },
  19285. repo: {
  19286. required: true,
  19287. type: "string"
  19288. },
  19289. sha: {
  19290. type: "string"
  19291. }
  19292. },
  19293. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19294. },
  19295. submitReview: {
  19296. method: "POST",
  19297. params: {
  19298. body: {
  19299. type: "string"
  19300. },
  19301. event: {
  19302. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19303. required: true,
  19304. type: "string"
  19305. },
  19306. number: {
  19307. alias: "pull_number",
  19308. deprecated: true,
  19309. type: "integer"
  19310. },
  19311. owner: {
  19312. required: true,
  19313. type: "string"
  19314. },
  19315. pull_number: {
  19316. required: true,
  19317. type: "integer"
  19318. },
  19319. repo: {
  19320. required: true,
  19321. type: "string"
  19322. },
  19323. review_id: {
  19324. required: true,
  19325. type: "integer"
  19326. }
  19327. },
  19328. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19329. },
  19330. update: {
  19331. method: "PATCH",
  19332. params: {
  19333. base: {
  19334. type: "string"
  19335. },
  19336. body: {
  19337. type: "string"
  19338. },
  19339. maintainer_can_modify: {
  19340. type: "boolean"
  19341. },
  19342. number: {
  19343. alias: "pull_number",
  19344. deprecated: true,
  19345. type: "integer"
  19346. },
  19347. owner: {
  19348. required: true,
  19349. type: "string"
  19350. },
  19351. pull_number: {
  19352. required: true,
  19353. type: "integer"
  19354. },
  19355. repo: {
  19356. required: true,
  19357. type: "string"
  19358. },
  19359. state: {
  19360. enum: ["open", "closed"],
  19361. type: "string"
  19362. },
  19363. title: {
  19364. type: "string"
  19365. }
  19366. },
  19367. url: "/repos/:owner/:repo/pulls/:pull_number"
  19368. },
  19369. updateBranch: {
  19370. headers: {
  19371. accept: "application/vnd.github.lydian-preview+json"
  19372. },
  19373. method: "PUT",
  19374. params: {
  19375. expected_head_sha: {
  19376. type: "string"
  19377. },
  19378. owner: {
  19379. required: true,
  19380. type: "string"
  19381. },
  19382. pull_number: {
  19383. required: true,
  19384. type: "integer"
  19385. },
  19386. repo: {
  19387. required: true,
  19388. type: "string"
  19389. }
  19390. },
  19391. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19392. },
  19393. updateComment: {
  19394. method: "PATCH",
  19395. params: {
  19396. body: {
  19397. required: true,
  19398. type: "string"
  19399. },
  19400. comment_id: {
  19401. required: true,
  19402. type: "integer"
  19403. },
  19404. owner: {
  19405. required: true,
  19406. type: "string"
  19407. },
  19408. repo: {
  19409. required: true,
  19410. type: "string"
  19411. }
  19412. },
  19413. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19414. },
  19415. updateReview: {
  19416. method: "PUT",
  19417. params: {
  19418. body: {
  19419. required: true,
  19420. type: "string"
  19421. },
  19422. number: {
  19423. alias: "pull_number",
  19424. deprecated: true,
  19425. type: "integer"
  19426. },
  19427. owner: {
  19428. required: true,
  19429. type: "string"
  19430. },
  19431. pull_number: {
  19432. required: true,
  19433. type: "integer"
  19434. },
  19435. repo: {
  19436. required: true,
  19437. type: "string"
  19438. },
  19439. review_id: {
  19440. required: true,
  19441. type: "integer"
  19442. }
  19443. },
  19444. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19445. }
  19446. },
  19447. rateLimit: {
  19448. get: {
  19449. method: "GET",
  19450. params: {},
  19451. url: "/rate_limit"
  19452. }
  19453. },
  19454. reactions: {
  19455. createForCommitComment: {
  19456. headers: {
  19457. accept: "application/vnd.github.squirrel-girl-preview+json"
  19458. },
  19459. method: "POST",
  19460. params: {
  19461. comment_id: {
  19462. required: true,
  19463. type: "integer"
  19464. },
  19465. content: {
  19466. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19467. required: true,
  19468. type: "string"
  19469. },
  19470. owner: {
  19471. required: true,
  19472. type: "string"
  19473. },
  19474. repo: {
  19475. required: true,
  19476. type: "string"
  19477. }
  19478. },
  19479. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19480. },
  19481. createForIssue: {
  19482. headers: {
  19483. accept: "application/vnd.github.squirrel-girl-preview+json"
  19484. },
  19485. method: "POST",
  19486. params: {
  19487. content: {
  19488. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19489. required: true,
  19490. type: "string"
  19491. },
  19492. issue_number: {
  19493. required: true,
  19494. type: "integer"
  19495. },
  19496. number: {
  19497. alias: "issue_number",
  19498. deprecated: true,
  19499. type: "integer"
  19500. },
  19501. owner: {
  19502. required: true,
  19503. type: "string"
  19504. },
  19505. repo: {
  19506. required: true,
  19507. type: "string"
  19508. }
  19509. },
  19510. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19511. },
  19512. createForIssueComment: {
  19513. headers: {
  19514. accept: "application/vnd.github.squirrel-girl-preview+json"
  19515. },
  19516. method: "POST",
  19517. params: {
  19518. comment_id: {
  19519. required: true,
  19520. type: "integer"
  19521. },
  19522. content: {
  19523. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19524. required: true,
  19525. type: "string"
  19526. },
  19527. owner: {
  19528. required: true,
  19529. type: "string"
  19530. },
  19531. repo: {
  19532. required: true,
  19533. type: "string"
  19534. }
  19535. },
  19536. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19537. },
  19538. createForPullRequestReviewComment: {
  19539. headers: {
  19540. accept: "application/vnd.github.squirrel-girl-preview+json"
  19541. },
  19542. method: "POST",
  19543. params: {
  19544. comment_id: {
  19545. required: true,
  19546. type: "integer"
  19547. },
  19548. content: {
  19549. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19550. required: true,
  19551. type: "string"
  19552. },
  19553. owner: {
  19554. required: true,
  19555. type: "string"
  19556. },
  19557. repo: {
  19558. required: true,
  19559. type: "string"
  19560. }
  19561. },
  19562. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19563. },
  19564. createForTeamDiscussion: {
  19565. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19566. headers: {
  19567. accept: "application/vnd.github.squirrel-girl-preview+json"
  19568. },
  19569. method: "POST",
  19570. params: {
  19571. content: {
  19572. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19573. required: true,
  19574. type: "string"
  19575. },
  19576. discussion_number: {
  19577. required: true,
  19578. type: "integer"
  19579. },
  19580. team_id: {
  19581. required: true,
  19582. type: "integer"
  19583. }
  19584. },
  19585. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19586. },
  19587. createForTeamDiscussionComment: {
  19588. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19589. headers: {
  19590. accept: "application/vnd.github.squirrel-girl-preview+json"
  19591. },
  19592. method: "POST",
  19593. params: {
  19594. comment_number: {
  19595. required: true,
  19596. type: "integer"
  19597. },
  19598. content: {
  19599. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19600. required: true,
  19601. type: "string"
  19602. },
  19603. discussion_number: {
  19604. required: true,
  19605. type: "integer"
  19606. },
  19607. team_id: {
  19608. required: true,
  19609. type: "integer"
  19610. }
  19611. },
  19612. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19613. },
  19614. createForTeamDiscussionCommentInOrg: {
  19615. headers: {
  19616. accept: "application/vnd.github.squirrel-girl-preview+json"
  19617. },
  19618. method: "POST",
  19619. params: {
  19620. comment_number: {
  19621. required: true,
  19622. type: "integer"
  19623. },
  19624. content: {
  19625. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19626. required: true,
  19627. type: "string"
  19628. },
  19629. discussion_number: {
  19630. required: true,
  19631. type: "integer"
  19632. },
  19633. org: {
  19634. required: true,
  19635. type: "string"
  19636. },
  19637. team_slug: {
  19638. required: true,
  19639. type: "string"
  19640. }
  19641. },
  19642. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19643. },
  19644. createForTeamDiscussionCommentLegacy: {
  19645. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19646. headers: {
  19647. accept: "application/vnd.github.squirrel-girl-preview+json"
  19648. },
  19649. method: "POST",
  19650. params: {
  19651. comment_number: {
  19652. required: true,
  19653. type: "integer"
  19654. },
  19655. content: {
  19656. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19657. required: true,
  19658. type: "string"
  19659. },
  19660. discussion_number: {
  19661. required: true,
  19662. type: "integer"
  19663. },
  19664. team_id: {
  19665. required: true,
  19666. type: "integer"
  19667. }
  19668. },
  19669. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19670. },
  19671. createForTeamDiscussionInOrg: {
  19672. headers: {
  19673. accept: "application/vnd.github.squirrel-girl-preview+json"
  19674. },
  19675. method: "POST",
  19676. params: {
  19677. content: {
  19678. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19679. required: true,
  19680. type: "string"
  19681. },
  19682. discussion_number: {
  19683. required: true,
  19684. type: "integer"
  19685. },
  19686. org: {
  19687. required: true,
  19688. type: "string"
  19689. },
  19690. team_slug: {
  19691. required: true,
  19692. type: "string"
  19693. }
  19694. },
  19695. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19696. },
  19697. createForTeamDiscussionLegacy: {
  19698. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19699. headers: {
  19700. accept: "application/vnd.github.squirrel-girl-preview+json"
  19701. },
  19702. method: "POST",
  19703. params: {
  19704. content: {
  19705. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19706. required: true,
  19707. type: "string"
  19708. },
  19709. discussion_number: {
  19710. required: true,
  19711. type: "integer"
  19712. },
  19713. team_id: {
  19714. required: true,
  19715. type: "integer"
  19716. }
  19717. },
  19718. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19719. },
  19720. delete: {
  19721. headers: {
  19722. accept: "application/vnd.github.squirrel-girl-preview+json"
  19723. },
  19724. method: "DELETE",
  19725. params: {
  19726. reaction_id: {
  19727. required: true,
  19728. type: "integer"
  19729. }
  19730. },
  19731. url: "/reactions/:reaction_id"
  19732. },
  19733. listForCommitComment: {
  19734. headers: {
  19735. accept: "application/vnd.github.squirrel-girl-preview+json"
  19736. },
  19737. method: "GET",
  19738. params: {
  19739. comment_id: {
  19740. required: true,
  19741. type: "integer"
  19742. },
  19743. content: {
  19744. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19745. type: "string"
  19746. },
  19747. owner: {
  19748. required: true,
  19749. type: "string"
  19750. },
  19751. page: {
  19752. type: "integer"
  19753. },
  19754. per_page: {
  19755. type: "integer"
  19756. },
  19757. repo: {
  19758. required: true,
  19759. type: "string"
  19760. }
  19761. },
  19762. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19763. },
  19764. listForIssue: {
  19765. headers: {
  19766. accept: "application/vnd.github.squirrel-girl-preview+json"
  19767. },
  19768. method: "GET",
  19769. params: {
  19770. content: {
  19771. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19772. type: "string"
  19773. },
  19774. issue_number: {
  19775. required: true,
  19776. type: "integer"
  19777. },
  19778. number: {
  19779. alias: "issue_number",
  19780. deprecated: true,
  19781. type: "integer"
  19782. },
  19783. owner: {
  19784. required: true,
  19785. type: "string"
  19786. },
  19787. page: {
  19788. type: "integer"
  19789. },
  19790. per_page: {
  19791. type: "integer"
  19792. },
  19793. repo: {
  19794. required: true,
  19795. type: "string"
  19796. }
  19797. },
  19798. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19799. },
  19800. listForIssueComment: {
  19801. headers: {
  19802. accept: "application/vnd.github.squirrel-girl-preview+json"
  19803. },
  19804. method: "GET",
  19805. params: {
  19806. comment_id: {
  19807. required: true,
  19808. type: "integer"
  19809. },
  19810. content: {
  19811. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19812. type: "string"
  19813. },
  19814. owner: {
  19815. required: true,
  19816. type: "string"
  19817. },
  19818. page: {
  19819. type: "integer"
  19820. },
  19821. per_page: {
  19822. type: "integer"
  19823. },
  19824. repo: {
  19825. required: true,
  19826. type: "string"
  19827. }
  19828. },
  19829. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19830. },
  19831. listForPullRequestReviewComment: {
  19832. headers: {
  19833. accept: "application/vnd.github.squirrel-girl-preview+json"
  19834. },
  19835. method: "GET",
  19836. params: {
  19837. comment_id: {
  19838. required: true,
  19839. type: "integer"
  19840. },
  19841. content: {
  19842. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19843. type: "string"
  19844. },
  19845. owner: {
  19846. required: true,
  19847. type: "string"
  19848. },
  19849. page: {
  19850. type: "integer"
  19851. },
  19852. per_page: {
  19853. type: "integer"
  19854. },
  19855. repo: {
  19856. required: true,
  19857. type: "string"
  19858. }
  19859. },
  19860. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19861. },
  19862. listForTeamDiscussion: {
  19863. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19864. headers: {
  19865. accept: "application/vnd.github.squirrel-girl-preview+json"
  19866. },
  19867. method: "GET",
  19868. params: {
  19869. content: {
  19870. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19871. type: "string"
  19872. },
  19873. discussion_number: {
  19874. required: true,
  19875. type: "integer"
  19876. },
  19877. page: {
  19878. type: "integer"
  19879. },
  19880. per_page: {
  19881. type: "integer"
  19882. },
  19883. team_id: {
  19884. required: true,
  19885. type: "integer"
  19886. }
  19887. },
  19888. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19889. },
  19890. listForTeamDiscussionComment: {
  19891. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19892. headers: {
  19893. accept: "application/vnd.github.squirrel-girl-preview+json"
  19894. },
  19895. method: "GET",
  19896. params: {
  19897. comment_number: {
  19898. required: true,
  19899. type: "integer"
  19900. },
  19901. content: {
  19902. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19903. type: "string"
  19904. },
  19905. discussion_number: {
  19906. required: true,
  19907. type: "integer"
  19908. },
  19909. page: {
  19910. type: "integer"
  19911. },
  19912. per_page: {
  19913. type: "integer"
  19914. },
  19915. team_id: {
  19916. required: true,
  19917. type: "integer"
  19918. }
  19919. },
  19920. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19921. },
  19922. listForTeamDiscussionCommentInOrg: {
  19923. headers: {
  19924. accept: "application/vnd.github.squirrel-girl-preview+json"
  19925. },
  19926. method: "GET",
  19927. params: {
  19928. comment_number: {
  19929. required: true,
  19930. type: "integer"
  19931. },
  19932. content: {
  19933. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19934. type: "string"
  19935. },
  19936. discussion_number: {
  19937. required: true,
  19938. type: "integer"
  19939. },
  19940. org: {
  19941. required: true,
  19942. type: "string"
  19943. },
  19944. page: {
  19945. type: "integer"
  19946. },
  19947. per_page: {
  19948. type: "integer"
  19949. },
  19950. team_slug: {
  19951. required: true,
  19952. type: "string"
  19953. }
  19954. },
  19955. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19956. },
  19957. listForTeamDiscussionCommentLegacy: {
  19958. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19959. headers: {
  19960. accept: "application/vnd.github.squirrel-girl-preview+json"
  19961. },
  19962. method: "GET",
  19963. params: {
  19964. comment_number: {
  19965. required: true,
  19966. type: "integer"
  19967. },
  19968. content: {
  19969. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19970. type: "string"
  19971. },
  19972. discussion_number: {
  19973. required: true,
  19974. type: "integer"
  19975. },
  19976. page: {
  19977. type: "integer"
  19978. },
  19979. per_page: {
  19980. type: "integer"
  19981. },
  19982. team_id: {
  19983. required: true,
  19984. type: "integer"
  19985. }
  19986. },
  19987. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19988. },
  19989. listForTeamDiscussionInOrg: {
  19990. headers: {
  19991. accept: "application/vnd.github.squirrel-girl-preview+json"
  19992. },
  19993. method: "GET",
  19994. params: {
  19995. content: {
  19996. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19997. type: "string"
  19998. },
  19999. discussion_number: {
  20000. required: true,
  20001. type: "integer"
  20002. },
  20003. org: {
  20004. required: true,
  20005. type: "string"
  20006. },
  20007. page: {
  20008. type: "integer"
  20009. },
  20010. per_page: {
  20011. type: "integer"
  20012. },
  20013. team_slug: {
  20014. required: true,
  20015. type: "string"
  20016. }
  20017. },
  20018. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  20019. },
  20020. listForTeamDiscussionLegacy: {
  20021. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  20022. headers: {
  20023. accept: "application/vnd.github.squirrel-girl-preview+json"
  20024. },
  20025. method: "GET",
  20026. params: {
  20027. content: {
  20028. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20029. type: "string"
  20030. },
  20031. discussion_number: {
  20032. required: true,
  20033. type: "integer"
  20034. },
  20035. page: {
  20036. type: "integer"
  20037. },
  20038. per_page: {
  20039. type: "integer"
  20040. },
  20041. team_id: {
  20042. required: true,
  20043. type: "integer"
  20044. }
  20045. },
  20046. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20047. }
  20048. },
  20049. repos: {
  20050. acceptInvitation: {
  20051. method: "PATCH",
  20052. params: {
  20053. invitation_id: {
  20054. required: true,
  20055. type: "integer"
  20056. }
  20057. },
  20058. url: "/user/repository_invitations/:invitation_id"
  20059. },
  20060. addCollaborator: {
  20061. method: "PUT",
  20062. params: {
  20063. owner: {
  20064. required: true,
  20065. type: "string"
  20066. },
  20067. permission: {
  20068. enum: ["pull", "push", "admin"],
  20069. type: "string"
  20070. },
  20071. repo: {
  20072. required: true,
  20073. type: "string"
  20074. },
  20075. username: {
  20076. required: true,
  20077. type: "string"
  20078. }
  20079. },
  20080. url: "/repos/:owner/:repo/collaborators/:username"
  20081. },
  20082. addDeployKey: {
  20083. method: "POST",
  20084. params: {
  20085. key: {
  20086. required: true,
  20087. type: "string"
  20088. },
  20089. owner: {
  20090. required: true,
  20091. type: "string"
  20092. },
  20093. read_only: {
  20094. type: "boolean"
  20095. },
  20096. repo: {
  20097. required: true,
  20098. type: "string"
  20099. },
  20100. title: {
  20101. type: "string"
  20102. }
  20103. },
  20104. url: "/repos/:owner/:repo/keys"
  20105. },
  20106. addProtectedBranchAdminEnforcement: {
  20107. method: "POST",
  20108. params: {
  20109. branch: {
  20110. required: true,
  20111. type: "string"
  20112. },
  20113. owner: {
  20114. required: true,
  20115. type: "string"
  20116. },
  20117. repo: {
  20118. required: true,
  20119. type: "string"
  20120. }
  20121. },
  20122. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20123. },
  20124. addProtectedBranchAppRestrictions: {
  20125. method: "POST",
  20126. params: {
  20127. apps: {
  20128. mapTo: "data",
  20129. required: true,
  20130. type: "string[]"
  20131. },
  20132. branch: {
  20133. required: true,
  20134. type: "string"
  20135. },
  20136. owner: {
  20137. required: true,
  20138. type: "string"
  20139. },
  20140. repo: {
  20141. required: true,
  20142. type: "string"
  20143. }
  20144. },
  20145. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20146. },
  20147. addProtectedBranchRequiredSignatures: {
  20148. headers: {
  20149. accept: "application/vnd.github.zzzax-preview+json"
  20150. },
  20151. method: "POST",
  20152. params: {
  20153. branch: {
  20154. required: true,
  20155. type: "string"
  20156. },
  20157. owner: {
  20158. required: true,
  20159. type: "string"
  20160. },
  20161. repo: {
  20162. required: true,
  20163. type: "string"
  20164. }
  20165. },
  20166. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20167. },
  20168. addProtectedBranchRequiredStatusChecksContexts: {
  20169. method: "POST",
  20170. params: {
  20171. branch: {
  20172. required: true,
  20173. type: "string"
  20174. },
  20175. contexts: {
  20176. mapTo: "data",
  20177. required: true,
  20178. type: "string[]"
  20179. },
  20180. owner: {
  20181. required: true,
  20182. type: "string"
  20183. },
  20184. repo: {
  20185. required: true,
  20186. type: "string"
  20187. }
  20188. },
  20189. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20190. },
  20191. addProtectedBranchTeamRestrictions: {
  20192. method: "POST",
  20193. params: {
  20194. branch: {
  20195. required: true,
  20196. type: "string"
  20197. },
  20198. owner: {
  20199. required: true,
  20200. type: "string"
  20201. },
  20202. repo: {
  20203. required: true,
  20204. type: "string"
  20205. },
  20206. teams: {
  20207. mapTo: "data",
  20208. required: true,
  20209. type: "string[]"
  20210. }
  20211. },
  20212. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20213. },
  20214. addProtectedBranchUserRestrictions: {
  20215. method: "POST",
  20216. params: {
  20217. branch: {
  20218. required: true,
  20219. type: "string"
  20220. },
  20221. owner: {
  20222. required: true,
  20223. type: "string"
  20224. },
  20225. repo: {
  20226. required: true,
  20227. type: "string"
  20228. },
  20229. users: {
  20230. mapTo: "data",
  20231. required: true,
  20232. type: "string[]"
  20233. }
  20234. },
  20235. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20236. },
  20237. checkCollaborator: {
  20238. method: "GET",
  20239. params: {
  20240. owner: {
  20241. required: true,
  20242. type: "string"
  20243. },
  20244. repo: {
  20245. required: true,
  20246. type: "string"
  20247. },
  20248. username: {
  20249. required: true,
  20250. type: "string"
  20251. }
  20252. },
  20253. url: "/repos/:owner/:repo/collaborators/:username"
  20254. },
  20255. checkVulnerabilityAlerts: {
  20256. headers: {
  20257. accept: "application/vnd.github.dorian-preview+json"
  20258. },
  20259. method: "GET",
  20260. params: {
  20261. owner: {
  20262. required: true,
  20263. type: "string"
  20264. },
  20265. repo: {
  20266. required: true,
  20267. type: "string"
  20268. }
  20269. },
  20270. url: "/repos/:owner/:repo/vulnerability-alerts"
  20271. },
  20272. compareCommits: {
  20273. method: "GET",
  20274. params: {
  20275. base: {
  20276. required: true,
  20277. type: "string"
  20278. },
  20279. head: {
  20280. required: true,
  20281. type: "string"
  20282. },
  20283. owner: {
  20284. required: true,
  20285. type: "string"
  20286. },
  20287. repo: {
  20288. required: true,
  20289. type: "string"
  20290. }
  20291. },
  20292. url: "/repos/:owner/:repo/compare/:base...:head"
  20293. },
  20294. createCommitComment: {
  20295. method: "POST",
  20296. params: {
  20297. body: {
  20298. required: true,
  20299. type: "string"
  20300. },
  20301. commit_sha: {
  20302. required: true,
  20303. type: "string"
  20304. },
  20305. line: {
  20306. type: "integer"
  20307. },
  20308. owner: {
  20309. required: true,
  20310. type: "string"
  20311. },
  20312. path: {
  20313. type: "string"
  20314. },
  20315. position: {
  20316. type: "integer"
  20317. },
  20318. repo: {
  20319. required: true,
  20320. type: "string"
  20321. },
  20322. sha: {
  20323. alias: "commit_sha",
  20324. deprecated: true,
  20325. type: "string"
  20326. }
  20327. },
  20328. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20329. },
  20330. createDeployment: {
  20331. method: "POST",
  20332. params: {
  20333. auto_merge: {
  20334. type: "boolean"
  20335. },
  20336. description: {
  20337. type: "string"
  20338. },
  20339. environment: {
  20340. type: "string"
  20341. },
  20342. owner: {
  20343. required: true,
  20344. type: "string"
  20345. },
  20346. payload: {
  20347. type: "string"
  20348. },
  20349. production_environment: {
  20350. type: "boolean"
  20351. },
  20352. ref: {
  20353. required: true,
  20354. type: "string"
  20355. },
  20356. repo: {
  20357. required: true,
  20358. type: "string"
  20359. },
  20360. required_contexts: {
  20361. type: "string[]"
  20362. },
  20363. task: {
  20364. type: "string"
  20365. },
  20366. transient_environment: {
  20367. type: "boolean"
  20368. }
  20369. },
  20370. url: "/repos/:owner/:repo/deployments"
  20371. },
  20372. createDeploymentStatus: {
  20373. method: "POST",
  20374. params: {
  20375. auto_inactive: {
  20376. type: "boolean"
  20377. },
  20378. deployment_id: {
  20379. required: true,
  20380. type: "integer"
  20381. },
  20382. description: {
  20383. type: "string"
  20384. },
  20385. environment: {
  20386. enum: ["production", "staging", "qa"],
  20387. type: "string"
  20388. },
  20389. environment_url: {
  20390. type: "string"
  20391. },
  20392. log_url: {
  20393. type: "string"
  20394. },
  20395. owner: {
  20396. required: true,
  20397. type: "string"
  20398. },
  20399. repo: {
  20400. required: true,
  20401. type: "string"
  20402. },
  20403. state: {
  20404. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20405. required: true,
  20406. type: "string"
  20407. },
  20408. target_url: {
  20409. type: "string"
  20410. }
  20411. },
  20412. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20413. },
  20414. createDispatchEvent: {
  20415. method: "POST",
  20416. params: {
  20417. client_payload: {
  20418. type: "object"
  20419. },
  20420. event_type: {
  20421. type: "string"
  20422. },
  20423. owner: {
  20424. required: true,
  20425. type: "string"
  20426. },
  20427. repo: {
  20428. required: true,
  20429. type: "string"
  20430. }
  20431. },
  20432. url: "/repos/:owner/:repo/dispatches"
  20433. },
  20434. createFile: {
  20435. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20436. method: "PUT",
  20437. params: {
  20438. author: {
  20439. type: "object"
  20440. },
  20441. "author.email": {
  20442. required: true,
  20443. type: "string"
  20444. },
  20445. "author.name": {
  20446. required: true,
  20447. type: "string"
  20448. },
  20449. branch: {
  20450. type: "string"
  20451. },
  20452. committer: {
  20453. type: "object"
  20454. },
  20455. "committer.email": {
  20456. required: true,
  20457. type: "string"
  20458. },
  20459. "committer.name": {
  20460. required: true,
  20461. type: "string"
  20462. },
  20463. content: {
  20464. required: true,
  20465. type: "string"
  20466. },
  20467. message: {
  20468. required: true,
  20469. type: "string"
  20470. },
  20471. owner: {
  20472. required: true,
  20473. type: "string"
  20474. },
  20475. path: {
  20476. required: true,
  20477. type: "string"
  20478. },
  20479. repo: {
  20480. required: true,
  20481. type: "string"
  20482. },
  20483. sha: {
  20484. type: "string"
  20485. }
  20486. },
  20487. url: "/repos/:owner/:repo/contents/:path"
  20488. },
  20489. createForAuthenticatedUser: {
  20490. method: "POST",
  20491. params: {
  20492. allow_merge_commit: {
  20493. type: "boolean"
  20494. },
  20495. allow_rebase_merge: {
  20496. type: "boolean"
  20497. },
  20498. allow_squash_merge: {
  20499. type: "boolean"
  20500. },
  20501. auto_init: {
  20502. type: "boolean"
  20503. },
  20504. delete_branch_on_merge: {
  20505. type: "boolean"
  20506. },
  20507. description: {
  20508. type: "string"
  20509. },
  20510. gitignore_template: {
  20511. type: "string"
  20512. },
  20513. has_issues: {
  20514. type: "boolean"
  20515. },
  20516. has_projects: {
  20517. type: "boolean"
  20518. },
  20519. has_wiki: {
  20520. type: "boolean"
  20521. },
  20522. homepage: {
  20523. type: "string"
  20524. },
  20525. is_template: {
  20526. type: "boolean"
  20527. },
  20528. license_template: {
  20529. type: "string"
  20530. },
  20531. name: {
  20532. required: true,
  20533. type: "string"
  20534. },
  20535. private: {
  20536. type: "boolean"
  20537. },
  20538. team_id: {
  20539. type: "integer"
  20540. },
  20541. visibility: {
  20542. enum: ["public", "private", "visibility", "internal"],
  20543. type: "string"
  20544. }
  20545. },
  20546. url: "/user/repos"
  20547. },
  20548. createFork: {
  20549. method: "POST",
  20550. params: {
  20551. organization: {
  20552. type: "string"
  20553. },
  20554. owner: {
  20555. required: true,
  20556. type: "string"
  20557. },
  20558. repo: {
  20559. required: true,
  20560. type: "string"
  20561. }
  20562. },
  20563. url: "/repos/:owner/:repo/forks"
  20564. },
  20565. createHook: {
  20566. method: "POST",
  20567. params: {
  20568. active: {
  20569. type: "boolean"
  20570. },
  20571. config: {
  20572. required: true,
  20573. type: "object"
  20574. },
  20575. "config.content_type": {
  20576. type: "string"
  20577. },
  20578. "config.insecure_ssl": {
  20579. type: "string"
  20580. },
  20581. "config.secret": {
  20582. type: "string"
  20583. },
  20584. "config.url": {
  20585. required: true,
  20586. type: "string"
  20587. },
  20588. events: {
  20589. type: "string[]"
  20590. },
  20591. name: {
  20592. type: "string"
  20593. },
  20594. owner: {
  20595. required: true,
  20596. type: "string"
  20597. },
  20598. repo: {
  20599. required: true,
  20600. type: "string"
  20601. }
  20602. },
  20603. url: "/repos/:owner/:repo/hooks"
  20604. },
  20605. createInOrg: {
  20606. method: "POST",
  20607. params: {
  20608. allow_merge_commit: {
  20609. type: "boolean"
  20610. },
  20611. allow_rebase_merge: {
  20612. type: "boolean"
  20613. },
  20614. allow_squash_merge: {
  20615. type: "boolean"
  20616. },
  20617. auto_init: {
  20618. type: "boolean"
  20619. },
  20620. delete_branch_on_merge: {
  20621. type: "boolean"
  20622. },
  20623. description: {
  20624. type: "string"
  20625. },
  20626. gitignore_template: {
  20627. type: "string"
  20628. },
  20629. has_issues: {
  20630. type: "boolean"
  20631. },
  20632. has_projects: {
  20633. type: "boolean"
  20634. },
  20635. has_wiki: {
  20636. type: "boolean"
  20637. },
  20638. homepage: {
  20639. type: "string"
  20640. },
  20641. is_template: {
  20642. type: "boolean"
  20643. },
  20644. license_template: {
  20645. type: "string"
  20646. },
  20647. name: {
  20648. required: true,
  20649. type: "string"
  20650. },
  20651. org: {
  20652. required: true,
  20653. type: "string"
  20654. },
  20655. private: {
  20656. type: "boolean"
  20657. },
  20658. team_id: {
  20659. type: "integer"
  20660. },
  20661. visibility: {
  20662. enum: ["public", "private", "visibility", "internal"],
  20663. type: "string"
  20664. }
  20665. },
  20666. url: "/orgs/:org/repos"
  20667. },
  20668. createOrUpdateFile: {
  20669. method: "PUT",
  20670. params: {
  20671. author: {
  20672. type: "object"
  20673. },
  20674. "author.email": {
  20675. required: true,
  20676. type: "string"
  20677. },
  20678. "author.name": {
  20679. required: true,
  20680. type: "string"
  20681. },
  20682. branch: {
  20683. type: "string"
  20684. },
  20685. committer: {
  20686. type: "object"
  20687. },
  20688. "committer.email": {
  20689. required: true,
  20690. type: "string"
  20691. },
  20692. "committer.name": {
  20693. required: true,
  20694. type: "string"
  20695. },
  20696. content: {
  20697. required: true,
  20698. type: "string"
  20699. },
  20700. message: {
  20701. required: true,
  20702. type: "string"
  20703. },
  20704. owner: {
  20705. required: true,
  20706. type: "string"
  20707. },
  20708. path: {
  20709. required: true,
  20710. type: "string"
  20711. },
  20712. repo: {
  20713. required: true,
  20714. type: "string"
  20715. },
  20716. sha: {
  20717. type: "string"
  20718. }
  20719. },
  20720. url: "/repos/:owner/:repo/contents/:path"
  20721. },
  20722. createRelease: {
  20723. method: "POST",
  20724. params: {
  20725. body: {
  20726. type: "string"
  20727. },
  20728. draft: {
  20729. type: "boolean"
  20730. },
  20731. name: {
  20732. type: "string"
  20733. },
  20734. owner: {
  20735. required: true,
  20736. type: "string"
  20737. },
  20738. prerelease: {
  20739. type: "boolean"
  20740. },
  20741. repo: {
  20742. required: true,
  20743. type: "string"
  20744. },
  20745. tag_name: {
  20746. required: true,
  20747. type: "string"
  20748. },
  20749. target_commitish: {
  20750. type: "string"
  20751. }
  20752. },
  20753. url: "/repos/:owner/:repo/releases"
  20754. },
  20755. createStatus: {
  20756. method: "POST",
  20757. params: {
  20758. context: {
  20759. type: "string"
  20760. },
  20761. description: {
  20762. type: "string"
  20763. },
  20764. owner: {
  20765. required: true,
  20766. type: "string"
  20767. },
  20768. repo: {
  20769. required: true,
  20770. type: "string"
  20771. },
  20772. sha: {
  20773. required: true,
  20774. type: "string"
  20775. },
  20776. state: {
  20777. enum: ["error", "failure", "pending", "success"],
  20778. required: true,
  20779. type: "string"
  20780. },
  20781. target_url: {
  20782. type: "string"
  20783. }
  20784. },
  20785. url: "/repos/:owner/:repo/statuses/:sha"
  20786. },
  20787. createUsingTemplate: {
  20788. headers: {
  20789. accept: "application/vnd.github.baptiste-preview+json"
  20790. },
  20791. method: "POST",
  20792. params: {
  20793. description: {
  20794. type: "string"
  20795. },
  20796. name: {
  20797. required: true,
  20798. type: "string"
  20799. },
  20800. owner: {
  20801. type: "string"
  20802. },
  20803. private: {
  20804. type: "boolean"
  20805. },
  20806. template_owner: {
  20807. required: true,
  20808. type: "string"
  20809. },
  20810. template_repo: {
  20811. required: true,
  20812. type: "string"
  20813. }
  20814. },
  20815. url: "/repos/:template_owner/:template_repo/generate"
  20816. },
  20817. declineInvitation: {
  20818. method: "DELETE",
  20819. params: {
  20820. invitation_id: {
  20821. required: true,
  20822. type: "integer"
  20823. }
  20824. },
  20825. url: "/user/repository_invitations/:invitation_id"
  20826. },
  20827. delete: {
  20828. method: "DELETE",
  20829. params: {
  20830. owner: {
  20831. required: true,
  20832. type: "string"
  20833. },
  20834. repo: {
  20835. required: true,
  20836. type: "string"
  20837. }
  20838. },
  20839. url: "/repos/:owner/:repo"
  20840. },
  20841. deleteCommitComment: {
  20842. method: "DELETE",
  20843. params: {
  20844. comment_id: {
  20845. required: true,
  20846. type: "integer"
  20847. },
  20848. owner: {
  20849. required: true,
  20850. type: "string"
  20851. },
  20852. repo: {
  20853. required: true,
  20854. type: "string"
  20855. }
  20856. },
  20857. url: "/repos/:owner/:repo/comments/:comment_id"
  20858. },
  20859. deleteDownload: {
  20860. method: "DELETE",
  20861. params: {
  20862. download_id: {
  20863. required: true,
  20864. type: "integer"
  20865. },
  20866. owner: {
  20867. required: true,
  20868. type: "string"
  20869. },
  20870. repo: {
  20871. required: true,
  20872. type: "string"
  20873. }
  20874. },
  20875. url: "/repos/:owner/:repo/downloads/:download_id"
  20876. },
  20877. deleteFile: {
  20878. method: "DELETE",
  20879. params: {
  20880. author: {
  20881. type: "object"
  20882. },
  20883. "author.email": {
  20884. type: "string"
  20885. },
  20886. "author.name": {
  20887. type: "string"
  20888. },
  20889. branch: {
  20890. type: "string"
  20891. },
  20892. committer: {
  20893. type: "object"
  20894. },
  20895. "committer.email": {
  20896. type: "string"
  20897. },
  20898. "committer.name": {
  20899. type: "string"
  20900. },
  20901. message: {
  20902. required: true,
  20903. type: "string"
  20904. },
  20905. owner: {
  20906. required: true,
  20907. type: "string"
  20908. },
  20909. path: {
  20910. required: true,
  20911. type: "string"
  20912. },
  20913. repo: {
  20914. required: true,
  20915. type: "string"
  20916. },
  20917. sha: {
  20918. required: true,
  20919. type: "string"
  20920. }
  20921. },
  20922. url: "/repos/:owner/:repo/contents/:path"
  20923. },
  20924. deleteHook: {
  20925. method: "DELETE",
  20926. params: {
  20927. hook_id: {
  20928. required: true,
  20929. type: "integer"
  20930. },
  20931. owner: {
  20932. required: true,
  20933. type: "string"
  20934. },
  20935. repo: {
  20936. required: true,
  20937. type: "string"
  20938. }
  20939. },
  20940. url: "/repos/:owner/:repo/hooks/:hook_id"
  20941. },
  20942. deleteInvitation: {
  20943. method: "DELETE",
  20944. params: {
  20945. invitation_id: {
  20946. required: true,
  20947. type: "integer"
  20948. },
  20949. owner: {
  20950. required: true,
  20951. type: "string"
  20952. },
  20953. repo: {
  20954. required: true,
  20955. type: "string"
  20956. }
  20957. },
  20958. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20959. },
  20960. deleteRelease: {
  20961. method: "DELETE",
  20962. params: {
  20963. owner: {
  20964. required: true,
  20965. type: "string"
  20966. },
  20967. release_id: {
  20968. required: true,
  20969. type: "integer"
  20970. },
  20971. repo: {
  20972. required: true,
  20973. type: "string"
  20974. }
  20975. },
  20976. url: "/repos/:owner/:repo/releases/:release_id"
  20977. },
  20978. deleteReleaseAsset: {
  20979. method: "DELETE",
  20980. params: {
  20981. asset_id: {
  20982. required: true,
  20983. type: "integer"
  20984. },
  20985. owner: {
  20986. required: true,
  20987. type: "string"
  20988. },
  20989. repo: {
  20990. required: true,
  20991. type: "string"
  20992. }
  20993. },
  20994. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20995. },
  20996. disableAutomatedSecurityFixes: {
  20997. headers: {
  20998. accept: "application/vnd.github.london-preview+json"
  20999. },
  21000. method: "DELETE",
  21001. params: {
  21002. owner: {
  21003. required: true,
  21004. type: "string"
  21005. },
  21006. repo: {
  21007. required: true,
  21008. type: "string"
  21009. }
  21010. },
  21011. url: "/repos/:owner/:repo/automated-security-fixes"
  21012. },
  21013. disablePagesSite: {
  21014. headers: {
  21015. accept: "application/vnd.github.switcheroo-preview+json"
  21016. },
  21017. method: "DELETE",
  21018. params: {
  21019. owner: {
  21020. required: true,
  21021. type: "string"
  21022. },
  21023. repo: {
  21024. required: true,
  21025. type: "string"
  21026. }
  21027. },
  21028. url: "/repos/:owner/:repo/pages"
  21029. },
  21030. disableVulnerabilityAlerts: {
  21031. headers: {
  21032. accept: "application/vnd.github.dorian-preview+json"
  21033. },
  21034. method: "DELETE",
  21035. params: {
  21036. owner: {
  21037. required: true,
  21038. type: "string"
  21039. },
  21040. repo: {
  21041. required: true,
  21042. type: "string"
  21043. }
  21044. },
  21045. url: "/repos/:owner/:repo/vulnerability-alerts"
  21046. },
  21047. enableAutomatedSecurityFixes: {
  21048. headers: {
  21049. accept: "application/vnd.github.london-preview+json"
  21050. },
  21051. method: "PUT",
  21052. params: {
  21053. owner: {
  21054. required: true,
  21055. type: "string"
  21056. },
  21057. repo: {
  21058. required: true,
  21059. type: "string"
  21060. }
  21061. },
  21062. url: "/repos/:owner/:repo/automated-security-fixes"
  21063. },
  21064. enablePagesSite: {
  21065. headers: {
  21066. accept: "application/vnd.github.switcheroo-preview+json"
  21067. },
  21068. method: "POST",
  21069. params: {
  21070. owner: {
  21071. required: true,
  21072. type: "string"
  21073. },
  21074. repo: {
  21075. required: true,
  21076. type: "string"
  21077. },
  21078. source: {
  21079. type: "object"
  21080. },
  21081. "source.branch": {
  21082. enum: ["master", "gh-pages"],
  21083. type: "string"
  21084. },
  21085. "source.path": {
  21086. type: "string"
  21087. }
  21088. },
  21089. url: "/repos/:owner/:repo/pages"
  21090. },
  21091. enableVulnerabilityAlerts: {
  21092. headers: {
  21093. accept: "application/vnd.github.dorian-preview+json"
  21094. },
  21095. method: "PUT",
  21096. params: {
  21097. owner: {
  21098. required: true,
  21099. type: "string"
  21100. },
  21101. repo: {
  21102. required: true,
  21103. type: "string"
  21104. }
  21105. },
  21106. url: "/repos/:owner/:repo/vulnerability-alerts"
  21107. },
  21108. get: {
  21109. method: "GET",
  21110. params: {
  21111. owner: {
  21112. required: true,
  21113. type: "string"
  21114. },
  21115. repo: {
  21116. required: true,
  21117. type: "string"
  21118. }
  21119. },
  21120. url: "/repos/:owner/:repo"
  21121. },
  21122. getAppsWithAccessToProtectedBranch: {
  21123. method: "GET",
  21124. params: {
  21125. branch: {
  21126. required: true,
  21127. type: "string"
  21128. },
  21129. owner: {
  21130. required: true,
  21131. type: "string"
  21132. },
  21133. repo: {
  21134. required: true,
  21135. type: "string"
  21136. }
  21137. },
  21138. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21139. },
  21140. getArchiveLink: {
  21141. method: "GET",
  21142. params: {
  21143. archive_format: {
  21144. required: true,
  21145. type: "string"
  21146. },
  21147. owner: {
  21148. required: true,
  21149. type: "string"
  21150. },
  21151. ref: {
  21152. required: true,
  21153. type: "string"
  21154. },
  21155. repo: {
  21156. required: true,
  21157. type: "string"
  21158. }
  21159. },
  21160. url: "/repos/:owner/:repo/:archive_format/:ref"
  21161. },
  21162. getBranch: {
  21163. method: "GET",
  21164. params: {
  21165. branch: {
  21166. required: true,
  21167. type: "string"
  21168. },
  21169. owner: {
  21170. required: true,
  21171. type: "string"
  21172. },
  21173. repo: {
  21174. required: true,
  21175. type: "string"
  21176. }
  21177. },
  21178. url: "/repos/:owner/:repo/branches/:branch"
  21179. },
  21180. getBranchProtection: {
  21181. method: "GET",
  21182. params: {
  21183. branch: {
  21184. required: true,
  21185. type: "string"
  21186. },
  21187. owner: {
  21188. required: true,
  21189. type: "string"
  21190. },
  21191. repo: {
  21192. required: true,
  21193. type: "string"
  21194. }
  21195. },
  21196. url: "/repos/:owner/:repo/branches/:branch/protection"
  21197. },
  21198. getClones: {
  21199. method: "GET",
  21200. params: {
  21201. owner: {
  21202. required: true,
  21203. type: "string"
  21204. },
  21205. per: {
  21206. enum: ["day", "week"],
  21207. type: "string"
  21208. },
  21209. repo: {
  21210. required: true,
  21211. type: "string"
  21212. }
  21213. },
  21214. url: "/repos/:owner/:repo/traffic/clones"
  21215. },
  21216. getCodeFrequencyStats: {
  21217. method: "GET",
  21218. params: {
  21219. owner: {
  21220. required: true,
  21221. type: "string"
  21222. },
  21223. repo: {
  21224. required: true,
  21225. type: "string"
  21226. }
  21227. },
  21228. url: "/repos/:owner/:repo/stats/code_frequency"
  21229. },
  21230. getCollaboratorPermissionLevel: {
  21231. method: "GET",
  21232. params: {
  21233. owner: {
  21234. required: true,
  21235. type: "string"
  21236. },
  21237. repo: {
  21238. required: true,
  21239. type: "string"
  21240. },
  21241. username: {
  21242. required: true,
  21243. type: "string"
  21244. }
  21245. },
  21246. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21247. },
  21248. getCombinedStatusForRef: {
  21249. method: "GET",
  21250. params: {
  21251. owner: {
  21252. required: true,
  21253. type: "string"
  21254. },
  21255. ref: {
  21256. required: true,
  21257. type: "string"
  21258. },
  21259. repo: {
  21260. required: true,
  21261. type: "string"
  21262. }
  21263. },
  21264. url: "/repos/:owner/:repo/commits/:ref/status"
  21265. },
  21266. getCommit: {
  21267. method: "GET",
  21268. params: {
  21269. commit_sha: {
  21270. alias: "ref",
  21271. deprecated: true,
  21272. type: "string"
  21273. },
  21274. owner: {
  21275. required: true,
  21276. type: "string"
  21277. },
  21278. ref: {
  21279. required: true,
  21280. type: "string"
  21281. },
  21282. repo: {
  21283. required: true,
  21284. type: "string"
  21285. },
  21286. sha: {
  21287. alias: "ref",
  21288. deprecated: true,
  21289. type: "string"
  21290. }
  21291. },
  21292. url: "/repos/:owner/:repo/commits/:ref"
  21293. },
  21294. getCommitActivityStats: {
  21295. method: "GET",
  21296. params: {
  21297. owner: {
  21298. required: true,
  21299. type: "string"
  21300. },
  21301. repo: {
  21302. required: true,
  21303. type: "string"
  21304. }
  21305. },
  21306. url: "/repos/:owner/:repo/stats/commit_activity"
  21307. },
  21308. getCommitComment: {
  21309. method: "GET",
  21310. params: {
  21311. comment_id: {
  21312. required: true,
  21313. type: "integer"
  21314. },
  21315. owner: {
  21316. required: true,
  21317. type: "string"
  21318. },
  21319. repo: {
  21320. required: true,
  21321. type: "string"
  21322. }
  21323. },
  21324. url: "/repos/:owner/:repo/comments/:comment_id"
  21325. },
  21326. getCommitRefSha: {
  21327. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21328. headers: {
  21329. accept: "application/vnd.github.v3.sha"
  21330. },
  21331. method: "GET",
  21332. params: {
  21333. owner: {
  21334. required: true,
  21335. type: "string"
  21336. },
  21337. ref: {
  21338. required: true,
  21339. type: "string"
  21340. },
  21341. repo: {
  21342. required: true,
  21343. type: "string"
  21344. }
  21345. },
  21346. url: "/repos/:owner/:repo/commits/:ref"
  21347. },
  21348. getContents: {
  21349. method: "GET",
  21350. params: {
  21351. owner: {
  21352. required: true,
  21353. type: "string"
  21354. },
  21355. path: {
  21356. required: true,
  21357. type: "string"
  21358. },
  21359. ref: {
  21360. type: "string"
  21361. },
  21362. repo: {
  21363. required: true,
  21364. type: "string"
  21365. }
  21366. },
  21367. url: "/repos/:owner/:repo/contents/:path"
  21368. },
  21369. getContributorsStats: {
  21370. method: "GET",
  21371. params: {
  21372. owner: {
  21373. required: true,
  21374. type: "string"
  21375. },
  21376. repo: {
  21377. required: true,
  21378. type: "string"
  21379. }
  21380. },
  21381. url: "/repos/:owner/:repo/stats/contributors"
  21382. },
  21383. getDeployKey: {
  21384. method: "GET",
  21385. params: {
  21386. key_id: {
  21387. required: true,
  21388. type: "integer"
  21389. },
  21390. owner: {
  21391. required: true,
  21392. type: "string"
  21393. },
  21394. repo: {
  21395. required: true,
  21396. type: "string"
  21397. }
  21398. },
  21399. url: "/repos/:owner/:repo/keys/:key_id"
  21400. },
  21401. getDeployment: {
  21402. method: "GET",
  21403. params: {
  21404. deployment_id: {
  21405. required: true,
  21406. type: "integer"
  21407. },
  21408. owner: {
  21409. required: true,
  21410. type: "string"
  21411. },
  21412. repo: {
  21413. required: true,
  21414. type: "string"
  21415. }
  21416. },
  21417. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21418. },
  21419. getDeploymentStatus: {
  21420. method: "GET",
  21421. params: {
  21422. deployment_id: {
  21423. required: true,
  21424. type: "integer"
  21425. },
  21426. owner: {
  21427. required: true,
  21428. type: "string"
  21429. },
  21430. repo: {
  21431. required: true,
  21432. type: "string"
  21433. },
  21434. status_id: {
  21435. required: true,
  21436. type: "integer"
  21437. }
  21438. },
  21439. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21440. },
  21441. getDownload: {
  21442. method: "GET",
  21443. params: {
  21444. download_id: {
  21445. required: true,
  21446. type: "integer"
  21447. },
  21448. owner: {
  21449. required: true,
  21450. type: "string"
  21451. },
  21452. repo: {
  21453. required: true,
  21454. type: "string"
  21455. }
  21456. },
  21457. url: "/repos/:owner/:repo/downloads/:download_id"
  21458. },
  21459. getHook: {
  21460. method: "GET",
  21461. params: {
  21462. hook_id: {
  21463. required: true,
  21464. type: "integer"
  21465. },
  21466. owner: {
  21467. required: true,
  21468. type: "string"
  21469. },
  21470. repo: {
  21471. required: true,
  21472. type: "string"
  21473. }
  21474. },
  21475. url: "/repos/:owner/:repo/hooks/:hook_id"
  21476. },
  21477. getLatestPagesBuild: {
  21478. method: "GET",
  21479. params: {
  21480. owner: {
  21481. required: true,
  21482. type: "string"
  21483. },
  21484. repo: {
  21485. required: true,
  21486. type: "string"
  21487. }
  21488. },
  21489. url: "/repos/:owner/:repo/pages/builds/latest"
  21490. },
  21491. getLatestRelease: {
  21492. method: "GET",
  21493. params: {
  21494. owner: {
  21495. required: true,
  21496. type: "string"
  21497. },
  21498. repo: {
  21499. required: true,
  21500. type: "string"
  21501. }
  21502. },
  21503. url: "/repos/:owner/:repo/releases/latest"
  21504. },
  21505. getPages: {
  21506. method: "GET",
  21507. params: {
  21508. owner: {
  21509. required: true,
  21510. type: "string"
  21511. },
  21512. repo: {
  21513. required: true,
  21514. type: "string"
  21515. }
  21516. },
  21517. url: "/repos/:owner/:repo/pages"
  21518. },
  21519. getPagesBuild: {
  21520. method: "GET",
  21521. params: {
  21522. build_id: {
  21523. required: true,
  21524. type: "integer"
  21525. },
  21526. owner: {
  21527. required: true,
  21528. type: "string"
  21529. },
  21530. repo: {
  21531. required: true,
  21532. type: "string"
  21533. }
  21534. },
  21535. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21536. },
  21537. getParticipationStats: {
  21538. method: "GET",
  21539. params: {
  21540. owner: {
  21541. required: true,
  21542. type: "string"
  21543. },
  21544. repo: {
  21545. required: true,
  21546. type: "string"
  21547. }
  21548. },
  21549. url: "/repos/:owner/:repo/stats/participation"
  21550. },
  21551. getProtectedBranchAdminEnforcement: {
  21552. method: "GET",
  21553. params: {
  21554. branch: {
  21555. required: true,
  21556. type: "string"
  21557. },
  21558. owner: {
  21559. required: true,
  21560. type: "string"
  21561. },
  21562. repo: {
  21563. required: true,
  21564. type: "string"
  21565. }
  21566. },
  21567. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21568. },
  21569. getProtectedBranchPullRequestReviewEnforcement: {
  21570. method: "GET",
  21571. params: {
  21572. branch: {
  21573. required: true,
  21574. type: "string"
  21575. },
  21576. owner: {
  21577. required: true,
  21578. type: "string"
  21579. },
  21580. repo: {
  21581. required: true,
  21582. type: "string"
  21583. }
  21584. },
  21585. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21586. },
  21587. getProtectedBranchRequiredSignatures: {
  21588. headers: {
  21589. accept: "application/vnd.github.zzzax-preview+json"
  21590. },
  21591. method: "GET",
  21592. params: {
  21593. branch: {
  21594. required: true,
  21595. type: "string"
  21596. },
  21597. owner: {
  21598. required: true,
  21599. type: "string"
  21600. },
  21601. repo: {
  21602. required: true,
  21603. type: "string"
  21604. }
  21605. },
  21606. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21607. },
  21608. getProtectedBranchRequiredStatusChecks: {
  21609. method: "GET",
  21610. params: {
  21611. branch: {
  21612. required: true,
  21613. type: "string"
  21614. },
  21615. owner: {
  21616. required: true,
  21617. type: "string"
  21618. },
  21619. repo: {
  21620. required: true,
  21621. type: "string"
  21622. }
  21623. },
  21624. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21625. },
  21626. getProtectedBranchRestrictions: {
  21627. method: "GET",
  21628. params: {
  21629. branch: {
  21630. required: true,
  21631. type: "string"
  21632. },
  21633. owner: {
  21634. required: true,
  21635. type: "string"
  21636. },
  21637. repo: {
  21638. required: true,
  21639. type: "string"
  21640. }
  21641. },
  21642. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21643. },
  21644. getPunchCardStats: {
  21645. method: "GET",
  21646. params: {
  21647. owner: {
  21648. required: true,
  21649. type: "string"
  21650. },
  21651. repo: {
  21652. required: true,
  21653. type: "string"
  21654. }
  21655. },
  21656. url: "/repos/:owner/:repo/stats/punch_card"
  21657. },
  21658. getReadme: {
  21659. method: "GET",
  21660. params: {
  21661. owner: {
  21662. required: true,
  21663. type: "string"
  21664. },
  21665. ref: {
  21666. type: "string"
  21667. },
  21668. repo: {
  21669. required: true,
  21670. type: "string"
  21671. }
  21672. },
  21673. url: "/repos/:owner/:repo/readme"
  21674. },
  21675. getRelease: {
  21676. method: "GET",
  21677. params: {
  21678. owner: {
  21679. required: true,
  21680. type: "string"
  21681. },
  21682. release_id: {
  21683. required: true,
  21684. type: "integer"
  21685. },
  21686. repo: {
  21687. required: true,
  21688. type: "string"
  21689. }
  21690. },
  21691. url: "/repos/:owner/:repo/releases/:release_id"
  21692. },
  21693. getReleaseAsset: {
  21694. method: "GET",
  21695. params: {
  21696. asset_id: {
  21697. required: true,
  21698. type: "integer"
  21699. },
  21700. owner: {
  21701. required: true,
  21702. type: "string"
  21703. },
  21704. repo: {
  21705. required: true,
  21706. type: "string"
  21707. }
  21708. },
  21709. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21710. },
  21711. getReleaseByTag: {
  21712. method: "GET",
  21713. params: {
  21714. owner: {
  21715. required: true,
  21716. type: "string"
  21717. },
  21718. repo: {
  21719. required: true,
  21720. type: "string"
  21721. },
  21722. tag: {
  21723. required: true,
  21724. type: "string"
  21725. }
  21726. },
  21727. url: "/repos/:owner/:repo/releases/tags/:tag"
  21728. },
  21729. getTeamsWithAccessToProtectedBranch: {
  21730. method: "GET",
  21731. params: {
  21732. branch: {
  21733. required: true,
  21734. type: "string"
  21735. },
  21736. owner: {
  21737. required: true,
  21738. type: "string"
  21739. },
  21740. repo: {
  21741. required: true,
  21742. type: "string"
  21743. }
  21744. },
  21745. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21746. },
  21747. getTopPaths: {
  21748. method: "GET",
  21749. params: {
  21750. owner: {
  21751. required: true,
  21752. type: "string"
  21753. },
  21754. repo: {
  21755. required: true,
  21756. type: "string"
  21757. }
  21758. },
  21759. url: "/repos/:owner/:repo/traffic/popular/paths"
  21760. },
  21761. getTopReferrers: {
  21762. method: "GET",
  21763. params: {
  21764. owner: {
  21765. required: true,
  21766. type: "string"
  21767. },
  21768. repo: {
  21769. required: true,
  21770. type: "string"
  21771. }
  21772. },
  21773. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21774. },
  21775. getUsersWithAccessToProtectedBranch: {
  21776. method: "GET",
  21777. params: {
  21778. branch: {
  21779. required: true,
  21780. type: "string"
  21781. },
  21782. owner: {
  21783. required: true,
  21784. type: "string"
  21785. },
  21786. repo: {
  21787. required: true,
  21788. type: "string"
  21789. }
  21790. },
  21791. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21792. },
  21793. getViews: {
  21794. method: "GET",
  21795. params: {
  21796. owner: {
  21797. required: true,
  21798. type: "string"
  21799. },
  21800. per: {
  21801. enum: ["day", "week"],
  21802. type: "string"
  21803. },
  21804. repo: {
  21805. required: true,
  21806. type: "string"
  21807. }
  21808. },
  21809. url: "/repos/:owner/:repo/traffic/views"
  21810. },
  21811. list: {
  21812. method: "GET",
  21813. params: {
  21814. affiliation: {
  21815. type: "string"
  21816. },
  21817. direction: {
  21818. enum: ["asc", "desc"],
  21819. type: "string"
  21820. },
  21821. page: {
  21822. type: "integer"
  21823. },
  21824. per_page: {
  21825. type: "integer"
  21826. },
  21827. sort: {
  21828. enum: ["created", "updated", "pushed", "full_name"],
  21829. type: "string"
  21830. },
  21831. type: {
  21832. enum: ["all", "owner", "public", "private", "member"],
  21833. type: "string"
  21834. },
  21835. visibility: {
  21836. enum: ["all", "public", "private"],
  21837. type: "string"
  21838. }
  21839. },
  21840. url: "/user/repos"
  21841. },
  21842. listAppsWithAccessToProtectedBranch: {
  21843. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21844. method: "GET",
  21845. params: {
  21846. branch: {
  21847. required: true,
  21848. type: "string"
  21849. },
  21850. owner: {
  21851. required: true,
  21852. type: "string"
  21853. },
  21854. repo: {
  21855. required: true,
  21856. type: "string"
  21857. }
  21858. },
  21859. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21860. },
  21861. listAssetsForRelease: {
  21862. method: "GET",
  21863. params: {
  21864. owner: {
  21865. required: true,
  21866. type: "string"
  21867. },
  21868. page: {
  21869. type: "integer"
  21870. },
  21871. per_page: {
  21872. type: "integer"
  21873. },
  21874. release_id: {
  21875. required: true,
  21876. type: "integer"
  21877. },
  21878. repo: {
  21879. required: true,
  21880. type: "string"
  21881. }
  21882. },
  21883. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21884. },
  21885. listBranches: {
  21886. method: "GET",
  21887. params: {
  21888. owner: {
  21889. required: true,
  21890. type: "string"
  21891. },
  21892. page: {
  21893. type: "integer"
  21894. },
  21895. per_page: {
  21896. type: "integer"
  21897. },
  21898. protected: {
  21899. type: "boolean"
  21900. },
  21901. repo: {
  21902. required: true,
  21903. type: "string"
  21904. }
  21905. },
  21906. url: "/repos/:owner/:repo/branches"
  21907. },
  21908. listBranchesForHeadCommit: {
  21909. headers: {
  21910. accept: "application/vnd.github.groot-preview+json"
  21911. },
  21912. method: "GET",
  21913. params: {
  21914. commit_sha: {
  21915. required: true,
  21916. type: "string"
  21917. },
  21918. owner: {
  21919. required: true,
  21920. type: "string"
  21921. },
  21922. repo: {
  21923. required: true,
  21924. type: "string"
  21925. }
  21926. },
  21927. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21928. },
  21929. listCollaborators: {
  21930. method: "GET",
  21931. params: {
  21932. affiliation: {
  21933. enum: ["outside", "direct", "all"],
  21934. type: "string"
  21935. },
  21936. owner: {
  21937. required: true,
  21938. type: "string"
  21939. },
  21940. page: {
  21941. type: "integer"
  21942. },
  21943. per_page: {
  21944. type: "integer"
  21945. },
  21946. repo: {
  21947. required: true,
  21948. type: "string"
  21949. }
  21950. },
  21951. url: "/repos/:owner/:repo/collaborators"
  21952. },
  21953. listCommentsForCommit: {
  21954. method: "GET",
  21955. params: {
  21956. commit_sha: {
  21957. required: true,
  21958. type: "string"
  21959. },
  21960. owner: {
  21961. required: true,
  21962. type: "string"
  21963. },
  21964. page: {
  21965. type: "integer"
  21966. },
  21967. per_page: {
  21968. type: "integer"
  21969. },
  21970. ref: {
  21971. alias: "commit_sha",
  21972. deprecated: true,
  21973. type: "string"
  21974. },
  21975. repo: {
  21976. required: true,
  21977. type: "string"
  21978. }
  21979. },
  21980. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21981. },
  21982. listCommitComments: {
  21983. method: "GET",
  21984. params: {
  21985. owner: {
  21986. required: true,
  21987. type: "string"
  21988. },
  21989. page: {
  21990. type: "integer"
  21991. },
  21992. per_page: {
  21993. type: "integer"
  21994. },
  21995. repo: {
  21996. required: true,
  21997. type: "string"
  21998. }
  21999. },
  22000. url: "/repos/:owner/:repo/comments"
  22001. },
  22002. listCommits: {
  22003. method: "GET",
  22004. params: {
  22005. author: {
  22006. type: "string"
  22007. },
  22008. owner: {
  22009. required: true,
  22010. type: "string"
  22011. },
  22012. page: {
  22013. type: "integer"
  22014. },
  22015. path: {
  22016. type: "string"
  22017. },
  22018. per_page: {
  22019. type: "integer"
  22020. },
  22021. repo: {
  22022. required: true,
  22023. type: "string"
  22024. },
  22025. sha: {
  22026. type: "string"
  22027. },
  22028. since: {
  22029. type: "string"
  22030. },
  22031. until: {
  22032. type: "string"
  22033. }
  22034. },
  22035. url: "/repos/:owner/:repo/commits"
  22036. },
  22037. listContributors: {
  22038. method: "GET",
  22039. params: {
  22040. anon: {
  22041. type: "string"
  22042. },
  22043. owner: {
  22044. required: true,
  22045. type: "string"
  22046. },
  22047. page: {
  22048. type: "integer"
  22049. },
  22050. per_page: {
  22051. type: "integer"
  22052. },
  22053. repo: {
  22054. required: true,
  22055. type: "string"
  22056. }
  22057. },
  22058. url: "/repos/:owner/:repo/contributors"
  22059. },
  22060. listDeployKeys: {
  22061. method: "GET",
  22062. params: {
  22063. owner: {
  22064. required: true,
  22065. type: "string"
  22066. },
  22067. page: {
  22068. type: "integer"
  22069. },
  22070. per_page: {
  22071. type: "integer"
  22072. },
  22073. repo: {
  22074. required: true,
  22075. type: "string"
  22076. }
  22077. },
  22078. url: "/repos/:owner/:repo/keys"
  22079. },
  22080. listDeploymentStatuses: {
  22081. method: "GET",
  22082. params: {
  22083. deployment_id: {
  22084. required: true,
  22085. type: "integer"
  22086. },
  22087. owner: {
  22088. required: true,
  22089. type: "string"
  22090. },
  22091. page: {
  22092. type: "integer"
  22093. },
  22094. per_page: {
  22095. type: "integer"
  22096. },
  22097. repo: {
  22098. required: true,
  22099. type: "string"
  22100. }
  22101. },
  22102. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22103. },
  22104. listDeployments: {
  22105. method: "GET",
  22106. params: {
  22107. environment: {
  22108. type: "string"
  22109. },
  22110. owner: {
  22111. required: true,
  22112. type: "string"
  22113. },
  22114. page: {
  22115. type: "integer"
  22116. },
  22117. per_page: {
  22118. type: "integer"
  22119. },
  22120. ref: {
  22121. type: "string"
  22122. },
  22123. repo: {
  22124. required: true,
  22125. type: "string"
  22126. },
  22127. sha: {
  22128. type: "string"
  22129. },
  22130. task: {
  22131. type: "string"
  22132. }
  22133. },
  22134. url: "/repos/:owner/:repo/deployments"
  22135. },
  22136. listDownloads: {
  22137. method: "GET",
  22138. params: {
  22139. owner: {
  22140. required: true,
  22141. type: "string"
  22142. },
  22143. page: {
  22144. type: "integer"
  22145. },
  22146. per_page: {
  22147. type: "integer"
  22148. },
  22149. repo: {
  22150. required: true,
  22151. type: "string"
  22152. }
  22153. },
  22154. url: "/repos/:owner/:repo/downloads"
  22155. },
  22156. listForOrg: {
  22157. method: "GET",
  22158. params: {
  22159. direction: {
  22160. enum: ["asc", "desc"],
  22161. type: "string"
  22162. },
  22163. org: {
  22164. required: true,
  22165. type: "string"
  22166. },
  22167. page: {
  22168. type: "integer"
  22169. },
  22170. per_page: {
  22171. type: "integer"
  22172. },
  22173. sort: {
  22174. enum: ["created", "updated", "pushed", "full_name"],
  22175. type: "string"
  22176. },
  22177. type: {
  22178. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22179. type: "string"
  22180. }
  22181. },
  22182. url: "/orgs/:org/repos"
  22183. },
  22184. listForUser: {
  22185. method: "GET",
  22186. params: {
  22187. direction: {
  22188. enum: ["asc", "desc"],
  22189. type: "string"
  22190. },
  22191. page: {
  22192. type: "integer"
  22193. },
  22194. per_page: {
  22195. type: "integer"
  22196. },
  22197. sort: {
  22198. enum: ["created", "updated", "pushed", "full_name"],
  22199. type: "string"
  22200. },
  22201. type: {
  22202. enum: ["all", "owner", "member"],
  22203. type: "string"
  22204. },
  22205. username: {
  22206. required: true,
  22207. type: "string"
  22208. }
  22209. },
  22210. url: "/users/:username/repos"
  22211. },
  22212. listForks: {
  22213. method: "GET",
  22214. params: {
  22215. owner: {
  22216. required: true,
  22217. type: "string"
  22218. },
  22219. page: {
  22220. type: "integer"
  22221. },
  22222. per_page: {
  22223. type: "integer"
  22224. },
  22225. repo: {
  22226. required: true,
  22227. type: "string"
  22228. },
  22229. sort: {
  22230. enum: ["newest", "oldest", "stargazers"],
  22231. type: "string"
  22232. }
  22233. },
  22234. url: "/repos/:owner/:repo/forks"
  22235. },
  22236. listHooks: {
  22237. method: "GET",
  22238. params: {
  22239. owner: {
  22240. required: true,
  22241. type: "string"
  22242. },
  22243. page: {
  22244. type: "integer"
  22245. },
  22246. per_page: {
  22247. type: "integer"
  22248. },
  22249. repo: {
  22250. required: true,
  22251. type: "string"
  22252. }
  22253. },
  22254. url: "/repos/:owner/:repo/hooks"
  22255. },
  22256. listInvitations: {
  22257. method: "GET",
  22258. params: {
  22259. owner: {
  22260. required: true,
  22261. type: "string"
  22262. },
  22263. page: {
  22264. type: "integer"
  22265. },
  22266. per_page: {
  22267. type: "integer"
  22268. },
  22269. repo: {
  22270. required: true,
  22271. type: "string"
  22272. }
  22273. },
  22274. url: "/repos/:owner/:repo/invitations"
  22275. },
  22276. listInvitationsForAuthenticatedUser: {
  22277. method: "GET",
  22278. params: {
  22279. page: {
  22280. type: "integer"
  22281. },
  22282. per_page: {
  22283. type: "integer"
  22284. }
  22285. },
  22286. url: "/user/repository_invitations"
  22287. },
  22288. listLanguages: {
  22289. method: "GET",
  22290. params: {
  22291. owner: {
  22292. required: true,
  22293. type: "string"
  22294. },
  22295. repo: {
  22296. required: true,
  22297. type: "string"
  22298. }
  22299. },
  22300. url: "/repos/:owner/:repo/languages"
  22301. },
  22302. listPagesBuilds: {
  22303. method: "GET",
  22304. params: {
  22305. owner: {
  22306. required: true,
  22307. type: "string"
  22308. },
  22309. page: {
  22310. type: "integer"
  22311. },
  22312. per_page: {
  22313. type: "integer"
  22314. },
  22315. repo: {
  22316. required: true,
  22317. type: "string"
  22318. }
  22319. },
  22320. url: "/repos/:owner/:repo/pages/builds"
  22321. },
  22322. listProtectedBranchRequiredStatusChecksContexts: {
  22323. method: "GET",
  22324. params: {
  22325. branch: {
  22326. required: true,
  22327. type: "string"
  22328. },
  22329. owner: {
  22330. required: true,
  22331. type: "string"
  22332. },
  22333. repo: {
  22334. required: true,
  22335. type: "string"
  22336. }
  22337. },
  22338. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22339. },
  22340. listProtectedBranchTeamRestrictions: {
  22341. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22342. method: "GET",
  22343. params: {
  22344. branch: {
  22345. required: true,
  22346. type: "string"
  22347. },
  22348. owner: {
  22349. required: true,
  22350. type: "string"
  22351. },
  22352. repo: {
  22353. required: true,
  22354. type: "string"
  22355. }
  22356. },
  22357. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22358. },
  22359. listProtectedBranchUserRestrictions: {
  22360. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22361. method: "GET",
  22362. params: {
  22363. branch: {
  22364. required: true,
  22365. type: "string"
  22366. },
  22367. owner: {
  22368. required: true,
  22369. type: "string"
  22370. },
  22371. repo: {
  22372. required: true,
  22373. type: "string"
  22374. }
  22375. },
  22376. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22377. },
  22378. listPublic: {
  22379. method: "GET",
  22380. params: {
  22381. page: {
  22382. type: "integer"
  22383. },
  22384. per_page: {
  22385. type: "integer"
  22386. },
  22387. since: {
  22388. type: "integer"
  22389. }
  22390. },
  22391. url: "/repositories"
  22392. },
  22393. listPullRequestsAssociatedWithCommit: {
  22394. headers: {
  22395. accept: "application/vnd.github.groot-preview+json"
  22396. },
  22397. method: "GET",
  22398. params: {
  22399. commit_sha: {
  22400. required: true,
  22401. type: "string"
  22402. },
  22403. owner: {
  22404. required: true,
  22405. type: "string"
  22406. },
  22407. page: {
  22408. type: "integer"
  22409. },
  22410. per_page: {
  22411. type: "integer"
  22412. },
  22413. repo: {
  22414. required: true,
  22415. type: "string"
  22416. }
  22417. },
  22418. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22419. },
  22420. listReleases: {
  22421. method: "GET",
  22422. params: {
  22423. owner: {
  22424. required: true,
  22425. type: "string"
  22426. },
  22427. page: {
  22428. type: "integer"
  22429. },
  22430. per_page: {
  22431. type: "integer"
  22432. },
  22433. repo: {
  22434. required: true,
  22435. type: "string"
  22436. }
  22437. },
  22438. url: "/repos/:owner/:repo/releases"
  22439. },
  22440. listStatusesForRef: {
  22441. method: "GET",
  22442. params: {
  22443. owner: {
  22444. required: true,
  22445. type: "string"
  22446. },
  22447. page: {
  22448. type: "integer"
  22449. },
  22450. per_page: {
  22451. type: "integer"
  22452. },
  22453. ref: {
  22454. required: true,
  22455. type: "string"
  22456. },
  22457. repo: {
  22458. required: true,
  22459. type: "string"
  22460. }
  22461. },
  22462. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22463. },
  22464. listTags: {
  22465. method: "GET",
  22466. params: {
  22467. owner: {
  22468. required: true,
  22469. type: "string"
  22470. },
  22471. page: {
  22472. type: "integer"
  22473. },
  22474. per_page: {
  22475. type: "integer"
  22476. },
  22477. repo: {
  22478. required: true,
  22479. type: "string"
  22480. }
  22481. },
  22482. url: "/repos/:owner/:repo/tags"
  22483. },
  22484. listTeams: {
  22485. method: "GET",
  22486. params: {
  22487. owner: {
  22488. required: true,
  22489. type: "string"
  22490. },
  22491. page: {
  22492. type: "integer"
  22493. },
  22494. per_page: {
  22495. type: "integer"
  22496. },
  22497. repo: {
  22498. required: true,
  22499. type: "string"
  22500. }
  22501. },
  22502. url: "/repos/:owner/:repo/teams"
  22503. },
  22504. listTeamsWithAccessToProtectedBranch: {
  22505. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22506. method: "GET",
  22507. params: {
  22508. branch: {
  22509. required: true,
  22510. type: "string"
  22511. },
  22512. owner: {
  22513. required: true,
  22514. type: "string"
  22515. },
  22516. repo: {
  22517. required: true,
  22518. type: "string"
  22519. }
  22520. },
  22521. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22522. },
  22523. listTopics: {
  22524. headers: {
  22525. accept: "application/vnd.github.mercy-preview+json"
  22526. },
  22527. method: "GET",
  22528. params: {
  22529. owner: {
  22530. required: true,
  22531. type: "string"
  22532. },
  22533. repo: {
  22534. required: true,
  22535. type: "string"
  22536. }
  22537. },
  22538. url: "/repos/:owner/:repo/topics"
  22539. },
  22540. listUsersWithAccessToProtectedBranch: {
  22541. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22542. method: "GET",
  22543. params: {
  22544. branch: {
  22545. required: true,
  22546. type: "string"
  22547. },
  22548. owner: {
  22549. required: true,
  22550. type: "string"
  22551. },
  22552. repo: {
  22553. required: true,
  22554. type: "string"
  22555. }
  22556. },
  22557. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22558. },
  22559. merge: {
  22560. method: "POST",
  22561. params: {
  22562. base: {
  22563. required: true,
  22564. type: "string"
  22565. },
  22566. commit_message: {
  22567. type: "string"
  22568. },
  22569. head: {
  22570. required: true,
  22571. type: "string"
  22572. },
  22573. owner: {
  22574. required: true,
  22575. type: "string"
  22576. },
  22577. repo: {
  22578. required: true,
  22579. type: "string"
  22580. }
  22581. },
  22582. url: "/repos/:owner/:repo/merges"
  22583. },
  22584. pingHook: {
  22585. method: "POST",
  22586. params: {
  22587. hook_id: {
  22588. required: true,
  22589. type: "integer"
  22590. },
  22591. owner: {
  22592. required: true,
  22593. type: "string"
  22594. },
  22595. repo: {
  22596. required: true,
  22597. type: "string"
  22598. }
  22599. },
  22600. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22601. },
  22602. removeBranchProtection: {
  22603. method: "DELETE",
  22604. params: {
  22605. branch: {
  22606. required: true,
  22607. type: "string"
  22608. },
  22609. owner: {
  22610. required: true,
  22611. type: "string"
  22612. },
  22613. repo: {
  22614. required: true,
  22615. type: "string"
  22616. }
  22617. },
  22618. url: "/repos/:owner/:repo/branches/:branch/protection"
  22619. },
  22620. removeCollaborator: {
  22621. method: "DELETE",
  22622. params: {
  22623. owner: {
  22624. required: true,
  22625. type: "string"
  22626. },
  22627. repo: {
  22628. required: true,
  22629. type: "string"
  22630. },
  22631. username: {
  22632. required: true,
  22633. type: "string"
  22634. }
  22635. },
  22636. url: "/repos/:owner/:repo/collaborators/:username"
  22637. },
  22638. removeDeployKey: {
  22639. method: "DELETE",
  22640. params: {
  22641. key_id: {
  22642. required: true,
  22643. type: "integer"
  22644. },
  22645. owner: {
  22646. required: true,
  22647. type: "string"
  22648. },
  22649. repo: {
  22650. required: true,
  22651. type: "string"
  22652. }
  22653. },
  22654. url: "/repos/:owner/:repo/keys/:key_id"
  22655. },
  22656. removeProtectedBranchAdminEnforcement: {
  22657. method: "DELETE",
  22658. params: {
  22659. branch: {
  22660. required: true,
  22661. type: "string"
  22662. },
  22663. owner: {
  22664. required: true,
  22665. type: "string"
  22666. },
  22667. repo: {
  22668. required: true,
  22669. type: "string"
  22670. }
  22671. },
  22672. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22673. },
  22674. removeProtectedBranchAppRestrictions: {
  22675. method: "DELETE",
  22676. params: {
  22677. apps: {
  22678. mapTo: "data",
  22679. required: true,
  22680. type: "string[]"
  22681. },
  22682. branch: {
  22683. required: true,
  22684. type: "string"
  22685. },
  22686. owner: {
  22687. required: true,
  22688. type: "string"
  22689. },
  22690. repo: {
  22691. required: true,
  22692. type: "string"
  22693. }
  22694. },
  22695. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22696. },
  22697. removeProtectedBranchPullRequestReviewEnforcement: {
  22698. method: "DELETE",
  22699. params: {
  22700. branch: {
  22701. required: true,
  22702. type: "string"
  22703. },
  22704. owner: {
  22705. required: true,
  22706. type: "string"
  22707. },
  22708. repo: {
  22709. required: true,
  22710. type: "string"
  22711. }
  22712. },
  22713. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22714. },
  22715. removeProtectedBranchRequiredSignatures: {
  22716. headers: {
  22717. accept: "application/vnd.github.zzzax-preview+json"
  22718. },
  22719. method: "DELETE",
  22720. params: {
  22721. branch: {
  22722. required: true,
  22723. type: "string"
  22724. },
  22725. owner: {
  22726. required: true,
  22727. type: "string"
  22728. },
  22729. repo: {
  22730. required: true,
  22731. type: "string"
  22732. }
  22733. },
  22734. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22735. },
  22736. removeProtectedBranchRequiredStatusChecks: {
  22737. method: "DELETE",
  22738. params: {
  22739. branch: {
  22740. required: true,
  22741. type: "string"
  22742. },
  22743. owner: {
  22744. required: true,
  22745. type: "string"
  22746. },
  22747. repo: {
  22748. required: true,
  22749. type: "string"
  22750. }
  22751. },
  22752. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22753. },
  22754. removeProtectedBranchRequiredStatusChecksContexts: {
  22755. method: "DELETE",
  22756. params: {
  22757. branch: {
  22758. required: true,
  22759. type: "string"
  22760. },
  22761. contexts: {
  22762. mapTo: "data",
  22763. required: true,
  22764. type: "string[]"
  22765. },
  22766. owner: {
  22767. required: true,
  22768. type: "string"
  22769. },
  22770. repo: {
  22771. required: true,
  22772. type: "string"
  22773. }
  22774. },
  22775. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22776. },
  22777. removeProtectedBranchRestrictions: {
  22778. method: "DELETE",
  22779. params: {
  22780. branch: {
  22781. required: true,
  22782. type: "string"
  22783. },
  22784. owner: {
  22785. required: true,
  22786. type: "string"
  22787. },
  22788. repo: {
  22789. required: true,
  22790. type: "string"
  22791. }
  22792. },
  22793. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22794. },
  22795. removeProtectedBranchTeamRestrictions: {
  22796. method: "DELETE",
  22797. params: {
  22798. branch: {
  22799. required: true,
  22800. type: "string"
  22801. },
  22802. owner: {
  22803. required: true,
  22804. type: "string"
  22805. },
  22806. repo: {
  22807. required: true,
  22808. type: "string"
  22809. },
  22810. teams: {
  22811. mapTo: "data",
  22812. required: true,
  22813. type: "string[]"
  22814. }
  22815. },
  22816. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22817. },
  22818. removeProtectedBranchUserRestrictions: {
  22819. method: "DELETE",
  22820. params: {
  22821. branch: {
  22822. required: true,
  22823. type: "string"
  22824. },
  22825. owner: {
  22826. required: true,
  22827. type: "string"
  22828. },
  22829. repo: {
  22830. required: true,
  22831. type: "string"
  22832. },
  22833. users: {
  22834. mapTo: "data",
  22835. required: true,
  22836. type: "string[]"
  22837. }
  22838. },
  22839. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22840. },
  22841. replaceProtectedBranchAppRestrictions: {
  22842. method: "PUT",
  22843. params: {
  22844. apps: {
  22845. mapTo: "data",
  22846. required: true,
  22847. type: "string[]"
  22848. },
  22849. branch: {
  22850. required: true,
  22851. type: "string"
  22852. },
  22853. owner: {
  22854. required: true,
  22855. type: "string"
  22856. },
  22857. repo: {
  22858. required: true,
  22859. type: "string"
  22860. }
  22861. },
  22862. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22863. },
  22864. replaceProtectedBranchRequiredStatusChecksContexts: {
  22865. method: "PUT",
  22866. params: {
  22867. branch: {
  22868. required: true,
  22869. type: "string"
  22870. },
  22871. contexts: {
  22872. mapTo: "data",
  22873. required: true,
  22874. type: "string[]"
  22875. },
  22876. owner: {
  22877. required: true,
  22878. type: "string"
  22879. },
  22880. repo: {
  22881. required: true,
  22882. type: "string"
  22883. }
  22884. },
  22885. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22886. },
  22887. replaceProtectedBranchTeamRestrictions: {
  22888. method: "PUT",
  22889. params: {
  22890. branch: {
  22891. required: true,
  22892. type: "string"
  22893. },
  22894. owner: {
  22895. required: true,
  22896. type: "string"
  22897. },
  22898. repo: {
  22899. required: true,
  22900. type: "string"
  22901. },
  22902. teams: {
  22903. mapTo: "data",
  22904. required: true,
  22905. type: "string[]"
  22906. }
  22907. },
  22908. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22909. },
  22910. replaceProtectedBranchUserRestrictions: {
  22911. method: "PUT",
  22912. params: {
  22913. branch: {
  22914. required: true,
  22915. type: "string"
  22916. },
  22917. owner: {
  22918. required: true,
  22919. type: "string"
  22920. },
  22921. repo: {
  22922. required: true,
  22923. type: "string"
  22924. },
  22925. users: {
  22926. mapTo: "data",
  22927. required: true,
  22928. type: "string[]"
  22929. }
  22930. },
  22931. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22932. },
  22933. replaceTopics: {
  22934. headers: {
  22935. accept: "application/vnd.github.mercy-preview+json"
  22936. },
  22937. method: "PUT",
  22938. params: {
  22939. names: {
  22940. required: true,
  22941. type: "string[]"
  22942. },
  22943. owner: {
  22944. required: true,
  22945. type: "string"
  22946. },
  22947. repo: {
  22948. required: true,
  22949. type: "string"
  22950. }
  22951. },
  22952. url: "/repos/:owner/:repo/topics"
  22953. },
  22954. requestPageBuild: {
  22955. method: "POST",
  22956. params: {
  22957. owner: {
  22958. required: true,
  22959. type: "string"
  22960. },
  22961. repo: {
  22962. required: true,
  22963. type: "string"
  22964. }
  22965. },
  22966. url: "/repos/:owner/:repo/pages/builds"
  22967. },
  22968. retrieveCommunityProfileMetrics: {
  22969. method: "GET",
  22970. params: {
  22971. owner: {
  22972. required: true,
  22973. type: "string"
  22974. },
  22975. repo: {
  22976. required: true,
  22977. type: "string"
  22978. }
  22979. },
  22980. url: "/repos/:owner/:repo/community/profile"
  22981. },
  22982. testPushHook: {
  22983. method: "POST",
  22984. params: {
  22985. hook_id: {
  22986. required: true,
  22987. type: "integer"
  22988. },
  22989. owner: {
  22990. required: true,
  22991. type: "string"
  22992. },
  22993. repo: {
  22994. required: true,
  22995. type: "string"
  22996. }
  22997. },
  22998. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22999. },
  23000. transfer: {
  23001. method: "POST",
  23002. params: {
  23003. new_owner: {
  23004. type: "string"
  23005. },
  23006. owner: {
  23007. required: true,
  23008. type: "string"
  23009. },
  23010. repo: {
  23011. required: true,
  23012. type: "string"
  23013. },
  23014. team_ids: {
  23015. type: "integer[]"
  23016. }
  23017. },
  23018. url: "/repos/:owner/:repo/transfer"
  23019. },
  23020. update: {
  23021. method: "PATCH",
  23022. params: {
  23023. allow_merge_commit: {
  23024. type: "boolean"
  23025. },
  23026. allow_rebase_merge: {
  23027. type: "boolean"
  23028. },
  23029. allow_squash_merge: {
  23030. type: "boolean"
  23031. },
  23032. archived: {
  23033. type: "boolean"
  23034. },
  23035. default_branch: {
  23036. type: "string"
  23037. },
  23038. delete_branch_on_merge: {
  23039. type: "boolean"
  23040. },
  23041. description: {
  23042. type: "string"
  23043. },
  23044. has_issues: {
  23045. type: "boolean"
  23046. },
  23047. has_projects: {
  23048. type: "boolean"
  23049. },
  23050. has_wiki: {
  23051. type: "boolean"
  23052. },
  23053. homepage: {
  23054. type: "string"
  23055. },
  23056. is_template: {
  23057. type: "boolean"
  23058. },
  23059. name: {
  23060. type: "string"
  23061. },
  23062. owner: {
  23063. required: true,
  23064. type: "string"
  23065. },
  23066. private: {
  23067. type: "boolean"
  23068. },
  23069. repo: {
  23070. required: true,
  23071. type: "string"
  23072. },
  23073. visibility: {
  23074. enum: ["public", "private", "visibility", "internal"],
  23075. type: "string"
  23076. }
  23077. },
  23078. url: "/repos/:owner/:repo"
  23079. },
  23080. updateBranchProtection: {
  23081. method: "PUT",
  23082. params: {
  23083. allow_deletions: {
  23084. type: "boolean"
  23085. },
  23086. allow_force_pushes: {
  23087. allowNull: true,
  23088. type: "boolean"
  23089. },
  23090. branch: {
  23091. required: true,
  23092. type: "string"
  23093. },
  23094. enforce_admins: {
  23095. allowNull: true,
  23096. required: true,
  23097. type: "boolean"
  23098. },
  23099. owner: {
  23100. required: true,
  23101. type: "string"
  23102. },
  23103. repo: {
  23104. required: true,
  23105. type: "string"
  23106. },
  23107. required_linear_history: {
  23108. type: "boolean"
  23109. },
  23110. required_pull_request_reviews: {
  23111. allowNull: true,
  23112. required: true,
  23113. type: "object"
  23114. },
  23115. "required_pull_request_reviews.dismiss_stale_reviews": {
  23116. type: "boolean"
  23117. },
  23118. "required_pull_request_reviews.dismissal_restrictions": {
  23119. type: "object"
  23120. },
  23121. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23122. type: "string[]"
  23123. },
  23124. "required_pull_request_reviews.dismissal_restrictions.users": {
  23125. type: "string[]"
  23126. },
  23127. "required_pull_request_reviews.require_code_owner_reviews": {
  23128. type: "boolean"
  23129. },
  23130. "required_pull_request_reviews.required_approving_review_count": {
  23131. type: "integer"
  23132. },
  23133. required_status_checks: {
  23134. allowNull: true,
  23135. required: true,
  23136. type: "object"
  23137. },
  23138. "required_status_checks.contexts": {
  23139. required: true,
  23140. type: "string[]"
  23141. },
  23142. "required_status_checks.strict": {
  23143. required: true,
  23144. type: "boolean"
  23145. },
  23146. restrictions: {
  23147. allowNull: true,
  23148. required: true,
  23149. type: "object"
  23150. },
  23151. "restrictions.apps": {
  23152. type: "string[]"
  23153. },
  23154. "restrictions.teams": {
  23155. required: true,
  23156. type: "string[]"
  23157. },
  23158. "restrictions.users": {
  23159. required: true,
  23160. type: "string[]"
  23161. }
  23162. },
  23163. url: "/repos/:owner/:repo/branches/:branch/protection"
  23164. },
  23165. updateCommitComment: {
  23166. method: "PATCH",
  23167. params: {
  23168. body: {
  23169. required: true,
  23170. type: "string"
  23171. },
  23172. comment_id: {
  23173. required: true,
  23174. type: "integer"
  23175. },
  23176. owner: {
  23177. required: true,
  23178. type: "string"
  23179. },
  23180. repo: {
  23181. required: true,
  23182. type: "string"
  23183. }
  23184. },
  23185. url: "/repos/:owner/:repo/comments/:comment_id"
  23186. },
  23187. updateFile: {
  23188. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23189. method: "PUT",
  23190. params: {
  23191. author: {
  23192. type: "object"
  23193. },
  23194. "author.email": {
  23195. required: true,
  23196. type: "string"
  23197. },
  23198. "author.name": {
  23199. required: true,
  23200. type: "string"
  23201. },
  23202. branch: {
  23203. type: "string"
  23204. },
  23205. committer: {
  23206. type: "object"
  23207. },
  23208. "committer.email": {
  23209. required: true,
  23210. type: "string"
  23211. },
  23212. "committer.name": {
  23213. required: true,
  23214. type: "string"
  23215. },
  23216. content: {
  23217. required: true,
  23218. type: "string"
  23219. },
  23220. message: {
  23221. required: true,
  23222. type: "string"
  23223. },
  23224. owner: {
  23225. required: true,
  23226. type: "string"
  23227. },
  23228. path: {
  23229. required: true,
  23230. type: "string"
  23231. },
  23232. repo: {
  23233. required: true,
  23234. type: "string"
  23235. },
  23236. sha: {
  23237. type: "string"
  23238. }
  23239. },
  23240. url: "/repos/:owner/:repo/contents/:path"
  23241. },
  23242. updateHook: {
  23243. method: "PATCH",
  23244. params: {
  23245. active: {
  23246. type: "boolean"
  23247. },
  23248. add_events: {
  23249. type: "string[]"
  23250. },
  23251. config: {
  23252. type: "object"
  23253. },
  23254. "config.content_type": {
  23255. type: "string"
  23256. },
  23257. "config.insecure_ssl": {
  23258. type: "string"
  23259. },
  23260. "config.secret": {
  23261. type: "string"
  23262. },
  23263. "config.url": {
  23264. required: true,
  23265. type: "string"
  23266. },
  23267. events: {
  23268. type: "string[]"
  23269. },
  23270. hook_id: {
  23271. required: true,
  23272. type: "integer"
  23273. },
  23274. owner: {
  23275. required: true,
  23276. type: "string"
  23277. },
  23278. remove_events: {
  23279. type: "string[]"
  23280. },
  23281. repo: {
  23282. required: true,
  23283. type: "string"
  23284. }
  23285. },
  23286. url: "/repos/:owner/:repo/hooks/:hook_id"
  23287. },
  23288. updateInformationAboutPagesSite: {
  23289. method: "PUT",
  23290. params: {
  23291. cname: {
  23292. type: "string"
  23293. },
  23294. owner: {
  23295. required: true,
  23296. type: "string"
  23297. },
  23298. repo: {
  23299. required: true,
  23300. type: "string"
  23301. },
  23302. source: {
  23303. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23304. type: "string"
  23305. }
  23306. },
  23307. url: "/repos/:owner/:repo/pages"
  23308. },
  23309. updateInvitation: {
  23310. method: "PATCH",
  23311. params: {
  23312. invitation_id: {
  23313. required: true,
  23314. type: "integer"
  23315. },
  23316. owner: {
  23317. required: true,
  23318. type: "string"
  23319. },
  23320. permissions: {
  23321. enum: ["read", "write", "admin"],
  23322. type: "string"
  23323. },
  23324. repo: {
  23325. required: true,
  23326. type: "string"
  23327. }
  23328. },
  23329. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23330. },
  23331. updateProtectedBranchPullRequestReviewEnforcement: {
  23332. method: "PATCH",
  23333. params: {
  23334. branch: {
  23335. required: true,
  23336. type: "string"
  23337. },
  23338. dismiss_stale_reviews: {
  23339. type: "boolean"
  23340. },
  23341. dismissal_restrictions: {
  23342. type: "object"
  23343. },
  23344. "dismissal_restrictions.teams": {
  23345. type: "string[]"
  23346. },
  23347. "dismissal_restrictions.users": {
  23348. type: "string[]"
  23349. },
  23350. owner: {
  23351. required: true,
  23352. type: "string"
  23353. },
  23354. repo: {
  23355. required: true,
  23356. type: "string"
  23357. },
  23358. require_code_owner_reviews: {
  23359. type: "boolean"
  23360. },
  23361. required_approving_review_count: {
  23362. type: "integer"
  23363. }
  23364. },
  23365. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23366. },
  23367. updateProtectedBranchRequiredStatusChecks: {
  23368. method: "PATCH",
  23369. params: {
  23370. branch: {
  23371. required: true,
  23372. type: "string"
  23373. },
  23374. contexts: {
  23375. type: "string[]"
  23376. },
  23377. owner: {
  23378. required: true,
  23379. type: "string"
  23380. },
  23381. repo: {
  23382. required: true,
  23383. type: "string"
  23384. },
  23385. strict: {
  23386. type: "boolean"
  23387. }
  23388. },
  23389. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23390. },
  23391. updateRelease: {
  23392. method: "PATCH",
  23393. params: {
  23394. body: {
  23395. type: "string"
  23396. },
  23397. draft: {
  23398. type: "boolean"
  23399. },
  23400. name: {
  23401. type: "string"
  23402. },
  23403. owner: {
  23404. required: true,
  23405. type: "string"
  23406. },
  23407. prerelease: {
  23408. type: "boolean"
  23409. },
  23410. release_id: {
  23411. required: true,
  23412. type: "integer"
  23413. },
  23414. repo: {
  23415. required: true,
  23416. type: "string"
  23417. },
  23418. tag_name: {
  23419. type: "string"
  23420. },
  23421. target_commitish: {
  23422. type: "string"
  23423. }
  23424. },
  23425. url: "/repos/:owner/:repo/releases/:release_id"
  23426. },
  23427. updateReleaseAsset: {
  23428. method: "PATCH",
  23429. params: {
  23430. asset_id: {
  23431. required: true,
  23432. type: "integer"
  23433. },
  23434. label: {
  23435. type: "string"
  23436. },
  23437. name: {
  23438. type: "string"
  23439. },
  23440. owner: {
  23441. required: true,
  23442. type: "string"
  23443. },
  23444. repo: {
  23445. required: true,
  23446. type: "string"
  23447. }
  23448. },
  23449. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23450. },
  23451. uploadReleaseAsset: {
  23452. method: "POST",
  23453. params: {
  23454. data: {
  23455. mapTo: "data",
  23456. required: true,
  23457. type: "string | object"
  23458. },
  23459. file: {
  23460. alias: "data",
  23461. deprecated: true,
  23462. type: "string | object"
  23463. },
  23464. headers: {
  23465. required: true,
  23466. type: "object"
  23467. },
  23468. "headers.content-length": {
  23469. required: true,
  23470. type: "integer"
  23471. },
  23472. "headers.content-type": {
  23473. required: true,
  23474. type: "string"
  23475. },
  23476. label: {
  23477. type: "string"
  23478. },
  23479. name: {
  23480. required: true,
  23481. type: "string"
  23482. },
  23483. url: {
  23484. required: true,
  23485. type: "string"
  23486. }
  23487. },
  23488. url: ":url"
  23489. }
  23490. },
  23491. search: {
  23492. code: {
  23493. method: "GET",
  23494. params: {
  23495. order: {
  23496. enum: ["desc", "asc"],
  23497. type: "string"
  23498. },
  23499. page: {
  23500. type: "integer"
  23501. },
  23502. per_page: {
  23503. type: "integer"
  23504. },
  23505. q: {
  23506. required: true,
  23507. type: "string"
  23508. },
  23509. sort: {
  23510. enum: ["indexed"],
  23511. type: "string"
  23512. }
  23513. },
  23514. url: "/search/code"
  23515. },
  23516. commits: {
  23517. headers: {
  23518. accept: "application/vnd.github.cloak-preview+json"
  23519. },
  23520. method: "GET",
  23521. params: {
  23522. order: {
  23523. enum: ["desc", "asc"],
  23524. type: "string"
  23525. },
  23526. page: {
  23527. type: "integer"
  23528. },
  23529. per_page: {
  23530. type: "integer"
  23531. },
  23532. q: {
  23533. required: true,
  23534. type: "string"
  23535. },
  23536. sort: {
  23537. enum: ["author-date", "committer-date"],
  23538. type: "string"
  23539. }
  23540. },
  23541. url: "/search/commits"
  23542. },
  23543. issues: {
  23544. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23545. method: "GET",
  23546. params: {
  23547. order: {
  23548. enum: ["desc", "asc"],
  23549. type: "string"
  23550. },
  23551. page: {
  23552. type: "integer"
  23553. },
  23554. per_page: {
  23555. type: "integer"
  23556. },
  23557. q: {
  23558. required: true,
  23559. type: "string"
  23560. },
  23561. sort: {
  23562. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23563. type: "string"
  23564. }
  23565. },
  23566. url: "/search/issues"
  23567. },
  23568. issuesAndPullRequests: {
  23569. method: "GET",
  23570. params: {
  23571. order: {
  23572. enum: ["desc", "asc"],
  23573. type: "string"
  23574. },
  23575. page: {
  23576. type: "integer"
  23577. },
  23578. per_page: {
  23579. type: "integer"
  23580. },
  23581. q: {
  23582. required: true,
  23583. type: "string"
  23584. },
  23585. sort: {
  23586. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23587. type: "string"
  23588. }
  23589. },
  23590. url: "/search/issues"
  23591. },
  23592. labels: {
  23593. method: "GET",
  23594. params: {
  23595. order: {
  23596. enum: ["desc", "asc"],
  23597. type: "string"
  23598. },
  23599. q: {
  23600. required: true,
  23601. type: "string"
  23602. },
  23603. repository_id: {
  23604. required: true,
  23605. type: "integer"
  23606. },
  23607. sort: {
  23608. enum: ["created", "updated"],
  23609. type: "string"
  23610. }
  23611. },
  23612. url: "/search/labels"
  23613. },
  23614. repos: {
  23615. method: "GET",
  23616. params: {
  23617. order: {
  23618. enum: ["desc", "asc"],
  23619. type: "string"
  23620. },
  23621. page: {
  23622. type: "integer"
  23623. },
  23624. per_page: {
  23625. type: "integer"
  23626. },
  23627. q: {
  23628. required: true,
  23629. type: "string"
  23630. },
  23631. sort: {
  23632. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23633. type: "string"
  23634. }
  23635. },
  23636. url: "/search/repositories"
  23637. },
  23638. topics: {
  23639. method: "GET",
  23640. params: {
  23641. q: {
  23642. required: true,
  23643. type: "string"
  23644. }
  23645. },
  23646. url: "/search/topics"
  23647. },
  23648. users: {
  23649. method: "GET",
  23650. params: {
  23651. order: {
  23652. enum: ["desc", "asc"],
  23653. type: "string"
  23654. },
  23655. page: {
  23656. type: "integer"
  23657. },
  23658. per_page: {
  23659. type: "integer"
  23660. },
  23661. q: {
  23662. required: true,
  23663. type: "string"
  23664. },
  23665. sort: {
  23666. enum: ["followers", "repositories", "joined"],
  23667. type: "string"
  23668. }
  23669. },
  23670. url: "/search/users"
  23671. }
  23672. },
  23673. teams: {
  23674. addMember: {
  23675. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23676. method: "PUT",
  23677. params: {
  23678. team_id: {
  23679. required: true,
  23680. type: "integer"
  23681. },
  23682. username: {
  23683. required: true,
  23684. type: "string"
  23685. }
  23686. },
  23687. url: "/teams/:team_id/members/:username"
  23688. },
  23689. addMemberLegacy: {
  23690. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23691. method: "PUT",
  23692. params: {
  23693. team_id: {
  23694. required: true,
  23695. type: "integer"
  23696. },
  23697. username: {
  23698. required: true,
  23699. type: "string"
  23700. }
  23701. },
  23702. url: "/teams/:team_id/members/:username"
  23703. },
  23704. addOrUpdateMembership: {
  23705. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23706. method: "PUT",
  23707. params: {
  23708. role: {
  23709. enum: ["member", "maintainer"],
  23710. type: "string"
  23711. },
  23712. team_id: {
  23713. required: true,
  23714. type: "integer"
  23715. },
  23716. username: {
  23717. required: true,
  23718. type: "string"
  23719. }
  23720. },
  23721. url: "/teams/:team_id/memberships/:username"
  23722. },
  23723. addOrUpdateMembershipInOrg: {
  23724. method: "PUT",
  23725. params: {
  23726. org: {
  23727. required: true,
  23728. type: "string"
  23729. },
  23730. role: {
  23731. enum: ["member", "maintainer"],
  23732. type: "string"
  23733. },
  23734. team_slug: {
  23735. required: true,
  23736. type: "string"
  23737. },
  23738. username: {
  23739. required: true,
  23740. type: "string"
  23741. }
  23742. },
  23743. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23744. },
  23745. addOrUpdateMembershipLegacy: {
  23746. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23747. method: "PUT",
  23748. params: {
  23749. role: {
  23750. enum: ["member", "maintainer"],
  23751. type: "string"
  23752. },
  23753. team_id: {
  23754. required: true,
  23755. type: "integer"
  23756. },
  23757. username: {
  23758. required: true,
  23759. type: "string"
  23760. }
  23761. },
  23762. url: "/teams/:team_id/memberships/:username"
  23763. },
  23764. addOrUpdateProject: {
  23765. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23766. headers: {
  23767. accept: "application/vnd.github.inertia-preview+json"
  23768. },
  23769. method: "PUT",
  23770. params: {
  23771. permission: {
  23772. enum: ["read", "write", "admin"],
  23773. type: "string"
  23774. },
  23775. project_id: {
  23776. required: true,
  23777. type: "integer"
  23778. },
  23779. team_id: {
  23780. required: true,
  23781. type: "integer"
  23782. }
  23783. },
  23784. url: "/teams/:team_id/projects/:project_id"
  23785. },
  23786. addOrUpdateProjectInOrg: {
  23787. headers: {
  23788. accept: "application/vnd.github.inertia-preview+json"
  23789. },
  23790. method: "PUT",
  23791. params: {
  23792. org: {
  23793. required: true,
  23794. type: "string"
  23795. },
  23796. permission: {
  23797. enum: ["read", "write", "admin"],
  23798. type: "string"
  23799. },
  23800. project_id: {
  23801. required: true,
  23802. type: "integer"
  23803. },
  23804. team_slug: {
  23805. required: true,
  23806. type: "string"
  23807. }
  23808. },
  23809. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23810. },
  23811. addOrUpdateProjectLegacy: {
  23812. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23813. headers: {
  23814. accept: "application/vnd.github.inertia-preview+json"
  23815. },
  23816. method: "PUT",
  23817. params: {
  23818. permission: {
  23819. enum: ["read", "write", "admin"],
  23820. type: "string"
  23821. },
  23822. project_id: {
  23823. required: true,
  23824. type: "integer"
  23825. },
  23826. team_id: {
  23827. required: true,
  23828. type: "integer"
  23829. }
  23830. },
  23831. url: "/teams/:team_id/projects/:project_id"
  23832. },
  23833. addOrUpdateRepo: {
  23834. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23835. method: "PUT",
  23836. params: {
  23837. owner: {
  23838. required: true,
  23839. type: "string"
  23840. },
  23841. permission: {
  23842. enum: ["pull", "push", "admin"],
  23843. type: "string"
  23844. },
  23845. repo: {
  23846. required: true,
  23847. type: "string"
  23848. },
  23849. team_id: {
  23850. required: true,
  23851. type: "integer"
  23852. }
  23853. },
  23854. url: "/teams/:team_id/repos/:owner/:repo"
  23855. },
  23856. addOrUpdateRepoInOrg: {
  23857. method: "PUT",
  23858. params: {
  23859. org: {
  23860. required: true,
  23861. type: "string"
  23862. },
  23863. owner: {
  23864. required: true,
  23865. type: "string"
  23866. },
  23867. permission: {
  23868. enum: ["pull", "push", "admin"],
  23869. type: "string"
  23870. },
  23871. repo: {
  23872. required: true,
  23873. type: "string"
  23874. },
  23875. team_slug: {
  23876. required: true,
  23877. type: "string"
  23878. }
  23879. },
  23880. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23881. },
  23882. addOrUpdateRepoLegacy: {
  23883. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23884. method: "PUT",
  23885. params: {
  23886. owner: {
  23887. required: true,
  23888. type: "string"
  23889. },
  23890. permission: {
  23891. enum: ["pull", "push", "admin"],
  23892. type: "string"
  23893. },
  23894. repo: {
  23895. required: true,
  23896. type: "string"
  23897. },
  23898. team_id: {
  23899. required: true,
  23900. type: "integer"
  23901. }
  23902. },
  23903. url: "/teams/:team_id/repos/:owner/:repo"
  23904. },
  23905. checkManagesRepo: {
  23906. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23907. method: "GET",
  23908. params: {
  23909. owner: {
  23910. required: true,
  23911. type: "string"
  23912. },
  23913. repo: {
  23914. required: true,
  23915. type: "string"
  23916. },
  23917. team_id: {
  23918. required: true,
  23919. type: "integer"
  23920. }
  23921. },
  23922. url: "/teams/:team_id/repos/:owner/:repo"
  23923. },
  23924. checkManagesRepoInOrg: {
  23925. method: "GET",
  23926. params: {
  23927. org: {
  23928. required: true,
  23929. type: "string"
  23930. },
  23931. owner: {
  23932. required: true,
  23933. type: "string"
  23934. },
  23935. repo: {
  23936. required: true,
  23937. type: "string"
  23938. },
  23939. team_slug: {
  23940. required: true,
  23941. type: "string"
  23942. }
  23943. },
  23944. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23945. },
  23946. checkManagesRepoLegacy: {
  23947. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23948. method: "GET",
  23949. params: {
  23950. owner: {
  23951. required: true,
  23952. type: "string"
  23953. },
  23954. repo: {
  23955. required: true,
  23956. type: "string"
  23957. },
  23958. team_id: {
  23959. required: true,
  23960. type: "integer"
  23961. }
  23962. },
  23963. url: "/teams/:team_id/repos/:owner/:repo"
  23964. },
  23965. create: {
  23966. method: "POST",
  23967. params: {
  23968. description: {
  23969. type: "string"
  23970. },
  23971. maintainers: {
  23972. type: "string[]"
  23973. },
  23974. name: {
  23975. required: true,
  23976. type: "string"
  23977. },
  23978. org: {
  23979. required: true,
  23980. type: "string"
  23981. },
  23982. parent_team_id: {
  23983. type: "integer"
  23984. },
  23985. permission: {
  23986. enum: ["pull", "push", "admin"],
  23987. type: "string"
  23988. },
  23989. privacy: {
  23990. enum: ["secret", "closed"],
  23991. type: "string"
  23992. },
  23993. repo_names: {
  23994. type: "string[]"
  23995. }
  23996. },
  23997. url: "/orgs/:org/teams"
  23998. },
  23999. createDiscussion: {
  24000. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  24001. method: "POST",
  24002. params: {
  24003. body: {
  24004. required: true,
  24005. type: "string"
  24006. },
  24007. private: {
  24008. type: "boolean"
  24009. },
  24010. team_id: {
  24011. required: true,
  24012. type: "integer"
  24013. },
  24014. title: {
  24015. required: true,
  24016. type: "string"
  24017. }
  24018. },
  24019. url: "/teams/:team_id/discussions"
  24020. },
  24021. createDiscussionComment: {
  24022. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  24023. method: "POST",
  24024. params: {
  24025. body: {
  24026. required: true,
  24027. type: "string"
  24028. },
  24029. discussion_number: {
  24030. required: true,
  24031. type: "integer"
  24032. },
  24033. team_id: {
  24034. required: true,
  24035. type: "integer"
  24036. }
  24037. },
  24038. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24039. },
  24040. createDiscussionCommentInOrg: {
  24041. method: "POST",
  24042. params: {
  24043. body: {
  24044. required: true,
  24045. type: "string"
  24046. },
  24047. discussion_number: {
  24048. required: true,
  24049. type: "integer"
  24050. },
  24051. org: {
  24052. required: true,
  24053. type: "string"
  24054. },
  24055. team_slug: {
  24056. required: true,
  24057. type: "string"
  24058. }
  24059. },
  24060. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24061. },
  24062. createDiscussionCommentLegacy: {
  24063. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24064. method: "POST",
  24065. params: {
  24066. body: {
  24067. required: true,
  24068. type: "string"
  24069. },
  24070. discussion_number: {
  24071. required: true,
  24072. type: "integer"
  24073. },
  24074. team_id: {
  24075. required: true,
  24076. type: "integer"
  24077. }
  24078. },
  24079. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24080. },
  24081. createDiscussionInOrg: {
  24082. method: "POST",
  24083. params: {
  24084. body: {
  24085. required: true,
  24086. type: "string"
  24087. },
  24088. org: {
  24089. required: true,
  24090. type: "string"
  24091. },
  24092. private: {
  24093. type: "boolean"
  24094. },
  24095. team_slug: {
  24096. required: true,
  24097. type: "string"
  24098. },
  24099. title: {
  24100. required: true,
  24101. type: "string"
  24102. }
  24103. },
  24104. url: "/orgs/:org/teams/:team_slug/discussions"
  24105. },
  24106. createDiscussionLegacy: {
  24107. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24108. method: "POST",
  24109. params: {
  24110. body: {
  24111. required: true,
  24112. type: "string"
  24113. },
  24114. private: {
  24115. type: "boolean"
  24116. },
  24117. team_id: {
  24118. required: true,
  24119. type: "integer"
  24120. },
  24121. title: {
  24122. required: true,
  24123. type: "string"
  24124. }
  24125. },
  24126. url: "/teams/:team_id/discussions"
  24127. },
  24128. delete: {
  24129. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24130. method: "DELETE",
  24131. params: {
  24132. team_id: {
  24133. required: true,
  24134. type: "integer"
  24135. }
  24136. },
  24137. url: "/teams/:team_id"
  24138. },
  24139. deleteDiscussion: {
  24140. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24141. method: "DELETE",
  24142. params: {
  24143. discussion_number: {
  24144. required: true,
  24145. type: "integer"
  24146. },
  24147. team_id: {
  24148. required: true,
  24149. type: "integer"
  24150. }
  24151. },
  24152. url: "/teams/:team_id/discussions/:discussion_number"
  24153. },
  24154. deleteDiscussionComment: {
  24155. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24156. method: "DELETE",
  24157. params: {
  24158. comment_number: {
  24159. required: true,
  24160. type: "integer"
  24161. },
  24162. discussion_number: {
  24163. required: true,
  24164. type: "integer"
  24165. },
  24166. team_id: {
  24167. required: true,
  24168. type: "integer"
  24169. }
  24170. },
  24171. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24172. },
  24173. deleteDiscussionCommentInOrg: {
  24174. method: "DELETE",
  24175. params: {
  24176. comment_number: {
  24177. required: true,
  24178. type: "integer"
  24179. },
  24180. discussion_number: {
  24181. required: true,
  24182. type: "integer"
  24183. },
  24184. org: {
  24185. required: true,
  24186. type: "string"
  24187. },
  24188. team_slug: {
  24189. required: true,
  24190. type: "string"
  24191. }
  24192. },
  24193. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24194. },
  24195. deleteDiscussionCommentLegacy: {
  24196. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24197. method: "DELETE",
  24198. params: {
  24199. comment_number: {
  24200. required: true,
  24201. type: "integer"
  24202. },
  24203. discussion_number: {
  24204. required: true,
  24205. type: "integer"
  24206. },
  24207. team_id: {
  24208. required: true,
  24209. type: "integer"
  24210. }
  24211. },
  24212. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24213. },
  24214. deleteDiscussionInOrg: {
  24215. method: "DELETE",
  24216. params: {
  24217. discussion_number: {
  24218. required: true,
  24219. type: "integer"
  24220. },
  24221. org: {
  24222. required: true,
  24223. type: "string"
  24224. },
  24225. team_slug: {
  24226. required: true,
  24227. type: "string"
  24228. }
  24229. },
  24230. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24231. },
  24232. deleteDiscussionLegacy: {
  24233. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24234. method: "DELETE",
  24235. params: {
  24236. discussion_number: {
  24237. required: true,
  24238. type: "integer"
  24239. },
  24240. team_id: {
  24241. required: true,
  24242. type: "integer"
  24243. }
  24244. },
  24245. url: "/teams/:team_id/discussions/:discussion_number"
  24246. },
  24247. deleteInOrg: {
  24248. method: "DELETE",
  24249. params: {
  24250. org: {
  24251. required: true,
  24252. type: "string"
  24253. },
  24254. team_slug: {
  24255. required: true,
  24256. type: "string"
  24257. }
  24258. },
  24259. url: "/orgs/:org/teams/:team_slug"
  24260. },
  24261. deleteLegacy: {
  24262. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24263. method: "DELETE",
  24264. params: {
  24265. team_id: {
  24266. required: true,
  24267. type: "integer"
  24268. }
  24269. },
  24270. url: "/teams/:team_id"
  24271. },
  24272. get: {
  24273. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24274. method: "GET",
  24275. params: {
  24276. team_id: {
  24277. required: true,
  24278. type: "integer"
  24279. }
  24280. },
  24281. url: "/teams/:team_id"
  24282. },
  24283. getByName: {
  24284. method: "GET",
  24285. params: {
  24286. org: {
  24287. required: true,
  24288. type: "string"
  24289. },
  24290. team_slug: {
  24291. required: true,
  24292. type: "string"
  24293. }
  24294. },
  24295. url: "/orgs/:org/teams/:team_slug"
  24296. },
  24297. getDiscussion: {
  24298. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24299. method: "GET",
  24300. params: {
  24301. discussion_number: {
  24302. required: true,
  24303. type: "integer"
  24304. },
  24305. team_id: {
  24306. required: true,
  24307. type: "integer"
  24308. }
  24309. },
  24310. url: "/teams/:team_id/discussions/:discussion_number"
  24311. },
  24312. getDiscussionComment: {
  24313. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24314. method: "GET",
  24315. params: {
  24316. comment_number: {
  24317. required: true,
  24318. type: "integer"
  24319. },
  24320. discussion_number: {
  24321. required: true,
  24322. type: "integer"
  24323. },
  24324. team_id: {
  24325. required: true,
  24326. type: "integer"
  24327. }
  24328. },
  24329. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24330. },
  24331. getDiscussionCommentInOrg: {
  24332. method: "GET",
  24333. params: {
  24334. comment_number: {
  24335. required: true,
  24336. type: "integer"
  24337. },
  24338. discussion_number: {
  24339. required: true,
  24340. type: "integer"
  24341. },
  24342. org: {
  24343. required: true,
  24344. type: "string"
  24345. },
  24346. team_slug: {
  24347. required: true,
  24348. type: "string"
  24349. }
  24350. },
  24351. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24352. },
  24353. getDiscussionCommentLegacy: {
  24354. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24355. method: "GET",
  24356. params: {
  24357. comment_number: {
  24358. required: true,
  24359. type: "integer"
  24360. },
  24361. discussion_number: {
  24362. required: true,
  24363. type: "integer"
  24364. },
  24365. team_id: {
  24366. required: true,
  24367. type: "integer"
  24368. }
  24369. },
  24370. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24371. },
  24372. getDiscussionInOrg: {
  24373. method: "GET",
  24374. params: {
  24375. discussion_number: {
  24376. required: true,
  24377. type: "integer"
  24378. },
  24379. org: {
  24380. required: true,
  24381. type: "string"
  24382. },
  24383. team_slug: {
  24384. required: true,
  24385. type: "string"
  24386. }
  24387. },
  24388. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24389. },
  24390. getDiscussionLegacy: {
  24391. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24392. method: "GET",
  24393. params: {
  24394. discussion_number: {
  24395. required: true,
  24396. type: "integer"
  24397. },
  24398. team_id: {
  24399. required: true,
  24400. type: "integer"
  24401. }
  24402. },
  24403. url: "/teams/:team_id/discussions/:discussion_number"
  24404. },
  24405. getLegacy: {
  24406. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24407. method: "GET",
  24408. params: {
  24409. team_id: {
  24410. required: true,
  24411. type: "integer"
  24412. }
  24413. },
  24414. url: "/teams/:team_id"
  24415. },
  24416. getMember: {
  24417. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24418. method: "GET",
  24419. params: {
  24420. team_id: {
  24421. required: true,
  24422. type: "integer"
  24423. },
  24424. username: {
  24425. required: true,
  24426. type: "string"
  24427. }
  24428. },
  24429. url: "/teams/:team_id/members/:username"
  24430. },
  24431. getMemberLegacy: {
  24432. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24433. method: "GET",
  24434. params: {
  24435. team_id: {
  24436. required: true,
  24437. type: "integer"
  24438. },
  24439. username: {
  24440. required: true,
  24441. type: "string"
  24442. }
  24443. },
  24444. url: "/teams/:team_id/members/:username"
  24445. },
  24446. getMembership: {
  24447. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24448. method: "GET",
  24449. params: {
  24450. team_id: {
  24451. required: true,
  24452. type: "integer"
  24453. },
  24454. username: {
  24455. required: true,
  24456. type: "string"
  24457. }
  24458. },
  24459. url: "/teams/:team_id/memberships/:username"
  24460. },
  24461. getMembershipInOrg: {
  24462. method: "GET",
  24463. params: {
  24464. org: {
  24465. required: true,
  24466. type: "string"
  24467. },
  24468. team_slug: {
  24469. required: true,
  24470. type: "string"
  24471. },
  24472. username: {
  24473. required: true,
  24474. type: "string"
  24475. }
  24476. },
  24477. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24478. },
  24479. getMembershipLegacy: {
  24480. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24481. method: "GET",
  24482. params: {
  24483. team_id: {
  24484. required: true,
  24485. type: "integer"
  24486. },
  24487. username: {
  24488. required: true,
  24489. type: "string"
  24490. }
  24491. },
  24492. url: "/teams/:team_id/memberships/:username"
  24493. },
  24494. list: {
  24495. method: "GET",
  24496. params: {
  24497. org: {
  24498. required: true,
  24499. type: "string"
  24500. },
  24501. page: {
  24502. type: "integer"
  24503. },
  24504. per_page: {
  24505. type: "integer"
  24506. }
  24507. },
  24508. url: "/orgs/:org/teams"
  24509. },
  24510. listChild: {
  24511. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24512. method: "GET",
  24513. params: {
  24514. page: {
  24515. type: "integer"
  24516. },
  24517. per_page: {
  24518. type: "integer"
  24519. },
  24520. team_id: {
  24521. required: true,
  24522. type: "integer"
  24523. }
  24524. },
  24525. url: "/teams/:team_id/teams"
  24526. },
  24527. listChildInOrg: {
  24528. method: "GET",
  24529. params: {
  24530. org: {
  24531. required: true,
  24532. type: "string"
  24533. },
  24534. page: {
  24535. type: "integer"
  24536. },
  24537. per_page: {
  24538. type: "integer"
  24539. },
  24540. team_slug: {
  24541. required: true,
  24542. type: "string"
  24543. }
  24544. },
  24545. url: "/orgs/:org/teams/:team_slug/teams"
  24546. },
  24547. listChildLegacy: {
  24548. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24549. method: "GET",
  24550. params: {
  24551. page: {
  24552. type: "integer"
  24553. },
  24554. per_page: {
  24555. type: "integer"
  24556. },
  24557. team_id: {
  24558. required: true,
  24559. type: "integer"
  24560. }
  24561. },
  24562. url: "/teams/:team_id/teams"
  24563. },
  24564. listDiscussionComments: {
  24565. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24566. method: "GET",
  24567. params: {
  24568. direction: {
  24569. enum: ["asc", "desc"],
  24570. type: "string"
  24571. },
  24572. discussion_number: {
  24573. required: true,
  24574. type: "integer"
  24575. },
  24576. page: {
  24577. type: "integer"
  24578. },
  24579. per_page: {
  24580. type: "integer"
  24581. },
  24582. team_id: {
  24583. required: true,
  24584. type: "integer"
  24585. }
  24586. },
  24587. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24588. },
  24589. listDiscussionCommentsInOrg: {
  24590. method: "GET",
  24591. params: {
  24592. direction: {
  24593. enum: ["asc", "desc"],
  24594. type: "string"
  24595. },
  24596. discussion_number: {
  24597. required: true,
  24598. type: "integer"
  24599. },
  24600. org: {
  24601. required: true,
  24602. type: "string"
  24603. },
  24604. page: {
  24605. type: "integer"
  24606. },
  24607. per_page: {
  24608. type: "integer"
  24609. },
  24610. team_slug: {
  24611. required: true,
  24612. type: "string"
  24613. }
  24614. },
  24615. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24616. },
  24617. listDiscussionCommentsLegacy: {
  24618. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24619. method: "GET",
  24620. params: {
  24621. direction: {
  24622. enum: ["asc", "desc"],
  24623. type: "string"
  24624. },
  24625. discussion_number: {
  24626. required: true,
  24627. type: "integer"
  24628. },
  24629. page: {
  24630. type: "integer"
  24631. },
  24632. per_page: {
  24633. type: "integer"
  24634. },
  24635. team_id: {
  24636. required: true,
  24637. type: "integer"
  24638. }
  24639. },
  24640. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24641. },
  24642. listDiscussions: {
  24643. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24644. method: "GET",
  24645. params: {
  24646. direction: {
  24647. enum: ["asc", "desc"],
  24648. type: "string"
  24649. },
  24650. page: {
  24651. type: "integer"
  24652. },
  24653. per_page: {
  24654. type: "integer"
  24655. },
  24656. team_id: {
  24657. required: true,
  24658. type: "integer"
  24659. }
  24660. },
  24661. url: "/teams/:team_id/discussions"
  24662. },
  24663. listDiscussionsInOrg: {
  24664. method: "GET",
  24665. params: {
  24666. direction: {
  24667. enum: ["asc", "desc"],
  24668. type: "string"
  24669. },
  24670. org: {
  24671. required: true,
  24672. type: "string"
  24673. },
  24674. page: {
  24675. type: "integer"
  24676. },
  24677. per_page: {
  24678. type: "integer"
  24679. },
  24680. team_slug: {
  24681. required: true,
  24682. type: "string"
  24683. }
  24684. },
  24685. url: "/orgs/:org/teams/:team_slug/discussions"
  24686. },
  24687. listDiscussionsLegacy: {
  24688. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24689. method: "GET",
  24690. params: {
  24691. direction: {
  24692. enum: ["asc", "desc"],
  24693. type: "string"
  24694. },
  24695. page: {
  24696. type: "integer"
  24697. },
  24698. per_page: {
  24699. type: "integer"
  24700. },
  24701. team_id: {
  24702. required: true,
  24703. type: "integer"
  24704. }
  24705. },
  24706. url: "/teams/:team_id/discussions"
  24707. },
  24708. listForAuthenticatedUser: {
  24709. method: "GET",
  24710. params: {
  24711. page: {
  24712. type: "integer"
  24713. },
  24714. per_page: {
  24715. type: "integer"
  24716. }
  24717. },
  24718. url: "/user/teams"
  24719. },
  24720. listMembers: {
  24721. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24722. method: "GET",
  24723. params: {
  24724. page: {
  24725. type: "integer"
  24726. },
  24727. per_page: {
  24728. type: "integer"
  24729. },
  24730. role: {
  24731. enum: ["member", "maintainer", "all"],
  24732. type: "string"
  24733. },
  24734. team_id: {
  24735. required: true,
  24736. type: "integer"
  24737. }
  24738. },
  24739. url: "/teams/:team_id/members"
  24740. },
  24741. listMembersInOrg: {
  24742. method: "GET",
  24743. params: {
  24744. org: {
  24745. required: true,
  24746. type: "string"
  24747. },
  24748. page: {
  24749. type: "integer"
  24750. },
  24751. per_page: {
  24752. type: "integer"
  24753. },
  24754. role: {
  24755. enum: ["member", "maintainer", "all"],
  24756. type: "string"
  24757. },
  24758. team_slug: {
  24759. required: true,
  24760. type: "string"
  24761. }
  24762. },
  24763. url: "/orgs/:org/teams/:team_slug/members"
  24764. },
  24765. listMembersLegacy: {
  24766. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24767. method: "GET",
  24768. params: {
  24769. page: {
  24770. type: "integer"
  24771. },
  24772. per_page: {
  24773. type: "integer"
  24774. },
  24775. role: {
  24776. enum: ["member", "maintainer", "all"],
  24777. type: "string"
  24778. },
  24779. team_id: {
  24780. required: true,
  24781. type: "integer"
  24782. }
  24783. },
  24784. url: "/teams/:team_id/members"
  24785. },
  24786. listPendingInvitations: {
  24787. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24788. method: "GET",
  24789. params: {
  24790. page: {
  24791. type: "integer"
  24792. },
  24793. per_page: {
  24794. type: "integer"
  24795. },
  24796. team_id: {
  24797. required: true,
  24798. type: "integer"
  24799. }
  24800. },
  24801. url: "/teams/:team_id/invitations"
  24802. },
  24803. listPendingInvitationsInOrg: {
  24804. method: "GET",
  24805. params: {
  24806. org: {
  24807. required: true,
  24808. type: "string"
  24809. },
  24810. page: {
  24811. type: "integer"
  24812. },
  24813. per_page: {
  24814. type: "integer"
  24815. },
  24816. team_slug: {
  24817. required: true,
  24818. type: "string"
  24819. }
  24820. },
  24821. url: "/orgs/:org/teams/:team_slug/invitations"
  24822. },
  24823. listPendingInvitationsLegacy: {
  24824. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24825. method: "GET",
  24826. params: {
  24827. page: {
  24828. type: "integer"
  24829. },
  24830. per_page: {
  24831. type: "integer"
  24832. },
  24833. team_id: {
  24834. required: true,
  24835. type: "integer"
  24836. }
  24837. },
  24838. url: "/teams/:team_id/invitations"
  24839. },
  24840. listProjects: {
  24841. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24842. headers: {
  24843. accept: "application/vnd.github.inertia-preview+json"
  24844. },
  24845. method: "GET",
  24846. params: {
  24847. page: {
  24848. type: "integer"
  24849. },
  24850. per_page: {
  24851. type: "integer"
  24852. },
  24853. team_id: {
  24854. required: true,
  24855. type: "integer"
  24856. }
  24857. },
  24858. url: "/teams/:team_id/projects"
  24859. },
  24860. listProjectsInOrg: {
  24861. headers: {
  24862. accept: "application/vnd.github.inertia-preview+json"
  24863. },
  24864. method: "GET",
  24865. params: {
  24866. org: {
  24867. required: true,
  24868. type: "string"
  24869. },
  24870. page: {
  24871. type: "integer"
  24872. },
  24873. per_page: {
  24874. type: "integer"
  24875. },
  24876. team_slug: {
  24877. required: true,
  24878. type: "string"
  24879. }
  24880. },
  24881. url: "/orgs/:org/teams/:team_slug/projects"
  24882. },
  24883. listProjectsLegacy: {
  24884. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24885. headers: {
  24886. accept: "application/vnd.github.inertia-preview+json"
  24887. },
  24888. method: "GET",
  24889. params: {
  24890. page: {
  24891. type: "integer"
  24892. },
  24893. per_page: {
  24894. type: "integer"
  24895. },
  24896. team_id: {
  24897. required: true,
  24898. type: "integer"
  24899. }
  24900. },
  24901. url: "/teams/:team_id/projects"
  24902. },
  24903. listRepos: {
  24904. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24905. method: "GET",
  24906. params: {
  24907. page: {
  24908. type: "integer"
  24909. },
  24910. per_page: {
  24911. type: "integer"
  24912. },
  24913. team_id: {
  24914. required: true,
  24915. type: "integer"
  24916. }
  24917. },
  24918. url: "/teams/:team_id/repos"
  24919. },
  24920. listReposInOrg: {
  24921. method: "GET",
  24922. params: {
  24923. org: {
  24924. required: true,
  24925. type: "string"
  24926. },
  24927. page: {
  24928. type: "integer"
  24929. },
  24930. per_page: {
  24931. type: "integer"
  24932. },
  24933. team_slug: {
  24934. required: true,
  24935. type: "string"
  24936. }
  24937. },
  24938. url: "/orgs/:org/teams/:team_slug/repos"
  24939. },
  24940. listReposLegacy: {
  24941. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24942. method: "GET",
  24943. params: {
  24944. page: {
  24945. type: "integer"
  24946. },
  24947. per_page: {
  24948. type: "integer"
  24949. },
  24950. team_id: {
  24951. required: true,
  24952. type: "integer"
  24953. }
  24954. },
  24955. url: "/teams/:team_id/repos"
  24956. },
  24957. removeMember: {
  24958. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24959. method: "DELETE",
  24960. params: {
  24961. team_id: {
  24962. required: true,
  24963. type: "integer"
  24964. },
  24965. username: {
  24966. required: true,
  24967. type: "string"
  24968. }
  24969. },
  24970. url: "/teams/:team_id/members/:username"
  24971. },
  24972. removeMemberLegacy: {
  24973. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24974. method: "DELETE",
  24975. params: {
  24976. team_id: {
  24977. required: true,
  24978. type: "integer"
  24979. },
  24980. username: {
  24981. required: true,
  24982. type: "string"
  24983. }
  24984. },
  24985. url: "/teams/:team_id/members/:username"
  24986. },
  24987. removeMembership: {
  24988. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24989. method: "DELETE",
  24990. params: {
  24991. team_id: {
  24992. required: true,
  24993. type: "integer"
  24994. },
  24995. username: {
  24996. required: true,
  24997. type: "string"
  24998. }
  24999. },
  25000. url: "/teams/:team_id/memberships/:username"
  25001. },
  25002. removeMembershipInOrg: {
  25003. method: "DELETE",
  25004. params: {
  25005. org: {
  25006. required: true,
  25007. type: "string"
  25008. },
  25009. team_slug: {
  25010. required: true,
  25011. type: "string"
  25012. },
  25013. username: {
  25014. required: true,
  25015. type: "string"
  25016. }
  25017. },
  25018. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  25019. },
  25020. removeMembershipLegacy: {
  25021. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  25022. method: "DELETE",
  25023. params: {
  25024. team_id: {
  25025. required: true,
  25026. type: "integer"
  25027. },
  25028. username: {
  25029. required: true,
  25030. type: "string"
  25031. }
  25032. },
  25033. url: "/teams/:team_id/memberships/:username"
  25034. },
  25035. removeProject: {
  25036. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  25037. method: "DELETE",
  25038. params: {
  25039. project_id: {
  25040. required: true,
  25041. type: "integer"
  25042. },
  25043. team_id: {
  25044. required: true,
  25045. type: "integer"
  25046. }
  25047. },
  25048. url: "/teams/:team_id/projects/:project_id"
  25049. },
  25050. removeProjectInOrg: {
  25051. method: "DELETE",
  25052. params: {
  25053. org: {
  25054. required: true,
  25055. type: "string"
  25056. },
  25057. project_id: {
  25058. required: true,
  25059. type: "integer"
  25060. },
  25061. team_slug: {
  25062. required: true,
  25063. type: "string"
  25064. }
  25065. },
  25066. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25067. },
  25068. removeProjectLegacy: {
  25069. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25070. method: "DELETE",
  25071. params: {
  25072. project_id: {
  25073. required: true,
  25074. type: "integer"
  25075. },
  25076. team_id: {
  25077. required: true,
  25078. type: "integer"
  25079. }
  25080. },
  25081. url: "/teams/:team_id/projects/:project_id"
  25082. },
  25083. removeRepo: {
  25084. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25085. method: "DELETE",
  25086. params: {
  25087. owner: {
  25088. required: true,
  25089. type: "string"
  25090. },
  25091. repo: {
  25092. required: true,
  25093. type: "string"
  25094. },
  25095. team_id: {
  25096. required: true,
  25097. type: "integer"
  25098. }
  25099. },
  25100. url: "/teams/:team_id/repos/:owner/:repo"
  25101. },
  25102. removeRepoInOrg: {
  25103. method: "DELETE",
  25104. params: {
  25105. org: {
  25106. required: true,
  25107. type: "string"
  25108. },
  25109. owner: {
  25110. required: true,
  25111. type: "string"
  25112. },
  25113. repo: {
  25114. required: true,
  25115. type: "string"
  25116. },
  25117. team_slug: {
  25118. required: true,
  25119. type: "string"
  25120. }
  25121. },
  25122. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25123. },
  25124. removeRepoLegacy: {
  25125. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25126. method: "DELETE",
  25127. params: {
  25128. owner: {
  25129. required: true,
  25130. type: "string"
  25131. },
  25132. repo: {
  25133. required: true,
  25134. type: "string"
  25135. },
  25136. team_id: {
  25137. required: true,
  25138. type: "integer"
  25139. }
  25140. },
  25141. url: "/teams/:team_id/repos/:owner/:repo"
  25142. },
  25143. reviewProject: {
  25144. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25145. headers: {
  25146. accept: "application/vnd.github.inertia-preview+json"
  25147. },
  25148. method: "GET",
  25149. params: {
  25150. project_id: {
  25151. required: true,
  25152. type: "integer"
  25153. },
  25154. team_id: {
  25155. required: true,
  25156. type: "integer"
  25157. }
  25158. },
  25159. url: "/teams/:team_id/projects/:project_id"
  25160. },
  25161. reviewProjectInOrg: {
  25162. headers: {
  25163. accept: "application/vnd.github.inertia-preview+json"
  25164. },
  25165. method: "GET",
  25166. params: {
  25167. org: {
  25168. required: true,
  25169. type: "string"
  25170. },
  25171. project_id: {
  25172. required: true,
  25173. type: "integer"
  25174. },
  25175. team_slug: {
  25176. required: true,
  25177. type: "string"
  25178. }
  25179. },
  25180. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25181. },
  25182. reviewProjectLegacy: {
  25183. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25184. headers: {
  25185. accept: "application/vnd.github.inertia-preview+json"
  25186. },
  25187. method: "GET",
  25188. params: {
  25189. project_id: {
  25190. required: true,
  25191. type: "integer"
  25192. },
  25193. team_id: {
  25194. required: true,
  25195. type: "integer"
  25196. }
  25197. },
  25198. url: "/teams/:team_id/projects/:project_id"
  25199. },
  25200. update: {
  25201. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25202. method: "PATCH",
  25203. params: {
  25204. description: {
  25205. type: "string"
  25206. },
  25207. name: {
  25208. required: true,
  25209. type: "string"
  25210. },
  25211. parent_team_id: {
  25212. type: "integer"
  25213. },
  25214. permission: {
  25215. enum: ["pull", "push", "admin"],
  25216. type: "string"
  25217. },
  25218. privacy: {
  25219. enum: ["secret", "closed"],
  25220. type: "string"
  25221. },
  25222. team_id: {
  25223. required: true,
  25224. type: "integer"
  25225. }
  25226. },
  25227. url: "/teams/:team_id"
  25228. },
  25229. updateDiscussion: {
  25230. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25231. method: "PATCH",
  25232. params: {
  25233. body: {
  25234. type: "string"
  25235. },
  25236. discussion_number: {
  25237. required: true,
  25238. type: "integer"
  25239. },
  25240. team_id: {
  25241. required: true,
  25242. type: "integer"
  25243. },
  25244. title: {
  25245. type: "string"
  25246. }
  25247. },
  25248. url: "/teams/:team_id/discussions/:discussion_number"
  25249. },
  25250. updateDiscussionComment: {
  25251. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25252. method: "PATCH",
  25253. params: {
  25254. body: {
  25255. required: true,
  25256. type: "string"
  25257. },
  25258. comment_number: {
  25259. required: true,
  25260. type: "integer"
  25261. },
  25262. discussion_number: {
  25263. required: true,
  25264. type: "integer"
  25265. },
  25266. team_id: {
  25267. required: true,
  25268. type: "integer"
  25269. }
  25270. },
  25271. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25272. },
  25273. updateDiscussionCommentInOrg: {
  25274. method: "PATCH",
  25275. params: {
  25276. body: {
  25277. required: true,
  25278. type: "string"
  25279. },
  25280. comment_number: {
  25281. required: true,
  25282. type: "integer"
  25283. },
  25284. discussion_number: {
  25285. required: true,
  25286. type: "integer"
  25287. },
  25288. org: {
  25289. required: true,
  25290. type: "string"
  25291. },
  25292. team_slug: {
  25293. required: true,
  25294. type: "string"
  25295. }
  25296. },
  25297. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25298. },
  25299. updateDiscussionCommentLegacy: {
  25300. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25301. method: "PATCH",
  25302. params: {
  25303. body: {
  25304. required: true,
  25305. type: "string"
  25306. },
  25307. comment_number: {
  25308. required: true,
  25309. type: "integer"
  25310. },
  25311. discussion_number: {
  25312. required: true,
  25313. type: "integer"
  25314. },
  25315. team_id: {
  25316. required: true,
  25317. type: "integer"
  25318. }
  25319. },
  25320. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25321. },
  25322. updateDiscussionInOrg: {
  25323. method: "PATCH",
  25324. params: {
  25325. body: {
  25326. type: "string"
  25327. },
  25328. discussion_number: {
  25329. required: true,
  25330. type: "integer"
  25331. },
  25332. org: {
  25333. required: true,
  25334. type: "string"
  25335. },
  25336. team_slug: {
  25337. required: true,
  25338. type: "string"
  25339. },
  25340. title: {
  25341. type: "string"
  25342. }
  25343. },
  25344. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25345. },
  25346. updateDiscussionLegacy: {
  25347. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25348. method: "PATCH",
  25349. params: {
  25350. body: {
  25351. type: "string"
  25352. },
  25353. discussion_number: {
  25354. required: true,
  25355. type: "integer"
  25356. },
  25357. team_id: {
  25358. required: true,
  25359. type: "integer"
  25360. },
  25361. title: {
  25362. type: "string"
  25363. }
  25364. },
  25365. url: "/teams/:team_id/discussions/:discussion_number"
  25366. },
  25367. updateInOrg: {
  25368. method: "PATCH",
  25369. params: {
  25370. description: {
  25371. type: "string"
  25372. },
  25373. name: {
  25374. required: true,
  25375. type: "string"
  25376. },
  25377. org: {
  25378. required: true,
  25379. type: "string"
  25380. },
  25381. parent_team_id: {
  25382. type: "integer"
  25383. },
  25384. permission: {
  25385. enum: ["pull", "push", "admin"],
  25386. type: "string"
  25387. },
  25388. privacy: {
  25389. enum: ["secret", "closed"],
  25390. type: "string"
  25391. },
  25392. team_slug: {
  25393. required: true,
  25394. type: "string"
  25395. }
  25396. },
  25397. url: "/orgs/:org/teams/:team_slug"
  25398. },
  25399. updateLegacy: {
  25400. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25401. method: "PATCH",
  25402. params: {
  25403. description: {
  25404. type: "string"
  25405. },
  25406. name: {
  25407. required: true,
  25408. type: "string"
  25409. },
  25410. parent_team_id: {
  25411. type: "integer"
  25412. },
  25413. permission: {
  25414. enum: ["pull", "push", "admin"],
  25415. type: "string"
  25416. },
  25417. privacy: {
  25418. enum: ["secret", "closed"],
  25419. type: "string"
  25420. },
  25421. team_id: {
  25422. required: true,
  25423. type: "integer"
  25424. }
  25425. },
  25426. url: "/teams/:team_id"
  25427. }
  25428. },
  25429. users: {
  25430. addEmails: {
  25431. method: "POST",
  25432. params: {
  25433. emails: {
  25434. required: true,
  25435. type: "string[]"
  25436. }
  25437. },
  25438. url: "/user/emails"
  25439. },
  25440. block: {
  25441. method: "PUT",
  25442. params: {
  25443. username: {
  25444. required: true,
  25445. type: "string"
  25446. }
  25447. },
  25448. url: "/user/blocks/:username"
  25449. },
  25450. checkBlocked: {
  25451. method: "GET",
  25452. params: {
  25453. username: {
  25454. required: true,
  25455. type: "string"
  25456. }
  25457. },
  25458. url: "/user/blocks/:username"
  25459. },
  25460. checkFollowing: {
  25461. method: "GET",
  25462. params: {
  25463. username: {
  25464. required: true,
  25465. type: "string"
  25466. }
  25467. },
  25468. url: "/user/following/:username"
  25469. },
  25470. checkFollowingForUser: {
  25471. method: "GET",
  25472. params: {
  25473. target_user: {
  25474. required: true,
  25475. type: "string"
  25476. },
  25477. username: {
  25478. required: true,
  25479. type: "string"
  25480. }
  25481. },
  25482. url: "/users/:username/following/:target_user"
  25483. },
  25484. createGpgKey: {
  25485. method: "POST",
  25486. params: {
  25487. armored_public_key: {
  25488. type: "string"
  25489. }
  25490. },
  25491. url: "/user/gpg_keys"
  25492. },
  25493. createPublicKey: {
  25494. method: "POST",
  25495. params: {
  25496. key: {
  25497. type: "string"
  25498. },
  25499. title: {
  25500. type: "string"
  25501. }
  25502. },
  25503. url: "/user/keys"
  25504. },
  25505. deleteEmails: {
  25506. method: "DELETE",
  25507. params: {
  25508. emails: {
  25509. required: true,
  25510. type: "string[]"
  25511. }
  25512. },
  25513. url: "/user/emails"
  25514. },
  25515. deleteGpgKey: {
  25516. method: "DELETE",
  25517. params: {
  25518. gpg_key_id: {
  25519. required: true,
  25520. type: "integer"
  25521. }
  25522. },
  25523. url: "/user/gpg_keys/:gpg_key_id"
  25524. },
  25525. deletePublicKey: {
  25526. method: "DELETE",
  25527. params: {
  25528. key_id: {
  25529. required: true,
  25530. type: "integer"
  25531. }
  25532. },
  25533. url: "/user/keys/:key_id"
  25534. },
  25535. follow: {
  25536. method: "PUT",
  25537. params: {
  25538. username: {
  25539. required: true,
  25540. type: "string"
  25541. }
  25542. },
  25543. url: "/user/following/:username"
  25544. },
  25545. getAuthenticated: {
  25546. method: "GET",
  25547. params: {},
  25548. url: "/user"
  25549. },
  25550. getByUsername: {
  25551. method: "GET",
  25552. params: {
  25553. username: {
  25554. required: true,
  25555. type: "string"
  25556. }
  25557. },
  25558. url: "/users/:username"
  25559. },
  25560. getContextForUser: {
  25561. method: "GET",
  25562. params: {
  25563. subject_id: {
  25564. type: "string"
  25565. },
  25566. subject_type: {
  25567. enum: ["organization", "repository", "issue", "pull_request"],
  25568. type: "string"
  25569. },
  25570. username: {
  25571. required: true,
  25572. type: "string"
  25573. }
  25574. },
  25575. url: "/users/:username/hovercard"
  25576. },
  25577. getGpgKey: {
  25578. method: "GET",
  25579. params: {
  25580. gpg_key_id: {
  25581. required: true,
  25582. type: "integer"
  25583. }
  25584. },
  25585. url: "/user/gpg_keys/:gpg_key_id"
  25586. },
  25587. getPublicKey: {
  25588. method: "GET",
  25589. params: {
  25590. key_id: {
  25591. required: true,
  25592. type: "integer"
  25593. }
  25594. },
  25595. url: "/user/keys/:key_id"
  25596. },
  25597. list: {
  25598. method: "GET",
  25599. params: {
  25600. page: {
  25601. type: "integer"
  25602. },
  25603. per_page: {
  25604. type: "integer"
  25605. },
  25606. since: {
  25607. type: "string"
  25608. }
  25609. },
  25610. url: "/users"
  25611. },
  25612. listBlocked: {
  25613. method: "GET",
  25614. params: {},
  25615. url: "/user/blocks"
  25616. },
  25617. listEmails: {
  25618. method: "GET",
  25619. params: {
  25620. page: {
  25621. type: "integer"
  25622. },
  25623. per_page: {
  25624. type: "integer"
  25625. }
  25626. },
  25627. url: "/user/emails"
  25628. },
  25629. listFollowersForAuthenticatedUser: {
  25630. method: "GET",
  25631. params: {
  25632. page: {
  25633. type: "integer"
  25634. },
  25635. per_page: {
  25636. type: "integer"
  25637. }
  25638. },
  25639. url: "/user/followers"
  25640. },
  25641. listFollowersForUser: {
  25642. method: "GET",
  25643. params: {
  25644. page: {
  25645. type: "integer"
  25646. },
  25647. per_page: {
  25648. type: "integer"
  25649. },
  25650. username: {
  25651. required: true,
  25652. type: "string"
  25653. }
  25654. },
  25655. url: "/users/:username/followers"
  25656. },
  25657. listFollowingForAuthenticatedUser: {
  25658. method: "GET",
  25659. params: {
  25660. page: {
  25661. type: "integer"
  25662. },
  25663. per_page: {
  25664. type: "integer"
  25665. }
  25666. },
  25667. url: "/user/following"
  25668. },
  25669. listFollowingForUser: {
  25670. method: "GET",
  25671. params: {
  25672. page: {
  25673. type: "integer"
  25674. },
  25675. per_page: {
  25676. type: "integer"
  25677. },
  25678. username: {
  25679. required: true,
  25680. type: "string"
  25681. }
  25682. },
  25683. url: "/users/:username/following"
  25684. },
  25685. listGpgKeys: {
  25686. method: "GET",
  25687. params: {
  25688. page: {
  25689. type: "integer"
  25690. },
  25691. per_page: {
  25692. type: "integer"
  25693. }
  25694. },
  25695. url: "/user/gpg_keys"
  25696. },
  25697. listGpgKeysForUser: {
  25698. method: "GET",
  25699. params: {
  25700. page: {
  25701. type: "integer"
  25702. },
  25703. per_page: {
  25704. type: "integer"
  25705. },
  25706. username: {
  25707. required: true,
  25708. type: "string"
  25709. }
  25710. },
  25711. url: "/users/:username/gpg_keys"
  25712. },
  25713. listPublicEmails: {
  25714. method: "GET",
  25715. params: {
  25716. page: {
  25717. type: "integer"
  25718. },
  25719. per_page: {
  25720. type: "integer"
  25721. }
  25722. },
  25723. url: "/user/public_emails"
  25724. },
  25725. listPublicKeys: {
  25726. method: "GET",
  25727. params: {
  25728. page: {
  25729. type: "integer"
  25730. },
  25731. per_page: {
  25732. type: "integer"
  25733. }
  25734. },
  25735. url: "/user/keys"
  25736. },
  25737. listPublicKeysForUser: {
  25738. method: "GET",
  25739. params: {
  25740. page: {
  25741. type: "integer"
  25742. },
  25743. per_page: {
  25744. type: "integer"
  25745. },
  25746. username: {
  25747. required: true,
  25748. type: "string"
  25749. }
  25750. },
  25751. url: "/users/:username/keys"
  25752. },
  25753. togglePrimaryEmailVisibility: {
  25754. method: "PATCH",
  25755. params: {
  25756. email: {
  25757. required: true,
  25758. type: "string"
  25759. },
  25760. visibility: {
  25761. required: true,
  25762. type: "string"
  25763. }
  25764. },
  25765. url: "/user/email/visibility"
  25766. },
  25767. unblock: {
  25768. method: "DELETE",
  25769. params: {
  25770. username: {
  25771. required: true,
  25772. type: "string"
  25773. }
  25774. },
  25775. url: "/user/blocks/:username"
  25776. },
  25777. unfollow: {
  25778. method: "DELETE",
  25779. params: {
  25780. username: {
  25781. required: true,
  25782. type: "string"
  25783. }
  25784. },
  25785. url: "/user/following/:username"
  25786. },
  25787. updateAuthenticated: {
  25788. method: "PATCH",
  25789. params: {
  25790. bio: {
  25791. type: "string"
  25792. },
  25793. blog: {
  25794. type: "string"
  25795. },
  25796. company: {
  25797. type: "string"
  25798. },
  25799. email: {
  25800. type: "string"
  25801. },
  25802. hireable: {
  25803. type: "boolean"
  25804. },
  25805. location: {
  25806. type: "string"
  25807. },
  25808. name: {
  25809. type: "string"
  25810. }
  25811. },
  25812. url: "/user"
  25813. }
  25814. }
  25815. };
  25816. const VERSION = "2.4.0";
  25817. function registerEndpoints(octokit, routes) {
  25818. Object.keys(routes).forEach(namespaceName => {
  25819. if (!octokit[namespaceName]) {
  25820. octokit[namespaceName] = {};
  25821. }
  25822. Object.keys(routes[namespaceName]).forEach(apiName => {
  25823. const apiOptions = routes[namespaceName][apiName];
  25824. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25825. if (typeof apiOptions[key] !== "undefined") {
  25826. map[key] = apiOptions[key];
  25827. }
  25828. return map;
  25829. }, {});
  25830. endpointDefaults.request = {
  25831. validate: apiOptions.params
  25832. };
  25833. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25834. // Not the most elegant solution, but we don’t want to move deprecation
  25835. // logic into octokit/endpoint.js as it’s out of scope
  25836. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25837. if (hasDeprecatedParam) {
  25838. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25839. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25840. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25841. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25842. }
  25843. if (apiOptions.deprecated) {
  25844. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25845. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25846. octokit[namespaceName][apiName] = request;
  25847. return request.apply(null, arguments);
  25848. }, request);
  25849. return;
  25850. }
  25851. octokit[namespaceName][apiName] = request;
  25852. });
  25853. });
  25854. }
  25855. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25856. const patchedMethod = options => {
  25857. options = Object.assign({}, options);
  25858. Object.keys(options).forEach(key => {
  25859. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25860. const aliasKey = apiOptions.params[key].alias;
  25861. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25862. if (!(aliasKey in options)) {
  25863. options[aliasKey] = options[key];
  25864. }
  25865. delete options[key];
  25866. }
  25867. });
  25868. return method(options);
  25869. };
  25870. Object.keys(method).forEach(key => {
  25871. patchedMethod[key] = method[key];
  25872. });
  25873. return patchedMethod;
  25874. }
  25875. /**
  25876. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25877. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25878. * done, we will remove the registerEndpoints methods and return the methods
  25879. * directly as with the other plugins. At that point we will also remove the
  25880. * legacy workarounds and deprecations.
  25881. *
  25882. * See the plan at
  25883. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25884. */
  25885. function restEndpointMethods(octokit) {
  25886. // @ts-ignore
  25887. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25888. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25889. // See https://github.com/octokit/rest.js/pull/1134
  25890. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25891. Object.defineProperty(octokit, deprecatedScope, {
  25892. get() {
  25893. octokit.log.warn( // @ts-ignore
  25894. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25895. return octokit[scope];
  25896. }
  25897. });
  25898. });
  25899. return {};
  25900. }
  25901. restEndpointMethods.VERSION = VERSION;
  25902. exports.restEndpointMethods = restEndpointMethods;
  25903. //# sourceMappingURL=index.js.map
  25904. /***/ }),
  25905. /***/ 850:
  25906. /***/ (function(module, __unusedexports, __webpack_require__) {
  25907. module.exports = paginationMethodsPlugin
  25908. function paginationMethodsPlugin (octokit) {
  25909. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25910. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25911. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25912. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25913. octokit.hasFirstPage = __webpack_require__(536)
  25914. octokit.hasLastPage = __webpack_require__(336)
  25915. octokit.hasNextPage = __webpack_require__(929)
  25916. octokit.hasPreviousPage = __webpack_require__(558)
  25917. }
  25918. /***/ }),
  25919. /***/ 854:
  25920. /***/ (function(module) {
  25921. /**
  25922. * lodash (Custom Build) <https://lodash.com/>
  25923. * Build: `lodash modularize exports="npm" -o ./`
  25924. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25925. * Released under MIT license <https://lodash.com/license>
  25926. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25927. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25928. */
  25929. /** Used as the `TypeError` message for "Functions" methods. */
  25930. var FUNC_ERROR_TEXT = 'Expected a function';
  25931. /** Used to stand-in for `undefined` hash values. */
  25932. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25933. /** Used as references for various `Number` constants. */
  25934. var INFINITY = 1 / 0;
  25935. /** `Object#toString` result references. */
  25936. var funcTag = '[object Function]',
  25937. genTag = '[object GeneratorFunction]',
  25938. symbolTag = '[object Symbol]';
  25939. /** Used to match property names within property paths. */
  25940. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25941. reIsPlainProp = /^\w*$/,
  25942. reLeadingDot = /^\./,
  25943. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25944. /**
  25945. * Used to match `RegExp`
  25946. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25947. */
  25948. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25949. /** Used to match backslashes in property paths. */
  25950. var reEscapeChar = /\\(\\)?/g;
  25951. /** Used to detect host constructors (Safari). */
  25952. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25953. /** Detect free variable `global` from Node.js. */
  25954. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25955. /** Detect free variable `self`. */
  25956. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25957. /** Used as a reference to the global object. */
  25958. var root = freeGlobal || freeSelf || Function('return this')();
  25959. /**
  25960. * Gets the value at `key` of `object`.
  25961. *
  25962. * @private
  25963. * @param {Object} [object] The object to query.
  25964. * @param {string} key The key of the property to get.
  25965. * @returns {*} Returns the property value.
  25966. */
  25967. function getValue(object, key) {
  25968. return object == null ? undefined : object[key];
  25969. }
  25970. /**
  25971. * Checks if `value` is a host object in IE < 9.
  25972. *
  25973. * @private
  25974. * @param {*} value The value to check.
  25975. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25976. */
  25977. function isHostObject(value) {
  25978. // Many host objects are `Object` objects that can coerce to strings
  25979. // despite having improperly defined `toString` methods.
  25980. var result = false;
  25981. if (value != null && typeof value.toString != 'function') {
  25982. try {
  25983. result = !!(value + '');
  25984. } catch (e) {}
  25985. }
  25986. return result;
  25987. }
  25988. /** Used for built-in method references. */
  25989. var arrayProto = Array.prototype,
  25990. funcProto = Function.prototype,
  25991. objectProto = Object.prototype;
  25992. /** Used to detect overreaching core-js shims. */
  25993. var coreJsData = root['__core-js_shared__'];
  25994. /** Used to detect methods masquerading as native. */
  25995. var maskSrcKey = (function() {
  25996. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25997. return uid ? ('Symbol(src)_1.' + uid) : '';
  25998. }());
  25999. /** Used to resolve the decompiled source of functions. */
  26000. var funcToString = funcProto.toString;
  26001. /** Used to check objects for own properties. */
  26002. var hasOwnProperty = objectProto.hasOwnProperty;
  26003. /**
  26004. * Used to resolve the
  26005. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  26006. * of values.
  26007. */
  26008. var objectToString = objectProto.toString;
  26009. /** Used to detect if a method is native. */
  26010. var reIsNative = RegExp('^' +
  26011. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  26012. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  26013. );
  26014. /** Built-in value references. */
  26015. var Symbol = root.Symbol,
  26016. splice = arrayProto.splice;
  26017. /* Built-in method references that are verified to be native. */
  26018. var Map = getNative(root, 'Map'),
  26019. nativeCreate = getNative(Object, 'create');
  26020. /** Used to convert symbols to primitives and strings. */
  26021. var symbolProto = Symbol ? Symbol.prototype : undefined,
  26022. symbolToString = symbolProto ? symbolProto.toString : undefined;
  26023. /**
  26024. * Creates a hash object.
  26025. *
  26026. * @private
  26027. * @constructor
  26028. * @param {Array} [entries] The key-value pairs to cache.
  26029. */
  26030. function Hash(entries) {
  26031. var index = -1,
  26032. length = entries ? entries.length : 0;
  26033. this.clear();
  26034. while (++index < length) {
  26035. var entry = entries[index];
  26036. this.set(entry[0], entry[1]);
  26037. }
  26038. }
  26039. /**
  26040. * Removes all key-value entries from the hash.
  26041. *
  26042. * @private
  26043. * @name clear
  26044. * @memberOf Hash
  26045. */
  26046. function hashClear() {
  26047. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  26048. }
  26049. /**
  26050. * Removes `key` and its value from the hash.
  26051. *
  26052. * @private
  26053. * @name delete
  26054. * @memberOf Hash
  26055. * @param {Object} hash The hash to modify.
  26056. * @param {string} key The key of the value to remove.
  26057. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26058. */
  26059. function hashDelete(key) {
  26060. return this.has(key) && delete this.__data__[key];
  26061. }
  26062. /**
  26063. * Gets the hash value for `key`.
  26064. *
  26065. * @private
  26066. * @name get
  26067. * @memberOf Hash
  26068. * @param {string} key The key of the value to get.
  26069. * @returns {*} Returns the entry value.
  26070. */
  26071. function hashGet(key) {
  26072. var data = this.__data__;
  26073. if (nativeCreate) {
  26074. var result = data[key];
  26075. return result === HASH_UNDEFINED ? undefined : result;
  26076. }
  26077. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26078. }
  26079. /**
  26080. * Checks if a hash value for `key` exists.
  26081. *
  26082. * @private
  26083. * @name has
  26084. * @memberOf Hash
  26085. * @param {string} key The key of the entry to check.
  26086. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26087. */
  26088. function hashHas(key) {
  26089. var data = this.__data__;
  26090. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26091. }
  26092. /**
  26093. * Sets the hash `key` to `value`.
  26094. *
  26095. * @private
  26096. * @name set
  26097. * @memberOf Hash
  26098. * @param {string} key The key of the value to set.
  26099. * @param {*} value The value to set.
  26100. * @returns {Object} Returns the hash instance.
  26101. */
  26102. function hashSet(key, value) {
  26103. var data = this.__data__;
  26104. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26105. return this;
  26106. }
  26107. // Add methods to `Hash`.
  26108. Hash.prototype.clear = hashClear;
  26109. Hash.prototype['delete'] = hashDelete;
  26110. Hash.prototype.get = hashGet;
  26111. Hash.prototype.has = hashHas;
  26112. Hash.prototype.set = hashSet;
  26113. /**
  26114. * Creates an list cache object.
  26115. *
  26116. * @private
  26117. * @constructor
  26118. * @param {Array} [entries] The key-value pairs to cache.
  26119. */
  26120. function ListCache(entries) {
  26121. var index = -1,
  26122. length = entries ? entries.length : 0;
  26123. this.clear();
  26124. while (++index < length) {
  26125. var entry = entries[index];
  26126. this.set(entry[0], entry[1]);
  26127. }
  26128. }
  26129. /**
  26130. * Removes all key-value entries from the list cache.
  26131. *
  26132. * @private
  26133. * @name clear
  26134. * @memberOf ListCache
  26135. */
  26136. function listCacheClear() {
  26137. this.__data__ = [];
  26138. }
  26139. /**
  26140. * Removes `key` and its value from the list cache.
  26141. *
  26142. * @private
  26143. * @name delete
  26144. * @memberOf ListCache
  26145. * @param {string} key The key of the value to remove.
  26146. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26147. */
  26148. function listCacheDelete(key) {
  26149. var data = this.__data__,
  26150. index = assocIndexOf(data, key);
  26151. if (index < 0) {
  26152. return false;
  26153. }
  26154. var lastIndex = data.length - 1;
  26155. if (index == lastIndex) {
  26156. data.pop();
  26157. } else {
  26158. splice.call(data, index, 1);
  26159. }
  26160. return true;
  26161. }
  26162. /**
  26163. * Gets the list cache value for `key`.
  26164. *
  26165. * @private
  26166. * @name get
  26167. * @memberOf ListCache
  26168. * @param {string} key The key of the value to get.
  26169. * @returns {*} Returns the entry value.
  26170. */
  26171. function listCacheGet(key) {
  26172. var data = this.__data__,
  26173. index = assocIndexOf(data, key);
  26174. return index < 0 ? undefined : data[index][1];
  26175. }
  26176. /**
  26177. * Checks if a list cache value for `key` exists.
  26178. *
  26179. * @private
  26180. * @name has
  26181. * @memberOf ListCache
  26182. * @param {string} key The key of the entry to check.
  26183. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26184. */
  26185. function listCacheHas(key) {
  26186. return assocIndexOf(this.__data__, key) > -1;
  26187. }
  26188. /**
  26189. * Sets the list cache `key` to `value`.
  26190. *
  26191. * @private
  26192. * @name set
  26193. * @memberOf ListCache
  26194. * @param {string} key The key of the value to set.
  26195. * @param {*} value The value to set.
  26196. * @returns {Object} Returns the list cache instance.
  26197. */
  26198. function listCacheSet(key, value) {
  26199. var data = this.__data__,
  26200. index = assocIndexOf(data, key);
  26201. if (index < 0) {
  26202. data.push([key, value]);
  26203. } else {
  26204. data[index][1] = value;
  26205. }
  26206. return this;
  26207. }
  26208. // Add methods to `ListCache`.
  26209. ListCache.prototype.clear = listCacheClear;
  26210. ListCache.prototype['delete'] = listCacheDelete;
  26211. ListCache.prototype.get = listCacheGet;
  26212. ListCache.prototype.has = listCacheHas;
  26213. ListCache.prototype.set = listCacheSet;
  26214. /**
  26215. * Creates a map cache object to store key-value pairs.
  26216. *
  26217. * @private
  26218. * @constructor
  26219. * @param {Array} [entries] The key-value pairs to cache.
  26220. */
  26221. function MapCache(entries) {
  26222. var index = -1,
  26223. length = entries ? entries.length : 0;
  26224. this.clear();
  26225. while (++index < length) {
  26226. var entry = entries[index];
  26227. this.set(entry[0], entry[1]);
  26228. }
  26229. }
  26230. /**
  26231. * Removes all key-value entries from the map.
  26232. *
  26233. * @private
  26234. * @name clear
  26235. * @memberOf MapCache
  26236. */
  26237. function mapCacheClear() {
  26238. this.__data__ = {
  26239. 'hash': new Hash,
  26240. 'map': new (Map || ListCache),
  26241. 'string': new Hash
  26242. };
  26243. }
  26244. /**
  26245. * Removes `key` and its value from the map.
  26246. *
  26247. * @private
  26248. * @name delete
  26249. * @memberOf MapCache
  26250. * @param {string} key The key of the value to remove.
  26251. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26252. */
  26253. function mapCacheDelete(key) {
  26254. return getMapData(this, key)['delete'](key);
  26255. }
  26256. /**
  26257. * Gets the map value for `key`.
  26258. *
  26259. * @private
  26260. * @name get
  26261. * @memberOf MapCache
  26262. * @param {string} key The key of the value to get.
  26263. * @returns {*} Returns the entry value.
  26264. */
  26265. function mapCacheGet(key) {
  26266. return getMapData(this, key).get(key);
  26267. }
  26268. /**
  26269. * Checks if a map value for `key` exists.
  26270. *
  26271. * @private
  26272. * @name has
  26273. * @memberOf MapCache
  26274. * @param {string} key The key of the entry to check.
  26275. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26276. */
  26277. function mapCacheHas(key) {
  26278. return getMapData(this, key).has(key);
  26279. }
  26280. /**
  26281. * Sets the map `key` to `value`.
  26282. *
  26283. * @private
  26284. * @name set
  26285. * @memberOf MapCache
  26286. * @param {string} key The key of the value to set.
  26287. * @param {*} value The value to set.
  26288. * @returns {Object} Returns the map cache instance.
  26289. */
  26290. function mapCacheSet(key, value) {
  26291. getMapData(this, key).set(key, value);
  26292. return this;
  26293. }
  26294. // Add methods to `MapCache`.
  26295. MapCache.prototype.clear = mapCacheClear;
  26296. MapCache.prototype['delete'] = mapCacheDelete;
  26297. MapCache.prototype.get = mapCacheGet;
  26298. MapCache.prototype.has = mapCacheHas;
  26299. MapCache.prototype.set = mapCacheSet;
  26300. /**
  26301. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26302. *
  26303. * @private
  26304. * @param {Array} array The array to inspect.
  26305. * @param {*} key The key to search for.
  26306. * @returns {number} Returns the index of the matched value, else `-1`.
  26307. */
  26308. function assocIndexOf(array, key) {
  26309. var length = array.length;
  26310. while (length--) {
  26311. if (eq(array[length][0], key)) {
  26312. return length;
  26313. }
  26314. }
  26315. return -1;
  26316. }
  26317. /**
  26318. * The base implementation of `_.get` without support for default values.
  26319. *
  26320. * @private
  26321. * @param {Object} object The object to query.
  26322. * @param {Array|string} path The path of the property to get.
  26323. * @returns {*} Returns the resolved value.
  26324. */
  26325. function baseGet(object, path) {
  26326. path = isKey(path, object) ? [path] : castPath(path);
  26327. var index = 0,
  26328. length = path.length;
  26329. while (object != null && index < length) {
  26330. object = object[toKey(path[index++])];
  26331. }
  26332. return (index && index == length) ? object : undefined;
  26333. }
  26334. /**
  26335. * The base implementation of `_.isNative` without bad shim checks.
  26336. *
  26337. * @private
  26338. * @param {*} value The value to check.
  26339. * @returns {boolean} Returns `true` if `value` is a native function,
  26340. * else `false`.
  26341. */
  26342. function baseIsNative(value) {
  26343. if (!isObject(value) || isMasked(value)) {
  26344. return false;
  26345. }
  26346. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26347. return pattern.test(toSource(value));
  26348. }
  26349. /**
  26350. * The base implementation of `_.toString` which doesn't convert nullish
  26351. * values to empty strings.
  26352. *
  26353. * @private
  26354. * @param {*} value The value to process.
  26355. * @returns {string} Returns the string.
  26356. */
  26357. function baseToString(value) {
  26358. // Exit early for strings to avoid a performance hit in some environments.
  26359. if (typeof value == 'string') {
  26360. return value;
  26361. }
  26362. if (isSymbol(value)) {
  26363. return symbolToString ? symbolToString.call(value) : '';
  26364. }
  26365. var result = (value + '');
  26366. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26367. }
  26368. /**
  26369. * Casts `value` to a path array if it's not one.
  26370. *
  26371. * @private
  26372. * @param {*} value The value to inspect.
  26373. * @returns {Array} Returns the cast property path array.
  26374. */
  26375. function castPath(value) {
  26376. return isArray(value) ? value : stringToPath(value);
  26377. }
  26378. /**
  26379. * Gets the data for `map`.
  26380. *
  26381. * @private
  26382. * @param {Object} map The map to query.
  26383. * @param {string} key The reference key.
  26384. * @returns {*} Returns the map data.
  26385. */
  26386. function getMapData(map, key) {
  26387. var data = map.__data__;
  26388. return isKeyable(key)
  26389. ? data[typeof key == 'string' ? 'string' : 'hash']
  26390. : data.map;
  26391. }
  26392. /**
  26393. * Gets the native function at `key` of `object`.
  26394. *
  26395. * @private
  26396. * @param {Object} object The object to query.
  26397. * @param {string} key The key of the method to get.
  26398. * @returns {*} Returns the function if it's native, else `undefined`.
  26399. */
  26400. function getNative(object, key) {
  26401. var value = getValue(object, key);
  26402. return baseIsNative(value) ? value : undefined;
  26403. }
  26404. /**
  26405. * Checks if `value` is a property name and not a property path.
  26406. *
  26407. * @private
  26408. * @param {*} value The value to check.
  26409. * @param {Object} [object] The object to query keys on.
  26410. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26411. */
  26412. function isKey(value, object) {
  26413. if (isArray(value)) {
  26414. return false;
  26415. }
  26416. var type = typeof value;
  26417. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26418. value == null || isSymbol(value)) {
  26419. return true;
  26420. }
  26421. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26422. (object != null && value in Object(object));
  26423. }
  26424. /**
  26425. * Checks if `value` is suitable for use as unique object key.
  26426. *
  26427. * @private
  26428. * @param {*} value The value to check.
  26429. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26430. */
  26431. function isKeyable(value) {
  26432. var type = typeof value;
  26433. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26434. ? (value !== '__proto__')
  26435. : (value === null);
  26436. }
  26437. /**
  26438. * Checks if `func` has its source masked.
  26439. *
  26440. * @private
  26441. * @param {Function} func The function to check.
  26442. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26443. */
  26444. function isMasked(func) {
  26445. return !!maskSrcKey && (maskSrcKey in func);
  26446. }
  26447. /**
  26448. * Converts `string` to a property path array.
  26449. *
  26450. * @private
  26451. * @param {string} string The string to convert.
  26452. * @returns {Array} Returns the property path array.
  26453. */
  26454. var stringToPath = memoize(function(string) {
  26455. string = toString(string);
  26456. var result = [];
  26457. if (reLeadingDot.test(string)) {
  26458. result.push('');
  26459. }
  26460. string.replace(rePropName, function(match, number, quote, string) {
  26461. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26462. });
  26463. return result;
  26464. });
  26465. /**
  26466. * Converts `value` to a string key if it's not a string or symbol.
  26467. *
  26468. * @private
  26469. * @param {*} value The value to inspect.
  26470. * @returns {string|symbol} Returns the key.
  26471. */
  26472. function toKey(value) {
  26473. if (typeof value == 'string' || isSymbol(value)) {
  26474. return value;
  26475. }
  26476. var result = (value + '');
  26477. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26478. }
  26479. /**
  26480. * Converts `func` to its source code.
  26481. *
  26482. * @private
  26483. * @param {Function} func The function to process.
  26484. * @returns {string} Returns the source code.
  26485. */
  26486. function toSource(func) {
  26487. if (func != null) {
  26488. try {
  26489. return funcToString.call(func);
  26490. } catch (e) {}
  26491. try {
  26492. return (func + '');
  26493. } catch (e) {}
  26494. }
  26495. return '';
  26496. }
  26497. /**
  26498. * Creates a function that memoizes the result of `func`. If `resolver` is
  26499. * provided, it determines the cache key for storing the result based on the
  26500. * arguments provided to the memoized function. By default, the first argument
  26501. * provided to the memoized function is used as the map cache key. The `func`
  26502. * is invoked with the `this` binding of the memoized function.
  26503. *
  26504. * **Note:** The cache is exposed as the `cache` property on the memoized
  26505. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26506. * constructor with one whose instances implement the
  26507. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26508. * method interface of `delete`, `get`, `has`, and `set`.
  26509. *
  26510. * @static
  26511. * @memberOf _
  26512. * @since 0.1.0
  26513. * @category Function
  26514. * @param {Function} func The function to have its output memoized.
  26515. * @param {Function} [resolver] The function to resolve the cache key.
  26516. * @returns {Function} Returns the new memoized function.
  26517. * @example
  26518. *
  26519. * var object = { 'a': 1, 'b': 2 };
  26520. * var other = { 'c': 3, 'd': 4 };
  26521. *
  26522. * var values = _.memoize(_.values);
  26523. * values(object);
  26524. * // => [1, 2]
  26525. *
  26526. * values(other);
  26527. * // => [3, 4]
  26528. *
  26529. * object.a = 2;
  26530. * values(object);
  26531. * // => [1, 2]
  26532. *
  26533. * // Modify the result cache.
  26534. * values.cache.set(object, ['a', 'b']);
  26535. * values(object);
  26536. * // => ['a', 'b']
  26537. *
  26538. * // Replace `_.memoize.Cache`.
  26539. * _.memoize.Cache = WeakMap;
  26540. */
  26541. function memoize(func, resolver) {
  26542. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26543. throw new TypeError(FUNC_ERROR_TEXT);
  26544. }
  26545. var memoized = function() {
  26546. var args = arguments,
  26547. key = resolver ? resolver.apply(this, args) : args[0],
  26548. cache = memoized.cache;
  26549. if (cache.has(key)) {
  26550. return cache.get(key);
  26551. }
  26552. var result = func.apply(this, args);
  26553. memoized.cache = cache.set(key, result);
  26554. return result;
  26555. };
  26556. memoized.cache = new (memoize.Cache || MapCache);
  26557. return memoized;
  26558. }
  26559. // Assign cache to `_.memoize`.
  26560. memoize.Cache = MapCache;
  26561. /**
  26562. * Performs a
  26563. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26564. * comparison between two values to determine if they are equivalent.
  26565. *
  26566. * @static
  26567. * @memberOf _
  26568. * @since 4.0.0
  26569. * @category Lang
  26570. * @param {*} value The value to compare.
  26571. * @param {*} other The other value to compare.
  26572. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26573. * @example
  26574. *
  26575. * var object = { 'a': 1 };
  26576. * var other = { 'a': 1 };
  26577. *
  26578. * _.eq(object, object);
  26579. * // => true
  26580. *
  26581. * _.eq(object, other);
  26582. * // => false
  26583. *
  26584. * _.eq('a', 'a');
  26585. * // => true
  26586. *
  26587. * _.eq('a', Object('a'));
  26588. * // => false
  26589. *
  26590. * _.eq(NaN, NaN);
  26591. * // => true
  26592. */
  26593. function eq(value, other) {
  26594. return value === other || (value !== value && other !== other);
  26595. }
  26596. /**
  26597. * Checks if `value` is classified as an `Array` object.
  26598. *
  26599. * @static
  26600. * @memberOf _
  26601. * @since 0.1.0
  26602. * @category Lang
  26603. * @param {*} value The value to check.
  26604. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26605. * @example
  26606. *
  26607. * _.isArray([1, 2, 3]);
  26608. * // => true
  26609. *
  26610. * _.isArray(document.body.children);
  26611. * // => false
  26612. *
  26613. * _.isArray('abc');
  26614. * // => false
  26615. *
  26616. * _.isArray(_.noop);
  26617. * // => false
  26618. */
  26619. var isArray = Array.isArray;
  26620. /**
  26621. * Checks if `value` is classified as a `Function` object.
  26622. *
  26623. * @static
  26624. * @memberOf _
  26625. * @since 0.1.0
  26626. * @category Lang
  26627. * @param {*} value The value to check.
  26628. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26629. * @example
  26630. *
  26631. * _.isFunction(_);
  26632. * // => true
  26633. *
  26634. * _.isFunction(/abc/);
  26635. * // => false
  26636. */
  26637. function isFunction(value) {
  26638. // The use of `Object#toString` avoids issues with the `typeof` operator
  26639. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26640. var tag = isObject(value) ? objectToString.call(value) : '';
  26641. return tag == funcTag || tag == genTag;
  26642. }
  26643. /**
  26644. * Checks if `value` is the
  26645. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26646. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26647. *
  26648. * @static
  26649. * @memberOf _
  26650. * @since 0.1.0
  26651. * @category Lang
  26652. * @param {*} value The value to check.
  26653. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26654. * @example
  26655. *
  26656. * _.isObject({});
  26657. * // => true
  26658. *
  26659. * _.isObject([1, 2, 3]);
  26660. * // => true
  26661. *
  26662. * _.isObject(_.noop);
  26663. * // => true
  26664. *
  26665. * _.isObject(null);
  26666. * // => false
  26667. */
  26668. function isObject(value) {
  26669. var type = typeof value;
  26670. return !!value && (type == 'object' || type == 'function');
  26671. }
  26672. /**
  26673. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26674. * and has a `typeof` result of "object".
  26675. *
  26676. * @static
  26677. * @memberOf _
  26678. * @since 4.0.0
  26679. * @category Lang
  26680. * @param {*} value The value to check.
  26681. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26682. * @example
  26683. *
  26684. * _.isObjectLike({});
  26685. * // => true
  26686. *
  26687. * _.isObjectLike([1, 2, 3]);
  26688. * // => true
  26689. *
  26690. * _.isObjectLike(_.noop);
  26691. * // => false
  26692. *
  26693. * _.isObjectLike(null);
  26694. * // => false
  26695. */
  26696. function isObjectLike(value) {
  26697. return !!value && typeof value == 'object';
  26698. }
  26699. /**
  26700. * Checks if `value` is classified as a `Symbol` primitive or object.
  26701. *
  26702. * @static
  26703. * @memberOf _
  26704. * @since 4.0.0
  26705. * @category Lang
  26706. * @param {*} value The value to check.
  26707. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26708. * @example
  26709. *
  26710. * _.isSymbol(Symbol.iterator);
  26711. * // => true
  26712. *
  26713. * _.isSymbol('abc');
  26714. * // => false
  26715. */
  26716. function isSymbol(value) {
  26717. return typeof value == 'symbol' ||
  26718. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26719. }
  26720. /**
  26721. * Converts `value` to a string. An empty string is returned for `null`
  26722. * and `undefined` values. The sign of `-0` is preserved.
  26723. *
  26724. * @static
  26725. * @memberOf _
  26726. * @since 4.0.0
  26727. * @category Lang
  26728. * @param {*} value The value to process.
  26729. * @returns {string} Returns the string.
  26730. * @example
  26731. *
  26732. * _.toString(null);
  26733. * // => ''
  26734. *
  26735. * _.toString(-0);
  26736. * // => '-0'
  26737. *
  26738. * _.toString([1, 2, 3]);
  26739. * // => '1,2,3'
  26740. */
  26741. function toString(value) {
  26742. return value == null ? '' : baseToString(value);
  26743. }
  26744. /**
  26745. * Gets the value at `path` of `object`. If the resolved value is
  26746. * `undefined`, the `defaultValue` is returned in its place.
  26747. *
  26748. * @static
  26749. * @memberOf _
  26750. * @since 3.7.0
  26751. * @category Object
  26752. * @param {Object} object The object to query.
  26753. * @param {Array|string} path The path of the property to get.
  26754. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26755. * @returns {*} Returns the resolved value.
  26756. * @example
  26757. *
  26758. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26759. *
  26760. * _.get(object, 'a[0].b.c');
  26761. * // => 3
  26762. *
  26763. * _.get(object, ['a', '0', 'b', 'c']);
  26764. * // => 3
  26765. *
  26766. * _.get(object, 'a.b.c', 'default');
  26767. * // => 'default'
  26768. */
  26769. function get(object, path, defaultValue) {
  26770. var result = object == null ? undefined : baseGet(object, path);
  26771. return result === undefined ? defaultValue : result;
  26772. }
  26773. module.exports = get;
  26774. /***/ }),
  26775. /***/ 855:
  26776. /***/ (function(module, __unusedexports, __webpack_require__) {
  26777. module.exports = registerPlugin;
  26778. const factory = __webpack_require__(47);
  26779. function registerPlugin(plugins, pluginFunction) {
  26780. return factory(
  26781. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26782. );
  26783. }
  26784. /***/ }),
  26785. /***/ 856:
  26786. /***/ (function(module, __unusedexports, __webpack_require__) {
  26787. module.exports = __webpack_require__(141);
  26788. /***/ }),
  26789. /***/ 863:
  26790. /***/ (function(module, __unusedexports, __webpack_require__) {
  26791. module.exports = authenticationBeforeRequest;
  26792. const btoa = __webpack_require__(675);
  26793. const withAuthorizationPrefix = __webpack_require__(143);
  26794. function authenticationBeforeRequest(state, options) {
  26795. if (typeof state.auth === "string") {
  26796. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26797. return;
  26798. }
  26799. if (state.auth.username) {
  26800. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26801. options.headers.authorization = `Basic ${hash}`;
  26802. if (state.otp) {
  26803. options.headers["x-github-otp"] = state.otp;
  26804. }
  26805. return;
  26806. }
  26807. if (state.auth.clientId) {
  26808. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26809. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26810. // URL though: `/applications/:client_id/tokens/:access_token`.
  26811. //
  26812. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26813. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26814. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26815. //
  26816. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26817. // as well as "/applications/123/tokens/token456"
  26818. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26819. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26820. options.headers.authorization = `Basic ${hash}`;
  26821. return;
  26822. }
  26823. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26824. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26825. return;
  26826. }
  26827. return Promise.resolve()
  26828. .then(() => {
  26829. return state.auth();
  26830. })
  26831. .then(authorization => {
  26832. options.headers.authorization = withAuthorizationPrefix(authorization);
  26833. });
  26834. }
  26835. /***/ }),
  26836. /***/ 866:
  26837. /***/ (function(module, __unusedexports, __webpack_require__) {
  26838. "use strict";
  26839. var shebangRegex = __webpack_require__(816);
  26840. module.exports = function (str) {
  26841. var match = str.match(shebangRegex);
  26842. if (!match) {
  26843. return null;
  26844. }
  26845. var arr = match[0].replace(/#! ?/, '').split(' ');
  26846. var bin = arr[0].split('/').pop();
  26847. var arg = arr[1];
  26848. return (bin === 'env' ?
  26849. arg :
  26850. bin + (arg ? ' ' + arg : '')
  26851. );
  26852. };
  26853. /***/ }),
  26854. /***/ 874:
  26855. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26856. "use strict";
  26857. // Copyright (c) Microsoft. All rights reserved.
  26858. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26859. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26860. return new (P || (P = Promise))(function (resolve, reject) {
  26861. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26862. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26863. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26864. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26865. });
  26866. };
  26867. Object.defineProperty(exports, "__esModule", { value: true });
  26868. const url = __webpack_require__(835);
  26869. const http = __webpack_require__(605);
  26870. const https = __webpack_require__(34);
  26871. let fs;
  26872. let tunnel;
  26873. var HttpCodes;
  26874. (function (HttpCodes) {
  26875. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26876. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26877. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26878. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26879. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26880. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26881. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26882. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26883. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26884. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26885. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26886. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26887. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26888. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26889. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26890. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26891. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26892. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26893. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26894. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26895. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26896. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26897. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26898. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26899. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26900. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26901. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26902. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26903. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26904. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26905. const ExponentialBackoffCeiling = 10;
  26906. const ExponentialBackoffTimeSlice = 5;
  26907. class HttpClientResponse {
  26908. constructor(message) {
  26909. this.message = message;
  26910. }
  26911. readBody() {
  26912. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26913. let output = '';
  26914. this.message.on('data', (chunk) => {
  26915. output += chunk;
  26916. });
  26917. this.message.on('end', () => {
  26918. resolve(output);
  26919. });
  26920. }));
  26921. }
  26922. }
  26923. exports.HttpClientResponse = HttpClientResponse;
  26924. function isHttps(requestUrl) {
  26925. let parsedUrl = url.parse(requestUrl);
  26926. return parsedUrl.protocol === 'https:';
  26927. }
  26928. exports.isHttps = isHttps;
  26929. var EnvironmentVariables;
  26930. (function (EnvironmentVariables) {
  26931. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26932. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26933. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26934. class HttpClient {
  26935. constructor(userAgent, handlers, requestOptions) {
  26936. this._ignoreSslError = false;
  26937. this._allowRedirects = true;
  26938. this._maxRedirects = 50;
  26939. this._allowRetries = false;
  26940. this._maxRetries = 1;
  26941. this._keepAlive = false;
  26942. this._disposed = false;
  26943. this.userAgent = userAgent;
  26944. this.handlers = handlers || [];
  26945. this.requestOptions = requestOptions;
  26946. if (requestOptions) {
  26947. if (requestOptions.ignoreSslError != null) {
  26948. this._ignoreSslError = requestOptions.ignoreSslError;
  26949. }
  26950. this._socketTimeout = requestOptions.socketTimeout;
  26951. this._httpProxy = requestOptions.proxy;
  26952. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26953. this._httpProxyBypassHosts = [];
  26954. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26955. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26956. });
  26957. }
  26958. this._certConfig = requestOptions.cert;
  26959. if (this._certConfig) {
  26960. // If using cert, need fs
  26961. fs = __webpack_require__(747);
  26962. // cache the cert content into memory, so we don't have to read it from disk every time
  26963. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26964. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26965. }
  26966. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26967. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26968. }
  26969. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26970. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26971. }
  26972. }
  26973. if (requestOptions.allowRedirects != null) {
  26974. this._allowRedirects = requestOptions.allowRedirects;
  26975. }
  26976. if (requestOptions.maxRedirects != null) {
  26977. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26978. }
  26979. if (requestOptions.keepAlive != null) {
  26980. this._keepAlive = requestOptions.keepAlive;
  26981. }
  26982. if (requestOptions.allowRetries != null) {
  26983. this._allowRetries = requestOptions.allowRetries;
  26984. }
  26985. if (requestOptions.maxRetries != null) {
  26986. this._maxRetries = requestOptions.maxRetries;
  26987. }
  26988. }
  26989. }
  26990. options(requestUrl, additionalHeaders) {
  26991. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26992. }
  26993. get(requestUrl, additionalHeaders) {
  26994. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26995. }
  26996. del(requestUrl, additionalHeaders) {
  26997. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26998. }
  26999. post(requestUrl, data, additionalHeaders) {
  27000. return this.request('POST', requestUrl, data, additionalHeaders || {});
  27001. }
  27002. patch(requestUrl, data, additionalHeaders) {
  27003. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  27004. }
  27005. put(requestUrl, data, additionalHeaders) {
  27006. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  27007. }
  27008. head(requestUrl, additionalHeaders) {
  27009. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  27010. }
  27011. sendStream(verb, requestUrl, stream, additionalHeaders) {
  27012. return this.request(verb, requestUrl, stream, additionalHeaders);
  27013. }
  27014. /**
  27015. * Makes a raw http request.
  27016. * All other methods such as get, post, patch, and request ultimately call this.
  27017. * Prefer get, del, post and patch
  27018. */
  27019. request(verb, requestUrl, data, headers) {
  27020. return __awaiter(this, void 0, void 0, function* () {
  27021. if (this._disposed) {
  27022. throw new Error("Client has already been disposed.");
  27023. }
  27024. let info = this._prepareRequest(verb, requestUrl, headers);
  27025. // Only perform retries on reads since writes may not be idempotent.
  27026. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  27027. let numTries = 0;
  27028. let response;
  27029. while (numTries < maxTries) {
  27030. response = yield this.requestRaw(info, data);
  27031. // Check if it's an authentication challenge
  27032. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  27033. let authenticationHandler;
  27034. for (let i = 0; i < this.handlers.length; i++) {
  27035. if (this.handlers[i].canHandleAuthentication(response)) {
  27036. authenticationHandler = this.handlers[i];
  27037. break;
  27038. }
  27039. }
  27040. if (authenticationHandler) {
  27041. return authenticationHandler.handleAuthentication(this, info, data);
  27042. }
  27043. else {
  27044. // We have received an unauthorized response but have no handlers to handle it.
  27045. // Let the response return to the caller.
  27046. return response;
  27047. }
  27048. }
  27049. let redirectsRemaining = this._maxRedirects;
  27050. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  27051. && this._allowRedirects
  27052. && redirectsRemaining > 0) {
  27053. const redirectUrl = response.message.headers["location"];
  27054. if (!redirectUrl) {
  27055. // if there's no location to redirect to, we won't
  27056. break;
  27057. }
  27058. // we need to finish reading the response before reassigning response
  27059. // which will leak the open socket.
  27060. yield response.readBody();
  27061. // let's make the request with the new redirectUrl
  27062. info = this._prepareRequest(verb, redirectUrl, headers);
  27063. response = yield this.requestRaw(info, data);
  27064. redirectsRemaining--;
  27065. }
  27066. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27067. // If not a retry code, return immediately instead of retrying
  27068. return response;
  27069. }
  27070. numTries += 1;
  27071. if (numTries < maxTries) {
  27072. yield response.readBody();
  27073. yield this._performExponentialBackoff(numTries);
  27074. }
  27075. }
  27076. return response;
  27077. });
  27078. }
  27079. /**
  27080. * Needs to be called if keepAlive is set to true in request options.
  27081. */
  27082. dispose() {
  27083. if (this._agent) {
  27084. this._agent.destroy();
  27085. }
  27086. this._disposed = true;
  27087. }
  27088. /**
  27089. * Raw request.
  27090. * @param info
  27091. * @param data
  27092. */
  27093. requestRaw(info, data) {
  27094. return new Promise((resolve, reject) => {
  27095. let callbackForResult = function (err, res) {
  27096. if (err) {
  27097. reject(err);
  27098. }
  27099. resolve(res);
  27100. };
  27101. this.requestRawWithCallback(info, data, callbackForResult);
  27102. });
  27103. }
  27104. /**
  27105. * Raw request with callback.
  27106. * @param info
  27107. * @param data
  27108. * @param onResult
  27109. */
  27110. requestRawWithCallback(info, data, onResult) {
  27111. let socket;
  27112. let isDataString = typeof (data) === 'string';
  27113. if (typeof (data) === 'string') {
  27114. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27115. }
  27116. let callbackCalled = false;
  27117. let handleResult = (err, res) => {
  27118. if (!callbackCalled) {
  27119. callbackCalled = true;
  27120. onResult(err, res);
  27121. }
  27122. };
  27123. let req = info.httpModule.request(info.options, (msg) => {
  27124. let res = new HttpClientResponse(msg);
  27125. handleResult(null, res);
  27126. });
  27127. req.on('socket', (sock) => {
  27128. socket = sock;
  27129. });
  27130. // If we ever get disconnected, we want the socket to timeout eventually
  27131. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27132. if (socket) {
  27133. socket.end();
  27134. }
  27135. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27136. });
  27137. req.on('error', function (err) {
  27138. // err has statusCode property
  27139. // res should have headers
  27140. handleResult(err, null);
  27141. });
  27142. if (data && typeof (data) === 'string') {
  27143. req.write(data, 'utf8');
  27144. }
  27145. if (data && typeof (data) !== 'string') {
  27146. data.on('close', function () {
  27147. req.end();
  27148. });
  27149. data.pipe(req);
  27150. }
  27151. else {
  27152. req.end();
  27153. }
  27154. }
  27155. _prepareRequest(method, requestUrl, headers) {
  27156. const info = {};
  27157. info.parsedUrl = url.parse(requestUrl);
  27158. const usingSsl = info.parsedUrl.protocol === 'https:';
  27159. info.httpModule = usingSsl ? https : http;
  27160. const defaultPort = usingSsl ? 443 : 80;
  27161. info.options = {};
  27162. info.options.host = info.parsedUrl.hostname;
  27163. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27164. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27165. info.options.method = method;
  27166. info.options.headers = this._mergeHeaders(headers);
  27167. info.options.headers["user-agent"] = this.userAgent;
  27168. info.options.agent = this._getAgent(requestUrl);
  27169. // gives handlers an opportunity to participate
  27170. if (this.handlers && !this._isPresigned(requestUrl)) {
  27171. this.handlers.forEach((handler) => {
  27172. handler.prepareRequest(info.options);
  27173. });
  27174. }
  27175. return info;
  27176. }
  27177. _isPresigned(requestUrl) {
  27178. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27179. const patterns = this.requestOptions.presignedUrlPatterns;
  27180. for (let i = 0; i < patterns.length; i++) {
  27181. if (requestUrl.match(patterns[i])) {
  27182. return true;
  27183. }
  27184. }
  27185. }
  27186. return false;
  27187. }
  27188. _mergeHeaders(headers) {
  27189. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27190. if (this.requestOptions && this.requestOptions.headers) {
  27191. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27192. }
  27193. return lowercaseKeys(headers || {});
  27194. }
  27195. _getAgent(requestUrl) {
  27196. let agent;
  27197. let proxy = this._getProxy(requestUrl);
  27198. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27199. if (this._keepAlive && useProxy) {
  27200. agent = this._proxyAgent;
  27201. }
  27202. if (this._keepAlive && !useProxy) {
  27203. agent = this._agent;
  27204. }
  27205. // if agent is already assigned use that agent.
  27206. if (!!agent) {
  27207. return agent;
  27208. }
  27209. let parsedUrl = url.parse(requestUrl);
  27210. const usingSsl = parsedUrl.protocol === 'https:';
  27211. let maxSockets = 100;
  27212. if (!!this.requestOptions) {
  27213. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27214. }
  27215. if (useProxy) {
  27216. // If using proxy, need tunnel
  27217. if (!tunnel) {
  27218. tunnel = __webpack_require__(856);
  27219. }
  27220. const agentOptions = {
  27221. maxSockets: maxSockets,
  27222. keepAlive: this._keepAlive,
  27223. proxy: {
  27224. proxyAuth: proxy.proxyAuth,
  27225. host: proxy.proxyUrl.hostname,
  27226. port: proxy.proxyUrl.port
  27227. },
  27228. };
  27229. let tunnelAgent;
  27230. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27231. if (usingSsl) {
  27232. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27233. }
  27234. else {
  27235. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27236. }
  27237. agent = tunnelAgent(agentOptions);
  27238. this._proxyAgent = agent;
  27239. }
  27240. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27241. if (this._keepAlive && !agent) {
  27242. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27243. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27244. this._agent = agent;
  27245. }
  27246. // if not using private agent and tunnel agent isn't setup then use global agent
  27247. if (!agent) {
  27248. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27249. }
  27250. if (usingSsl && this._ignoreSslError) {
  27251. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27252. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27253. // we have to cast it to any and change it directly
  27254. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27255. }
  27256. if (usingSsl && this._certConfig) {
  27257. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27258. }
  27259. return agent;
  27260. }
  27261. _getProxy(requestUrl) {
  27262. const parsedUrl = url.parse(requestUrl);
  27263. let usingSsl = parsedUrl.protocol === 'https:';
  27264. let proxyConfig = this._httpProxy;
  27265. // fallback to http_proxy and https_proxy env
  27266. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27267. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27268. if (!proxyConfig) {
  27269. if (https_proxy && usingSsl) {
  27270. proxyConfig = {
  27271. proxyUrl: https_proxy
  27272. };
  27273. }
  27274. else if (http_proxy) {
  27275. proxyConfig = {
  27276. proxyUrl: http_proxy
  27277. };
  27278. }
  27279. }
  27280. let proxyUrl;
  27281. let proxyAuth;
  27282. if (proxyConfig) {
  27283. if (proxyConfig.proxyUrl.length > 0) {
  27284. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27285. }
  27286. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27287. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27288. }
  27289. }
  27290. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27291. }
  27292. _isBypassProxy(requestUrl) {
  27293. if (!this._httpProxyBypassHosts) {
  27294. return false;
  27295. }
  27296. let bypass = false;
  27297. this._httpProxyBypassHosts.forEach(bypassHost => {
  27298. if (bypassHost.test(requestUrl)) {
  27299. bypass = true;
  27300. }
  27301. });
  27302. return bypass;
  27303. }
  27304. _performExponentialBackoff(retryNumber) {
  27305. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27306. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27307. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27308. }
  27309. }
  27310. exports.HttpClient = HttpClient;
  27311. /***/ }),
  27312. /***/ 881:
  27313. /***/ (function(module) {
  27314. "use strict";
  27315. const isWin = process.platform === 'win32';
  27316. function notFoundError(original, syscall) {
  27317. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27318. code: 'ENOENT',
  27319. errno: 'ENOENT',
  27320. syscall: `${syscall} ${original.command}`,
  27321. path: original.command,
  27322. spawnargs: original.args,
  27323. });
  27324. }
  27325. function hookChildProcess(cp, parsed) {
  27326. if (!isWin) {
  27327. return;
  27328. }
  27329. const originalEmit = cp.emit;
  27330. cp.emit = function (name, arg1) {
  27331. // If emitting "exit" event and exit code is 1, we need to check if
  27332. // the command exists and emit an "error" instead
  27333. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27334. if (name === 'exit') {
  27335. const err = verifyENOENT(arg1, parsed, 'spawn');
  27336. if (err) {
  27337. return originalEmit.call(cp, 'error', err);
  27338. }
  27339. }
  27340. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27341. };
  27342. }
  27343. function verifyENOENT(status, parsed) {
  27344. if (isWin && status === 1 && !parsed.file) {
  27345. return notFoundError(parsed.original, 'spawn');
  27346. }
  27347. return null;
  27348. }
  27349. function verifyENOENTSync(status, parsed) {
  27350. if (isWin && status === 1 && !parsed.file) {
  27351. return notFoundError(parsed.original, 'spawnSync');
  27352. }
  27353. return null;
  27354. }
  27355. module.exports = {
  27356. hookChildProcess,
  27357. verifyENOENT,
  27358. verifyENOENTSync,
  27359. notFoundError,
  27360. };
  27361. /***/ }),
  27362. /***/ 883:
  27363. /***/ (function(module) {
  27364. /**
  27365. * lodash (Custom Build) <https://lodash.com/>
  27366. * Build: `lodash modularize exports="npm" -o ./`
  27367. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27368. * Released under MIT license <https://lodash.com/license>
  27369. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27370. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27371. */
  27372. /** Used as the `TypeError` message for "Functions" methods. */
  27373. var FUNC_ERROR_TEXT = 'Expected a function';
  27374. /** Used to stand-in for `undefined` hash values. */
  27375. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27376. /** Used as references for various `Number` constants. */
  27377. var INFINITY = 1 / 0,
  27378. MAX_SAFE_INTEGER = 9007199254740991;
  27379. /** `Object#toString` result references. */
  27380. var funcTag = '[object Function]',
  27381. genTag = '[object GeneratorFunction]',
  27382. symbolTag = '[object Symbol]';
  27383. /** Used to match property names within property paths. */
  27384. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27385. reIsPlainProp = /^\w*$/,
  27386. reLeadingDot = /^\./,
  27387. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27388. /**
  27389. * Used to match `RegExp`
  27390. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27391. */
  27392. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27393. /** Used to match backslashes in property paths. */
  27394. var reEscapeChar = /\\(\\)?/g;
  27395. /** Used to detect host constructors (Safari). */
  27396. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27397. /** Used to detect unsigned integer values. */
  27398. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27399. /** Detect free variable `global` from Node.js. */
  27400. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27401. /** Detect free variable `self`. */
  27402. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27403. /** Used as a reference to the global object. */
  27404. var root = freeGlobal || freeSelf || Function('return this')();
  27405. /**
  27406. * Gets the value at `key` of `object`.
  27407. *
  27408. * @private
  27409. * @param {Object} [object] The object to query.
  27410. * @param {string} key The key of the property to get.
  27411. * @returns {*} Returns the property value.
  27412. */
  27413. function getValue(object, key) {
  27414. return object == null ? undefined : object[key];
  27415. }
  27416. /**
  27417. * Checks if `value` is a host object in IE < 9.
  27418. *
  27419. * @private
  27420. * @param {*} value The value to check.
  27421. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27422. */
  27423. function isHostObject(value) {
  27424. // Many host objects are `Object` objects that can coerce to strings
  27425. // despite having improperly defined `toString` methods.
  27426. var result = false;
  27427. if (value != null && typeof value.toString != 'function') {
  27428. try {
  27429. result = !!(value + '');
  27430. } catch (e) {}
  27431. }
  27432. return result;
  27433. }
  27434. /** Used for built-in method references. */
  27435. var arrayProto = Array.prototype,
  27436. funcProto = Function.prototype,
  27437. objectProto = Object.prototype;
  27438. /** Used to detect overreaching core-js shims. */
  27439. var coreJsData = root['__core-js_shared__'];
  27440. /** Used to detect methods masquerading as native. */
  27441. var maskSrcKey = (function() {
  27442. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27443. return uid ? ('Symbol(src)_1.' + uid) : '';
  27444. }());
  27445. /** Used to resolve the decompiled source of functions. */
  27446. var funcToString = funcProto.toString;
  27447. /** Used to check objects for own properties. */
  27448. var hasOwnProperty = objectProto.hasOwnProperty;
  27449. /**
  27450. * Used to resolve the
  27451. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27452. * of values.
  27453. */
  27454. var objectToString = objectProto.toString;
  27455. /** Used to detect if a method is native. */
  27456. var reIsNative = RegExp('^' +
  27457. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27458. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27459. );
  27460. /** Built-in value references. */
  27461. var Symbol = root.Symbol,
  27462. splice = arrayProto.splice;
  27463. /* Built-in method references that are verified to be native. */
  27464. var Map = getNative(root, 'Map'),
  27465. nativeCreate = getNative(Object, 'create');
  27466. /** Used to convert symbols to primitives and strings. */
  27467. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27468. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27469. /**
  27470. * Creates a hash object.
  27471. *
  27472. * @private
  27473. * @constructor
  27474. * @param {Array} [entries] The key-value pairs to cache.
  27475. */
  27476. function Hash(entries) {
  27477. var index = -1,
  27478. length = entries ? entries.length : 0;
  27479. this.clear();
  27480. while (++index < length) {
  27481. var entry = entries[index];
  27482. this.set(entry[0], entry[1]);
  27483. }
  27484. }
  27485. /**
  27486. * Removes all key-value entries from the hash.
  27487. *
  27488. * @private
  27489. * @name clear
  27490. * @memberOf Hash
  27491. */
  27492. function hashClear() {
  27493. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27494. }
  27495. /**
  27496. * Removes `key` and its value from the hash.
  27497. *
  27498. * @private
  27499. * @name delete
  27500. * @memberOf Hash
  27501. * @param {Object} hash The hash to modify.
  27502. * @param {string} key The key of the value to remove.
  27503. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27504. */
  27505. function hashDelete(key) {
  27506. return this.has(key) && delete this.__data__[key];
  27507. }
  27508. /**
  27509. * Gets the hash value for `key`.
  27510. *
  27511. * @private
  27512. * @name get
  27513. * @memberOf Hash
  27514. * @param {string} key The key of the value to get.
  27515. * @returns {*} Returns the entry value.
  27516. */
  27517. function hashGet(key) {
  27518. var data = this.__data__;
  27519. if (nativeCreate) {
  27520. var result = data[key];
  27521. return result === HASH_UNDEFINED ? undefined : result;
  27522. }
  27523. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27524. }
  27525. /**
  27526. * Checks if a hash value for `key` exists.
  27527. *
  27528. * @private
  27529. * @name has
  27530. * @memberOf Hash
  27531. * @param {string} key The key of the entry to check.
  27532. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27533. */
  27534. function hashHas(key) {
  27535. var data = this.__data__;
  27536. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27537. }
  27538. /**
  27539. * Sets the hash `key` to `value`.
  27540. *
  27541. * @private
  27542. * @name set
  27543. * @memberOf Hash
  27544. * @param {string} key The key of the value to set.
  27545. * @param {*} value The value to set.
  27546. * @returns {Object} Returns the hash instance.
  27547. */
  27548. function hashSet(key, value) {
  27549. var data = this.__data__;
  27550. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27551. return this;
  27552. }
  27553. // Add methods to `Hash`.
  27554. Hash.prototype.clear = hashClear;
  27555. Hash.prototype['delete'] = hashDelete;
  27556. Hash.prototype.get = hashGet;
  27557. Hash.prototype.has = hashHas;
  27558. Hash.prototype.set = hashSet;
  27559. /**
  27560. * Creates an list cache object.
  27561. *
  27562. * @private
  27563. * @constructor
  27564. * @param {Array} [entries] The key-value pairs to cache.
  27565. */
  27566. function ListCache(entries) {
  27567. var index = -1,
  27568. length = entries ? entries.length : 0;
  27569. this.clear();
  27570. while (++index < length) {
  27571. var entry = entries[index];
  27572. this.set(entry[0], entry[1]);
  27573. }
  27574. }
  27575. /**
  27576. * Removes all key-value entries from the list cache.
  27577. *
  27578. * @private
  27579. * @name clear
  27580. * @memberOf ListCache
  27581. */
  27582. function listCacheClear() {
  27583. this.__data__ = [];
  27584. }
  27585. /**
  27586. * Removes `key` and its value from the list cache.
  27587. *
  27588. * @private
  27589. * @name delete
  27590. * @memberOf ListCache
  27591. * @param {string} key The key of the value to remove.
  27592. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27593. */
  27594. function listCacheDelete(key) {
  27595. var data = this.__data__,
  27596. index = assocIndexOf(data, key);
  27597. if (index < 0) {
  27598. return false;
  27599. }
  27600. var lastIndex = data.length - 1;
  27601. if (index == lastIndex) {
  27602. data.pop();
  27603. } else {
  27604. splice.call(data, index, 1);
  27605. }
  27606. return true;
  27607. }
  27608. /**
  27609. * Gets the list cache value for `key`.
  27610. *
  27611. * @private
  27612. * @name get
  27613. * @memberOf ListCache
  27614. * @param {string} key The key of the value to get.
  27615. * @returns {*} Returns the entry value.
  27616. */
  27617. function listCacheGet(key) {
  27618. var data = this.__data__,
  27619. index = assocIndexOf(data, key);
  27620. return index < 0 ? undefined : data[index][1];
  27621. }
  27622. /**
  27623. * Checks if a list cache value for `key` exists.
  27624. *
  27625. * @private
  27626. * @name has
  27627. * @memberOf ListCache
  27628. * @param {string} key The key of the entry to check.
  27629. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27630. */
  27631. function listCacheHas(key) {
  27632. return assocIndexOf(this.__data__, key) > -1;
  27633. }
  27634. /**
  27635. * Sets the list cache `key` to `value`.
  27636. *
  27637. * @private
  27638. * @name set
  27639. * @memberOf ListCache
  27640. * @param {string} key The key of the value to set.
  27641. * @param {*} value The value to set.
  27642. * @returns {Object} Returns the list cache instance.
  27643. */
  27644. function listCacheSet(key, value) {
  27645. var data = this.__data__,
  27646. index = assocIndexOf(data, key);
  27647. if (index < 0) {
  27648. data.push([key, value]);
  27649. } else {
  27650. data[index][1] = value;
  27651. }
  27652. return this;
  27653. }
  27654. // Add methods to `ListCache`.
  27655. ListCache.prototype.clear = listCacheClear;
  27656. ListCache.prototype['delete'] = listCacheDelete;
  27657. ListCache.prototype.get = listCacheGet;
  27658. ListCache.prototype.has = listCacheHas;
  27659. ListCache.prototype.set = listCacheSet;
  27660. /**
  27661. * Creates a map cache object to store key-value pairs.
  27662. *
  27663. * @private
  27664. * @constructor
  27665. * @param {Array} [entries] The key-value pairs to cache.
  27666. */
  27667. function MapCache(entries) {
  27668. var index = -1,
  27669. length = entries ? entries.length : 0;
  27670. this.clear();
  27671. while (++index < length) {
  27672. var entry = entries[index];
  27673. this.set(entry[0], entry[1]);
  27674. }
  27675. }
  27676. /**
  27677. * Removes all key-value entries from the map.
  27678. *
  27679. * @private
  27680. * @name clear
  27681. * @memberOf MapCache
  27682. */
  27683. function mapCacheClear() {
  27684. this.__data__ = {
  27685. 'hash': new Hash,
  27686. 'map': new (Map || ListCache),
  27687. 'string': new Hash
  27688. };
  27689. }
  27690. /**
  27691. * Removes `key` and its value from the map.
  27692. *
  27693. * @private
  27694. * @name delete
  27695. * @memberOf MapCache
  27696. * @param {string} key The key of the value to remove.
  27697. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27698. */
  27699. function mapCacheDelete(key) {
  27700. return getMapData(this, key)['delete'](key);
  27701. }
  27702. /**
  27703. * Gets the map value for `key`.
  27704. *
  27705. * @private
  27706. * @name get
  27707. * @memberOf MapCache
  27708. * @param {string} key The key of the value to get.
  27709. * @returns {*} Returns the entry value.
  27710. */
  27711. function mapCacheGet(key) {
  27712. return getMapData(this, key).get(key);
  27713. }
  27714. /**
  27715. * Checks if a map value for `key` exists.
  27716. *
  27717. * @private
  27718. * @name has
  27719. * @memberOf MapCache
  27720. * @param {string} key The key of the entry to check.
  27721. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27722. */
  27723. function mapCacheHas(key) {
  27724. return getMapData(this, key).has(key);
  27725. }
  27726. /**
  27727. * Sets the map `key` to `value`.
  27728. *
  27729. * @private
  27730. * @name set
  27731. * @memberOf MapCache
  27732. * @param {string} key The key of the value to set.
  27733. * @param {*} value The value to set.
  27734. * @returns {Object} Returns the map cache instance.
  27735. */
  27736. function mapCacheSet(key, value) {
  27737. getMapData(this, key).set(key, value);
  27738. return this;
  27739. }
  27740. // Add methods to `MapCache`.
  27741. MapCache.prototype.clear = mapCacheClear;
  27742. MapCache.prototype['delete'] = mapCacheDelete;
  27743. MapCache.prototype.get = mapCacheGet;
  27744. MapCache.prototype.has = mapCacheHas;
  27745. MapCache.prototype.set = mapCacheSet;
  27746. /**
  27747. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27748. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27749. * for equality comparisons.
  27750. *
  27751. * @private
  27752. * @param {Object} object The object to modify.
  27753. * @param {string} key The key of the property to assign.
  27754. * @param {*} value The value to assign.
  27755. */
  27756. function assignValue(object, key, value) {
  27757. var objValue = object[key];
  27758. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27759. (value === undefined && !(key in object))) {
  27760. object[key] = value;
  27761. }
  27762. }
  27763. /**
  27764. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27765. *
  27766. * @private
  27767. * @param {Array} array The array to inspect.
  27768. * @param {*} key The key to search for.
  27769. * @returns {number} Returns the index of the matched value, else `-1`.
  27770. */
  27771. function assocIndexOf(array, key) {
  27772. var length = array.length;
  27773. while (length--) {
  27774. if (eq(array[length][0], key)) {
  27775. return length;
  27776. }
  27777. }
  27778. return -1;
  27779. }
  27780. /**
  27781. * The base implementation of `_.isNative` without bad shim checks.
  27782. *
  27783. * @private
  27784. * @param {*} value The value to check.
  27785. * @returns {boolean} Returns `true` if `value` is a native function,
  27786. * else `false`.
  27787. */
  27788. function baseIsNative(value) {
  27789. if (!isObject(value) || isMasked(value)) {
  27790. return false;
  27791. }
  27792. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27793. return pattern.test(toSource(value));
  27794. }
  27795. /**
  27796. * The base implementation of `_.set`.
  27797. *
  27798. * @private
  27799. * @param {Object} object The object to modify.
  27800. * @param {Array|string} path The path of the property to set.
  27801. * @param {*} value The value to set.
  27802. * @param {Function} [customizer] The function to customize path creation.
  27803. * @returns {Object} Returns `object`.
  27804. */
  27805. function baseSet(object, path, value, customizer) {
  27806. if (!isObject(object)) {
  27807. return object;
  27808. }
  27809. path = isKey(path, object) ? [path] : castPath(path);
  27810. var index = -1,
  27811. length = path.length,
  27812. lastIndex = length - 1,
  27813. nested = object;
  27814. while (nested != null && ++index < length) {
  27815. var key = toKey(path[index]),
  27816. newValue = value;
  27817. if (index != lastIndex) {
  27818. var objValue = nested[key];
  27819. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27820. if (newValue === undefined) {
  27821. newValue = isObject(objValue)
  27822. ? objValue
  27823. : (isIndex(path[index + 1]) ? [] : {});
  27824. }
  27825. }
  27826. assignValue(nested, key, newValue);
  27827. nested = nested[key];
  27828. }
  27829. return object;
  27830. }
  27831. /**
  27832. * The base implementation of `_.toString` which doesn't convert nullish
  27833. * values to empty strings.
  27834. *
  27835. * @private
  27836. * @param {*} value The value to process.
  27837. * @returns {string} Returns the string.
  27838. */
  27839. function baseToString(value) {
  27840. // Exit early for strings to avoid a performance hit in some environments.
  27841. if (typeof value == 'string') {
  27842. return value;
  27843. }
  27844. if (isSymbol(value)) {
  27845. return symbolToString ? symbolToString.call(value) : '';
  27846. }
  27847. var result = (value + '');
  27848. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27849. }
  27850. /**
  27851. * Casts `value` to a path array if it's not one.
  27852. *
  27853. * @private
  27854. * @param {*} value The value to inspect.
  27855. * @returns {Array} Returns the cast property path array.
  27856. */
  27857. function castPath(value) {
  27858. return isArray(value) ? value : stringToPath(value);
  27859. }
  27860. /**
  27861. * Gets the data for `map`.
  27862. *
  27863. * @private
  27864. * @param {Object} map The map to query.
  27865. * @param {string} key The reference key.
  27866. * @returns {*} Returns the map data.
  27867. */
  27868. function getMapData(map, key) {
  27869. var data = map.__data__;
  27870. return isKeyable(key)
  27871. ? data[typeof key == 'string' ? 'string' : 'hash']
  27872. : data.map;
  27873. }
  27874. /**
  27875. * Gets the native function at `key` of `object`.
  27876. *
  27877. * @private
  27878. * @param {Object} object The object to query.
  27879. * @param {string} key The key of the method to get.
  27880. * @returns {*} Returns the function if it's native, else `undefined`.
  27881. */
  27882. function getNative(object, key) {
  27883. var value = getValue(object, key);
  27884. return baseIsNative(value) ? value : undefined;
  27885. }
  27886. /**
  27887. * Checks if `value` is a valid array-like index.
  27888. *
  27889. * @private
  27890. * @param {*} value The value to check.
  27891. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27892. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27893. */
  27894. function isIndex(value, length) {
  27895. length = length == null ? MAX_SAFE_INTEGER : length;
  27896. return !!length &&
  27897. (typeof value == 'number' || reIsUint.test(value)) &&
  27898. (value > -1 && value % 1 == 0 && value < length);
  27899. }
  27900. /**
  27901. * Checks if `value` is a property name and not a property path.
  27902. *
  27903. * @private
  27904. * @param {*} value The value to check.
  27905. * @param {Object} [object] The object to query keys on.
  27906. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27907. */
  27908. function isKey(value, object) {
  27909. if (isArray(value)) {
  27910. return false;
  27911. }
  27912. var type = typeof value;
  27913. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27914. value == null || isSymbol(value)) {
  27915. return true;
  27916. }
  27917. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27918. (object != null && value in Object(object));
  27919. }
  27920. /**
  27921. * Checks if `value` is suitable for use as unique object key.
  27922. *
  27923. * @private
  27924. * @param {*} value The value to check.
  27925. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27926. */
  27927. function isKeyable(value) {
  27928. var type = typeof value;
  27929. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27930. ? (value !== '__proto__')
  27931. : (value === null);
  27932. }
  27933. /**
  27934. * Checks if `func` has its source masked.
  27935. *
  27936. * @private
  27937. * @param {Function} func The function to check.
  27938. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27939. */
  27940. function isMasked(func) {
  27941. return !!maskSrcKey && (maskSrcKey in func);
  27942. }
  27943. /**
  27944. * Converts `string` to a property path array.
  27945. *
  27946. * @private
  27947. * @param {string} string The string to convert.
  27948. * @returns {Array} Returns the property path array.
  27949. */
  27950. var stringToPath = memoize(function(string) {
  27951. string = toString(string);
  27952. var result = [];
  27953. if (reLeadingDot.test(string)) {
  27954. result.push('');
  27955. }
  27956. string.replace(rePropName, function(match, number, quote, string) {
  27957. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27958. });
  27959. return result;
  27960. });
  27961. /**
  27962. * Converts `value` to a string key if it's not a string or symbol.
  27963. *
  27964. * @private
  27965. * @param {*} value The value to inspect.
  27966. * @returns {string|symbol} Returns the key.
  27967. */
  27968. function toKey(value) {
  27969. if (typeof value == 'string' || isSymbol(value)) {
  27970. return value;
  27971. }
  27972. var result = (value + '');
  27973. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27974. }
  27975. /**
  27976. * Converts `func` to its source code.
  27977. *
  27978. * @private
  27979. * @param {Function} func The function to process.
  27980. * @returns {string} Returns the source code.
  27981. */
  27982. function toSource(func) {
  27983. if (func != null) {
  27984. try {
  27985. return funcToString.call(func);
  27986. } catch (e) {}
  27987. try {
  27988. return (func + '');
  27989. } catch (e) {}
  27990. }
  27991. return '';
  27992. }
  27993. /**
  27994. * Creates a function that memoizes the result of `func`. If `resolver` is
  27995. * provided, it determines the cache key for storing the result based on the
  27996. * arguments provided to the memoized function. By default, the first argument
  27997. * provided to the memoized function is used as the map cache key. The `func`
  27998. * is invoked with the `this` binding of the memoized function.
  27999. *
  28000. * **Note:** The cache is exposed as the `cache` property on the memoized
  28001. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28002. * constructor with one whose instances implement the
  28003. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28004. * method interface of `delete`, `get`, `has`, and `set`.
  28005. *
  28006. * @static
  28007. * @memberOf _
  28008. * @since 0.1.0
  28009. * @category Function
  28010. * @param {Function} func The function to have its output memoized.
  28011. * @param {Function} [resolver] The function to resolve the cache key.
  28012. * @returns {Function} Returns the new memoized function.
  28013. * @example
  28014. *
  28015. * var object = { 'a': 1, 'b': 2 };
  28016. * var other = { 'c': 3, 'd': 4 };
  28017. *
  28018. * var values = _.memoize(_.values);
  28019. * values(object);
  28020. * // => [1, 2]
  28021. *
  28022. * values(other);
  28023. * // => [3, 4]
  28024. *
  28025. * object.a = 2;
  28026. * values(object);
  28027. * // => [1, 2]
  28028. *
  28029. * // Modify the result cache.
  28030. * values.cache.set(object, ['a', 'b']);
  28031. * values(object);
  28032. * // => ['a', 'b']
  28033. *
  28034. * // Replace `_.memoize.Cache`.
  28035. * _.memoize.Cache = WeakMap;
  28036. */
  28037. function memoize(func, resolver) {
  28038. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28039. throw new TypeError(FUNC_ERROR_TEXT);
  28040. }
  28041. var memoized = function() {
  28042. var args = arguments,
  28043. key = resolver ? resolver.apply(this, args) : args[0],
  28044. cache = memoized.cache;
  28045. if (cache.has(key)) {
  28046. return cache.get(key);
  28047. }
  28048. var result = func.apply(this, args);
  28049. memoized.cache = cache.set(key, result);
  28050. return result;
  28051. };
  28052. memoized.cache = new (memoize.Cache || MapCache);
  28053. return memoized;
  28054. }
  28055. // Assign cache to `_.memoize`.
  28056. memoize.Cache = MapCache;
  28057. /**
  28058. * Performs a
  28059. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28060. * comparison between two values to determine if they are equivalent.
  28061. *
  28062. * @static
  28063. * @memberOf _
  28064. * @since 4.0.0
  28065. * @category Lang
  28066. * @param {*} value The value to compare.
  28067. * @param {*} other The other value to compare.
  28068. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28069. * @example
  28070. *
  28071. * var object = { 'a': 1 };
  28072. * var other = { 'a': 1 };
  28073. *
  28074. * _.eq(object, object);
  28075. * // => true
  28076. *
  28077. * _.eq(object, other);
  28078. * // => false
  28079. *
  28080. * _.eq('a', 'a');
  28081. * // => true
  28082. *
  28083. * _.eq('a', Object('a'));
  28084. * // => false
  28085. *
  28086. * _.eq(NaN, NaN);
  28087. * // => true
  28088. */
  28089. function eq(value, other) {
  28090. return value === other || (value !== value && other !== other);
  28091. }
  28092. /**
  28093. * Checks if `value` is classified as an `Array` object.
  28094. *
  28095. * @static
  28096. * @memberOf _
  28097. * @since 0.1.0
  28098. * @category Lang
  28099. * @param {*} value The value to check.
  28100. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28101. * @example
  28102. *
  28103. * _.isArray([1, 2, 3]);
  28104. * // => true
  28105. *
  28106. * _.isArray(document.body.children);
  28107. * // => false
  28108. *
  28109. * _.isArray('abc');
  28110. * // => false
  28111. *
  28112. * _.isArray(_.noop);
  28113. * // => false
  28114. */
  28115. var isArray = Array.isArray;
  28116. /**
  28117. * Checks if `value` is classified as a `Function` object.
  28118. *
  28119. * @static
  28120. * @memberOf _
  28121. * @since 0.1.0
  28122. * @category Lang
  28123. * @param {*} value The value to check.
  28124. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28125. * @example
  28126. *
  28127. * _.isFunction(_);
  28128. * // => true
  28129. *
  28130. * _.isFunction(/abc/);
  28131. * // => false
  28132. */
  28133. function isFunction(value) {
  28134. // The use of `Object#toString` avoids issues with the `typeof` operator
  28135. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28136. var tag = isObject(value) ? objectToString.call(value) : '';
  28137. return tag == funcTag || tag == genTag;
  28138. }
  28139. /**
  28140. * Checks if `value` is the
  28141. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28142. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28143. *
  28144. * @static
  28145. * @memberOf _
  28146. * @since 0.1.0
  28147. * @category Lang
  28148. * @param {*} value The value to check.
  28149. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28150. * @example
  28151. *
  28152. * _.isObject({});
  28153. * // => true
  28154. *
  28155. * _.isObject([1, 2, 3]);
  28156. * // => true
  28157. *
  28158. * _.isObject(_.noop);
  28159. * // => true
  28160. *
  28161. * _.isObject(null);
  28162. * // => false
  28163. */
  28164. function isObject(value) {
  28165. var type = typeof value;
  28166. return !!value && (type == 'object' || type == 'function');
  28167. }
  28168. /**
  28169. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28170. * and has a `typeof` result of "object".
  28171. *
  28172. * @static
  28173. * @memberOf _
  28174. * @since 4.0.0
  28175. * @category Lang
  28176. * @param {*} value The value to check.
  28177. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28178. * @example
  28179. *
  28180. * _.isObjectLike({});
  28181. * // => true
  28182. *
  28183. * _.isObjectLike([1, 2, 3]);
  28184. * // => true
  28185. *
  28186. * _.isObjectLike(_.noop);
  28187. * // => false
  28188. *
  28189. * _.isObjectLike(null);
  28190. * // => false
  28191. */
  28192. function isObjectLike(value) {
  28193. return !!value && typeof value == 'object';
  28194. }
  28195. /**
  28196. * Checks if `value` is classified as a `Symbol` primitive or object.
  28197. *
  28198. * @static
  28199. * @memberOf _
  28200. * @since 4.0.0
  28201. * @category Lang
  28202. * @param {*} value The value to check.
  28203. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28204. * @example
  28205. *
  28206. * _.isSymbol(Symbol.iterator);
  28207. * // => true
  28208. *
  28209. * _.isSymbol('abc');
  28210. * // => false
  28211. */
  28212. function isSymbol(value) {
  28213. return typeof value == 'symbol' ||
  28214. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28215. }
  28216. /**
  28217. * Converts `value` to a string. An empty string is returned for `null`
  28218. * and `undefined` values. The sign of `-0` is preserved.
  28219. *
  28220. * @static
  28221. * @memberOf _
  28222. * @since 4.0.0
  28223. * @category Lang
  28224. * @param {*} value The value to process.
  28225. * @returns {string} Returns the string.
  28226. * @example
  28227. *
  28228. * _.toString(null);
  28229. * // => ''
  28230. *
  28231. * _.toString(-0);
  28232. * // => '-0'
  28233. *
  28234. * _.toString([1, 2, 3]);
  28235. * // => '1,2,3'
  28236. */
  28237. function toString(value) {
  28238. return value == null ? '' : baseToString(value);
  28239. }
  28240. /**
  28241. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28242. * it's created. Arrays are created for missing index properties while objects
  28243. * are created for all other missing properties. Use `_.setWith` to customize
  28244. * `path` creation.
  28245. *
  28246. * **Note:** This method mutates `object`.
  28247. *
  28248. * @static
  28249. * @memberOf _
  28250. * @since 3.7.0
  28251. * @category Object
  28252. * @param {Object} object The object to modify.
  28253. * @param {Array|string} path The path of the property to set.
  28254. * @param {*} value The value to set.
  28255. * @returns {Object} Returns `object`.
  28256. * @example
  28257. *
  28258. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28259. *
  28260. * _.set(object, 'a[0].b.c', 4);
  28261. * console.log(object.a[0].b.c);
  28262. * // => 4
  28263. *
  28264. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28265. * console.log(object.x[0].y.z);
  28266. * // => 5
  28267. */
  28268. function set(object, path, value) {
  28269. return object == null ? object : baseSet(object, path, value);
  28270. }
  28271. module.exports = set;
  28272. /***/ }),
  28273. /***/ 898:
  28274. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28275. "use strict";
  28276. Object.defineProperty(exports, '__esModule', { value: true });
  28277. var request = __webpack_require__(753);
  28278. var universalUserAgent = __webpack_require__(796);
  28279. const VERSION = "4.3.1";
  28280. class GraphqlError extends Error {
  28281. constructor(request, response) {
  28282. const message = response.data.errors[0].message;
  28283. super(message);
  28284. Object.assign(this, response.data);
  28285. this.name = "GraphqlError";
  28286. this.request = request; // Maintains proper stack trace (only available on V8)
  28287. /* istanbul ignore next */
  28288. if (Error.captureStackTrace) {
  28289. Error.captureStackTrace(this, this.constructor);
  28290. }
  28291. }
  28292. }
  28293. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28294. function graphql(request, query, options) {
  28295. options = typeof query === "string" ? options = Object.assign({
  28296. query
  28297. }, options) : options = query;
  28298. const requestOptions = Object.keys(options).reduce((result, key) => {
  28299. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28300. result[key] = options[key];
  28301. return result;
  28302. }
  28303. if (!result.variables) {
  28304. result.variables = {};
  28305. }
  28306. result.variables[key] = options[key];
  28307. return result;
  28308. }, {});
  28309. return request(requestOptions).then(response => {
  28310. if (response.data.errors) {
  28311. throw new GraphqlError(requestOptions, {
  28312. data: response.data
  28313. });
  28314. }
  28315. return response.data.data;
  28316. });
  28317. }
  28318. function withDefaults(request$1, newDefaults) {
  28319. const newRequest = request$1.defaults(newDefaults);
  28320. const newApi = (query, options) => {
  28321. return graphql(newRequest, query, options);
  28322. };
  28323. return Object.assign(newApi, {
  28324. defaults: withDefaults.bind(null, newRequest),
  28325. endpoint: request.request.endpoint
  28326. });
  28327. }
  28328. const graphql$1 = withDefaults(request.request, {
  28329. headers: {
  28330. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28331. },
  28332. method: "POST",
  28333. url: "/graphql"
  28334. });
  28335. function withCustomRequest(customRequest) {
  28336. return withDefaults(customRequest, {
  28337. method: "POST",
  28338. url: "/graphql"
  28339. });
  28340. }
  28341. exports.graphql = graphql$1;
  28342. exports.withCustomRequest = withCustomRequest;
  28343. //# sourceMappingURL=index.js.map
  28344. /***/ }),
  28345. /***/ 916:
  28346. /***/ (function(__unusedmodule, exports) {
  28347. "use strict";
  28348. Object.defineProperty(exports, '__esModule', { value: true });
  28349. const VERSION = "1.0.0";
  28350. /**
  28351. * @param octokit Octokit instance
  28352. * @param options Options passed to Octokit constructor
  28353. */
  28354. function requestLog(octokit) {
  28355. octokit.hook.wrap("request", (request, options) => {
  28356. octokit.log.debug("request", options);
  28357. const start = Date.now();
  28358. const requestOptions = octokit.request.endpoint.parse(options);
  28359. const path = requestOptions.url.replace(options.baseUrl, "");
  28360. return request(options).then(response => {
  28361. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28362. return response;
  28363. }).catch(error => {
  28364. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28365. throw error;
  28366. });
  28367. });
  28368. }
  28369. requestLog.VERSION = VERSION;
  28370. exports.requestLog = requestLog;
  28371. //# sourceMappingURL=index.js.map
  28372. /***/ }),
  28373. /***/ 929:
  28374. /***/ (function(module, __unusedexports, __webpack_require__) {
  28375. module.exports = hasNextPage
  28376. const deprecate = __webpack_require__(370)
  28377. const getPageLinks = __webpack_require__(577)
  28378. function hasNextPage (link) {
  28379. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28380. return getPageLinks(link).next
  28381. }
  28382. /***/ }),
  28383. /***/ 948:
  28384. /***/ (function(module) {
  28385. "use strict";
  28386. /**
  28387. * Tries to execute a function and discards any error that occurs.
  28388. * @param {Function} fn - Function that might or might not throw an error.
  28389. * @returns {?*} Return-value of the function when no error occurred.
  28390. */
  28391. module.exports = function(fn) {
  28392. try { return fn() } catch (e) {}
  28393. }
  28394. /***/ }),
  28395. /***/ 950:
  28396. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28397. "use strict";
  28398. Object.defineProperty(exports, "__esModule", { value: true });
  28399. const url = __webpack_require__(835);
  28400. function getProxyUrl(reqUrl) {
  28401. let usingSsl = reqUrl.protocol === 'https:';
  28402. let proxyUrl;
  28403. if (checkBypass(reqUrl)) {
  28404. return proxyUrl;
  28405. }
  28406. let proxyVar;
  28407. if (usingSsl) {
  28408. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28409. }
  28410. else {
  28411. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28412. }
  28413. if (proxyVar) {
  28414. proxyUrl = url.parse(proxyVar);
  28415. }
  28416. return proxyUrl;
  28417. }
  28418. exports.getProxyUrl = getProxyUrl;
  28419. function checkBypass(reqUrl) {
  28420. if (!reqUrl.hostname) {
  28421. return false;
  28422. }
  28423. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28424. if (!noProxy) {
  28425. return false;
  28426. }
  28427. // Determine the request port
  28428. let reqPort;
  28429. if (reqUrl.port) {
  28430. reqPort = Number(reqUrl.port);
  28431. }
  28432. else if (reqUrl.protocol === 'http:') {
  28433. reqPort = 80;
  28434. }
  28435. else if (reqUrl.protocol === 'https:') {
  28436. reqPort = 443;
  28437. }
  28438. // Format the request hostname and hostname with port
  28439. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28440. if (typeof reqPort === 'number') {
  28441. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28442. }
  28443. // Compare request host against noproxy
  28444. for (let upperNoProxyItem of noProxy
  28445. .split(',')
  28446. .map(x => x.trim().toUpperCase())
  28447. .filter(x => x)) {
  28448. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28449. return true;
  28450. }
  28451. }
  28452. return false;
  28453. }
  28454. exports.checkBypass = checkBypass;
  28455. /***/ }),
  28456. /***/ 954:
  28457. /***/ (function(module) {
  28458. module.exports = validateAuth;
  28459. function validateAuth(auth) {
  28460. if (typeof auth === "string") {
  28461. return;
  28462. }
  28463. if (typeof auth === "function") {
  28464. return;
  28465. }
  28466. if (auth.username && auth.password) {
  28467. return;
  28468. }
  28469. if (auth.clientId && auth.clientSecret) {
  28470. return;
  28471. }
  28472. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28473. }
  28474. /***/ }),
  28475. /***/ 955:
  28476. /***/ (function(module, __unusedexports, __webpack_require__) {
  28477. "use strict";
  28478. const path = __webpack_require__(622);
  28479. const childProcess = __webpack_require__(129);
  28480. const crossSpawn = __webpack_require__(20);
  28481. const stripEof = __webpack_require__(768);
  28482. const npmRunPath = __webpack_require__(621);
  28483. const isStream = __webpack_require__(323);
  28484. const _getStream = __webpack_require__(145);
  28485. const pFinally = __webpack_require__(697);
  28486. const onExit = __webpack_require__(260);
  28487. const errname = __webpack_require__(427);
  28488. const stdio = __webpack_require__(168);
  28489. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28490. function handleArgs(cmd, args, opts) {
  28491. let parsed;
  28492. opts = Object.assign({
  28493. extendEnv: true,
  28494. env: {}
  28495. }, opts);
  28496. if (opts.extendEnv) {
  28497. opts.env = Object.assign({}, process.env, opts.env);
  28498. }
  28499. if (opts.__winShell === true) {
  28500. delete opts.__winShell;
  28501. parsed = {
  28502. command: cmd,
  28503. args,
  28504. options: opts,
  28505. file: cmd,
  28506. original: {
  28507. cmd,
  28508. args
  28509. }
  28510. };
  28511. } else {
  28512. parsed = crossSpawn._parse(cmd, args, opts);
  28513. }
  28514. opts = Object.assign({
  28515. maxBuffer: TEN_MEGABYTES,
  28516. buffer: true,
  28517. stripEof: true,
  28518. preferLocal: true,
  28519. localDir: parsed.options.cwd || process.cwd(),
  28520. encoding: 'utf8',
  28521. reject: true,
  28522. cleanup: true
  28523. }, parsed.options);
  28524. opts.stdio = stdio(opts);
  28525. if (opts.preferLocal) {
  28526. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28527. }
  28528. if (opts.detached) {
  28529. // #115
  28530. opts.cleanup = false;
  28531. }
  28532. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28533. // #116
  28534. parsed.args.unshift('/q');
  28535. }
  28536. return {
  28537. cmd: parsed.command,
  28538. args: parsed.args,
  28539. opts,
  28540. parsed
  28541. };
  28542. }
  28543. function handleInput(spawned, input) {
  28544. if (input === null || input === undefined) {
  28545. return;
  28546. }
  28547. if (isStream(input)) {
  28548. input.pipe(spawned.stdin);
  28549. } else {
  28550. spawned.stdin.end(input);
  28551. }
  28552. }
  28553. function handleOutput(opts, val) {
  28554. if (val && opts.stripEof) {
  28555. val = stripEof(val);
  28556. }
  28557. return val;
  28558. }
  28559. function handleShell(fn, cmd, opts) {
  28560. let file = '/bin/sh';
  28561. let args = ['-c', cmd];
  28562. opts = Object.assign({}, opts);
  28563. if (process.platform === 'win32') {
  28564. opts.__winShell = true;
  28565. file = process.env.comspec || 'cmd.exe';
  28566. args = ['/s', '/c', `"${cmd}"`];
  28567. opts.windowsVerbatimArguments = true;
  28568. }
  28569. if (opts.shell) {
  28570. file = opts.shell;
  28571. delete opts.shell;
  28572. }
  28573. return fn(file, args, opts);
  28574. }
  28575. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28576. if (!process[stream]) {
  28577. return null;
  28578. }
  28579. let ret;
  28580. if (!buffer) {
  28581. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28582. ret = new Promise((resolve, reject) => {
  28583. process[stream]
  28584. .once('end', resolve)
  28585. .once('error', reject);
  28586. });
  28587. } else if (encoding) {
  28588. ret = _getStream(process[stream], {
  28589. encoding,
  28590. maxBuffer
  28591. });
  28592. } else {
  28593. ret = _getStream.buffer(process[stream], {maxBuffer});
  28594. }
  28595. return ret.catch(err => {
  28596. err.stream = stream;
  28597. err.message = `${stream} ${err.message}`;
  28598. throw err;
  28599. });
  28600. }
  28601. function makeError(result, options) {
  28602. const {stdout, stderr} = result;
  28603. let err = result.error;
  28604. const {code, signal} = result;
  28605. const {parsed, joinedCmd} = options;
  28606. const timedOut = options.timedOut || false;
  28607. if (!err) {
  28608. let output = '';
  28609. if (Array.isArray(parsed.opts.stdio)) {
  28610. if (parsed.opts.stdio[2] !== 'inherit') {
  28611. output += output.length > 0 ? stderr : `\n${stderr}`;
  28612. }
  28613. if (parsed.opts.stdio[1] !== 'inherit') {
  28614. output += `\n${stdout}`;
  28615. }
  28616. } else if (parsed.opts.stdio !== 'inherit') {
  28617. output = `\n${stderr}${stdout}`;
  28618. }
  28619. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28620. err.code = code < 0 ? errname(code) : code;
  28621. }
  28622. err.stdout = stdout;
  28623. err.stderr = stderr;
  28624. err.failed = true;
  28625. err.signal = signal || null;
  28626. err.cmd = joinedCmd;
  28627. err.timedOut = timedOut;
  28628. return err;
  28629. }
  28630. function joinCmd(cmd, args) {
  28631. let joinedCmd = cmd;
  28632. if (Array.isArray(args) && args.length > 0) {
  28633. joinedCmd += ' ' + args.join(' ');
  28634. }
  28635. return joinedCmd;
  28636. }
  28637. module.exports = (cmd, args, opts) => {
  28638. const parsed = handleArgs(cmd, args, opts);
  28639. const {encoding, buffer, maxBuffer} = parsed.opts;
  28640. const joinedCmd = joinCmd(cmd, args);
  28641. let spawned;
  28642. try {
  28643. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28644. } catch (err) {
  28645. return Promise.reject(err);
  28646. }
  28647. let removeExitHandler;
  28648. if (parsed.opts.cleanup) {
  28649. removeExitHandler = onExit(() => {
  28650. spawned.kill();
  28651. });
  28652. }
  28653. let timeoutId = null;
  28654. let timedOut = false;
  28655. const cleanup = () => {
  28656. if (timeoutId) {
  28657. clearTimeout(timeoutId);
  28658. timeoutId = null;
  28659. }
  28660. if (removeExitHandler) {
  28661. removeExitHandler();
  28662. }
  28663. };
  28664. if (parsed.opts.timeout > 0) {
  28665. timeoutId = setTimeout(() => {
  28666. timeoutId = null;
  28667. timedOut = true;
  28668. spawned.kill(parsed.opts.killSignal);
  28669. }, parsed.opts.timeout);
  28670. }
  28671. const processDone = new Promise(resolve => {
  28672. spawned.on('exit', (code, signal) => {
  28673. cleanup();
  28674. resolve({code, signal});
  28675. });
  28676. spawned.on('error', err => {
  28677. cleanup();
  28678. resolve({error: err});
  28679. });
  28680. if (spawned.stdin) {
  28681. spawned.stdin.on('error', err => {
  28682. cleanup();
  28683. resolve({error: err});
  28684. });
  28685. }
  28686. });
  28687. function destroy() {
  28688. if (spawned.stdout) {
  28689. spawned.stdout.destroy();
  28690. }
  28691. if (spawned.stderr) {
  28692. spawned.stderr.destroy();
  28693. }
  28694. }
  28695. const handlePromise = () => pFinally(Promise.all([
  28696. processDone,
  28697. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28698. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28699. ]).then(arr => {
  28700. const result = arr[0];
  28701. result.stdout = arr[1];
  28702. result.stderr = arr[2];
  28703. if (result.error || result.code !== 0 || result.signal !== null) {
  28704. const err = makeError(result, {
  28705. joinedCmd,
  28706. parsed,
  28707. timedOut
  28708. });
  28709. // TODO: missing some timeout logic for killed
  28710. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28711. // err.killed = spawned.killed || killed;
  28712. err.killed = err.killed || spawned.killed;
  28713. if (!parsed.opts.reject) {
  28714. return err;
  28715. }
  28716. throw err;
  28717. }
  28718. return {
  28719. stdout: handleOutput(parsed.opts, result.stdout),
  28720. stderr: handleOutput(parsed.opts, result.stderr),
  28721. code: 0,
  28722. failed: false,
  28723. killed: false,
  28724. signal: null,
  28725. cmd: joinedCmd,
  28726. timedOut: false
  28727. };
  28728. }), destroy);
  28729. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28730. handleInput(spawned, parsed.opts.input);
  28731. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28732. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28733. return spawned;
  28734. };
  28735. // TODO: set `stderr: 'ignore'` when that option is implemented
  28736. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28737. // TODO: set `stdout: 'ignore'` when that option is implemented
  28738. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28739. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28740. module.exports.sync = (cmd, args, opts) => {
  28741. const parsed = handleArgs(cmd, args, opts);
  28742. const joinedCmd = joinCmd(cmd, args);
  28743. if (isStream(parsed.opts.input)) {
  28744. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28745. }
  28746. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28747. result.code = result.status;
  28748. if (result.error || result.status !== 0 || result.signal !== null) {
  28749. const err = makeError(result, {
  28750. joinedCmd,
  28751. parsed
  28752. });
  28753. if (!parsed.opts.reject) {
  28754. return err;
  28755. }
  28756. throw err;
  28757. }
  28758. return {
  28759. stdout: handleOutput(parsed.opts, result.stdout),
  28760. stderr: handleOutput(parsed.opts, result.stderr),
  28761. code: 0,
  28762. failed: false,
  28763. signal: null,
  28764. cmd: joinedCmd,
  28765. timedOut: false
  28766. };
  28767. };
  28768. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28769. /***/ }),
  28770. /***/ 966:
  28771. /***/ (function(module, __unusedexports, __webpack_require__) {
  28772. "use strict";
  28773. const {PassThrough} = __webpack_require__(413);
  28774. module.exports = options => {
  28775. options = Object.assign({}, options);
  28776. const {array} = options;
  28777. let {encoding} = options;
  28778. const buffer = encoding === 'buffer';
  28779. let objectMode = false;
  28780. if (array) {
  28781. objectMode = !(encoding || buffer);
  28782. } else {
  28783. encoding = encoding || 'utf8';
  28784. }
  28785. if (buffer) {
  28786. encoding = null;
  28787. }
  28788. let len = 0;
  28789. const ret = [];
  28790. const stream = new PassThrough({objectMode});
  28791. if (encoding) {
  28792. stream.setEncoding(encoding);
  28793. }
  28794. stream.on('data', chunk => {
  28795. ret.push(chunk);
  28796. if (objectMode) {
  28797. len = ret.length;
  28798. } else {
  28799. len += chunk.length;
  28800. }
  28801. });
  28802. stream.getBufferedValue = () => {
  28803. if (array) {
  28804. return ret;
  28805. }
  28806. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28807. };
  28808. stream.getBufferedLength = () => len;
  28809. return stream;
  28810. };
  28811. /***/ }),
  28812. /***/ 969:
  28813. /***/ (function(module, __unusedexports, __webpack_require__) {
  28814. var wrappy = __webpack_require__(11)
  28815. module.exports = wrappy(once)
  28816. module.exports.strict = wrappy(onceStrict)
  28817. once.proto = once(function () {
  28818. Object.defineProperty(Function.prototype, 'once', {
  28819. value: function () {
  28820. return once(this)
  28821. },
  28822. configurable: true
  28823. })
  28824. Object.defineProperty(Function.prototype, 'onceStrict', {
  28825. value: function () {
  28826. return onceStrict(this)
  28827. },
  28828. configurable: true
  28829. })
  28830. })
  28831. function once (fn) {
  28832. var f = function () {
  28833. if (f.called) return f.value
  28834. f.called = true
  28835. return f.value = fn.apply(this, arguments)
  28836. }
  28837. f.called = false
  28838. return f
  28839. }
  28840. function onceStrict (fn) {
  28841. var f = function () {
  28842. if (f.called)
  28843. throw new Error(f.onceError)
  28844. f.called = true
  28845. return f.value = fn.apply(this, arguments)
  28846. }
  28847. var name = fn.name || 'Function wrapped with `once`'
  28848. f.onceError = name + " shouldn't be called more than once"
  28849. f.called = false
  28850. return f
  28851. }
  28852. /***/ }),
  28853. /***/ 986:
  28854. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28855. "use strict";
  28856. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28857. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28858. return new (P || (P = Promise))(function (resolve, reject) {
  28859. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28860. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28861. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28862. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28863. });
  28864. };
  28865. Object.defineProperty(exports, "__esModule", { value: true });
  28866. const tr = __webpack_require__(9);
  28867. /**
  28868. * Exec a command.
  28869. * Output will be streamed to the live console.
  28870. * Returns promise with return code
  28871. *
  28872. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28873. * @param args optional arguments for tool. Escaping is handled by the lib.
  28874. * @param options optional exec options. See ExecOptions
  28875. * @returns Promise<number> exit code
  28876. */
  28877. function exec(commandLine, args, options) {
  28878. return __awaiter(this, void 0, void 0, function* () {
  28879. const commandArgs = tr.argStringToArray(commandLine);
  28880. if (commandArgs.length === 0) {
  28881. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28882. }
  28883. // Path to tool to execute should be first arg
  28884. const toolPath = commandArgs[0];
  28885. args = commandArgs.slice(1).concat(args || []);
  28886. const runner = new tr.ToolRunner(toolPath, args, options);
  28887. return runner.exec();
  28888. });
  28889. }
  28890. exports.exec = exec;
  28891. //# sourceMappingURL=exec.js.map
  28892. /***/ }),
  28893. /***/ 991:
  28894. /***/ (function(module, __unusedexports, __webpack_require__) {
  28895. module.exports = authenticationRequestError;
  28896. const { RequestError } = __webpack_require__(497);
  28897. function authenticationRequestError(state, error, options) {
  28898. if (!error.headers) throw error;
  28899. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28900. // handle "2FA required" error only
  28901. if (error.status !== 401 || !otpRequired) {
  28902. throw error;
  28903. }
  28904. if (
  28905. error.status === 401 &&
  28906. otpRequired &&
  28907. error.request &&
  28908. error.request.headers["x-github-otp"]
  28909. ) {
  28910. if (state.otp) {
  28911. delete state.otp; // no longer valid, request again
  28912. } else {
  28913. throw new RequestError(
  28914. "Invalid one-time password for two-factor authentication",
  28915. 401,
  28916. {
  28917. headers: error.headers,
  28918. request: options
  28919. }
  28920. );
  28921. }
  28922. }
  28923. if (typeof state.auth.on2fa !== "function") {
  28924. throw new RequestError(
  28925. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28926. 401,
  28927. {
  28928. headers: error.headers,
  28929. request: options
  28930. }
  28931. );
  28932. }
  28933. return Promise.resolve()
  28934. .then(() => {
  28935. return state.auth.on2fa();
  28936. })
  28937. .then(oneTimePassword => {
  28938. const newOptions = Object.assign(options, {
  28939. headers: Object.assign(options.headers, {
  28940. "x-github-otp": oneTimePassword
  28941. })
  28942. });
  28943. return state.octokit.request(newOptions).then(response => {
  28944. // If OTP still valid, then persist it for following requests
  28945. state.otp = oneTimePassword;
  28946. return response;
  28947. });
  28948. });
  28949. }
  28950. /***/ })
  28951. /******/ });