index.js 810 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300
  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. console.log(JSON.stringify(process.env, null, ' '));
  2891. // Get sources
  2892. yield gitSourceProvider.getSource(sourceSettings);
  2893. }
  2894. finally {
  2895. // Unregister problem matcher
  2896. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2897. }
  2898. }
  2899. catch (error) {
  2900. core.setFailed(error.message);
  2901. }
  2902. });
  2903. }
  2904. function cleanup() {
  2905. return __awaiter(this, void 0, void 0, function* () {
  2906. try {
  2907. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2908. }
  2909. catch (error) {
  2910. core.warning(error.message);
  2911. }
  2912. });
  2913. }
  2914. // Main
  2915. if (!stateHelper.IsPost) {
  2916. run();
  2917. }
  2918. // Post
  2919. else {
  2920. cleanup();
  2921. }
  2922. /***/ }),
  2923. /***/ 211:
  2924. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2925. "use strict";
  2926. Object.defineProperty(exports, '__esModule', { value: true });
  2927. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2928. var osName = _interopDefault(__webpack_require__(2));
  2929. function getUserAgent() {
  2930. try {
  2931. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2932. } catch (error) {
  2933. if (/wmic os get Caption/.test(error.message)) {
  2934. return "Windows <version undetectable>";
  2935. }
  2936. return "<environment undetectable>";
  2937. }
  2938. }
  2939. exports.getUserAgent = getUserAgent;
  2940. //# sourceMappingURL=index.js.map
  2941. /***/ }),
  2942. /***/ 215:
  2943. /***/ (function(module) {
  2944. 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"};
  2945. /***/ }),
  2946. /***/ 227:
  2947. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2948. "use strict";
  2949. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2950. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2951. return new (P || (P = Promise))(function (resolve, reject) {
  2952. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2953. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2954. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2955. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2956. });
  2957. };
  2958. var __importStar = (this && this.__importStar) || function (mod) {
  2959. if (mod && mod.__esModule) return mod;
  2960. var result = {};
  2961. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2962. result["default"] = mod;
  2963. return result;
  2964. };
  2965. Object.defineProperty(exports, "__esModule", { value: true });
  2966. const url_1 = __webpack_require__(835);
  2967. const core = __importStar(__webpack_require__(470));
  2968. const github = __importStar(__webpack_require__(469));
  2969. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2970. function getCheckoutInfo(git, ref, commit) {
  2971. return __awaiter(this, void 0, void 0, function* () {
  2972. if (!git) {
  2973. throw new Error('Arg git cannot be empty');
  2974. }
  2975. if (!ref && !commit) {
  2976. throw new Error('Args ref and commit cannot both be empty');
  2977. }
  2978. const result = {};
  2979. const upperRef = (ref || '').toUpperCase();
  2980. // SHA only
  2981. if (!ref) {
  2982. result.ref = commit;
  2983. }
  2984. // refs/heads/
  2985. else if (upperRef.startsWith('REFS/HEADS/')) {
  2986. const branch = ref.substring('refs/heads/'.length);
  2987. result.ref = branch;
  2988. result.startPoint = `refs/remotes/origin/${branch}`;
  2989. }
  2990. // refs/pull/
  2991. else if (upperRef.startsWith('REFS/PULL/')) {
  2992. const branch = ref.substring('refs/pull/'.length);
  2993. result.ref = `refs/remotes/pull/${branch}`;
  2994. }
  2995. // refs/tags/
  2996. else if (upperRef.startsWith('REFS/')) {
  2997. result.ref = ref;
  2998. }
  2999. // Unqualified ref, check for a matching branch or tag
  3000. else {
  3001. if (yield git.branchExists(true, `origin/${ref}`)) {
  3002. result.ref = ref;
  3003. result.startPoint = `refs/remotes/origin/${ref}`;
  3004. }
  3005. else if (yield git.tagExists(`${ref}`)) {
  3006. result.ref = `refs/tags/${ref}`;
  3007. }
  3008. else {
  3009. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3010. }
  3011. }
  3012. return result;
  3013. });
  3014. }
  3015. exports.getCheckoutInfo = getCheckoutInfo;
  3016. function getRefSpecForAllHistory(ref, commit) {
  3017. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3018. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3019. const branch = ref.substring('refs/pull/'.length);
  3020. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3021. }
  3022. return result;
  3023. }
  3024. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3025. function getRefSpec(ref, commit) {
  3026. if (!ref && !commit) {
  3027. throw new Error('Args ref and commit cannot both be empty');
  3028. }
  3029. const upperRef = (ref || '').toUpperCase();
  3030. // SHA
  3031. if (commit) {
  3032. // refs/heads
  3033. if (upperRef.startsWith('REFS/HEADS/')) {
  3034. const branch = ref.substring('refs/heads/'.length);
  3035. return [`+${commit}:refs/remotes/origin/${branch}`];
  3036. }
  3037. // refs/pull/
  3038. else if (upperRef.startsWith('REFS/PULL/')) {
  3039. const branch = ref.substring('refs/pull/'.length);
  3040. return [`+${commit}:refs/remotes/pull/${branch}`];
  3041. }
  3042. // refs/tags/
  3043. else if (upperRef.startsWith('REFS/TAGS/')) {
  3044. return [`+${commit}:${ref}`];
  3045. }
  3046. // Otherwise no destination ref
  3047. else {
  3048. return [commit];
  3049. }
  3050. }
  3051. // Unqualified ref, check for a matching branch or tag
  3052. else if (!upperRef.startsWith('REFS/')) {
  3053. return [
  3054. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3055. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3056. ];
  3057. }
  3058. // refs/heads/
  3059. else if (upperRef.startsWith('REFS/HEADS/')) {
  3060. const branch = ref.substring('refs/heads/'.length);
  3061. return [`+${ref}:refs/remotes/origin/${branch}`];
  3062. }
  3063. // refs/pull/
  3064. else if (upperRef.startsWith('REFS/PULL/')) {
  3065. const branch = ref.substring('refs/pull/'.length);
  3066. return [`+${ref}:refs/remotes/pull/${branch}`];
  3067. }
  3068. // refs/tags/
  3069. else {
  3070. return [`+${ref}:${ref}`];
  3071. }
  3072. }
  3073. exports.getRefSpec = getRefSpec;
  3074. /**
  3075. * Tests whether the initial fetch created the ref at the expected commit
  3076. */
  3077. function testRef(git, ref, commit) {
  3078. return __awaiter(this, void 0, void 0, function* () {
  3079. if (!git) {
  3080. throw new Error('Arg git cannot be empty');
  3081. }
  3082. if (!ref && !commit) {
  3083. throw new Error('Args ref and commit cannot both be empty');
  3084. }
  3085. // No SHA? Nothing to test
  3086. if (!commit) {
  3087. return true;
  3088. }
  3089. // SHA only?
  3090. else if (!ref) {
  3091. return yield git.shaExists(commit);
  3092. }
  3093. const upperRef = ref.toUpperCase();
  3094. // refs/heads/
  3095. if (upperRef.startsWith('REFS/HEADS/')) {
  3096. const branch = ref.substring('refs/heads/'.length);
  3097. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3098. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3099. }
  3100. // refs/pull/
  3101. else if (upperRef.startsWith('REFS/PULL/')) {
  3102. // Assume matches because fetched using the commit
  3103. return true;
  3104. }
  3105. // refs/tags/
  3106. else if (upperRef.startsWith('REFS/TAGS/')) {
  3107. const tagName = ref.substring('refs/tags/'.length);
  3108. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3109. }
  3110. // Unexpected
  3111. else {
  3112. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3113. return true;
  3114. }
  3115. });
  3116. }
  3117. exports.testRef = testRef;
  3118. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3119. return __awaiter(this, void 0, void 0, function* () {
  3120. try {
  3121. // GHES?
  3122. if (isGhes()) {
  3123. return;
  3124. }
  3125. // Auth token?
  3126. if (!token) {
  3127. return;
  3128. }
  3129. // Public PR synchronize, for workflow repo?
  3130. if (fromPayload('repository.private') !== false ||
  3131. github.context.eventName !== 'pull_request' ||
  3132. fromPayload('action') !== 'synchronize' ||
  3133. repositoryOwner !== github.context.repo.owner ||
  3134. repositoryName !== github.context.repo.repo ||
  3135. ref !== github.context.ref ||
  3136. !ref.startsWith('refs/pull/') ||
  3137. commit !== github.context.sha) {
  3138. return;
  3139. }
  3140. // Head SHA
  3141. const expectedHeadSha = fromPayload('after');
  3142. if (!expectedHeadSha) {
  3143. core.debug('Unable to determine head sha');
  3144. return;
  3145. }
  3146. // Base SHA
  3147. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3148. if (!expectedBaseSha) {
  3149. core.debug('Unable to determine base sha');
  3150. return;
  3151. }
  3152. // Expected message?
  3153. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3154. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3155. return;
  3156. }
  3157. // Extract details from message
  3158. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3159. if (!match) {
  3160. core.debug('Unexpected message format');
  3161. return;
  3162. }
  3163. // Post telemetry
  3164. const actualHeadSha = match[1];
  3165. if (actualHeadSha !== expectedHeadSha) {
  3166. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3167. const octokit = new github.GitHub(token, {
  3168. 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})`
  3169. });
  3170. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3171. }
  3172. }
  3173. catch (err) {
  3174. core.debug(`Error when validating commit info: ${err.stack}`);
  3175. }
  3176. });
  3177. }
  3178. exports.checkCommitInfo = checkCommitInfo;
  3179. function fromPayload(path) {
  3180. return select(github.context.payload, path);
  3181. }
  3182. function select(obj, path) {
  3183. if (!obj) {
  3184. return undefined;
  3185. }
  3186. const i = path.indexOf('.');
  3187. if (i < 0) {
  3188. return obj[path];
  3189. }
  3190. const key = path.substr(0, i);
  3191. return select(obj[key], path.substr(i + 1));
  3192. }
  3193. function isGhes() {
  3194. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3195. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3196. }
  3197. /***/ }),
  3198. /***/ 260:
  3199. /***/ (function(module, __unusedexports, __webpack_require__) {
  3200. // Note: since nyc uses this module to output coverage, any lines
  3201. // that are in the direct sync flow of nyc's outputCoverage are
  3202. // ignored, since we can never get coverage for them.
  3203. var assert = __webpack_require__(357)
  3204. var signals = __webpack_require__(654)
  3205. var EE = __webpack_require__(614)
  3206. /* istanbul ignore if */
  3207. if (typeof EE !== 'function') {
  3208. EE = EE.EventEmitter
  3209. }
  3210. var emitter
  3211. if (process.__signal_exit_emitter__) {
  3212. emitter = process.__signal_exit_emitter__
  3213. } else {
  3214. emitter = process.__signal_exit_emitter__ = new EE()
  3215. emitter.count = 0
  3216. emitter.emitted = {}
  3217. }
  3218. // Because this emitter is a global, we have to check to see if a
  3219. // previous version of this library failed to enable infinite listeners.
  3220. // I know what you're about to say. But literally everything about
  3221. // signal-exit is a compromise with evil. Get used to it.
  3222. if (!emitter.infinite) {
  3223. emitter.setMaxListeners(Infinity)
  3224. emitter.infinite = true
  3225. }
  3226. module.exports = function (cb, opts) {
  3227. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3228. if (loaded === false) {
  3229. load()
  3230. }
  3231. var ev = 'exit'
  3232. if (opts && opts.alwaysLast) {
  3233. ev = 'afterexit'
  3234. }
  3235. var remove = function () {
  3236. emitter.removeListener(ev, cb)
  3237. if (emitter.listeners('exit').length === 0 &&
  3238. emitter.listeners('afterexit').length === 0) {
  3239. unload()
  3240. }
  3241. }
  3242. emitter.on(ev, cb)
  3243. return remove
  3244. }
  3245. module.exports.unload = unload
  3246. function unload () {
  3247. if (!loaded) {
  3248. return
  3249. }
  3250. loaded = false
  3251. signals.forEach(function (sig) {
  3252. try {
  3253. process.removeListener(sig, sigListeners[sig])
  3254. } catch (er) {}
  3255. })
  3256. process.emit = originalProcessEmit
  3257. process.reallyExit = originalProcessReallyExit
  3258. emitter.count -= 1
  3259. }
  3260. function emit (event, code, signal) {
  3261. if (emitter.emitted[event]) {
  3262. return
  3263. }
  3264. emitter.emitted[event] = true
  3265. emitter.emit(event, code, signal)
  3266. }
  3267. // { <signal>: <listener fn>, ... }
  3268. var sigListeners = {}
  3269. signals.forEach(function (sig) {
  3270. sigListeners[sig] = function listener () {
  3271. // If there are no other listeners, an exit is coming!
  3272. // Simplest way: remove us and then re-send the signal.
  3273. // We know that this will kill the process, so we can
  3274. // safely emit now.
  3275. var listeners = process.listeners(sig)
  3276. if (listeners.length === emitter.count) {
  3277. unload()
  3278. emit('exit', null, sig)
  3279. /* istanbul ignore next */
  3280. emit('afterexit', null, sig)
  3281. /* istanbul ignore next */
  3282. process.kill(process.pid, sig)
  3283. }
  3284. }
  3285. })
  3286. module.exports.signals = function () {
  3287. return signals
  3288. }
  3289. module.exports.load = load
  3290. var loaded = false
  3291. function load () {
  3292. if (loaded) {
  3293. return
  3294. }
  3295. loaded = true
  3296. // This is the number of onSignalExit's that are in play.
  3297. // It's important so that we can count the correct number of
  3298. // listeners on signals, and don't wait for the other one to
  3299. // handle it instead of us.
  3300. emitter.count += 1
  3301. signals = signals.filter(function (sig) {
  3302. try {
  3303. process.on(sig, sigListeners[sig])
  3304. return true
  3305. } catch (er) {
  3306. return false
  3307. }
  3308. })
  3309. process.emit = processEmit
  3310. process.reallyExit = processReallyExit
  3311. }
  3312. var originalProcessReallyExit = process.reallyExit
  3313. function processReallyExit (code) {
  3314. process.exitCode = code || 0
  3315. emit('exit', process.exitCode, null)
  3316. /* istanbul ignore next */
  3317. emit('afterexit', process.exitCode, null)
  3318. /* istanbul ignore next */
  3319. originalProcessReallyExit.call(process, process.exitCode)
  3320. }
  3321. var originalProcessEmit = process.emit
  3322. function processEmit (ev, arg) {
  3323. if (ev === 'exit') {
  3324. if (arg !== undefined) {
  3325. process.exitCode = arg
  3326. }
  3327. var ret = originalProcessEmit.apply(this, arguments)
  3328. emit('exit', process.exitCode, null)
  3329. /* istanbul ignore next */
  3330. emit('afterexit', process.exitCode, null)
  3331. return ret
  3332. } else {
  3333. return originalProcessEmit.apply(this, arguments)
  3334. }
  3335. }
  3336. /***/ }),
  3337. /***/ 262:
  3338. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3339. "use strict";
  3340. Object.defineProperty(exports, "__esModule", { value: true });
  3341. const fs_1 = __webpack_require__(747);
  3342. const os_1 = __webpack_require__(87);
  3343. class Context {
  3344. /**
  3345. * Hydrate the context from the environment
  3346. */
  3347. constructor() {
  3348. this.payload = {};
  3349. if (process.env.GITHUB_EVENT_PATH) {
  3350. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3351. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3352. }
  3353. else {
  3354. const path = process.env.GITHUB_EVENT_PATH;
  3355. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3356. }
  3357. }
  3358. this.eventName = process.env.GITHUB_EVENT_NAME;
  3359. this.sha = process.env.GITHUB_SHA;
  3360. this.ref = process.env.GITHUB_REF;
  3361. this.workflow = process.env.GITHUB_WORKFLOW;
  3362. this.action = process.env.GITHUB_ACTION;
  3363. this.actor = process.env.GITHUB_ACTOR;
  3364. }
  3365. get issue() {
  3366. const payload = this.payload;
  3367. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3368. }
  3369. get repo() {
  3370. if (process.env.GITHUB_REPOSITORY) {
  3371. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3372. return { owner, repo };
  3373. }
  3374. if (this.payload.repository) {
  3375. return {
  3376. owner: this.payload.repository.owner.login,
  3377. repo: this.payload.repository.name
  3378. };
  3379. }
  3380. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3381. }
  3382. }
  3383. exports.Context = Context;
  3384. //# sourceMappingURL=context.js.map
  3385. /***/ }),
  3386. /***/ 265:
  3387. /***/ (function(module, __unusedexports, __webpack_require__) {
  3388. module.exports = getPage
  3389. const deprecate = __webpack_require__(370)
  3390. const getPageLinks = __webpack_require__(577)
  3391. const HttpError = __webpack_require__(297)
  3392. function getPage (octokit, link, which, headers) {
  3393. 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.`)
  3394. const url = getPageLinks(link)[which]
  3395. if (!url) {
  3396. const urlError = new HttpError(`No ${which} page found`, 404)
  3397. return Promise.reject(urlError)
  3398. }
  3399. const requestOptions = {
  3400. url,
  3401. headers: applyAcceptHeader(link, headers)
  3402. }
  3403. const promise = octokit.request(requestOptions)
  3404. return promise
  3405. }
  3406. function applyAcceptHeader (res, headers) {
  3407. const previous = res.headers && res.headers['x-github-media-type']
  3408. if (!previous || (headers && headers.accept)) {
  3409. return headers
  3410. }
  3411. headers = headers || {}
  3412. headers.accept = 'application/vnd.' + previous
  3413. .replace('; param=', '.')
  3414. .replace('; format=', '+')
  3415. return headers
  3416. }
  3417. /***/ }),
  3418. /***/ 280:
  3419. /***/ (function(module, exports) {
  3420. exports = module.exports = SemVer
  3421. var debug
  3422. /* istanbul ignore next */
  3423. if (typeof process === 'object' &&
  3424. process.env &&
  3425. process.env.NODE_DEBUG &&
  3426. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3427. debug = function () {
  3428. var args = Array.prototype.slice.call(arguments, 0)
  3429. args.unshift('SEMVER')
  3430. console.log.apply(console, args)
  3431. }
  3432. } else {
  3433. debug = function () {}
  3434. }
  3435. // Note: this is the semver.org version of the spec that it implements
  3436. // Not necessarily the package version of this code.
  3437. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3438. var MAX_LENGTH = 256
  3439. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3440. /* istanbul ignore next */ 9007199254740991
  3441. // Max safe segment length for coercion.
  3442. var MAX_SAFE_COMPONENT_LENGTH = 16
  3443. // The actual regexps go on exports.re
  3444. var re = exports.re = []
  3445. var src = exports.src = []
  3446. var R = 0
  3447. // The following Regular Expressions can be used for tokenizing,
  3448. // validating, and parsing SemVer version strings.
  3449. // ## Numeric Identifier
  3450. // A single `0`, or a non-zero digit followed by zero or more digits.
  3451. var NUMERICIDENTIFIER = R++
  3452. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3453. var NUMERICIDENTIFIERLOOSE = R++
  3454. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3455. // ## Non-numeric Identifier
  3456. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3457. // more letters, digits, or hyphens.
  3458. var NONNUMERICIDENTIFIER = R++
  3459. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3460. // ## Main Version
  3461. // Three dot-separated numeric identifiers.
  3462. var MAINVERSION = R++
  3463. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3464. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3465. '(' + src[NUMERICIDENTIFIER] + ')'
  3466. var MAINVERSIONLOOSE = R++
  3467. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3468. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3469. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3470. // ## Pre-release Version Identifier
  3471. // A numeric identifier, or a non-numeric identifier.
  3472. var PRERELEASEIDENTIFIER = R++
  3473. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3474. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3475. var PRERELEASEIDENTIFIERLOOSE = R++
  3476. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3477. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3478. // ## Pre-release Version
  3479. // Hyphen, followed by one or more dot-separated pre-release version
  3480. // identifiers.
  3481. var PRERELEASE = R++
  3482. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3483. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3484. var PRERELEASELOOSE = R++
  3485. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3486. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3487. // ## Build Metadata Identifier
  3488. // Any combination of digits, letters, or hyphens.
  3489. var BUILDIDENTIFIER = R++
  3490. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3491. // ## Build Metadata
  3492. // Plus sign, followed by one or more period-separated build metadata
  3493. // identifiers.
  3494. var BUILD = R++
  3495. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3496. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3497. // ## Full Version String
  3498. // A main version, followed optionally by a pre-release version and
  3499. // build metadata.
  3500. // Note that the only major, minor, patch, and pre-release sections of
  3501. // the version string are capturing groups. The build metadata is not a
  3502. // capturing group, because it should not ever be used in version
  3503. // comparison.
  3504. var FULL = R++
  3505. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3506. src[PRERELEASE] + '?' +
  3507. src[BUILD] + '?'
  3508. src[FULL] = '^' + FULLPLAIN + '$'
  3509. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3510. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3511. // common in the npm registry.
  3512. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3513. src[PRERELEASELOOSE] + '?' +
  3514. src[BUILD] + '?'
  3515. var LOOSE = R++
  3516. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3517. var GTLT = R++
  3518. src[GTLT] = '((?:<|>)?=?)'
  3519. // Something like "2.*" or "1.2.x".
  3520. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3521. // Only the first item is strictly required.
  3522. var XRANGEIDENTIFIERLOOSE = R++
  3523. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3524. var XRANGEIDENTIFIER = R++
  3525. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3526. var XRANGEPLAIN = R++
  3527. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3528. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3529. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3530. '(?:' + src[PRERELEASE] + ')?' +
  3531. src[BUILD] + '?' +
  3532. ')?)?'
  3533. var XRANGEPLAINLOOSE = R++
  3534. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3535. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3536. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3537. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3538. src[BUILD] + '?' +
  3539. ')?)?'
  3540. var XRANGE = R++
  3541. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3542. var XRANGELOOSE = R++
  3543. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3544. // Coercion.
  3545. // Extract anything that could conceivably be a part of a valid semver
  3546. var COERCE = R++
  3547. src[COERCE] = '(?:^|[^\\d])' +
  3548. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3549. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3550. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3551. '(?:$|[^\\d])'
  3552. // Tilde ranges.
  3553. // Meaning is "reasonably at or greater than"
  3554. var LONETILDE = R++
  3555. src[LONETILDE] = '(?:~>?)'
  3556. var TILDETRIM = R++
  3557. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3558. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3559. var tildeTrimReplace = '$1~'
  3560. var TILDE = R++
  3561. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3562. var TILDELOOSE = R++
  3563. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3564. // Caret ranges.
  3565. // Meaning is "at least and backwards compatible with"
  3566. var LONECARET = R++
  3567. src[LONECARET] = '(?:\\^)'
  3568. var CARETTRIM = R++
  3569. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3570. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3571. var caretTrimReplace = '$1^'
  3572. var CARET = R++
  3573. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3574. var CARETLOOSE = R++
  3575. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3576. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3577. var COMPARATORLOOSE = R++
  3578. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3579. var COMPARATOR = R++
  3580. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3581. // An expression to strip any whitespace between the gtlt and the thing
  3582. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3583. var COMPARATORTRIM = R++
  3584. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3585. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3586. // this one has to use the /g flag
  3587. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3588. var comparatorTrimReplace = '$1$2$3'
  3589. // Something like `1.2.3 - 1.2.4`
  3590. // Note that these all use the loose form, because they'll be
  3591. // checked against either the strict or loose comparator form
  3592. // later.
  3593. var HYPHENRANGE = R++
  3594. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3595. '\\s+-\\s+' +
  3596. '(' + src[XRANGEPLAIN] + ')' +
  3597. '\\s*$'
  3598. var HYPHENRANGELOOSE = R++
  3599. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3600. '\\s+-\\s+' +
  3601. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3602. '\\s*$'
  3603. // Star ranges basically just allow anything at all.
  3604. var STAR = R++
  3605. src[STAR] = '(<|>)?=?\\s*\\*'
  3606. // Compile to actual regexp objects.
  3607. // All are flag-free, unless they were created above with a flag.
  3608. for (var i = 0; i < R; i++) {
  3609. debug(i, src[i])
  3610. if (!re[i]) {
  3611. re[i] = new RegExp(src[i])
  3612. }
  3613. }
  3614. exports.parse = parse
  3615. function parse (version, options) {
  3616. if (!options || typeof options !== 'object') {
  3617. options = {
  3618. loose: !!options,
  3619. includePrerelease: false
  3620. }
  3621. }
  3622. if (version instanceof SemVer) {
  3623. return version
  3624. }
  3625. if (typeof version !== 'string') {
  3626. return null
  3627. }
  3628. if (version.length > MAX_LENGTH) {
  3629. return null
  3630. }
  3631. var r = options.loose ? re[LOOSE] : re[FULL]
  3632. if (!r.test(version)) {
  3633. return null
  3634. }
  3635. try {
  3636. return new SemVer(version, options)
  3637. } catch (er) {
  3638. return null
  3639. }
  3640. }
  3641. exports.valid = valid
  3642. function valid (version, options) {
  3643. var v = parse(version, options)
  3644. return v ? v.version : null
  3645. }
  3646. exports.clean = clean
  3647. function clean (version, options) {
  3648. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3649. return s ? s.version : null
  3650. }
  3651. exports.SemVer = SemVer
  3652. function SemVer (version, options) {
  3653. if (!options || typeof options !== 'object') {
  3654. options = {
  3655. loose: !!options,
  3656. includePrerelease: false
  3657. }
  3658. }
  3659. if (version instanceof SemVer) {
  3660. if (version.loose === options.loose) {
  3661. return version
  3662. } else {
  3663. version = version.version
  3664. }
  3665. } else if (typeof version !== 'string') {
  3666. throw new TypeError('Invalid Version: ' + version)
  3667. }
  3668. if (version.length > MAX_LENGTH) {
  3669. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3670. }
  3671. if (!(this instanceof SemVer)) {
  3672. return new SemVer(version, options)
  3673. }
  3674. debug('SemVer', version, options)
  3675. this.options = options
  3676. this.loose = !!options.loose
  3677. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3678. if (!m) {
  3679. throw new TypeError('Invalid Version: ' + version)
  3680. }
  3681. this.raw = version
  3682. // these are actually numbers
  3683. this.major = +m[1]
  3684. this.minor = +m[2]
  3685. this.patch = +m[3]
  3686. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3687. throw new TypeError('Invalid major version')
  3688. }
  3689. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3690. throw new TypeError('Invalid minor version')
  3691. }
  3692. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3693. throw new TypeError('Invalid patch version')
  3694. }
  3695. // numberify any prerelease numeric ids
  3696. if (!m[4]) {
  3697. this.prerelease = []
  3698. } else {
  3699. this.prerelease = m[4].split('.').map(function (id) {
  3700. if (/^[0-9]+$/.test(id)) {
  3701. var num = +id
  3702. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3703. return num
  3704. }
  3705. }
  3706. return id
  3707. })
  3708. }
  3709. this.build = m[5] ? m[5].split('.') : []
  3710. this.format()
  3711. }
  3712. SemVer.prototype.format = function () {
  3713. this.version = this.major + '.' + this.minor + '.' + this.patch
  3714. if (this.prerelease.length) {
  3715. this.version += '-' + this.prerelease.join('.')
  3716. }
  3717. return this.version
  3718. }
  3719. SemVer.prototype.toString = function () {
  3720. return this.version
  3721. }
  3722. SemVer.prototype.compare = function (other) {
  3723. debug('SemVer.compare', this.version, this.options, other)
  3724. if (!(other instanceof SemVer)) {
  3725. other = new SemVer(other, this.options)
  3726. }
  3727. return this.compareMain(other) || this.comparePre(other)
  3728. }
  3729. SemVer.prototype.compareMain = function (other) {
  3730. if (!(other instanceof SemVer)) {
  3731. other = new SemVer(other, this.options)
  3732. }
  3733. return compareIdentifiers(this.major, other.major) ||
  3734. compareIdentifiers(this.minor, other.minor) ||
  3735. compareIdentifiers(this.patch, other.patch)
  3736. }
  3737. SemVer.prototype.comparePre = function (other) {
  3738. if (!(other instanceof SemVer)) {
  3739. other = new SemVer(other, this.options)
  3740. }
  3741. // NOT having a prerelease is > having one
  3742. if (this.prerelease.length && !other.prerelease.length) {
  3743. return -1
  3744. } else if (!this.prerelease.length && other.prerelease.length) {
  3745. return 1
  3746. } else if (!this.prerelease.length && !other.prerelease.length) {
  3747. return 0
  3748. }
  3749. var i = 0
  3750. do {
  3751. var a = this.prerelease[i]
  3752. var b = other.prerelease[i]
  3753. debug('prerelease compare', i, a, b)
  3754. if (a === undefined && b === undefined) {
  3755. return 0
  3756. } else if (b === undefined) {
  3757. return 1
  3758. } else if (a === undefined) {
  3759. return -1
  3760. } else if (a === b) {
  3761. continue
  3762. } else {
  3763. return compareIdentifiers(a, b)
  3764. }
  3765. } while (++i)
  3766. }
  3767. // preminor will bump the version up to the next minor release, and immediately
  3768. // down to pre-release. premajor and prepatch work the same way.
  3769. SemVer.prototype.inc = function (release, identifier) {
  3770. switch (release) {
  3771. case 'premajor':
  3772. this.prerelease.length = 0
  3773. this.patch = 0
  3774. this.minor = 0
  3775. this.major++
  3776. this.inc('pre', identifier)
  3777. break
  3778. case 'preminor':
  3779. this.prerelease.length = 0
  3780. this.patch = 0
  3781. this.minor++
  3782. this.inc('pre', identifier)
  3783. break
  3784. case 'prepatch':
  3785. // If this is already a prerelease, it will bump to the next version
  3786. // drop any prereleases that might already exist, since they are not
  3787. // relevant at this point.
  3788. this.prerelease.length = 0
  3789. this.inc('patch', identifier)
  3790. this.inc('pre', identifier)
  3791. break
  3792. // If the input is a non-prerelease version, this acts the same as
  3793. // prepatch.
  3794. case 'prerelease':
  3795. if (this.prerelease.length === 0) {
  3796. this.inc('patch', identifier)
  3797. }
  3798. this.inc('pre', identifier)
  3799. break
  3800. case 'major':
  3801. // If this is a pre-major version, bump up to the same major version.
  3802. // Otherwise increment major.
  3803. // 1.0.0-5 bumps to 1.0.0
  3804. // 1.1.0 bumps to 2.0.0
  3805. if (this.minor !== 0 ||
  3806. this.patch !== 0 ||
  3807. this.prerelease.length === 0) {
  3808. this.major++
  3809. }
  3810. this.minor = 0
  3811. this.patch = 0
  3812. this.prerelease = []
  3813. break
  3814. case 'minor':
  3815. // If this is a pre-minor version, bump up to the same minor version.
  3816. // Otherwise increment minor.
  3817. // 1.2.0-5 bumps to 1.2.0
  3818. // 1.2.1 bumps to 1.3.0
  3819. if (this.patch !== 0 || this.prerelease.length === 0) {
  3820. this.minor++
  3821. }
  3822. this.patch = 0
  3823. this.prerelease = []
  3824. break
  3825. case 'patch':
  3826. // If this is not a pre-release version, it will increment the patch.
  3827. // If it is a pre-release it will bump up to the same patch version.
  3828. // 1.2.0-5 patches to 1.2.0
  3829. // 1.2.0 patches to 1.2.1
  3830. if (this.prerelease.length === 0) {
  3831. this.patch++
  3832. }
  3833. this.prerelease = []
  3834. break
  3835. // This probably shouldn't be used publicly.
  3836. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3837. case 'pre':
  3838. if (this.prerelease.length === 0) {
  3839. this.prerelease = [0]
  3840. } else {
  3841. var i = this.prerelease.length
  3842. while (--i >= 0) {
  3843. if (typeof this.prerelease[i] === 'number') {
  3844. this.prerelease[i]++
  3845. i = -2
  3846. }
  3847. }
  3848. if (i === -1) {
  3849. // didn't increment anything
  3850. this.prerelease.push(0)
  3851. }
  3852. }
  3853. if (identifier) {
  3854. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3855. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3856. if (this.prerelease[0] === identifier) {
  3857. if (isNaN(this.prerelease[1])) {
  3858. this.prerelease = [identifier, 0]
  3859. }
  3860. } else {
  3861. this.prerelease = [identifier, 0]
  3862. }
  3863. }
  3864. break
  3865. default:
  3866. throw new Error('invalid increment argument: ' + release)
  3867. }
  3868. this.format()
  3869. this.raw = this.version
  3870. return this
  3871. }
  3872. exports.inc = inc
  3873. function inc (version, release, loose, identifier) {
  3874. if (typeof (loose) === 'string') {
  3875. identifier = loose
  3876. loose = undefined
  3877. }
  3878. try {
  3879. return new SemVer(version, loose).inc(release, identifier).version
  3880. } catch (er) {
  3881. return null
  3882. }
  3883. }
  3884. exports.diff = diff
  3885. function diff (version1, version2) {
  3886. if (eq(version1, version2)) {
  3887. return null
  3888. } else {
  3889. var v1 = parse(version1)
  3890. var v2 = parse(version2)
  3891. var prefix = ''
  3892. if (v1.prerelease.length || v2.prerelease.length) {
  3893. prefix = 'pre'
  3894. var defaultResult = 'prerelease'
  3895. }
  3896. for (var key in v1) {
  3897. if (key === 'major' || key === 'minor' || key === 'patch') {
  3898. if (v1[key] !== v2[key]) {
  3899. return prefix + key
  3900. }
  3901. }
  3902. }
  3903. return defaultResult // may be undefined
  3904. }
  3905. }
  3906. exports.compareIdentifiers = compareIdentifiers
  3907. var numeric = /^[0-9]+$/
  3908. function compareIdentifiers (a, b) {
  3909. var anum = numeric.test(a)
  3910. var bnum = numeric.test(b)
  3911. if (anum && bnum) {
  3912. a = +a
  3913. b = +b
  3914. }
  3915. return a === b ? 0
  3916. : (anum && !bnum) ? -1
  3917. : (bnum && !anum) ? 1
  3918. : a < b ? -1
  3919. : 1
  3920. }
  3921. exports.rcompareIdentifiers = rcompareIdentifiers
  3922. function rcompareIdentifiers (a, b) {
  3923. return compareIdentifiers(b, a)
  3924. }
  3925. exports.major = major
  3926. function major (a, loose) {
  3927. return new SemVer(a, loose).major
  3928. }
  3929. exports.minor = minor
  3930. function minor (a, loose) {
  3931. return new SemVer(a, loose).minor
  3932. }
  3933. exports.patch = patch
  3934. function patch (a, loose) {
  3935. return new SemVer(a, loose).patch
  3936. }
  3937. exports.compare = compare
  3938. function compare (a, b, loose) {
  3939. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3940. }
  3941. exports.compareLoose = compareLoose
  3942. function compareLoose (a, b) {
  3943. return compare(a, b, true)
  3944. }
  3945. exports.rcompare = rcompare
  3946. function rcompare (a, b, loose) {
  3947. return compare(b, a, loose)
  3948. }
  3949. exports.sort = sort
  3950. function sort (list, loose) {
  3951. return list.sort(function (a, b) {
  3952. return exports.compare(a, b, loose)
  3953. })
  3954. }
  3955. exports.rsort = rsort
  3956. function rsort (list, loose) {
  3957. return list.sort(function (a, b) {
  3958. return exports.rcompare(a, b, loose)
  3959. })
  3960. }
  3961. exports.gt = gt
  3962. function gt (a, b, loose) {
  3963. return compare(a, b, loose) > 0
  3964. }
  3965. exports.lt = lt
  3966. function lt (a, b, loose) {
  3967. return compare(a, b, loose) < 0
  3968. }
  3969. exports.eq = eq
  3970. function eq (a, b, loose) {
  3971. return compare(a, b, loose) === 0
  3972. }
  3973. exports.neq = neq
  3974. function neq (a, b, loose) {
  3975. return compare(a, b, loose) !== 0
  3976. }
  3977. exports.gte = gte
  3978. function gte (a, b, loose) {
  3979. return compare(a, b, loose) >= 0
  3980. }
  3981. exports.lte = lte
  3982. function lte (a, b, loose) {
  3983. return compare(a, b, loose) <= 0
  3984. }
  3985. exports.cmp = cmp
  3986. function cmp (a, op, b, loose) {
  3987. switch (op) {
  3988. case '===':
  3989. if (typeof a === 'object')
  3990. a = a.version
  3991. if (typeof b === 'object')
  3992. b = b.version
  3993. return a === b
  3994. case '!==':
  3995. if (typeof a === 'object')
  3996. a = a.version
  3997. if (typeof b === 'object')
  3998. b = b.version
  3999. return a !== b
  4000. case '':
  4001. case '=':
  4002. case '==':
  4003. return eq(a, b, loose)
  4004. case '!=':
  4005. return neq(a, b, loose)
  4006. case '>':
  4007. return gt(a, b, loose)
  4008. case '>=':
  4009. return gte(a, b, loose)
  4010. case '<':
  4011. return lt(a, b, loose)
  4012. case '<=':
  4013. return lte(a, b, loose)
  4014. default:
  4015. throw new TypeError('Invalid operator: ' + op)
  4016. }
  4017. }
  4018. exports.Comparator = Comparator
  4019. function Comparator (comp, options) {
  4020. if (!options || typeof options !== 'object') {
  4021. options = {
  4022. loose: !!options,
  4023. includePrerelease: false
  4024. }
  4025. }
  4026. if (comp instanceof Comparator) {
  4027. if (comp.loose === !!options.loose) {
  4028. return comp
  4029. } else {
  4030. comp = comp.value
  4031. }
  4032. }
  4033. if (!(this instanceof Comparator)) {
  4034. return new Comparator(comp, options)
  4035. }
  4036. debug('comparator', comp, options)
  4037. this.options = options
  4038. this.loose = !!options.loose
  4039. this.parse(comp)
  4040. if (this.semver === ANY) {
  4041. this.value = ''
  4042. } else {
  4043. this.value = this.operator + this.semver.version
  4044. }
  4045. debug('comp', this)
  4046. }
  4047. var ANY = {}
  4048. Comparator.prototype.parse = function (comp) {
  4049. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4050. var m = comp.match(r)
  4051. if (!m) {
  4052. throw new TypeError('Invalid comparator: ' + comp)
  4053. }
  4054. this.operator = m[1]
  4055. if (this.operator === '=') {
  4056. this.operator = ''
  4057. }
  4058. // if it literally is just '>' or '' then allow anything.
  4059. if (!m[2]) {
  4060. this.semver = ANY
  4061. } else {
  4062. this.semver = new SemVer(m[2], this.options.loose)
  4063. }
  4064. }
  4065. Comparator.prototype.toString = function () {
  4066. return this.value
  4067. }
  4068. Comparator.prototype.test = function (version) {
  4069. debug('Comparator.test', version, this.options.loose)
  4070. if (this.semver === ANY) {
  4071. return true
  4072. }
  4073. if (typeof version === 'string') {
  4074. version = new SemVer(version, this.options)
  4075. }
  4076. return cmp(version, this.operator, this.semver, this.options)
  4077. }
  4078. Comparator.prototype.intersects = function (comp, options) {
  4079. if (!(comp instanceof Comparator)) {
  4080. throw new TypeError('a Comparator is required')
  4081. }
  4082. if (!options || typeof options !== 'object') {
  4083. options = {
  4084. loose: !!options,
  4085. includePrerelease: false
  4086. }
  4087. }
  4088. var rangeTmp
  4089. if (this.operator === '') {
  4090. rangeTmp = new Range(comp.value, options)
  4091. return satisfies(this.value, rangeTmp, options)
  4092. } else if (comp.operator === '') {
  4093. rangeTmp = new Range(this.value, options)
  4094. return satisfies(comp.semver, rangeTmp, options)
  4095. }
  4096. var sameDirectionIncreasing =
  4097. (this.operator === '>=' || this.operator === '>') &&
  4098. (comp.operator === '>=' || comp.operator === '>')
  4099. var sameDirectionDecreasing =
  4100. (this.operator === '<=' || this.operator === '<') &&
  4101. (comp.operator === '<=' || comp.operator === '<')
  4102. var sameSemVer = this.semver.version === comp.semver.version
  4103. var differentDirectionsInclusive =
  4104. (this.operator === '>=' || this.operator === '<=') &&
  4105. (comp.operator === '>=' || comp.operator === '<=')
  4106. var oppositeDirectionsLessThan =
  4107. cmp(this.semver, '<', comp.semver, options) &&
  4108. ((this.operator === '>=' || this.operator === '>') &&
  4109. (comp.operator === '<=' || comp.operator === '<'))
  4110. var oppositeDirectionsGreaterThan =
  4111. cmp(this.semver, '>', comp.semver, options) &&
  4112. ((this.operator === '<=' || this.operator === '<') &&
  4113. (comp.operator === '>=' || comp.operator === '>'))
  4114. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4115. (sameSemVer && differentDirectionsInclusive) ||
  4116. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4117. }
  4118. exports.Range = Range
  4119. function Range (range, options) {
  4120. if (!options || typeof options !== 'object') {
  4121. options = {
  4122. loose: !!options,
  4123. includePrerelease: false
  4124. }
  4125. }
  4126. if (range instanceof Range) {
  4127. if (range.loose === !!options.loose &&
  4128. range.includePrerelease === !!options.includePrerelease) {
  4129. return range
  4130. } else {
  4131. return new Range(range.raw, options)
  4132. }
  4133. }
  4134. if (range instanceof Comparator) {
  4135. return new Range(range.value, options)
  4136. }
  4137. if (!(this instanceof Range)) {
  4138. return new Range(range, options)
  4139. }
  4140. this.options = options
  4141. this.loose = !!options.loose
  4142. this.includePrerelease = !!options.includePrerelease
  4143. // First, split based on boolean or ||
  4144. this.raw = range
  4145. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4146. return this.parseRange(range.trim())
  4147. }, this).filter(function (c) {
  4148. // throw out any that are not relevant for whatever reason
  4149. return c.length
  4150. })
  4151. if (!this.set.length) {
  4152. throw new TypeError('Invalid SemVer Range: ' + range)
  4153. }
  4154. this.format()
  4155. }
  4156. Range.prototype.format = function () {
  4157. this.range = this.set.map(function (comps) {
  4158. return comps.join(' ').trim()
  4159. }).join('||').trim()
  4160. return this.range
  4161. }
  4162. Range.prototype.toString = function () {
  4163. return this.range
  4164. }
  4165. Range.prototype.parseRange = function (range) {
  4166. var loose = this.options.loose
  4167. range = range.trim()
  4168. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4169. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4170. range = range.replace(hr, hyphenReplace)
  4171. debug('hyphen replace', range)
  4172. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4173. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4174. debug('comparator trim', range, re[COMPARATORTRIM])
  4175. // `~ 1.2.3` => `~1.2.3`
  4176. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4177. // `^ 1.2.3` => `^1.2.3`
  4178. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4179. // normalize spaces
  4180. range = range.split(/\s+/).join(' ')
  4181. // At this point, the range is completely trimmed and
  4182. // ready to be split into comparators.
  4183. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4184. var set = range.split(' ').map(function (comp) {
  4185. return parseComparator(comp, this.options)
  4186. }, this).join(' ').split(/\s+/)
  4187. if (this.options.loose) {
  4188. // in loose mode, throw out any that are not valid comparators
  4189. set = set.filter(function (comp) {
  4190. return !!comp.match(compRe)
  4191. })
  4192. }
  4193. set = set.map(function (comp) {
  4194. return new Comparator(comp, this.options)
  4195. }, this)
  4196. return set
  4197. }
  4198. Range.prototype.intersects = function (range, options) {
  4199. if (!(range instanceof Range)) {
  4200. throw new TypeError('a Range is required')
  4201. }
  4202. return this.set.some(function (thisComparators) {
  4203. return thisComparators.every(function (thisComparator) {
  4204. return range.set.some(function (rangeComparators) {
  4205. return rangeComparators.every(function (rangeComparator) {
  4206. return thisComparator.intersects(rangeComparator, options)
  4207. })
  4208. })
  4209. })
  4210. })
  4211. }
  4212. // Mostly just for testing and legacy API reasons
  4213. exports.toComparators = toComparators
  4214. function toComparators (range, options) {
  4215. return new Range(range, options).set.map(function (comp) {
  4216. return comp.map(function (c) {
  4217. return c.value
  4218. }).join(' ').trim().split(' ')
  4219. })
  4220. }
  4221. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4222. // already replaced the hyphen ranges
  4223. // turn into a set of JUST comparators.
  4224. function parseComparator (comp, options) {
  4225. debug('comp', comp, options)
  4226. comp = replaceCarets(comp, options)
  4227. debug('caret', comp)
  4228. comp = replaceTildes(comp, options)
  4229. debug('tildes', comp)
  4230. comp = replaceXRanges(comp, options)
  4231. debug('xrange', comp)
  4232. comp = replaceStars(comp, options)
  4233. debug('stars', comp)
  4234. return comp
  4235. }
  4236. function isX (id) {
  4237. return !id || id.toLowerCase() === 'x' || id === '*'
  4238. }
  4239. // ~, ~> --> * (any, kinda silly)
  4240. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4241. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4242. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4243. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4244. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4245. function replaceTildes (comp, options) {
  4246. return comp.trim().split(/\s+/).map(function (comp) {
  4247. return replaceTilde(comp, options)
  4248. }).join(' ')
  4249. }
  4250. function replaceTilde (comp, options) {
  4251. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4252. return comp.replace(r, function (_, M, m, p, pr) {
  4253. debug('tilde', comp, _, M, m, p, pr)
  4254. var ret
  4255. if (isX(M)) {
  4256. ret = ''
  4257. } else if (isX(m)) {
  4258. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4259. } else if (isX(p)) {
  4260. // ~1.2 == >=1.2.0 <1.3.0
  4261. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4262. } else if (pr) {
  4263. debug('replaceTilde pr', pr)
  4264. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4265. ' <' + M + '.' + (+m + 1) + '.0'
  4266. } else {
  4267. // ~1.2.3 == >=1.2.3 <1.3.0
  4268. ret = '>=' + M + '.' + m + '.' + p +
  4269. ' <' + M + '.' + (+m + 1) + '.0'
  4270. }
  4271. debug('tilde return', ret)
  4272. return ret
  4273. })
  4274. }
  4275. // ^ --> * (any, kinda silly)
  4276. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4277. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4278. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4279. // ^1.2.3 --> >=1.2.3 <2.0.0
  4280. // ^1.2.0 --> >=1.2.0 <2.0.0
  4281. function replaceCarets (comp, options) {
  4282. return comp.trim().split(/\s+/).map(function (comp) {
  4283. return replaceCaret(comp, options)
  4284. }).join(' ')
  4285. }
  4286. function replaceCaret (comp, options) {
  4287. debug('caret', comp, options)
  4288. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4289. return comp.replace(r, function (_, M, m, p, pr) {
  4290. debug('caret', comp, _, M, m, p, pr)
  4291. var ret
  4292. if (isX(M)) {
  4293. ret = ''
  4294. } else if (isX(m)) {
  4295. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4296. } else if (isX(p)) {
  4297. if (M === '0') {
  4298. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4299. } else {
  4300. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4301. }
  4302. } else if (pr) {
  4303. debug('replaceCaret pr', pr)
  4304. if (M === '0') {
  4305. if (m === '0') {
  4306. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4307. ' <' + M + '.' + m + '.' + (+p + 1)
  4308. } else {
  4309. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4310. ' <' + M + '.' + (+m + 1) + '.0'
  4311. }
  4312. } else {
  4313. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4314. ' <' + (+M + 1) + '.0.0'
  4315. }
  4316. } else {
  4317. debug('no pr')
  4318. if (M === '0') {
  4319. if (m === '0') {
  4320. ret = '>=' + M + '.' + m + '.' + p +
  4321. ' <' + M + '.' + m + '.' + (+p + 1)
  4322. } else {
  4323. ret = '>=' + M + '.' + m + '.' + p +
  4324. ' <' + M + '.' + (+m + 1) + '.0'
  4325. }
  4326. } else {
  4327. ret = '>=' + M + '.' + m + '.' + p +
  4328. ' <' + (+M + 1) + '.0.0'
  4329. }
  4330. }
  4331. debug('caret return', ret)
  4332. return ret
  4333. })
  4334. }
  4335. function replaceXRanges (comp, options) {
  4336. debug('replaceXRanges', comp, options)
  4337. return comp.split(/\s+/).map(function (comp) {
  4338. return replaceXRange(comp, options)
  4339. }).join(' ')
  4340. }
  4341. function replaceXRange (comp, options) {
  4342. comp = comp.trim()
  4343. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4344. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4345. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4346. var xM = isX(M)
  4347. var xm = xM || isX(m)
  4348. var xp = xm || isX(p)
  4349. var anyX = xp
  4350. if (gtlt === '=' && anyX) {
  4351. gtlt = ''
  4352. }
  4353. if (xM) {
  4354. if (gtlt === '>' || gtlt === '<') {
  4355. // nothing is allowed
  4356. ret = '<0.0.0'
  4357. } else {
  4358. // nothing is forbidden
  4359. ret = '*'
  4360. }
  4361. } else if (gtlt && anyX) {
  4362. // we know patch is an x, because we have any x at all.
  4363. // replace X with 0
  4364. if (xm) {
  4365. m = 0
  4366. }
  4367. p = 0
  4368. if (gtlt === '>') {
  4369. // >1 => >=2.0.0
  4370. // >1.2 => >=1.3.0
  4371. // >1.2.3 => >= 1.2.4
  4372. gtlt = '>='
  4373. if (xm) {
  4374. M = +M + 1
  4375. m = 0
  4376. p = 0
  4377. } else {
  4378. m = +m + 1
  4379. p = 0
  4380. }
  4381. } else if (gtlt === '<=') {
  4382. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4383. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4384. gtlt = '<'
  4385. if (xm) {
  4386. M = +M + 1
  4387. } else {
  4388. m = +m + 1
  4389. }
  4390. }
  4391. ret = gtlt + M + '.' + m + '.' + p
  4392. } else if (xm) {
  4393. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4394. } else if (xp) {
  4395. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4396. }
  4397. debug('xRange return', ret)
  4398. return ret
  4399. })
  4400. }
  4401. // Because * is AND-ed with everything else in the comparator,
  4402. // and '' means "any version", just remove the *s entirely.
  4403. function replaceStars (comp, options) {
  4404. debug('replaceStars', comp, options)
  4405. // Looseness is ignored here. star is always as loose as it gets!
  4406. return comp.trim().replace(re[STAR], '')
  4407. }
  4408. // This function is passed to string.replace(re[HYPHENRANGE])
  4409. // M, m, patch, prerelease, build
  4410. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4411. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4412. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4413. function hyphenReplace ($0,
  4414. from, fM, fm, fp, fpr, fb,
  4415. to, tM, tm, tp, tpr, tb) {
  4416. if (isX(fM)) {
  4417. from = ''
  4418. } else if (isX(fm)) {
  4419. from = '>=' + fM + '.0.0'
  4420. } else if (isX(fp)) {
  4421. from = '>=' + fM + '.' + fm + '.0'
  4422. } else {
  4423. from = '>=' + from
  4424. }
  4425. if (isX(tM)) {
  4426. to = ''
  4427. } else if (isX(tm)) {
  4428. to = '<' + (+tM + 1) + '.0.0'
  4429. } else if (isX(tp)) {
  4430. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4431. } else if (tpr) {
  4432. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4433. } else {
  4434. to = '<=' + to
  4435. }
  4436. return (from + ' ' + to).trim()
  4437. }
  4438. // if ANY of the sets match ALL of its comparators, then pass
  4439. Range.prototype.test = function (version) {
  4440. if (!version) {
  4441. return false
  4442. }
  4443. if (typeof version === 'string') {
  4444. version = new SemVer(version, this.options)
  4445. }
  4446. for (var i = 0; i < this.set.length; i++) {
  4447. if (testSet(this.set[i], version, this.options)) {
  4448. return true
  4449. }
  4450. }
  4451. return false
  4452. }
  4453. function testSet (set, version, options) {
  4454. for (var i = 0; i < set.length; i++) {
  4455. if (!set[i].test(version)) {
  4456. return false
  4457. }
  4458. }
  4459. if (version.prerelease.length && !options.includePrerelease) {
  4460. // Find the set of versions that are allowed to have prereleases
  4461. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4462. // That should allow `1.2.3-pr.2` to pass.
  4463. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4464. // even though it's within the range set by the comparators.
  4465. for (i = 0; i < set.length; i++) {
  4466. debug(set[i].semver)
  4467. if (set[i].semver === ANY) {
  4468. continue
  4469. }
  4470. if (set[i].semver.prerelease.length > 0) {
  4471. var allowed = set[i].semver
  4472. if (allowed.major === version.major &&
  4473. allowed.minor === version.minor &&
  4474. allowed.patch === version.patch) {
  4475. return true
  4476. }
  4477. }
  4478. }
  4479. // Version has a -pre, but it's not one of the ones we like.
  4480. return false
  4481. }
  4482. return true
  4483. }
  4484. exports.satisfies = satisfies
  4485. function satisfies (version, range, options) {
  4486. try {
  4487. range = new Range(range, options)
  4488. } catch (er) {
  4489. return false
  4490. }
  4491. return range.test(version)
  4492. }
  4493. exports.maxSatisfying = maxSatisfying
  4494. function maxSatisfying (versions, range, options) {
  4495. var max = null
  4496. var maxSV = null
  4497. try {
  4498. var rangeObj = new Range(range, options)
  4499. } catch (er) {
  4500. return null
  4501. }
  4502. versions.forEach(function (v) {
  4503. if (rangeObj.test(v)) {
  4504. // satisfies(v, range, options)
  4505. if (!max || maxSV.compare(v) === -1) {
  4506. // compare(max, v, true)
  4507. max = v
  4508. maxSV = new SemVer(max, options)
  4509. }
  4510. }
  4511. })
  4512. return max
  4513. }
  4514. exports.minSatisfying = minSatisfying
  4515. function minSatisfying (versions, range, options) {
  4516. var min = null
  4517. var minSV = null
  4518. try {
  4519. var rangeObj = new Range(range, options)
  4520. } catch (er) {
  4521. return null
  4522. }
  4523. versions.forEach(function (v) {
  4524. if (rangeObj.test(v)) {
  4525. // satisfies(v, range, options)
  4526. if (!min || minSV.compare(v) === 1) {
  4527. // compare(min, v, true)
  4528. min = v
  4529. minSV = new SemVer(min, options)
  4530. }
  4531. }
  4532. })
  4533. return min
  4534. }
  4535. exports.minVersion = minVersion
  4536. function minVersion (range, loose) {
  4537. range = new Range(range, loose)
  4538. var minver = new SemVer('0.0.0')
  4539. if (range.test(minver)) {
  4540. return minver
  4541. }
  4542. minver = new SemVer('0.0.0-0')
  4543. if (range.test(minver)) {
  4544. return minver
  4545. }
  4546. minver = null
  4547. for (var i = 0; i < range.set.length; ++i) {
  4548. var comparators = range.set[i]
  4549. comparators.forEach(function (comparator) {
  4550. // Clone to avoid manipulating the comparator's semver object.
  4551. var compver = new SemVer(comparator.semver.version)
  4552. switch (comparator.operator) {
  4553. case '>':
  4554. if (compver.prerelease.length === 0) {
  4555. compver.patch++
  4556. } else {
  4557. compver.prerelease.push(0)
  4558. }
  4559. compver.raw = compver.format()
  4560. /* fallthrough */
  4561. case '':
  4562. case '>=':
  4563. if (!minver || gt(minver, compver)) {
  4564. minver = compver
  4565. }
  4566. break
  4567. case '<':
  4568. case '<=':
  4569. /* Ignore maximum versions */
  4570. break
  4571. /* istanbul ignore next */
  4572. default:
  4573. throw new Error('Unexpected operation: ' + comparator.operator)
  4574. }
  4575. })
  4576. }
  4577. if (minver && range.test(minver)) {
  4578. return minver
  4579. }
  4580. return null
  4581. }
  4582. exports.validRange = validRange
  4583. function validRange (range, options) {
  4584. try {
  4585. // Return '*' instead of '' so that truthiness works.
  4586. // This will throw if it's invalid anyway
  4587. return new Range(range, options).range || '*'
  4588. } catch (er) {
  4589. return null
  4590. }
  4591. }
  4592. // Determine if version is less than all the versions possible in the range
  4593. exports.ltr = ltr
  4594. function ltr (version, range, options) {
  4595. return outside(version, range, '<', options)
  4596. }
  4597. // Determine if version is greater than all the versions possible in the range.
  4598. exports.gtr = gtr
  4599. function gtr (version, range, options) {
  4600. return outside(version, range, '>', options)
  4601. }
  4602. exports.outside = outside
  4603. function outside (version, range, hilo, options) {
  4604. version = new SemVer(version, options)
  4605. range = new Range(range, options)
  4606. var gtfn, ltefn, ltfn, comp, ecomp
  4607. switch (hilo) {
  4608. case '>':
  4609. gtfn = gt
  4610. ltefn = lte
  4611. ltfn = lt
  4612. comp = '>'
  4613. ecomp = '>='
  4614. break
  4615. case '<':
  4616. gtfn = lt
  4617. ltefn = gte
  4618. ltfn = gt
  4619. comp = '<'
  4620. ecomp = '<='
  4621. break
  4622. default:
  4623. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4624. }
  4625. // If it satisifes the range it is not outside
  4626. if (satisfies(version, range, options)) {
  4627. return false
  4628. }
  4629. // From now on, variable terms are as if we're in "gtr" mode.
  4630. // but note that everything is flipped for the "ltr" function.
  4631. for (var i = 0; i < range.set.length; ++i) {
  4632. var comparators = range.set[i]
  4633. var high = null
  4634. var low = null
  4635. comparators.forEach(function (comparator) {
  4636. if (comparator.semver === ANY) {
  4637. comparator = new Comparator('>=0.0.0')
  4638. }
  4639. high = high || comparator
  4640. low = low || comparator
  4641. if (gtfn(comparator.semver, high.semver, options)) {
  4642. high = comparator
  4643. } else if (ltfn(comparator.semver, low.semver, options)) {
  4644. low = comparator
  4645. }
  4646. })
  4647. // If the edge version comparator has a operator then our version
  4648. // isn't outside it
  4649. if (high.operator === comp || high.operator === ecomp) {
  4650. return false
  4651. }
  4652. // If the lowest version comparator has an operator and our version
  4653. // is less than it then it isn't higher than the range
  4654. if ((!low.operator || low.operator === comp) &&
  4655. ltefn(version, low.semver)) {
  4656. return false
  4657. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4658. return false
  4659. }
  4660. }
  4661. return true
  4662. }
  4663. exports.prerelease = prerelease
  4664. function prerelease (version, options) {
  4665. var parsed = parse(version, options)
  4666. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4667. }
  4668. exports.intersects = intersects
  4669. function intersects (r1, r2, options) {
  4670. r1 = new Range(r1, options)
  4671. r2 = new Range(r2, options)
  4672. return r1.intersects(r2)
  4673. }
  4674. exports.coerce = coerce
  4675. function coerce (version) {
  4676. if (version instanceof SemVer) {
  4677. return version
  4678. }
  4679. if (typeof version !== 'string') {
  4680. return null
  4681. }
  4682. var match = version.match(re[COERCE])
  4683. if (match == null) {
  4684. return null
  4685. }
  4686. return parse(match[1] +
  4687. '.' + (match[2] || '0') +
  4688. '.' + (match[3] || '0'))
  4689. }
  4690. /***/ }),
  4691. /***/ 287:
  4692. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4693. "use strict";
  4694. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4695. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4696. return new (P || (P = Promise))(function (resolve, reject) {
  4697. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4698. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4699. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4700. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4701. });
  4702. };
  4703. var __importStar = (this && this.__importStar) || function (mod) {
  4704. if (mod && mod.__esModule) return mod;
  4705. var result = {};
  4706. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4707. result["default"] = mod;
  4708. return result;
  4709. };
  4710. var __importDefault = (this && this.__importDefault) || function (mod) {
  4711. return (mod && mod.__esModule) ? mod : { "default": mod };
  4712. };
  4713. Object.defineProperty(exports, "__esModule", { value: true });
  4714. const assert = __importStar(__webpack_require__(357));
  4715. const core = __importStar(__webpack_require__(470));
  4716. const exec = __importStar(__webpack_require__(986));
  4717. const fs = __importStar(__webpack_require__(747));
  4718. const io = __importStar(__webpack_require__(1));
  4719. const os = __importStar(__webpack_require__(87));
  4720. const path = __importStar(__webpack_require__(622));
  4721. const regexpHelper = __importStar(__webpack_require__(528));
  4722. const stateHelper = __importStar(__webpack_require__(153));
  4723. const urlHelper = __importStar(__webpack_require__(81));
  4724. const v4_1 = __importDefault(__webpack_require__(826));
  4725. const IS_WINDOWS = process.platform === 'win32';
  4726. const SSH_COMMAND_KEY = 'core.sshCommand';
  4727. function createAuthHelper(git, settings) {
  4728. return new GitAuthHelper(git, settings);
  4729. }
  4730. exports.createAuthHelper = createAuthHelper;
  4731. class GitAuthHelper {
  4732. constructor(gitCommandManager, gitSourceSettings) {
  4733. this.sshCommand = '';
  4734. this.sshKeyPath = '';
  4735. this.sshKnownHostsPath = '';
  4736. this.temporaryHomePath = '';
  4737. this.git = gitCommandManager;
  4738. this.settings = gitSourceSettings || {};
  4739. // Token auth header
  4740. const serverUrl = urlHelper.getServerUrl();
  4741. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4742. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4743. core.setSecret(basicCredential);
  4744. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4745. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4746. // Instead of SSH URL
  4747. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4748. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4749. }
  4750. configureAuth() {
  4751. return __awaiter(this, void 0, void 0, function* () {
  4752. // Remove possible previous values
  4753. yield this.removeAuth();
  4754. // Configure new values
  4755. yield this.configureSsh();
  4756. yield this.configureToken();
  4757. });
  4758. }
  4759. configureGlobalAuth() {
  4760. return __awaiter(this, void 0, void 0, function* () {
  4761. // Create a temp home directory
  4762. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4763. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4764. const uniqueId = v4_1.default();
  4765. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4766. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4767. // Copy the global git config
  4768. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4769. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4770. let configExists = false;
  4771. try {
  4772. yield fs.promises.stat(gitConfigPath);
  4773. configExists = true;
  4774. }
  4775. catch (err) {
  4776. if (err.code !== 'ENOENT') {
  4777. throw err;
  4778. }
  4779. }
  4780. if (configExists) {
  4781. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4782. yield io.cp(gitConfigPath, newGitConfigPath);
  4783. }
  4784. else {
  4785. yield fs.promises.writeFile(newGitConfigPath, '');
  4786. }
  4787. try {
  4788. // Override HOME
  4789. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4790. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4791. // Configure the token
  4792. yield this.configureToken(newGitConfigPath, true);
  4793. // Configure HTTPS instead of SSH
  4794. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4795. if (!this.settings.sshKey) {
  4796. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4797. }
  4798. }
  4799. catch (err) {
  4800. // Unset in case somehow written to the real global config
  4801. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4802. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4803. throw err;
  4804. }
  4805. });
  4806. }
  4807. configureSubmoduleAuth() {
  4808. return __awaiter(this, void 0, void 0, function* () {
  4809. // Remove possible previous HTTPS instead of SSH
  4810. yield this.removeGitConfig(this.insteadOfKey, true);
  4811. if (this.settings.persistCredentials) {
  4812. // Configure a placeholder value. This approach avoids the credential being captured
  4813. // by process creation audit events, which are commonly logged. For more information,
  4814. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4815. 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);
  4816. // Replace the placeholder
  4817. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4818. for (const configPath of configPaths) {
  4819. core.debug(`Replacing token placeholder in '${configPath}'`);
  4820. yield this.replaceTokenPlaceholder(configPath);
  4821. }
  4822. if (this.settings.sshKey) {
  4823. // Configure core.sshCommand
  4824. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4825. }
  4826. else {
  4827. // Configure HTTPS instead of SSH
  4828. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4829. }
  4830. }
  4831. });
  4832. }
  4833. removeAuth() {
  4834. return __awaiter(this, void 0, void 0, function* () {
  4835. yield this.removeSsh();
  4836. yield this.removeToken();
  4837. });
  4838. }
  4839. removeGlobalAuth() {
  4840. return __awaiter(this, void 0, void 0, function* () {
  4841. core.debug(`Unsetting HOME override`);
  4842. this.git.removeEnvironmentVariable('HOME');
  4843. yield io.rmRF(this.temporaryHomePath);
  4844. });
  4845. }
  4846. configureSsh() {
  4847. return __awaiter(this, void 0, void 0, function* () {
  4848. if (!this.settings.sshKey) {
  4849. return;
  4850. }
  4851. // Write key
  4852. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4853. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4854. const uniqueId = v4_1.default();
  4855. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4856. stateHelper.setSshKeyPath(this.sshKeyPath);
  4857. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4858. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4859. // Remove inherited permissions on Windows
  4860. if (IS_WINDOWS) {
  4861. const icacls = yield io.which('icacls.exe');
  4862. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4863. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4864. }
  4865. // Write known hosts
  4866. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4867. let userKnownHosts = '';
  4868. try {
  4869. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4870. }
  4871. catch (err) {
  4872. if (err.code !== 'ENOENT') {
  4873. throw err;
  4874. }
  4875. }
  4876. let knownHosts = '';
  4877. if (userKnownHosts) {
  4878. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4879. }
  4880. if (this.settings.sshKnownHosts) {
  4881. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4882. }
  4883. 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`;
  4884. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4885. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4886. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4887. // Configure GIT_SSH_COMMAND
  4888. const sshPath = yield io.which('ssh', true);
  4889. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4890. if (this.settings.sshStrict) {
  4891. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4892. }
  4893. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4894. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4895. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4896. // Configure core.sshCommand
  4897. if (this.settings.persistCredentials) {
  4898. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4899. }
  4900. });
  4901. }
  4902. configureToken(configPath, globalConfig) {
  4903. return __awaiter(this, void 0, void 0, function* () {
  4904. // Validate args
  4905. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4906. // Default config path
  4907. if (!configPath && !globalConfig) {
  4908. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4909. }
  4910. // Configure a placeholder value. This approach avoids the credential being captured
  4911. // by process creation audit events, which are commonly logged. For more information,
  4912. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4913. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4914. // Replace the placeholder
  4915. yield this.replaceTokenPlaceholder(configPath || '');
  4916. });
  4917. }
  4918. replaceTokenPlaceholder(configPath) {
  4919. return __awaiter(this, void 0, void 0, function* () {
  4920. assert.ok(configPath, 'configPath is not defined');
  4921. let content = (yield fs.promises.readFile(configPath)).toString();
  4922. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4923. if (placeholderIndex < 0 ||
  4924. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4925. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4926. }
  4927. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4928. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4929. yield fs.promises.writeFile(configPath, content);
  4930. });
  4931. }
  4932. removeSsh() {
  4933. return __awaiter(this, void 0, void 0, function* () {
  4934. // SSH key
  4935. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4936. if (keyPath) {
  4937. try {
  4938. yield io.rmRF(keyPath);
  4939. }
  4940. catch (err) {
  4941. core.debug(err.message);
  4942. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4943. }
  4944. }
  4945. // SSH known hosts
  4946. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4947. if (knownHostsPath) {
  4948. try {
  4949. yield io.rmRF(knownHostsPath);
  4950. }
  4951. catch (_a) {
  4952. // Intentionally empty
  4953. }
  4954. }
  4955. // SSH command
  4956. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4957. });
  4958. }
  4959. removeToken() {
  4960. return __awaiter(this, void 0, void 0, function* () {
  4961. // HTTP extra header
  4962. yield this.removeGitConfig(this.tokenConfigKey);
  4963. });
  4964. }
  4965. removeGitConfig(configKey, submoduleOnly = false) {
  4966. return __awaiter(this, void 0, void 0, function* () {
  4967. if (!submoduleOnly) {
  4968. if ((yield this.git.configExists(configKey)) &&
  4969. !(yield this.git.tryConfigUnset(configKey))) {
  4970. // Load the config contents
  4971. core.warning(`Failed to remove '${configKey}' from the git config`);
  4972. }
  4973. }
  4974. const pattern = regexpHelper.escape(configKey);
  4975. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4976. });
  4977. }
  4978. }
  4979. /***/ }),
  4980. /***/ 289:
  4981. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4982. "use strict";
  4983. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4984. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4985. return new (P || (P = Promise))(function (resolve, reject) {
  4986. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4987. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4988. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4989. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4990. });
  4991. };
  4992. var __importStar = (this && this.__importStar) || function (mod) {
  4993. if (mod && mod.__esModule) return mod;
  4994. var result = {};
  4995. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4996. result["default"] = mod;
  4997. return result;
  4998. };
  4999. Object.defineProperty(exports, "__esModule", { value: true });
  5000. const core = __importStar(__webpack_require__(470));
  5001. const exec = __importStar(__webpack_require__(986));
  5002. const fshelper = __importStar(__webpack_require__(618));
  5003. const io = __importStar(__webpack_require__(1));
  5004. const path = __importStar(__webpack_require__(622));
  5005. const refHelper = __importStar(__webpack_require__(227));
  5006. const regexpHelper = __importStar(__webpack_require__(528));
  5007. const retryHelper = __importStar(__webpack_require__(587));
  5008. const git_version_1 = __webpack_require__(559);
  5009. // Auth header not supported before 2.9
  5010. // Wire protocol v2 not supported before 2.18
  5011. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5012. function createCommandManager(workingDirectory, lfs) {
  5013. return __awaiter(this, void 0, void 0, function* () {
  5014. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5015. });
  5016. }
  5017. exports.createCommandManager = createCommandManager;
  5018. class GitCommandManager {
  5019. // Private constructor; use createCommandManager()
  5020. constructor() {
  5021. this.gitEnv = {
  5022. GIT_TERMINAL_PROMPT: '0',
  5023. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5024. };
  5025. this.gitPath = '';
  5026. this.lfs = false;
  5027. this.workingDirectory = '';
  5028. }
  5029. branchDelete(remote, branch) {
  5030. return __awaiter(this, void 0, void 0, function* () {
  5031. const args = ['branch', '--delete', '--force'];
  5032. if (remote) {
  5033. args.push('--remote');
  5034. }
  5035. args.push(branch);
  5036. yield this.execGit(args);
  5037. });
  5038. }
  5039. branchExists(remote, pattern) {
  5040. return __awaiter(this, void 0, void 0, function* () {
  5041. const args = ['branch', '--list'];
  5042. if (remote) {
  5043. args.push('--remote');
  5044. }
  5045. args.push(pattern);
  5046. const output = yield this.execGit(args);
  5047. return !!output.stdout.trim();
  5048. });
  5049. }
  5050. branchList(remote) {
  5051. return __awaiter(this, void 0, void 0, function* () {
  5052. const result = [];
  5053. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5054. // "branch --list" is more difficult when in a detached HEAD state.
  5055. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5056. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5057. const args = ['rev-parse', '--symbolic-full-name'];
  5058. if (remote) {
  5059. args.push('--remotes=origin');
  5060. }
  5061. else {
  5062. args.push('--branches');
  5063. }
  5064. const output = yield this.execGit(args);
  5065. for (let branch of output.stdout.trim().split('\n')) {
  5066. branch = branch.trim();
  5067. if (branch) {
  5068. if (branch.startsWith('refs/heads/')) {
  5069. branch = branch.substr('refs/heads/'.length);
  5070. }
  5071. else if (branch.startsWith('refs/remotes/')) {
  5072. branch = branch.substr('refs/remotes/'.length);
  5073. }
  5074. result.push(branch);
  5075. }
  5076. }
  5077. return result;
  5078. });
  5079. }
  5080. checkout(ref, startPoint) {
  5081. return __awaiter(this, void 0, void 0, function* () {
  5082. const args = ['checkout', '--progress', '--force'];
  5083. if (startPoint) {
  5084. args.push('-B', ref, startPoint);
  5085. }
  5086. else {
  5087. args.push(ref);
  5088. }
  5089. yield this.execGit(args);
  5090. });
  5091. }
  5092. checkoutDetach() {
  5093. return __awaiter(this, void 0, void 0, function* () {
  5094. const args = ['checkout', '--detach'];
  5095. yield this.execGit(args);
  5096. });
  5097. }
  5098. config(configKey, configValue, globalConfig) {
  5099. return __awaiter(this, void 0, void 0, function* () {
  5100. yield this.execGit([
  5101. 'config',
  5102. globalConfig ? '--global' : '--local',
  5103. configKey,
  5104. configValue
  5105. ]);
  5106. });
  5107. }
  5108. configExists(configKey, globalConfig) {
  5109. return __awaiter(this, void 0, void 0, function* () {
  5110. const pattern = regexpHelper.escape(configKey);
  5111. const output = yield this.execGit([
  5112. 'config',
  5113. globalConfig ? '--global' : '--local',
  5114. '--name-only',
  5115. '--get-regexp',
  5116. pattern
  5117. ], true);
  5118. return output.exitCode === 0;
  5119. });
  5120. }
  5121. fetch(refSpec, fetchDepth) {
  5122. return __awaiter(this, void 0, void 0, function* () {
  5123. const args = ['-c', 'protocol.version=2', 'fetch'];
  5124. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5125. args.push('--no-tags');
  5126. }
  5127. args.push('--prune', '--progress', '--no-recurse-submodules');
  5128. if (fetchDepth && fetchDepth > 0) {
  5129. args.push(`--depth=${fetchDepth}`);
  5130. }
  5131. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5132. args.push('--unshallow');
  5133. }
  5134. args.push('origin');
  5135. for (const arg of refSpec) {
  5136. args.push(arg);
  5137. }
  5138. const that = this;
  5139. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5140. yield that.execGit(args);
  5141. }));
  5142. });
  5143. }
  5144. getDefaultBranch(repositoryUrl) {
  5145. return __awaiter(this, void 0, void 0, function* () {
  5146. let output;
  5147. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5148. output = yield this.execGit([
  5149. 'ls-remote',
  5150. '--quiet',
  5151. '--exit-code',
  5152. '--symref',
  5153. repositoryUrl,
  5154. 'HEAD'
  5155. ]);
  5156. }));
  5157. if (output) {
  5158. // Satisfy compiler, will always be set
  5159. for (let line of output.stdout.trim().split('\n')) {
  5160. line = line.trim();
  5161. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  5162. return line
  5163. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  5164. .trim();
  5165. }
  5166. }
  5167. }
  5168. throw new Error('Unexpected output when retrieving default branch');
  5169. });
  5170. }
  5171. getWorkingDirectory() {
  5172. return this.workingDirectory;
  5173. }
  5174. init() {
  5175. return __awaiter(this, void 0, void 0, function* () {
  5176. yield this.execGit(['init', this.workingDirectory]);
  5177. });
  5178. }
  5179. isDetached() {
  5180. return __awaiter(this, void 0, void 0, function* () {
  5181. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5182. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5183. return !output.stdout.trim().startsWith('refs/heads/');
  5184. });
  5185. }
  5186. lfsFetch(ref) {
  5187. return __awaiter(this, void 0, void 0, function* () {
  5188. const args = ['lfs', 'fetch', 'origin', ref];
  5189. const that = this;
  5190. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5191. yield that.execGit(args);
  5192. }));
  5193. });
  5194. }
  5195. lfsInstall() {
  5196. return __awaiter(this, void 0, void 0, function* () {
  5197. yield this.execGit(['lfs', 'install', '--local']);
  5198. });
  5199. }
  5200. log1(format) {
  5201. return __awaiter(this, void 0, void 0, function* () {
  5202. var args = format ? ['log', '-1', format] : ['log', '-1'];
  5203. var silent = format ? false : true;
  5204. const output = yield this.execGit(args, false, silent);
  5205. return output.stdout;
  5206. });
  5207. }
  5208. remoteAdd(remoteName, remoteUrl) {
  5209. return __awaiter(this, void 0, void 0, function* () {
  5210. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5211. });
  5212. }
  5213. removeEnvironmentVariable(name) {
  5214. delete this.gitEnv[name];
  5215. }
  5216. /**
  5217. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5218. * For an annotated tag, the tag SHA is returned.
  5219. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  5220. * @returns {Promise<string>}
  5221. */
  5222. revParse(ref) {
  5223. return __awaiter(this, void 0, void 0, function* () {
  5224. const output = yield this.execGit(['rev-parse', ref]);
  5225. return output.stdout.trim();
  5226. });
  5227. }
  5228. setEnvironmentVariable(name, value) {
  5229. this.gitEnv[name] = value;
  5230. }
  5231. shaExists(sha) {
  5232. return __awaiter(this, void 0, void 0, function* () {
  5233. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5234. const output = yield this.execGit(args, true);
  5235. return output.exitCode === 0;
  5236. });
  5237. }
  5238. submoduleForeach(command, recursive) {
  5239. return __awaiter(this, void 0, void 0, function* () {
  5240. const args = ['submodule', 'foreach'];
  5241. if (recursive) {
  5242. args.push('--recursive');
  5243. }
  5244. args.push(command);
  5245. const output = yield this.execGit(args);
  5246. return output.stdout;
  5247. });
  5248. }
  5249. submoduleSync(recursive) {
  5250. return __awaiter(this, void 0, void 0, function* () {
  5251. const args = ['submodule', 'sync'];
  5252. if (recursive) {
  5253. args.push('--recursive');
  5254. }
  5255. yield this.execGit(args);
  5256. });
  5257. }
  5258. submoduleUpdate(fetchDepth, recursive) {
  5259. return __awaiter(this, void 0, void 0, function* () {
  5260. const args = ['-c', 'protocol.version=2'];
  5261. args.push('submodule', 'update', '--init', '--force');
  5262. if (fetchDepth > 0) {
  5263. args.push(`--depth=${fetchDepth}`);
  5264. }
  5265. if (recursive) {
  5266. args.push('--recursive');
  5267. }
  5268. yield this.execGit(args);
  5269. });
  5270. }
  5271. tagExists(pattern) {
  5272. return __awaiter(this, void 0, void 0, function* () {
  5273. const output = yield this.execGit(['tag', '--list', pattern]);
  5274. return !!output.stdout.trim();
  5275. });
  5276. }
  5277. tryClean() {
  5278. return __awaiter(this, void 0, void 0, function* () {
  5279. const output = yield this.execGit(['clean', '-ffdx'], true);
  5280. return output.exitCode === 0;
  5281. });
  5282. }
  5283. tryConfigUnset(configKey, globalConfig) {
  5284. return __awaiter(this, void 0, void 0, function* () {
  5285. const output = yield this.execGit([
  5286. 'config',
  5287. globalConfig ? '--global' : '--local',
  5288. '--unset-all',
  5289. configKey
  5290. ], true);
  5291. return output.exitCode === 0;
  5292. });
  5293. }
  5294. tryDisableAutomaticGarbageCollection() {
  5295. return __awaiter(this, void 0, void 0, function* () {
  5296. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5297. return output.exitCode === 0;
  5298. });
  5299. }
  5300. tryGetFetchUrl() {
  5301. return __awaiter(this, void 0, void 0, function* () {
  5302. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5303. if (output.exitCode !== 0) {
  5304. return '';
  5305. }
  5306. const stdout = output.stdout.trim();
  5307. if (stdout.includes('\n')) {
  5308. return '';
  5309. }
  5310. return stdout;
  5311. });
  5312. }
  5313. tryReset() {
  5314. return __awaiter(this, void 0, void 0, function* () {
  5315. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5316. return output.exitCode === 0;
  5317. });
  5318. }
  5319. static createCommandManager(workingDirectory, lfs) {
  5320. return __awaiter(this, void 0, void 0, function* () {
  5321. const result = new GitCommandManager();
  5322. yield result.initializeCommandManager(workingDirectory, lfs);
  5323. return result;
  5324. });
  5325. }
  5326. execGit(args, allowAllExitCodes = false, silent = false) {
  5327. return __awaiter(this, void 0, void 0, function* () {
  5328. fshelper.directoryExistsSync(this.workingDirectory, true);
  5329. const result = new GitOutput();
  5330. const env = {};
  5331. for (const key of Object.keys(process.env)) {
  5332. env[key] = process.env[key];
  5333. }
  5334. for (const key of Object.keys(this.gitEnv)) {
  5335. env[key] = this.gitEnv[key];
  5336. }
  5337. const stdout = [];
  5338. const options = {
  5339. cwd: this.workingDirectory,
  5340. env,
  5341. silent,
  5342. ignoreReturnCode: allowAllExitCodes,
  5343. listeners: {
  5344. stdout: (data) => {
  5345. stdout.push(data.toString());
  5346. }
  5347. }
  5348. };
  5349. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5350. result.stdout = stdout.join('');
  5351. return result;
  5352. });
  5353. }
  5354. initializeCommandManager(workingDirectory, lfs) {
  5355. return __awaiter(this, void 0, void 0, function* () {
  5356. this.workingDirectory = workingDirectory;
  5357. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5358. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5359. this.lfs = lfs;
  5360. if (!this.lfs) {
  5361. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5362. }
  5363. this.gitPath = yield io.which('git', true);
  5364. // Git version
  5365. core.debug('Getting git version');
  5366. let gitVersion = new git_version_1.GitVersion();
  5367. let gitOutput = yield this.execGit(['version']);
  5368. let stdout = gitOutput.stdout.trim();
  5369. if (!stdout.includes('\n')) {
  5370. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5371. if (match) {
  5372. gitVersion = new git_version_1.GitVersion(match[0]);
  5373. }
  5374. }
  5375. if (!gitVersion.isValid()) {
  5376. throw new Error('Unable to determine git version');
  5377. }
  5378. // Minimum git version
  5379. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5380. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5381. }
  5382. if (this.lfs) {
  5383. // Git-lfs version
  5384. core.debug('Getting git-lfs version');
  5385. let gitLfsVersion = new git_version_1.GitVersion();
  5386. const gitLfsPath = yield io.which('git-lfs', true);
  5387. gitOutput = yield this.execGit(['lfs', 'version']);
  5388. stdout = gitOutput.stdout.trim();
  5389. if (!stdout.includes('\n')) {
  5390. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5391. if (match) {
  5392. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5393. }
  5394. }
  5395. if (!gitLfsVersion.isValid()) {
  5396. throw new Error('Unable to determine git-lfs version');
  5397. }
  5398. // Minimum git-lfs version
  5399. // Note:
  5400. // - Auth header not supported before 2.1
  5401. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5402. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5403. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5404. }
  5405. }
  5406. // Set the user agent
  5407. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5408. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5409. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5410. });
  5411. }
  5412. }
  5413. class GitOutput {
  5414. constructor() {
  5415. this.stdout = '';
  5416. this.exitCode = 0;
  5417. }
  5418. }
  5419. /***/ }),
  5420. /***/ 293:
  5421. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5422. "use strict";
  5423. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5424. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5425. return new (P || (P = Promise))(function (resolve, reject) {
  5426. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5427. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5428. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5429. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5430. });
  5431. };
  5432. var __importStar = (this && this.__importStar) || function (mod) {
  5433. if (mod && mod.__esModule) return mod;
  5434. var result = {};
  5435. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5436. result["default"] = mod;
  5437. return result;
  5438. };
  5439. Object.defineProperty(exports, "__esModule", { value: true });
  5440. const core = __importStar(__webpack_require__(470));
  5441. const fsHelper = __importStar(__webpack_require__(618));
  5442. const gitAuthHelper = __importStar(__webpack_require__(287));
  5443. const gitCommandManager = __importStar(__webpack_require__(289));
  5444. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5445. const githubApiHelper = __importStar(__webpack_require__(464));
  5446. const io = __importStar(__webpack_require__(1));
  5447. const path = __importStar(__webpack_require__(622));
  5448. const refHelper = __importStar(__webpack_require__(227));
  5449. const stateHelper = __importStar(__webpack_require__(153));
  5450. const urlHelper = __importStar(__webpack_require__(81));
  5451. function getSource(settings) {
  5452. return __awaiter(this, void 0, void 0, function* () {
  5453. // Repository URL
  5454. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5455. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5456. // Remove conflicting file path
  5457. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5458. yield io.rmRF(settings.repositoryPath);
  5459. }
  5460. // Create directory
  5461. let isExisting = true;
  5462. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5463. isExisting = false;
  5464. yield io.mkdirP(settings.repositoryPath);
  5465. }
  5466. // Git command manager
  5467. core.startGroup('Getting Git version info');
  5468. const git = yield getGitCommandManager(settings);
  5469. core.endGroup();
  5470. // Prepare existing directory, otherwise recreate
  5471. if (isExisting) {
  5472. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5473. }
  5474. if (!git) {
  5475. // Downloading using REST API
  5476. core.info(`The repository will be downloaded using the GitHub REST API`);
  5477. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5478. if (settings.submodules) {
  5479. 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.`);
  5480. }
  5481. else if (settings.sshKey) {
  5482. 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.`);
  5483. }
  5484. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5485. return;
  5486. }
  5487. // Save state for POST action
  5488. stateHelper.setRepositoryPath(settings.repositoryPath);
  5489. // Initialize the repository
  5490. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5491. core.startGroup('Initializing the repository');
  5492. yield git.init();
  5493. yield git.remoteAdd('origin', repositoryUrl);
  5494. core.endGroup();
  5495. }
  5496. // Disable automatic garbage collection
  5497. core.startGroup('Disabling automatic garbage collection');
  5498. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5499. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5500. }
  5501. core.endGroup();
  5502. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5503. try {
  5504. // Configure auth
  5505. core.startGroup('Setting up auth');
  5506. yield authHelper.configureAuth();
  5507. core.endGroup();
  5508. // Determine the default branch
  5509. if (!settings.ref && !settings.commit) {
  5510. core.startGroup('Determining the default branch');
  5511. if (settings.sshKey) {
  5512. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  5513. }
  5514. else {
  5515. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5516. }
  5517. core.endGroup();
  5518. }
  5519. // LFS install
  5520. if (settings.lfs) {
  5521. yield git.lfsInstall();
  5522. }
  5523. // Fetch
  5524. core.startGroup('Fetching the repository');
  5525. if (settings.fetchDepth <= 0) {
  5526. // Fetch all branches and tags
  5527. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5528. yield git.fetch(refSpec);
  5529. // When all history is fetched, the ref we're interested in may have moved to a different
  5530. // commit (push or force push). If so, fetch again with a targeted refspec.
  5531. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5532. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5533. yield git.fetch(refSpec);
  5534. }
  5535. }
  5536. else {
  5537. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5538. yield git.fetch(refSpec, settings.fetchDepth);
  5539. }
  5540. core.endGroup();
  5541. // Checkout info
  5542. core.startGroup('Determining the checkout info');
  5543. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5544. core.endGroup();
  5545. // LFS fetch
  5546. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5547. // Explicit lfs fetch will fetch lfs objects in parallel.
  5548. if (settings.lfs) {
  5549. core.startGroup('Fetching LFS objects');
  5550. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5551. core.endGroup();
  5552. }
  5553. // Checkout
  5554. core.startGroup('Checking out the ref');
  5555. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5556. core.endGroup();
  5557. // Submodules
  5558. if (settings.submodules) {
  5559. try {
  5560. // Temporarily override global config
  5561. core.startGroup('Setting up auth for fetching submodules');
  5562. yield authHelper.configureGlobalAuth();
  5563. core.endGroup();
  5564. // Checkout submodules
  5565. core.startGroup('Fetching submodules');
  5566. yield git.submoduleSync(settings.nestedSubmodules);
  5567. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5568. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5569. core.endGroup();
  5570. // Persist credentials
  5571. if (settings.persistCredentials) {
  5572. core.startGroup('Persisting credentials for submodules');
  5573. yield authHelper.configureSubmoduleAuth();
  5574. core.endGroup();
  5575. }
  5576. }
  5577. finally {
  5578. // Remove temporary global config override
  5579. yield authHelper.removeGlobalAuth();
  5580. }
  5581. }
  5582. // Get commit information
  5583. const commitInfo = yield git.log1();
  5584. // Log commit sha
  5585. yield git.log1("--format='%H'");
  5586. // Check for incorrect pull request merge commit
  5587. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5588. }
  5589. finally {
  5590. // Remove auth
  5591. if (!settings.persistCredentials) {
  5592. core.startGroup('Removing auth');
  5593. yield authHelper.removeAuth();
  5594. core.endGroup();
  5595. }
  5596. }
  5597. });
  5598. }
  5599. exports.getSource = getSource;
  5600. function cleanup(repositoryPath) {
  5601. return __awaiter(this, void 0, void 0, function* () {
  5602. // Repo exists?
  5603. if (!repositoryPath ||
  5604. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5605. return;
  5606. }
  5607. let git;
  5608. try {
  5609. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5610. }
  5611. catch (_a) {
  5612. return;
  5613. }
  5614. // Remove auth
  5615. const authHelper = gitAuthHelper.createAuthHelper(git);
  5616. yield authHelper.removeAuth();
  5617. });
  5618. }
  5619. exports.cleanup = cleanup;
  5620. function getGitCommandManager(settings) {
  5621. return __awaiter(this, void 0, void 0, function* () {
  5622. core.info(`Working directory is '${settings.repositoryPath}'`);
  5623. try {
  5624. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5625. }
  5626. catch (err) {
  5627. // Git is required for LFS
  5628. if (settings.lfs) {
  5629. throw err;
  5630. }
  5631. // Otherwise fallback to REST API
  5632. return undefined;
  5633. }
  5634. });
  5635. }
  5636. /***/ }),
  5637. /***/ 294:
  5638. /***/ (function(module, __unusedexports, __webpack_require__) {
  5639. module.exports = parseOptions;
  5640. const { Deprecation } = __webpack_require__(692);
  5641. const { getUserAgent } = __webpack_require__(796);
  5642. const once = __webpack_require__(969);
  5643. const pkg = __webpack_require__(215);
  5644. const deprecateOptionsTimeout = once((log, deprecation) =>
  5645. log.warn(deprecation)
  5646. );
  5647. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5648. const deprecateOptionsHeaders = once((log, deprecation) =>
  5649. log.warn(deprecation)
  5650. );
  5651. function parseOptions(options, log, hook) {
  5652. if (options.headers) {
  5653. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5654. newObj[key.toLowerCase()] = options.headers[key];
  5655. return newObj;
  5656. }, {});
  5657. }
  5658. const clientDefaults = {
  5659. headers: options.headers || {},
  5660. request: options.request || {},
  5661. mediaType: {
  5662. previews: [],
  5663. format: ""
  5664. }
  5665. };
  5666. if (options.baseUrl) {
  5667. clientDefaults.baseUrl = options.baseUrl;
  5668. }
  5669. if (options.userAgent) {
  5670. clientDefaults.headers["user-agent"] = options.userAgent;
  5671. }
  5672. if (options.previews) {
  5673. clientDefaults.mediaType.previews = options.previews;
  5674. }
  5675. if (options.timeZone) {
  5676. clientDefaults.headers["time-zone"] = options.timeZone;
  5677. }
  5678. if (options.timeout) {
  5679. deprecateOptionsTimeout(
  5680. log,
  5681. new Deprecation(
  5682. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5683. )
  5684. );
  5685. clientDefaults.request.timeout = options.timeout;
  5686. }
  5687. if (options.agent) {
  5688. deprecateOptionsAgent(
  5689. log,
  5690. new Deprecation(
  5691. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5692. )
  5693. );
  5694. clientDefaults.request.agent = options.agent;
  5695. }
  5696. if (options.headers) {
  5697. deprecateOptionsHeaders(
  5698. log,
  5699. new Deprecation(
  5700. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5701. )
  5702. );
  5703. }
  5704. const userAgentOption = clientDefaults.headers["user-agent"];
  5705. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5706. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5707. .filter(Boolean)
  5708. .join(" ");
  5709. clientDefaults.request.hook = hook.bind(null, "request");
  5710. return clientDefaults;
  5711. }
  5712. /***/ }),
  5713. /***/ 297:
  5714. /***/ (function(module) {
  5715. module.exports = class HttpError extends Error {
  5716. constructor (message, code, headers) {
  5717. super(message)
  5718. // Maintains proper stack trace (only available on V8)
  5719. /* istanbul ignore next */
  5720. if (Error.captureStackTrace) {
  5721. Error.captureStackTrace(this, this.constructor)
  5722. }
  5723. this.name = 'HttpError'
  5724. this.code = code
  5725. this.headers = headers
  5726. }
  5727. }
  5728. /***/ }),
  5729. /***/ 299:
  5730. /***/ (function(__unusedmodule, exports) {
  5731. "use strict";
  5732. Object.defineProperty(exports, '__esModule', { value: true });
  5733. const VERSION = "1.1.2";
  5734. /**
  5735. * Some “list” response that can be paginated have a different response structure
  5736. *
  5737. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5738. * /installation/repositories also has `repository_selection`), as well as a key with
  5739. * the list of the items which name varies from endpoint to endpoint:
  5740. *
  5741. * - https://developer.github.com/v3/search/#example (key `items`)
  5742. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5743. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5744. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5745. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5746. *
  5747. * Octokit normalizes these responses so that paginated results are always returned following
  5748. * the same structure. One challenge is that if the list response has only one page, no Link
  5749. * header is provided, so this header alone is not sufficient to check wether a response is
  5750. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5751. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5752. * property because it also exists in the response of Get the combined status for a specific ref.
  5753. */
  5754. 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))?([^/]|$)/];
  5755. function normalizePaginatedListResponse(octokit, url, response) {
  5756. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5757. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5758. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5759. // to retrieve the same information.
  5760. const incompleteResults = response.data.incomplete_results;
  5761. const repositorySelection = response.data.repository_selection;
  5762. const totalCount = response.data.total_count;
  5763. delete response.data.incomplete_results;
  5764. delete response.data.repository_selection;
  5765. delete response.data.total_count;
  5766. const namespaceKey = Object.keys(response.data)[0];
  5767. const data = response.data[namespaceKey];
  5768. response.data = data;
  5769. if (typeof incompleteResults !== "undefined") {
  5770. response.data.incomplete_results = incompleteResults;
  5771. }
  5772. if (typeof repositorySelection !== "undefined") {
  5773. response.data.repository_selection = repositorySelection;
  5774. }
  5775. response.data.total_count = totalCount;
  5776. Object.defineProperty(response.data, namespaceKey, {
  5777. get() {
  5778. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5779. return Array.from(data);
  5780. }
  5781. });
  5782. }
  5783. function iterator(octokit, route, parameters) {
  5784. const options = octokit.request.endpoint(route, parameters);
  5785. const method = options.method;
  5786. const headers = options.headers;
  5787. let url = options.url;
  5788. return {
  5789. [Symbol.asyncIterator]: () => ({
  5790. next() {
  5791. if (!url) {
  5792. return Promise.resolve({
  5793. done: true
  5794. });
  5795. }
  5796. return octokit.request({
  5797. method,
  5798. url,
  5799. headers
  5800. }).then(response => {
  5801. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5802. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5803. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5804. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5805. return {
  5806. value: response
  5807. };
  5808. });
  5809. }
  5810. })
  5811. };
  5812. }
  5813. function paginate(octokit, route, parameters, mapFn) {
  5814. if (typeof parameters === "function") {
  5815. mapFn = parameters;
  5816. parameters = undefined;
  5817. }
  5818. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5819. }
  5820. function gather(octokit, results, iterator, mapFn) {
  5821. return iterator.next().then(result => {
  5822. if (result.done) {
  5823. return results;
  5824. }
  5825. let earlyExit = false;
  5826. function done() {
  5827. earlyExit = true;
  5828. }
  5829. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5830. if (earlyExit) {
  5831. return results;
  5832. }
  5833. return gather(octokit, results, iterator, mapFn);
  5834. });
  5835. }
  5836. /**
  5837. * @param octokit Octokit instance
  5838. * @param options Options passed to Octokit constructor
  5839. */
  5840. function paginateRest(octokit) {
  5841. return {
  5842. paginate: Object.assign(paginate.bind(null, octokit), {
  5843. iterator: iterator.bind(null, octokit)
  5844. })
  5845. };
  5846. }
  5847. paginateRest.VERSION = VERSION;
  5848. exports.paginateRest = paginateRest;
  5849. //# sourceMappingURL=index.js.map
  5850. /***/ }),
  5851. /***/ 323:
  5852. /***/ (function(module) {
  5853. "use strict";
  5854. var isStream = module.exports = function (stream) {
  5855. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5856. };
  5857. isStream.writable = function (stream) {
  5858. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5859. };
  5860. isStream.readable = function (stream) {
  5861. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5862. };
  5863. isStream.duplex = function (stream) {
  5864. return isStream.writable(stream) && isStream.readable(stream);
  5865. };
  5866. isStream.transform = function (stream) {
  5867. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5868. };
  5869. /***/ }),
  5870. /***/ 335:
  5871. /***/ (function(module, __unusedexports, __webpack_require__) {
  5872. module.exports = __webpack_require__(179);
  5873. /***/ }),
  5874. /***/ 336:
  5875. /***/ (function(module, __unusedexports, __webpack_require__) {
  5876. module.exports = hasLastPage
  5877. const deprecate = __webpack_require__(370)
  5878. const getPageLinks = __webpack_require__(577)
  5879. function hasLastPage (link) {
  5880. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5881. return getPageLinks(link).last
  5882. }
  5883. /***/ }),
  5884. /***/ 348:
  5885. /***/ (function(module, __unusedexports, __webpack_require__) {
  5886. "use strict";
  5887. module.exports = validate;
  5888. const { RequestError } = __webpack_require__(497);
  5889. const get = __webpack_require__(854);
  5890. const set = __webpack_require__(883);
  5891. function validate(octokit, options) {
  5892. if (!options.request.validate) {
  5893. return;
  5894. }
  5895. const { validate: params } = options.request;
  5896. Object.keys(params).forEach(parameterName => {
  5897. const parameter = get(params, parameterName);
  5898. const expectedType = parameter.type;
  5899. let parentParameterName;
  5900. let parentValue;
  5901. let parentParamIsPresent = true;
  5902. let parentParameterIsArray = false;
  5903. if (/\./.test(parameterName)) {
  5904. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5905. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5906. if (parentParameterIsArray) {
  5907. parentParameterName = parentParameterName.slice(0, -2);
  5908. }
  5909. parentValue = get(options, parentParameterName);
  5910. parentParamIsPresent =
  5911. parentParameterName === "headers" ||
  5912. (typeof parentValue === "object" && parentValue !== null);
  5913. }
  5914. const values = parentParameterIsArray
  5915. ? (get(options, parentParameterName) || []).map(
  5916. value => value[parameterName.split(/\./).pop()]
  5917. )
  5918. : [get(options, parameterName)];
  5919. values.forEach((value, i) => {
  5920. const valueIsPresent = typeof value !== "undefined";
  5921. const valueIsNull = value === null;
  5922. const currentParameterName = parentParameterIsArray
  5923. ? parameterName.replace(/\[\]/, `[${i}]`)
  5924. : parameterName;
  5925. if (!parameter.required && !valueIsPresent) {
  5926. return;
  5927. }
  5928. // if the parent parameter is of type object but allows null
  5929. // then the child parameters can be ignored
  5930. if (!parentParamIsPresent) {
  5931. return;
  5932. }
  5933. if (parameter.allowNull && valueIsNull) {
  5934. return;
  5935. }
  5936. if (!parameter.allowNull && valueIsNull) {
  5937. throw new RequestError(
  5938. `'${currentParameterName}' cannot be null`,
  5939. 400,
  5940. {
  5941. request: options
  5942. }
  5943. );
  5944. }
  5945. if (parameter.required && !valueIsPresent) {
  5946. throw new RequestError(
  5947. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5948. value
  5949. )}`,
  5950. 400,
  5951. {
  5952. request: options
  5953. }
  5954. );
  5955. }
  5956. // parse to integer before checking for enum
  5957. // so that string "1" will match enum with number 1
  5958. if (expectedType === "integer") {
  5959. const unparsedValue = value;
  5960. value = parseInt(value, 10);
  5961. if (isNaN(value)) {
  5962. throw new RequestError(
  5963. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5964. unparsedValue
  5965. )} is NaN`,
  5966. 400,
  5967. {
  5968. request: options
  5969. }
  5970. );
  5971. }
  5972. }
  5973. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5974. throw new RequestError(
  5975. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5976. value
  5977. )}`,
  5978. 400,
  5979. {
  5980. request: options
  5981. }
  5982. );
  5983. }
  5984. if (parameter.validation) {
  5985. const regex = new RegExp(parameter.validation);
  5986. if (!regex.test(value)) {
  5987. throw new RequestError(
  5988. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5989. value
  5990. )}`,
  5991. 400,
  5992. {
  5993. request: options
  5994. }
  5995. );
  5996. }
  5997. }
  5998. if (expectedType === "object" && typeof value === "string") {
  5999. try {
  6000. value = JSON.parse(value);
  6001. } catch (exception) {
  6002. throw new RequestError(
  6003. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  6004. value
  6005. )}`,
  6006. 400,
  6007. {
  6008. request: options
  6009. }
  6010. );
  6011. }
  6012. }
  6013. set(options, parameter.mapTo || currentParameterName, value);
  6014. });
  6015. });
  6016. return options;
  6017. }
  6018. /***/ }),
  6019. /***/ 349:
  6020. /***/ (function(module, __unusedexports, __webpack_require__) {
  6021. module.exports = authenticationRequestError;
  6022. const { RequestError } = __webpack_require__(497);
  6023. function authenticationRequestError(state, error, options) {
  6024. /* istanbul ignore next */
  6025. if (!error.headers) throw error;
  6026. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  6027. // handle "2FA required" error only
  6028. if (error.status !== 401 || !otpRequired) {
  6029. throw error;
  6030. }
  6031. if (
  6032. error.status === 401 &&
  6033. otpRequired &&
  6034. error.request &&
  6035. error.request.headers["x-github-otp"]
  6036. ) {
  6037. throw new RequestError(
  6038. "Invalid one-time password for two-factor authentication",
  6039. 401,
  6040. {
  6041. headers: error.headers,
  6042. request: options
  6043. }
  6044. );
  6045. }
  6046. if (typeof state.auth.on2fa !== "function") {
  6047. throw new RequestError(
  6048. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6049. 401,
  6050. {
  6051. headers: error.headers,
  6052. request: options
  6053. }
  6054. );
  6055. }
  6056. return Promise.resolve()
  6057. .then(() => {
  6058. return state.auth.on2fa();
  6059. })
  6060. .then(oneTimePassword => {
  6061. const newOptions = Object.assign(options, {
  6062. headers: Object.assign(
  6063. { "x-github-otp": oneTimePassword },
  6064. options.headers
  6065. )
  6066. });
  6067. return state.octokit.request(newOptions);
  6068. });
  6069. }
  6070. /***/ }),
  6071. /***/ 357:
  6072. /***/ (function(module) {
  6073. module.exports = require("assert");
  6074. /***/ }),
  6075. /***/ 363:
  6076. /***/ (function(module) {
  6077. module.exports = register
  6078. function register (state, name, method, options) {
  6079. if (typeof method !== 'function') {
  6080. throw new Error('method for before hook must be a function')
  6081. }
  6082. if (!options) {
  6083. options = {}
  6084. }
  6085. if (Array.isArray(name)) {
  6086. return name.reverse().reduce(function (callback, name) {
  6087. return register.bind(null, state, name, callback, options)
  6088. }, method)()
  6089. }
  6090. return Promise.resolve()
  6091. .then(function () {
  6092. if (!state.registry[name]) {
  6093. return method(options)
  6094. }
  6095. return (state.registry[name]).reduce(function (method, registered) {
  6096. return registered.hook.bind(null, method, options)
  6097. }, method)()
  6098. })
  6099. }
  6100. /***/ }),
  6101. /***/ 368:
  6102. /***/ (function(module) {
  6103. module.exports = function atob(str) {
  6104. return Buffer.from(str, 'base64').toString('binary')
  6105. }
  6106. /***/ }),
  6107. /***/ 370:
  6108. /***/ (function(module) {
  6109. module.exports = deprecate
  6110. const loggedMessages = {}
  6111. function deprecate (message) {
  6112. if (loggedMessages[message]) {
  6113. return
  6114. }
  6115. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6116. loggedMessages[message] = 1
  6117. }
  6118. /***/ }),
  6119. /***/ 385:
  6120. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6121. "use strict";
  6122. Object.defineProperty(exports, '__esModule', { value: true });
  6123. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6124. var isPlainObject = _interopDefault(__webpack_require__(696));
  6125. var universalUserAgent = __webpack_require__(562);
  6126. function lowercaseKeys(object) {
  6127. if (!object) {
  6128. return {};
  6129. }
  6130. return Object.keys(object).reduce((newObj, key) => {
  6131. newObj[key.toLowerCase()] = object[key];
  6132. return newObj;
  6133. }, {});
  6134. }
  6135. function mergeDeep(defaults, options) {
  6136. const result = Object.assign({}, defaults);
  6137. Object.keys(options).forEach(key => {
  6138. if (isPlainObject(options[key])) {
  6139. if (!(key in defaults)) Object.assign(result, {
  6140. [key]: options[key]
  6141. });else result[key] = mergeDeep(defaults[key], options[key]);
  6142. } else {
  6143. Object.assign(result, {
  6144. [key]: options[key]
  6145. });
  6146. }
  6147. });
  6148. return result;
  6149. }
  6150. function merge(defaults, route, options) {
  6151. if (typeof route === "string") {
  6152. let [method, url] = route.split(" ");
  6153. options = Object.assign(url ? {
  6154. method,
  6155. url
  6156. } : {
  6157. url: method
  6158. }, options);
  6159. } else {
  6160. options = Object.assign({}, route);
  6161. } // lowercase header names before merging with defaults to avoid duplicates
  6162. options.headers = lowercaseKeys(options.headers);
  6163. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6164. if (defaults && defaults.mediaType.previews.length) {
  6165. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6166. }
  6167. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6168. return mergedOptions;
  6169. }
  6170. function addQueryParameters(url, parameters) {
  6171. const separator = /\?/.test(url) ? "&" : "?";
  6172. const names = Object.keys(parameters);
  6173. if (names.length === 0) {
  6174. return url;
  6175. }
  6176. return url + separator + names.map(name => {
  6177. if (name === "q") {
  6178. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6179. }
  6180. return `${name}=${encodeURIComponent(parameters[name])}`;
  6181. }).join("&");
  6182. }
  6183. const urlVariableRegex = /\{[^}]+\}/g;
  6184. function removeNonChars(variableName) {
  6185. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6186. }
  6187. function extractUrlVariableNames(url) {
  6188. const matches = url.match(urlVariableRegex);
  6189. if (!matches) {
  6190. return [];
  6191. }
  6192. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6193. }
  6194. function omit(object, keysToOmit) {
  6195. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6196. obj[key] = object[key];
  6197. return obj;
  6198. }, {});
  6199. }
  6200. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6201. // TODO: create separate package.
  6202. //
  6203. // Copyright (c) 2012-2014, Bram Stein
  6204. // All rights reserved.
  6205. // Redistribution and use in source and binary forms, with or without
  6206. // modification, are permitted provided that the following conditions
  6207. // are met:
  6208. // 1. Redistributions of source code must retain the above copyright
  6209. // notice, this list of conditions and the following disclaimer.
  6210. // 2. Redistributions in binary form must reproduce the above copyright
  6211. // notice, this list of conditions and the following disclaimer in the
  6212. // documentation and/or other materials provided with the distribution.
  6213. // 3. The name of the author may not be used to endorse or promote products
  6214. // derived from this software without specific prior written permission.
  6215. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6216. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6217. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6218. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6219. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6220. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6221. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6222. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6223. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6224. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6225. /* istanbul ignore file */
  6226. function encodeReserved(str) {
  6227. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6228. if (!/%[0-9A-Fa-f]/.test(part)) {
  6229. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6230. }
  6231. return part;
  6232. }).join("");
  6233. }
  6234. function encodeUnreserved(str) {
  6235. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6236. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6237. });
  6238. }
  6239. function encodeValue(operator, value, key) {
  6240. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6241. if (key) {
  6242. return encodeUnreserved(key) + "=" + value;
  6243. } else {
  6244. return value;
  6245. }
  6246. }
  6247. function isDefined(value) {
  6248. return value !== undefined && value !== null;
  6249. }
  6250. function isKeyOperator(operator) {
  6251. return operator === ";" || operator === "&" || operator === "?";
  6252. }
  6253. function getValues(context, operator, key, modifier) {
  6254. var value = context[key],
  6255. result = [];
  6256. if (isDefined(value) && value !== "") {
  6257. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6258. value = value.toString();
  6259. if (modifier && modifier !== "*") {
  6260. value = value.substring(0, parseInt(modifier, 10));
  6261. }
  6262. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6263. } else {
  6264. if (modifier === "*") {
  6265. if (Array.isArray(value)) {
  6266. value.filter(isDefined).forEach(function (value) {
  6267. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6268. });
  6269. } else {
  6270. Object.keys(value).forEach(function (k) {
  6271. if (isDefined(value[k])) {
  6272. result.push(encodeValue(operator, value[k], k));
  6273. }
  6274. });
  6275. }
  6276. } else {
  6277. const tmp = [];
  6278. if (Array.isArray(value)) {
  6279. value.filter(isDefined).forEach(function (value) {
  6280. tmp.push(encodeValue(operator, value));
  6281. });
  6282. } else {
  6283. Object.keys(value).forEach(function (k) {
  6284. if (isDefined(value[k])) {
  6285. tmp.push(encodeUnreserved(k));
  6286. tmp.push(encodeValue(operator, value[k].toString()));
  6287. }
  6288. });
  6289. }
  6290. if (isKeyOperator(operator)) {
  6291. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6292. } else if (tmp.length !== 0) {
  6293. result.push(tmp.join(","));
  6294. }
  6295. }
  6296. }
  6297. } else {
  6298. if (operator === ";") {
  6299. if (isDefined(value)) {
  6300. result.push(encodeUnreserved(key));
  6301. }
  6302. } else if (value === "" && (operator === "&" || operator === "?")) {
  6303. result.push(encodeUnreserved(key) + "=");
  6304. } else if (value === "") {
  6305. result.push("");
  6306. }
  6307. }
  6308. return result;
  6309. }
  6310. function parseUrl(template) {
  6311. return {
  6312. expand: expand.bind(null, template)
  6313. };
  6314. }
  6315. function expand(template, context) {
  6316. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6317. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6318. if (expression) {
  6319. let operator = "";
  6320. const values = [];
  6321. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6322. operator = expression.charAt(0);
  6323. expression = expression.substr(1);
  6324. }
  6325. expression.split(/,/g).forEach(function (variable) {
  6326. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6327. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6328. });
  6329. if (operator && operator !== "+") {
  6330. var separator = ",";
  6331. if (operator === "?") {
  6332. separator = "&";
  6333. } else if (operator !== "#") {
  6334. separator = operator;
  6335. }
  6336. return (values.length !== 0 ? operator : "") + values.join(separator);
  6337. } else {
  6338. return values.join(",");
  6339. }
  6340. } else {
  6341. return encodeReserved(literal);
  6342. }
  6343. });
  6344. }
  6345. function parse(options) {
  6346. // https://fetch.spec.whatwg.org/#methods
  6347. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6348. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6349. let headers = Object.assign({}, options.headers);
  6350. let body;
  6351. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6352. const urlVariableNames = extractUrlVariableNames(url);
  6353. url = parseUrl(url).expand(parameters);
  6354. if (!/^http/.test(url)) {
  6355. url = options.baseUrl + url;
  6356. }
  6357. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6358. const remainingParameters = omit(parameters, omittedParameters);
  6359. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6360. if (!isBinaryRequset) {
  6361. if (options.mediaType.format) {
  6362. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6363. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6364. }
  6365. if (options.mediaType.previews.length) {
  6366. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6367. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6368. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6369. return `application/vnd.github.${preview}-preview${format}`;
  6370. }).join(",");
  6371. }
  6372. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6373. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6374. if (["GET", "HEAD"].includes(method)) {
  6375. url = addQueryParameters(url, remainingParameters);
  6376. } else {
  6377. if ("data" in remainingParameters) {
  6378. body = remainingParameters.data;
  6379. } else {
  6380. if (Object.keys(remainingParameters).length) {
  6381. body = remainingParameters;
  6382. } else {
  6383. headers["content-length"] = 0;
  6384. }
  6385. }
  6386. } // default content-type for JSON if body is set
  6387. if (!headers["content-type"] && typeof body !== "undefined") {
  6388. headers["content-type"] = "application/json; charset=utf-8";
  6389. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6390. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6391. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6392. body = "";
  6393. } // Only return body/request keys if present
  6394. return Object.assign({
  6395. method,
  6396. url,
  6397. headers
  6398. }, typeof body !== "undefined" ? {
  6399. body
  6400. } : null, options.request ? {
  6401. request: options.request
  6402. } : null);
  6403. }
  6404. function endpointWithDefaults(defaults, route, options) {
  6405. return parse(merge(defaults, route, options));
  6406. }
  6407. function withDefaults(oldDefaults, newDefaults) {
  6408. const DEFAULTS = merge(oldDefaults, newDefaults);
  6409. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6410. return Object.assign(endpoint, {
  6411. DEFAULTS,
  6412. defaults: withDefaults.bind(null, DEFAULTS),
  6413. merge: merge.bind(null, DEFAULTS),
  6414. parse
  6415. });
  6416. }
  6417. const VERSION = "6.0.1";
  6418. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6419. // So we use RequestParameters and add method as additional required property.
  6420. const DEFAULTS = {
  6421. method: "GET",
  6422. baseUrl: "https://api.github.com",
  6423. headers: {
  6424. accept: "application/vnd.github.v3+json",
  6425. "user-agent": userAgent
  6426. },
  6427. mediaType: {
  6428. format: "",
  6429. previews: []
  6430. }
  6431. };
  6432. const endpoint = withDefaults(null, DEFAULTS);
  6433. exports.endpoint = endpoint;
  6434. //# sourceMappingURL=index.js.map
  6435. /***/ }),
  6436. /***/ 389:
  6437. /***/ (function(module, __unusedexports, __webpack_require__) {
  6438. "use strict";
  6439. const fs = __webpack_require__(747);
  6440. const shebangCommand = __webpack_require__(866);
  6441. function readShebang(command) {
  6442. // Read the first 150 bytes from the file
  6443. const size = 150;
  6444. let buffer;
  6445. if (Buffer.alloc) {
  6446. // Node.js v4.5+ / v5.10+
  6447. buffer = Buffer.alloc(size);
  6448. } else {
  6449. // Old Node.js API
  6450. buffer = new Buffer(size);
  6451. buffer.fill(0); // zero-fill
  6452. }
  6453. let fd;
  6454. try {
  6455. fd = fs.openSync(command, 'r');
  6456. fs.readSync(fd, buffer, 0, size, 0);
  6457. fs.closeSync(fd);
  6458. } catch (e) { /* Empty */ }
  6459. // Attempt to extract shebang (null is returned if not a shebang)
  6460. return shebangCommand(buffer.toString());
  6461. }
  6462. module.exports = readShebang;
  6463. /***/ }),
  6464. /***/ 402:
  6465. /***/ (function(module, __unusedexports, __webpack_require__) {
  6466. module.exports = Octokit;
  6467. const { request } = __webpack_require__(753);
  6468. const Hook = __webpack_require__(523);
  6469. const parseClientOptions = __webpack_require__(294);
  6470. function Octokit(plugins, options) {
  6471. options = options || {};
  6472. const hook = new Hook.Collection();
  6473. const log = Object.assign(
  6474. {
  6475. debug: () => {},
  6476. info: () => {},
  6477. warn: console.warn,
  6478. error: console.error
  6479. },
  6480. options && options.log
  6481. );
  6482. const api = {
  6483. hook,
  6484. log,
  6485. request: request.defaults(parseClientOptions(options, log, hook))
  6486. };
  6487. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6488. return api;
  6489. }
  6490. /***/ }),
  6491. /***/ 413:
  6492. /***/ (function(module) {
  6493. module.exports = require("stream");
  6494. /***/ }),
  6495. /***/ 417:
  6496. /***/ (function(module) {
  6497. module.exports = require("crypto");
  6498. /***/ }),
  6499. /***/ 427:
  6500. /***/ (function(module, __unusedexports, __webpack_require__) {
  6501. "use strict";
  6502. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6503. // In that case, fall back to a deprecated internal.
  6504. const util = __webpack_require__(669);
  6505. let uv;
  6506. if (typeof util.getSystemErrorName === 'function') {
  6507. module.exports = util.getSystemErrorName;
  6508. } else {
  6509. try {
  6510. uv = process.binding('uv');
  6511. if (typeof uv.errname !== 'function') {
  6512. throw new TypeError('uv.errname is not a function');
  6513. }
  6514. } catch (err) {
  6515. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6516. uv = null;
  6517. }
  6518. module.exports = code => errname(uv, code);
  6519. }
  6520. // Used for testing the fallback behavior
  6521. module.exports.__test__ = errname;
  6522. function errname(uv, code) {
  6523. if (uv) {
  6524. return uv.errname(code);
  6525. }
  6526. if (!(code < 0)) {
  6527. throw new Error('err >= 0');
  6528. }
  6529. return `Unknown system error ${code}`;
  6530. }
  6531. /***/ }),
  6532. /***/ 430:
  6533. /***/ (function(module, __unusedexports, __webpack_require__) {
  6534. module.exports = octokitValidate;
  6535. const validate = __webpack_require__(348);
  6536. function octokitValidate(octokit) {
  6537. octokit.hook.before("request", validate.bind(null, octokit));
  6538. }
  6539. /***/ }),
  6540. /***/ 431:
  6541. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6542. "use strict";
  6543. Object.defineProperty(exports, "__esModule", { value: true });
  6544. const os = __webpack_require__(87);
  6545. /**
  6546. * Commands
  6547. *
  6548. * Command Format:
  6549. * ##[name key=value;key=value]message
  6550. *
  6551. * Examples:
  6552. * ##[warning]This is the user warning message
  6553. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6554. */
  6555. function issueCommand(command, properties, message) {
  6556. const cmd = new Command(command, properties, message);
  6557. process.stdout.write(cmd.toString() + os.EOL);
  6558. }
  6559. exports.issueCommand = issueCommand;
  6560. function issue(name, message = '') {
  6561. issueCommand(name, {}, message);
  6562. }
  6563. exports.issue = issue;
  6564. const CMD_STRING = '::';
  6565. class Command {
  6566. constructor(command, properties, message) {
  6567. if (!command) {
  6568. command = 'missing.command';
  6569. }
  6570. this.command = command;
  6571. this.properties = properties;
  6572. this.message = message;
  6573. }
  6574. toString() {
  6575. let cmdStr = CMD_STRING + this.command;
  6576. if (this.properties && Object.keys(this.properties).length > 0) {
  6577. cmdStr += ' ';
  6578. for (const key in this.properties) {
  6579. if (this.properties.hasOwnProperty(key)) {
  6580. const val = this.properties[key];
  6581. if (val) {
  6582. // safely append the val - avoid blowing up when attempting to
  6583. // call .replace() if message is not a string for some reason
  6584. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6585. }
  6586. }
  6587. }
  6588. }
  6589. cmdStr += CMD_STRING;
  6590. // safely append the message - avoid blowing up when attempting to
  6591. // call .replace() if message is not a string for some reason
  6592. const message = `${this.message || ''}`;
  6593. cmdStr += escapeData(message);
  6594. return cmdStr;
  6595. }
  6596. }
  6597. function escapeData(s) {
  6598. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6599. }
  6600. function escape(s) {
  6601. return s
  6602. .replace(/\r/g, '%0D')
  6603. .replace(/\n/g, '%0A')
  6604. .replace(/]/g, '%5D')
  6605. .replace(/;/g, '%3B');
  6606. }
  6607. //# sourceMappingURL=command.js.map
  6608. /***/ }),
  6609. /***/ 438:
  6610. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6611. "use strict";
  6612. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6613. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6614. return new (P || (P = Promise))(function (resolve, reject) {
  6615. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6616. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6617. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6618. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6619. });
  6620. };
  6621. var __importStar = (this && this.__importStar) || function (mod) {
  6622. if (mod && mod.__esModule) return mod;
  6623. var result = {};
  6624. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6625. result["default"] = mod;
  6626. return result;
  6627. };
  6628. Object.defineProperty(exports, "__esModule", { value: true });
  6629. const assert = __importStar(__webpack_require__(357));
  6630. const core = __importStar(__webpack_require__(470));
  6631. const fs = __importStar(__webpack_require__(747));
  6632. const fsHelper = __importStar(__webpack_require__(618));
  6633. const io = __importStar(__webpack_require__(1));
  6634. const path = __importStar(__webpack_require__(622));
  6635. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6636. return __awaiter(this, void 0, void 0, function* () {
  6637. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6638. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6639. // Indicates whether to delete the directory contents
  6640. let remove = false;
  6641. // Check whether using git or REST API
  6642. if (!git) {
  6643. remove = true;
  6644. }
  6645. // Fetch URL does not match
  6646. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6647. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6648. remove = true;
  6649. }
  6650. else {
  6651. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6652. const lockPaths = [
  6653. path.join(repositoryPath, '.git', 'index.lock'),
  6654. path.join(repositoryPath, '.git', 'shallow.lock')
  6655. ];
  6656. for (const lockPath of lockPaths) {
  6657. try {
  6658. yield io.rmRF(lockPath);
  6659. }
  6660. catch (error) {
  6661. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6662. }
  6663. }
  6664. try {
  6665. core.startGroup('Removing previously created refs, to avoid conflicts');
  6666. // Checkout detached HEAD
  6667. if (!(yield git.isDetached())) {
  6668. yield git.checkoutDetach();
  6669. }
  6670. // Remove all refs/heads/*
  6671. let branches = yield git.branchList(false);
  6672. for (const branch of branches) {
  6673. yield git.branchDelete(false, branch);
  6674. }
  6675. // Remove any conflicting refs/remotes/origin/*
  6676. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6677. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6678. if (ref) {
  6679. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6680. if (ref.startsWith('refs/heads/')) {
  6681. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6682. const upperName1Slash = `${upperName1}/`;
  6683. branches = yield git.branchList(true);
  6684. for (const branch of branches) {
  6685. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6686. const upperName2Slash = `${upperName2}/`;
  6687. if (upperName1.startsWith(upperName2Slash) ||
  6688. upperName2.startsWith(upperName1Slash)) {
  6689. yield git.branchDelete(true, branch);
  6690. }
  6691. }
  6692. }
  6693. }
  6694. core.endGroup();
  6695. // Clean
  6696. if (clean) {
  6697. core.startGroup('Cleaning the repository');
  6698. if (!(yield git.tryClean())) {
  6699. 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}'.`);
  6700. remove = true;
  6701. }
  6702. else if (!(yield git.tryReset())) {
  6703. remove = true;
  6704. }
  6705. core.endGroup();
  6706. if (remove) {
  6707. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6708. }
  6709. }
  6710. }
  6711. catch (error) {
  6712. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6713. remove = true;
  6714. }
  6715. }
  6716. if (remove) {
  6717. // Delete the contents of the directory. Don't delete the directory itself
  6718. // since it might be the current working directory.
  6719. core.info(`Deleting the contents of '${repositoryPath}'`);
  6720. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6721. yield io.rmRF(path.join(repositoryPath, file));
  6722. }
  6723. }
  6724. });
  6725. }
  6726. exports.prepareExistingDirectory = prepareExistingDirectory;
  6727. /***/ }),
  6728. /***/ 453:
  6729. /***/ (function(module, __unusedexports, __webpack_require__) {
  6730. var once = __webpack_require__(969)
  6731. var eos = __webpack_require__(3)
  6732. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6733. var noop = function () {}
  6734. var ancient = /^v?\.0/.test(process.version)
  6735. var isFn = function (fn) {
  6736. return typeof fn === 'function'
  6737. }
  6738. var isFS = function (stream) {
  6739. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6740. if (!fs) return false // browser
  6741. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6742. }
  6743. var isRequest = function (stream) {
  6744. return stream.setHeader && isFn(stream.abort)
  6745. }
  6746. var destroyer = function (stream, reading, writing, callback) {
  6747. callback = once(callback)
  6748. var closed = false
  6749. stream.on('close', function () {
  6750. closed = true
  6751. })
  6752. eos(stream, {readable: reading, writable: writing}, function (err) {
  6753. if (err) return callback(err)
  6754. closed = true
  6755. callback()
  6756. })
  6757. var destroyed = false
  6758. return function (err) {
  6759. if (closed) return
  6760. if (destroyed) return
  6761. destroyed = true
  6762. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6763. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6764. if (isFn(stream.destroy)) return stream.destroy()
  6765. callback(err || new Error('stream was destroyed'))
  6766. }
  6767. }
  6768. var call = function (fn) {
  6769. fn()
  6770. }
  6771. var pipe = function (from, to) {
  6772. return from.pipe(to)
  6773. }
  6774. var pump = function () {
  6775. var streams = Array.prototype.slice.call(arguments)
  6776. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6777. if (Array.isArray(streams[0])) streams = streams[0]
  6778. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6779. var error
  6780. var destroys = streams.map(function (stream, i) {
  6781. var reading = i < streams.length - 1
  6782. var writing = i > 0
  6783. return destroyer(stream, reading, writing, function (err) {
  6784. if (!error) error = err
  6785. if (err) destroys.forEach(call)
  6786. if (reading) return
  6787. destroys.forEach(call)
  6788. callback(error)
  6789. })
  6790. })
  6791. return streams.reduce(pipe)
  6792. }
  6793. module.exports = pump
  6794. /***/ }),
  6795. /***/ 454:
  6796. /***/ (function(module, exports, __webpack_require__) {
  6797. "use strict";
  6798. Object.defineProperty(exports, '__esModule', { value: true });
  6799. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6800. var Stream = _interopDefault(__webpack_require__(413));
  6801. var http = _interopDefault(__webpack_require__(605));
  6802. var Url = _interopDefault(__webpack_require__(835));
  6803. var https = _interopDefault(__webpack_require__(34));
  6804. var zlib = _interopDefault(__webpack_require__(761));
  6805. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6806. // fix for "Readable" isn't a named export issue
  6807. const Readable = Stream.Readable;
  6808. const BUFFER = Symbol('buffer');
  6809. const TYPE = Symbol('type');
  6810. class Blob {
  6811. constructor() {
  6812. this[TYPE] = '';
  6813. const blobParts = arguments[0];
  6814. const options = arguments[1];
  6815. const buffers = [];
  6816. let size = 0;
  6817. if (blobParts) {
  6818. const a = blobParts;
  6819. const length = Number(a.length);
  6820. for (let i = 0; i < length; i++) {
  6821. const element = a[i];
  6822. let buffer;
  6823. if (element instanceof Buffer) {
  6824. buffer = element;
  6825. } else if (ArrayBuffer.isView(element)) {
  6826. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6827. } else if (element instanceof ArrayBuffer) {
  6828. buffer = Buffer.from(element);
  6829. } else if (element instanceof Blob) {
  6830. buffer = element[BUFFER];
  6831. } else {
  6832. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6833. }
  6834. size += buffer.length;
  6835. buffers.push(buffer);
  6836. }
  6837. }
  6838. this[BUFFER] = Buffer.concat(buffers);
  6839. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6840. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6841. this[TYPE] = type;
  6842. }
  6843. }
  6844. get size() {
  6845. return this[BUFFER].length;
  6846. }
  6847. get type() {
  6848. return this[TYPE];
  6849. }
  6850. text() {
  6851. return Promise.resolve(this[BUFFER].toString());
  6852. }
  6853. arrayBuffer() {
  6854. const buf = this[BUFFER];
  6855. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6856. return Promise.resolve(ab);
  6857. }
  6858. stream() {
  6859. const readable = new Readable();
  6860. readable._read = function () {};
  6861. readable.push(this[BUFFER]);
  6862. readable.push(null);
  6863. return readable;
  6864. }
  6865. toString() {
  6866. return '[object Blob]';
  6867. }
  6868. slice() {
  6869. const size = this.size;
  6870. const start = arguments[0];
  6871. const end = arguments[1];
  6872. let relativeStart, relativeEnd;
  6873. if (start === undefined) {
  6874. relativeStart = 0;
  6875. } else if (start < 0) {
  6876. relativeStart = Math.max(size + start, 0);
  6877. } else {
  6878. relativeStart = Math.min(start, size);
  6879. }
  6880. if (end === undefined) {
  6881. relativeEnd = size;
  6882. } else if (end < 0) {
  6883. relativeEnd = Math.max(size + end, 0);
  6884. } else {
  6885. relativeEnd = Math.min(end, size);
  6886. }
  6887. const span = Math.max(relativeEnd - relativeStart, 0);
  6888. const buffer = this[BUFFER];
  6889. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6890. const blob = new Blob([], { type: arguments[2] });
  6891. blob[BUFFER] = slicedBuffer;
  6892. return blob;
  6893. }
  6894. }
  6895. Object.defineProperties(Blob.prototype, {
  6896. size: { enumerable: true },
  6897. type: { enumerable: true },
  6898. slice: { enumerable: true }
  6899. });
  6900. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6901. value: 'Blob',
  6902. writable: false,
  6903. enumerable: false,
  6904. configurable: true
  6905. });
  6906. /**
  6907. * fetch-error.js
  6908. *
  6909. * FetchError interface for operational errors
  6910. */
  6911. /**
  6912. * Create FetchError instance
  6913. *
  6914. * @param String message Error message for human
  6915. * @param String type Error type for machine
  6916. * @param String systemError For Node.js system error
  6917. * @return FetchError
  6918. */
  6919. function FetchError(message, type, systemError) {
  6920. Error.call(this, message);
  6921. this.message = message;
  6922. this.type = type;
  6923. // when err.type is `system`, err.code contains system error code
  6924. if (systemError) {
  6925. this.code = this.errno = systemError.code;
  6926. }
  6927. // hide custom error implementation details from end-users
  6928. Error.captureStackTrace(this, this.constructor);
  6929. }
  6930. FetchError.prototype = Object.create(Error.prototype);
  6931. FetchError.prototype.constructor = FetchError;
  6932. FetchError.prototype.name = 'FetchError';
  6933. let convert;
  6934. try {
  6935. convert = __webpack_require__(18).convert;
  6936. } catch (e) {}
  6937. const INTERNALS = Symbol('Body internals');
  6938. // fix an issue where "PassThrough" isn't a named export for node <10
  6939. const PassThrough = Stream.PassThrough;
  6940. /**
  6941. * Body mixin
  6942. *
  6943. * Ref: https://fetch.spec.whatwg.org/#body
  6944. *
  6945. * @param Stream body Readable stream
  6946. * @param Object opts Response options
  6947. * @return Void
  6948. */
  6949. function Body(body) {
  6950. var _this = this;
  6951. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6952. _ref$size = _ref.size;
  6953. let size = _ref$size === undefined ? 0 : _ref$size;
  6954. var _ref$timeout = _ref.timeout;
  6955. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6956. if (body == null) {
  6957. // body is undefined or null
  6958. body = null;
  6959. } else if (isURLSearchParams(body)) {
  6960. // body is a URLSearchParams
  6961. body = Buffer.from(body.toString());
  6962. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6963. // body is ArrayBuffer
  6964. body = Buffer.from(body);
  6965. } else if (ArrayBuffer.isView(body)) {
  6966. // body is ArrayBufferView
  6967. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6968. } else if (body instanceof Stream) ; else {
  6969. // none of the above
  6970. // coerce to string then buffer
  6971. body = Buffer.from(String(body));
  6972. }
  6973. this[INTERNALS] = {
  6974. body,
  6975. disturbed: false,
  6976. error: null
  6977. };
  6978. this.size = size;
  6979. this.timeout = timeout;
  6980. if (body instanceof Stream) {
  6981. body.on('error', function (err) {
  6982. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6983. _this[INTERNALS].error = error;
  6984. });
  6985. }
  6986. }
  6987. Body.prototype = {
  6988. get body() {
  6989. return this[INTERNALS].body;
  6990. },
  6991. get bodyUsed() {
  6992. return this[INTERNALS].disturbed;
  6993. },
  6994. /**
  6995. * Decode response as ArrayBuffer
  6996. *
  6997. * @return Promise
  6998. */
  6999. arrayBuffer() {
  7000. return consumeBody.call(this).then(function (buf) {
  7001. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  7002. });
  7003. },
  7004. /**
  7005. * Return raw response as Blob
  7006. *
  7007. * @return Promise
  7008. */
  7009. blob() {
  7010. let ct = this.headers && this.headers.get('content-type') || '';
  7011. return consumeBody.call(this).then(function (buf) {
  7012. return Object.assign(
  7013. // Prevent copying
  7014. new Blob([], {
  7015. type: ct.toLowerCase()
  7016. }), {
  7017. [BUFFER]: buf
  7018. });
  7019. });
  7020. },
  7021. /**
  7022. * Decode response as json
  7023. *
  7024. * @return Promise
  7025. */
  7026. json() {
  7027. var _this2 = this;
  7028. return consumeBody.call(this).then(function (buffer) {
  7029. try {
  7030. return JSON.parse(buffer.toString());
  7031. } catch (err) {
  7032. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  7033. }
  7034. });
  7035. },
  7036. /**
  7037. * Decode response as text
  7038. *
  7039. * @return Promise
  7040. */
  7041. text() {
  7042. return consumeBody.call(this).then(function (buffer) {
  7043. return buffer.toString();
  7044. });
  7045. },
  7046. /**
  7047. * Decode response as buffer (non-spec api)
  7048. *
  7049. * @return Promise
  7050. */
  7051. buffer() {
  7052. return consumeBody.call(this);
  7053. },
  7054. /**
  7055. * Decode response as text, while automatically detecting the encoding and
  7056. * trying to decode to UTF-8 (non-spec api)
  7057. *
  7058. * @return Promise
  7059. */
  7060. textConverted() {
  7061. var _this3 = this;
  7062. return consumeBody.call(this).then(function (buffer) {
  7063. return convertBody(buffer, _this3.headers);
  7064. });
  7065. }
  7066. };
  7067. // In browsers, all properties are enumerable.
  7068. Object.defineProperties(Body.prototype, {
  7069. body: { enumerable: true },
  7070. bodyUsed: { enumerable: true },
  7071. arrayBuffer: { enumerable: true },
  7072. blob: { enumerable: true },
  7073. json: { enumerable: true },
  7074. text: { enumerable: true }
  7075. });
  7076. Body.mixIn = function (proto) {
  7077. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7078. // istanbul ignore else: future proof
  7079. if (!(name in proto)) {
  7080. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7081. Object.defineProperty(proto, name, desc);
  7082. }
  7083. }
  7084. };
  7085. /**
  7086. * Consume and convert an entire Body to a Buffer.
  7087. *
  7088. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7089. *
  7090. * @return Promise
  7091. */
  7092. function consumeBody() {
  7093. var _this4 = this;
  7094. if (this[INTERNALS].disturbed) {
  7095. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7096. }
  7097. this[INTERNALS].disturbed = true;
  7098. if (this[INTERNALS].error) {
  7099. return Body.Promise.reject(this[INTERNALS].error);
  7100. }
  7101. let body = this.body;
  7102. // body is null
  7103. if (body === null) {
  7104. return Body.Promise.resolve(Buffer.alloc(0));
  7105. }
  7106. // body is blob
  7107. if (isBlob(body)) {
  7108. body = body.stream();
  7109. }
  7110. // body is buffer
  7111. if (Buffer.isBuffer(body)) {
  7112. return Body.Promise.resolve(body);
  7113. }
  7114. // istanbul ignore if: should never happen
  7115. if (!(body instanceof Stream)) {
  7116. return Body.Promise.resolve(Buffer.alloc(0));
  7117. }
  7118. // body is stream
  7119. // get ready to actually consume the body
  7120. let accum = [];
  7121. let accumBytes = 0;
  7122. let abort = false;
  7123. return new Body.Promise(function (resolve, reject) {
  7124. let resTimeout;
  7125. // allow timeout on slow response body
  7126. if (_this4.timeout) {
  7127. resTimeout = setTimeout(function () {
  7128. abort = true;
  7129. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7130. }, _this4.timeout);
  7131. }
  7132. // handle stream errors
  7133. body.on('error', function (err) {
  7134. if (err.name === 'AbortError') {
  7135. // if the request was aborted, reject with this Error
  7136. abort = true;
  7137. reject(err);
  7138. } else {
  7139. // other errors, such as incorrect content-encoding
  7140. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7141. }
  7142. });
  7143. body.on('data', function (chunk) {
  7144. if (abort || chunk === null) {
  7145. return;
  7146. }
  7147. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7148. abort = true;
  7149. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7150. return;
  7151. }
  7152. accumBytes += chunk.length;
  7153. accum.push(chunk);
  7154. });
  7155. body.on('end', function () {
  7156. if (abort) {
  7157. return;
  7158. }
  7159. clearTimeout(resTimeout);
  7160. try {
  7161. resolve(Buffer.concat(accum, accumBytes));
  7162. } catch (err) {
  7163. // handle streams that have accumulated too much data (issue #414)
  7164. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7165. }
  7166. });
  7167. });
  7168. }
  7169. /**
  7170. * Detect buffer encoding and convert to target encoding
  7171. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7172. *
  7173. * @param Buffer buffer Incoming buffer
  7174. * @param String encoding Target encoding
  7175. * @return String
  7176. */
  7177. function convertBody(buffer, headers) {
  7178. if (typeof convert !== 'function') {
  7179. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7180. }
  7181. const ct = headers.get('content-type');
  7182. let charset = 'utf-8';
  7183. let res, str;
  7184. // header
  7185. if (ct) {
  7186. res = /charset=([^;]*)/i.exec(ct);
  7187. }
  7188. // no charset in content type, peek at response body for at most 1024 bytes
  7189. str = buffer.slice(0, 1024).toString();
  7190. // html5
  7191. if (!res && str) {
  7192. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7193. }
  7194. // html4
  7195. if (!res && str) {
  7196. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7197. if (res) {
  7198. res = /charset=(.*)/i.exec(res.pop());
  7199. }
  7200. }
  7201. // xml
  7202. if (!res && str) {
  7203. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7204. }
  7205. // found charset
  7206. if (res) {
  7207. charset = res.pop();
  7208. // prevent decode issues when sites use incorrect encoding
  7209. // ref: https://hsivonen.fi/encoding-menu/
  7210. if (charset === 'gb2312' || charset === 'gbk') {
  7211. charset = 'gb18030';
  7212. }
  7213. }
  7214. // turn raw buffers into a single utf-8 buffer
  7215. return convert(buffer, 'UTF-8', charset).toString();
  7216. }
  7217. /**
  7218. * Detect a URLSearchParams object
  7219. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7220. *
  7221. * @param Object obj Object to detect by type or brand
  7222. * @return String
  7223. */
  7224. function isURLSearchParams(obj) {
  7225. // Duck-typing as a necessary condition.
  7226. 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') {
  7227. return false;
  7228. }
  7229. // Brand-checking and more duck-typing as optional condition.
  7230. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7231. }
  7232. /**
  7233. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7234. * @param {*} obj
  7235. * @return {boolean}
  7236. */
  7237. function isBlob(obj) {
  7238. 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]);
  7239. }
  7240. /**
  7241. * Clone body given Res/Req instance
  7242. *
  7243. * @param Mixed instance Response or Request instance
  7244. * @return Mixed
  7245. */
  7246. function clone(instance) {
  7247. let p1, p2;
  7248. let body = instance.body;
  7249. // don't allow cloning a used body
  7250. if (instance.bodyUsed) {
  7251. throw new Error('cannot clone body after it is used');
  7252. }
  7253. // check that body is a stream and not form-data object
  7254. // note: we can't clone the form-data object without having it as a dependency
  7255. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7256. // tee instance body
  7257. p1 = new PassThrough();
  7258. p2 = new PassThrough();
  7259. body.pipe(p1);
  7260. body.pipe(p2);
  7261. // set instance body to teed body and return the other teed body
  7262. instance[INTERNALS].body = p1;
  7263. body = p2;
  7264. }
  7265. return body;
  7266. }
  7267. /**
  7268. * Performs the operation "extract a `Content-Type` value from |object|" as
  7269. * specified in the specification:
  7270. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7271. *
  7272. * This function assumes that instance.body is present.
  7273. *
  7274. * @param Mixed instance Any options.body input
  7275. */
  7276. function extractContentType(body) {
  7277. if (body === null) {
  7278. // body is null
  7279. return null;
  7280. } else if (typeof body === 'string') {
  7281. // body is string
  7282. return 'text/plain;charset=UTF-8';
  7283. } else if (isURLSearchParams(body)) {
  7284. // body is a URLSearchParams
  7285. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7286. } else if (isBlob(body)) {
  7287. // body is blob
  7288. return body.type || null;
  7289. } else if (Buffer.isBuffer(body)) {
  7290. // body is buffer
  7291. return null;
  7292. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7293. // body is ArrayBuffer
  7294. return null;
  7295. } else if (ArrayBuffer.isView(body)) {
  7296. // body is ArrayBufferView
  7297. return null;
  7298. } else if (typeof body.getBoundary === 'function') {
  7299. // detect form data input from form-data module
  7300. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7301. } else if (body instanceof Stream) {
  7302. // body is stream
  7303. // can't really do much about this
  7304. return null;
  7305. } else {
  7306. // Body constructor defaults other things to string
  7307. return 'text/plain;charset=UTF-8';
  7308. }
  7309. }
  7310. /**
  7311. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7312. * For us, we have to explicitly get it with a function.
  7313. *
  7314. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7315. *
  7316. * @param Body instance Instance of Body
  7317. * @return Number? Number of bytes, or null if not possible
  7318. */
  7319. function getTotalBytes(instance) {
  7320. const body = instance.body;
  7321. if (body === null) {
  7322. // body is null
  7323. return 0;
  7324. } else if (isBlob(body)) {
  7325. return body.size;
  7326. } else if (Buffer.isBuffer(body)) {
  7327. // body is buffer
  7328. return body.length;
  7329. } else if (body && typeof body.getLengthSync === 'function') {
  7330. // detect form data input from form-data module
  7331. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7332. body.hasKnownLength && body.hasKnownLength()) {
  7333. // 2.x
  7334. return body.getLengthSync();
  7335. }
  7336. return null;
  7337. } else {
  7338. // body is stream
  7339. return null;
  7340. }
  7341. }
  7342. /**
  7343. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7344. *
  7345. * @param Body instance Instance of Body
  7346. * @return Void
  7347. */
  7348. function writeToStream(dest, instance) {
  7349. const body = instance.body;
  7350. if (body === null) {
  7351. // body is null
  7352. dest.end();
  7353. } else if (isBlob(body)) {
  7354. body.stream().pipe(dest);
  7355. } else if (Buffer.isBuffer(body)) {
  7356. // body is buffer
  7357. dest.write(body);
  7358. dest.end();
  7359. } else {
  7360. // body is stream
  7361. body.pipe(dest);
  7362. }
  7363. }
  7364. // expose Promise
  7365. Body.Promise = global.Promise;
  7366. /**
  7367. * headers.js
  7368. *
  7369. * Headers class offers convenient helpers
  7370. */
  7371. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7372. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7373. function validateName(name) {
  7374. name = `${name}`;
  7375. if (invalidTokenRegex.test(name) || name === '') {
  7376. throw new TypeError(`${name} is not a legal HTTP header name`);
  7377. }
  7378. }
  7379. function validateValue(value) {
  7380. value = `${value}`;
  7381. if (invalidHeaderCharRegex.test(value)) {
  7382. throw new TypeError(`${value} is not a legal HTTP header value`);
  7383. }
  7384. }
  7385. /**
  7386. * Find the key in the map object given a header name.
  7387. *
  7388. * Returns undefined if not found.
  7389. *
  7390. * @param String name Header name
  7391. * @return String|Undefined
  7392. */
  7393. function find(map, name) {
  7394. name = name.toLowerCase();
  7395. for (const key in map) {
  7396. if (key.toLowerCase() === name) {
  7397. return key;
  7398. }
  7399. }
  7400. return undefined;
  7401. }
  7402. const MAP = Symbol('map');
  7403. class Headers {
  7404. /**
  7405. * Headers class
  7406. *
  7407. * @param Object headers Response headers
  7408. * @return Void
  7409. */
  7410. constructor() {
  7411. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7412. this[MAP] = Object.create(null);
  7413. if (init instanceof Headers) {
  7414. const rawHeaders = init.raw();
  7415. const headerNames = Object.keys(rawHeaders);
  7416. for (const headerName of headerNames) {
  7417. for (const value of rawHeaders[headerName]) {
  7418. this.append(headerName, value);
  7419. }
  7420. }
  7421. return;
  7422. }
  7423. // We don't worry about converting prop to ByteString here as append()
  7424. // will handle it.
  7425. if (init == null) ; else if (typeof init === 'object') {
  7426. const method = init[Symbol.iterator];
  7427. if (method != null) {
  7428. if (typeof method !== 'function') {
  7429. throw new TypeError('Header pairs must be iterable');
  7430. }
  7431. // sequence<sequence<ByteString>>
  7432. // Note: per spec we have to first exhaust the lists then process them
  7433. const pairs = [];
  7434. for (const pair of init) {
  7435. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7436. throw new TypeError('Each header pair must be iterable');
  7437. }
  7438. pairs.push(Array.from(pair));
  7439. }
  7440. for (const pair of pairs) {
  7441. if (pair.length !== 2) {
  7442. throw new TypeError('Each header pair must be a name/value tuple');
  7443. }
  7444. this.append(pair[0], pair[1]);
  7445. }
  7446. } else {
  7447. // record<ByteString, ByteString>
  7448. for (const key of Object.keys(init)) {
  7449. const value = init[key];
  7450. this.append(key, value);
  7451. }
  7452. }
  7453. } else {
  7454. throw new TypeError('Provided initializer must be an object');
  7455. }
  7456. }
  7457. /**
  7458. * Return combined header value given name
  7459. *
  7460. * @param String name Header name
  7461. * @return Mixed
  7462. */
  7463. get(name) {
  7464. name = `${name}`;
  7465. validateName(name);
  7466. const key = find(this[MAP], name);
  7467. if (key === undefined) {
  7468. return null;
  7469. }
  7470. return this[MAP][key].join(', ');
  7471. }
  7472. /**
  7473. * Iterate over all headers
  7474. *
  7475. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7476. * @param Boolean thisArg `this` context for callback function
  7477. * @return Void
  7478. */
  7479. forEach(callback) {
  7480. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7481. let pairs = getHeaders(this);
  7482. let i = 0;
  7483. while (i < pairs.length) {
  7484. var _pairs$i = pairs[i];
  7485. const name = _pairs$i[0],
  7486. value = _pairs$i[1];
  7487. callback.call(thisArg, value, name, this);
  7488. pairs = getHeaders(this);
  7489. i++;
  7490. }
  7491. }
  7492. /**
  7493. * Overwrite header values given name
  7494. *
  7495. * @param String name Header name
  7496. * @param String value Header value
  7497. * @return Void
  7498. */
  7499. set(name, value) {
  7500. name = `${name}`;
  7501. value = `${value}`;
  7502. validateName(name);
  7503. validateValue(value);
  7504. const key = find(this[MAP], name);
  7505. this[MAP][key !== undefined ? key : name] = [value];
  7506. }
  7507. /**
  7508. * Append a value onto existing header
  7509. *
  7510. * @param String name Header name
  7511. * @param String value Header value
  7512. * @return Void
  7513. */
  7514. append(name, value) {
  7515. name = `${name}`;
  7516. value = `${value}`;
  7517. validateName(name);
  7518. validateValue(value);
  7519. const key = find(this[MAP], name);
  7520. if (key !== undefined) {
  7521. this[MAP][key].push(value);
  7522. } else {
  7523. this[MAP][name] = [value];
  7524. }
  7525. }
  7526. /**
  7527. * Check for header name existence
  7528. *
  7529. * @param String name Header name
  7530. * @return Boolean
  7531. */
  7532. has(name) {
  7533. name = `${name}`;
  7534. validateName(name);
  7535. return find(this[MAP], name) !== undefined;
  7536. }
  7537. /**
  7538. * Delete all header values given name
  7539. *
  7540. * @param String name Header name
  7541. * @return Void
  7542. */
  7543. delete(name) {
  7544. name = `${name}`;
  7545. validateName(name);
  7546. const key = find(this[MAP], name);
  7547. if (key !== undefined) {
  7548. delete this[MAP][key];
  7549. }
  7550. }
  7551. /**
  7552. * Return raw headers (non-spec api)
  7553. *
  7554. * @return Object
  7555. */
  7556. raw() {
  7557. return this[MAP];
  7558. }
  7559. /**
  7560. * Get an iterator on keys.
  7561. *
  7562. * @return Iterator
  7563. */
  7564. keys() {
  7565. return createHeadersIterator(this, 'key');
  7566. }
  7567. /**
  7568. * Get an iterator on values.
  7569. *
  7570. * @return Iterator
  7571. */
  7572. values() {
  7573. return createHeadersIterator(this, 'value');
  7574. }
  7575. /**
  7576. * Get an iterator on entries.
  7577. *
  7578. * This is the default iterator of the Headers object.
  7579. *
  7580. * @return Iterator
  7581. */
  7582. [Symbol.iterator]() {
  7583. return createHeadersIterator(this, 'key+value');
  7584. }
  7585. }
  7586. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7587. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7588. value: 'Headers',
  7589. writable: false,
  7590. enumerable: false,
  7591. configurable: true
  7592. });
  7593. Object.defineProperties(Headers.prototype, {
  7594. get: { enumerable: true },
  7595. forEach: { enumerable: true },
  7596. set: { enumerable: true },
  7597. append: { enumerable: true },
  7598. has: { enumerable: true },
  7599. delete: { enumerable: true },
  7600. keys: { enumerable: true },
  7601. values: { enumerable: true },
  7602. entries: { enumerable: true }
  7603. });
  7604. function getHeaders(headers) {
  7605. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7606. const keys = Object.keys(headers[MAP]).sort();
  7607. return keys.map(kind === 'key' ? function (k) {
  7608. return k.toLowerCase();
  7609. } : kind === 'value' ? function (k) {
  7610. return headers[MAP][k].join(', ');
  7611. } : function (k) {
  7612. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7613. });
  7614. }
  7615. const INTERNAL = Symbol('internal');
  7616. function createHeadersIterator(target, kind) {
  7617. const iterator = Object.create(HeadersIteratorPrototype);
  7618. iterator[INTERNAL] = {
  7619. target,
  7620. kind,
  7621. index: 0
  7622. };
  7623. return iterator;
  7624. }
  7625. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7626. next() {
  7627. // istanbul ignore if
  7628. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7629. throw new TypeError('Value of `this` is not a HeadersIterator');
  7630. }
  7631. var _INTERNAL = this[INTERNAL];
  7632. const target = _INTERNAL.target,
  7633. kind = _INTERNAL.kind,
  7634. index = _INTERNAL.index;
  7635. const values = getHeaders(target, kind);
  7636. const len = values.length;
  7637. if (index >= len) {
  7638. return {
  7639. value: undefined,
  7640. done: true
  7641. };
  7642. }
  7643. this[INTERNAL].index = index + 1;
  7644. return {
  7645. value: values[index],
  7646. done: false
  7647. };
  7648. }
  7649. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7650. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7651. value: 'HeadersIterator',
  7652. writable: false,
  7653. enumerable: false,
  7654. configurable: true
  7655. });
  7656. /**
  7657. * Export the Headers object in a form that Node.js can consume.
  7658. *
  7659. * @param Headers headers
  7660. * @return Object
  7661. */
  7662. function exportNodeCompatibleHeaders(headers) {
  7663. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7664. // http.request() only supports string as Host header. This hack makes
  7665. // specifying custom Host header possible.
  7666. const hostHeaderKey = find(headers[MAP], 'Host');
  7667. if (hostHeaderKey !== undefined) {
  7668. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7669. }
  7670. return obj;
  7671. }
  7672. /**
  7673. * Create a Headers object from an object of headers, ignoring those that do
  7674. * not conform to HTTP grammar productions.
  7675. *
  7676. * @param Object obj Object of headers
  7677. * @return Headers
  7678. */
  7679. function createHeadersLenient(obj) {
  7680. const headers = new Headers();
  7681. for (const name of Object.keys(obj)) {
  7682. if (invalidTokenRegex.test(name)) {
  7683. continue;
  7684. }
  7685. if (Array.isArray(obj[name])) {
  7686. for (const val of obj[name]) {
  7687. if (invalidHeaderCharRegex.test(val)) {
  7688. continue;
  7689. }
  7690. if (headers[MAP][name] === undefined) {
  7691. headers[MAP][name] = [val];
  7692. } else {
  7693. headers[MAP][name].push(val);
  7694. }
  7695. }
  7696. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7697. headers[MAP][name] = [obj[name]];
  7698. }
  7699. }
  7700. return headers;
  7701. }
  7702. const INTERNALS$1 = Symbol('Response internals');
  7703. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7704. const STATUS_CODES = http.STATUS_CODES;
  7705. /**
  7706. * Response class
  7707. *
  7708. * @param Stream body Readable stream
  7709. * @param Object opts Response options
  7710. * @return Void
  7711. */
  7712. class Response {
  7713. constructor() {
  7714. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7715. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7716. Body.call(this, body, opts);
  7717. const status = opts.status || 200;
  7718. const headers = new Headers(opts.headers);
  7719. if (body != null && !headers.has('Content-Type')) {
  7720. const contentType = extractContentType(body);
  7721. if (contentType) {
  7722. headers.append('Content-Type', contentType);
  7723. }
  7724. }
  7725. this[INTERNALS$1] = {
  7726. url: opts.url,
  7727. status,
  7728. statusText: opts.statusText || STATUS_CODES[status],
  7729. headers,
  7730. counter: opts.counter
  7731. };
  7732. }
  7733. get url() {
  7734. return this[INTERNALS$1].url || '';
  7735. }
  7736. get status() {
  7737. return this[INTERNALS$1].status;
  7738. }
  7739. /**
  7740. * Convenience property representing if the request ended normally
  7741. */
  7742. get ok() {
  7743. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7744. }
  7745. get redirected() {
  7746. return this[INTERNALS$1].counter > 0;
  7747. }
  7748. get statusText() {
  7749. return this[INTERNALS$1].statusText;
  7750. }
  7751. get headers() {
  7752. return this[INTERNALS$1].headers;
  7753. }
  7754. /**
  7755. * Clone this response
  7756. *
  7757. * @return Response
  7758. */
  7759. clone() {
  7760. return new Response(clone(this), {
  7761. url: this.url,
  7762. status: this.status,
  7763. statusText: this.statusText,
  7764. headers: this.headers,
  7765. ok: this.ok,
  7766. redirected: this.redirected
  7767. });
  7768. }
  7769. }
  7770. Body.mixIn(Response.prototype);
  7771. Object.defineProperties(Response.prototype, {
  7772. url: { enumerable: true },
  7773. status: { enumerable: true },
  7774. ok: { enumerable: true },
  7775. redirected: { enumerable: true },
  7776. statusText: { enumerable: true },
  7777. headers: { enumerable: true },
  7778. clone: { enumerable: true }
  7779. });
  7780. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7781. value: 'Response',
  7782. writable: false,
  7783. enumerable: false,
  7784. configurable: true
  7785. });
  7786. const INTERNALS$2 = Symbol('Request internals');
  7787. // fix an issue where "format", "parse" aren't a named export for node <10
  7788. const parse_url = Url.parse;
  7789. const format_url = Url.format;
  7790. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7791. /**
  7792. * Check if a value is an instance of Request.
  7793. *
  7794. * @param Mixed input
  7795. * @return Boolean
  7796. */
  7797. function isRequest(input) {
  7798. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7799. }
  7800. function isAbortSignal(signal) {
  7801. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7802. return !!(proto && proto.constructor.name === 'AbortSignal');
  7803. }
  7804. /**
  7805. * Request class
  7806. *
  7807. * @param Mixed input Url or Request instance
  7808. * @param Object init Custom options
  7809. * @return Void
  7810. */
  7811. class Request {
  7812. constructor(input) {
  7813. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7814. let parsedURL;
  7815. // normalize input
  7816. if (!isRequest(input)) {
  7817. if (input && input.href) {
  7818. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7819. // will fall into this branch also (since their `toString()` will return
  7820. // `href` property anyway)
  7821. parsedURL = parse_url(input.href);
  7822. } else {
  7823. // coerce input to a string before attempting to parse
  7824. parsedURL = parse_url(`${input}`);
  7825. }
  7826. input = {};
  7827. } else {
  7828. parsedURL = parse_url(input.url);
  7829. }
  7830. let method = init.method || input.method || 'GET';
  7831. method = method.toUpperCase();
  7832. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7833. throw new TypeError('Request with GET/HEAD method cannot have body');
  7834. }
  7835. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7836. Body.call(this, inputBody, {
  7837. timeout: init.timeout || input.timeout || 0,
  7838. size: init.size || input.size || 0
  7839. });
  7840. const headers = new Headers(init.headers || input.headers || {});
  7841. if (inputBody != null && !headers.has('Content-Type')) {
  7842. const contentType = extractContentType(inputBody);
  7843. if (contentType) {
  7844. headers.append('Content-Type', contentType);
  7845. }
  7846. }
  7847. let signal = isRequest(input) ? input.signal : null;
  7848. if ('signal' in init) signal = init.signal;
  7849. if (signal != null && !isAbortSignal(signal)) {
  7850. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7851. }
  7852. this[INTERNALS$2] = {
  7853. method,
  7854. redirect: init.redirect || input.redirect || 'follow',
  7855. headers,
  7856. parsedURL,
  7857. signal
  7858. };
  7859. // node-fetch-only options
  7860. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7861. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7862. this.counter = init.counter || input.counter || 0;
  7863. this.agent = init.agent || input.agent;
  7864. }
  7865. get method() {
  7866. return this[INTERNALS$2].method;
  7867. }
  7868. get url() {
  7869. return format_url(this[INTERNALS$2].parsedURL);
  7870. }
  7871. get headers() {
  7872. return this[INTERNALS$2].headers;
  7873. }
  7874. get redirect() {
  7875. return this[INTERNALS$2].redirect;
  7876. }
  7877. get signal() {
  7878. return this[INTERNALS$2].signal;
  7879. }
  7880. /**
  7881. * Clone this request
  7882. *
  7883. * @return Request
  7884. */
  7885. clone() {
  7886. return new Request(this);
  7887. }
  7888. }
  7889. Body.mixIn(Request.prototype);
  7890. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7891. value: 'Request',
  7892. writable: false,
  7893. enumerable: false,
  7894. configurable: true
  7895. });
  7896. Object.defineProperties(Request.prototype, {
  7897. method: { enumerable: true },
  7898. url: { enumerable: true },
  7899. headers: { enumerable: true },
  7900. redirect: { enumerable: true },
  7901. clone: { enumerable: true },
  7902. signal: { enumerable: true }
  7903. });
  7904. /**
  7905. * Convert a Request to Node.js http request options.
  7906. *
  7907. * @param Request A Request instance
  7908. * @return Object The options object to be passed to http.request
  7909. */
  7910. function getNodeRequestOptions(request) {
  7911. const parsedURL = request[INTERNALS$2].parsedURL;
  7912. const headers = new Headers(request[INTERNALS$2].headers);
  7913. // fetch step 1.3
  7914. if (!headers.has('Accept')) {
  7915. headers.set('Accept', '*/*');
  7916. }
  7917. // Basic fetch
  7918. if (!parsedURL.protocol || !parsedURL.hostname) {
  7919. throw new TypeError('Only absolute URLs are supported');
  7920. }
  7921. if (!/^https?:$/.test(parsedURL.protocol)) {
  7922. throw new TypeError('Only HTTP(S) protocols are supported');
  7923. }
  7924. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7925. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7926. }
  7927. // HTTP-network-or-cache fetch steps 2.4-2.7
  7928. let contentLengthValue = null;
  7929. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7930. contentLengthValue = '0';
  7931. }
  7932. if (request.body != null) {
  7933. const totalBytes = getTotalBytes(request);
  7934. if (typeof totalBytes === 'number') {
  7935. contentLengthValue = String(totalBytes);
  7936. }
  7937. }
  7938. if (contentLengthValue) {
  7939. headers.set('Content-Length', contentLengthValue);
  7940. }
  7941. // HTTP-network-or-cache fetch step 2.11
  7942. if (!headers.has('User-Agent')) {
  7943. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7944. }
  7945. // HTTP-network-or-cache fetch step 2.15
  7946. if (request.compress && !headers.has('Accept-Encoding')) {
  7947. headers.set('Accept-Encoding', 'gzip,deflate');
  7948. }
  7949. let agent = request.agent;
  7950. if (typeof agent === 'function') {
  7951. agent = agent(parsedURL);
  7952. }
  7953. if (!headers.has('Connection') && !agent) {
  7954. headers.set('Connection', 'close');
  7955. }
  7956. // HTTP-network fetch step 4.2
  7957. // chunked encoding is handled by Node.js
  7958. return Object.assign({}, parsedURL, {
  7959. method: request.method,
  7960. headers: exportNodeCompatibleHeaders(headers),
  7961. agent
  7962. });
  7963. }
  7964. /**
  7965. * abort-error.js
  7966. *
  7967. * AbortError interface for cancelled requests
  7968. */
  7969. /**
  7970. * Create AbortError instance
  7971. *
  7972. * @param String message Error message for human
  7973. * @return AbortError
  7974. */
  7975. function AbortError(message) {
  7976. Error.call(this, message);
  7977. this.type = 'aborted';
  7978. this.message = message;
  7979. // hide custom error implementation details from end-users
  7980. Error.captureStackTrace(this, this.constructor);
  7981. }
  7982. AbortError.prototype = Object.create(Error.prototype);
  7983. AbortError.prototype.constructor = AbortError;
  7984. AbortError.prototype.name = 'AbortError';
  7985. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7986. const PassThrough$1 = Stream.PassThrough;
  7987. const resolve_url = Url.resolve;
  7988. /**
  7989. * Fetch function
  7990. *
  7991. * @param Mixed url Absolute url or Request instance
  7992. * @param Object opts Fetch options
  7993. * @return Promise
  7994. */
  7995. function fetch(url, opts) {
  7996. // allow custom promise
  7997. if (!fetch.Promise) {
  7998. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7999. }
  8000. Body.Promise = fetch.Promise;
  8001. // wrap http.request into fetch
  8002. return new fetch.Promise(function (resolve, reject) {
  8003. // build request object
  8004. const request = new Request(url, opts);
  8005. const options = getNodeRequestOptions(request);
  8006. const send = (options.protocol === 'https:' ? https : http).request;
  8007. const signal = request.signal;
  8008. let response = null;
  8009. const abort = function abort() {
  8010. let error = new AbortError('The user aborted a request.');
  8011. reject(error);
  8012. if (request.body && request.body instanceof Stream.Readable) {
  8013. request.body.destroy(error);
  8014. }
  8015. if (!response || !response.body) return;
  8016. response.body.emit('error', error);
  8017. };
  8018. if (signal && signal.aborted) {
  8019. abort();
  8020. return;
  8021. }
  8022. const abortAndFinalize = function abortAndFinalize() {
  8023. abort();
  8024. finalize();
  8025. };
  8026. // send request
  8027. const req = send(options);
  8028. let reqTimeout;
  8029. if (signal) {
  8030. signal.addEventListener('abort', abortAndFinalize);
  8031. }
  8032. function finalize() {
  8033. req.abort();
  8034. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8035. clearTimeout(reqTimeout);
  8036. }
  8037. if (request.timeout) {
  8038. req.once('socket', function (socket) {
  8039. reqTimeout = setTimeout(function () {
  8040. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8041. finalize();
  8042. }, request.timeout);
  8043. });
  8044. }
  8045. req.on('error', function (err) {
  8046. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8047. finalize();
  8048. });
  8049. req.on('response', function (res) {
  8050. clearTimeout(reqTimeout);
  8051. const headers = createHeadersLenient(res.headers);
  8052. // HTTP fetch step 5
  8053. if (fetch.isRedirect(res.statusCode)) {
  8054. // HTTP fetch step 5.2
  8055. const location = headers.get('Location');
  8056. // HTTP fetch step 5.3
  8057. const locationURL = location === null ? null : resolve_url(request.url, location);
  8058. // HTTP fetch step 5.5
  8059. switch (request.redirect) {
  8060. case 'error':
  8061. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8062. finalize();
  8063. return;
  8064. case 'manual':
  8065. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8066. if (locationURL !== null) {
  8067. // handle corrupted header
  8068. try {
  8069. headers.set('Location', locationURL);
  8070. } catch (err) {
  8071. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8072. reject(err);
  8073. }
  8074. }
  8075. break;
  8076. case 'follow':
  8077. // HTTP-redirect fetch step 2
  8078. if (locationURL === null) {
  8079. break;
  8080. }
  8081. // HTTP-redirect fetch step 5
  8082. if (request.counter >= request.follow) {
  8083. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8084. finalize();
  8085. return;
  8086. }
  8087. // HTTP-redirect fetch step 6 (counter increment)
  8088. // Create a new Request object.
  8089. const requestOpts = {
  8090. headers: new Headers(request.headers),
  8091. follow: request.follow,
  8092. counter: request.counter + 1,
  8093. agent: request.agent,
  8094. compress: request.compress,
  8095. method: request.method,
  8096. body: request.body,
  8097. signal: request.signal,
  8098. timeout: request.timeout
  8099. };
  8100. // HTTP-redirect fetch step 9
  8101. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8102. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8103. finalize();
  8104. return;
  8105. }
  8106. // HTTP-redirect fetch step 11
  8107. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8108. requestOpts.method = 'GET';
  8109. requestOpts.body = undefined;
  8110. requestOpts.headers.delete('content-length');
  8111. }
  8112. // HTTP-redirect fetch step 15
  8113. resolve(fetch(new Request(locationURL, requestOpts)));
  8114. finalize();
  8115. return;
  8116. }
  8117. }
  8118. // prepare response
  8119. res.once('end', function () {
  8120. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8121. });
  8122. let body = res.pipe(new PassThrough$1());
  8123. const response_options = {
  8124. url: request.url,
  8125. status: res.statusCode,
  8126. statusText: res.statusMessage,
  8127. headers: headers,
  8128. size: request.size,
  8129. timeout: request.timeout,
  8130. counter: request.counter
  8131. };
  8132. // HTTP-network fetch step 12.1.1.3
  8133. const codings = headers.get('Content-Encoding');
  8134. // HTTP-network fetch step 12.1.1.4: handle content codings
  8135. // in following scenarios we ignore compression support
  8136. // 1. compression support is disabled
  8137. // 2. HEAD request
  8138. // 3. no Content-Encoding header
  8139. // 4. no content response (204)
  8140. // 5. content not modified response (304)
  8141. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8142. response = new Response(body, response_options);
  8143. resolve(response);
  8144. return;
  8145. }
  8146. // For Node v6+
  8147. // Be less strict when decoding compressed responses, since sometimes
  8148. // servers send slightly invalid responses that are still accepted
  8149. // by common browsers.
  8150. // Always using Z_SYNC_FLUSH is what cURL does.
  8151. const zlibOptions = {
  8152. flush: zlib.Z_SYNC_FLUSH,
  8153. finishFlush: zlib.Z_SYNC_FLUSH
  8154. };
  8155. // for gzip
  8156. if (codings == 'gzip' || codings == 'x-gzip') {
  8157. body = body.pipe(zlib.createGunzip(zlibOptions));
  8158. response = new Response(body, response_options);
  8159. resolve(response);
  8160. return;
  8161. }
  8162. // for deflate
  8163. if (codings == 'deflate' || codings == 'x-deflate') {
  8164. // handle the infamous raw deflate response from old servers
  8165. // a hack for old IIS and Apache servers
  8166. const raw = res.pipe(new PassThrough$1());
  8167. raw.once('data', function (chunk) {
  8168. // see http://stackoverflow.com/questions/37519828
  8169. if ((chunk[0] & 0x0F) === 0x08) {
  8170. body = body.pipe(zlib.createInflate());
  8171. } else {
  8172. body = body.pipe(zlib.createInflateRaw());
  8173. }
  8174. response = new Response(body, response_options);
  8175. resolve(response);
  8176. });
  8177. return;
  8178. }
  8179. // for br
  8180. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8181. body = body.pipe(zlib.createBrotliDecompress());
  8182. response = new Response(body, response_options);
  8183. resolve(response);
  8184. return;
  8185. }
  8186. // otherwise, use response as-is
  8187. response = new Response(body, response_options);
  8188. resolve(response);
  8189. });
  8190. writeToStream(req, request);
  8191. });
  8192. }
  8193. /**
  8194. * Redirect code matching
  8195. *
  8196. * @param Number code Status code
  8197. * @return Boolean
  8198. */
  8199. fetch.isRedirect = function (code) {
  8200. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8201. };
  8202. // expose Promise
  8203. fetch.Promise = global.Promise;
  8204. module.exports = exports = fetch;
  8205. Object.defineProperty(exports, "__esModule", { value: true });
  8206. exports.default = exports;
  8207. exports.Headers = Headers;
  8208. exports.Request = Request;
  8209. exports.Response = Response;
  8210. exports.FetchError = FetchError;
  8211. /***/ }),
  8212. /***/ 462:
  8213. /***/ (function(module) {
  8214. "use strict";
  8215. // See http://www.robvanderwoude.com/escapechars.php
  8216. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8217. function escapeCommand(arg) {
  8218. // Escape meta chars
  8219. arg = arg.replace(metaCharsRegExp, '^$1');
  8220. return arg;
  8221. }
  8222. function escapeArgument(arg, doubleEscapeMetaChars) {
  8223. // Convert to string
  8224. arg = `${arg}`;
  8225. // Algorithm below is based on https://qntm.org/cmd
  8226. // Sequence of backslashes followed by a double quote:
  8227. // double up all the backslashes and escape the double quote
  8228. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8229. // Sequence of backslashes followed by the end of the string
  8230. // (which will become a double quote later):
  8231. // double up all the backslashes
  8232. arg = arg.replace(/(\\*)$/, '$1$1');
  8233. // All other backslashes occur literally
  8234. // Quote the whole thing:
  8235. arg = `"${arg}"`;
  8236. // Escape meta chars
  8237. arg = arg.replace(metaCharsRegExp, '^$1');
  8238. // Double escape meta chars if necessary
  8239. if (doubleEscapeMetaChars) {
  8240. arg = arg.replace(metaCharsRegExp, '^$1');
  8241. }
  8242. return arg;
  8243. }
  8244. module.exports.command = escapeCommand;
  8245. module.exports.argument = escapeArgument;
  8246. /***/ }),
  8247. /***/ 463:
  8248. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8249. "use strict";
  8250. Object.defineProperty(exports, '__esModule', { value: true });
  8251. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8252. var deprecation = __webpack_require__(692);
  8253. var once = _interopDefault(__webpack_require__(969));
  8254. const logOnce = once(deprecation => console.warn(deprecation));
  8255. /**
  8256. * Error with extra properties to help with debugging
  8257. */
  8258. class RequestError extends Error {
  8259. constructor(message, statusCode, options) {
  8260. super(message); // Maintains proper stack trace (only available on V8)
  8261. /* istanbul ignore next */
  8262. if (Error.captureStackTrace) {
  8263. Error.captureStackTrace(this, this.constructor);
  8264. }
  8265. this.name = "HttpError";
  8266. this.status = statusCode;
  8267. Object.defineProperty(this, "code", {
  8268. get() {
  8269. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8270. return statusCode;
  8271. }
  8272. });
  8273. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8274. const requestCopy = Object.assign({}, options.request);
  8275. if (options.request.headers.authorization) {
  8276. requestCopy.headers = Object.assign({}, options.request.headers, {
  8277. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8278. });
  8279. }
  8280. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8281. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8282. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8283. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8284. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8285. this.request = requestCopy;
  8286. }
  8287. }
  8288. exports.RequestError = RequestError;
  8289. //# sourceMappingURL=index.js.map
  8290. /***/ }),
  8291. /***/ 464:
  8292. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8293. "use strict";
  8294. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8295. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8296. return new (P || (P = Promise))(function (resolve, reject) {
  8297. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8298. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8299. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8300. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8301. });
  8302. };
  8303. var __importStar = (this && this.__importStar) || function (mod) {
  8304. if (mod && mod.__esModule) return mod;
  8305. var result = {};
  8306. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8307. result["default"] = mod;
  8308. return result;
  8309. };
  8310. var __importDefault = (this && this.__importDefault) || function (mod) {
  8311. return (mod && mod.__esModule) ? mod : { "default": mod };
  8312. };
  8313. Object.defineProperty(exports, "__esModule", { value: true });
  8314. const assert = __importStar(__webpack_require__(357));
  8315. const core = __importStar(__webpack_require__(470));
  8316. const fs = __importStar(__webpack_require__(747));
  8317. const github = __importStar(__webpack_require__(469));
  8318. const io = __importStar(__webpack_require__(1));
  8319. const path = __importStar(__webpack_require__(622));
  8320. const retryHelper = __importStar(__webpack_require__(587));
  8321. const toolCache = __importStar(__webpack_require__(533));
  8322. const v4_1 = __importDefault(__webpack_require__(826));
  8323. const IS_WINDOWS = process.platform === 'win32';
  8324. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8325. return __awaiter(this, void 0, void 0, function* () {
  8326. // Determine the default branch
  8327. if (!ref && !commit) {
  8328. core.info('Determining the default branch');
  8329. ref = yield getDefaultBranch(authToken, owner, repo);
  8330. }
  8331. // Download the archive
  8332. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8333. core.info('Downloading the archive');
  8334. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8335. }));
  8336. // Write archive to disk
  8337. core.info('Writing archive to disk');
  8338. const uniqueId = v4_1.default();
  8339. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8340. yield fs.promises.writeFile(archivePath, archiveData);
  8341. archiveData = Buffer.from(''); // Free memory
  8342. // Extract archive
  8343. core.info('Extracting the archive');
  8344. const extractPath = path.join(repositoryPath, uniqueId);
  8345. yield io.mkdirP(extractPath);
  8346. if (IS_WINDOWS) {
  8347. yield toolCache.extractZip(archivePath, extractPath);
  8348. }
  8349. else {
  8350. yield toolCache.extractTar(archivePath, extractPath);
  8351. }
  8352. yield io.rmRF(archivePath);
  8353. // Determine the path of the repository content. The archive contains
  8354. // a top-level folder and the repository content is inside.
  8355. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8356. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8357. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8358. core.info(`Resolved version ${archiveVersion}`);
  8359. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8360. // Move the files
  8361. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8362. const sourcePath = path.join(tempRepositoryPath, fileName);
  8363. const targetPath = path.join(repositoryPath, fileName);
  8364. if (IS_WINDOWS) {
  8365. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8366. }
  8367. else {
  8368. yield io.mv(sourcePath, targetPath);
  8369. }
  8370. }
  8371. yield io.rmRF(extractPath);
  8372. });
  8373. }
  8374. exports.downloadRepository = downloadRepository;
  8375. /**
  8376. * Looks up the default branch name
  8377. */
  8378. function getDefaultBranch(authToken, owner, repo) {
  8379. return __awaiter(this, void 0, void 0, function* () {
  8380. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8381. core.info('Retrieving the default branch name');
  8382. const octokit = new github.GitHub(authToken);
  8383. let result;
  8384. try {
  8385. // Get the default branch from the repo info
  8386. const response = yield octokit.repos.get({ owner, repo });
  8387. result = response.data.default_branch;
  8388. assert.ok(result, 'default_branch cannot be empty');
  8389. }
  8390. catch (err) {
  8391. // Handle .wiki repo
  8392. if (err['status'] === 404 && repo.toUpperCase().endsWith('.WIKI')) {
  8393. result = 'master';
  8394. }
  8395. // Otherwise error
  8396. else {
  8397. throw err;
  8398. }
  8399. }
  8400. // Print the default branch
  8401. core.info(`Default branch '${result}'`);
  8402. // Prefix with 'refs/heads'
  8403. if (!result.startsWith('refs/')) {
  8404. result = `refs/heads/${result}`;
  8405. }
  8406. return result;
  8407. }));
  8408. });
  8409. }
  8410. exports.getDefaultBranch = getDefaultBranch;
  8411. function downloadArchive(authToken, owner, repo, ref, commit) {
  8412. return __awaiter(this, void 0, void 0, function* () {
  8413. const octokit = new github.GitHub(authToken);
  8414. const params = {
  8415. owner: owner,
  8416. repo: repo,
  8417. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8418. ref: commit || ref
  8419. };
  8420. const response = yield octokit.repos.getArchiveLink(params);
  8421. if (response.status != 200) {
  8422. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8423. }
  8424. return Buffer.from(response.data); // response.data is ArrayBuffer
  8425. });
  8426. }
  8427. /***/ }),
  8428. /***/ 469:
  8429. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8430. "use strict";
  8431. var __importStar = (this && this.__importStar) || function (mod) {
  8432. if (mod && mod.__esModule) return mod;
  8433. var result = {};
  8434. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8435. result["default"] = mod;
  8436. return result;
  8437. };
  8438. Object.defineProperty(exports, "__esModule", { value: true });
  8439. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8440. const graphql_1 = __webpack_require__(898);
  8441. const rest_1 = __webpack_require__(0);
  8442. const Context = __importStar(__webpack_require__(262));
  8443. const httpClient = __importStar(__webpack_require__(539));
  8444. // We need this in order to extend Octokit
  8445. rest_1.Octokit.prototype = new rest_1.Octokit();
  8446. exports.context = new Context.Context();
  8447. class GitHub extends rest_1.Octokit {
  8448. constructor(token, opts) {
  8449. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8450. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8451. }
  8452. /**
  8453. * Disambiguates the constructor overload parameters
  8454. */
  8455. static disambiguate(token, opts) {
  8456. return [
  8457. typeof token === 'string' ? token : '',
  8458. typeof token === 'object' ? token : opts || {}
  8459. ];
  8460. }
  8461. static getOctokitOptions(args) {
  8462. const token = args[0];
  8463. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8464. // Base URL - GHES or Dotcom
  8465. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8466. // Auth
  8467. const auth = GitHub.getAuthString(token, options);
  8468. if (auth) {
  8469. options.auth = auth;
  8470. }
  8471. // Proxy
  8472. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8473. if (agent) {
  8474. // Shallow clone - don't mutate the object provided by the caller
  8475. options.request = options.request ? Object.assign({}, options.request) : {};
  8476. // Set the agent
  8477. options.request.agent = agent;
  8478. }
  8479. return options;
  8480. }
  8481. static getGraphQL(args) {
  8482. const defaults = {};
  8483. defaults.baseUrl = this.getGraphQLBaseUrl();
  8484. const token = args[0];
  8485. const options = args[1];
  8486. // Authorization
  8487. const auth = this.getAuthString(token, options);
  8488. if (auth) {
  8489. defaults.headers = {
  8490. authorization: auth
  8491. };
  8492. }
  8493. // Proxy
  8494. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8495. if (agent) {
  8496. defaults.request = { agent };
  8497. }
  8498. return graphql_1.graphql.defaults(defaults);
  8499. }
  8500. static getAuthString(token, options) {
  8501. // Validate args
  8502. if (!token && !options.auth) {
  8503. throw new Error('Parameter token or opts.auth is required');
  8504. }
  8505. else if (token && options.auth) {
  8506. throw new Error('Parameters token and opts.auth may not both be specified');
  8507. }
  8508. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8509. }
  8510. static getProxyAgent(destinationUrl, options) {
  8511. var _a;
  8512. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8513. if (httpClient.getProxyUrl(destinationUrl)) {
  8514. const hc = new httpClient.HttpClient();
  8515. return hc.getAgent(destinationUrl);
  8516. }
  8517. }
  8518. return undefined;
  8519. }
  8520. static getApiBaseUrl() {
  8521. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8522. }
  8523. static getGraphQLBaseUrl() {
  8524. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8525. // Shouldn't be a trailing slash, but remove if so
  8526. if (url.endsWith('/')) {
  8527. url = url.substr(0, url.length - 1);
  8528. }
  8529. // Remove trailing "/graphql"
  8530. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8531. url = url.substr(0, url.length - '/graphql'.length);
  8532. }
  8533. return url;
  8534. }
  8535. }
  8536. exports.GitHub = GitHub;
  8537. //# sourceMappingURL=github.js.map
  8538. /***/ }),
  8539. /***/ 470:
  8540. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8541. "use strict";
  8542. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8543. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8544. return new (P || (P = Promise))(function (resolve, reject) {
  8545. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8546. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8547. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8548. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8549. });
  8550. };
  8551. Object.defineProperty(exports, "__esModule", { value: true });
  8552. const command_1 = __webpack_require__(431);
  8553. const os = __webpack_require__(87);
  8554. const path = __webpack_require__(622);
  8555. /**
  8556. * The code to exit an action
  8557. */
  8558. var ExitCode;
  8559. (function (ExitCode) {
  8560. /**
  8561. * A code indicating that the action was successful
  8562. */
  8563. ExitCode[ExitCode["Success"] = 0] = "Success";
  8564. /**
  8565. * A code indicating that the action was a failure
  8566. */
  8567. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8568. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8569. //-----------------------------------------------------------------------
  8570. // Variables
  8571. //-----------------------------------------------------------------------
  8572. /**
  8573. * Sets env variable for this action and future actions in the job
  8574. * @param name the name of the variable to set
  8575. * @param val the value of the variable
  8576. */
  8577. function exportVariable(name, val) {
  8578. process.env[name] = val;
  8579. command_1.issueCommand('set-env', { name }, val);
  8580. }
  8581. exports.exportVariable = exportVariable;
  8582. /**
  8583. * Registers a secret which will get masked from logs
  8584. * @param secret value of the secret
  8585. */
  8586. function setSecret(secret) {
  8587. command_1.issueCommand('add-mask', {}, secret);
  8588. }
  8589. exports.setSecret = setSecret;
  8590. /**
  8591. * Prepends inputPath to the PATH (for this action and future actions)
  8592. * @param inputPath
  8593. */
  8594. function addPath(inputPath) {
  8595. command_1.issueCommand('add-path', {}, inputPath);
  8596. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8597. }
  8598. exports.addPath = addPath;
  8599. /**
  8600. * Gets the value of an input. The value is also trimmed.
  8601. *
  8602. * @param name name of the input to get
  8603. * @param options optional. See InputOptions.
  8604. * @returns string
  8605. */
  8606. function getInput(name, options) {
  8607. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8608. if (options && options.required && !val) {
  8609. throw new Error(`Input required and not supplied: ${name}`);
  8610. }
  8611. return val.trim();
  8612. }
  8613. exports.getInput = getInput;
  8614. /**
  8615. * Sets the value of an output.
  8616. *
  8617. * @param name name of the output to set
  8618. * @param value value to store
  8619. */
  8620. function setOutput(name, value) {
  8621. command_1.issueCommand('set-output', { name }, value);
  8622. }
  8623. exports.setOutput = setOutput;
  8624. //-----------------------------------------------------------------------
  8625. // Results
  8626. //-----------------------------------------------------------------------
  8627. /**
  8628. * Sets the action status to failed.
  8629. * When the action exits it will be with an exit code of 1
  8630. * @param message add error issue message
  8631. */
  8632. function setFailed(message) {
  8633. process.exitCode = ExitCode.Failure;
  8634. error(message);
  8635. }
  8636. exports.setFailed = setFailed;
  8637. //-----------------------------------------------------------------------
  8638. // Logging Commands
  8639. //-----------------------------------------------------------------------
  8640. /**
  8641. * Writes debug message to user log
  8642. * @param message debug message
  8643. */
  8644. function debug(message) {
  8645. command_1.issueCommand('debug', {}, message);
  8646. }
  8647. exports.debug = debug;
  8648. /**
  8649. * Adds an error issue
  8650. * @param message error issue message
  8651. */
  8652. function error(message) {
  8653. command_1.issue('error', message);
  8654. }
  8655. exports.error = error;
  8656. /**
  8657. * Adds an warning issue
  8658. * @param message warning issue message
  8659. */
  8660. function warning(message) {
  8661. command_1.issue('warning', message);
  8662. }
  8663. exports.warning = warning;
  8664. /**
  8665. * Writes info to log with console.log.
  8666. * @param message info message
  8667. */
  8668. function info(message) {
  8669. process.stdout.write(message + os.EOL);
  8670. }
  8671. exports.info = info;
  8672. /**
  8673. * Begin an output group.
  8674. *
  8675. * Output until the next `groupEnd` will be foldable in this group
  8676. *
  8677. * @param name The name of the output group
  8678. */
  8679. function startGroup(name) {
  8680. command_1.issue('group', name);
  8681. }
  8682. exports.startGroup = startGroup;
  8683. /**
  8684. * End an output group.
  8685. */
  8686. function endGroup() {
  8687. command_1.issue('endgroup');
  8688. }
  8689. exports.endGroup = endGroup;
  8690. /**
  8691. * Wrap an asynchronous function call in a group.
  8692. *
  8693. * Returns the same type as the function itself.
  8694. *
  8695. * @param name The name of the group
  8696. * @param fn The function to wrap in the group
  8697. */
  8698. function group(name, fn) {
  8699. return __awaiter(this, void 0, void 0, function* () {
  8700. startGroup(name);
  8701. let result;
  8702. try {
  8703. result = yield fn();
  8704. }
  8705. finally {
  8706. endGroup();
  8707. }
  8708. return result;
  8709. });
  8710. }
  8711. exports.group = group;
  8712. //# sourceMappingURL=core.js.map
  8713. /***/ }),
  8714. /***/ 471:
  8715. /***/ (function(module, __unusedexports, __webpack_require__) {
  8716. module.exports = authenticationBeforeRequest;
  8717. const btoa = __webpack_require__(675);
  8718. const uniq = __webpack_require__(126);
  8719. function authenticationBeforeRequest(state, options) {
  8720. if (!state.auth.type) {
  8721. return;
  8722. }
  8723. if (state.auth.type === "basic") {
  8724. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8725. options.headers.authorization = `Basic ${hash}`;
  8726. return;
  8727. }
  8728. if (state.auth.type === "token") {
  8729. options.headers.authorization = `token ${state.auth.token}`;
  8730. return;
  8731. }
  8732. if (state.auth.type === "app") {
  8733. options.headers.authorization = `Bearer ${state.auth.token}`;
  8734. const acceptHeaders = options.headers.accept
  8735. .split(",")
  8736. .concat("application/vnd.github.machine-man-preview+json");
  8737. options.headers.accept = uniq(acceptHeaders)
  8738. .filter(Boolean)
  8739. .join(",");
  8740. return;
  8741. }
  8742. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8743. if (state.auth.token) {
  8744. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8745. return;
  8746. }
  8747. const key = encodeURIComponent(state.auth.key);
  8748. const secret = encodeURIComponent(state.auth.secret);
  8749. options.url += `client_id=${key}&client_secret=${secret}`;
  8750. }
  8751. /***/ }),
  8752. /***/ 489:
  8753. /***/ (function(module, __unusedexports, __webpack_require__) {
  8754. "use strict";
  8755. const path = __webpack_require__(622);
  8756. const which = __webpack_require__(814);
  8757. const pathKey = __webpack_require__(39)();
  8758. function resolveCommandAttempt(parsed, withoutPathExt) {
  8759. const cwd = process.cwd();
  8760. const hasCustomCwd = parsed.options.cwd != null;
  8761. // If a custom `cwd` was specified, we need to change the process cwd
  8762. // because `which` will do stat calls but does not support a custom cwd
  8763. if (hasCustomCwd) {
  8764. try {
  8765. process.chdir(parsed.options.cwd);
  8766. } catch (err) {
  8767. /* Empty */
  8768. }
  8769. }
  8770. let resolved;
  8771. try {
  8772. resolved = which.sync(parsed.command, {
  8773. path: (parsed.options.env || process.env)[pathKey],
  8774. pathExt: withoutPathExt ? path.delimiter : undefined,
  8775. });
  8776. } catch (e) {
  8777. /* Empty */
  8778. } finally {
  8779. process.chdir(cwd);
  8780. }
  8781. // If we successfully resolved, ensure that an absolute path is returned
  8782. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8783. if (resolved) {
  8784. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8785. }
  8786. return resolved;
  8787. }
  8788. function resolveCommand(parsed) {
  8789. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8790. }
  8791. module.exports = resolveCommand;
  8792. /***/ }),
  8793. /***/ 497:
  8794. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8795. "use strict";
  8796. Object.defineProperty(exports, '__esModule', { value: true });
  8797. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8798. var deprecation = __webpack_require__(692);
  8799. var once = _interopDefault(__webpack_require__(969));
  8800. const logOnce = once(deprecation => console.warn(deprecation));
  8801. /**
  8802. * Error with extra properties to help with debugging
  8803. */
  8804. class RequestError extends Error {
  8805. constructor(message, statusCode, options) {
  8806. super(message); // Maintains proper stack trace (only available on V8)
  8807. /* istanbul ignore next */
  8808. if (Error.captureStackTrace) {
  8809. Error.captureStackTrace(this, this.constructor);
  8810. }
  8811. this.name = "HttpError";
  8812. this.status = statusCode;
  8813. Object.defineProperty(this, "code", {
  8814. get() {
  8815. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8816. return statusCode;
  8817. }
  8818. });
  8819. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8820. const requestCopy = Object.assign({}, options.request);
  8821. if (options.request.headers.authorization) {
  8822. requestCopy.headers = Object.assign({}, options.request.headers, {
  8823. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8824. });
  8825. }
  8826. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8827. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8828. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8829. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8830. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8831. this.request = requestCopy;
  8832. }
  8833. }
  8834. exports.RequestError = RequestError;
  8835. //# sourceMappingURL=index.js.map
  8836. /***/ }),
  8837. /***/ 510:
  8838. /***/ (function(module) {
  8839. module.exports = addHook
  8840. function addHook (state, kind, name, hook) {
  8841. var orig = hook
  8842. if (!state.registry[name]) {
  8843. state.registry[name] = []
  8844. }
  8845. if (kind === 'before') {
  8846. hook = function (method, options) {
  8847. return Promise.resolve()
  8848. .then(orig.bind(null, options))
  8849. .then(method.bind(null, options))
  8850. }
  8851. }
  8852. if (kind === 'after') {
  8853. hook = function (method, options) {
  8854. var result
  8855. return Promise.resolve()
  8856. .then(method.bind(null, options))
  8857. .then(function (result_) {
  8858. result = result_
  8859. return orig(result, options)
  8860. })
  8861. .then(function () {
  8862. return result
  8863. })
  8864. }
  8865. }
  8866. if (kind === 'error') {
  8867. hook = function (method, options) {
  8868. return Promise.resolve()
  8869. .then(method.bind(null, options))
  8870. .catch(function (error) {
  8871. return orig(error, options)
  8872. })
  8873. }
  8874. }
  8875. state.registry[name].push({
  8876. hook: hook,
  8877. orig: orig
  8878. })
  8879. }
  8880. /***/ }),
  8881. /***/ 523:
  8882. /***/ (function(module, __unusedexports, __webpack_require__) {
  8883. var register = __webpack_require__(363)
  8884. var addHook = __webpack_require__(510)
  8885. var removeHook = __webpack_require__(763)
  8886. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8887. var bind = Function.bind
  8888. var bindable = bind.bind(bind)
  8889. function bindApi (hook, state, name) {
  8890. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8891. hook.api = { remove: removeHookRef }
  8892. hook.remove = removeHookRef
  8893. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8894. var args = name ? [state, kind, name] : [state, kind]
  8895. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8896. })
  8897. }
  8898. function HookSingular () {
  8899. var singularHookName = 'h'
  8900. var singularHookState = {
  8901. registry: {}
  8902. }
  8903. var singularHook = register.bind(null, singularHookState, singularHookName)
  8904. bindApi(singularHook, singularHookState, singularHookName)
  8905. return singularHook
  8906. }
  8907. function HookCollection () {
  8908. var state = {
  8909. registry: {}
  8910. }
  8911. var hook = register.bind(null, state)
  8912. bindApi(hook, state)
  8913. return hook
  8914. }
  8915. var collectionHookDeprecationMessageDisplayed = false
  8916. function Hook () {
  8917. if (!collectionHookDeprecationMessageDisplayed) {
  8918. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8919. collectionHookDeprecationMessageDisplayed = true
  8920. }
  8921. return HookCollection()
  8922. }
  8923. Hook.Singular = HookSingular.bind()
  8924. Hook.Collection = HookCollection.bind()
  8925. module.exports = Hook
  8926. // expose constructors as a named property for TypeScript
  8927. module.exports.Hook = Hook
  8928. module.exports.Singular = Hook.Singular
  8929. module.exports.Collection = Hook.Collection
  8930. /***/ }),
  8931. /***/ 528:
  8932. /***/ (function(__unusedmodule, exports) {
  8933. "use strict";
  8934. Object.defineProperty(exports, "__esModule", { value: true });
  8935. function escape(value) {
  8936. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8937. return `\\${x}`;
  8938. });
  8939. }
  8940. exports.escape = escape;
  8941. /***/ }),
  8942. /***/ 529:
  8943. /***/ (function(module, __unusedexports, __webpack_require__) {
  8944. const factory = __webpack_require__(47);
  8945. module.exports = factory();
  8946. /***/ }),
  8947. /***/ 533:
  8948. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8949. "use strict";
  8950. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8951. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8952. return new (P || (P = Promise))(function (resolve, reject) {
  8953. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8954. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8955. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8956. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8957. });
  8958. };
  8959. Object.defineProperty(exports, "__esModule", { value: true });
  8960. const core = __webpack_require__(470);
  8961. const io = __webpack_require__(1);
  8962. const fs = __webpack_require__(747);
  8963. const os = __webpack_require__(87);
  8964. const path = __webpack_require__(622);
  8965. const httpm = __webpack_require__(874);
  8966. const semver = __webpack_require__(656);
  8967. const uuidV4 = __webpack_require__(826);
  8968. const exec_1 = __webpack_require__(986);
  8969. const assert_1 = __webpack_require__(357);
  8970. class HTTPError extends Error {
  8971. constructor(httpStatusCode) {
  8972. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8973. this.httpStatusCode = httpStatusCode;
  8974. Object.setPrototypeOf(this, new.target.prototype);
  8975. }
  8976. }
  8977. exports.HTTPError = HTTPError;
  8978. const IS_WINDOWS = process.platform === 'win32';
  8979. const userAgent = 'actions/tool-cache';
  8980. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8981. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8982. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8983. // If directories not found, place them in common temp locations
  8984. if (!tempDirectory || !cacheRoot) {
  8985. let baseLocation;
  8986. if (IS_WINDOWS) {
  8987. // On windows use the USERPROFILE env variable
  8988. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8989. }
  8990. else {
  8991. if (process.platform === 'darwin') {
  8992. baseLocation = '/Users';
  8993. }
  8994. else {
  8995. baseLocation = '/home';
  8996. }
  8997. }
  8998. if (!tempDirectory) {
  8999. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  9000. }
  9001. if (!cacheRoot) {
  9002. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  9003. }
  9004. }
  9005. /**
  9006. * Download a tool from an url and stream it into a file
  9007. *
  9008. * @param url url of tool to download
  9009. * @returns path to downloaded tool
  9010. */
  9011. function downloadTool(url) {
  9012. return __awaiter(this, void 0, void 0, function* () {
  9013. // Wrap in a promise so that we can resolve from within stream callbacks
  9014. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  9015. try {
  9016. const http = new httpm.HttpClient(userAgent, [], {
  9017. allowRetries: true,
  9018. maxRetries: 3
  9019. });
  9020. const destPath = path.join(tempDirectory, uuidV4());
  9021. yield io.mkdirP(tempDirectory);
  9022. core.debug(`Downloading ${url}`);
  9023. core.debug(`Downloading ${destPath}`);
  9024. if (fs.existsSync(destPath)) {
  9025. throw new Error(`Destination file path ${destPath} already exists`);
  9026. }
  9027. const response = yield http.get(url);
  9028. if (response.message.statusCode !== 200) {
  9029. const err = new HTTPError(response.message.statusCode);
  9030. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9031. throw err;
  9032. }
  9033. const file = fs.createWriteStream(destPath);
  9034. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  9035. try {
  9036. const stream = response.message.pipe(file);
  9037. stream.on('close', () => {
  9038. core.debug('download complete');
  9039. resolve(destPath);
  9040. });
  9041. }
  9042. catch (err) {
  9043. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9044. reject(err);
  9045. }
  9046. }));
  9047. file.on('error', err => {
  9048. file.end();
  9049. reject(err);
  9050. });
  9051. }
  9052. catch (err) {
  9053. reject(err);
  9054. }
  9055. }));
  9056. });
  9057. }
  9058. exports.downloadTool = downloadTool;
  9059. /**
  9060. * Extract a .7z file
  9061. *
  9062. * @param file path to the .7z file
  9063. * @param dest destination directory. Optional.
  9064. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9065. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9066. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9067. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9068. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9069. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9070. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9071. * to 7zr.exe can be pass to this function.
  9072. * @returns path to the destination directory
  9073. */
  9074. function extract7z(file, dest, _7zPath) {
  9075. return __awaiter(this, void 0, void 0, function* () {
  9076. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9077. assert_1.ok(file, 'parameter "file" is required');
  9078. dest = dest || (yield _createExtractFolder(dest));
  9079. const originalCwd = process.cwd();
  9080. process.chdir(dest);
  9081. if (_7zPath) {
  9082. try {
  9083. const args = [
  9084. 'x',
  9085. '-bb1',
  9086. '-bd',
  9087. '-sccUTF-8',
  9088. file
  9089. ];
  9090. const options = {
  9091. silent: true
  9092. };
  9093. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9094. }
  9095. finally {
  9096. process.chdir(originalCwd);
  9097. }
  9098. }
  9099. else {
  9100. const escapedScript = path
  9101. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9102. .replace(/'/g, "''")
  9103. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9104. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9105. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9106. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9107. const args = [
  9108. '-NoLogo',
  9109. '-Sta',
  9110. '-NoProfile',
  9111. '-NonInteractive',
  9112. '-ExecutionPolicy',
  9113. 'Unrestricted',
  9114. '-Command',
  9115. command
  9116. ];
  9117. const options = {
  9118. silent: true
  9119. };
  9120. try {
  9121. const powershellPath = yield io.which('powershell', true);
  9122. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9123. }
  9124. finally {
  9125. process.chdir(originalCwd);
  9126. }
  9127. }
  9128. return dest;
  9129. });
  9130. }
  9131. exports.extract7z = extract7z;
  9132. /**
  9133. * Extract a tar
  9134. *
  9135. * @param file path to the tar
  9136. * @param dest destination directory. Optional.
  9137. * @param flags flags for the tar. Optional.
  9138. * @returns path to the destination directory
  9139. */
  9140. function extractTar(file, dest, flags = 'xz') {
  9141. return __awaiter(this, void 0, void 0, function* () {
  9142. if (!file) {
  9143. throw new Error("parameter 'file' is required");
  9144. }
  9145. dest = dest || (yield _createExtractFolder(dest));
  9146. const tarPath = yield io.which('tar', true);
  9147. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9148. return dest;
  9149. });
  9150. }
  9151. exports.extractTar = extractTar;
  9152. /**
  9153. * Extract a zip
  9154. *
  9155. * @param file path to the zip
  9156. * @param dest destination directory. Optional.
  9157. * @returns path to the destination directory
  9158. */
  9159. function extractZip(file, dest) {
  9160. return __awaiter(this, void 0, void 0, function* () {
  9161. if (!file) {
  9162. throw new Error("parameter 'file' is required");
  9163. }
  9164. dest = dest || (yield _createExtractFolder(dest));
  9165. if (IS_WINDOWS) {
  9166. yield extractZipWin(file, dest);
  9167. }
  9168. else {
  9169. yield extractZipNix(file, dest);
  9170. }
  9171. return dest;
  9172. });
  9173. }
  9174. exports.extractZip = extractZip;
  9175. function extractZipWin(file, dest) {
  9176. return __awaiter(this, void 0, void 0, function* () {
  9177. // build the powershell command
  9178. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9179. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9180. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9181. // run powershell
  9182. const powershellPath = yield io.which('powershell');
  9183. const args = [
  9184. '-NoLogo',
  9185. '-Sta',
  9186. '-NoProfile',
  9187. '-NonInteractive',
  9188. '-ExecutionPolicy',
  9189. 'Unrestricted',
  9190. '-Command',
  9191. command
  9192. ];
  9193. yield exec_1.exec(`"${powershellPath}"`, args);
  9194. });
  9195. }
  9196. function extractZipNix(file, dest) {
  9197. return __awaiter(this, void 0, void 0, function* () {
  9198. const unzipPath = yield io.which('unzip');
  9199. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9200. });
  9201. }
  9202. /**
  9203. * Caches a directory and installs it into the tool cacheDir
  9204. *
  9205. * @param sourceDir the directory to cache into tools
  9206. * @param tool tool name
  9207. * @param version version of the tool. semver format
  9208. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9209. */
  9210. function cacheDir(sourceDir, tool, version, arch) {
  9211. return __awaiter(this, void 0, void 0, function* () {
  9212. version = semver.clean(version) || version;
  9213. arch = arch || os.arch();
  9214. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9215. core.debug(`source dir: ${sourceDir}`);
  9216. if (!fs.statSync(sourceDir).isDirectory()) {
  9217. throw new Error('sourceDir is not a directory');
  9218. }
  9219. // Create the tool dir
  9220. const destPath = yield _createToolPath(tool, version, arch);
  9221. // copy each child item. do not move. move can fail on Windows
  9222. // due to anti-virus software having an open handle on a file.
  9223. for (const itemName of fs.readdirSync(sourceDir)) {
  9224. const s = path.join(sourceDir, itemName);
  9225. yield io.cp(s, destPath, { recursive: true });
  9226. }
  9227. // write .complete
  9228. _completeToolPath(tool, version, arch);
  9229. return destPath;
  9230. });
  9231. }
  9232. exports.cacheDir = cacheDir;
  9233. /**
  9234. * Caches a downloaded file (GUID) and installs it
  9235. * into the tool cache with a given targetName
  9236. *
  9237. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9238. * @param targetFile the name of the file name in the tools directory
  9239. * @param tool tool name
  9240. * @param version version of the tool. semver format
  9241. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9242. */
  9243. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9244. return __awaiter(this, void 0, void 0, function* () {
  9245. version = semver.clean(version) || version;
  9246. arch = arch || os.arch();
  9247. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9248. core.debug(`source file: ${sourceFile}`);
  9249. if (!fs.statSync(sourceFile).isFile()) {
  9250. throw new Error('sourceFile is not a file');
  9251. }
  9252. // create the tool dir
  9253. const destFolder = yield _createToolPath(tool, version, arch);
  9254. // copy instead of move. move can fail on Windows due to
  9255. // anti-virus software having an open handle on a file.
  9256. const destPath = path.join(destFolder, targetFile);
  9257. core.debug(`destination file ${destPath}`);
  9258. yield io.cp(sourceFile, destPath);
  9259. // write .complete
  9260. _completeToolPath(tool, version, arch);
  9261. return destFolder;
  9262. });
  9263. }
  9264. exports.cacheFile = cacheFile;
  9265. /**
  9266. * Finds the path to a tool version in the local installed tool cache
  9267. *
  9268. * @param toolName name of the tool
  9269. * @param versionSpec version of the tool
  9270. * @param arch optional arch. defaults to arch of computer
  9271. */
  9272. function find(toolName, versionSpec, arch) {
  9273. if (!toolName) {
  9274. throw new Error('toolName parameter is required');
  9275. }
  9276. if (!versionSpec) {
  9277. throw new Error('versionSpec parameter is required');
  9278. }
  9279. arch = arch || os.arch();
  9280. // attempt to resolve an explicit version
  9281. if (!_isExplicitVersion(versionSpec)) {
  9282. const localVersions = findAllVersions(toolName, arch);
  9283. const match = _evaluateVersions(localVersions, versionSpec);
  9284. versionSpec = match;
  9285. }
  9286. // check for the explicit version in the cache
  9287. let toolPath = '';
  9288. if (versionSpec) {
  9289. versionSpec = semver.clean(versionSpec) || '';
  9290. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9291. core.debug(`checking cache: ${cachePath}`);
  9292. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9293. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9294. toolPath = cachePath;
  9295. }
  9296. else {
  9297. core.debug('not found');
  9298. }
  9299. }
  9300. return toolPath;
  9301. }
  9302. exports.find = find;
  9303. /**
  9304. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9305. *
  9306. * @param toolName name of the tool
  9307. * @param arch optional arch. defaults to arch of computer
  9308. */
  9309. function findAllVersions(toolName, arch) {
  9310. const versions = [];
  9311. arch = arch || os.arch();
  9312. const toolPath = path.join(cacheRoot, toolName);
  9313. if (fs.existsSync(toolPath)) {
  9314. const children = fs.readdirSync(toolPath);
  9315. for (const child of children) {
  9316. if (_isExplicitVersion(child)) {
  9317. const fullPath = path.join(toolPath, child, arch || '');
  9318. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9319. versions.push(child);
  9320. }
  9321. }
  9322. }
  9323. }
  9324. return versions;
  9325. }
  9326. exports.findAllVersions = findAllVersions;
  9327. function _createExtractFolder(dest) {
  9328. return __awaiter(this, void 0, void 0, function* () {
  9329. if (!dest) {
  9330. // create a temp dir
  9331. dest = path.join(tempDirectory, uuidV4());
  9332. }
  9333. yield io.mkdirP(dest);
  9334. return dest;
  9335. });
  9336. }
  9337. function _createToolPath(tool, version, arch) {
  9338. return __awaiter(this, void 0, void 0, function* () {
  9339. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9340. core.debug(`destination ${folderPath}`);
  9341. const markerPath = `${folderPath}.complete`;
  9342. yield io.rmRF(folderPath);
  9343. yield io.rmRF(markerPath);
  9344. yield io.mkdirP(folderPath);
  9345. return folderPath;
  9346. });
  9347. }
  9348. function _completeToolPath(tool, version, arch) {
  9349. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9350. const markerPath = `${folderPath}.complete`;
  9351. fs.writeFileSync(markerPath, '');
  9352. core.debug('finished caching tool');
  9353. }
  9354. function _isExplicitVersion(versionSpec) {
  9355. const c = semver.clean(versionSpec) || '';
  9356. core.debug(`isExplicit: ${c}`);
  9357. const valid = semver.valid(c) != null;
  9358. core.debug(`explicit? ${valid}`);
  9359. return valid;
  9360. }
  9361. function _evaluateVersions(versions, versionSpec) {
  9362. let version = '';
  9363. core.debug(`evaluating ${versions.length} versions`);
  9364. versions = versions.sort((a, b) => {
  9365. if (semver.gt(a, b)) {
  9366. return 1;
  9367. }
  9368. return -1;
  9369. });
  9370. for (let i = versions.length - 1; i >= 0; i--) {
  9371. const potential = versions[i];
  9372. const satisfied = semver.satisfies(potential, versionSpec);
  9373. if (satisfied) {
  9374. version = potential;
  9375. break;
  9376. }
  9377. }
  9378. if (version) {
  9379. core.debug(`matched: ${version}`);
  9380. }
  9381. else {
  9382. core.debug('match not found');
  9383. }
  9384. return version;
  9385. }
  9386. //# sourceMappingURL=tool-cache.js.map
  9387. /***/ }),
  9388. /***/ 536:
  9389. /***/ (function(module, __unusedexports, __webpack_require__) {
  9390. module.exports = hasFirstPage
  9391. const deprecate = __webpack_require__(370)
  9392. const getPageLinks = __webpack_require__(577)
  9393. function hasFirstPage (link) {
  9394. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9395. return getPageLinks(link).first
  9396. }
  9397. /***/ }),
  9398. /***/ 539:
  9399. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9400. "use strict";
  9401. Object.defineProperty(exports, "__esModule", { value: true });
  9402. const url = __webpack_require__(835);
  9403. const http = __webpack_require__(605);
  9404. const https = __webpack_require__(34);
  9405. const pm = __webpack_require__(950);
  9406. let tunnel;
  9407. var HttpCodes;
  9408. (function (HttpCodes) {
  9409. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9410. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9411. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9412. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9413. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9414. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9415. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9416. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9417. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9418. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9419. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9420. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9421. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9422. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9423. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9424. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9425. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9426. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9427. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9428. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9429. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9430. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9431. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9432. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9433. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9434. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9435. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9436. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9437. var Headers;
  9438. (function (Headers) {
  9439. Headers["Accept"] = "accept";
  9440. Headers["ContentType"] = "content-type";
  9441. })(Headers = exports.Headers || (exports.Headers = {}));
  9442. var MediaTypes;
  9443. (function (MediaTypes) {
  9444. MediaTypes["ApplicationJson"] = "application/json";
  9445. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9446. /**
  9447. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9448. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9449. */
  9450. function getProxyUrl(serverUrl) {
  9451. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9452. return proxyUrl ? proxyUrl.href : '';
  9453. }
  9454. exports.getProxyUrl = getProxyUrl;
  9455. const HttpRedirectCodes = [
  9456. HttpCodes.MovedPermanently,
  9457. HttpCodes.ResourceMoved,
  9458. HttpCodes.SeeOther,
  9459. HttpCodes.TemporaryRedirect,
  9460. HttpCodes.PermanentRedirect
  9461. ];
  9462. const HttpResponseRetryCodes = [
  9463. HttpCodes.BadGateway,
  9464. HttpCodes.ServiceUnavailable,
  9465. HttpCodes.GatewayTimeout
  9466. ];
  9467. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9468. const ExponentialBackoffCeiling = 10;
  9469. const ExponentialBackoffTimeSlice = 5;
  9470. class HttpClientResponse {
  9471. constructor(message) {
  9472. this.message = message;
  9473. }
  9474. readBody() {
  9475. return new Promise(async (resolve, reject) => {
  9476. let output = Buffer.alloc(0);
  9477. this.message.on('data', (chunk) => {
  9478. output = Buffer.concat([output, chunk]);
  9479. });
  9480. this.message.on('end', () => {
  9481. resolve(output.toString());
  9482. });
  9483. });
  9484. }
  9485. }
  9486. exports.HttpClientResponse = HttpClientResponse;
  9487. function isHttps(requestUrl) {
  9488. let parsedUrl = url.parse(requestUrl);
  9489. return parsedUrl.protocol === 'https:';
  9490. }
  9491. exports.isHttps = isHttps;
  9492. class HttpClient {
  9493. constructor(userAgent, handlers, requestOptions) {
  9494. this._ignoreSslError = false;
  9495. this._allowRedirects = true;
  9496. this._allowRedirectDowngrade = false;
  9497. this._maxRedirects = 50;
  9498. this._allowRetries = false;
  9499. this._maxRetries = 1;
  9500. this._keepAlive = false;
  9501. this._disposed = false;
  9502. this.userAgent = userAgent;
  9503. this.handlers = handlers || [];
  9504. this.requestOptions = requestOptions;
  9505. if (requestOptions) {
  9506. if (requestOptions.ignoreSslError != null) {
  9507. this._ignoreSslError = requestOptions.ignoreSslError;
  9508. }
  9509. this._socketTimeout = requestOptions.socketTimeout;
  9510. if (requestOptions.allowRedirects != null) {
  9511. this._allowRedirects = requestOptions.allowRedirects;
  9512. }
  9513. if (requestOptions.allowRedirectDowngrade != null) {
  9514. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9515. }
  9516. if (requestOptions.maxRedirects != null) {
  9517. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9518. }
  9519. if (requestOptions.keepAlive != null) {
  9520. this._keepAlive = requestOptions.keepAlive;
  9521. }
  9522. if (requestOptions.allowRetries != null) {
  9523. this._allowRetries = requestOptions.allowRetries;
  9524. }
  9525. if (requestOptions.maxRetries != null) {
  9526. this._maxRetries = requestOptions.maxRetries;
  9527. }
  9528. }
  9529. }
  9530. options(requestUrl, additionalHeaders) {
  9531. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9532. }
  9533. get(requestUrl, additionalHeaders) {
  9534. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9535. }
  9536. del(requestUrl, additionalHeaders) {
  9537. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9538. }
  9539. post(requestUrl, data, additionalHeaders) {
  9540. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9541. }
  9542. patch(requestUrl, data, additionalHeaders) {
  9543. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9544. }
  9545. put(requestUrl, data, additionalHeaders) {
  9546. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9547. }
  9548. head(requestUrl, additionalHeaders) {
  9549. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9550. }
  9551. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9552. return this.request(verb, requestUrl, stream, additionalHeaders);
  9553. }
  9554. /**
  9555. * Gets a typed object from an endpoint
  9556. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9557. */
  9558. async getJson(requestUrl, additionalHeaders = {}) {
  9559. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9560. let res = await this.get(requestUrl, additionalHeaders);
  9561. return this._processResponse(res, this.requestOptions);
  9562. }
  9563. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9564. let data = JSON.stringify(obj, null, 2);
  9565. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9566. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9567. let res = await this.post(requestUrl, data, additionalHeaders);
  9568. return this._processResponse(res, this.requestOptions);
  9569. }
  9570. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9571. let data = JSON.stringify(obj, null, 2);
  9572. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9573. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9574. let res = await this.put(requestUrl, data, additionalHeaders);
  9575. return this._processResponse(res, this.requestOptions);
  9576. }
  9577. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9578. let data = JSON.stringify(obj, null, 2);
  9579. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9580. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9581. let res = await this.patch(requestUrl, data, additionalHeaders);
  9582. return this._processResponse(res, this.requestOptions);
  9583. }
  9584. /**
  9585. * Makes a raw http request.
  9586. * All other methods such as get, post, patch, and request ultimately call this.
  9587. * Prefer get, del, post and patch
  9588. */
  9589. async request(verb, requestUrl, data, headers) {
  9590. if (this._disposed) {
  9591. throw new Error('Client has already been disposed.');
  9592. }
  9593. let parsedUrl = url.parse(requestUrl);
  9594. let info = this._prepareRequest(verb, parsedUrl, headers);
  9595. // Only perform retries on reads since writes may not be idempotent.
  9596. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9597. ? this._maxRetries + 1
  9598. : 1;
  9599. let numTries = 0;
  9600. let response;
  9601. while (numTries < maxTries) {
  9602. response = await this.requestRaw(info, data);
  9603. // Check if it's an authentication challenge
  9604. if (response &&
  9605. response.message &&
  9606. response.message.statusCode === HttpCodes.Unauthorized) {
  9607. let authenticationHandler;
  9608. for (let i = 0; i < this.handlers.length; i++) {
  9609. if (this.handlers[i].canHandleAuthentication(response)) {
  9610. authenticationHandler = this.handlers[i];
  9611. break;
  9612. }
  9613. }
  9614. if (authenticationHandler) {
  9615. return authenticationHandler.handleAuthentication(this, info, data);
  9616. }
  9617. else {
  9618. // We have received an unauthorized response but have no handlers to handle it.
  9619. // Let the response return to the caller.
  9620. return response;
  9621. }
  9622. }
  9623. let redirectsRemaining = this._maxRedirects;
  9624. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9625. this._allowRedirects &&
  9626. redirectsRemaining > 0) {
  9627. const redirectUrl = response.message.headers['location'];
  9628. if (!redirectUrl) {
  9629. // if there's no location to redirect to, we won't
  9630. break;
  9631. }
  9632. let parsedRedirectUrl = url.parse(redirectUrl);
  9633. if (parsedUrl.protocol == 'https:' &&
  9634. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9635. !this._allowRedirectDowngrade) {
  9636. 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.');
  9637. }
  9638. // we need to finish reading the response before reassigning response
  9639. // which will leak the open socket.
  9640. await response.readBody();
  9641. // strip authorization header if redirected to a different hostname
  9642. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9643. for (let header in headers) {
  9644. // header names are case insensitive
  9645. if (header.toLowerCase() === 'authorization') {
  9646. delete headers[header];
  9647. }
  9648. }
  9649. }
  9650. // let's make the request with the new redirectUrl
  9651. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9652. response = await this.requestRaw(info, data);
  9653. redirectsRemaining--;
  9654. }
  9655. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9656. // If not a retry code, return immediately instead of retrying
  9657. return response;
  9658. }
  9659. numTries += 1;
  9660. if (numTries < maxTries) {
  9661. await response.readBody();
  9662. await this._performExponentialBackoff(numTries);
  9663. }
  9664. }
  9665. return response;
  9666. }
  9667. /**
  9668. * Needs to be called if keepAlive is set to true in request options.
  9669. */
  9670. dispose() {
  9671. if (this._agent) {
  9672. this._agent.destroy();
  9673. }
  9674. this._disposed = true;
  9675. }
  9676. /**
  9677. * Raw request.
  9678. * @param info
  9679. * @param data
  9680. */
  9681. requestRaw(info, data) {
  9682. return new Promise((resolve, reject) => {
  9683. let callbackForResult = function (err, res) {
  9684. if (err) {
  9685. reject(err);
  9686. }
  9687. resolve(res);
  9688. };
  9689. this.requestRawWithCallback(info, data, callbackForResult);
  9690. });
  9691. }
  9692. /**
  9693. * Raw request with callback.
  9694. * @param info
  9695. * @param data
  9696. * @param onResult
  9697. */
  9698. requestRawWithCallback(info, data, onResult) {
  9699. let socket;
  9700. if (typeof data === 'string') {
  9701. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9702. }
  9703. let callbackCalled = false;
  9704. let handleResult = (err, res) => {
  9705. if (!callbackCalled) {
  9706. callbackCalled = true;
  9707. onResult(err, res);
  9708. }
  9709. };
  9710. let req = info.httpModule.request(info.options, (msg) => {
  9711. let res = new HttpClientResponse(msg);
  9712. handleResult(null, res);
  9713. });
  9714. req.on('socket', sock => {
  9715. socket = sock;
  9716. });
  9717. // If we ever get disconnected, we want the socket to timeout eventually
  9718. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9719. if (socket) {
  9720. socket.end();
  9721. }
  9722. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9723. });
  9724. req.on('error', function (err) {
  9725. // err has statusCode property
  9726. // res should have headers
  9727. handleResult(err, null);
  9728. });
  9729. if (data && typeof data === 'string') {
  9730. req.write(data, 'utf8');
  9731. }
  9732. if (data && typeof data !== 'string') {
  9733. data.on('close', function () {
  9734. req.end();
  9735. });
  9736. data.pipe(req);
  9737. }
  9738. else {
  9739. req.end();
  9740. }
  9741. }
  9742. /**
  9743. * Gets an http agent. This function is useful when you need an http agent that handles
  9744. * routing through a proxy server - depending upon the url and proxy environment variables.
  9745. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9746. */
  9747. getAgent(serverUrl) {
  9748. let parsedUrl = url.parse(serverUrl);
  9749. return this._getAgent(parsedUrl);
  9750. }
  9751. _prepareRequest(method, requestUrl, headers) {
  9752. const info = {};
  9753. info.parsedUrl = requestUrl;
  9754. const usingSsl = info.parsedUrl.protocol === 'https:';
  9755. info.httpModule = usingSsl ? https : http;
  9756. const defaultPort = usingSsl ? 443 : 80;
  9757. info.options = {};
  9758. info.options.host = info.parsedUrl.hostname;
  9759. info.options.port = info.parsedUrl.port
  9760. ? parseInt(info.parsedUrl.port)
  9761. : defaultPort;
  9762. info.options.path =
  9763. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9764. info.options.method = method;
  9765. info.options.headers = this._mergeHeaders(headers);
  9766. if (this.userAgent != null) {
  9767. info.options.headers['user-agent'] = this.userAgent;
  9768. }
  9769. info.options.agent = this._getAgent(info.parsedUrl);
  9770. // gives handlers an opportunity to participate
  9771. if (this.handlers) {
  9772. this.handlers.forEach(handler => {
  9773. handler.prepareRequest(info.options);
  9774. });
  9775. }
  9776. return info;
  9777. }
  9778. _mergeHeaders(headers) {
  9779. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9780. if (this.requestOptions && this.requestOptions.headers) {
  9781. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9782. }
  9783. return lowercaseKeys(headers || {});
  9784. }
  9785. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9786. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9787. let clientHeader;
  9788. if (this.requestOptions && this.requestOptions.headers) {
  9789. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9790. }
  9791. return additionalHeaders[header] || clientHeader || _default;
  9792. }
  9793. _getAgent(parsedUrl) {
  9794. let agent;
  9795. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9796. let useProxy = proxyUrl && proxyUrl.hostname;
  9797. if (this._keepAlive && useProxy) {
  9798. agent = this._proxyAgent;
  9799. }
  9800. if (this._keepAlive && !useProxy) {
  9801. agent = this._agent;
  9802. }
  9803. // if agent is already assigned use that agent.
  9804. if (!!agent) {
  9805. return agent;
  9806. }
  9807. const usingSsl = parsedUrl.protocol === 'https:';
  9808. let maxSockets = 100;
  9809. if (!!this.requestOptions) {
  9810. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9811. }
  9812. if (useProxy) {
  9813. // If using proxy, need tunnel
  9814. if (!tunnel) {
  9815. tunnel = __webpack_require__(335);
  9816. }
  9817. const agentOptions = {
  9818. maxSockets: maxSockets,
  9819. keepAlive: this._keepAlive,
  9820. proxy: {
  9821. proxyAuth: proxyUrl.auth,
  9822. host: proxyUrl.hostname,
  9823. port: proxyUrl.port
  9824. }
  9825. };
  9826. let tunnelAgent;
  9827. const overHttps = proxyUrl.protocol === 'https:';
  9828. if (usingSsl) {
  9829. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9830. }
  9831. else {
  9832. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9833. }
  9834. agent = tunnelAgent(agentOptions);
  9835. this._proxyAgent = agent;
  9836. }
  9837. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9838. if (this._keepAlive && !agent) {
  9839. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9840. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9841. this._agent = agent;
  9842. }
  9843. // if not using private agent and tunnel agent isn't setup then use global agent
  9844. if (!agent) {
  9845. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9846. }
  9847. if (usingSsl && this._ignoreSslError) {
  9848. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9849. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9850. // we have to cast it to any and change it directly
  9851. agent.options = Object.assign(agent.options || {}, {
  9852. rejectUnauthorized: false
  9853. });
  9854. }
  9855. return agent;
  9856. }
  9857. _performExponentialBackoff(retryNumber) {
  9858. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9859. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9860. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9861. }
  9862. static dateTimeDeserializer(key, value) {
  9863. if (typeof value === 'string') {
  9864. let a = new Date(value);
  9865. if (!isNaN(a.valueOf())) {
  9866. return a;
  9867. }
  9868. }
  9869. return value;
  9870. }
  9871. async _processResponse(res, options) {
  9872. return new Promise(async (resolve, reject) => {
  9873. const statusCode = res.message.statusCode;
  9874. const response = {
  9875. statusCode: statusCode,
  9876. result: null,
  9877. headers: {}
  9878. };
  9879. // not found leads to null obj returned
  9880. if (statusCode == HttpCodes.NotFound) {
  9881. resolve(response);
  9882. }
  9883. let obj;
  9884. let contents;
  9885. // get the result from the body
  9886. try {
  9887. contents = await res.readBody();
  9888. if (contents && contents.length > 0) {
  9889. if (options && options.deserializeDates) {
  9890. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9891. }
  9892. else {
  9893. obj = JSON.parse(contents);
  9894. }
  9895. response.result = obj;
  9896. }
  9897. response.headers = res.message.headers;
  9898. }
  9899. catch (err) {
  9900. // Invalid resource (contents not json); leaving result obj null
  9901. }
  9902. // note that 3xx redirects are handled by the http layer.
  9903. if (statusCode > 299) {
  9904. let msg;
  9905. // if exception/error in body, attempt to get better error
  9906. if (obj && obj.message) {
  9907. msg = obj.message;
  9908. }
  9909. else if (contents && contents.length > 0) {
  9910. // it may be the case that the exception is in the body message as string
  9911. msg = contents;
  9912. }
  9913. else {
  9914. msg = 'Failed request: (' + statusCode + ')';
  9915. }
  9916. let err = new Error(msg);
  9917. // attach statusCode and body obj (if available) to the error object
  9918. err['statusCode'] = statusCode;
  9919. if (response.result) {
  9920. err['result'] = response.result;
  9921. }
  9922. reject(err);
  9923. }
  9924. else {
  9925. resolve(response);
  9926. }
  9927. });
  9928. }
  9929. }
  9930. exports.HttpClient = HttpClient;
  9931. /***/ }),
  9932. /***/ 550:
  9933. /***/ (function(module, __unusedexports, __webpack_require__) {
  9934. module.exports = getNextPage
  9935. const getPage = __webpack_require__(265)
  9936. function getNextPage (octokit, link, headers) {
  9937. return getPage(octokit, link, 'next', headers)
  9938. }
  9939. /***/ }),
  9940. /***/ 558:
  9941. /***/ (function(module, __unusedexports, __webpack_require__) {
  9942. module.exports = hasPreviousPage
  9943. const deprecate = __webpack_require__(370)
  9944. const getPageLinks = __webpack_require__(577)
  9945. function hasPreviousPage (link) {
  9946. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9947. return getPageLinks(link).prev
  9948. }
  9949. /***/ }),
  9950. /***/ 559:
  9951. /***/ (function(__unusedmodule, exports) {
  9952. "use strict";
  9953. Object.defineProperty(exports, "__esModule", { value: true });
  9954. class GitVersion {
  9955. /**
  9956. * Used for comparing the version of git and git-lfs against the minimum required version
  9957. * @param version the version string, e.g. 1.2 or 1.2.3
  9958. */
  9959. constructor(version) {
  9960. this.major = NaN;
  9961. this.minor = NaN;
  9962. this.patch = NaN;
  9963. if (version) {
  9964. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9965. if (match) {
  9966. this.major = Number(match[1]);
  9967. this.minor = Number(match[2]);
  9968. if (match[4]) {
  9969. this.patch = Number(match[4]);
  9970. }
  9971. }
  9972. }
  9973. }
  9974. /**
  9975. * Compares the instance against a minimum required version
  9976. * @param minimum Minimum version
  9977. */
  9978. checkMinimum(minimum) {
  9979. if (!minimum.isValid()) {
  9980. throw new Error('Arg minimum is not a valid version');
  9981. }
  9982. // Major is insufficient
  9983. if (this.major < minimum.major) {
  9984. return false;
  9985. }
  9986. // Major is equal
  9987. if (this.major === minimum.major) {
  9988. // Minor is insufficient
  9989. if (this.minor < minimum.minor) {
  9990. return false;
  9991. }
  9992. // Minor is equal
  9993. if (this.minor === minimum.minor) {
  9994. // Patch is insufficient
  9995. if (this.patch && this.patch < (minimum.patch || 0)) {
  9996. return false;
  9997. }
  9998. }
  9999. }
  10000. return true;
  10001. }
  10002. /**
  10003. * Indicates whether the instance was constructed from a valid version string
  10004. */
  10005. isValid() {
  10006. return !isNaN(this.major);
  10007. }
  10008. /**
  10009. * Returns the version as a string, e.g. 1.2 or 1.2.3
  10010. */
  10011. toString() {
  10012. let result = '';
  10013. if (this.isValid()) {
  10014. result = `${this.major}.${this.minor}`;
  10015. if (!isNaN(this.patch)) {
  10016. result += `.${this.patch}`;
  10017. }
  10018. }
  10019. return result;
  10020. }
  10021. }
  10022. exports.GitVersion = GitVersion;
  10023. /***/ }),
  10024. /***/ 562:
  10025. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10026. "use strict";
  10027. Object.defineProperty(exports, '__esModule', { value: true });
  10028. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10029. var osName = _interopDefault(__webpack_require__(2));
  10030. function getUserAgent() {
  10031. try {
  10032. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10033. } catch (error) {
  10034. if (/wmic os get Caption/.test(error.message)) {
  10035. return "Windows <version undetectable>";
  10036. }
  10037. return "<environment undetectable>";
  10038. }
  10039. }
  10040. exports.getUserAgent = getUserAgent;
  10041. //# sourceMappingURL=index.js.map
  10042. /***/ }),
  10043. /***/ 563:
  10044. /***/ (function(module, __unusedexports, __webpack_require__) {
  10045. module.exports = getPreviousPage
  10046. const getPage = __webpack_require__(265)
  10047. function getPreviousPage (octokit, link, headers) {
  10048. return getPage(octokit, link, 'prev', headers)
  10049. }
  10050. /***/ }),
  10051. /***/ 568:
  10052. /***/ (function(module, __unusedexports, __webpack_require__) {
  10053. "use strict";
  10054. const path = __webpack_require__(622);
  10055. const niceTry = __webpack_require__(948);
  10056. const resolveCommand = __webpack_require__(489);
  10057. const escape = __webpack_require__(462);
  10058. const readShebang = __webpack_require__(389);
  10059. const semver = __webpack_require__(280);
  10060. const isWin = process.platform === 'win32';
  10061. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10062. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10063. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10064. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10065. function detectShebang(parsed) {
  10066. parsed.file = resolveCommand(parsed);
  10067. const shebang = parsed.file && readShebang(parsed.file);
  10068. if (shebang) {
  10069. parsed.args.unshift(parsed.file);
  10070. parsed.command = shebang;
  10071. return resolveCommand(parsed);
  10072. }
  10073. return parsed.file;
  10074. }
  10075. function parseNonShell(parsed) {
  10076. if (!isWin) {
  10077. return parsed;
  10078. }
  10079. // Detect & add support for shebangs
  10080. const commandFile = detectShebang(parsed);
  10081. // We don't need a shell if the command filename is an executable
  10082. const needsShell = !isExecutableRegExp.test(commandFile);
  10083. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10084. // Note that `forceShell` is an hidden option used only in tests
  10085. if (parsed.options.forceShell || needsShell) {
  10086. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10087. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10088. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10089. // we need to double escape them
  10090. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10091. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10092. // This is necessary otherwise it will always fail with ENOENT in those cases
  10093. parsed.command = path.normalize(parsed.command);
  10094. // Escape command & arguments
  10095. parsed.command = escape.command(parsed.command);
  10096. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10097. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10098. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10099. parsed.command = process.env.comspec || 'cmd.exe';
  10100. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10101. }
  10102. return parsed;
  10103. }
  10104. function parseShell(parsed) {
  10105. // If node supports the shell option, there's no need to mimic its behavior
  10106. if (supportsShellOption) {
  10107. return parsed;
  10108. }
  10109. // Mimic node shell option
  10110. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10111. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10112. if (isWin) {
  10113. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10114. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10115. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10116. } else {
  10117. if (typeof parsed.options.shell === 'string') {
  10118. parsed.command = parsed.options.shell;
  10119. } else if (process.platform === 'android') {
  10120. parsed.command = '/system/bin/sh';
  10121. } else {
  10122. parsed.command = '/bin/sh';
  10123. }
  10124. parsed.args = ['-c', shellCommand];
  10125. }
  10126. return parsed;
  10127. }
  10128. function parse(command, args, options) {
  10129. // Normalize arguments, similar to nodejs
  10130. if (args && !Array.isArray(args)) {
  10131. options = args;
  10132. args = null;
  10133. }
  10134. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10135. options = Object.assign({}, options); // Clone object to avoid changing the original
  10136. // Build our parsed object
  10137. const parsed = {
  10138. command,
  10139. args,
  10140. options,
  10141. file: undefined,
  10142. original: {
  10143. command,
  10144. args,
  10145. },
  10146. };
  10147. // Delegate further parsing to shell or non-shell
  10148. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10149. }
  10150. module.exports = parse;
  10151. /***/ }),
  10152. /***/ 577:
  10153. /***/ (function(module) {
  10154. module.exports = getPageLinks
  10155. function getPageLinks (link) {
  10156. link = link.link || link.headers.link || ''
  10157. const links = {}
  10158. // link format:
  10159. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10160. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10161. links[type] = uri
  10162. })
  10163. return links
  10164. }
  10165. /***/ }),
  10166. /***/ 587:
  10167. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10168. "use strict";
  10169. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10170. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10171. return new (P || (P = Promise))(function (resolve, reject) {
  10172. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10173. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10174. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10175. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10176. });
  10177. };
  10178. var __importStar = (this && this.__importStar) || function (mod) {
  10179. if (mod && mod.__esModule) return mod;
  10180. var result = {};
  10181. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10182. result["default"] = mod;
  10183. return result;
  10184. };
  10185. Object.defineProperty(exports, "__esModule", { value: true });
  10186. const core = __importStar(__webpack_require__(470));
  10187. const defaultMaxAttempts = 3;
  10188. const defaultMinSeconds = 10;
  10189. const defaultMaxSeconds = 20;
  10190. class RetryHelper {
  10191. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10192. this.maxAttempts = maxAttempts;
  10193. this.minSeconds = Math.floor(minSeconds);
  10194. this.maxSeconds = Math.floor(maxSeconds);
  10195. if (this.minSeconds > this.maxSeconds) {
  10196. throw new Error('min seconds should be less than or equal to max seconds');
  10197. }
  10198. }
  10199. execute(action) {
  10200. return __awaiter(this, void 0, void 0, function* () {
  10201. let attempt = 1;
  10202. while (attempt < this.maxAttempts) {
  10203. // Try
  10204. try {
  10205. return yield action();
  10206. }
  10207. catch (err) {
  10208. core.info(err.message);
  10209. }
  10210. // Sleep
  10211. const seconds = this.getSleepAmount();
  10212. core.info(`Waiting ${seconds} seconds before trying again`);
  10213. yield this.sleep(seconds);
  10214. attempt++;
  10215. }
  10216. // Last attempt
  10217. return yield action();
  10218. });
  10219. }
  10220. getSleepAmount() {
  10221. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10222. this.minSeconds);
  10223. }
  10224. sleep(seconds) {
  10225. return __awaiter(this, void 0, void 0, function* () {
  10226. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10227. });
  10228. }
  10229. }
  10230. exports.RetryHelper = RetryHelper;
  10231. function execute(action) {
  10232. return __awaiter(this, void 0, void 0, function* () {
  10233. const retryHelper = new RetryHelper();
  10234. return yield retryHelper.execute(action);
  10235. });
  10236. }
  10237. exports.execute = execute;
  10238. /***/ }),
  10239. /***/ 605:
  10240. /***/ (function(module) {
  10241. module.exports = require("http");
  10242. /***/ }),
  10243. /***/ 614:
  10244. /***/ (function(module) {
  10245. module.exports = require("events");
  10246. /***/ }),
  10247. /***/ 618:
  10248. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10249. "use strict";
  10250. var __importStar = (this && this.__importStar) || function (mod) {
  10251. if (mod && mod.__esModule) return mod;
  10252. var result = {};
  10253. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10254. result["default"] = mod;
  10255. return result;
  10256. };
  10257. Object.defineProperty(exports, "__esModule", { value: true });
  10258. const fs = __importStar(__webpack_require__(747));
  10259. function directoryExistsSync(path, required) {
  10260. if (!path) {
  10261. throw new Error("Arg 'path' must not be empty");
  10262. }
  10263. let stats;
  10264. try {
  10265. stats = fs.statSync(path);
  10266. }
  10267. catch (error) {
  10268. if (error.code === 'ENOENT') {
  10269. if (!required) {
  10270. return false;
  10271. }
  10272. throw new Error(`Directory '${path}' does not exist`);
  10273. }
  10274. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10275. }
  10276. if (stats.isDirectory()) {
  10277. return true;
  10278. }
  10279. else if (!required) {
  10280. return false;
  10281. }
  10282. throw new Error(`Directory '${path}' does not exist`);
  10283. }
  10284. exports.directoryExistsSync = directoryExistsSync;
  10285. function existsSync(path) {
  10286. if (!path) {
  10287. throw new Error("Arg 'path' must not be empty");
  10288. }
  10289. try {
  10290. fs.statSync(path);
  10291. }
  10292. catch (error) {
  10293. if (error.code === 'ENOENT') {
  10294. return false;
  10295. }
  10296. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10297. }
  10298. return true;
  10299. }
  10300. exports.existsSync = existsSync;
  10301. function fileExistsSync(path) {
  10302. if (!path) {
  10303. throw new Error("Arg 'path' must not be empty");
  10304. }
  10305. let stats;
  10306. try {
  10307. stats = fs.statSync(path);
  10308. }
  10309. catch (error) {
  10310. if (error.code === 'ENOENT') {
  10311. return false;
  10312. }
  10313. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10314. }
  10315. if (!stats.isDirectory()) {
  10316. return true;
  10317. }
  10318. return false;
  10319. }
  10320. exports.fileExistsSync = fileExistsSync;
  10321. /***/ }),
  10322. /***/ 621:
  10323. /***/ (function(module, __unusedexports, __webpack_require__) {
  10324. "use strict";
  10325. const path = __webpack_require__(622);
  10326. const pathKey = __webpack_require__(39);
  10327. module.exports = opts => {
  10328. opts = Object.assign({
  10329. cwd: process.cwd(),
  10330. path: process.env[pathKey()]
  10331. }, opts);
  10332. let prev;
  10333. let pth = path.resolve(opts.cwd);
  10334. const ret = [];
  10335. while (prev !== pth) {
  10336. ret.push(path.join(pth, 'node_modules/.bin'));
  10337. prev = pth;
  10338. pth = path.resolve(pth, '..');
  10339. }
  10340. // ensure the running `node` binary is used
  10341. ret.push(path.dirname(process.execPath));
  10342. return ret.concat(opts.path).join(path.delimiter);
  10343. };
  10344. module.exports.env = opts => {
  10345. opts = Object.assign({
  10346. env: process.env
  10347. }, opts);
  10348. const env = Object.assign({}, opts.env);
  10349. const path = pathKey({env});
  10350. opts.path = env[path];
  10351. env[path] = module.exports(opts);
  10352. return env;
  10353. };
  10354. /***/ }),
  10355. /***/ 622:
  10356. /***/ (function(module) {
  10357. module.exports = require("path");
  10358. /***/ }),
  10359. /***/ 631:
  10360. /***/ (function(module) {
  10361. module.exports = require("net");
  10362. /***/ }),
  10363. /***/ 649:
  10364. /***/ (function(module, __unusedexports, __webpack_require__) {
  10365. module.exports = getLastPage
  10366. const getPage = __webpack_require__(265)
  10367. function getLastPage (octokit, link, headers) {
  10368. return getPage(octokit, link, 'last', headers)
  10369. }
  10370. /***/ }),
  10371. /***/ 654:
  10372. /***/ (function(module) {
  10373. // This is not the set of all possible signals.
  10374. //
  10375. // It IS, however, the set of all signals that trigger
  10376. // an exit on either Linux or BSD systems. Linux is a
  10377. // superset of the signal names supported on BSD, and
  10378. // the unknown signals just fail to register, so we can
  10379. // catch that easily enough.
  10380. //
  10381. // Don't bother with SIGKILL. It's uncatchable, which
  10382. // means that we can't fire any callbacks anyway.
  10383. //
  10384. // If a user does happen to register a handler on a non-
  10385. // fatal signal like SIGWINCH or something, and then
  10386. // exit, it'll end up firing `process.emit('exit')`, so
  10387. // the handler will be fired anyway.
  10388. //
  10389. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10390. // artificially, inherently leave the process in a
  10391. // state from which it is not safe to try and enter JS
  10392. // listeners.
  10393. module.exports = [
  10394. 'SIGABRT',
  10395. 'SIGALRM',
  10396. 'SIGHUP',
  10397. 'SIGINT',
  10398. 'SIGTERM'
  10399. ]
  10400. if (process.platform !== 'win32') {
  10401. module.exports.push(
  10402. 'SIGVTALRM',
  10403. 'SIGXCPU',
  10404. 'SIGXFSZ',
  10405. 'SIGUSR2',
  10406. 'SIGTRAP',
  10407. 'SIGSYS',
  10408. 'SIGQUIT',
  10409. 'SIGIOT'
  10410. // should detect profiler and enable/disable accordingly.
  10411. // see #21
  10412. // 'SIGPROF'
  10413. )
  10414. }
  10415. if (process.platform === 'linux') {
  10416. module.exports.push(
  10417. 'SIGIO',
  10418. 'SIGPOLL',
  10419. 'SIGPWR',
  10420. 'SIGSTKFLT',
  10421. 'SIGUNUSED'
  10422. )
  10423. }
  10424. /***/ }),
  10425. /***/ 656:
  10426. /***/ (function(module, exports) {
  10427. exports = module.exports = SemVer
  10428. var debug
  10429. /* istanbul ignore next */
  10430. if (typeof process === 'object' &&
  10431. process.env &&
  10432. process.env.NODE_DEBUG &&
  10433. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10434. debug = function () {
  10435. var args = Array.prototype.slice.call(arguments, 0)
  10436. args.unshift('SEMVER')
  10437. console.log.apply(console, args)
  10438. }
  10439. } else {
  10440. debug = function () {}
  10441. }
  10442. // Note: this is the semver.org version of the spec that it implements
  10443. // Not necessarily the package version of this code.
  10444. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10445. var MAX_LENGTH = 256
  10446. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10447. /* istanbul ignore next */ 9007199254740991
  10448. // Max safe segment length for coercion.
  10449. var MAX_SAFE_COMPONENT_LENGTH = 16
  10450. // The actual regexps go on exports.re
  10451. var re = exports.re = []
  10452. var src = exports.src = []
  10453. var t = exports.tokens = {}
  10454. var R = 0
  10455. function tok (n) {
  10456. t[n] = R++
  10457. }
  10458. // The following Regular Expressions can be used for tokenizing,
  10459. // validating, and parsing SemVer version strings.
  10460. // ## Numeric Identifier
  10461. // A single `0`, or a non-zero digit followed by zero or more digits.
  10462. tok('NUMERICIDENTIFIER')
  10463. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10464. tok('NUMERICIDENTIFIERLOOSE')
  10465. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10466. // ## Non-numeric Identifier
  10467. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10468. // more letters, digits, or hyphens.
  10469. tok('NONNUMERICIDENTIFIER')
  10470. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10471. // ## Main Version
  10472. // Three dot-separated numeric identifiers.
  10473. tok('MAINVERSION')
  10474. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10475. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10476. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10477. tok('MAINVERSIONLOOSE')
  10478. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10479. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10480. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10481. // ## Pre-release Version Identifier
  10482. // A numeric identifier, or a non-numeric identifier.
  10483. tok('PRERELEASEIDENTIFIER')
  10484. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10485. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10486. tok('PRERELEASEIDENTIFIERLOOSE')
  10487. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10488. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10489. // ## Pre-release Version
  10490. // Hyphen, followed by one or more dot-separated pre-release version
  10491. // identifiers.
  10492. tok('PRERELEASE')
  10493. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10494. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10495. tok('PRERELEASELOOSE')
  10496. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10497. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10498. // ## Build Metadata Identifier
  10499. // Any combination of digits, letters, or hyphens.
  10500. tok('BUILDIDENTIFIER')
  10501. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10502. // ## Build Metadata
  10503. // Plus sign, followed by one or more period-separated build metadata
  10504. // identifiers.
  10505. tok('BUILD')
  10506. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10507. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10508. // ## Full Version String
  10509. // A main version, followed optionally by a pre-release version and
  10510. // build metadata.
  10511. // Note that the only major, minor, patch, and pre-release sections of
  10512. // the version string are capturing groups. The build metadata is not a
  10513. // capturing group, because it should not ever be used in version
  10514. // comparison.
  10515. tok('FULL')
  10516. tok('FULLPLAIN')
  10517. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10518. src[t.PRERELEASE] + '?' +
  10519. src[t.BUILD] + '?'
  10520. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10521. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10522. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10523. // common in the npm registry.
  10524. tok('LOOSEPLAIN')
  10525. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10526. src[t.PRERELEASELOOSE] + '?' +
  10527. src[t.BUILD] + '?'
  10528. tok('LOOSE')
  10529. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10530. tok('GTLT')
  10531. src[t.GTLT] = '((?:<|>)?=?)'
  10532. // Something like "2.*" or "1.2.x".
  10533. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10534. // Only the first item is strictly required.
  10535. tok('XRANGEIDENTIFIERLOOSE')
  10536. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10537. tok('XRANGEIDENTIFIER')
  10538. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10539. tok('XRANGEPLAIN')
  10540. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10541. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10542. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10543. '(?:' + src[t.PRERELEASE] + ')?' +
  10544. src[t.BUILD] + '?' +
  10545. ')?)?'
  10546. tok('XRANGEPLAINLOOSE')
  10547. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10548. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10549. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10550. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10551. src[t.BUILD] + '?' +
  10552. ')?)?'
  10553. tok('XRANGE')
  10554. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10555. tok('XRANGELOOSE')
  10556. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10557. // Coercion.
  10558. // Extract anything that could conceivably be a part of a valid semver
  10559. tok('COERCE')
  10560. src[t.COERCE] = '(^|[^\\d])' +
  10561. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10562. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10563. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10564. '(?:$|[^\\d])'
  10565. tok('COERCERTL')
  10566. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10567. // Tilde ranges.
  10568. // Meaning is "reasonably at or greater than"
  10569. tok('LONETILDE')
  10570. src[t.LONETILDE] = '(?:~>?)'
  10571. tok('TILDETRIM')
  10572. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10573. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10574. var tildeTrimReplace = '$1~'
  10575. tok('TILDE')
  10576. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10577. tok('TILDELOOSE')
  10578. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10579. // Caret ranges.
  10580. // Meaning is "at least and backwards compatible with"
  10581. tok('LONECARET')
  10582. src[t.LONECARET] = '(?:\\^)'
  10583. tok('CARETTRIM')
  10584. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10585. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10586. var caretTrimReplace = '$1^'
  10587. tok('CARET')
  10588. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10589. tok('CARETLOOSE')
  10590. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10591. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10592. tok('COMPARATORLOOSE')
  10593. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10594. tok('COMPARATOR')
  10595. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10596. // An expression to strip any whitespace between the gtlt and the thing
  10597. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10598. tok('COMPARATORTRIM')
  10599. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10600. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10601. // this one has to use the /g flag
  10602. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10603. var comparatorTrimReplace = '$1$2$3'
  10604. // Something like `1.2.3 - 1.2.4`
  10605. // Note that these all use the loose form, because they'll be
  10606. // checked against either the strict or loose comparator form
  10607. // later.
  10608. tok('HYPHENRANGE')
  10609. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10610. '\\s+-\\s+' +
  10611. '(' + src[t.XRANGEPLAIN] + ')' +
  10612. '\\s*$'
  10613. tok('HYPHENRANGELOOSE')
  10614. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10615. '\\s+-\\s+' +
  10616. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10617. '\\s*$'
  10618. // Star ranges basically just allow anything at all.
  10619. tok('STAR')
  10620. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10621. // Compile to actual regexp objects.
  10622. // All are flag-free, unless they were created above with a flag.
  10623. for (var i = 0; i < R; i++) {
  10624. debug(i, src[i])
  10625. if (!re[i]) {
  10626. re[i] = new RegExp(src[i])
  10627. }
  10628. }
  10629. exports.parse = parse
  10630. function parse (version, options) {
  10631. if (!options || typeof options !== 'object') {
  10632. options = {
  10633. loose: !!options,
  10634. includePrerelease: false
  10635. }
  10636. }
  10637. if (version instanceof SemVer) {
  10638. return version
  10639. }
  10640. if (typeof version !== 'string') {
  10641. return null
  10642. }
  10643. if (version.length > MAX_LENGTH) {
  10644. return null
  10645. }
  10646. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10647. if (!r.test(version)) {
  10648. return null
  10649. }
  10650. try {
  10651. return new SemVer(version, options)
  10652. } catch (er) {
  10653. return null
  10654. }
  10655. }
  10656. exports.valid = valid
  10657. function valid (version, options) {
  10658. var v = parse(version, options)
  10659. return v ? v.version : null
  10660. }
  10661. exports.clean = clean
  10662. function clean (version, options) {
  10663. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10664. return s ? s.version : null
  10665. }
  10666. exports.SemVer = SemVer
  10667. function SemVer (version, options) {
  10668. if (!options || typeof options !== 'object') {
  10669. options = {
  10670. loose: !!options,
  10671. includePrerelease: false
  10672. }
  10673. }
  10674. if (version instanceof SemVer) {
  10675. if (version.loose === options.loose) {
  10676. return version
  10677. } else {
  10678. version = version.version
  10679. }
  10680. } else if (typeof version !== 'string') {
  10681. throw new TypeError('Invalid Version: ' + version)
  10682. }
  10683. if (version.length > MAX_LENGTH) {
  10684. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10685. }
  10686. if (!(this instanceof SemVer)) {
  10687. return new SemVer(version, options)
  10688. }
  10689. debug('SemVer', version, options)
  10690. this.options = options
  10691. this.loose = !!options.loose
  10692. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10693. if (!m) {
  10694. throw new TypeError('Invalid Version: ' + version)
  10695. }
  10696. this.raw = version
  10697. // these are actually numbers
  10698. this.major = +m[1]
  10699. this.minor = +m[2]
  10700. this.patch = +m[3]
  10701. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10702. throw new TypeError('Invalid major version')
  10703. }
  10704. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10705. throw new TypeError('Invalid minor version')
  10706. }
  10707. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10708. throw new TypeError('Invalid patch version')
  10709. }
  10710. // numberify any prerelease numeric ids
  10711. if (!m[4]) {
  10712. this.prerelease = []
  10713. } else {
  10714. this.prerelease = m[4].split('.').map(function (id) {
  10715. if (/^[0-9]+$/.test(id)) {
  10716. var num = +id
  10717. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10718. return num
  10719. }
  10720. }
  10721. return id
  10722. })
  10723. }
  10724. this.build = m[5] ? m[5].split('.') : []
  10725. this.format()
  10726. }
  10727. SemVer.prototype.format = function () {
  10728. this.version = this.major + '.' + this.minor + '.' + this.patch
  10729. if (this.prerelease.length) {
  10730. this.version += '-' + this.prerelease.join('.')
  10731. }
  10732. return this.version
  10733. }
  10734. SemVer.prototype.toString = function () {
  10735. return this.version
  10736. }
  10737. SemVer.prototype.compare = function (other) {
  10738. debug('SemVer.compare', this.version, this.options, other)
  10739. if (!(other instanceof SemVer)) {
  10740. other = new SemVer(other, this.options)
  10741. }
  10742. return this.compareMain(other) || this.comparePre(other)
  10743. }
  10744. SemVer.prototype.compareMain = function (other) {
  10745. if (!(other instanceof SemVer)) {
  10746. other = new SemVer(other, this.options)
  10747. }
  10748. return compareIdentifiers(this.major, other.major) ||
  10749. compareIdentifiers(this.minor, other.minor) ||
  10750. compareIdentifiers(this.patch, other.patch)
  10751. }
  10752. SemVer.prototype.comparePre = function (other) {
  10753. if (!(other instanceof SemVer)) {
  10754. other = new SemVer(other, this.options)
  10755. }
  10756. // NOT having a prerelease is > having one
  10757. if (this.prerelease.length && !other.prerelease.length) {
  10758. return -1
  10759. } else if (!this.prerelease.length && other.prerelease.length) {
  10760. return 1
  10761. } else if (!this.prerelease.length && !other.prerelease.length) {
  10762. return 0
  10763. }
  10764. var i = 0
  10765. do {
  10766. var a = this.prerelease[i]
  10767. var b = other.prerelease[i]
  10768. debug('prerelease compare', i, a, b)
  10769. if (a === undefined && b === undefined) {
  10770. return 0
  10771. } else if (b === undefined) {
  10772. return 1
  10773. } else if (a === undefined) {
  10774. return -1
  10775. } else if (a === b) {
  10776. continue
  10777. } else {
  10778. return compareIdentifiers(a, b)
  10779. }
  10780. } while (++i)
  10781. }
  10782. SemVer.prototype.compareBuild = function (other) {
  10783. if (!(other instanceof SemVer)) {
  10784. other = new SemVer(other, this.options)
  10785. }
  10786. var i = 0
  10787. do {
  10788. var a = this.build[i]
  10789. var b = other.build[i]
  10790. debug('prerelease compare', i, a, b)
  10791. if (a === undefined && b === undefined) {
  10792. return 0
  10793. } else if (b === undefined) {
  10794. return 1
  10795. } else if (a === undefined) {
  10796. return -1
  10797. } else if (a === b) {
  10798. continue
  10799. } else {
  10800. return compareIdentifiers(a, b)
  10801. }
  10802. } while (++i)
  10803. }
  10804. // preminor will bump the version up to the next minor release, and immediately
  10805. // down to pre-release. premajor and prepatch work the same way.
  10806. SemVer.prototype.inc = function (release, identifier) {
  10807. switch (release) {
  10808. case 'premajor':
  10809. this.prerelease.length = 0
  10810. this.patch = 0
  10811. this.minor = 0
  10812. this.major++
  10813. this.inc('pre', identifier)
  10814. break
  10815. case 'preminor':
  10816. this.prerelease.length = 0
  10817. this.patch = 0
  10818. this.minor++
  10819. this.inc('pre', identifier)
  10820. break
  10821. case 'prepatch':
  10822. // If this is already a prerelease, it will bump to the next version
  10823. // drop any prereleases that might already exist, since they are not
  10824. // relevant at this point.
  10825. this.prerelease.length = 0
  10826. this.inc('patch', identifier)
  10827. this.inc('pre', identifier)
  10828. break
  10829. // If the input is a non-prerelease version, this acts the same as
  10830. // prepatch.
  10831. case 'prerelease':
  10832. if (this.prerelease.length === 0) {
  10833. this.inc('patch', identifier)
  10834. }
  10835. this.inc('pre', identifier)
  10836. break
  10837. case 'major':
  10838. // If this is a pre-major version, bump up to the same major version.
  10839. // Otherwise increment major.
  10840. // 1.0.0-5 bumps to 1.0.0
  10841. // 1.1.0 bumps to 2.0.0
  10842. if (this.minor !== 0 ||
  10843. this.patch !== 0 ||
  10844. this.prerelease.length === 0) {
  10845. this.major++
  10846. }
  10847. this.minor = 0
  10848. this.patch = 0
  10849. this.prerelease = []
  10850. break
  10851. case 'minor':
  10852. // If this is a pre-minor version, bump up to the same minor version.
  10853. // Otherwise increment minor.
  10854. // 1.2.0-5 bumps to 1.2.0
  10855. // 1.2.1 bumps to 1.3.0
  10856. if (this.patch !== 0 || this.prerelease.length === 0) {
  10857. this.minor++
  10858. }
  10859. this.patch = 0
  10860. this.prerelease = []
  10861. break
  10862. case 'patch':
  10863. // If this is not a pre-release version, it will increment the patch.
  10864. // If it is a pre-release it will bump up to the same patch version.
  10865. // 1.2.0-5 patches to 1.2.0
  10866. // 1.2.0 patches to 1.2.1
  10867. if (this.prerelease.length === 0) {
  10868. this.patch++
  10869. }
  10870. this.prerelease = []
  10871. break
  10872. // This probably shouldn't be used publicly.
  10873. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10874. case 'pre':
  10875. if (this.prerelease.length === 0) {
  10876. this.prerelease = [0]
  10877. } else {
  10878. var i = this.prerelease.length
  10879. while (--i >= 0) {
  10880. if (typeof this.prerelease[i] === 'number') {
  10881. this.prerelease[i]++
  10882. i = -2
  10883. }
  10884. }
  10885. if (i === -1) {
  10886. // didn't increment anything
  10887. this.prerelease.push(0)
  10888. }
  10889. }
  10890. if (identifier) {
  10891. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10892. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10893. if (this.prerelease[0] === identifier) {
  10894. if (isNaN(this.prerelease[1])) {
  10895. this.prerelease = [identifier, 0]
  10896. }
  10897. } else {
  10898. this.prerelease = [identifier, 0]
  10899. }
  10900. }
  10901. break
  10902. default:
  10903. throw new Error('invalid increment argument: ' + release)
  10904. }
  10905. this.format()
  10906. this.raw = this.version
  10907. return this
  10908. }
  10909. exports.inc = inc
  10910. function inc (version, release, loose, identifier) {
  10911. if (typeof (loose) === 'string') {
  10912. identifier = loose
  10913. loose = undefined
  10914. }
  10915. try {
  10916. return new SemVer(version, loose).inc(release, identifier).version
  10917. } catch (er) {
  10918. return null
  10919. }
  10920. }
  10921. exports.diff = diff
  10922. function diff (version1, version2) {
  10923. if (eq(version1, version2)) {
  10924. return null
  10925. } else {
  10926. var v1 = parse(version1)
  10927. var v2 = parse(version2)
  10928. var prefix = ''
  10929. if (v1.prerelease.length || v2.prerelease.length) {
  10930. prefix = 'pre'
  10931. var defaultResult = 'prerelease'
  10932. }
  10933. for (var key in v1) {
  10934. if (key === 'major' || key === 'minor' || key === 'patch') {
  10935. if (v1[key] !== v2[key]) {
  10936. return prefix + key
  10937. }
  10938. }
  10939. }
  10940. return defaultResult // may be undefined
  10941. }
  10942. }
  10943. exports.compareIdentifiers = compareIdentifiers
  10944. var numeric = /^[0-9]+$/
  10945. function compareIdentifiers (a, b) {
  10946. var anum = numeric.test(a)
  10947. var bnum = numeric.test(b)
  10948. if (anum && bnum) {
  10949. a = +a
  10950. b = +b
  10951. }
  10952. return a === b ? 0
  10953. : (anum && !bnum) ? -1
  10954. : (bnum && !anum) ? 1
  10955. : a < b ? -1
  10956. : 1
  10957. }
  10958. exports.rcompareIdentifiers = rcompareIdentifiers
  10959. function rcompareIdentifiers (a, b) {
  10960. return compareIdentifiers(b, a)
  10961. }
  10962. exports.major = major
  10963. function major (a, loose) {
  10964. return new SemVer(a, loose).major
  10965. }
  10966. exports.minor = minor
  10967. function minor (a, loose) {
  10968. return new SemVer(a, loose).minor
  10969. }
  10970. exports.patch = patch
  10971. function patch (a, loose) {
  10972. return new SemVer(a, loose).patch
  10973. }
  10974. exports.compare = compare
  10975. function compare (a, b, loose) {
  10976. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10977. }
  10978. exports.compareLoose = compareLoose
  10979. function compareLoose (a, b) {
  10980. return compare(a, b, true)
  10981. }
  10982. exports.compareBuild = compareBuild
  10983. function compareBuild (a, b, loose) {
  10984. var versionA = new SemVer(a, loose)
  10985. var versionB = new SemVer(b, loose)
  10986. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10987. }
  10988. exports.rcompare = rcompare
  10989. function rcompare (a, b, loose) {
  10990. return compare(b, a, loose)
  10991. }
  10992. exports.sort = sort
  10993. function sort (list, loose) {
  10994. return list.sort(function (a, b) {
  10995. return exports.compareBuild(a, b, loose)
  10996. })
  10997. }
  10998. exports.rsort = rsort
  10999. function rsort (list, loose) {
  11000. return list.sort(function (a, b) {
  11001. return exports.compareBuild(b, a, loose)
  11002. })
  11003. }
  11004. exports.gt = gt
  11005. function gt (a, b, loose) {
  11006. return compare(a, b, loose) > 0
  11007. }
  11008. exports.lt = lt
  11009. function lt (a, b, loose) {
  11010. return compare(a, b, loose) < 0
  11011. }
  11012. exports.eq = eq
  11013. function eq (a, b, loose) {
  11014. return compare(a, b, loose) === 0
  11015. }
  11016. exports.neq = neq
  11017. function neq (a, b, loose) {
  11018. return compare(a, b, loose) !== 0
  11019. }
  11020. exports.gte = gte
  11021. function gte (a, b, loose) {
  11022. return compare(a, b, loose) >= 0
  11023. }
  11024. exports.lte = lte
  11025. function lte (a, b, loose) {
  11026. return compare(a, b, loose) <= 0
  11027. }
  11028. exports.cmp = cmp
  11029. function cmp (a, op, b, loose) {
  11030. switch (op) {
  11031. case '===':
  11032. if (typeof a === 'object')
  11033. a = a.version
  11034. if (typeof b === 'object')
  11035. b = b.version
  11036. return a === b
  11037. case '!==':
  11038. if (typeof a === 'object')
  11039. a = a.version
  11040. if (typeof b === 'object')
  11041. b = b.version
  11042. return a !== b
  11043. case '':
  11044. case '=':
  11045. case '==':
  11046. return eq(a, b, loose)
  11047. case '!=':
  11048. return neq(a, b, loose)
  11049. case '>':
  11050. return gt(a, b, loose)
  11051. case '>=':
  11052. return gte(a, b, loose)
  11053. case '<':
  11054. return lt(a, b, loose)
  11055. case '<=':
  11056. return lte(a, b, loose)
  11057. default:
  11058. throw new TypeError('Invalid operator: ' + op)
  11059. }
  11060. }
  11061. exports.Comparator = Comparator
  11062. function Comparator (comp, options) {
  11063. if (!options || typeof options !== 'object') {
  11064. options = {
  11065. loose: !!options,
  11066. includePrerelease: false
  11067. }
  11068. }
  11069. if (comp instanceof Comparator) {
  11070. if (comp.loose === !!options.loose) {
  11071. return comp
  11072. } else {
  11073. comp = comp.value
  11074. }
  11075. }
  11076. if (!(this instanceof Comparator)) {
  11077. return new Comparator(comp, options)
  11078. }
  11079. debug('comparator', comp, options)
  11080. this.options = options
  11081. this.loose = !!options.loose
  11082. this.parse(comp)
  11083. if (this.semver === ANY) {
  11084. this.value = ''
  11085. } else {
  11086. this.value = this.operator + this.semver.version
  11087. }
  11088. debug('comp', this)
  11089. }
  11090. var ANY = {}
  11091. Comparator.prototype.parse = function (comp) {
  11092. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11093. var m = comp.match(r)
  11094. if (!m) {
  11095. throw new TypeError('Invalid comparator: ' + comp)
  11096. }
  11097. this.operator = m[1] !== undefined ? m[1] : ''
  11098. if (this.operator === '=') {
  11099. this.operator = ''
  11100. }
  11101. // if it literally is just '>' or '' then allow anything.
  11102. if (!m[2]) {
  11103. this.semver = ANY
  11104. } else {
  11105. this.semver = new SemVer(m[2], this.options.loose)
  11106. }
  11107. }
  11108. Comparator.prototype.toString = function () {
  11109. return this.value
  11110. }
  11111. Comparator.prototype.test = function (version) {
  11112. debug('Comparator.test', version, this.options.loose)
  11113. if (this.semver === ANY || version === ANY) {
  11114. return true
  11115. }
  11116. if (typeof version === 'string') {
  11117. try {
  11118. version = new SemVer(version, this.options)
  11119. } catch (er) {
  11120. return false
  11121. }
  11122. }
  11123. return cmp(version, this.operator, this.semver, this.options)
  11124. }
  11125. Comparator.prototype.intersects = function (comp, options) {
  11126. if (!(comp instanceof Comparator)) {
  11127. throw new TypeError('a Comparator is required')
  11128. }
  11129. if (!options || typeof options !== 'object') {
  11130. options = {
  11131. loose: !!options,
  11132. includePrerelease: false
  11133. }
  11134. }
  11135. var rangeTmp
  11136. if (this.operator === '') {
  11137. if (this.value === '') {
  11138. return true
  11139. }
  11140. rangeTmp = new Range(comp.value, options)
  11141. return satisfies(this.value, rangeTmp, options)
  11142. } else if (comp.operator === '') {
  11143. if (comp.value === '') {
  11144. return true
  11145. }
  11146. rangeTmp = new Range(this.value, options)
  11147. return satisfies(comp.semver, rangeTmp, options)
  11148. }
  11149. var sameDirectionIncreasing =
  11150. (this.operator === '>=' || this.operator === '>') &&
  11151. (comp.operator === '>=' || comp.operator === '>')
  11152. var sameDirectionDecreasing =
  11153. (this.operator === '<=' || this.operator === '<') &&
  11154. (comp.operator === '<=' || comp.operator === '<')
  11155. var sameSemVer = this.semver.version === comp.semver.version
  11156. var differentDirectionsInclusive =
  11157. (this.operator === '>=' || this.operator === '<=') &&
  11158. (comp.operator === '>=' || comp.operator === '<=')
  11159. var oppositeDirectionsLessThan =
  11160. cmp(this.semver, '<', comp.semver, options) &&
  11161. ((this.operator === '>=' || this.operator === '>') &&
  11162. (comp.operator === '<=' || comp.operator === '<'))
  11163. var oppositeDirectionsGreaterThan =
  11164. cmp(this.semver, '>', comp.semver, options) &&
  11165. ((this.operator === '<=' || this.operator === '<') &&
  11166. (comp.operator === '>=' || comp.operator === '>'))
  11167. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11168. (sameSemVer && differentDirectionsInclusive) ||
  11169. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11170. }
  11171. exports.Range = Range
  11172. function Range (range, options) {
  11173. if (!options || typeof options !== 'object') {
  11174. options = {
  11175. loose: !!options,
  11176. includePrerelease: false
  11177. }
  11178. }
  11179. if (range instanceof Range) {
  11180. if (range.loose === !!options.loose &&
  11181. range.includePrerelease === !!options.includePrerelease) {
  11182. return range
  11183. } else {
  11184. return new Range(range.raw, options)
  11185. }
  11186. }
  11187. if (range instanceof Comparator) {
  11188. return new Range(range.value, options)
  11189. }
  11190. if (!(this instanceof Range)) {
  11191. return new Range(range, options)
  11192. }
  11193. this.options = options
  11194. this.loose = !!options.loose
  11195. this.includePrerelease = !!options.includePrerelease
  11196. // First, split based on boolean or ||
  11197. this.raw = range
  11198. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11199. return this.parseRange(range.trim())
  11200. }, this).filter(function (c) {
  11201. // throw out any that are not relevant for whatever reason
  11202. return c.length
  11203. })
  11204. if (!this.set.length) {
  11205. throw new TypeError('Invalid SemVer Range: ' + range)
  11206. }
  11207. this.format()
  11208. }
  11209. Range.prototype.format = function () {
  11210. this.range = this.set.map(function (comps) {
  11211. return comps.join(' ').trim()
  11212. }).join('||').trim()
  11213. return this.range
  11214. }
  11215. Range.prototype.toString = function () {
  11216. return this.range
  11217. }
  11218. Range.prototype.parseRange = function (range) {
  11219. var loose = this.options.loose
  11220. range = range.trim()
  11221. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11222. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11223. range = range.replace(hr, hyphenReplace)
  11224. debug('hyphen replace', range)
  11225. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11226. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11227. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11228. // `~ 1.2.3` => `~1.2.3`
  11229. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11230. // `^ 1.2.3` => `^1.2.3`
  11231. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11232. // normalize spaces
  11233. range = range.split(/\s+/).join(' ')
  11234. // At this point, the range is completely trimmed and
  11235. // ready to be split into comparators.
  11236. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11237. var set = range.split(' ').map(function (comp) {
  11238. return parseComparator(comp, this.options)
  11239. }, this).join(' ').split(/\s+/)
  11240. if (this.options.loose) {
  11241. // in loose mode, throw out any that are not valid comparators
  11242. set = set.filter(function (comp) {
  11243. return !!comp.match(compRe)
  11244. })
  11245. }
  11246. set = set.map(function (comp) {
  11247. return new Comparator(comp, this.options)
  11248. }, this)
  11249. return set
  11250. }
  11251. Range.prototype.intersects = function (range, options) {
  11252. if (!(range instanceof Range)) {
  11253. throw new TypeError('a Range is required')
  11254. }
  11255. return this.set.some(function (thisComparators) {
  11256. return (
  11257. isSatisfiable(thisComparators, options) &&
  11258. range.set.some(function (rangeComparators) {
  11259. return (
  11260. isSatisfiable(rangeComparators, options) &&
  11261. thisComparators.every(function (thisComparator) {
  11262. return rangeComparators.every(function (rangeComparator) {
  11263. return thisComparator.intersects(rangeComparator, options)
  11264. })
  11265. })
  11266. )
  11267. })
  11268. )
  11269. })
  11270. }
  11271. // take a set of comparators and determine whether there
  11272. // exists a version which can satisfy it
  11273. function isSatisfiable (comparators, options) {
  11274. var result = true
  11275. var remainingComparators = comparators.slice()
  11276. var testComparator = remainingComparators.pop()
  11277. while (result && remainingComparators.length) {
  11278. result = remainingComparators.every(function (otherComparator) {
  11279. return testComparator.intersects(otherComparator, options)
  11280. })
  11281. testComparator = remainingComparators.pop()
  11282. }
  11283. return result
  11284. }
  11285. // Mostly just for testing and legacy API reasons
  11286. exports.toComparators = toComparators
  11287. function toComparators (range, options) {
  11288. return new Range(range, options).set.map(function (comp) {
  11289. return comp.map(function (c) {
  11290. return c.value
  11291. }).join(' ').trim().split(' ')
  11292. })
  11293. }
  11294. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11295. // already replaced the hyphen ranges
  11296. // turn into a set of JUST comparators.
  11297. function parseComparator (comp, options) {
  11298. debug('comp', comp, options)
  11299. comp = replaceCarets(comp, options)
  11300. debug('caret', comp)
  11301. comp = replaceTildes(comp, options)
  11302. debug('tildes', comp)
  11303. comp = replaceXRanges(comp, options)
  11304. debug('xrange', comp)
  11305. comp = replaceStars(comp, options)
  11306. debug('stars', comp)
  11307. return comp
  11308. }
  11309. function isX (id) {
  11310. return !id || id.toLowerCase() === 'x' || id === '*'
  11311. }
  11312. // ~, ~> --> * (any, kinda silly)
  11313. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11314. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11315. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11316. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11317. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11318. function replaceTildes (comp, options) {
  11319. return comp.trim().split(/\s+/).map(function (comp) {
  11320. return replaceTilde(comp, options)
  11321. }).join(' ')
  11322. }
  11323. function replaceTilde (comp, options) {
  11324. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11325. return comp.replace(r, function (_, M, m, p, pr) {
  11326. debug('tilde', comp, _, M, m, p, pr)
  11327. var ret
  11328. if (isX(M)) {
  11329. ret = ''
  11330. } else if (isX(m)) {
  11331. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11332. } else if (isX(p)) {
  11333. // ~1.2 == >=1.2.0 <1.3.0
  11334. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11335. } else if (pr) {
  11336. debug('replaceTilde pr', pr)
  11337. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11338. ' <' + M + '.' + (+m + 1) + '.0'
  11339. } else {
  11340. // ~1.2.3 == >=1.2.3 <1.3.0
  11341. ret = '>=' + M + '.' + m + '.' + p +
  11342. ' <' + M + '.' + (+m + 1) + '.0'
  11343. }
  11344. debug('tilde return', ret)
  11345. return ret
  11346. })
  11347. }
  11348. // ^ --> * (any, kinda silly)
  11349. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11350. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11351. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11352. // ^1.2.3 --> >=1.2.3 <2.0.0
  11353. // ^1.2.0 --> >=1.2.0 <2.0.0
  11354. function replaceCarets (comp, options) {
  11355. return comp.trim().split(/\s+/).map(function (comp) {
  11356. return replaceCaret(comp, options)
  11357. }).join(' ')
  11358. }
  11359. function replaceCaret (comp, options) {
  11360. debug('caret', comp, options)
  11361. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11362. return comp.replace(r, function (_, M, m, p, pr) {
  11363. debug('caret', comp, _, M, m, p, pr)
  11364. var ret
  11365. if (isX(M)) {
  11366. ret = ''
  11367. } else if (isX(m)) {
  11368. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11369. } else if (isX(p)) {
  11370. if (M === '0') {
  11371. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11372. } else {
  11373. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11374. }
  11375. } else if (pr) {
  11376. debug('replaceCaret pr', pr)
  11377. if (M === '0') {
  11378. if (m === '0') {
  11379. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11380. ' <' + M + '.' + m + '.' + (+p + 1)
  11381. } else {
  11382. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11383. ' <' + M + '.' + (+m + 1) + '.0'
  11384. }
  11385. } else {
  11386. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11387. ' <' + (+M + 1) + '.0.0'
  11388. }
  11389. } else {
  11390. debug('no pr')
  11391. if (M === '0') {
  11392. if (m === '0') {
  11393. ret = '>=' + M + '.' + m + '.' + p +
  11394. ' <' + M + '.' + m + '.' + (+p + 1)
  11395. } else {
  11396. ret = '>=' + M + '.' + m + '.' + p +
  11397. ' <' + M + '.' + (+m + 1) + '.0'
  11398. }
  11399. } else {
  11400. ret = '>=' + M + '.' + m + '.' + p +
  11401. ' <' + (+M + 1) + '.0.0'
  11402. }
  11403. }
  11404. debug('caret return', ret)
  11405. return ret
  11406. })
  11407. }
  11408. function replaceXRanges (comp, options) {
  11409. debug('replaceXRanges', comp, options)
  11410. return comp.split(/\s+/).map(function (comp) {
  11411. return replaceXRange(comp, options)
  11412. }).join(' ')
  11413. }
  11414. function replaceXRange (comp, options) {
  11415. comp = comp.trim()
  11416. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11417. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11418. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11419. var xM = isX(M)
  11420. var xm = xM || isX(m)
  11421. var xp = xm || isX(p)
  11422. var anyX = xp
  11423. if (gtlt === '=' && anyX) {
  11424. gtlt = ''
  11425. }
  11426. // if we're including prereleases in the match, then we need
  11427. // to fix this to -0, the lowest possible prerelease value
  11428. pr = options.includePrerelease ? '-0' : ''
  11429. if (xM) {
  11430. if (gtlt === '>' || gtlt === '<') {
  11431. // nothing is allowed
  11432. ret = '<0.0.0-0'
  11433. } else {
  11434. // nothing is forbidden
  11435. ret = '*'
  11436. }
  11437. } else if (gtlt && anyX) {
  11438. // we know patch is an x, because we have any x at all.
  11439. // replace X with 0
  11440. if (xm) {
  11441. m = 0
  11442. }
  11443. p = 0
  11444. if (gtlt === '>') {
  11445. // >1 => >=2.0.0
  11446. // >1.2 => >=1.3.0
  11447. // >1.2.3 => >= 1.2.4
  11448. gtlt = '>='
  11449. if (xm) {
  11450. M = +M + 1
  11451. m = 0
  11452. p = 0
  11453. } else {
  11454. m = +m + 1
  11455. p = 0
  11456. }
  11457. } else if (gtlt === '<=') {
  11458. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11459. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11460. gtlt = '<'
  11461. if (xm) {
  11462. M = +M + 1
  11463. } else {
  11464. m = +m + 1
  11465. }
  11466. }
  11467. ret = gtlt + M + '.' + m + '.' + p + pr
  11468. } else if (xm) {
  11469. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11470. } else if (xp) {
  11471. ret = '>=' + M + '.' + m + '.0' + pr +
  11472. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11473. }
  11474. debug('xRange return', ret)
  11475. return ret
  11476. })
  11477. }
  11478. // Because * is AND-ed with everything else in the comparator,
  11479. // and '' means "any version", just remove the *s entirely.
  11480. function replaceStars (comp, options) {
  11481. debug('replaceStars', comp, options)
  11482. // Looseness is ignored here. star is always as loose as it gets!
  11483. return comp.trim().replace(re[t.STAR], '')
  11484. }
  11485. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11486. // M, m, patch, prerelease, build
  11487. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11488. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11489. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11490. function hyphenReplace ($0,
  11491. from, fM, fm, fp, fpr, fb,
  11492. to, tM, tm, tp, tpr, tb) {
  11493. if (isX(fM)) {
  11494. from = ''
  11495. } else if (isX(fm)) {
  11496. from = '>=' + fM + '.0.0'
  11497. } else if (isX(fp)) {
  11498. from = '>=' + fM + '.' + fm + '.0'
  11499. } else {
  11500. from = '>=' + from
  11501. }
  11502. if (isX(tM)) {
  11503. to = ''
  11504. } else if (isX(tm)) {
  11505. to = '<' + (+tM + 1) + '.0.0'
  11506. } else if (isX(tp)) {
  11507. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11508. } else if (tpr) {
  11509. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11510. } else {
  11511. to = '<=' + to
  11512. }
  11513. return (from + ' ' + to).trim()
  11514. }
  11515. // if ANY of the sets match ALL of its comparators, then pass
  11516. Range.prototype.test = function (version) {
  11517. if (!version) {
  11518. return false
  11519. }
  11520. if (typeof version === 'string') {
  11521. try {
  11522. version = new SemVer(version, this.options)
  11523. } catch (er) {
  11524. return false
  11525. }
  11526. }
  11527. for (var i = 0; i < this.set.length; i++) {
  11528. if (testSet(this.set[i], version, this.options)) {
  11529. return true
  11530. }
  11531. }
  11532. return false
  11533. }
  11534. function testSet (set, version, options) {
  11535. for (var i = 0; i < set.length; i++) {
  11536. if (!set[i].test(version)) {
  11537. return false
  11538. }
  11539. }
  11540. if (version.prerelease.length && !options.includePrerelease) {
  11541. // Find the set of versions that are allowed to have prereleases
  11542. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11543. // That should allow `1.2.3-pr.2` to pass.
  11544. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11545. // even though it's within the range set by the comparators.
  11546. for (i = 0; i < set.length; i++) {
  11547. debug(set[i].semver)
  11548. if (set[i].semver === ANY) {
  11549. continue
  11550. }
  11551. if (set[i].semver.prerelease.length > 0) {
  11552. var allowed = set[i].semver
  11553. if (allowed.major === version.major &&
  11554. allowed.minor === version.minor &&
  11555. allowed.patch === version.patch) {
  11556. return true
  11557. }
  11558. }
  11559. }
  11560. // Version has a -pre, but it's not one of the ones we like.
  11561. return false
  11562. }
  11563. return true
  11564. }
  11565. exports.satisfies = satisfies
  11566. function satisfies (version, range, options) {
  11567. try {
  11568. range = new Range(range, options)
  11569. } catch (er) {
  11570. return false
  11571. }
  11572. return range.test(version)
  11573. }
  11574. exports.maxSatisfying = maxSatisfying
  11575. function maxSatisfying (versions, range, options) {
  11576. var max = null
  11577. var maxSV = null
  11578. try {
  11579. var rangeObj = new Range(range, options)
  11580. } catch (er) {
  11581. return null
  11582. }
  11583. versions.forEach(function (v) {
  11584. if (rangeObj.test(v)) {
  11585. // satisfies(v, range, options)
  11586. if (!max || maxSV.compare(v) === -1) {
  11587. // compare(max, v, true)
  11588. max = v
  11589. maxSV = new SemVer(max, options)
  11590. }
  11591. }
  11592. })
  11593. return max
  11594. }
  11595. exports.minSatisfying = minSatisfying
  11596. function minSatisfying (versions, range, options) {
  11597. var min = null
  11598. var minSV = null
  11599. try {
  11600. var rangeObj = new Range(range, options)
  11601. } catch (er) {
  11602. return null
  11603. }
  11604. versions.forEach(function (v) {
  11605. if (rangeObj.test(v)) {
  11606. // satisfies(v, range, options)
  11607. if (!min || minSV.compare(v) === 1) {
  11608. // compare(min, v, true)
  11609. min = v
  11610. minSV = new SemVer(min, options)
  11611. }
  11612. }
  11613. })
  11614. return min
  11615. }
  11616. exports.minVersion = minVersion
  11617. function minVersion (range, loose) {
  11618. range = new Range(range, loose)
  11619. var minver = new SemVer('0.0.0')
  11620. if (range.test(minver)) {
  11621. return minver
  11622. }
  11623. minver = new SemVer('0.0.0-0')
  11624. if (range.test(minver)) {
  11625. return minver
  11626. }
  11627. minver = null
  11628. for (var i = 0; i < range.set.length; ++i) {
  11629. var comparators = range.set[i]
  11630. comparators.forEach(function (comparator) {
  11631. // Clone to avoid manipulating the comparator's semver object.
  11632. var compver = new SemVer(comparator.semver.version)
  11633. switch (comparator.operator) {
  11634. case '>':
  11635. if (compver.prerelease.length === 0) {
  11636. compver.patch++
  11637. } else {
  11638. compver.prerelease.push(0)
  11639. }
  11640. compver.raw = compver.format()
  11641. /* fallthrough */
  11642. case '':
  11643. case '>=':
  11644. if (!minver || gt(minver, compver)) {
  11645. minver = compver
  11646. }
  11647. break
  11648. case '<':
  11649. case '<=':
  11650. /* Ignore maximum versions */
  11651. break
  11652. /* istanbul ignore next */
  11653. default:
  11654. throw new Error('Unexpected operation: ' + comparator.operator)
  11655. }
  11656. })
  11657. }
  11658. if (minver && range.test(minver)) {
  11659. return minver
  11660. }
  11661. return null
  11662. }
  11663. exports.validRange = validRange
  11664. function validRange (range, options) {
  11665. try {
  11666. // Return '*' instead of '' so that truthiness works.
  11667. // This will throw if it's invalid anyway
  11668. return new Range(range, options).range || '*'
  11669. } catch (er) {
  11670. return null
  11671. }
  11672. }
  11673. // Determine if version is less than all the versions possible in the range
  11674. exports.ltr = ltr
  11675. function ltr (version, range, options) {
  11676. return outside(version, range, '<', options)
  11677. }
  11678. // Determine if version is greater than all the versions possible in the range.
  11679. exports.gtr = gtr
  11680. function gtr (version, range, options) {
  11681. return outside(version, range, '>', options)
  11682. }
  11683. exports.outside = outside
  11684. function outside (version, range, hilo, options) {
  11685. version = new SemVer(version, options)
  11686. range = new Range(range, options)
  11687. var gtfn, ltefn, ltfn, comp, ecomp
  11688. switch (hilo) {
  11689. case '>':
  11690. gtfn = gt
  11691. ltefn = lte
  11692. ltfn = lt
  11693. comp = '>'
  11694. ecomp = '>='
  11695. break
  11696. case '<':
  11697. gtfn = lt
  11698. ltefn = gte
  11699. ltfn = gt
  11700. comp = '<'
  11701. ecomp = '<='
  11702. break
  11703. default:
  11704. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11705. }
  11706. // If it satisifes the range it is not outside
  11707. if (satisfies(version, range, options)) {
  11708. return false
  11709. }
  11710. // From now on, variable terms are as if we're in "gtr" mode.
  11711. // but note that everything is flipped for the "ltr" function.
  11712. for (var i = 0; i < range.set.length; ++i) {
  11713. var comparators = range.set[i]
  11714. var high = null
  11715. var low = null
  11716. comparators.forEach(function (comparator) {
  11717. if (comparator.semver === ANY) {
  11718. comparator = new Comparator('>=0.0.0')
  11719. }
  11720. high = high || comparator
  11721. low = low || comparator
  11722. if (gtfn(comparator.semver, high.semver, options)) {
  11723. high = comparator
  11724. } else if (ltfn(comparator.semver, low.semver, options)) {
  11725. low = comparator
  11726. }
  11727. })
  11728. // If the edge version comparator has a operator then our version
  11729. // isn't outside it
  11730. if (high.operator === comp || high.operator === ecomp) {
  11731. return false
  11732. }
  11733. // If the lowest version comparator has an operator and our version
  11734. // is less than it then it isn't higher than the range
  11735. if ((!low.operator || low.operator === comp) &&
  11736. ltefn(version, low.semver)) {
  11737. return false
  11738. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11739. return false
  11740. }
  11741. }
  11742. return true
  11743. }
  11744. exports.prerelease = prerelease
  11745. function prerelease (version, options) {
  11746. var parsed = parse(version, options)
  11747. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11748. }
  11749. exports.intersects = intersects
  11750. function intersects (r1, r2, options) {
  11751. r1 = new Range(r1, options)
  11752. r2 = new Range(r2, options)
  11753. return r1.intersects(r2)
  11754. }
  11755. exports.coerce = coerce
  11756. function coerce (version, options) {
  11757. if (version instanceof SemVer) {
  11758. return version
  11759. }
  11760. if (typeof version === 'number') {
  11761. version = String(version)
  11762. }
  11763. if (typeof version !== 'string') {
  11764. return null
  11765. }
  11766. options = options || {}
  11767. var match = null
  11768. if (!options.rtl) {
  11769. match = version.match(re[t.COERCE])
  11770. } else {
  11771. // Find the right-most coercible string that does not share
  11772. // a terminus with a more left-ward coercible string.
  11773. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11774. //
  11775. // Walk through the string checking with a /g regexp
  11776. // Manually set the index so as to pick up overlapping matches.
  11777. // Stop when we get a match that ends at the string end, since no
  11778. // coercible string can be more right-ward without the same terminus.
  11779. var next
  11780. while ((next = re[t.COERCERTL].exec(version)) &&
  11781. (!match || match.index + match[0].length !== version.length)
  11782. ) {
  11783. if (!match ||
  11784. next.index + next[0].length !== match.index + match[0].length) {
  11785. match = next
  11786. }
  11787. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11788. }
  11789. // leave it in a clean state
  11790. re[t.COERCERTL].lastIndex = -1
  11791. }
  11792. if (match === null) {
  11793. return null
  11794. }
  11795. return parse(match[2] +
  11796. '.' + (match[3] || '0') +
  11797. '.' + (match[4] || '0'), options)
  11798. }
  11799. /***/ }),
  11800. /***/ 669:
  11801. /***/ (function(module) {
  11802. module.exports = require("util");
  11803. /***/ }),
  11804. /***/ 672:
  11805. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11806. "use strict";
  11807. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11808. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11809. return new (P || (P = Promise))(function (resolve, reject) {
  11810. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11811. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11812. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11813. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11814. });
  11815. };
  11816. var _a;
  11817. Object.defineProperty(exports, "__esModule", { value: true });
  11818. const assert_1 = __webpack_require__(357);
  11819. const fs = __webpack_require__(747);
  11820. const path = __webpack_require__(622);
  11821. _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;
  11822. exports.IS_WINDOWS = process.platform === 'win32';
  11823. function exists(fsPath) {
  11824. return __awaiter(this, void 0, void 0, function* () {
  11825. try {
  11826. yield exports.stat(fsPath);
  11827. }
  11828. catch (err) {
  11829. if (err.code === 'ENOENT') {
  11830. return false;
  11831. }
  11832. throw err;
  11833. }
  11834. return true;
  11835. });
  11836. }
  11837. exports.exists = exists;
  11838. function isDirectory(fsPath, useStat = false) {
  11839. return __awaiter(this, void 0, void 0, function* () {
  11840. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11841. return stats.isDirectory();
  11842. });
  11843. }
  11844. exports.isDirectory = isDirectory;
  11845. /**
  11846. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11847. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11848. */
  11849. function isRooted(p) {
  11850. p = normalizeSeparators(p);
  11851. if (!p) {
  11852. throw new Error('isRooted() parameter "p" cannot be empty');
  11853. }
  11854. if (exports.IS_WINDOWS) {
  11855. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11856. ); // e.g. C: or C:\hello
  11857. }
  11858. return p.startsWith('/');
  11859. }
  11860. exports.isRooted = isRooted;
  11861. /**
  11862. * Recursively create a directory at `fsPath`.
  11863. *
  11864. * This implementation is optimistic, meaning it attempts to create the full
  11865. * path first, and backs up the path stack from there.
  11866. *
  11867. * @param fsPath The path to create
  11868. * @param maxDepth The maximum recursion depth
  11869. * @param depth The current recursion depth
  11870. */
  11871. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11872. return __awaiter(this, void 0, void 0, function* () {
  11873. assert_1.ok(fsPath, 'a path argument must be provided');
  11874. fsPath = path.resolve(fsPath);
  11875. if (depth >= maxDepth)
  11876. return exports.mkdir(fsPath);
  11877. try {
  11878. yield exports.mkdir(fsPath);
  11879. return;
  11880. }
  11881. catch (err) {
  11882. switch (err.code) {
  11883. case 'ENOENT': {
  11884. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11885. yield exports.mkdir(fsPath);
  11886. return;
  11887. }
  11888. default: {
  11889. let stats;
  11890. try {
  11891. stats = yield exports.stat(fsPath);
  11892. }
  11893. catch (err2) {
  11894. throw err;
  11895. }
  11896. if (!stats.isDirectory())
  11897. throw err;
  11898. }
  11899. }
  11900. }
  11901. });
  11902. }
  11903. exports.mkdirP = mkdirP;
  11904. /**
  11905. * Best effort attempt to determine whether a file exists and is executable.
  11906. * @param filePath file path to check
  11907. * @param extensions additional file extensions to try
  11908. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11909. */
  11910. function tryGetExecutablePath(filePath, extensions) {
  11911. return __awaiter(this, void 0, void 0, function* () {
  11912. let stats = undefined;
  11913. try {
  11914. // test file exists
  11915. stats = yield exports.stat(filePath);
  11916. }
  11917. catch (err) {
  11918. if (err.code !== 'ENOENT') {
  11919. // eslint-disable-next-line no-console
  11920. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11921. }
  11922. }
  11923. if (stats && stats.isFile()) {
  11924. if (exports.IS_WINDOWS) {
  11925. // on Windows, test for valid extension
  11926. const upperExt = path.extname(filePath).toUpperCase();
  11927. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11928. return filePath;
  11929. }
  11930. }
  11931. else {
  11932. if (isUnixExecutable(stats)) {
  11933. return filePath;
  11934. }
  11935. }
  11936. }
  11937. // try each extension
  11938. const originalFilePath = filePath;
  11939. for (const extension of extensions) {
  11940. filePath = originalFilePath + extension;
  11941. stats = undefined;
  11942. try {
  11943. stats = yield exports.stat(filePath);
  11944. }
  11945. catch (err) {
  11946. if (err.code !== 'ENOENT') {
  11947. // eslint-disable-next-line no-console
  11948. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11949. }
  11950. }
  11951. if (stats && stats.isFile()) {
  11952. if (exports.IS_WINDOWS) {
  11953. // preserve the case of the actual file (since an extension was appended)
  11954. try {
  11955. const directory = path.dirname(filePath);
  11956. const upperName = path.basename(filePath).toUpperCase();
  11957. for (const actualName of yield exports.readdir(directory)) {
  11958. if (upperName === actualName.toUpperCase()) {
  11959. filePath = path.join(directory, actualName);
  11960. break;
  11961. }
  11962. }
  11963. }
  11964. catch (err) {
  11965. // eslint-disable-next-line no-console
  11966. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11967. }
  11968. return filePath;
  11969. }
  11970. else {
  11971. if (isUnixExecutable(stats)) {
  11972. return filePath;
  11973. }
  11974. }
  11975. }
  11976. }
  11977. return '';
  11978. });
  11979. }
  11980. exports.tryGetExecutablePath = tryGetExecutablePath;
  11981. function normalizeSeparators(p) {
  11982. p = p || '';
  11983. if (exports.IS_WINDOWS) {
  11984. // convert slashes on Windows
  11985. p = p.replace(/\//g, '\\');
  11986. // remove redundant slashes
  11987. return p.replace(/\\\\+/g, '\\');
  11988. }
  11989. // remove redundant slashes
  11990. return p.replace(/\/\/+/g, '/');
  11991. }
  11992. // on Mac/Linux, test the execute bit
  11993. // R W X R W X R W X
  11994. // 256 128 64 32 16 8 4 2 1
  11995. function isUnixExecutable(stats) {
  11996. return ((stats.mode & 1) > 0 ||
  11997. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11998. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11999. }
  12000. //# sourceMappingURL=io-util.js.map
  12001. /***/ }),
  12002. /***/ 674:
  12003. /***/ (function(module, __unusedexports, __webpack_require__) {
  12004. module.exports = authenticate;
  12005. const { Deprecation } = __webpack_require__(692);
  12006. const once = __webpack_require__(969);
  12007. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  12008. function authenticate(state, options) {
  12009. deprecateAuthenticate(
  12010. state.octokit.log,
  12011. new Deprecation(
  12012. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  12013. )
  12014. );
  12015. if (!options) {
  12016. state.auth = false;
  12017. return;
  12018. }
  12019. switch (options.type) {
  12020. case "basic":
  12021. if (!options.username || !options.password) {
  12022. throw new Error(
  12023. "Basic authentication requires both a username and password to be set"
  12024. );
  12025. }
  12026. break;
  12027. case "oauth":
  12028. if (!options.token && !(options.key && options.secret)) {
  12029. throw new Error(
  12030. "OAuth2 authentication requires a token or key & secret to be set"
  12031. );
  12032. }
  12033. break;
  12034. case "token":
  12035. case "app":
  12036. if (!options.token) {
  12037. throw new Error("Token authentication requires a token to be set");
  12038. }
  12039. break;
  12040. default:
  12041. throw new Error(
  12042. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  12043. );
  12044. }
  12045. state.auth = options;
  12046. }
  12047. /***/ }),
  12048. /***/ 675:
  12049. /***/ (function(module) {
  12050. module.exports = function btoa(str) {
  12051. return new Buffer(str).toString('base64')
  12052. }
  12053. /***/ }),
  12054. /***/ 692:
  12055. /***/ (function(__unusedmodule, exports) {
  12056. "use strict";
  12057. Object.defineProperty(exports, '__esModule', { value: true });
  12058. class Deprecation extends Error {
  12059. constructor(message) {
  12060. super(message); // Maintains proper stack trace (only available on V8)
  12061. /* istanbul ignore next */
  12062. if (Error.captureStackTrace) {
  12063. Error.captureStackTrace(this, this.constructor);
  12064. }
  12065. this.name = 'Deprecation';
  12066. }
  12067. }
  12068. exports.Deprecation = Deprecation;
  12069. /***/ }),
  12070. /***/ 696:
  12071. /***/ (function(module) {
  12072. "use strict";
  12073. /*!
  12074. * isobject <https://github.com/jonschlinkert/isobject>
  12075. *
  12076. * Copyright (c) 2014-2017, Jon Schlinkert.
  12077. * Released under the MIT License.
  12078. */
  12079. function isObject(val) {
  12080. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12081. }
  12082. /*!
  12083. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12084. *
  12085. * Copyright (c) 2014-2017, Jon Schlinkert.
  12086. * Released under the MIT License.
  12087. */
  12088. function isObjectObject(o) {
  12089. return isObject(o) === true
  12090. && Object.prototype.toString.call(o) === '[object Object]';
  12091. }
  12092. function isPlainObject(o) {
  12093. var ctor,prot;
  12094. if (isObjectObject(o) === false) return false;
  12095. // If has modified constructor
  12096. ctor = o.constructor;
  12097. if (typeof ctor !== 'function') return false;
  12098. // If has modified prototype
  12099. prot = ctor.prototype;
  12100. if (isObjectObject(prot) === false) return false;
  12101. // If constructor does not have an Object-specific method
  12102. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12103. return false;
  12104. }
  12105. // Most likely a plain Object
  12106. return true;
  12107. }
  12108. module.exports = isPlainObject;
  12109. /***/ }),
  12110. /***/ 697:
  12111. /***/ (function(module) {
  12112. "use strict";
  12113. module.exports = (promise, onFinally) => {
  12114. onFinally = onFinally || (() => {});
  12115. return promise.then(
  12116. val => new Promise(resolve => {
  12117. resolve(onFinally());
  12118. }).then(() => val),
  12119. err => new Promise(resolve => {
  12120. resolve(onFinally());
  12121. }).then(() => {
  12122. throw err;
  12123. })
  12124. );
  12125. };
  12126. /***/ }),
  12127. /***/ 722:
  12128. /***/ (function(module) {
  12129. /**
  12130. * Convert array of 16 byte values to UUID string format of the form:
  12131. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12132. */
  12133. var byteToHex = [];
  12134. for (var i = 0; i < 256; ++i) {
  12135. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12136. }
  12137. function bytesToUuid(buf, offset) {
  12138. var i = offset || 0;
  12139. var bth = byteToHex;
  12140. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12141. return ([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++]],
  12148. bth[buf[i++]], bth[buf[i++]]]).join('');
  12149. }
  12150. module.exports = bytesToUuid;
  12151. /***/ }),
  12152. /***/ 742:
  12153. /***/ (function(module, __unusedexports, __webpack_require__) {
  12154. var fs = __webpack_require__(747)
  12155. var core
  12156. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12157. core = __webpack_require__(818)
  12158. } else {
  12159. core = __webpack_require__(197)
  12160. }
  12161. module.exports = isexe
  12162. isexe.sync = sync
  12163. function isexe (path, options, cb) {
  12164. if (typeof options === 'function') {
  12165. cb = options
  12166. options = {}
  12167. }
  12168. if (!cb) {
  12169. if (typeof Promise !== 'function') {
  12170. throw new TypeError('callback not provided')
  12171. }
  12172. return new Promise(function (resolve, reject) {
  12173. isexe(path, options || {}, function (er, is) {
  12174. if (er) {
  12175. reject(er)
  12176. } else {
  12177. resolve(is)
  12178. }
  12179. })
  12180. })
  12181. }
  12182. core(path, options || {}, function (er, is) {
  12183. // ignore EACCES because that just means we aren't allowed to run it
  12184. if (er) {
  12185. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12186. er = null
  12187. is = false
  12188. }
  12189. }
  12190. cb(er, is)
  12191. })
  12192. }
  12193. function sync (path, options) {
  12194. // my kingdom for a filtered catch
  12195. try {
  12196. return core.sync(path, options || {})
  12197. } catch (er) {
  12198. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12199. return false
  12200. } else {
  12201. throw er
  12202. }
  12203. }
  12204. }
  12205. /***/ }),
  12206. /***/ 747:
  12207. /***/ (function(module) {
  12208. module.exports = require("fs");
  12209. /***/ }),
  12210. /***/ 753:
  12211. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12212. "use strict";
  12213. Object.defineProperty(exports, '__esModule', { value: true });
  12214. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12215. var endpoint = __webpack_require__(385);
  12216. var universalUserAgent = __webpack_require__(211);
  12217. var isPlainObject = _interopDefault(__webpack_require__(696));
  12218. var nodeFetch = _interopDefault(__webpack_require__(454));
  12219. var requestError = __webpack_require__(463);
  12220. const VERSION = "5.4.2";
  12221. function getBufferResponse(response) {
  12222. return response.arrayBuffer();
  12223. }
  12224. function fetchWrapper(requestOptions) {
  12225. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12226. requestOptions.body = JSON.stringify(requestOptions.body);
  12227. }
  12228. let headers = {};
  12229. let status;
  12230. let url;
  12231. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12232. return fetch(requestOptions.url, Object.assign({
  12233. method: requestOptions.method,
  12234. body: requestOptions.body,
  12235. headers: requestOptions.headers,
  12236. redirect: requestOptions.redirect
  12237. }, requestOptions.request)).then(response => {
  12238. url = response.url;
  12239. status = response.status;
  12240. for (const keyAndValue of response.headers) {
  12241. headers[keyAndValue[0]] = keyAndValue[1];
  12242. }
  12243. if (status === 204 || status === 205) {
  12244. return;
  12245. } // GitHub API returns 200 for HEAD requests
  12246. if (requestOptions.method === "HEAD") {
  12247. if (status < 400) {
  12248. return;
  12249. }
  12250. throw new requestError.RequestError(response.statusText, status, {
  12251. headers,
  12252. request: requestOptions
  12253. });
  12254. }
  12255. if (status === 304) {
  12256. throw new requestError.RequestError("Not modified", status, {
  12257. headers,
  12258. request: requestOptions
  12259. });
  12260. }
  12261. if (status >= 400) {
  12262. return response.text().then(message => {
  12263. const error = new requestError.RequestError(message, status, {
  12264. headers,
  12265. request: requestOptions
  12266. });
  12267. try {
  12268. let responseBody = JSON.parse(error.message);
  12269. Object.assign(error, responseBody);
  12270. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12271. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12272. } catch (e) {// ignore, see octokit/rest.js#684
  12273. }
  12274. throw error;
  12275. });
  12276. }
  12277. const contentType = response.headers.get("content-type");
  12278. if (/application\/json/.test(contentType)) {
  12279. return response.json();
  12280. }
  12281. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12282. return response.text();
  12283. }
  12284. return getBufferResponse(response);
  12285. }).then(data => {
  12286. return {
  12287. status,
  12288. url,
  12289. headers,
  12290. data
  12291. };
  12292. }).catch(error => {
  12293. if (error instanceof requestError.RequestError) {
  12294. throw error;
  12295. }
  12296. throw new requestError.RequestError(error.message, 500, {
  12297. headers,
  12298. request: requestOptions
  12299. });
  12300. });
  12301. }
  12302. function withDefaults(oldEndpoint, newDefaults) {
  12303. const endpoint = oldEndpoint.defaults(newDefaults);
  12304. const newApi = function (route, parameters) {
  12305. const endpointOptions = endpoint.merge(route, parameters);
  12306. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12307. return fetchWrapper(endpoint.parse(endpointOptions));
  12308. }
  12309. const request = (route, parameters) => {
  12310. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12311. };
  12312. Object.assign(request, {
  12313. endpoint,
  12314. defaults: withDefaults.bind(null, endpoint)
  12315. });
  12316. return endpointOptions.request.hook(request, endpointOptions);
  12317. };
  12318. return Object.assign(newApi, {
  12319. endpoint,
  12320. defaults: withDefaults.bind(null, endpoint)
  12321. });
  12322. }
  12323. const request = withDefaults(endpoint.endpoint, {
  12324. headers: {
  12325. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12326. }
  12327. });
  12328. exports.request = request;
  12329. //# sourceMappingURL=index.js.map
  12330. /***/ }),
  12331. /***/ 761:
  12332. /***/ (function(module) {
  12333. module.exports = require("zlib");
  12334. /***/ }),
  12335. /***/ 763:
  12336. /***/ (function(module) {
  12337. module.exports = removeHook
  12338. function removeHook (state, name, method) {
  12339. if (!state.registry[name]) {
  12340. return
  12341. }
  12342. var index = state.registry[name]
  12343. .map(function (registered) { return registered.orig })
  12344. .indexOf(method)
  12345. if (index === -1) {
  12346. return
  12347. }
  12348. state.registry[name].splice(index, 1)
  12349. }
  12350. /***/ }),
  12351. /***/ 768:
  12352. /***/ (function(module) {
  12353. "use strict";
  12354. module.exports = function (x) {
  12355. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12356. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12357. if (x[x.length - 1] === lf) {
  12358. x = x.slice(0, x.length - 1);
  12359. }
  12360. if (x[x.length - 1] === cr) {
  12361. x = x.slice(0, x.length - 1);
  12362. }
  12363. return x;
  12364. };
  12365. /***/ }),
  12366. /***/ 777:
  12367. /***/ (function(module, __unusedexports, __webpack_require__) {
  12368. module.exports = getFirstPage
  12369. const getPage = __webpack_require__(265)
  12370. function getFirstPage (octokit, link, headers) {
  12371. return getPage(octokit, link, 'first', headers)
  12372. }
  12373. /***/ }),
  12374. /***/ 796:
  12375. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12376. "use strict";
  12377. Object.defineProperty(exports, '__esModule', { value: true });
  12378. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12379. var osName = _interopDefault(__webpack_require__(2));
  12380. function getUserAgent() {
  12381. try {
  12382. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12383. } catch (error) {
  12384. if (/wmic os get Caption/.test(error.message)) {
  12385. return "Windows <version undetectable>";
  12386. }
  12387. throw error;
  12388. }
  12389. }
  12390. exports.getUserAgent = getUserAgent;
  12391. //# sourceMappingURL=index.js.map
  12392. /***/ }),
  12393. /***/ 813:
  12394. /***/ (function(__unusedmodule, exports) {
  12395. "use strict";
  12396. Object.defineProperty(exports, '__esModule', { value: true });
  12397. async function auth(token) {
  12398. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12399. return {
  12400. type: "token",
  12401. token: token,
  12402. tokenType
  12403. };
  12404. }
  12405. /**
  12406. * Prefix token for usage in the Authorization header
  12407. *
  12408. * @param token OAuth token or JSON Web Token
  12409. */
  12410. function withAuthorizationPrefix(token) {
  12411. if (token.split(/\./).length === 3) {
  12412. return `bearer ${token}`;
  12413. }
  12414. return `token ${token}`;
  12415. }
  12416. async function hook(token, request, route, parameters) {
  12417. const endpoint = request.endpoint.merge(route, parameters);
  12418. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12419. return request(endpoint);
  12420. }
  12421. const createTokenAuth = function createTokenAuth(token) {
  12422. if (!token) {
  12423. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12424. }
  12425. if (typeof token !== "string") {
  12426. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12427. }
  12428. token = token.replace(/^(token|bearer) +/i, "");
  12429. return Object.assign(auth.bind(null, token), {
  12430. hook: hook.bind(null, token)
  12431. });
  12432. };
  12433. exports.createTokenAuth = createTokenAuth;
  12434. //# sourceMappingURL=index.js.map
  12435. /***/ }),
  12436. /***/ 814:
  12437. /***/ (function(module, __unusedexports, __webpack_require__) {
  12438. module.exports = which
  12439. which.sync = whichSync
  12440. var isWindows = process.platform === 'win32' ||
  12441. process.env.OSTYPE === 'cygwin' ||
  12442. process.env.OSTYPE === 'msys'
  12443. var path = __webpack_require__(622)
  12444. var COLON = isWindows ? ';' : ':'
  12445. var isexe = __webpack_require__(742)
  12446. function getNotFoundError (cmd) {
  12447. var er = new Error('not found: ' + cmd)
  12448. er.code = 'ENOENT'
  12449. return er
  12450. }
  12451. function getPathInfo (cmd, opt) {
  12452. var colon = opt.colon || COLON
  12453. var pathEnv = opt.path || process.env.PATH || ''
  12454. var pathExt = ['']
  12455. pathEnv = pathEnv.split(colon)
  12456. var pathExtExe = ''
  12457. if (isWindows) {
  12458. pathEnv.unshift(process.cwd())
  12459. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12460. pathExt = pathExtExe.split(colon)
  12461. // Always test the cmd itself first. isexe will check to make sure
  12462. // it's found in the pathExt set.
  12463. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12464. pathExt.unshift('')
  12465. }
  12466. // If it has a slash, then we don't bother searching the pathenv.
  12467. // just check the file itself, and that's it.
  12468. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12469. pathEnv = ['']
  12470. return {
  12471. env: pathEnv,
  12472. ext: pathExt,
  12473. extExe: pathExtExe
  12474. }
  12475. }
  12476. function which (cmd, opt, cb) {
  12477. if (typeof opt === 'function') {
  12478. cb = opt
  12479. opt = {}
  12480. }
  12481. var info = getPathInfo(cmd, opt)
  12482. var pathEnv = info.env
  12483. var pathExt = info.ext
  12484. var pathExtExe = info.extExe
  12485. var found = []
  12486. ;(function F (i, l) {
  12487. if (i === l) {
  12488. if (opt.all && found.length)
  12489. return cb(null, found)
  12490. else
  12491. return cb(getNotFoundError(cmd))
  12492. }
  12493. var pathPart = pathEnv[i]
  12494. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12495. pathPart = pathPart.slice(1, -1)
  12496. var p = path.join(pathPart, cmd)
  12497. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12498. p = cmd.slice(0, 2) + p
  12499. }
  12500. ;(function E (ii, ll) {
  12501. if (ii === ll) return F(i + 1, l)
  12502. var ext = pathExt[ii]
  12503. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12504. if (!er && is) {
  12505. if (opt.all)
  12506. found.push(p + ext)
  12507. else
  12508. return cb(null, p + ext)
  12509. }
  12510. return E(ii + 1, ll)
  12511. })
  12512. })(0, pathExt.length)
  12513. })(0, pathEnv.length)
  12514. }
  12515. function whichSync (cmd, opt) {
  12516. opt = opt || {}
  12517. var info = getPathInfo(cmd, opt)
  12518. var pathEnv = info.env
  12519. var pathExt = info.ext
  12520. var pathExtExe = info.extExe
  12521. var found = []
  12522. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12523. var pathPart = pathEnv[i]
  12524. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12525. pathPart = pathPart.slice(1, -1)
  12526. var p = path.join(pathPart, cmd)
  12527. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12528. p = cmd.slice(0, 2) + p
  12529. }
  12530. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12531. var cur = p + pathExt[j]
  12532. var is
  12533. try {
  12534. is = isexe.sync(cur, { pathExt: pathExtExe })
  12535. if (is) {
  12536. if (opt.all)
  12537. found.push(cur)
  12538. else
  12539. return cur
  12540. }
  12541. } catch (ex) {}
  12542. }
  12543. }
  12544. if (opt.all && found.length)
  12545. return found
  12546. if (opt.nothrow)
  12547. return null
  12548. throw getNotFoundError(cmd)
  12549. }
  12550. /***/ }),
  12551. /***/ 816:
  12552. /***/ (function(module) {
  12553. "use strict";
  12554. module.exports = /^#!.*/;
  12555. /***/ }),
  12556. /***/ 818:
  12557. /***/ (function(module, __unusedexports, __webpack_require__) {
  12558. module.exports = isexe
  12559. isexe.sync = sync
  12560. var fs = __webpack_require__(747)
  12561. function checkPathExt (path, options) {
  12562. var pathext = options.pathExt !== undefined ?
  12563. options.pathExt : process.env.PATHEXT
  12564. if (!pathext) {
  12565. return true
  12566. }
  12567. pathext = pathext.split(';')
  12568. if (pathext.indexOf('') !== -1) {
  12569. return true
  12570. }
  12571. for (var i = 0; i < pathext.length; i++) {
  12572. var p = pathext[i].toLowerCase()
  12573. if (p && path.substr(-p.length).toLowerCase() === p) {
  12574. return true
  12575. }
  12576. }
  12577. return false
  12578. }
  12579. function checkStat (stat, path, options) {
  12580. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12581. return false
  12582. }
  12583. return checkPathExt(path, options)
  12584. }
  12585. function isexe (path, options, cb) {
  12586. fs.stat(path, function (er, stat) {
  12587. cb(er, er ? false : checkStat(stat, path, options))
  12588. })
  12589. }
  12590. function sync (path, options) {
  12591. return checkStat(fs.statSync(path), path, options)
  12592. }
  12593. /***/ }),
  12594. /***/ 821:
  12595. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12596. "use strict";
  12597. var __importStar = (this && this.__importStar) || function (mod) {
  12598. if (mod && mod.__esModule) return mod;
  12599. var result = {};
  12600. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12601. result["default"] = mod;
  12602. return result;
  12603. };
  12604. Object.defineProperty(exports, "__esModule", { value: true });
  12605. const core = __importStar(__webpack_require__(470));
  12606. const fsHelper = __importStar(__webpack_require__(618));
  12607. const github = __importStar(__webpack_require__(469));
  12608. const path = __importStar(__webpack_require__(622));
  12609. function getInputs() {
  12610. const result = {};
  12611. // GitHub workspace
  12612. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12613. if (!githubWorkspacePath) {
  12614. throw new Error('GITHUB_WORKSPACE not defined');
  12615. }
  12616. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12617. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12618. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12619. // Qualified repository
  12620. const qualifiedRepository = core.getInput('repository') ||
  12621. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12622. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12623. const splitRepository = qualifiedRepository.split('/');
  12624. if (splitRepository.length !== 2 ||
  12625. !splitRepository[0] ||
  12626. !splitRepository[1]) {
  12627. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12628. }
  12629. result.repositoryOwner = splitRepository[0];
  12630. result.repositoryName = splitRepository[1];
  12631. // Repository path
  12632. result.repositoryPath = core.getInput('path') || '.';
  12633. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12634. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12635. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12636. }
  12637. // Workflow repository?
  12638. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12639. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12640. // Source branch, source version
  12641. result.ref = core.getInput('ref');
  12642. if (!result.ref) {
  12643. if (isWorkflowRepository) {
  12644. result.ref = github.context.ref;
  12645. result.commit = github.context.sha;
  12646. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12647. // the ref is unqualifed like "main" instead of "refs/heads/main".
  12648. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12649. result.ref = `refs/heads/${result.ref}`;
  12650. }
  12651. }
  12652. }
  12653. // SHA?
  12654. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12655. result.commit = result.ref;
  12656. result.ref = '';
  12657. }
  12658. core.debug(`ref = '${result.ref}'`);
  12659. core.debug(`commit = '${result.commit}'`);
  12660. // Clean
  12661. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12662. core.debug(`clean = ${result.clean}`);
  12663. // Fetch depth
  12664. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12665. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12666. result.fetchDepth = 0;
  12667. }
  12668. core.debug(`fetch depth = ${result.fetchDepth}`);
  12669. // LFS
  12670. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12671. core.debug(`lfs = ${result.lfs}`);
  12672. // Submodules
  12673. result.submodules = false;
  12674. result.nestedSubmodules = false;
  12675. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12676. if (submodulesString == 'RECURSIVE') {
  12677. result.submodules = true;
  12678. result.nestedSubmodules = true;
  12679. }
  12680. else if (submodulesString == 'TRUE') {
  12681. result.submodules = true;
  12682. }
  12683. core.debug(`submodules = ${result.submodules}`);
  12684. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12685. // Auth token
  12686. result.authToken = core.getInput('token', { required: true });
  12687. // SSH
  12688. result.sshKey = core.getInput('ssh-key');
  12689. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12690. result.sshStrict =
  12691. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12692. // Persist credentials
  12693. result.persistCredentials =
  12694. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12695. return result;
  12696. }
  12697. exports.getInputs = getInputs;
  12698. /***/ }),
  12699. /***/ 826:
  12700. /***/ (function(module, __unusedexports, __webpack_require__) {
  12701. var rng = __webpack_require__(139);
  12702. var bytesToUuid = __webpack_require__(722);
  12703. function v4(options, buf, offset) {
  12704. var i = buf && offset || 0;
  12705. if (typeof(options) == 'string') {
  12706. buf = options === 'binary' ? new Array(16) : null;
  12707. options = null;
  12708. }
  12709. options = options || {};
  12710. var rnds = options.random || (options.rng || rng)();
  12711. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12712. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12713. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12714. // Copy bytes to buffer, if provided
  12715. if (buf) {
  12716. for (var ii = 0; ii < 16; ++ii) {
  12717. buf[i + ii] = rnds[ii];
  12718. }
  12719. }
  12720. return buf || bytesToUuid(rnds);
  12721. }
  12722. module.exports = v4;
  12723. /***/ }),
  12724. /***/ 835:
  12725. /***/ (function(module) {
  12726. module.exports = require("url");
  12727. /***/ }),
  12728. /***/ 842:
  12729. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12730. "use strict";
  12731. Object.defineProperty(exports, '__esModule', { value: true });
  12732. var deprecation = __webpack_require__(692);
  12733. var endpointsByScope = {
  12734. actions: {
  12735. cancelWorkflowRun: {
  12736. method: "POST",
  12737. params: {
  12738. owner: {
  12739. required: true,
  12740. type: "string"
  12741. },
  12742. repo: {
  12743. required: true,
  12744. type: "string"
  12745. },
  12746. run_id: {
  12747. required: true,
  12748. type: "integer"
  12749. }
  12750. },
  12751. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12752. },
  12753. createOrUpdateSecretForRepo: {
  12754. method: "PUT",
  12755. params: {
  12756. encrypted_value: {
  12757. type: "string"
  12758. },
  12759. key_id: {
  12760. type: "string"
  12761. },
  12762. name: {
  12763. required: true,
  12764. type: "string"
  12765. },
  12766. owner: {
  12767. required: true,
  12768. type: "string"
  12769. },
  12770. repo: {
  12771. required: true,
  12772. type: "string"
  12773. }
  12774. },
  12775. url: "/repos/:owner/:repo/actions/secrets/:name"
  12776. },
  12777. createRegistrationToken: {
  12778. method: "POST",
  12779. params: {
  12780. owner: {
  12781. required: true,
  12782. type: "string"
  12783. },
  12784. repo: {
  12785. required: true,
  12786. type: "string"
  12787. }
  12788. },
  12789. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12790. },
  12791. createRemoveToken: {
  12792. method: "POST",
  12793. params: {
  12794. owner: {
  12795. required: true,
  12796. type: "string"
  12797. },
  12798. repo: {
  12799. required: true,
  12800. type: "string"
  12801. }
  12802. },
  12803. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12804. },
  12805. deleteArtifact: {
  12806. method: "DELETE",
  12807. params: {
  12808. artifact_id: {
  12809. required: true,
  12810. type: "integer"
  12811. },
  12812. owner: {
  12813. required: true,
  12814. type: "string"
  12815. },
  12816. repo: {
  12817. required: true,
  12818. type: "string"
  12819. }
  12820. },
  12821. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12822. },
  12823. deleteSecretFromRepo: {
  12824. method: "DELETE",
  12825. params: {
  12826. name: {
  12827. required: true,
  12828. type: "string"
  12829. },
  12830. owner: {
  12831. required: true,
  12832. type: "string"
  12833. },
  12834. repo: {
  12835. required: true,
  12836. type: "string"
  12837. }
  12838. },
  12839. url: "/repos/:owner/:repo/actions/secrets/:name"
  12840. },
  12841. downloadArtifact: {
  12842. method: "GET",
  12843. params: {
  12844. archive_format: {
  12845. required: true,
  12846. type: "string"
  12847. },
  12848. artifact_id: {
  12849. required: true,
  12850. type: "integer"
  12851. },
  12852. owner: {
  12853. required: true,
  12854. type: "string"
  12855. },
  12856. repo: {
  12857. required: true,
  12858. type: "string"
  12859. }
  12860. },
  12861. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12862. },
  12863. getArtifact: {
  12864. method: "GET",
  12865. params: {
  12866. artifact_id: {
  12867. required: true,
  12868. type: "integer"
  12869. },
  12870. owner: {
  12871. required: true,
  12872. type: "string"
  12873. },
  12874. repo: {
  12875. required: true,
  12876. type: "string"
  12877. }
  12878. },
  12879. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12880. },
  12881. getPublicKey: {
  12882. method: "GET",
  12883. params: {
  12884. owner: {
  12885. required: true,
  12886. type: "string"
  12887. },
  12888. repo: {
  12889. required: true,
  12890. type: "string"
  12891. }
  12892. },
  12893. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12894. },
  12895. getSecret: {
  12896. method: "GET",
  12897. params: {
  12898. name: {
  12899. required: true,
  12900. type: "string"
  12901. },
  12902. owner: {
  12903. required: true,
  12904. type: "string"
  12905. },
  12906. page: {
  12907. type: "integer"
  12908. },
  12909. per_page: {
  12910. type: "integer"
  12911. },
  12912. repo: {
  12913. required: true,
  12914. type: "string"
  12915. }
  12916. },
  12917. url: "/repos/:owner/:repo/actions/secrets/:name"
  12918. },
  12919. getSelfHostedRunner: {
  12920. method: "GET",
  12921. params: {
  12922. owner: {
  12923. required: true,
  12924. type: "string"
  12925. },
  12926. repo: {
  12927. required: true,
  12928. type: "string"
  12929. },
  12930. runner_id: {
  12931. required: true,
  12932. type: "integer"
  12933. }
  12934. },
  12935. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12936. },
  12937. getWorkflow: {
  12938. method: "GET",
  12939. params: {
  12940. owner: {
  12941. required: true,
  12942. type: "string"
  12943. },
  12944. repo: {
  12945. required: true,
  12946. type: "string"
  12947. },
  12948. workflow_id: {
  12949. required: true,
  12950. type: "integer"
  12951. }
  12952. },
  12953. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12954. },
  12955. getWorkflowJob: {
  12956. method: "GET",
  12957. params: {
  12958. job_id: {
  12959. required: true,
  12960. type: "integer"
  12961. },
  12962. owner: {
  12963. required: true,
  12964. type: "string"
  12965. },
  12966. repo: {
  12967. required: true,
  12968. type: "string"
  12969. }
  12970. },
  12971. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12972. },
  12973. getWorkflowRun: {
  12974. method: "GET",
  12975. params: {
  12976. owner: {
  12977. required: true,
  12978. type: "string"
  12979. },
  12980. repo: {
  12981. required: true,
  12982. type: "string"
  12983. },
  12984. run_id: {
  12985. required: true,
  12986. type: "integer"
  12987. }
  12988. },
  12989. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12990. },
  12991. listDownloadsForSelfHostedRunnerApplication: {
  12992. method: "GET",
  12993. params: {
  12994. owner: {
  12995. required: true,
  12996. type: "string"
  12997. },
  12998. repo: {
  12999. required: true,
  13000. type: "string"
  13001. }
  13002. },
  13003. url: "/repos/:owner/:repo/actions/runners/downloads"
  13004. },
  13005. listJobsForWorkflowRun: {
  13006. method: "GET",
  13007. params: {
  13008. owner: {
  13009. required: true,
  13010. type: "string"
  13011. },
  13012. page: {
  13013. type: "integer"
  13014. },
  13015. per_page: {
  13016. type: "integer"
  13017. },
  13018. repo: {
  13019. required: true,
  13020. type: "string"
  13021. },
  13022. run_id: {
  13023. required: true,
  13024. type: "integer"
  13025. }
  13026. },
  13027. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  13028. },
  13029. listRepoWorkflowRuns: {
  13030. method: "GET",
  13031. params: {
  13032. actor: {
  13033. type: "string"
  13034. },
  13035. branch: {
  13036. type: "string"
  13037. },
  13038. event: {
  13039. type: "string"
  13040. },
  13041. owner: {
  13042. required: true,
  13043. type: "string"
  13044. },
  13045. page: {
  13046. type: "integer"
  13047. },
  13048. per_page: {
  13049. type: "integer"
  13050. },
  13051. repo: {
  13052. required: true,
  13053. type: "string"
  13054. },
  13055. status: {
  13056. enum: ["completed", "status", "conclusion"],
  13057. type: "string"
  13058. }
  13059. },
  13060. url: "/repos/:owner/:repo/actions/runs"
  13061. },
  13062. listRepoWorkflows: {
  13063. method: "GET",
  13064. params: {
  13065. owner: {
  13066. required: true,
  13067. type: "string"
  13068. },
  13069. page: {
  13070. type: "integer"
  13071. },
  13072. per_page: {
  13073. type: "integer"
  13074. },
  13075. repo: {
  13076. required: true,
  13077. type: "string"
  13078. }
  13079. },
  13080. url: "/repos/:owner/:repo/actions/workflows"
  13081. },
  13082. listSecretsForRepo: {
  13083. method: "GET",
  13084. params: {
  13085. owner: {
  13086. required: true,
  13087. type: "string"
  13088. },
  13089. page: {
  13090. type: "integer"
  13091. },
  13092. per_page: {
  13093. type: "integer"
  13094. },
  13095. repo: {
  13096. required: true,
  13097. type: "string"
  13098. }
  13099. },
  13100. url: "/repos/:owner/:repo/actions/secrets"
  13101. },
  13102. listSelfHostedRunnersForRepo: {
  13103. method: "GET",
  13104. params: {
  13105. owner: {
  13106. required: true,
  13107. type: "string"
  13108. },
  13109. page: {
  13110. type: "integer"
  13111. },
  13112. per_page: {
  13113. type: "integer"
  13114. },
  13115. repo: {
  13116. required: true,
  13117. type: "string"
  13118. }
  13119. },
  13120. url: "/repos/:owner/:repo/actions/runners"
  13121. },
  13122. listWorkflowJobLogs: {
  13123. method: "GET",
  13124. params: {
  13125. job_id: {
  13126. required: true,
  13127. type: "integer"
  13128. },
  13129. owner: {
  13130. required: true,
  13131. type: "string"
  13132. },
  13133. page: {
  13134. type: "integer"
  13135. },
  13136. per_page: {
  13137. type: "integer"
  13138. },
  13139. repo: {
  13140. required: true,
  13141. type: "string"
  13142. }
  13143. },
  13144. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13145. },
  13146. listWorkflowRunArtifacts: {
  13147. method: "GET",
  13148. params: {
  13149. owner: {
  13150. required: true,
  13151. type: "string"
  13152. },
  13153. page: {
  13154. type: "integer"
  13155. },
  13156. per_page: {
  13157. type: "integer"
  13158. },
  13159. repo: {
  13160. required: true,
  13161. type: "string"
  13162. },
  13163. run_id: {
  13164. required: true,
  13165. type: "integer"
  13166. }
  13167. },
  13168. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13169. },
  13170. listWorkflowRunLogs: {
  13171. method: "GET",
  13172. params: {
  13173. owner: {
  13174. required: true,
  13175. type: "string"
  13176. },
  13177. page: {
  13178. type: "integer"
  13179. },
  13180. per_page: {
  13181. type: "integer"
  13182. },
  13183. repo: {
  13184. required: true,
  13185. type: "string"
  13186. },
  13187. run_id: {
  13188. required: true,
  13189. type: "integer"
  13190. }
  13191. },
  13192. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13193. },
  13194. listWorkflowRuns: {
  13195. method: "GET",
  13196. params: {
  13197. actor: {
  13198. type: "string"
  13199. },
  13200. branch: {
  13201. type: "string"
  13202. },
  13203. event: {
  13204. type: "string"
  13205. },
  13206. owner: {
  13207. required: true,
  13208. type: "string"
  13209. },
  13210. page: {
  13211. type: "integer"
  13212. },
  13213. per_page: {
  13214. type: "integer"
  13215. },
  13216. repo: {
  13217. required: true,
  13218. type: "string"
  13219. },
  13220. status: {
  13221. enum: ["completed", "status", "conclusion"],
  13222. type: "string"
  13223. },
  13224. workflow_id: {
  13225. required: true,
  13226. type: "integer"
  13227. }
  13228. },
  13229. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13230. },
  13231. reRunWorkflow: {
  13232. method: "POST",
  13233. params: {
  13234. owner: {
  13235. required: true,
  13236. type: "string"
  13237. },
  13238. repo: {
  13239. required: true,
  13240. type: "string"
  13241. },
  13242. run_id: {
  13243. required: true,
  13244. type: "integer"
  13245. }
  13246. },
  13247. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13248. },
  13249. removeSelfHostedRunner: {
  13250. method: "DELETE",
  13251. params: {
  13252. owner: {
  13253. required: true,
  13254. type: "string"
  13255. },
  13256. repo: {
  13257. required: true,
  13258. type: "string"
  13259. },
  13260. runner_id: {
  13261. required: true,
  13262. type: "integer"
  13263. }
  13264. },
  13265. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13266. }
  13267. },
  13268. activity: {
  13269. checkStarringRepo: {
  13270. method: "GET",
  13271. params: {
  13272. owner: {
  13273. required: true,
  13274. type: "string"
  13275. },
  13276. repo: {
  13277. required: true,
  13278. type: "string"
  13279. }
  13280. },
  13281. url: "/user/starred/:owner/:repo"
  13282. },
  13283. deleteRepoSubscription: {
  13284. method: "DELETE",
  13285. params: {
  13286. owner: {
  13287. required: true,
  13288. type: "string"
  13289. },
  13290. repo: {
  13291. required: true,
  13292. type: "string"
  13293. }
  13294. },
  13295. url: "/repos/:owner/:repo/subscription"
  13296. },
  13297. deleteThreadSubscription: {
  13298. method: "DELETE",
  13299. params: {
  13300. thread_id: {
  13301. required: true,
  13302. type: "integer"
  13303. }
  13304. },
  13305. url: "/notifications/threads/:thread_id/subscription"
  13306. },
  13307. getRepoSubscription: {
  13308. method: "GET",
  13309. params: {
  13310. owner: {
  13311. required: true,
  13312. type: "string"
  13313. },
  13314. repo: {
  13315. required: true,
  13316. type: "string"
  13317. }
  13318. },
  13319. url: "/repos/:owner/:repo/subscription"
  13320. },
  13321. getThread: {
  13322. method: "GET",
  13323. params: {
  13324. thread_id: {
  13325. required: true,
  13326. type: "integer"
  13327. }
  13328. },
  13329. url: "/notifications/threads/:thread_id"
  13330. },
  13331. getThreadSubscription: {
  13332. method: "GET",
  13333. params: {
  13334. thread_id: {
  13335. required: true,
  13336. type: "integer"
  13337. }
  13338. },
  13339. url: "/notifications/threads/:thread_id/subscription"
  13340. },
  13341. listEventsForOrg: {
  13342. method: "GET",
  13343. params: {
  13344. org: {
  13345. required: true,
  13346. type: "string"
  13347. },
  13348. page: {
  13349. type: "integer"
  13350. },
  13351. per_page: {
  13352. type: "integer"
  13353. },
  13354. username: {
  13355. required: true,
  13356. type: "string"
  13357. }
  13358. },
  13359. url: "/users/:username/events/orgs/:org"
  13360. },
  13361. listEventsForUser: {
  13362. method: "GET",
  13363. params: {
  13364. page: {
  13365. type: "integer"
  13366. },
  13367. per_page: {
  13368. type: "integer"
  13369. },
  13370. username: {
  13371. required: true,
  13372. type: "string"
  13373. }
  13374. },
  13375. url: "/users/:username/events"
  13376. },
  13377. listFeeds: {
  13378. method: "GET",
  13379. params: {},
  13380. url: "/feeds"
  13381. },
  13382. listNotifications: {
  13383. method: "GET",
  13384. params: {
  13385. all: {
  13386. type: "boolean"
  13387. },
  13388. before: {
  13389. type: "string"
  13390. },
  13391. page: {
  13392. type: "integer"
  13393. },
  13394. participating: {
  13395. type: "boolean"
  13396. },
  13397. per_page: {
  13398. type: "integer"
  13399. },
  13400. since: {
  13401. type: "string"
  13402. }
  13403. },
  13404. url: "/notifications"
  13405. },
  13406. listNotificationsForRepo: {
  13407. method: "GET",
  13408. params: {
  13409. all: {
  13410. type: "boolean"
  13411. },
  13412. before: {
  13413. type: "string"
  13414. },
  13415. owner: {
  13416. required: true,
  13417. type: "string"
  13418. },
  13419. page: {
  13420. type: "integer"
  13421. },
  13422. participating: {
  13423. type: "boolean"
  13424. },
  13425. per_page: {
  13426. type: "integer"
  13427. },
  13428. repo: {
  13429. required: true,
  13430. type: "string"
  13431. },
  13432. since: {
  13433. type: "string"
  13434. }
  13435. },
  13436. url: "/repos/:owner/:repo/notifications"
  13437. },
  13438. listPublicEvents: {
  13439. method: "GET",
  13440. params: {
  13441. page: {
  13442. type: "integer"
  13443. },
  13444. per_page: {
  13445. type: "integer"
  13446. }
  13447. },
  13448. url: "/events"
  13449. },
  13450. listPublicEventsForOrg: {
  13451. method: "GET",
  13452. params: {
  13453. org: {
  13454. required: true,
  13455. type: "string"
  13456. },
  13457. page: {
  13458. type: "integer"
  13459. },
  13460. per_page: {
  13461. type: "integer"
  13462. }
  13463. },
  13464. url: "/orgs/:org/events"
  13465. },
  13466. listPublicEventsForRepoNetwork: {
  13467. method: "GET",
  13468. params: {
  13469. owner: {
  13470. required: true,
  13471. type: "string"
  13472. },
  13473. page: {
  13474. type: "integer"
  13475. },
  13476. per_page: {
  13477. type: "integer"
  13478. },
  13479. repo: {
  13480. required: true,
  13481. type: "string"
  13482. }
  13483. },
  13484. url: "/networks/:owner/:repo/events"
  13485. },
  13486. listPublicEventsForUser: {
  13487. method: "GET",
  13488. params: {
  13489. page: {
  13490. type: "integer"
  13491. },
  13492. per_page: {
  13493. type: "integer"
  13494. },
  13495. username: {
  13496. required: true,
  13497. type: "string"
  13498. }
  13499. },
  13500. url: "/users/:username/events/public"
  13501. },
  13502. listReceivedEventsForUser: {
  13503. method: "GET",
  13504. params: {
  13505. page: {
  13506. type: "integer"
  13507. },
  13508. per_page: {
  13509. type: "integer"
  13510. },
  13511. username: {
  13512. required: true,
  13513. type: "string"
  13514. }
  13515. },
  13516. url: "/users/:username/received_events"
  13517. },
  13518. listReceivedPublicEventsForUser: {
  13519. method: "GET",
  13520. params: {
  13521. page: {
  13522. type: "integer"
  13523. },
  13524. per_page: {
  13525. type: "integer"
  13526. },
  13527. username: {
  13528. required: true,
  13529. type: "string"
  13530. }
  13531. },
  13532. url: "/users/:username/received_events/public"
  13533. },
  13534. listRepoEvents: {
  13535. method: "GET",
  13536. params: {
  13537. owner: {
  13538. required: true,
  13539. type: "string"
  13540. },
  13541. page: {
  13542. type: "integer"
  13543. },
  13544. per_page: {
  13545. type: "integer"
  13546. },
  13547. repo: {
  13548. required: true,
  13549. type: "string"
  13550. }
  13551. },
  13552. url: "/repos/:owner/:repo/events"
  13553. },
  13554. listReposStarredByAuthenticatedUser: {
  13555. method: "GET",
  13556. params: {
  13557. direction: {
  13558. enum: ["asc", "desc"],
  13559. type: "string"
  13560. },
  13561. page: {
  13562. type: "integer"
  13563. },
  13564. per_page: {
  13565. type: "integer"
  13566. },
  13567. sort: {
  13568. enum: ["created", "updated"],
  13569. type: "string"
  13570. }
  13571. },
  13572. url: "/user/starred"
  13573. },
  13574. listReposStarredByUser: {
  13575. method: "GET",
  13576. params: {
  13577. direction: {
  13578. enum: ["asc", "desc"],
  13579. type: "string"
  13580. },
  13581. page: {
  13582. type: "integer"
  13583. },
  13584. per_page: {
  13585. type: "integer"
  13586. },
  13587. sort: {
  13588. enum: ["created", "updated"],
  13589. type: "string"
  13590. },
  13591. username: {
  13592. required: true,
  13593. type: "string"
  13594. }
  13595. },
  13596. url: "/users/:username/starred"
  13597. },
  13598. listReposWatchedByUser: {
  13599. method: "GET",
  13600. params: {
  13601. page: {
  13602. type: "integer"
  13603. },
  13604. per_page: {
  13605. type: "integer"
  13606. },
  13607. username: {
  13608. required: true,
  13609. type: "string"
  13610. }
  13611. },
  13612. url: "/users/:username/subscriptions"
  13613. },
  13614. listStargazersForRepo: {
  13615. method: "GET",
  13616. params: {
  13617. owner: {
  13618. required: true,
  13619. type: "string"
  13620. },
  13621. page: {
  13622. type: "integer"
  13623. },
  13624. per_page: {
  13625. type: "integer"
  13626. },
  13627. repo: {
  13628. required: true,
  13629. type: "string"
  13630. }
  13631. },
  13632. url: "/repos/:owner/:repo/stargazers"
  13633. },
  13634. listWatchedReposForAuthenticatedUser: {
  13635. method: "GET",
  13636. params: {
  13637. page: {
  13638. type: "integer"
  13639. },
  13640. per_page: {
  13641. type: "integer"
  13642. }
  13643. },
  13644. url: "/user/subscriptions"
  13645. },
  13646. listWatchersForRepo: {
  13647. method: "GET",
  13648. params: {
  13649. owner: {
  13650. required: true,
  13651. type: "string"
  13652. },
  13653. page: {
  13654. type: "integer"
  13655. },
  13656. per_page: {
  13657. type: "integer"
  13658. },
  13659. repo: {
  13660. required: true,
  13661. type: "string"
  13662. }
  13663. },
  13664. url: "/repos/:owner/:repo/subscribers"
  13665. },
  13666. markAsRead: {
  13667. method: "PUT",
  13668. params: {
  13669. last_read_at: {
  13670. type: "string"
  13671. }
  13672. },
  13673. url: "/notifications"
  13674. },
  13675. markNotificationsAsReadForRepo: {
  13676. method: "PUT",
  13677. params: {
  13678. last_read_at: {
  13679. type: "string"
  13680. },
  13681. owner: {
  13682. required: true,
  13683. type: "string"
  13684. },
  13685. repo: {
  13686. required: true,
  13687. type: "string"
  13688. }
  13689. },
  13690. url: "/repos/:owner/:repo/notifications"
  13691. },
  13692. markThreadAsRead: {
  13693. method: "PATCH",
  13694. params: {
  13695. thread_id: {
  13696. required: true,
  13697. type: "integer"
  13698. }
  13699. },
  13700. url: "/notifications/threads/:thread_id"
  13701. },
  13702. setRepoSubscription: {
  13703. method: "PUT",
  13704. params: {
  13705. ignored: {
  13706. type: "boolean"
  13707. },
  13708. owner: {
  13709. required: true,
  13710. type: "string"
  13711. },
  13712. repo: {
  13713. required: true,
  13714. type: "string"
  13715. },
  13716. subscribed: {
  13717. type: "boolean"
  13718. }
  13719. },
  13720. url: "/repos/:owner/:repo/subscription"
  13721. },
  13722. setThreadSubscription: {
  13723. method: "PUT",
  13724. params: {
  13725. ignored: {
  13726. type: "boolean"
  13727. },
  13728. thread_id: {
  13729. required: true,
  13730. type: "integer"
  13731. }
  13732. },
  13733. url: "/notifications/threads/:thread_id/subscription"
  13734. },
  13735. starRepo: {
  13736. method: "PUT",
  13737. params: {
  13738. owner: {
  13739. required: true,
  13740. type: "string"
  13741. },
  13742. repo: {
  13743. required: true,
  13744. type: "string"
  13745. }
  13746. },
  13747. url: "/user/starred/:owner/:repo"
  13748. },
  13749. unstarRepo: {
  13750. method: "DELETE",
  13751. params: {
  13752. owner: {
  13753. required: true,
  13754. type: "string"
  13755. },
  13756. repo: {
  13757. required: true,
  13758. type: "string"
  13759. }
  13760. },
  13761. url: "/user/starred/:owner/:repo"
  13762. }
  13763. },
  13764. apps: {
  13765. addRepoToInstallation: {
  13766. headers: {
  13767. accept: "application/vnd.github.machine-man-preview+json"
  13768. },
  13769. method: "PUT",
  13770. params: {
  13771. installation_id: {
  13772. required: true,
  13773. type: "integer"
  13774. },
  13775. repository_id: {
  13776. required: true,
  13777. type: "integer"
  13778. }
  13779. },
  13780. url: "/user/installations/:installation_id/repositories/:repository_id"
  13781. },
  13782. checkAccountIsAssociatedWithAny: {
  13783. method: "GET",
  13784. params: {
  13785. account_id: {
  13786. required: true,
  13787. type: "integer"
  13788. }
  13789. },
  13790. url: "/marketplace_listing/accounts/:account_id"
  13791. },
  13792. checkAccountIsAssociatedWithAnyStubbed: {
  13793. method: "GET",
  13794. params: {
  13795. account_id: {
  13796. required: true,
  13797. type: "integer"
  13798. }
  13799. },
  13800. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13801. },
  13802. checkAuthorization: {
  13803. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13804. method: "GET",
  13805. params: {
  13806. access_token: {
  13807. required: true,
  13808. type: "string"
  13809. },
  13810. client_id: {
  13811. required: true,
  13812. type: "string"
  13813. }
  13814. },
  13815. url: "/applications/:client_id/tokens/:access_token"
  13816. },
  13817. checkToken: {
  13818. headers: {
  13819. accept: "application/vnd.github.doctor-strange-preview+json"
  13820. },
  13821. method: "POST",
  13822. params: {
  13823. access_token: {
  13824. type: "string"
  13825. },
  13826. client_id: {
  13827. required: true,
  13828. type: "string"
  13829. }
  13830. },
  13831. url: "/applications/:client_id/token"
  13832. },
  13833. createContentAttachment: {
  13834. headers: {
  13835. accept: "application/vnd.github.corsair-preview+json"
  13836. },
  13837. method: "POST",
  13838. params: {
  13839. body: {
  13840. required: true,
  13841. type: "string"
  13842. },
  13843. content_reference_id: {
  13844. required: true,
  13845. type: "integer"
  13846. },
  13847. title: {
  13848. required: true,
  13849. type: "string"
  13850. }
  13851. },
  13852. url: "/content_references/:content_reference_id/attachments"
  13853. },
  13854. createFromManifest: {
  13855. headers: {
  13856. accept: "application/vnd.github.fury-preview+json"
  13857. },
  13858. method: "POST",
  13859. params: {
  13860. code: {
  13861. required: true,
  13862. type: "string"
  13863. }
  13864. },
  13865. url: "/app-manifests/:code/conversions"
  13866. },
  13867. createInstallationToken: {
  13868. headers: {
  13869. accept: "application/vnd.github.machine-man-preview+json"
  13870. },
  13871. method: "POST",
  13872. params: {
  13873. installation_id: {
  13874. required: true,
  13875. type: "integer"
  13876. },
  13877. permissions: {
  13878. type: "object"
  13879. },
  13880. repository_ids: {
  13881. type: "integer[]"
  13882. }
  13883. },
  13884. url: "/app/installations/:installation_id/access_tokens"
  13885. },
  13886. deleteAuthorization: {
  13887. headers: {
  13888. accept: "application/vnd.github.doctor-strange-preview+json"
  13889. },
  13890. method: "DELETE",
  13891. params: {
  13892. access_token: {
  13893. type: "string"
  13894. },
  13895. client_id: {
  13896. required: true,
  13897. type: "string"
  13898. }
  13899. },
  13900. url: "/applications/:client_id/grant"
  13901. },
  13902. deleteInstallation: {
  13903. headers: {
  13904. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13905. },
  13906. method: "DELETE",
  13907. params: {
  13908. installation_id: {
  13909. required: true,
  13910. type: "integer"
  13911. }
  13912. },
  13913. url: "/app/installations/:installation_id"
  13914. },
  13915. deleteToken: {
  13916. headers: {
  13917. accept: "application/vnd.github.doctor-strange-preview+json"
  13918. },
  13919. method: "DELETE",
  13920. params: {
  13921. access_token: {
  13922. type: "string"
  13923. },
  13924. client_id: {
  13925. required: true,
  13926. type: "string"
  13927. }
  13928. },
  13929. url: "/applications/:client_id/token"
  13930. },
  13931. findOrgInstallation: {
  13932. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13933. headers: {
  13934. accept: "application/vnd.github.machine-man-preview+json"
  13935. },
  13936. method: "GET",
  13937. params: {
  13938. org: {
  13939. required: true,
  13940. type: "string"
  13941. }
  13942. },
  13943. url: "/orgs/:org/installation"
  13944. },
  13945. findRepoInstallation: {
  13946. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13947. headers: {
  13948. accept: "application/vnd.github.machine-man-preview+json"
  13949. },
  13950. method: "GET",
  13951. params: {
  13952. owner: {
  13953. required: true,
  13954. type: "string"
  13955. },
  13956. repo: {
  13957. required: true,
  13958. type: "string"
  13959. }
  13960. },
  13961. url: "/repos/:owner/:repo/installation"
  13962. },
  13963. findUserInstallation: {
  13964. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13965. headers: {
  13966. accept: "application/vnd.github.machine-man-preview+json"
  13967. },
  13968. method: "GET",
  13969. params: {
  13970. username: {
  13971. required: true,
  13972. type: "string"
  13973. }
  13974. },
  13975. url: "/users/:username/installation"
  13976. },
  13977. getAuthenticated: {
  13978. headers: {
  13979. accept: "application/vnd.github.machine-man-preview+json"
  13980. },
  13981. method: "GET",
  13982. params: {},
  13983. url: "/app"
  13984. },
  13985. getBySlug: {
  13986. headers: {
  13987. accept: "application/vnd.github.machine-man-preview+json"
  13988. },
  13989. method: "GET",
  13990. params: {
  13991. app_slug: {
  13992. required: true,
  13993. type: "string"
  13994. }
  13995. },
  13996. url: "/apps/:app_slug"
  13997. },
  13998. getInstallation: {
  13999. headers: {
  14000. accept: "application/vnd.github.machine-man-preview+json"
  14001. },
  14002. method: "GET",
  14003. params: {
  14004. installation_id: {
  14005. required: true,
  14006. type: "integer"
  14007. }
  14008. },
  14009. url: "/app/installations/:installation_id"
  14010. },
  14011. getOrgInstallation: {
  14012. headers: {
  14013. accept: "application/vnd.github.machine-man-preview+json"
  14014. },
  14015. method: "GET",
  14016. params: {
  14017. org: {
  14018. required: true,
  14019. type: "string"
  14020. }
  14021. },
  14022. url: "/orgs/:org/installation"
  14023. },
  14024. getRepoInstallation: {
  14025. headers: {
  14026. accept: "application/vnd.github.machine-man-preview+json"
  14027. },
  14028. method: "GET",
  14029. params: {
  14030. owner: {
  14031. required: true,
  14032. type: "string"
  14033. },
  14034. repo: {
  14035. required: true,
  14036. type: "string"
  14037. }
  14038. },
  14039. url: "/repos/:owner/:repo/installation"
  14040. },
  14041. getUserInstallation: {
  14042. headers: {
  14043. accept: "application/vnd.github.machine-man-preview+json"
  14044. },
  14045. method: "GET",
  14046. params: {
  14047. username: {
  14048. required: true,
  14049. type: "string"
  14050. }
  14051. },
  14052. url: "/users/:username/installation"
  14053. },
  14054. listAccountsUserOrOrgOnPlan: {
  14055. method: "GET",
  14056. params: {
  14057. direction: {
  14058. enum: ["asc", "desc"],
  14059. type: "string"
  14060. },
  14061. page: {
  14062. type: "integer"
  14063. },
  14064. per_page: {
  14065. type: "integer"
  14066. },
  14067. plan_id: {
  14068. required: true,
  14069. type: "integer"
  14070. },
  14071. sort: {
  14072. enum: ["created", "updated"],
  14073. type: "string"
  14074. }
  14075. },
  14076. url: "/marketplace_listing/plans/:plan_id/accounts"
  14077. },
  14078. listAccountsUserOrOrgOnPlanStubbed: {
  14079. method: "GET",
  14080. params: {
  14081. direction: {
  14082. enum: ["asc", "desc"],
  14083. type: "string"
  14084. },
  14085. page: {
  14086. type: "integer"
  14087. },
  14088. per_page: {
  14089. type: "integer"
  14090. },
  14091. plan_id: {
  14092. required: true,
  14093. type: "integer"
  14094. },
  14095. sort: {
  14096. enum: ["created", "updated"],
  14097. type: "string"
  14098. }
  14099. },
  14100. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14101. },
  14102. listInstallationReposForAuthenticatedUser: {
  14103. headers: {
  14104. accept: "application/vnd.github.machine-man-preview+json"
  14105. },
  14106. method: "GET",
  14107. params: {
  14108. installation_id: {
  14109. required: true,
  14110. type: "integer"
  14111. },
  14112. page: {
  14113. type: "integer"
  14114. },
  14115. per_page: {
  14116. type: "integer"
  14117. }
  14118. },
  14119. url: "/user/installations/:installation_id/repositories"
  14120. },
  14121. listInstallations: {
  14122. headers: {
  14123. accept: "application/vnd.github.machine-man-preview+json"
  14124. },
  14125. method: "GET",
  14126. params: {
  14127. page: {
  14128. type: "integer"
  14129. },
  14130. per_page: {
  14131. type: "integer"
  14132. }
  14133. },
  14134. url: "/app/installations"
  14135. },
  14136. listInstallationsForAuthenticatedUser: {
  14137. headers: {
  14138. accept: "application/vnd.github.machine-man-preview+json"
  14139. },
  14140. method: "GET",
  14141. params: {
  14142. page: {
  14143. type: "integer"
  14144. },
  14145. per_page: {
  14146. type: "integer"
  14147. }
  14148. },
  14149. url: "/user/installations"
  14150. },
  14151. listMarketplacePurchasesForAuthenticatedUser: {
  14152. method: "GET",
  14153. params: {
  14154. page: {
  14155. type: "integer"
  14156. },
  14157. per_page: {
  14158. type: "integer"
  14159. }
  14160. },
  14161. url: "/user/marketplace_purchases"
  14162. },
  14163. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14164. method: "GET",
  14165. params: {
  14166. page: {
  14167. type: "integer"
  14168. },
  14169. per_page: {
  14170. type: "integer"
  14171. }
  14172. },
  14173. url: "/user/marketplace_purchases/stubbed"
  14174. },
  14175. listPlans: {
  14176. method: "GET",
  14177. params: {
  14178. page: {
  14179. type: "integer"
  14180. },
  14181. per_page: {
  14182. type: "integer"
  14183. }
  14184. },
  14185. url: "/marketplace_listing/plans"
  14186. },
  14187. listPlansStubbed: {
  14188. method: "GET",
  14189. params: {
  14190. page: {
  14191. type: "integer"
  14192. },
  14193. per_page: {
  14194. type: "integer"
  14195. }
  14196. },
  14197. url: "/marketplace_listing/stubbed/plans"
  14198. },
  14199. listRepos: {
  14200. headers: {
  14201. accept: "application/vnd.github.machine-man-preview+json"
  14202. },
  14203. method: "GET",
  14204. params: {
  14205. page: {
  14206. type: "integer"
  14207. },
  14208. per_page: {
  14209. type: "integer"
  14210. }
  14211. },
  14212. url: "/installation/repositories"
  14213. },
  14214. removeRepoFromInstallation: {
  14215. headers: {
  14216. accept: "application/vnd.github.machine-man-preview+json"
  14217. },
  14218. method: "DELETE",
  14219. params: {
  14220. installation_id: {
  14221. required: true,
  14222. type: "integer"
  14223. },
  14224. repository_id: {
  14225. required: true,
  14226. type: "integer"
  14227. }
  14228. },
  14229. url: "/user/installations/:installation_id/repositories/:repository_id"
  14230. },
  14231. resetAuthorization: {
  14232. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14233. method: "POST",
  14234. params: {
  14235. access_token: {
  14236. required: true,
  14237. type: "string"
  14238. },
  14239. client_id: {
  14240. required: true,
  14241. type: "string"
  14242. }
  14243. },
  14244. url: "/applications/:client_id/tokens/:access_token"
  14245. },
  14246. resetToken: {
  14247. headers: {
  14248. accept: "application/vnd.github.doctor-strange-preview+json"
  14249. },
  14250. method: "PATCH",
  14251. params: {
  14252. access_token: {
  14253. type: "string"
  14254. },
  14255. client_id: {
  14256. required: true,
  14257. type: "string"
  14258. }
  14259. },
  14260. url: "/applications/:client_id/token"
  14261. },
  14262. revokeAuthorizationForApplication: {
  14263. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14264. method: "DELETE",
  14265. params: {
  14266. access_token: {
  14267. required: true,
  14268. type: "string"
  14269. },
  14270. client_id: {
  14271. required: true,
  14272. type: "string"
  14273. }
  14274. },
  14275. url: "/applications/:client_id/tokens/:access_token"
  14276. },
  14277. revokeGrantForApplication: {
  14278. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14279. method: "DELETE",
  14280. params: {
  14281. access_token: {
  14282. required: true,
  14283. type: "string"
  14284. },
  14285. client_id: {
  14286. required: true,
  14287. type: "string"
  14288. }
  14289. },
  14290. url: "/applications/:client_id/grants/:access_token"
  14291. },
  14292. revokeInstallationToken: {
  14293. headers: {
  14294. accept: "application/vnd.github.gambit-preview+json"
  14295. },
  14296. method: "DELETE",
  14297. params: {},
  14298. url: "/installation/token"
  14299. }
  14300. },
  14301. checks: {
  14302. create: {
  14303. headers: {
  14304. accept: "application/vnd.github.antiope-preview+json"
  14305. },
  14306. method: "POST",
  14307. params: {
  14308. actions: {
  14309. type: "object[]"
  14310. },
  14311. "actions[].description": {
  14312. required: true,
  14313. type: "string"
  14314. },
  14315. "actions[].identifier": {
  14316. required: true,
  14317. type: "string"
  14318. },
  14319. "actions[].label": {
  14320. required: true,
  14321. type: "string"
  14322. },
  14323. completed_at: {
  14324. type: "string"
  14325. },
  14326. conclusion: {
  14327. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14328. type: "string"
  14329. },
  14330. details_url: {
  14331. type: "string"
  14332. },
  14333. external_id: {
  14334. type: "string"
  14335. },
  14336. head_sha: {
  14337. required: true,
  14338. type: "string"
  14339. },
  14340. name: {
  14341. required: true,
  14342. type: "string"
  14343. },
  14344. output: {
  14345. type: "object"
  14346. },
  14347. "output.annotations": {
  14348. type: "object[]"
  14349. },
  14350. "output.annotations[].annotation_level": {
  14351. enum: ["notice", "warning", "failure"],
  14352. required: true,
  14353. type: "string"
  14354. },
  14355. "output.annotations[].end_column": {
  14356. type: "integer"
  14357. },
  14358. "output.annotations[].end_line": {
  14359. required: true,
  14360. type: "integer"
  14361. },
  14362. "output.annotations[].message": {
  14363. required: true,
  14364. type: "string"
  14365. },
  14366. "output.annotations[].path": {
  14367. required: true,
  14368. type: "string"
  14369. },
  14370. "output.annotations[].raw_details": {
  14371. type: "string"
  14372. },
  14373. "output.annotations[].start_column": {
  14374. type: "integer"
  14375. },
  14376. "output.annotations[].start_line": {
  14377. required: true,
  14378. type: "integer"
  14379. },
  14380. "output.annotations[].title": {
  14381. type: "string"
  14382. },
  14383. "output.images": {
  14384. type: "object[]"
  14385. },
  14386. "output.images[].alt": {
  14387. required: true,
  14388. type: "string"
  14389. },
  14390. "output.images[].caption": {
  14391. type: "string"
  14392. },
  14393. "output.images[].image_url": {
  14394. required: true,
  14395. type: "string"
  14396. },
  14397. "output.summary": {
  14398. required: true,
  14399. type: "string"
  14400. },
  14401. "output.text": {
  14402. type: "string"
  14403. },
  14404. "output.title": {
  14405. required: true,
  14406. type: "string"
  14407. },
  14408. owner: {
  14409. required: true,
  14410. type: "string"
  14411. },
  14412. repo: {
  14413. required: true,
  14414. type: "string"
  14415. },
  14416. started_at: {
  14417. type: "string"
  14418. },
  14419. status: {
  14420. enum: ["queued", "in_progress", "completed"],
  14421. type: "string"
  14422. }
  14423. },
  14424. url: "/repos/:owner/:repo/check-runs"
  14425. },
  14426. createSuite: {
  14427. headers: {
  14428. accept: "application/vnd.github.antiope-preview+json"
  14429. },
  14430. method: "POST",
  14431. params: {
  14432. head_sha: {
  14433. required: true,
  14434. type: "string"
  14435. },
  14436. owner: {
  14437. required: true,
  14438. type: "string"
  14439. },
  14440. repo: {
  14441. required: true,
  14442. type: "string"
  14443. }
  14444. },
  14445. url: "/repos/:owner/:repo/check-suites"
  14446. },
  14447. get: {
  14448. headers: {
  14449. accept: "application/vnd.github.antiope-preview+json"
  14450. },
  14451. method: "GET",
  14452. params: {
  14453. check_run_id: {
  14454. required: true,
  14455. type: "integer"
  14456. },
  14457. owner: {
  14458. required: true,
  14459. type: "string"
  14460. },
  14461. repo: {
  14462. required: true,
  14463. type: "string"
  14464. }
  14465. },
  14466. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14467. },
  14468. getSuite: {
  14469. headers: {
  14470. accept: "application/vnd.github.antiope-preview+json"
  14471. },
  14472. method: "GET",
  14473. params: {
  14474. check_suite_id: {
  14475. required: true,
  14476. type: "integer"
  14477. },
  14478. owner: {
  14479. required: true,
  14480. type: "string"
  14481. },
  14482. repo: {
  14483. required: true,
  14484. type: "string"
  14485. }
  14486. },
  14487. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14488. },
  14489. listAnnotations: {
  14490. headers: {
  14491. accept: "application/vnd.github.antiope-preview+json"
  14492. },
  14493. method: "GET",
  14494. params: {
  14495. check_run_id: {
  14496. required: true,
  14497. type: "integer"
  14498. },
  14499. owner: {
  14500. required: true,
  14501. type: "string"
  14502. },
  14503. page: {
  14504. type: "integer"
  14505. },
  14506. per_page: {
  14507. type: "integer"
  14508. },
  14509. repo: {
  14510. required: true,
  14511. type: "string"
  14512. }
  14513. },
  14514. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14515. },
  14516. listForRef: {
  14517. headers: {
  14518. accept: "application/vnd.github.antiope-preview+json"
  14519. },
  14520. method: "GET",
  14521. params: {
  14522. check_name: {
  14523. type: "string"
  14524. },
  14525. filter: {
  14526. enum: ["latest", "all"],
  14527. type: "string"
  14528. },
  14529. owner: {
  14530. required: true,
  14531. type: "string"
  14532. },
  14533. page: {
  14534. type: "integer"
  14535. },
  14536. per_page: {
  14537. type: "integer"
  14538. },
  14539. ref: {
  14540. required: true,
  14541. type: "string"
  14542. },
  14543. repo: {
  14544. required: true,
  14545. type: "string"
  14546. },
  14547. status: {
  14548. enum: ["queued", "in_progress", "completed"],
  14549. type: "string"
  14550. }
  14551. },
  14552. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14553. },
  14554. listForSuite: {
  14555. headers: {
  14556. accept: "application/vnd.github.antiope-preview+json"
  14557. },
  14558. method: "GET",
  14559. params: {
  14560. check_name: {
  14561. type: "string"
  14562. },
  14563. check_suite_id: {
  14564. required: true,
  14565. type: "integer"
  14566. },
  14567. filter: {
  14568. enum: ["latest", "all"],
  14569. type: "string"
  14570. },
  14571. owner: {
  14572. required: true,
  14573. type: "string"
  14574. },
  14575. page: {
  14576. type: "integer"
  14577. },
  14578. per_page: {
  14579. type: "integer"
  14580. },
  14581. repo: {
  14582. required: true,
  14583. type: "string"
  14584. },
  14585. status: {
  14586. enum: ["queued", "in_progress", "completed"],
  14587. type: "string"
  14588. }
  14589. },
  14590. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14591. },
  14592. listSuitesForRef: {
  14593. headers: {
  14594. accept: "application/vnd.github.antiope-preview+json"
  14595. },
  14596. method: "GET",
  14597. params: {
  14598. app_id: {
  14599. type: "integer"
  14600. },
  14601. check_name: {
  14602. type: "string"
  14603. },
  14604. owner: {
  14605. required: true,
  14606. type: "string"
  14607. },
  14608. page: {
  14609. type: "integer"
  14610. },
  14611. per_page: {
  14612. type: "integer"
  14613. },
  14614. ref: {
  14615. required: true,
  14616. type: "string"
  14617. },
  14618. repo: {
  14619. required: true,
  14620. type: "string"
  14621. }
  14622. },
  14623. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14624. },
  14625. rerequestSuite: {
  14626. headers: {
  14627. accept: "application/vnd.github.antiope-preview+json"
  14628. },
  14629. method: "POST",
  14630. params: {
  14631. check_suite_id: {
  14632. required: true,
  14633. type: "integer"
  14634. },
  14635. owner: {
  14636. required: true,
  14637. type: "string"
  14638. },
  14639. repo: {
  14640. required: true,
  14641. type: "string"
  14642. }
  14643. },
  14644. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14645. },
  14646. setSuitesPreferences: {
  14647. headers: {
  14648. accept: "application/vnd.github.antiope-preview+json"
  14649. },
  14650. method: "PATCH",
  14651. params: {
  14652. auto_trigger_checks: {
  14653. type: "object[]"
  14654. },
  14655. "auto_trigger_checks[].app_id": {
  14656. required: true,
  14657. type: "integer"
  14658. },
  14659. "auto_trigger_checks[].setting": {
  14660. required: true,
  14661. type: "boolean"
  14662. },
  14663. owner: {
  14664. required: true,
  14665. type: "string"
  14666. },
  14667. repo: {
  14668. required: true,
  14669. type: "string"
  14670. }
  14671. },
  14672. url: "/repos/:owner/:repo/check-suites/preferences"
  14673. },
  14674. update: {
  14675. headers: {
  14676. accept: "application/vnd.github.antiope-preview+json"
  14677. },
  14678. method: "PATCH",
  14679. params: {
  14680. actions: {
  14681. type: "object[]"
  14682. },
  14683. "actions[].description": {
  14684. required: true,
  14685. type: "string"
  14686. },
  14687. "actions[].identifier": {
  14688. required: true,
  14689. type: "string"
  14690. },
  14691. "actions[].label": {
  14692. required: true,
  14693. type: "string"
  14694. },
  14695. check_run_id: {
  14696. required: true,
  14697. type: "integer"
  14698. },
  14699. completed_at: {
  14700. type: "string"
  14701. },
  14702. conclusion: {
  14703. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14704. type: "string"
  14705. },
  14706. details_url: {
  14707. type: "string"
  14708. },
  14709. external_id: {
  14710. type: "string"
  14711. },
  14712. name: {
  14713. type: "string"
  14714. },
  14715. output: {
  14716. type: "object"
  14717. },
  14718. "output.annotations": {
  14719. type: "object[]"
  14720. },
  14721. "output.annotations[].annotation_level": {
  14722. enum: ["notice", "warning", "failure"],
  14723. required: true,
  14724. type: "string"
  14725. },
  14726. "output.annotations[].end_column": {
  14727. type: "integer"
  14728. },
  14729. "output.annotations[].end_line": {
  14730. required: true,
  14731. type: "integer"
  14732. },
  14733. "output.annotations[].message": {
  14734. required: true,
  14735. type: "string"
  14736. },
  14737. "output.annotations[].path": {
  14738. required: true,
  14739. type: "string"
  14740. },
  14741. "output.annotations[].raw_details": {
  14742. type: "string"
  14743. },
  14744. "output.annotations[].start_column": {
  14745. type: "integer"
  14746. },
  14747. "output.annotations[].start_line": {
  14748. required: true,
  14749. type: "integer"
  14750. },
  14751. "output.annotations[].title": {
  14752. type: "string"
  14753. },
  14754. "output.images": {
  14755. type: "object[]"
  14756. },
  14757. "output.images[].alt": {
  14758. required: true,
  14759. type: "string"
  14760. },
  14761. "output.images[].caption": {
  14762. type: "string"
  14763. },
  14764. "output.images[].image_url": {
  14765. required: true,
  14766. type: "string"
  14767. },
  14768. "output.summary": {
  14769. required: true,
  14770. type: "string"
  14771. },
  14772. "output.text": {
  14773. type: "string"
  14774. },
  14775. "output.title": {
  14776. type: "string"
  14777. },
  14778. owner: {
  14779. required: true,
  14780. type: "string"
  14781. },
  14782. repo: {
  14783. required: true,
  14784. type: "string"
  14785. },
  14786. started_at: {
  14787. type: "string"
  14788. },
  14789. status: {
  14790. enum: ["queued", "in_progress", "completed"],
  14791. type: "string"
  14792. }
  14793. },
  14794. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14795. }
  14796. },
  14797. codesOfConduct: {
  14798. getConductCode: {
  14799. headers: {
  14800. accept: "application/vnd.github.scarlet-witch-preview+json"
  14801. },
  14802. method: "GET",
  14803. params: {
  14804. key: {
  14805. required: true,
  14806. type: "string"
  14807. }
  14808. },
  14809. url: "/codes_of_conduct/:key"
  14810. },
  14811. getForRepo: {
  14812. headers: {
  14813. accept: "application/vnd.github.scarlet-witch-preview+json"
  14814. },
  14815. method: "GET",
  14816. params: {
  14817. owner: {
  14818. required: true,
  14819. type: "string"
  14820. },
  14821. repo: {
  14822. required: true,
  14823. type: "string"
  14824. }
  14825. },
  14826. url: "/repos/:owner/:repo/community/code_of_conduct"
  14827. },
  14828. listConductCodes: {
  14829. headers: {
  14830. accept: "application/vnd.github.scarlet-witch-preview+json"
  14831. },
  14832. method: "GET",
  14833. params: {},
  14834. url: "/codes_of_conduct"
  14835. }
  14836. },
  14837. emojis: {
  14838. get: {
  14839. method: "GET",
  14840. params: {},
  14841. url: "/emojis"
  14842. }
  14843. },
  14844. gists: {
  14845. checkIsStarred: {
  14846. method: "GET",
  14847. params: {
  14848. gist_id: {
  14849. required: true,
  14850. type: "string"
  14851. }
  14852. },
  14853. url: "/gists/:gist_id/star"
  14854. },
  14855. create: {
  14856. method: "POST",
  14857. params: {
  14858. description: {
  14859. type: "string"
  14860. },
  14861. files: {
  14862. required: true,
  14863. type: "object"
  14864. },
  14865. "files.content": {
  14866. type: "string"
  14867. },
  14868. public: {
  14869. type: "boolean"
  14870. }
  14871. },
  14872. url: "/gists"
  14873. },
  14874. createComment: {
  14875. method: "POST",
  14876. params: {
  14877. body: {
  14878. required: true,
  14879. type: "string"
  14880. },
  14881. gist_id: {
  14882. required: true,
  14883. type: "string"
  14884. }
  14885. },
  14886. url: "/gists/:gist_id/comments"
  14887. },
  14888. delete: {
  14889. method: "DELETE",
  14890. params: {
  14891. gist_id: {
  14892. required: true,
  14893. type: "string"
  14894. }
  14895. },
  14896. url: "/gists/:gist_id"
  14897. },
  14898. deleteComment: {
  14899. method: "DELETE",
  14900. params: {
  14901. comment_id: {
  14902. required: true,
  14903. type: "integer"
  14904. },
  14905. gist_id: {
  14906. required: true,
  14907. type: "string"
  14908. }
  14909. },
  14910. url: "/gists/:gist_id/comments/:comment_id"
  14911. },
  14912. fork: {
  14913. method: "POST",
  14914. params: {
  14915. gist_id: {
  14916. required: true,
  14917. type: "string"
  14918. }
  14919. },
  14920. url: "/gists/:gist_id/forks"
  14921. },
  14922. get: {
  14923. method: "GET",
  14924. params: {
  14925. gist_id: {
  14926. required: true,
  14927. type: "string"
  14928. }
  14929. },
  14930. url: "/gists/:gist_id"
  14931. },
  14932. getComment: {
  14933. method: "GET",
  14934. params: {
  14935. comment_id: {
  14936. required: true,
  14937. type: "integer"
  14938. },
  14939. gist_id: {
  14940. required: true,
  14941. type: "string"
  14942. }
  14943. },
  14944. url: "/gists/:gist_id/comments/:comment_id"
  14945. },
  14946. getRevision: {
  14947. method: "GET",
  14948. params: {
  14949. gist_id: {
  14950. required: true,
  14951. type: "string"
  14952. },
  14953. sha: {
  14954. required: true,
  14955. type: "string"
  14956. }
  14957. },
  14958. url: "/gists/:gist_id/:sha"
  14959. },
  14960. list: {
  14961. method: "GET",
  14962. params: {
  14963. page: {
  14964. type: "integer"
  14965. },
  14966. per_page: {
  14967. type: "integer"
  14968. },
  14969. since: {
  14970. type: "string"
  14971. }
  14972. },
  14973. url: "/gists"
  14974. },
  14975. listComments: {
  14976. method: "GET",
  14977. params: {
  14978. gist_id: {
  14979. required: true,
  14980. type: "string"
  14981. },
  14982. page: {
  14983. type: "integer"
  14984. },
  14985. per_page: {
  14986. type: "integer"
  14987. }
  14988. },
  14989. url: "/gists/:gist_id/comments"
  14990. },
  14991. listCommits: {
  14992. method: "GET",
  14993. params: {
  14994. gist_id: {
  14995. required: true,
  14996. type: "string"
  14997. },
  14998. page: {
  14999. type: "integer"
  15000. },
  15001. per_page: {
  15002. type: "integer"
  15003. }
  15004. },
  15005. url: "/gists/:gist_id/commits"
  15006. },
  15007. listForks: {
  15008. method: "GET",
  15009. params: {
  15010. gist_id: {
  15011. required: true,
  15012. type: "string"
  15013. },
  15014. page: {
  15015. type: "integer"
  15016. },
  15017. per_page: {
  15018. type: "integer"
  15019. }
  15020. },
  15021. url: "/gists/:gist_id/forks"
  15022. },
  15023. listPublic: {
  15024. method: "GET",
  15025. params: {
  15026. page: {
  15027. type: "integer"
  15028. },
  15029. per_page: {
  15030. type: "integer"
  15031. },
  15032. since: {
  15033. type: "string"
  15034. }
  15035. },
  15036. url: "/gists/public"
  15037. },
  15038. listPublicForUser: {
  15039. method: "GET",
  15040. params: {
  15041. page: {
  15042. type: "integer"
  15043. },
  15044. per_page: {
  15045. type: "integer"
  15046. },
  15047. since: {
  15048. type: "string"
  15049. },
  15050. username: {
  15051. required: true,
  15052. type: "string"
  15053. }
  15054. },
  15055. url: "/users/:username/gists"
  15056. },
  15057. listStarred: {
  15058. method: "GET",
  15059. params: {
  15060. page: {
  15061. type: "integer"
  15062. },
  15063. per_page: {
  15064. type: "integer"
  15065. },
  15066. since: {
  15067. type: "string"
  15068. }
  15069. },
  15070. url: "/gists/starred"
  15071. },
  15072. star: {
  15073. method: "PUT",
  15074. params: {
  15075. gist_id: {
  15076. required: true,
  15077. type: "string"
  15078. }
  15079. },
  15080. url: "/gists/:gist_id/star"
  15081. },
  15082. unstar: {
  15083. method: "DELETE",
  15084. params: {
  15085. gist_id: {
  15086. required: true,
  15087. type: "string"
  15088. }
  15089. },
  15090. url: "/gists/:gist_id/star"
  15091. },
  15092. update: {
  15093. method: "PATCH",
  15094. params: {
  15095. description: {
  15096. type: "string"
  15097. },
  15098. files: {
  15099. type: "object"
  15100. },
  15101. "files.content": {
  15102. type: "string"
  15103. },
  15104. "files.filename": {
  15105. type: "string"
  15106. },
  15107. gist_id: {
  15108. required: true,
  15109. type: "string"
  15110. }
  15111. },
  15112. url: "/gists/:gist_id"
  15113. },
  15114. updateComment: {
  15115. method: "PATCH",
  15116. params: {
  15117. body: {
  15118. required: true,
  15119. type: "string"
  15120. },
  15121. comment_id: {
  15122. required: true,
  15123. type: "integer"
  15124. },
  15125. gist_id: {
  15126. required: true,
  15127. type: "string"
  15128. }
  15129. },
  15130. url: "/gists/:gist_id/comments/:comment_id"
  15131. }
  15132. },
  15133. git: {
  15134. createBlob: {
  15135. method: "POST",
  15136. params: {
  15137. content: {
  15138. required: true,
  15139. type: "string"
  15140. },
  15141. encoding: {
  15142. type: "string"
  15143. },
  15144. owner: {
  15145. required: true,
  15146. type: "string"
  15147. },
  15148. repo: {
  15149. required: true,
  15150. type: "string"
  15151. }
  15152. },
  15153. url: "/repos/:owner/:repo/git/blobs"
  15154. },
  15155. createCommit: {
  15156. method: "POST",
  15157. params: {
  15158. author: {
  15159. type: "object"
  15160. },
  15161. "author.date": {
  15162. type: "string"
  15163. },
  15164. "author.email": {
  15165. type: "string"
  15166. },
  15167. "author.name": {
  15168. type: "string"
  15169. },
  15170. committer: {
  15171. type: "object"
  15172. },
  15173. "committer.date": {
  15174. type: "string"
  15175. },
  15176. "committer.email": {
  15177. type: "string"
  15178. },
  15179. "committer.name": {
  15180. type: "string"
  15181. },
  15182. message: {
  15183. required: true,
  15184. type: "string"
  15185. },
  15186. owner: {
  15187. required: true,
  15188. type: "string"
  15189. },
  15190. parents: {
  15191. required: true,
  15192. type: "string[]"
  15193. },
  15194. repo: {
  15195. required: true,
  15196. type: "string"
  15197. },
  15198. signature: {
  15199. type: "string"
  15200. },
  15201. tree: {
  15202. required: true,
  15203. type: "string"
  15204. }
  15205. },
  15206. url: "/repos/:owner/:repo/git/commits"
  15207. },
  15208. createRef: {
  15209. method: "POST",
  15210. params: {
  15211. owner: {
  15212. required: true,
  15213. type: "string"
  15214. },
  15215. ref: {
  15216. required: true,
  15217. type: "string"
  15218. },
  15219. repo: {
  15220. required: true,
  15221. type: "string"
  15222. },
  15223. sha: {
  15224. required: true,
  15225. type: "string"
  15226. }
  15227. },
  15228. url: "/repos/:owner/:repo/git/refs"
  15229. },
  15230. createTag: {
  15231. method: "POST",
  15232. params: {
  15233. message: {
  15234. required: true,
  15235. type: "string"
  15236. },
  15237. object: {
  15238. required: true,
  15239. type: "string"
  15240. },
  15241. owner: {
  15242. required: true,
  15243. type: "string"
  15244. },
  15245. repo: {
  15246. required: true,
  15247. type: "string"
  15248. },
  15249. tag: {
  15250. required: true,
  15251. type: "string"
  15252. },
  15253. tagger: {
  15254. type: "object"
  15255. },
  15256. "tagger.date": {
  15257. type: "string"
  15258. },
  15259. "tagger.email": {
  15260. type: "string"
  15261. },
  15262. "tagger.name": {
  15263. type: "string"
  15264. },
  15265. type: {
  15266. enum: ["commit", "tree", "blob"],
  15267. required: true,
  15268. type: "string"
  15269. }
  15270. },
  15271. url: "/repos/:owner/:repo/git/tags"
  15272. },
  15273. createTree: {
  15274. method: "POST",
  15275. params: {
  15276. base_tree: {
  15277. type: "string"
  15278. },
  15279. owner: {
  15280. required: true,
  15281. type: "string"
  15282. },
  15283. repo: {
  15284. required: true,
  15285. type: "string"
  15286. },
  15287. tree: {
  15288. required: true,
  15289. type: "object[]"
  15290. },
  15291. "tree[].content": {
  15292. type: "string"
  15293. },
  15294. "tree[].mode": {
  15295. enum: ["100644", "100755", "040000", "160000", "120000"],
  15296. type: "string"
  15297. },
  15298. "tree[].path": {
  15299. type: "string"
  15300. },
  15301. "tree[].sha": {
  15302. allowNull: true,
  15303. type: "string"
  15304. },
  15305. "tree[].type": {
  15306. enum: ["blob", "tree", "commit"],
  15307. type: "string"
  15308. }
  15309. },
  15310. url: "/repos/:owner/:repo/git/trees"
  15311. },
  15312. deleteRef: {
  15313. method: "DELETE",
  15314. params: {
  15315. owner: {
  15316. required: true,
  15317. type: "string"
  15318. },
  15319. ref: {
  15320. required: true,
  15321. type: "string"
  15322. },
  15323. repo: {
  15324. required: true,
  15325. type: "string"
  15326. }
  15327. },
  15328. url: "/repos/:owner/:repo/git/refs/:ref"
  15329. },
  15330. getBlob: {
  15331. method: "GET",
  15332. params: {
  15333. file_sha: {
  15334. required: true,
  15335. type: "string"
  15336. },
  15337. owner: {
  15338. required: true,
  15339. type: "string"
  15340. },
  15341. repo: {
  15342. required: true,
  15343. type: "string"
  15344. }
  15345. },
  15346. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15347. },
  15348. getCommit: {
  15349. method: "GET",
  15350. params: {
  15351. commit_sha: {
  15352. required: true,
  15353. type: "string"
  15354. },
  15355. owner: {
  15356. required: true,
  15357. type: "string"
  15358. },
  15359. repo: {
  15360. required: true,
  15361. type: "string"
  15362. }
  15363. },
  15364. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15365. },
  15366. getRef: {
  15367. method: "GET",
  15368. params: {
  15369. owner: {
  15370. required: true,
  15371. type: "string"
  15372. },
  15373. ref: {
  15374. required: true,
  15375. type: "string"
  15376. },
  15377. repo: {
  15378. required: true,
  15379. type: "string"
  15380. }
  15381. },
  15382. url: "/repos/:owner/:repo/git/ref/:ref"
  15383. },
  15384. getTag: {
  15385. method: "GET",
  15386. params: {
  15387. owner: {
  15388. required: true,
  15389. type: "string"
  15390. },
  15391. repo: {
  15392. required: true,
  15393. type: "string"
  15394. },
  15395. tag_sha: {
  15396. required: true,
  15397. type: "string"
  15398. }
  15399. },
  15400. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15401. },
  15402. getTree: {
  15403. method: "GET",
  15404. params: {
  15405. owner: {
  15406. required: true,
  15407. type: "string"
  15408. },
  15409. recursive: {
  15410. enum: ["1"],
  15411. type: "integer"
  15412. },
  15413. repo: {
  15414. required: true,
  15415. type: "string"
  15416. },
  15417. tree_sha: {
  15418. required: true,
  15419. type: "string"
  15420. }
  15421. },
  15422. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15423. },
  15424. listMatchingRefs: {
  15425. method: "GET",
  15426. params: {
  15427. owner: {
  15428. required: true,
  15429. type: "string"
  15430. },
  15431. page: {
  15432. type: "integer"
  15433. },
  15434. per_page: {
  15435. type: "integer"
  15436. },
  15437. ref: {
  15438. required: true,
  15439. type: "string"
  15440. },
  15441. repo: {
  15442. required: true,
  15443. type: "string"
  15444. }
  15445. },
  15446. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15447. },
  15448. listRefs: {
  15449. method: "GET",
  15450. params: {
  15451. namespace: {
  15452. type: "string"
  15453. },
  15454. owner: {
  15455. required: true,
  15456. type: "string"
  15457. },
  15458. page: {
  15459. type: "integer"
  15460. },
  15461. per_page: {
  15462. type: "integer"
  15463. },
  15464. repo: {
  15465. required: true,
  15466. type: "string"
  15467. }
  15468. },
  15469. url: "/repos/:owner/:repo/git/refs/:namespace"
  15470. },
  15471. updateRef: {
  15472. method: "PATCH",
  15473. params: {
  15474. force: {
  15475. type: "boolean"
  15476. },
  15477. owner: {
  15478. required: true,
  15479. type: "string"
  15480. },
  15481. ref: {
  15482. required: true,
  15483. type: "string"
  15484. },
  15485. repo: {
  15486. required: true,
  15487. type: "string"
  15488. },
  15489. sha: {
  15490. required: true,
  15491. type: "string"
  15492. }
  15493. },
  15494. url: "/repos/:owner/:repo/git/refs/:ref"
  15495. }
  15496. },
  15497. gitignore: {
  15498. getTemplate: {
  15499. method: "GET",
  15500. params: {
  15501. name: {
  15502. required: true,
  15503. type: "string"
  15504. }
  15505. },
  15506. url: "/gitignore/templates/:name"
  15507. },
  15508. listTemplates: {
  15509. method: "GET",
  15510. params: {},
  15511. url: "/gitignore/templates"
  15512. }
  15513. },
  15514. interactions: {
  15515. addOrUpdateRestrictionsForOrg: {
  15516. headers: {
  15517. accept: "application/vnd.github.sombra-preview+json"
  15518. },
  15519. method: "PUT",
  15520. params: {
  15521. limit: {
  15522. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15523. required: true,
  15524. type: "string"
  15525. },
  15526. org: {
  15527. required: true,
  15528. type: "string"
  15529. }
  15530. },
  15531. url: "/orgs/:org/interaction-limits"
  15532. },
  15533. addOrUpdateRestrictionsForRepo: {
  15534. headers: {
  15535. accept: "application/vnd.github.sombra-preview+json"
  15536. },
  15537. method: "PUT",
  15538. params: {
  15539. limit: {
  15540. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15541. required: true,
  15542. type: "string"
  15543. },
  15544. owner: {
  15545. required: true,
  15546. type: "string"
  15547. },
  15548. repo: {
  15549. required: true,
  15550. type: "string"
  15551. }
  15552. },
  15553. url: "/repos/:owner/:repo/interaction-limits"
  15554. },
  15555. getRestrictionsForOrg: {
  15556. headers: {
  15557. accept: "application/vnd.github.sombra-preview+json"
  15558. },
  15559. method: "GET",
  15560. params: {
  15561. org: {
  15562. required: true,
  15563. type: "string"
  15564. }
  15565. },
  15566. url: "/orgs/:org/interaction-limits"
  15567. },
  15568. getRestrictionsForRepo: {
  15569. headers: {
  15570. accept: "application/vnd.github.sombra-preview+json"
  15571. },
  15572. method: "GET",
  15573. params: {
  15574. owner: {
  15575. required: true,
  15576. type: "string"
  15577. },
  15578. repo: {
  15579. required: true,
  15580. type: "string"
  15581. }
  15582. },
  15583. url: "/repos/:owner/:repo/interaction-limits"
  15584. },
  15585. removeRestrictionsForOrg: {
  15586. headers: {
  15587. accept: "application/vnd.github.sombra-preview+json"
  15588. },
  15589. method: "DELETE",
  15590. params: {
  15591. org: {
  15592. required: true,
  15593. type: "string"
  15594. }
  15595. },
  15596. url: "/orgs/:org/interaction-limits"
  15597. },
  15598. removeRestrictionsForRepo: {
  15599. headers: {
  15600. accept: "application/vnd.github.sombra-preview+json"
  15601. },
  15602. method: "DELETE",
  15603. params: {
  15604. owner: {
  15605. required: true,
  15606. type: "string"
  15607. },
  15608. repo: {
  15609. required: true,
  15610. type: "string"
  15611. }
  15612. },
  15613. url: "/repos/:owner/:repo/interaction-limits"
  15614. }
  15615. },
  15616. issues: {
  15617. addAssignees: {
  15618. method: "POST",
  15619. params: {
  15620. assignees: {
  15621. type: "string[]"
  15622. },
  15623. issue_number: {
  15624. required: true,
  15625. type: "integer"
  15626. },
  15627. number: {
  15628. alias: "issue_number",
  15629. deprecated: true,
  15630. type: "integer"
  15631. },
  15632. owner: {
  15633. required: true,
  15634. type: "string"
  15635. },
  15636. repo: {
  15637. required: true,
  15638. type: "string"
  15639. }
  15640. },
  15641. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15642. },
  15643. addLabels: {
  15644. method: "POST",
  15645. params: {
  15646. issue_number: {
  15647. required: true,
  15648. type: "integer"
  15649. },
  15650. labels: {
  15651. required: true,
  15652. type: "string[]"
  15653. },
  15654. number: {
  15655. alias: "issue_number",
  15656. deprecated: true,
  15657. type: "integer"
  15658. },
  15659. owner: {
  15660. required: true,
  15661. type: "string"
  15662. },
  15663. repo: {
  15664. required: true,
  15665. type: "string"
  15666. }
  15667. },
  15668. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15669. },
  15670. checkAssignee: {
  15671. method: "GET",
  15672. params: {
  15673. assignee: {
  15674. required: true,
  15675. type: "string"
  15676. },
  15677. owner: {
  15678. required: true,
  15679. type: "string"
  15680. },
  15681. repo: {
  15682. required: true,
  15683. type: "string"
  15684. }
  15685. },
  15686. url: "/repos/:owner/:repo/assignees/:assignee"
  15687. },
  15688. create: {
  15689. method: "POST",
  15690. params: {
  15691. assignee: {
  15692. type: "string"
  15693. },
  15694. assignees: {
  15695. type: "string[]"
  15696. },
  15697. body: {
  15698. type: "string"
  15699. },
  15700. labels: {
  15701. type: "string[]"
  15702. },
  15703. milestone: {
  15704. type: "integer"
  15705. },
  15706. owner: {
  15707. required: true,
  15708. type: "string"
  15709. },
  15710. repo: {
  15711. required: true,
  15712. type: "string"
  15713. },
  15714. title: {
  15715. required: true,
  15716. type: "string"
  15717. }
  15718. },
  15719. url: "/repos/:owner/:repo/issues"
  15720. },
  15721. createComment: {
  15722. method: "POST",
  15723. params: {
  15724. body: {
  15725. required: true,
  15726. type: "string"
  15727. },
  15728. issue_number: {
  15729. required: true,
  15730. type: "integer"
  15731. },
  15732. number: {
  15733. alias: "issue_number",
  15734. deprecated: true,
  15735. type: "integer"
  15736. },
  15737. owner: {
  15738. required: true,
  15739. type: "string"
  15740. },
  15741. repo: {
  15742. required: true,
  15743. type: "string"
  15744. }
  15745. },
  15746. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15747. },
  15748. createLabel: {
  15749. method: "POST",
  15750. params: {
  15751. color: {
  15752. required: true,
  15753. type: "string"
  15754. },
  15755. description: {
  15756. type: "string"
  15757. },
  15758. name: {
  15759. required: true,
  15760. type: "string"
  15761. },
  15762. owner: {
  15763. required: true,
  15764. type: "string"
  15765. },
  15766. repo: {
  15767. required: true,
  15768. type: "string"
  15769. }
  15770. },
  15771. url: "/repos/:owner/:repo/labels"
  15772. },
  15773. createMilestone: {
  15774. method: "POST",
  15775. params: {
  15776. description: {
  15777. type: "string"
  15778. },
  15779. due_on: {
  15780. type: "string"
  15781. },
  15782. owner: {
  15783. required: true,
  15784. type: "string"
  15785. },
  15786. repo: {
  15787. required: true,
  15788. type: "string"
  15789. },
  15790. state: {
  15791. enum: ["open", "closed"],
  15792. type: "string"
  15793. },
  15794. title: {
  15795. required: true,
  15796. type: "string"
  15797. }
  15798. },
  15799. url: "/repos/:owner/:repo/milestones"
  15800. },
  15801. deleteComment: {
  15802. method: "DELETE",
  15803. params: {
  15804. comment_id: {
  15805. required: true,
  15806. type: "integer"
  15807. },
  15808. owner: {
  15809. required: true,
  15810. type: "string"
  15811. },
  15812. repo: {
  15813. required: true,
  15814. type: "string"
  15815. }
  15816. },
  15817. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15818. },
  15819. deleteLabel: {
  15820. method: "DELETE",
  15821. params: {
  15822. name: {
  15823. required: true,
  15824. type: "string"
  15825. },
  15826. owner: {
  15827. required: true,
  15828. type: "string"
  15829. },
  15830. repo: {
  15831. required: true,
  15832. type: "string"
  15833. }
  15834. },
  15835. url: "/repos/:owner/:repo/labels/:name"
  15836. },
  15837. deleteMilestone: {
  15838. method: "DELETE",
  15839. params: {
  15840. milestone_number: {
  15841. required: true,
  15842. type: "integer"
  15843. },
  15844. number: {
  15845. alias: "milestone_number",
  15846. deprecated: true,
  15847. type: "integer"
  15848. },
  15849. owner: {
  15850. required: true,
  15851. type: "string"
  15852. },
  15853. repo: {
  15854. required: true,
  15855. type: "string"
  15856. }
  15857. },
  15858. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15859. },
  15860. get: {
  15861. method: "GET",
  15862. params: {
  15863. issue_number: {
  15864. required: true,
  15865. type: "integer"
  15866. },
  15867. number: {
  15868. alias: "issue_number",
  15869. deprecated: true,
  15870. type: "integer"
  15871. },
  15872. owner: {
  15873. required: true,
  15874. type: "string"
  15875. },
  15876. repo: {
  15877. required: true,
  15878. type: "string"
  15879. }
  15880. },
  15881. url: "/repos/:owner/:repo/issues/:issue_number"
  15882. },
  15883. getComment: {
  15884. method: "GET",
  15885. params: {
  15886. comment_id: {
  15887. required: true,
  15888. type: "integer"
  15889. },
  15890. owner: {
  15891. required: true,
  15892. type: "string"
  15893. },
  15894. repo: {
  15895. required: true,
  15896. type: "string"
  15897. }
  15898. },
  15899. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15900. },
  15901. getEvent: {
  15902. method: "GET",
  15903. params: {
  15904. event_id: {
  15905. required: true,
  15906. type: "integer"
  15907. },
  15908. owner: {
  15909. required: true,
  15910. type: "string"
  15911. },
  15912. repo: {
  15913. required: true,
  15914. type: "string"
  15915. }
  15916. },
  15917. url: "/repos/:owner/:repo/issues/events/:event_id"
  15918. },
  15919. getLabel: {
  15920. method: "GET",
  15921. params: {
  15922. name: {
  15923. required: true,
  15924. type: "string"
  15925. },
  15926. owner: {
  15927. required: true,
  15928. type: "string"
  15929. },
  15930. repo: {
  15931. required: true,
  15932. type: "string"
  15933. }
  15934. },
  15935. url: "/repos/:owner/:repo/labels/:name"
  15936. },
  15937. getMilestone: {
  15938. method: "GET",
  15939. params: {
  15940. milestone_number: {
  15941. required: true,
  15942. type: "integer"
  15943. },
  15944. number: {
  15945. alias: "milestone_number",
  15946. deprecated: true,
  15947. type: "integer"
  15948. },
  15949. owner: {
  15950. required: true,
  15951. type: "string"
  15952. },
  15953. repo: {
  15954. required: true,
  15955. type: "string"
  15956. }
  15957. },
  15958. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15959. },
  15960. list: {
  15961. method: "GET",
  15962. params: {
  15963. direction: {
  15964. enum: ["asc", "desc"],
  15965. type: "string"
  15966. },
  15967. filter: {
  15968. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15969. type: "string"
  15970. },
  15971. labels: {
  15972. type: "string"
  15973. },
  15974. page: {
  15975. type: "integer"
  15976. },
  15977. per_page: {
  15978. type: "integer"
  15979. },
  15980. since: {
  15981. type: "string"
  15982. },
  15983. sort: {
  15984. enum: ["created", "updated", "comments"],
  15985. type: "string"
  15986. },
  15987. state: {
  15988. enum: ["open", "closed", "all"],
  15989. type: "string"
  15990. }
  15991. },
  15992. url: "/issues"
  15993. },
  15994. listAssignees: {
  15995. method: "GET",
  15996. params: {
  15997. owner: {
  15998. required: true,
  15999. type: "string"
  16000. },
  16001. page: {
  16002. type: "integer"
  16003. },
  16004. per_page: {
  16005. type: "integer"
  16006. },
  16007. repo: {
  16008. required: true,
  16009. type: "string"
  16010. }
  16011. },
  16012. url: "/repos/:owner/:repo/assignees"
  16013. },
  16014. listComments: {
  16015. method: "GET",
  16016. params: {
  16017. issue_number: {
  16018. required: true,
  16019. type: "integer"
  16020. },
  16021. number: {
  16022. alias: "issue_number",
  16023. deprecated: true,
  16024. type: "integer"
  16025. },
  16026. owner: {
  16027. required: true,
  16028. type: "string"
  16029. },
  16030. page: {
  16031. type: "integer"
  16032. },
  16033. per_page: {
  16034. type: "integer"
  16035. },
  16036. repo: {
  16037. required: true,
  16038. type: "string"
  16039. },
  16040. since: {
  16041. type: "string"
  16042. }
  16043. },
  16044. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16045. },
  16046. listCommentsForRepo: {
  16047. method: "GET",
  16048. params: {
  16049. direction: {
  16050. enum: ["asc", "desc"],
  16051. type: "string"
  16052. },
  16053. owner: {
  16054. required: true,
  16055. type: "string"
  16056. },
  16057. repo: {
  16058. required: true,
  16059. type: "string"
  16060. },
  16061. since: {
  16062. type: "string"
  16063. },
  16064. sort: {
  16065. enum: ["created", "updated"],
  16066. type: "string"
  16067. }
  16068. },
  16069. url: "/repos/:owner/:repo/issues/comments"
  16070. },
  16071. listEvents: {
  16072. method: "GET",
  16073. params: {
  16074. issue_number: {
  16075. required: true,
  16076. type: "integer"
  16077. },
  16078. number: {
  16079. alias: "issue_number",
  16080. deprecated: true,
  16081. type: "integer"
  16082. },
  16083. owner: {
  16084. required: true,
  16085. type: "string"
  16086. },
  16087. page: {
  16088. type: "integer"
  16089. },
  16090. per_page: {
  16091. type: "integer"
  16092. },
  16093. repo: {
  16094. required: true,
  16095. type: "string"
  16096. }
  16097. },
  16098. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16099. },
  16100. listEventsForRepo: {
  16101. method: "GET",
  16102. params: {
  16103. owner: {
  16104. required: true,
  16105. type: "string"
  16106. },
  16107. page: {
  16108. type: "integer"
  16109. },
  16110. per_page: {
  16111. type: "integer"
  16112. },
  16113. repo: {
  16114. required: true,
  16115. type: "string"
  16116. }
  16117. },
  16118. url: "/repos/:owner/:repo/issues/events"
  16119. },
  16120. listEventsForTimeline: {
  16121. headers: {
  16122. accept: "application/vnd.github.mockingbird-preview+json"
  16123. },
  16124. method: "GET",
  16125. params: {
  16126. issue_number: {
  16127. required: true,
  16128. type: "integer"
  16129. },
  16130. number: {
  16131. alias: "issue_number",
  16132. deprecated: true,
  16133. type: "integer"
  16134. },
  16135. owner: {
  16136. required: true,
  16137. type: "string"
  16138. },
  16139. page: {
  16140. type: "integer"
  16141. },
  16142. per_page: {
  16143. type: "integer"
  16144. },
  16145. repo: {
  16146. required: true,
  16147. type: "string"
  16148. }
  16149. },
  16150. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16151. },
  16152. listForAuthenticatedUser: {
  16153. method: "GET",
  16154. params: {
  16155. direction: {
  16156. enum: ["asc", "desc"],
  16157. type: "string"
  16158. },
  16159. filter: {
  16160. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16161. type: "string"
  16162. },
  16163. labels: {
  16164. type: "string"
  16165. },
  16166. page: {
  16167. type: "integer"
  16168. },
  16169. per_page: {
  16170. type: "integer"
  16171. },
  16172. since: {
  16173. type: "string"
  16174. },
  16175. sort: {
  16176. enum: ["created", "updated", "comments"],
  16177. type: "string"
  16178. },
  16179. state: {
  16180. enum: ["open", "closed", "all"],
  16181. type: "string"
  16182. }
  16183. },
  16184. url: "/user/issues"
  16185. },
  16186. listForOrg: {
  16187. method: "GET",
  16188. params: {
  16189. direction: {
  16190. enum: ["asc", "desc"],
  16191. type: "string"
  16192. },
  16193. filter: {
  16194. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16195. type: "string"
  16196. },
  16197. labels: {
  16198. type: "string"
  16199. },
  16200. org: {
  16201. required: true,
  16202. type: "string"
  16203. },
  16204. page: {
  16205. type: "integer"
  16206. },
  16207. per_page: {
  16208. type: "integer"
  16209. },
  16210. since: {
  16211. type: "string"
  16212. },
  16213. sort: {
  16214. enum: ["created", "updated", "comments"],
  16215. type: "string"
  16216. },
  16217. state: {
  16218. enum: ["open", "closed", "all"],
  16219. type: "string"
  16220. }
  16221. },
  16222. url: "/orgs/:org/issues"
  16223. },
  16224. listForRepo: {
  16225. method: "GET",
  16226. params: {
  16227. assignee: {
  16228. type: "string"
  16229. },
  16230. creator: {
  16231. type: "string"
  16232. },
  16233. direction: {
  16234. enum: ["asc", "desc"],
  16235. type: "string"
  16236. },
  16237. labels: {
  16238. type: "string"
  16239. },
  16240. mentioned: {
  16241. type: "string"
  16242. },
  16243. milestone: {
  16244. type: "string"
  16245. },
  16246. owner: {
  16247. required: true,
  16248. type: "string"
  16249. },
  16250. page: {
  16251. type: "integer"
  16252. },
  16253. per_page: {
  16254. type: "integer"
  16255. },
  16256. repo: {
  16257. required: true,
  16258. type: "string"
  16259. },
  16260. since: {
  16261. type: "string"
  16262. },
  16263. sort: {
  16264. enum: ["created", "updated", "comments"],
  16265. type: "string"
  16266. },
  16267. state: {
  16268. enum: ["open", "closed", "all"],
  16269. type: "string"
  16270. }
  16271. },
  16272. url: "/repos/:owner/:repo/issues"
  16273. },
  16274. listLabelsForMilestone: {
  16275. method: "GET",
  16276. params: {
  16277. milestone_number: {
  16278. required: true,
  16279. type: "integer"
  16280. },
  16281. number: {
  16282. alias: "milestone_number",
  16283. deprecated: true,
  16284. type: "integer"
  16285. },
  16286. owner: {
  16287. required: true,
  16288. type: "string"
  16289. },
  16290. page: {
  16291. type: "integer"
  16292. },
  16293. per_page: {
  16294. type: "integer"
  16295. },
  16296. repo: {
  16297. required: true,
  16298. type: "string"
  16299. }
  16300. },
  16301. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16302. },
  16303. listLabelsForRepo: {
  16304. method: "GET",
  16305. params: {
  16306. owner: {
  16307. required: true,
  16308. type: "string"
  16309. },
  16310. page: {
  16311. type: "integer"
  16312. },
  16313. per_page: {
  16314. type: "integer"
  16315. },
  16316. repo: {
  16317. required: true,
  16318. type: "string"
  16319. }
  16320. },
  16321. url: "/repos/:owner/:repo/labels"
  16322. },
  16323. listLabelsOnIssue: {
  16324. method: "GET",
  16325. params: {
  16326. issue_number: {
  16327. required: true,
  16328. type: "integer"
  16329. },
  16330. number: {
  16331. alias: "issue_number",
  16332. deprecated: true,
  16333. type: "integer"
  16334. },
  16335. owner: {
  16336. required: true,
  16337. type: "string"
  16338. },
  16339. page: {
  16340. type: "integer"
  16341. },
  16342. per_page: {
  16343. type: "integer"
  16344. },
  16345. repo: {
  16346. required: true,
  16347. type: "string"
  16348. }
  16349. },
  16350. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16351. },
  16352. listMilestonesForRepo: {
  16353. method: "GET",
  16354. params: {
  16355. direction: {
  16356. enum: ["asc", "desc"],
  16357. type: "string"
  16358. },
  16359. owner: {
  16360. required: true,
  16361. type: "string"
  16362. },
  16363. page: {
  16364. type: "integer"
  16365. },
  16366. per_page: {
  16367. type: "integer"
  16368. },
  16369. repo: {
  16370. required: true,
  16371. type: "string"
  16372. },
  16373. sort: {
  16374. enum: ["due_on", "completeness"],
  16375. type: "string"
  16376. },
  16377. state: {
  16378. enum: ["open", "closed", "all"],
  16379. type: "string"
  16380. }
  16381. },
  16382. url: "/repos/:owner/:repo/milestones"
  16383. },
  16384. lock: {
  16385. method: "PUT",
  16386. params: {
  16387. issue_number: {
  16388. required: true,
  16389. type: "integer"
  16390. },
  16391. lock_reason: {
  16392. enum: ["off-topic", "too heated", "resolved", "spam"],
  16393. type: "string"
  16394. },
  16395. number: {
  16396. alias: "issue_number",
  16397. deprecated: true,
  16398. type: "integer"
  16399. },
  16400. owner: {
  16401. required: true,
  16402. type: "string"
  16403. },
  16404. repo: {
  16405. required: true,
  16406. type: "string"
  16407. }
  16408. },
  16409. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16410. },
  16411. removeAssignees: {
  16412. method: "DELETE",
  16413. params: {
  16414. assignees: {
  16415. type: "string[]"
  16416. },
  16417. issue_number: {
  16418. required: true,
  16419. type: "integer"
  16420. },
  16421. number: {
  16422. alias: "issue_number",
  16423. deprecated: true,
  16424. type: "integer"
  16425. },
  16426. owner: {
  16427. required: true,
  16428. type: "string"
  16429. },
  16430. repo: {
  16431. required: true,
  16432. type: "string"
  16433. }
  16434. },
  16435. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16436. },
  16437. removeLabel: {
  16438. method: "DELETE",
  16439. params: {
  16440. issue_number: {
  16441. required: true,
  16442. type: "integer"
  16443. },
  16444. name: {
  16445. required: true,
  16446. type: "string"
  16447. },
  16448. number: {
  16449. alias: "issue_number",
  16450. deprecated: true,
  16451. type: "integer"
  16452. },
  16453. owner: {
  16454. required: true,
  16455. type: "string"
  16456. },
  16457. repo: {
  16458. required: true,
  16459. type: "string"
  16460. }
  16461. },
  16462. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16463. },
  16464. removeLabels: {
  16465. method: "DELETE",
  16466. params: {
  16467. issue_number: {
  16468. required: true,
  16469. type: "integer"
  16470. },
  16471. number: {
  16472. alias: "issue_number",
  16473. deprecated: true,
  16474. type: "integer"
  16475. },
  16476. owner: {
  16477. required: true,
  16478. type: "string"
  16479. },
  16480. repo: {
  16481. required: true,
  16482. type: "string"
  16483. }
  16484. },
  16485. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16486. },
  16487. replaceLabels: {
  16488. method: "PUT",
  16489. params: {
  16490. issue_number: {
  16491. required: true,
  16492. type: "integer"
  16493. },
  16494. labels: {
  16495. type: "string[]"
  16496. },
  16497. number: {
  16498. alias: "issue_number",
  16499. deprecated: true,
  16500. type: "integer"
  16501. },
  16502. owner: {
  16503. required: true,
  16504. type: "string"
  16505. },
  16506. repo: {
  16507. required: true,
  16508. type: "string"
  16509. }
  16510. },
  16511. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16512. },
  16513. unlock: {
  16514. method: "DELETE",
  16515. params: {
  16516. issue_number: {
  16517. required: true,
  16518. type: "integer"
  16519. },
  16520. number: {
  16521. alias: "issue_number",
  16522. deprecated: true,
  16523. type: "integer"
  16524. },
  16525. owner: {
  16526. required: true,
  16527. type: "string"
  16528. },
  16529. repo: {
  16530. required: true,
  16531. type: "string"
  16532. }
  16533. },
  16534. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16535. },
  16536. update: {
  16537. method: "PATCH",
  16538. params: {
  16539. assignee: {
  16540. type: "string"
  16541. },
  16542. assignees: {
  16543. type: "string[]"
  16544. },
  16545. body: {
  16546. type: "string"
  16547. },
  16548. issue_number: {
  16549. required: true,
  16550. type: "integer"
  16551. },
  16552. labels: {
  16553. type: "string[]"
  16554. },
  16555. milestone: {
  16556. allowNull: true,
  16557. type: "integer"
  16558. },
  16559. number: {
  16560. alias: "issue_number",
  16561. deprecated: true,
  16562. type: "integer"
  16563. },
  16564. owner: {
  16565. required: true,
  16566. type: "string"
  16567. },
  16568. repo: {
  16569. required: true,
  16570. type: "string"
  16571. },
  16572. state: {
  16573. enum: ["open", "closed"],
  16574. type: "string"
  16575. },
  16576. title: {
  16577. type: "string"
  16578. }
  16579. },
  16580. url: "/repos/:owner/:repo/issues/:issue_number"
  16581. },
  16582. updateComment: {
  16583. method: "PATCH",
  16584. params: {
  16585. body: {
  16586. required: true,
  16587. type: "string"
  16588. },
  16589. comment_id: {
  16590. required: true,
  16591. type: "integer"
  16592. },
  16593. owner: {
  16594. required: true,
  16595. type: "string"
  16596. },
  16597. repo: {
  16598. required: true,
  16599. type: "string"
  16600. }
  16601. },
  16602. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16603. },
  16604. updateLabel: {
  16605. method: "PATCH",
  16606. params: {
  16607. color: {
  16608. type: "string"
  16609. },
  16610. current_name: {
  16611. required: true,
  16612. type: "string"
  16613. },
  16614. description: {
  16615. type: "string"
  16616. },
  16617. name: {
  16618. type: "string"
  16619. },
  16620. owner: {
  16621. required: true,
  16622. type: "string"
  16623. },
  16624. repo: {
  16625. required: true,
  16626. type: "string"
  16627. }
  16628. },
  16629. url: "/repos/:owner/:repo/labels/:current_name"
  16630. },
  16631. updateMilestone: {
  16632. method: "PATCH",
  16633. params: {
  16634. description: {
  16635. type: "string"
  16636. },
  16637. due_on: {
  16638. type: "string"
  16639. },
  16640. milestone_number: {
  16641. required: true,
  16642. type: "integer"
  16643. },
  16644. number: {
  16645. alias: "milestone_number",
  16646. deprecated: true,
  16647. type: "integer"
  16648. },
  16649. owner: {
  16650. required: true,
  16651. type: "string"
  16652. },
  16653. repo: {
  16654. required: true,
  16655. type: "string"
  16656. },
  16657. state: {
  16658. enum: ["open", "closed"],
  16659. type: "string"
  16660. },
  16661. title: {
  16662. type: "string"
  16663. }
  16664. },
  16665. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16666. }
  16667. },
  16668. licenses: {
  16669. get: {
  16670. method: "GET",
  16671. params: {
  16672. license: {
  16673. required: true,
  16674. type: "string"
  16675. }
  16676. },
  16677. url: "/licenses/:license"
  16678. },
  16679. getForRepo: {
  16680. method: "GET",
  16681. params: {
  16682. owner: {
  16683. required: true,
  16684. type: "string"
  16685. },
  16686. repo: {
  16687. required: true,
  16688. type: "string"
  16689. }
  16690. },
  16691. url: "/repos/:owner/:repo/license"
  16692. },
  16693. list: {
  16694. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16695. method: "GET",
  16696. params: {},
  16697. url: "/licenses"
  16698. },
  16699. listCommonlyUsed: {
  16700. method: "GET",
  16701. params: {},
  16702. url: "/licenses"
  16703. }
  16704. },
  16705. markdown: {
  16706. render: {
  16707. method: "POST",
  16708. params: {
  16709. context: {
  16710. type: "string"
  16711. },
  16712. mode: {
  16713. enum: ["markdown", "gfm"],
  16714. type: "string"
  16715. },
  16716. text: {
  16717. required: true,
  16718. type: "string"
  16719. }
  16720. },
  16721. url: "/markdown"
  16722. },
  16723. renderRaw: {
  16724. headers: {
  16725. "content-type": "text/plain; charset=utf-8"
  16726. },
  16727. method: "POST",
  16728. params: {
  16729. data: {
  16730. mapTo: "data",
  16731. required: true,
  16732. type: "string"
  16733. }
  16734. },
  16735. url: "/markdown/raw"
  16736. }
  16737. },
  16738. meta: {
  16739. get: {
  16740. method: "GET",
  16741. params: {},
  16742. url: "/meta"
  16743. }
  16744. },
  16745. migrations: {
  16746. cancelImport: {
  16747. method: "DELETE",
  16748. params: {
  16749. owner: {
  16750. required: true,
  16751. type: "string"
  16752. },
  16753. repo: {
  16754. required: true,
  16755. type: "string"
  16756. }
  16757. },
  16758. url: "/repos/:owner/:repo/import"
  16759. },
  16760. deleteArchiveForAuthenticatedUser: {
  16761. headers: {
  16762. accept: "application/vnd.github.wyandotte-preview+json"
  16763. },
  16764. method: "DELETE",
  16765. params: {
  16766. migration_id: {
  16767. required: true,
  16768. type: "integer"
  16769. }
  16770. },
  16771. url: "/user/migrations/:migration_id/archive"
  16772. },
  16773. deleteArchiveForOrg: {
  16774. headers: {
  16775. accept: "application/vnd.github.wyandotte-preview+json"
  16776. },
  16777. method: "DELETE",
  16778. params: {
  16779. migration_id: {
  16780. required: true,
  16781. type: "integer"
  16782. },
  16783. org: {
  16784. required: true,
  16785. type: "string"
  16786. }
  16787. },
  16788. url: "/orgs/:org/migrations/:migration_id/archive"
  16789. },
  16790. downloadArchiveForOrg: {
  16791. headers: {
  16792. accept: "application/vnd.github.wyandotte-preview+json"
  16793. },
  16794. method: "GET",
  16795. params: {
  16796. migration_id: {
  16797. required: true,
  16798. type: "integer"
  16799. },
  16800. org: {
  16801. required: true,
  16802. type: "string"
  16803. }
  16804. },
  16805. url: "/orgs/:org/migrations/:migration_id/archive"
  16806. },
  16807. getArchiveForAuthenticatedUser: {
  16808. headers: {
  16809. accept: "application/vnd.github.wyandotte-preview+json"
  16810. },
  16811. method: "GET",
  16812. params: {
  16813. migration_id: {
  16814. required: true,
  16815. type: "integer"
  16816. }
  16817. },
  16818. url: "/user/migrations/:migration_id/archive"
  16819. },
  16820. getArchiveForOrg: {
  16821. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16822. headers: {
  16823. accept: "application/vnd.github.wyandotte-preview+json"
  16824. },
  16825. method: "GET",
  16826. params: {
  16827. migration_id: {
  16828. required: true,
  16829. type: "integer"
  16830. },
  16831. org: {
  16832. required: true,
  16833. type: "string"
  16834. }
  16835. },
  16836. url: "/orgs/:org/migrations/:migration_id/archive"
  16837. },
  16838. getCommitAuthors: {
  16839. method: "GET",
  16840. params: {
  16841. owner: {
  16842. required: true,
  16843. type: "string"
  16844. },
  16845. repo: {
  16846. required: true,
  16847. type: "string"
  16848. },
  16849. since: {
  16850. type: "string"
  16851. }
  16852. },
  16853. url: "/repos/:owner/:repo/import/authors"
  16854. },
  16855. getImportProgress: {
  16856. method: "GET",
  16857. params: {
  16858. owner: {
  16859. required: true,
  16860. type: "string"
  16861. },
  16862. repo: {
  16863. required: true,
  16864. type: "string"
  16865. }
  16866. },
  16867. url: "/repos/:owner/:repo/import"
  16868. },
  16869. getLargeFiles: {
  16870. method: "GET",
  16871. params: {
  16872. owner: {
  16873. required: true,
  16874. type: "string"
  16875. },
  16876. repo: {
  16877. required: true,
  16878. type: "string"
  16879. }
  16880. },
  16881. url: "/repos/:owner/:repo/import/large_files"
  16882. },
  16883. getStatusForAuthenticatedUser: {
  16884. headers: {
  16885. accept: "application/vnd.github.wyandotte-preview+json"
  16886. },
  16887. method: "GET",
  16888. params: {
  16889. migration_id: {
  16890. required: true,
  16891. type: "integer"
  16892. }
  16893. },
  16894. url: "/user/migrations/:migration_id"
  16895. },
  16896. getStatusForOrg: {
  16897. headers: {
  16898. accept: "application/vnd.github.wyandotte-preview+json"
  16899. },
  16900. method: "GET",
  16901. params: {
  16902. migration_id: {
  16903. required: true,
  16904. type: "integer"
  16905. },
  16906. org: {
  16907. required: true,
  16908. type: "string"
  16909. }
  16910. },
  16911. url: "/orgs/:org/migrations/:migration_id"
  16912. },
  16913. listForAuthenticatedUser: {
  16914. headers: {
  16915. accept: "application/vnd.github.wyandotte-preview+json"
  16916. },
  16917. method: "GET",
  16918. params: {
  16919. page: {
  16920. type: "integer"
  16921. },
  16922. per_page: {
  16923. type: "integer"
  16924. }
  16925. },
  16926. url: "/user/migrations"
  16927. },
  16928. listForOrg: {
  16929. headers: {
  16930. accept: "application/vnd.github.wyandotte-preview+json"
  16931. },
  16932. method: "GET",
  16933. params: {
  16934. org: {
  16935. required: true,
  16936. type: "string"
  16937. },
  16938. page: {
  16939. type: "integer"
  16940. },
  16941. per_page: {
  16942. type: "integer"
  16943. }
  16944. },
  16945. url: "/orgs/:org/migrations"
  16946. },
  16947. listReposForOrg: {
  16948. headers: {
  16949. accept: "application/vnd.github.wyandotte-preview+json"
  16950. },
  16951. method: "GET",
  16952. params: {
  16953. migration_id: {
  16954. required: true,
  16955. type: "integer"
  16956. },
  16957. org: {
  16958. required: true,
  16959. type: "string"
  16960. },
  16961. page: {
  16962. type: "integer"
  16963. },
  16964. per_page: {
  16965. type: "integer"
  16966. }
  16967. },
  16968. url: "/orgs/:org/migrations/:migration_id/repositories"
  16969. },
  16970. listReposForUser: {
  16971. headers: {
  16972. accept: "application/vnd.github.wyandotte-preview+json"
  16973. },
  16974. method: "GET",
  16975. params: {
  16976. migration_id: {
  16977. required: true,
  16978. type: "integer"
  16979. },
  16980. page: {
  16981. type: "integer"
  16982. },
  16983. per_page: {
  16984. type: "integer"
  16985. }
  16986. },
  16987. url: "/user/:migration_id/repositories"
  16988. },
  16989. mapCommitAuthor: {
  16990. method: "PATCH",
  16991. params: {
  16992. author_id: {
  16993. required: true,
  16994. type: "integer"
  16995. },
  16996. email: {
  16997. type: "string"
  16998. },
  16999. name: {
  17000. type: "string"
  17001. },
  17002. owner: {
  17003. required: true,
  17004. type: "string"
  17005. },
  17006. repo: {
  17007. required: true,
  17008. type: "string"
  17009. }
  17010. },
  17011. url: "/repos/:owner/:repo/import/authors/:author_id"
  17012. },
  17013. setLfsPreference: {
  17014. method: "PATCH",
  17015. params: {
  17016. owner: {
  17017. required: true,
  17018. type: "string"
  17019. },
  17020. repo: {
  17021. required: true,
  17022. type: "string"
  17023. },
  17024. use_lfs: {
  17025. enum: ["opt_in", "opt_out"],
  17026. required: true,
  17027. type: "string"
  17028. }
  17029. },
  17030. url: "/repos/:owner/:repo/import/lfs"
  17031. },
  17032. startForAuthenticatedUser: {
  17033. method: "POST",
  17034. params: {
  17035. exclude_attachments: {
  17036. type: "boolean"
  17037. },
  17038. lock_repositories: {
  17039. type: "boolean"
  17040. },
  17041. repositories: {
  17042. required: true,
  17043. type: "string[]"
  17044. }
  17045. },
  17046. url: "/user/migrations"
  17047. },
  17048. startForOrg: {
  17049. method: "POST",
  17050. params: {
  17051. exclude_attachments: {
  17052. type: "boolean"
  17053. },
  17054. lock_repositories: {
  17055. type: "boolean"
  17056. },
  17057. org: {
  17058. required: true,
  17059. type: "string"
  17060. },
  17061. repositories: {
  17062. required: true,
  17063. type: "string[]"
  17064. }
  17065. },
  17066. url: "/orgs/:org/migrations"
  17067. },
  17068. startImport: {
  17069. method: "PUT",
  17070. params: {
  17071. owner: {
  17072. required: true,
  17073. type: "string"
  17074. },
  17075. repo: {
  17076. required: true,
  17077. type: "string"
  17078. },
  17079. tfvc_project: {
  17080. type: "string"
  17081. },
  17082. vcs: {
  17083. enum: ["subversion", "git", "mercurial", "tfvc"],
  17084. type: "string"
  17085. },
  17086. vcs_password: {
  17087. type: "string"
  17088. },
  17089. vcs_url: {
  17090. required: true,
  17091. type: "string"
  17092. },
  17093. vcs_username: {
  17094. type: "string"
  17095. }
  17096. },
  17097. url: "/repos/:owner/:repo/import"
  17098. },
  17099. unlockRepoForAuthenticatedUser: {
  17100. headers: {
  17101. accept: "application/vnd.github.wyandotte-preview+json"
  17102. },
  17103. method: "DELETE",
  17104. params: {
  17105. migration_id: {
  17106. required: true,
  17107. type: "integer"
  17108. },
  17109. repo_name: {
  17110. required: true,
  17111. type: "string"
  17112. }
  17113. },
  17114. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17115. },
  17116. unlockRepoForOrg: {
  17117. headers: {
  17118. accept: "application/vnd.github.wyandotte-preview+json"
  17119. },
  17120. method: "DELETE",
  17121. params: {
  17122. migration_id: {
  17123. required: true,
  17124. type: "integer"
  17125. },
  17126. org: {
  17127. required: true,
  17128. type: "string"
  17129. },
  17130. repo_name: {
  17131. required: true,
  17132. type: "string"
  17133. }
  17134. },
  17135. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17136. },
  17137. updateImport: {
  17138. method: "PATCH",
  17139. params: {
  17140. owner: {
  17141. required: true,
  17142. type: "string"
  17143. },
  17144. repo: {
  17145. required: true,
  17146. type: "string"
  17147. },
  17148. vcs_password: {
  17149. type: "string"
  17150. },
  17151. vcs_username: {
  17152. type: "string"
  17153. }
  17154. },
  17155. url: "/repos/:owner/:repo/import"
  17156. }
  17157. },
  17158. oauthAuthorizations: {
  17159. checkAuthorization: {
  17160. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17161. method: "GET",
  17162. params: {
  17163. access_token: {
  17164. required: true,
  17165. type: "string"
  17166. },
  17167. client_id: {
  17168. required: true,
  17169. type: "string"
  17170. }
  17171. },
  17172. url: "/applications/:client_id/tokens/:access_token"
  17173. },
  17174. createAuthorization: {
  17175. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17176. method: "POST",
  17177. params: {
  17178. client_id: {
  17179. type: "string"
  17180. },
  17181. client_secret: {
  17182. type: "string"
  17183. },
  17184. fingerprint: {
  17185. type: "string"
  17186. },
  17187. note: {
  17188. required: true,
  17189. type: "string"
  17190. },
  17191. note_url: {
  17192. type: "string"
  17193. },
  17194. scopes: {
  17195. type: "string[]"
  17196. }
  17197. },
  17198. url: "/authorizations"
  17199. },
  17200. deleteAuthorization: {
  17201. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17202. method: "DELETE",
  17203. params: {
  17204. authorization_id: {
  17205. required: true,
  17206. type: "integer"
  17207. }
  17208. },
  17209. url: "/authorizations/:authorization_id"
  17210. },
  17211. deleteGrant: {
  17212. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17213. method: "DELETE",
  17214. params: {
  17215. grant_id: {
  17216. required: true,
  17217. type: "integer"
  17218. }
  17219. },
  17220. url: "/applications/grants/:grant_id"
  17221. },
  17222. getAuthorization: {
  17223. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17224. method: "GET",
  17225. params: {
  17226. authorization_id: {
  17227. required: true,
  17228. type: "integer"
  17229. }
  17230. },
  17231. url: "/authorizations/:authorization_id"
  17232. },
  17233. getGrant: {
  17234. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17235. method: "GET",
  17236. params: {
  17237. grant_id: {
  17238. required: true,
  17239. type: "integer"
  17240. }
  17241. },
  17242. url: "/applications/grants/:grant_id"
  17243. },
  17244. getOrCreateAuthorizationForApp: {
  17245. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17246. method: "PUT",
  17247. params: {
  17248. client_id: {
  17249. required: true,
  17250. type: "string"
  17251. },
  17252. client_secret: {
  17253. required: true,
  17254. type: "string"
  17255. },
  17256. fingerprint: {
  17257. type: "string"
  17258. },
  17259. note: {
  17260. type: "string"
  17261. },
  17262. note_url: {
  17263. type: "string"
  17264. },
  17265. scopes: {
  17266. type: "string[]"
  17267. }
  17268. },
  17269. url: "/authorizations/clients/:client_id"
  17270. },
  17271. getOrCreateAuthorizationForAppAndFingerprint: {
  17272. 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",
  17273. method: "PUT",
  17274. params: {
  17275. client_id: {
  17276. required: true,
  17277. type: "string"
  17278. },
  17279. client_secret: {
  17280. required: true,
  17281. type: "string"
  17282. },
  17283. fingerprint: {
  17284. required: true,
  17285. type: "string"
  17286. },
  17287. note: {
  17288. type: "string"
  17289. },
  17290. note_url: {
  17291. type: "string"
  17292. },
  17293. scopes: {
  17294. type: "string[]"
  17295. }
  17296. },
  17297. url: "/authorizations/clients/:client_id/:fingerprint"
  17298. },
  17299. getOrCreateAuthorizationForAppFingerprint: {
  17300. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17301. method: "PUT",
  17302. params: {
  17303. client_id: {
  17304. required: true,
  17305. type: "string"
  17306. },
  17307. client_secret: {
  17308. required: true,
  17309. type: "string"
  17310. },
  17311. fingerprint: {
  17312. required: true,
  17313. type: "string"
  17314. },
  17315. note: {
  17316. type: "string"
  17317. },
  17318. note_url: {
  17319. type: "string"
  17320. },
  17321. scopes: {
  17322. type: "string[]"
  17323. }
  17324. },
  17325. url: "/authorizations/clients/:client_id/:fingerprint"
  17326. },
  17327. listAuthorizations: {
  17328. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17329. method: "GET",
  17330. params: {
  17331. page: {
  17332. type: "integer"
  17333. },
  17334. per_page: {
  17335. type: "integer"
  17336. }
  17337. },
  17338. url: "/authorizations"
  17339. },
  17340. listGrants: {
  17341. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17342. method: "GET",
  17343. params: {
  17344. page: {
  17345. type: "integer"
  17346. },
  17347. per_page: {
  17348. type: "integer"
  17349. }
  17350. },
  17351. url: "/applications/grants"
  17352. },
  17353. resetAuthorization: {
  17354. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17355. method: "POST",
  17356. params: {
  17357. access_token: {
  17358. required: true,
  17359. type: "string"
  17360. },
  17361. client_id: {
  17362. required: true,
  17363. type: "string"
  17364. }
  17365. },
  17366. url: "/applications/:client_id/tokens/:access_token"
  17367. },
  17368. revokeAuthorizationForApplication: {
  17369. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17370. method: "DELETE",
  17371. params: {
  17372. access_token: {
  17373. required: true,
  17374. type: "string"
  17375. },
  17376. client_id: {
  17377. required: true,
  17378. type: "string"
  17379. }
  17380. },
  17381. url: "/applications/:client_id/tokens/:access_token"
  17382. },
  17383. revokeGrantForApplication: {
  17384. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17385. method: "DELETE",
  17386. params: {
  17387. access_token: {
  17388. required: true,
  17389. type: "string"
  17390. },
  17391. client_id: {
  17392. required: true,
  17393. type: "string"
  17394. }
  17395. },
  17396. url: "/applications/:client_id/grants/:access_token"
  17397. },
  17398. updateAuthorization: {
  17399. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17400. method: "PATCH",
  17401. params: {
  17402. add_scopes: {
  17403. type: "string[]"
  17404. },
  17405. authorization_id: {
  17406. required: true,
  17407. type: "integer"
  17408. },
  17409. fingerprint: {
  17410. type: "string"
  17411. },
  17412. note: {
  17413. type: "string"
  17414. },
  17415. note_url: {
  17416. type: "string"
  17417. },
  17418. remove_scopes: {
  17419. type: "string[]"
  17420. },
  17421. scopes: {
  17422. type: "string[]"
  17423. }
  17424. },
  17425. url: "/authorizations/:authorization_id"
  17426. }
  17427. },
  17428. orgs: {
  17429. addOrUpdateMembership: {
  17430. method: "PUT",
  17431. params: {
  17432. org: {
  17433. required: true,
  17434. type: "string"
  17435. },
  17436. role: {
  17437. enum: ["admin", "member"],
  17438. type: "string"
  17439. },
  17440. username: {
  17441. required: true,
  17442. type: "string"
  17443. }
  17444. },
  17445. url: "/orgs/:org/memberships/:username"
  17446. },
  17447. blockUser: {
  17448. method: "PUT",
  17449. params: {
  17450. org: {
  17451. required: true,
  17452. type: "string"
  17453. },
  17454. username: {
  17455. required: true,
  17456. type: "string"
  17457. }
  17458. },
  17459. url: "/orgs/:org/blocks/:username"
  17460. },
  17461. checkBlockedUser: {
  17462. method: "GET",
  17463. params: {
  17464. org: {
  17465. required: true,
  17466. type: "string"
  17467. },
  17468. username: {
  17469. required: true,
  17470. type: "string"
  17471. }
  17472. },
  17473. url: "/orgs/:org/blocks/:username"
  17474. },
  17475. checkMembership: {
  17476. method: "GET",
  17477. params: {
  17478. org: {
  17479. required: true,
  17480. type: "string"
  17481. },
  17482. username: {
  17483. required: true,
  17484. type: "string"
  17485. }
  17486. },
  17487. url: "/orgs/:org/members/:username"
  17488. },
  17489. checkPublicMembership: {
  17490. method: "GET",
  17491. params: {
  17492. org: {
  17493. required: true,
  17494. type: "string"
  17495. },
  17496. username: {
  17497. required: true,
  17498. type: "string"
  17499. }
  17500. },
  17501. url: "/orgs/:org/public_members/:username"
  17502. },
  17503. concealMembership: {
  17504. method: "DELETE",
  17505. params: {
  17506. org: {
  17507. required: true,
  17508. type: "string"
  17509. },
  17510. username: {
  17511. required: true,
  17512. type: "string"
  17513. }
  17514. },
  17515. url: "/orgs/:org/public_members/:username"
  17516. },
  17517. convertMemberToOutsideCollaborator: {
  17518. method: "PUT",
  17519. params: {
  17520. org: {
  17521. required: true,
  17522. type: "string"
  17523. },
  17524. username: {
  17525. required: true,
  17526. type: "string"
  17527. }
  17528. },
  17529. url: "/orgs/:org/outside_collaborators/:username"
  17530. },
  17531. createHook: {
  17532. method: "POST",
  17533. params: {
  17534. active: {
  17535. type: "boolean"
  17536. },
  17537. config: {
  17538. required: true,
  17539. type: "object"
  17540. },
  17541. "config.content_type": {
  17542. type: "string"
  17543. },
  17544. "config.insecure_ssl": {
  17545. type: "string"
  17546. },
  17547. "config.secret": {
  17548. type: "string"
  17549. },
  17550. "config.url": {
  17551. required: true,
  17552. type: "string"
  17553. },
  17554. events: {
  17555. type: "string[]"
  17556. },
  17557. name: {
  17558. required: true,
  17559. type: "string"
  17560. },
  17561. org: {
  17562. required: true,
  17563. type: "string"
  17564. }
  17565. },
  17566. url: "/orgs/:org/hooks"
  17567. },
  17568. createInvitation: {
  17569. method: "POST",
  17570. params: {
  17571. email: {
  17572. type: "string"
  17573. },
  17574. invitee_id: {
  17575. type: "integer"
  17576. },
  17577. org: {
  17578. required: true,
  17579. type: "string"
  17580. },
  17581. role: {
  17582. enum: ["admin", "direct_member", "billing_manager"],
  17583. type: "string"
  17584. },
  17585. team_ids: {
  17586. type: "integer[]"
  17587. }
  17588. },
  17589. url: "/orgs/:org/invitations"
  17590. },
  17591. deleteHook: {
  17592. method: "DELETE",
  17593. params: {
  17594. hook_id: {
  17595. required: true,
  17596. type: "integer"
  17597. },
  17598. org: {
  17599. required: true,
  17600. type: "string"
  17601. }
  17602. },
  17603. url: "/orgs/:org/hooks/:hook_id"
  17604. },
  17605. get: {
  17606. method: "GET",
  17607. params: {
  17608. org: {
  17609. required: true,
  17610. type: "string"
  17611. }
  17612. },
  17613. url: "/orgs/:org"
  17614. },
  17615. getHook: {
  17616. method: "GET",
  17617. params: {
  17618. hook_id: {
  17619. required: true,
  17620. type: "integer"
  17621. },
  17622. org: {
  17623. required: true,
  17624. type: "string"
  17625. }
  17626. },
  17627. url: "/orgs/:org/hooks/:hook_id"
  17628. },
  17629. getMembership: {
  17630. method: "GET",
  17631. params: {
  17632. org: {
  17633. required: true,
  17634. type: "string"
  17635. },
  17636. username: {
  17637. required: true,
  17638. type: "string"
  17639. }
  17640. },
  17641. url: "/orgs/:org/memberships/:username"
  17642. },
  17643. getMembershipForAuthenticatedUser: {
  17644. method: "GET",
  17645. params: {
  17646. org: {
  17647. required: true,
  17648. type: "string"
  17649. }
  17650. },
  17651. url: "/user/memberships/orgs/:org"
  17652. },
  17653. list: {
  17654. method: "GET",
  17655. params: {
  17656. page: {
  17657. type: "integer"
  17658. },
  17659. per_page: {
  17660. type: "integer"
  17661. },
  17662. since: {
  17663. type: "integer"
  17664. }
  17665. },
  17666. url: "/organizations"
  17667. },
  17668. listBlockedUsers: {
  17669. method: "GET",
  17670. params: {
  17671. org: {
  17672. required: true,
  17673. type: "string"
  17674. }
  17675. },
  17676. url: "/orgs/:org/blocks"
  17677. },
  17678. listForAuthenticatedUser: {
  17679. method: "GET",
  17680. params: {
  17681. page: {
  17682. type: "integer"
  17683. },
  17684. per_page: {
  17685. type: "integer"
  17686. }
  17687. },
  17688. url: "/user/orgs"
  17689. },
  17690. listForUser: {
  17691. method: "GET",
  17692. params: {
  17693. page: {
  17694. type: "integer"
  17695. },
  17696. per_page: {
  17697. type: "integer"
  17698. },
  17699. username: {
  17700. required: true,
  17701. type: "string"
  17702. }
  17703. },
  17704. url: "/users/:username/orgs"
  17705. },
  17706. listHooks: {
  17707. method: "GET",
  17708. params: {
  17709. org: {
  17710. required: true,
  17711. type: "string"
  17712. },
  17713. page: {
  17714. type: "integer"
  17715. },
  17716. per_page: {
  17717. type: "integer"
  17718. }
  17719. },
  17720. url: "/orgs/:org/hooks"
  17721. },
  17722. listInstallations: {
  17723. headers: {
  17724. accept: "application/vnd.github.machine-man-preview+json"
  17725. },
  17726. method: "GET",
  17727. params: {
  17728. org: {
  17729. required: true,
  17730. type: "string"
  17731. },
  17732. page: {
  17733. type: "integer"
  17734. },
  17735. per_page: {
  17736. type: "integer"
  17737. }
  17738. },
  17739. url: "/orgs/:org/installations"
  17740. },
  17741. listInvitationTeams: {
  17742. method: "GET",
  17743. params: {
  17744. invitation_id: {
  17745. required: true,
  17746. type: "integer"
  17747. },
  17748. org: {
  17749. required: true,
  17750. type: "string"
  17751. },
  17752. page: {
  17753. type: "integer"
  17754. },
  17755. per_page: {
  17756. type: "integer"
  17757. }
  17758. },
  17759. url: "/orgs/:org/invitations/:invitation_id/teams"
  17760. },
  17761. listMembers: {
  17762. method: "GET",
  17763. params: {
  17764. filter: {
  17765. enum: ["2fa_disabled", "all"],
  17766. type: "string"
  17767. },
  17768. org: {
  17769. required: true,
  17770. type: "string"
  17771. },
  17772. page: {
  17773. type: "integer"
  17774. },
  17775. per_page: {
  17776. type: "integer"
  17777. },
  17778. role: {
  17779. enum: ["all", "admin", "member"],
  17780. type: "string"
  17781. }
  17782. },
  17783. url: "/orgs/:org/members"
  17784. },
  17785. listMemberships: {
  17786. method: "GET",
  17787. params: {
  17788. page: {
  17789. type: "integer"
  17790. },
  17791. per_page: {
  17792. type: "integer"
  17793. },
  17794. state: {
  17795. enum: ["active", "pending"],
  17796. type: "string"
  17797. }
  17798. },
  17799. url: "/user/memberships/orgs"
  17800. },
  17801. listOutsideCollaborators: {
  17802. method: "GET",
  17803. params: {
  17804. filter: {
  17805. enum: ["2fa_disabled", "all"],
  17806. type: "string"
  17807. },
  17808. org: {
  17809. required: true,
  17810. type: "string"
  17811. },
  17812. page: {
  17813. type: "integer"
  17814. },
  17815. per_page: {
  17816. type: "integer"
  17817. }
  17818. },
  17819. url: "/orgs/:org/outside_collaborators"
  17820. },
  17821. listPendingInvitations: {
  17822. method: "GET",
  17823. params: {
  17824. org: {
  17825. required: true,
  17826. type: "string"
  17827. },
  17828. page: {
  17829. type: "integer"
  17830. },
  17831. per_page: {
  17832. type: "integer"
  17833. }
  17834. },
  17835. url: "/orgs/:org/invitations"
  17836. },
  17837. listPublicMembers: {
  17838. method: "GET",
  17839. params: {
  17840. org: {
  17841. required: true,
  17842. type: "string"
  17843. },
  17844. page: {
  17845. type: "integer"
  17846. },
  17847. per_page: {
  17848. type: "integer"
  17849. }
  17850. },
  17851. url: "/orgs/:org/public_members"
  17852. },
  17853. pingHook: {
  17854. method: "POST",
  17855. params: {
  17856. hook_id: {
  17857. required: true,
  17858. type: "integer"
  17859. },
  17860. org: {
  17861. required: true,
  17862. type: "string"
  17863. }
  17864. },
  17865. url: "/orgs/:org/hooks/:hook_id/pings"
  17866. },
  17867. publicizeMembership: {
  17868. method: "PUT",
  17869. params: {
  17870. org: {
  17871. required: true,
  17872. type: "string"
  17873. },
  17874. username: {
  17875. required: true,
  17876. type: "string"
  17877. }
  17878. },
  17879. url: "/orgs/:org/public_members/:username"
  17880. },
  17881. removeMember: {
  17882. method: "DELETE",
  17883. params: {
  17884. org: {
  17885. required: true,
  17886. type: "string"
  17887. },
  17888. username: {
  17889. required: true,
  17890. type: "string"
  17891. }
  17892. },
  17893. url: "/orgs/:org/members/:username"
  17894. },
  17895. removeMembership: {
  17896. method: "DELETE",
  17897. params: {
  17898. org: {
  17899. required: true,
  17900. type: "string"
  17901. },
  17902. username: {
  17903. required: true,
  17904. type: "string"
  17905. }
  17906. },
  17907. url: "/orgs/:org/memberships/:username"
  17908. },
  17909. removeOutsideCollaborator: {
  17910. method: "DELETE",
  17911. params: {
  17912. org: {
  17913. required: true,
  17914. type: "string"
  17915. },
  17916. username: {
  17917. required: true,
  17918. type: "string"
  17919. }
  17920. },
  17921. url: "/orgs/:org/outside_collaborators/:username"
  17922. },
  17923. unblockUser: {
  17924. method: "DELETE",
  17925. params: {
  17926. org: {
  17927. required: true,
  17928. type: "string"
  17929. },
  17930. username: {
  17931. required: true,
  17932. type: "string"
  17933. }
  17934. },
  17935. url: "/orgs/:org/blocks/:username"
  17936. },
  17937. update: {
  17938. method: "PATCH",
  17939. params: {
  17940. billing_email: {
  17941. type: "string"
  17942. },
  17943. company: {
  17944. type: "string"
  17945. },
  17946. default_repository_permission: {
  17947. enum: ["read", "write", "admin", "none"],
  17948. type: "string"
  17949. },
  17950. description: {
  17951. type: "string"
  17952. },
  17953. email: {
  17954. type: "string"
  17955. },
  17956. has_organization_projects: {
  17957. type: "boolean"
  17958. },
  17959. has_repository_projects: {
  17960. type: "boolean"
  17961. },
  17962. location: {
  17963. type: "string"
  17964. },
  17965. members_allowed_repository_creation_type: {
  17966. enum: ["all", "private", "none"],
  17967. type: "string"
  17968. },
  17969. members_can_create_internal_repositories: {
  17970. type: "boolean"
  17971. },
  17972. members_can_create_private_repositories: {
  17973. type: "boolean"
  17974. },
  17975. members_can_create_public_repositories: {
  17976. type: "boolean"
  17977. },
  17978. members_can_create_repositories: {
  17979. type: "boolean"
  17980. },
  17981. name: {
  17982. type: "string"
  17983. },
  17984. org: {
  17985. required: true,
  17986. type: "string"
  17987. }
  17988. },
  17989. url: "/orgs/:org"
  17990. },
  17991. updateHook: {
  17992. method: "PATCH",
  17993. params: {
  17994. active: {
  17995. type: "boolean"
  17996. },
  17997. config: {
  17998. type: "object"
  17999. },
  18000. "config.content_type": {
  18001. type: "string"
  18002. },
  18003. "config.insecure_ssl": {
  18004. type: "string"
  18005. },
  18006. "config.secret": {
  18007. type: "string"
  18008. },
  18009. "config.url": {
  18010. required: true,
  18011. type: "string"
  18012. },
  18013. events: {
  18014. type: "string[]"
  18015. },
  18016. hook_id: {
  18017. required: true,
  18018. type: "integer"
  18019. },
  18020. org: {
  18021. required: true,
  18022. type: "string"
  18023. }
  18024. },
  18025. url: "/orgs/:org/hooks/:hook_id"
  18026. },
  18027. updateMembership: {
  18028. method: "PATCH",
  18029. params: {
  18030. org: {
  18031. required: true,
  18032. type: "string"
  18033. },
  18034. state: {
  18035. enum: ["active"],
  18036. required: true,
  18037. type: "string"
  18038. }
  18039. },
  18040. url: "/user/memberships/orgs/:org"
  18041. }
  18042. },
  18043. projects: {
  18044. addCollaborator: {
  18045. headers: {
  18046. accept: "application/vnd.github.inertia-preview+json"
  18047. },
  18048. method: "PUT",
  18049. params: {
  18050. permission: {
  18051. enum: ["read", "write", "admin"],
  18052. type: "string"
  18053. },
  18054. project_id: {
  18055. required: true,
  18056. type: "integer"
  18057. },
  18058. username: {
  18059. required: true,
  18060. type: "string"
  18061. }
  18062. },
  18063. url: "/projects/:project_id/collaborators/:username"
  18064. },
  18065. createCard: {
  18066. headers: {
  18067. accept: "application/vnd.github.inertia-preview+json"
  18068. },
  18069. method: "POST",
  18070. params: {
  18071. column_id: {
  18072. required: true,
  18073. type: "integer"
  18074. },
  18075. content_id: {
  18076. type: "integer"
  18077. },
  18078. content_type: {
  18079. type: "string"
  18080. },
  18081. note: {
  18082. type: "string"
  18083. }
  18084. },
  18085. url: "/projects/columns/:column_id/cards"
  18086. },
  18087. createColumn: {
  18088. headers: {
  18089. accept: "application/vnd.github.inertia-preview+json"
  18090. },
  18091. method: "POST",
  18092. params: {
  18093. name: {
  18094. required: true,
  18095. type: "string"
  18096. },
  18097. project_id: {
  18098. required: true,
  18099. type: "integer"
  18100. }
  18101. },
  18102. url: "/projects/:project_id/columns"
  18103. },
  18104. createForAuthenticatedUser: {
  18105. headers: {
  18106. accept: "application/vnd.github.inertia-preview+json"
  18107. },
  18108. method: "POST",
  18109. params: {
  18110. body: {
  18111. type: "string"
  18112. },
  18113. name: {
  18114. required: true,
  18115. type: "string"
  18116. }
  18117. },
  18118. url: "/user/projects"
  18119. },
  18120. createForOrg: {
  18121. headers: {
  18122. accept: "application/vnd.github.inertia-preview+json"
  18123. },
  18124. method: "POST",
  18125. params: {
  18126. body: {
  18127. type: "string"
  18128. },
  18129. name: {
  18130. required: true,
  18131. type: "string"
  18132. },
  18133. org: {
  18134. required: true,
  18135. type: "string"
  18136. }
  18137. },
  18138. url: "/orgs/:org/projects"
  18139. },
  18140. createForRepo: {
  18141. headers: {
  18142. accept: "application/vnd.github.inertia-preview+json"
  18143. },
  18144. method: "POST",
  18145. params: {
  18146. body: {
  18147. type: "string"
  18148. },
  18149. name: {
  18150. required: true,
  18151. type: "string"
  18152. },
  18153. owner: {
  18154. required: true,
  18155. type: "string"
  18156. },
  18157. repo: {
  18158. required: true,
  18159. type: "string"
  18160. }
  18161. },
  18162. url: "/repos/:owner/:repo/projects"
  18163. },
  18164. delete: {
  18165. headers: {
  18166. accept: "application/vnd.github.inertia-preview+json"
  18167. },
  18168. method: "DELETE",
  18169. params: {
  18170. project_id: {
  18171. required: true,
  18172. type: "integer"
  18173. }
  18174. },
  18175. url: "/projects/:project_id"
  18176. },
  18177. deleteCard: {
  18178. headers: {
  18179. accept: "application/vnd.github.inertia-preview+json"
  18180. },
  18181. method: "DELETE",
  18182. params: {
  18183. card_id: {
  18184. required: true,
  18185. type: "integer"
  18186. }
  18187. },
  18188. url: "/projects/columns/cards/:card_id"
  18189. },
  18190. deleteColumn: {
  18191. headers: {
  18192. accept: "application/vnd.github.inertia-preview+json"
  18193. },
  18194. method: "DELETE",
  18195. params: {
  18196. column_id: {
  18197. required: true,
  18198. type: "integer"
  18199. }
  18200. },
  18201. url: "/projects/columns/:column_id"
  18202. },
  18203. get: {
  18204. headers: {
  18205. accept: "application/vnd.github.inertia-preview+json"
  18206. },
  18207. method: "GET",
  18208. params: {
  18209. project_id: {
  18210. required: true,
  18211. type: "integer"
  18212. }
  18213. },
  18214. url: "/projects/:project_id"
  18215. },
  18216. getCard: {
  18217. headers: {
  18218. accept: "application/vnd.github.inertia-preview+json"
  18219. },
  18220. method: "GET",
  18221. params: {
  18222. card_id: {
  18223. required: true,
  18224. type: "integer"
  18225. }
  18226. },
  18227. url: "/projects/columns/cards/:card_id"
  18228. },
  18229. getColumn: {
  18230. headers: {
  18231. accept: "application/vnd.github.inertia-preview+json"
  18232. },
  18233. method: "GET",
  18234. params: {
  18235. column_id: {
  18236. required: true,
  18237. type: "integer"
  18238. }
  18239. },
  18240. url: "/projects/columns/:column_id"
  18241. },
  18242. listCards: {
  18243. headers: {
  18244. accept: "application/vnd.github.inertia-preview+json"
  18245. },
  18246. method: "GET",
  18247. params: {
  18248. archived_state: {
  18249. enum: ["all", "archived", "not_archived"],
  18250. type: "string"
  18251. },
  18252. column_id: {
  18253. required: true,
  18254. type: "integer"
  18255. },
  18256. page: {
  18257. type: "integer"
  18258. },
  18259. per_page: {
  18260. type: "integer"
  18261. }
  18262. },
  18263. url: "/projects/columns/:column_id/cards"
  18264. },
  18265. listCollaborators: {
  18266. headers: {
  18267. accept: "application/vnd.github.inertia-preview+json"
  18268. },
  18269. method: "GET",
  18270. params: {
  18271. affiliation: {
  18272. enum: ["outside", "direct", "all"],
  18273. type: "string"
  18274. },
  18275. page: {
  18276. type: "integer"
  18277. },
  18278. per_page: {
  18279. type: "integer"
  18280. },
  18281. project_id: {
  18282. required: true,
  18283. type: "integer"
  18284. }
  18285. },
  18286. url: "/projects/:project_id/collaborators"
  18287. },
  18288. listColumns: {
  18289. headers: {
  18290. accept: "application/vnd.github.inertia-preview+json"
  18291. },
  18292. method: "GET",
  18293. params: {
  18294. page: {
  18295. type: "integer"
  18296. },
  18297. per_page: {
  18298. type: "integer"
  18299. },
  18300. project_id: {
  18301. required: true,
  18302. type: "integer"
  18303. }
  18304. },
  18305. url: "/projects/:project_id/columns"
  18306. },
  18307. listForOrg: {
  18308. headers: {
  18309. accept: "application/vnd.github.inertia-preview+json"
  18310. },
  18311. method: "GET",
  18312. params: {
  18313. org: {
  18314. required: true,
  18315. type: "string"
  18316. },
  18317. page: {
  18318. type: "integer"
  18319. },
  18320. per_page: {
  18321. type: "integer"
  18322. },
  18323. state: {
  18324. enum: ["open", "closed", "all"],
  18325. type: "string"
  18326. }
  18327. },
  18328. url: "/orgs/:org/projects"
  18329. },
  18330. listForRepo: {
  18331. headers: {
  18332. accept: "application/vnd.github.inertia-preview+json"
  18333. },
  18334. method: "GET",
  18335. params: {
  18336. owner: {
  18337. required: true,
  18338. type: "string"
  18339. },
  18340. page: {
  18341. type: "integer"
  18342. },
  18343. per_page: {
  18344. type: "integer"
  18345. },
  18346. repo: {
  18347. required: true,
  18348. type: "string"
  18349. },
  18350. state: {
  18351. enum: ["open", "closed", "all"],
  18352. type: "string"
  18353. }
  18354. },
  18355. url: "/repos/:owner/:repo/projects"
  18356. },
  18357. listForUser: {
  18358. headers: {
  18359. accept: "application/vnd.github.inertia-preview+json"
  18360. },
  18361. method: "GET",
  18362. params: {
  18363. page: {
  18364. type: "integer"
  18365. },
  18366. per_page: {
  18367. type: "integer"
  18368. },
  18369. state: {
  18370. enum: ["open", "closed", "all"],
  18371. type: "string"
  18372. },
  18373. username: {
  18374. required: true,
  18375. type: "string"
  18376. }
  18377. },
  18378. url: "/users/:username/projects"
  18379. },
  18380. moveCard: {
  18381. headers: {
  18382. accept: "application/vnd.github.inertia-preview+json"
  18383. },
  18384. method: "POST",
  18385. params: {
  18386. card_id: {
  18387. required: true,
  18388. type: "integer"
  18389. },
  18390. column_id: {
  18391. type: "integer"
  18392. },
  18393. position: {
  18394. required: true,
  18395. type: "string",
  18396. validation: "^(top|bottom|after:\\d+)$"
  18397. }
  18398. },
  18399. url: "/projects/columns/cards/:card_id/moves"
  18400. },
  18401. moveColumn: {
  18402. headers: {
  18403. accept: "application/vnd.github.inertia-preview+json"
  18404. },
  18405. method: "POST",
  18406. params: {
  18407. column_id: {
  18408. required: true,
  18409. type: "integer"
  18410. },
  18411. position: {
  18412. required: true,
  18413. type: "string",
  18414. validation: "^(first|last|after:\\d+)$"
  18415. }
  18416. },
  18417. url: "/projects/columns/:column_id/moves"
  18418. },
  18419. removeCollaborator: {
  18420. headers: {
  18421. accept: "application/vnd.github.inertia-preview+json"
  18422. },
  18423. method: "DELETE",
  18424. params: {
  18425. project_id: {
  18426. required: true,
  18427. type: "integer"
  18428. },
  18429. username: {
  18430. required: true,
  18431. type: "string"
  18432. }
  18433. },
  18434. url: "/projects/:project_id/collaborators/:username"
  18435. },
  18436. reviewUserPermissionLevel: {
  18437. headers: {
  18438. accept: "application/vnd.github.inertia-preview+json"
  18439. },
  18440. method: "GET",
  18441. params: {
  18442. project_id: {
  18443. required: true,
  18444. type: "integer"
  18445. },
  18446. username: {
  18447. required: true,
  18448. type: "string"
  18449. }
  18450. },
  18451. url: "/projects/:project_id/collaborators/:username/permission"
  18452. },
  18453. update: {
  18454. headers: {
  18455. accept: "application/vnd.github.inertia-preview+json"
  18456. },
  18457. method: "PATCH",
  18458. params: {
  18459. body: {
  18460. type: "string"
  18461. },
  18462. name: {
  18463. type: "string"
  18464. },
  18465. organization_permission: {
  18466. type: "string"
  18467. },
  18468. private: {
  18469. type: "boolean"
  18470. },
  18471. project_id: {
  18472. required: true,
  18473. type: "integer"
  18474. },
  18475. state: {
  18476. enum: ["open", "closed"],
  18477. type: "string"
  18478. }
  18479. },
  18480. url: "/projects/:project_id"
  18481. },
  18482. updateCard: {
  18483. headers: {
  18484. accept: "application/vnd.github.inertia-preview+json"
  18485. },
  18486. method: "PATCH",
  18487. params: {
  18488. archived: {
  18489. type: "boolean"
  18490. },
  18491. card_id: {
  18492. required: true,
  18493. type: "integer"
  18494. },
  18495. note: {
  18496. type: "string"
  18497. }
  18498. },
  18499. url: "/projects/columns/cards/:card_id"
  18500. },
  18501. updateColumn: {
  18502. headers: {
  18503. accept: "application/vnd.github.inertia-preview+json"
  18504. },
  18505. method: "PATCH",
  18506. params: {
  18507. column_id: {
  18508. required: true,
  18509. type: "integer"
  18510. },
  18511. name: {
  18512. required: true,
  18513. type: "string"
  18514. }
  18515. },
  18516. url: "/projects/columns/:column_id"
  18517. }
  18518. },
  18519. pulls: {
  18520. checkIfMerged: {
  18521. method: "GET",
  18522. params: {
  18523. number: {
  18524. alias: "pull_number",
  18525. deprecated: true,
  18526. type: "integer"
  18527. },
  18528. owner: {
  18529. required: true,
  18530. type: "string"
  18531. },
  18532. pull_number: {
  18533. required: true,
  18534. type: "integer"
  18535. },
  18536. repo: {
  18537. required: true,
  18538. type: "string"
  18539. }
  18540. },
  18541. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18542. },
  18543. create: {
  18544. method: "POST",
  18545. params: {
  18546. base: {
  18547. required: true,
  18548. type: "string"
  18549. },
  18550. body: {
  18551. type: "string"
  18552. },
  18553. draft: {
  18554. type: "boolean"
  18555. },
  18556. head: {
  18557. required: true,
  18558. type: "string"
  18559. },
  18560. maintainer_can_modify: {
  18561. type: "boolean"
  18562. },
  18563. owner: {
  18564. required: true,
  18565. type: "string"
  18566. },
  18567. repo: {
  18568. required: true,
  18569. type: "string"
  18570. },
  18571. title: {
  18572. required: true,
  18573. type: "string"
  18574. }
  18575. },
  18576. url: "/repos/:owner/:repo/pulls"
  18577. },
  18578. createComment: {
  18579. method: "POST",
  18580. params: {
  18581. body: {
  18582. required: true,
  18583. type: "string"
  18584. },
  18585. commit_id: {
  18586. required: true,
  18587. type: "string"
  18588. },
  18589. in_reply_to: {
  18590. deprecated: true,
  18591. 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.",
  18592. type: "integer"
  18593. },
  18594. line: {
  18595. type: "integer"
  18596. },
  18597. number: {
  18598. alias: "pull_number",
  18599. deprecated: true,
  18600. type: "integer"
  18601. },
  18602. owner: {
  18603. required: true,
  18604. type: "string"
  18605. },
  18606. path: {
  18607. required: true,
  18608. type: "string"
  18609. },
  18610. position: {
  18611. type: "integer"
  18612. },
  18613. pull_number: {
  18614. required: true,
  18615. type: "integer"
  18616. },
  18617. repo: {
  18618. required: true,
  18619. type: "string"
  18620. },
  18621. side: {
  18622. enum: ["LEFT", "RIGHT"],
  18623. type: "string"
  18624. },
  18625. start_line: {
  18626. type: "integer"
  18627. },
  18628. start_side: {
  18629. enum: ["LEFT", "RIGHT", "side"],
  18630. type: "string"
  18631. }
  18632. },
  18633. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18634. },
  18635. createCommentReply: {
  18636. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18637. method: "POST",
  18638. params: {
  18639. body: {
  18640. required: true,
  18641. type: "string"
  18642. },
  18643. commit_id: {
  18644. required: true,
  18645. type: "string"
  18646. },
  18647. in_reply_to: {
  18648. deprecated: true,
  18649. 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.",
  18650. type: "integer"
  18651. },
  18652. line: {
  18653. type: "integer"
  18654. },
  18655. number: {
  18656. alias: "pull_number",
  18657. deprecated: true,
  18658. type: "integer"
  18659. },
  18660. owner: {
  18661. required: true,
  18662. type: "string"
  18663. },
  18664. path: {
  18665. required: true,
  18666. type: "string"
  18667. },
  18668. position: {
  18669. type: "integer"
  18670. },
  18671. pull_number: {
  18672. required: true,
  18673. type: "integer"
  18674. },
  18675. repo: {
  18676. required: true,
  18677. type: "string"
  18678. },
  18679. side: {
  18680. enum: ["LEFT", "RIGHT"],
  18681. type: "string"
  18682. },
  18683. start_line: {
  18684. type: "integer"
  18685. },
  18686. start_side: {
  18687. enum: ["LEFT", "RIGHT", "side"],
  18688. type: "string"
  18689. }
  18690. },
  18691. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18692. },
  18693. createFromIssue: {
  18694. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18695. method: "POST",
  18696. params: {
  18697. base: {
  18698. required: true,
  18699. type: "string"
  18700. },
  18701. draft: {
  18702. type: "boolean"
  18703. },
  18704. head: {
  18705. required: true,
  18706. type: "string"
  18707. },
  18708. issue: {
  18709. required: true,
  18710. type: "integer"
  18711. },
  18712. maintainer_can_modify: {
  18713. type: "boolean"
  18714. },
  18715. owner: {
  18716. required: true,
  18717. type: "string"
  18718. },
  18719. repo: {
  18720. required: true,
  18721. type: "string"
  18722. }
  18723. },
  18724. url: "/repos/:owner/:repo/pulls"
  18725. },
  18726. createReview: {
  18727. method: "POST",
  18728. params: {
  18729. body: {
  18730. type: "string"
  18731. },
  18732. comments: {
  18733. type: "object[]"
  18734. },
  18735. "comments[].body": {
  18736. required: true,
  18737. type: "string"
  18738. },
  18739. "comments[].path": {
  18740. required: true,
  18741. type: "string"
  18742. },
  18743. "comments[].position": {
  18744. required: true,
  18745. type: "integer"
  18746. },
  18747. commit_id: {
  18748. type: "string"
  18749. },
  18750. event: {
  18751. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18752. type: "string"
  18753. },
  18754. number: {
  18755. alias: "pull_number",
  18756. deprecated: true,
  18757. type: "integer"
  18758. },
  18759. owner: {
  18760. required: true,
  18761. type: "string"
  18762. },
  18763. pull_number: {
  18764. required: true,
  18765. type: "integer"
  18766. },
  18767. repo: {
  18768. required: true,
  18769. type: "string"
  18770. }
  18771. },
  18772. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18773. },
  18774. createReviewCommentReply: {
  18775. method: "POST",
  18776. params: {
  18777. body: {
  18778. required: true,
  18779. type: "string"
  18780. },
  18781. comment_id: {
  18782. required: true,
  18783. type: "integer"
  18784. },
  18785. owner: {
  18786. required: true,
  18787. type: "string"
  18788. },
  18789. pull_number: {
  18790. required: true,
  18791. type: "integer"
  18792. },
  18793. repo: {
  18794. required: true,
  18795. type: "string"
  18796. }
  18797. },
  18798. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18799. },
  18800. createReviewRequest: {
  18801. method: "POST",
  18802. params: {
  18803. number: {
  18804. alias: "pull_number",
  18805. deprecated: true,
  18806. type: "integer"
  18807. },
  18808. owner: {
  18809. required: true,
  18810. type: "string"
  18811. },
  18812. pull_number: {
  18813. required: true,
  18814. type: "integer"
  18815. },
  18816. repo: {
  18817. required: true,
  18818. type: "string"
  18819. },
  18820. reviewers: {
  18821. type: "string[]"
  18822. },
  18823. team_reviewers: {
  18824. type: "string[]"
  18825. }
  18826. },
  18827. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18828. },
  18829. deleteComment: {
  18830. method: "DELETE",
  18831. params: {
  18832. comment_id: {
  18833. required: true,
  18834. type: "integer"
  18835. },
  18836. owner: {
  18837. required: true,
  18838. type: "string"
  18839. },
  18840. repo: {
  18841. required: true,
  18842. type: "string"
  18843. }
  18844. },
  18845. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18846. },
  18847. deletePendingReview: {
  18848. method: "DELETE",
  18849. params: {
  18850. number: {
  18851. alias: "pull_number",
  18852. deprecated: true,
  18853. type: "integer"
  18854. },
  18855. owner: {
  18856. required: true,
  18857. type: "string"
  18858. },
  18859. pull_number: {
  18860. required: true,
  18861. type: "integer"
  18862. },
  18863. repo: {
  18864. required: true,
  18865. type: "string"
  18866. },
  18867. review_id: {
  18868. required: true,
  18869. type: "integer"
  18870. }
  18871. },
  18872. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18873. },
  18874. deleteReviewRequest: {
  18875. method: "DELETE",
  18876. params: {
  18877. number: {
  18878. alias: "pull_number",
  18879. deprecated: true,
  18880. type: "integer"
  18881. },
  18882. owner: {
  18883. required: true,
  18884. type: "string"
  18885. },
  18886. pull_number: {
  18887. required: true,
  18888. type: "integer"
  18889. },
  18890. repo: {
  18891. required: true,
  18892. type: "string"
  18893. },
  18894. reviewers: {
  18895. type: "string[]"
  18896. },
  18897. team_reviewers: {
  18898. type: "string[]"
  18899. }
  18900. },
  18901. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18902. },
  18903. dismissReview: {
  18904. method: "PUT",
  18905. params: {
  18906. message: {
  18907. required: true,
  18908. type: "string"
  18909. },
  18910. number: {
  18911. alias: "pull_number",
  18912. deprecated: true,
  18913. type: "integer"
  18914. },
  18915. owner: {
  18916. required: true,
  18917. type: "string"
  18918. },
  18919. pull_number: {
  18920. required: true,
  18921. type: "integer"
  18922. },
  18923. repo: {
  18924. required: true,
  18925. type: "string"
  18926. },
  18927. review_id: {
  18928. required: true,
  18929. type: "integer"
  18930. }
  18931. },
  18932. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18933. },
  18934. get: {
  18935. method: "GET",
  18936. params: {
  18937. number: {
  18938. alias: "pull_number",
  18939. deprecated: true,
  18940. type: "integer"
  18941. },
  18942. owner: {
  18943. required: true,
  18944. type: "string"
  18945. },
  18946. pull_number: {
  18947. required: true,
  18948. type: "integer"
  18949. },
  18950. repo: {
  18951. required: true,
  18952. type: "string"
  18953. }
  18954. },
  18955. url: "/repos/:owner/:repo/pulls/:pull_number"
  18956. },
  18957. getComment: {
  18958. method: "GET",
  18959. params: {
  18960. comment_id: {
  18961. required: true,
  18962. type: "integer"
  18963. },
  18964. owner: {
  18965. required: true,
  18966. type: "string"
  18967. },
  18968. repo: {
  18969. required: true,
  18970. type: "string"
  18971. }
  18972. },
  18973. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18974. },
  18975. getCommentsForReview: {
  18976. method: "GET",
  18977. params: {
  18978. number: {
  18979. alias: "pull_number",
  18980. deprecated: true,
  18981. type: "integer"
  18982. },
  18983. owner: {
  18984. required: true,
  18985. type: "string"
  18986. },
  18987. page: {
  18988. type: "integer"
  18989. },
  18990. per_page: {
  18991. type: "integer"
  18992. },
  18993. pull_number: {
  18994. required: true,
  18995. type: "integer"
  18996. },
  18997. repo: {
  18998. required: true,
  18999. type: "string"
  19000. },
  19001. review_id: {
  19002. required: true,
  19003. type: "integer"
  19004. }
  19005. },
  19006. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  19007. },
  19008. getReview: {
  19009. method: "GET",
  19010. params: {
  19011. number: {
  19012. alias: "pull_number",
  19013. deprecated: true,
  19014. type: "integer"
  19015. },
  19016. owner: {
  19017. required: true,
  19018. type: "string"
  19019. },
  19020. pull_number: {
  19021. required: true,
  19022. type: "integer"
  19023. },
  19024. repo: {
  19025. required: true,
  19026. type: "string"
  19027. },
  19028. review_id: {
  19029. required: true,
  19030. type: "integer"
  19031. }
  19032. },
  19033. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19034. },
  19035. list: {
  19036. method: "GET",
  19037. params: {
  19038. base: {
  19039. type: "string"
  19040. },
  19041. direction: {
  19042. enum: ["asc", "desc"],
  19043. type: "string"
  19044. },
  19045. head: {
  19046. type: "string"
  19047. },
  19048. owner: {
  19049. required: true,
  19050. type: "string"
  19051. },
  19052. page: {
  19053. type: "integer"
  19054. },
  19055. per_page: {
  19056. type: "integer"
  19057. },
  19058. repo: {
  19059. required: true,
  19060. type: "string"
  19061. },
  19062. sort: {
  19063. enum: ["created", "updated", "popularity", "long-running"],
  19064. type: "string"
  19065. },
  19066. state: {
  19067. enum: ["open", "closed", "all"],
  19068. type: "string"
  19069. }
  19070. },
  19071. url: "/repos/:owner/:repo/pulls"
  19072. },
  19073. listComments: {
  19074. method: "GET",
  19075. params: {
  19076. direction: {
  19077. enum: ["asc", "desc"],
  19078. type: "string"
  19079. },
  19080. number: {
  19081. alias: "pull_number",
  19082. deprecated: true,
  19083. type: "integer"
  19084. },
  19085. owner: {
  19086. required: true,
  19087. type: "string"
  19088. },
  19089. page: {
  19090. type: "integer"
  19091. },
  19092. per_page: {
  19093. type: "integer"
  19094. },
  19095. pull_number: {
  19096. required: true,
  19097. type: "integer"
  19098. },
  19099. repo: {
  19100. required: true,
  19101. type: "string"
  19102. },
  19103. since: {
  19104. type: "string"
  19105. },
  19106. sort: {
  19107. enum: ["created", "updated"],
  19108. type: "string"
  19109. }
  19110. },
  19111. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19112. },
  19113. listCommentsForRepo: {
  19114. method: "GET",
  19115. params: {
  19116. direction: {
  19117. enum: ["asc", "desc"],
  19118. type: "string"
  19119. },
  19120. owner: {
  19121. required: true,
  19122. type: "string"
  19123. },
  19124. page: {
  19125. type: "integer"
  19126. },
  19127. per_page: {
  19128. type: "integer"
  19129. },
  19130. repo: {
  19131. required: true,
  19132. type: "string"
  19133. },
  19134. since: {
  19135. type: "string"
  19136. },
  19137. sort: {
  19138. enum: ["created", "updated"],
  19139. type: "string"
  19140. }
  19141. },
  19142. url: "/repos/:owner/:repo/pulls/comments"
  19143. },
  19144. listCommits: {
  19145. method: "GET",
  19146. params: {
  19147. number: {
  19148. alias: "pull_number",
  19149. deprecated: true,
  19150. type: "integer"
  19151. },
  19152. owner: {
  19153. required: true,
  19154. type: "string"
  19155. },
  19156. page: {
  19157. type: "integer"
  19158. },
  19159. per_page: {
  19160. type: "integer"
  19161. },
  19162. pull_number: {
  19163. required: true,
  19164. type: "integer"
  19165. },
  19166. repo: {
  19167. required: true,
  19168. type: "string"
  19169. }
  19170. },
  19171. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19172. },
  19173. listFiles: {
  19174. method: "GET",
  19175. params: {
  19176. number: {
  19177. alias: "pull_number",
  19178. deprecated: true,
  19179. type: "integer"
  19180. },
  19181. owner: {
  19182. required: true,
  19183. type: "string"
  19184. },
  19185. page: {
  19186. type: "integer"
  19187. },
  19188. per_page: {
  19189. type: "integer"
  19190. },
  19191. pull_number: {
  19192. required: true,
  19193. type: "integer"
  19194. },
  19195. repo: {
  19196. required: true,
  19197. type: "string"
  19198. }
  19199. },
  19200. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19201. },
  19202. listReviewRequests: {
  19203. method: "GET",
  19204. params: {
  19205. number: {
  19206. alias: "pull_number",
  19207. deprecated: true,
  19208. type: "integer"
  19209. },
  19210. owner: {
  19211. required: true,
  19212. type: "string"
  19213. },
  19214. page: {
  19215. type: "integer"
  19216. },
  19217. per_page: {
  19218. type: "integer"
  19219. },
  19220. pull_number: {
  19221. required: true,
  19222. type: "integer"
  19223. },
  19224. repo: {
  19225. required: true,
  19226. type: "string"
  19227. }
  19228. },
  19229. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19230. },
  19231. listReviews: {
  19232. method: "GET",
  19233. params: {
  19234. number: {
  19235. alias: "pull_number",
  19236. deprecated: true,
  19237. type: "integer"
  19238. },
  19239. owner: {
  19240. required: true,
  19241. type: "string"
  19242. },
  19243. page: {
  19244. type: "integer"
  19245. },
  19246. per_page: {
  19247. type: "integer"
  19248. },
  19249. pull_number: {
  19250. required: true,
  19251. type: "integer"
  19252. },
  19253. repo: {
  19254. required: true,
  19255. type: "string"
  19256. }
  19257. },
  19258. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19259. },
  19260. merge: {
  19261. method: "PUT",
  19262. params: {
  19263. commit_message: {
  19264. type: "string"
  19265. },
  19266. commit_title: {
  19267. type: "string"
  19268. },
  19269. merge_method: {
  19270. enum: ["merge", "squash", "rebase"],
  19271. type: "string"
  19272. },
  19273. number: {
  19274. alias: "pull_number",
  19275. deprecated: true,
  19276. type: "integer"
  19277. },
  19278. owner: {
  19279. required: true,
  19280. type: "string"
  19281. },
  19282. pull_number: {
  19283. required: true,
  19284. type: "integer"
  19285. },
  19286. repo: {
  19287. required: true,
  19288. type: "string"
  19289. },
  19290. sha: {
  19291. type: "string"
  19292. }
  19293. },
  19294. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19295. },
  19296. submitReview: {
  19297. method: "POST",
  19298. params: {
  19299. body: {
  19300. type: "string"
  19301. },
  19302. event: {
  19303. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19304. required: true,
  19305. type: "string"
  19306. },
  19307. number: {
  19308. alias: "pull_number",
  19309. deprecated: true,
  19310. type: "integer"
  19311. },
  19312. owner: {
  19313. required: true,
  19314. type: "string"
  19315. },
  19316. pull_number: {
  19317. required: true,
  19318. type: "integer"
  19319. },
  19320. repo: {
  19321. required: true,
  19322. type: "string"
  19323. },
  19324. review_id: {
  19325. required: true,
  19326. type: "integer"
  19327. }
  19328. },
  19329. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19330. },
  19331. update: {
  19332. method: "PATCH",
  19333. params: {
  19334. base: {
  19335. type: "string"
  19336. },
  19337. body: {
  19338. type: "string"
  19339. },
  19340. maintainer_can_modify: {
  19341. type: "boolean"
  19342. },
  19343. number: {
  19344. alias: "pull_number",
  19345. deprecated: true,
  19346. type: "integer"
  19347. },
  19348. owner: {
  19349. required: true,
  19350. type: "string"
  19351. },
  19352. pull_number: {
  19353. required: true,
  19354. type: "integer"
  19355. },
  19356. repo: {
  19357. required: true,
  19358. type: "string"
  19359. },
  19360. state: {
  19361. enum: ["open", "closed"],
  19362. type: "string"
  19363. },
  19364. title: {
  19365. type: "string"
  19366. }
  19367. },
  19368. url: "/repos/:owner/:repo/pulls/:pull_number"
  19369. },
  19370. updateBranch: {
  19371. headers: {
  19372. accept: "application/vnd.github.lydian-preview+json"
  19373. },
  19374. method: "PUT",
  19375. params: {
  19376. expected_head_sha: {
  19377. type: "string"
  19378. },
  19379. owner: {
  19380. required: true,
  19381. type: "string"
  19382. },
  19383. pull_number: {
  19384. required: true,
  19385. type: "integer"
  19386. },
  19387. repo: {
  19388. required: true,
  19389. type: "string"
  19390. }
  19391. },
  19392. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19393. },
  19394. updateComment: {
  19395. method: "PATCH",
  19396. params: {
  19397. body: {
  19398. required: true,
  19399. type: "string"
  19400. },
  19401. comment_id: {
  19402. required: true,
  19403. type: "integer"
  19404. },
  19405. owner: {
  19406. required: true,
  19407. type: "string"
  19408. },
  19409. repo: {
  19410. required: true,
  19411. type: "string"
  19412. }
  19413. },
  19414. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19415. },
  19416. updateReview: {
  19417. method: "PUT",
  19418. params: {
  19419. body: {
  19420. required: true,
  19421. type: "string"
  19422. },
  19423. number: {
  19424. alias: "pull_number",
  19425. deprecated: true,
  19426. type: "integer"
  19427. },
  19428. owner: {
  19429. required: true,
  19430. type: "string"
  19431. },
  19432. pull_number: {
  19433. required: true,
  19434. type: "integer"
  19435. },
  19436. repo: {
  19437. required: true,
  19438. type: "string"
  19439. },
  19440. review_id: {
  19441. required: true,
  19442. type: "integer"
  19443. }
  19444. },
  19445. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19446. }
  19447. },
  19448. rateLimit: {
  19449. get: {
  19450. method: "GET",
  19451. params: {},
  19452. url: "/rate_limit"
  19453. }
  19454. },
  19455. reactions: {
  19456. createForCommitComment: {
  19457. headers: {
  19458. accept: "application/vnd.github.squirrel-girl-preview+json"
  19459. },
  19460. method: "POST",
  19461. params: {
  19462. comment_id: {
  19463. required: true,
  19464. type: "integer"
  19465. },
  19466. content: {
  19467. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19468. required: true,
  19469. type: "string"
  19470. },
  19471. owner: {
  19472. required: true,
  19473. type: "string"
  19474. },
  19475. repo: {
  19476. required: true,
  19477. type: "string"
  19478. }
  19479. },
  19480. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19481. },
  19482. createForIssue: {
  19483. headers: {
  19484. accept: "application/vnd.github.squirrel-girl-preview+json"
  19485. },
  19486. method: "POST",
  19487. params: {
  19488. content: {
  19489. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19490. required: true,
  19491. type: "string"
  19492. },
  19493. issue_number: {
  19494. required: true,
  19495. type: "integer"
  19496. },
  19497. number: {
  19498. alias: "issue_number",
  19499. deprecated: true,
  19500. type: "integer"
  19501. },
  19502. owner: {
  19503. required: true,
  19504. type: "string"
  19505. },
  19506. repo: {
  19507. required: true,
  19508. type: "string"
  19509. }
  19510. },
  19511. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19512. },
  19513. createForIssueComment: {
  19514. headers: {
  19515. accept: "application/vnd.github.squirrel-girl-preview+json"
  19516. },
  19517. method: "POST",
  19518. params: {
  19519. comment_id: {
  19520. required: true,
  19521. type: "integer"
  19522. },
  19523. content: {
  19524. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19525. required: true,
  19526. type: "string"
  19527. },
  19528. owner: {
  19529. required: true,
  19530. type: "string"
  19531. },
  19532. repo: {
  19533. required: true,
  19534. type: "string"
  19535. }
  19536. },
  19537. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19538. },
  19539. createForPullRequestReviewComment: {
  19540. headers: {
  19541. accept: "application/vnd.github.squirrel-girl-preview+json"
  19542. },
  19543. method: "POST",
  19544. params: {
  19545. comment_id: {
  19546. required: true,
  19547. type: "integer"
  19548. },
  19549. content: {
  19550. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19551. required: true,
  19552. type: "string"
  19553. },
  19554. owner: {
  19555. required: true,
  19556. type: "string"
  19557. },
  19558. repo: {
  19559. required: true,
  19560. type: "string"
  19561. }
  19562. },
  19563. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19564. },
  19565. createForTeamDiscussion: {
  19566. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19567. headers: {
  19568. accept: "application/vnd.github.squirrel-girl-preview+json"
  19569. },
  19570. method: "POST",
  19571. params: {
  19572. content: {
  19573. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19574. required: true,
  19575. type: "string"
  19576. },
  19577. discussion_number: {
  19578. required: true,
  19579. type: "integer"
  19580. },
  19581. team_id: {
  19582. required: true,
  19583. type: "integer"
  19584. }
  19585. },
  19586. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19587. },
  19588. createForTeamDiscussionComment: {
  19589. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19590. headers: {
  19591. accept: "application/vnd.github.squirrel-girl-preview+json"
  19592. },
  19593. method: "POST",
  19594. params: {
  19595. comment_number: {
  19596. required: true,
  19597. type: "integer"
  19598. },
  19599. content: {
  19600. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19601. required: true,
  19602. type: "string"
  19603. },
  19604. discussion_number: {
  19605. required: true,
  19606. type: "integer"
  19607. },
  19608. team_id: {
  19609. required: true,
  19610. type: "integer"
  19611. }
  19612. },
  19613. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19614. },
  19615. createForTeamDiscussionCommentInOrg: {
  19616. headers: {
  19617. accept: "application/vnd.github.squirrel-girl-preview+json"
  19618. },
  19619. method: "POST",
  19620. params: {
  19621. comment_number: {
  19622. required: true,
  19623. type: "integer"
  19624. },
  19625. content: {
  19626. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19627. required: true,
  19628. type: "string"
  19629. },
  19630. discussion_number: {
  19631. required: true,
  19632. type: "integer"
  19633. },
  19634. org: {
  19635. required: true,
  19636. type: "string"
  19637. },
  19638. team_slug: {
  19639. required: true,
  19640. type: "string"
  19641. }
  19642. },
  19643. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19644. },
  19645. createForTeamDiscussionCommentLegacy: {
  19646. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19647. headers: {
  19648. accept: "application/vnd.github.squirrel-girl-preview+json"
  19649. },
  19650. method: "POST",
  19651. params: {
  19652. comment_number: {
  19653. required: true,
  19654. type: "integer"
  19655. },
  19656. content: {
  19657. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19658. required: true,
  19659. type: "string"
  19660. },
  19661. discussion_number: {
  19662. required: true,
  19663. type: "integer"
  19664. },
  19665. team_id: {
  19666. required: true,
  19667. type: "integer"
  19668. }
  19669. },
  19670. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19671. },
  19672. createForTeamDiscussionInOrg: {
  19673. headers: {
  19674. accept: "application/vnd.github.squirrel-girl-preview+json"
  19675. },
  19676. method: "POST",
  19677. params: {
  19678. content: {
  19679. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19680. required: true,
  19681. type: "string"
  19682. },
  19683. discussion_number: {
  19684. required: true,
  19685. type: "integer"
  19686. },
  19687. org: {
  19688. required: true,
  19689. type: "string"
  19690. },
  19691. team_slug: {
  19692. required: true,
  19693. type: "string"
  19694. }
  19695. },
  19696. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19697. },
  19698. createForTeamDiscussionLegacy: {
  19699. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19700. headers: {
  19701. accept: "application/vnd.github.squirrel-girl-preview+json"
  19702. },
  19703. method: "POST",
  19704. params: {
  19705. content: {
  19706. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19707. required: true,
  19708. type: "string"
  19709. },
  19710. discussion_number: {
  19711. required: true,
  19712. type: "integer"
  19713. },
  19714. team_id: {
  19715. required: true,
  19716. type: "integer"
  19717. }
  19718. },
  19719. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19720. },
  19721. delete: {
  19722. headers: {
  19723. accept: "application/vnd.github.squirrel-girl-preview+json"
  19724. },
  19725. method: "DELETE",
  19726. params: {
  19727. reaction_id: {
  19728. required: true,
  19729. type: "integer"
  19730. }
  19731. },
  19732. url: "/reactions/:reaction_id"
  19733. },
  19734. listForCommitComment: {
  19735. headers: {
  19736. accept: "application/vnd.github.squirrel-girl-preview+json"
  19737. },
  19738. method: "GET",
  19739. params: {
  19740. comment_id: {
  19741. required: true,
  19742. type: "integer"
  19743. },
  19744. content: {
  19745. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19746. type: "string"
  19747. },
  19748. owner: {
  19749. required: true,
  19750. type: "string"
  19751. },
  19752. page: {
  19753. type: "integer"
  19754. },
  19755. per_page: {
  19756. type: "integer"
  19757. },
  19758. repo: {
  19759. required: true,
  19760. type: "string"
  19761. }
  19762. },
  19763. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19764. },
  19765. listForIssue: {
  19766. headers: {
  19767. accept: "application/vnd.github.squirrel-girl-preview+json"
  19768. },
  19769. method: "GET",
  19770. params: {
  19771. content: {
  19772. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19773. type: "string"
  19774. },
  19775. issue_number: {
  19776. required: true,
  19777. type: "integer"
  19778. },
  19779. number: {
  19780. alias: "issue_number",
  19781. deprecated: true,
  19782. type: "integer"
  19783. },
  19784. owner: {
  19785. required: true,
  19786. type: "string"
  19787. },
  19788. page: {
  19789. type: "integer"
  19790. },
  19791. per_page: {
  19792. type: "integer"
  19793. },
  19794. repo: {
  19795. required: true,
  19796. type: "string"
  19797. }
  19798. },
  19799. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19800. },
  19801. listForIssueComment: {
  19802. headers: {
  19803. accept: "application/vnd.github.squirrel-girl-preview+json"
  19804. },
  19805. method: "GET",
  19806. params: {
  19807. comment_id: {
  19808. required: true,
  19809. type: "integer"
  19810. },
  19811. content: {
  19812. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19813. type: "string"
  19814. },
  19815. owner: {
  19816. required: true,
  19817. type: "string"
  19818. },
  19819. page: {
  19820. type: "integer"
  19821. },
  19822. per_page: {
  19823. type: "integer"
  19824. },
  19825. repo: {
  19826. required: true,
  19827. type: "string"
  19828. }
  19829. },
  19830. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19831. },
  19832. listForPullRequestReviewComment: {
  19833. headers: {
  19834. accept: "application/vnd.github.squirrel-girl-preview+json"
  19835. },
  19836. method: "GET",
  19837. params: {
  19838. comment_id: {
  19839. required: true,
  19840. type: "integer"
  19841. },
  19842. content: {
  19843. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19844. type: "string"
  19845. },
  19846. owner: {
  19847. required: true,
  19848. type: "string"
  19849. },
  19850. page: {
  19851. type: "integer"
  19852. },
  19853. per_page: {
  19854. type: "integer"
  19855. },
  19856. repo: {
  19857. required: true,
  19858. type: "string"
  19859. }
  19860. },
  19861. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19862. },
  19863. listForTeamDiscussion: {
  19864. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19865. headers: {
  19866. accept: "application/vnd.github.squirrel-girl-preview+json"
  19867. },
  19868. method: "GET",
  19869. params: {
  19870. content: {
  19871. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19872. type: "string"
  19873. },
  19874. discussion_number: {
  19875. required: true,
  19876. type: "integer"
  19877. },
  19878. page: {
  19879. type: "integer"
  19880. },
  19881. per_page: {
  19882. type: "integer"
  19883. },
  19884. team_id: {
  19885. required: true,
  19886. type: "integer"
  19887. }
  19888. },
  19889. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19890. },
  19891. listForTeamDiscussionComment: {
  19892. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19893. headers: {
  19894. accept: "application/vnd.github.squirrel-girl-preview+json"
  19895. },
  19896. method: "GET",
  19897. params: {
  19898. comment_number: {
  19899. required: true,
  19900. type: "integer"
  19901. },
  19902. content: {
  19903. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19904. type: "string"
  19905. },
  19906. discussion_number: {
  19907. required: true,
  19908. type: "integer"
  19909. },
  19910. page: {
  19911. type: "integer"
  19912. },
  19913. per_page: {
  19914. type: "integer"
  19915. },
  19916. team_id: {
  19917. required: true,
  19918. type: "integer"
  19919. }
  19920. },
  19921. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19922. },
  19923. listForTeamDiscussionCommentInOrg: {
  19924. headers: {
  19925. accept: "application/vnd.github.squirrel-girl-preview+json"
  19926. },
  19927. method: "GET",
  19928. params: {
  19929. comment_number: {
  19930. required: true,
  19931. type: "integer"
  19932. },
  19933. content: {
  19934. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19935. type: "string"
  19936. },
  19937. discussion_number: {
  19938. required: true,
  19939. type: "integer"
  19940. },
  19941. org: {
  19942. required: true,
  19943. type: "string"
  19944. },
  19945. page: {
  19946. type: "integer"
  19947. },
  19948. per_page: {
  19949. type: "integer"
  19950. },
  19951. team_slug: {
  19952. required: true,
  19953. type: "string"
  19954. }
  19955. },
  19956. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19957. },
  19958. listForTeamDiscussionCommentLegacy: {
  19959. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19960. headers: {
  19961. accept: "application/vnd.github.squirrel-girl-preview+json"
  19962. },
  19963. method: "GET",
  19964. params: {
  19965. comment_number: {
  19966. required: true,
  19967. type: "integer"
  19968. },
  19969. content: {
  19970. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19971. type: "string"
  19972. },
  19973. discussion_number: {
  19974. required: true,
  19975. type: "integer"
  19976. },
  19977. page: {
  19978. type: "integer"
  19979. },
  19980. per_page: {
  19981. type: "integer"
  19982. },
  19983. team_id: {
  19984. required: true,
  19985. type: "integer"
  19986. }
  19987. },
  19988. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19989. },
  19990. listForTeamDiscussionInOrg: {
  19991. headers: {
  19992. accept: "application/vnd.github.squirrel-girl-preview+json"
  19993. },
  19994. method: "GET",
  19995. params: {
  19996. content: {
  19997. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19998. type: "string"
  19999. },
  20000. discussion_number: {
  20001. required: true,
  20002. type: "integer"
  20003. },
  20004. org: {
  20005. required: true,
  20006. type: "string"
  20007. },
  20008. page: {
  20009. type: "integer"
  20010. },
  20011. per_page: {
  20012. type: "integer"
  20013. },
  20014. team_slug: {
  20015. required: true,
  20016. type: "string"
  20017. }
  20018. },
  20019. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  20020. },
  20021. listForTeamDiscussionLegacy: {
  20022. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  20023. headers: {
  20024. accept: "application/vnd.github.squirrel-girl-preview+json"
  20025. },
  20026. method: "GET",
  20027. params: {
  20028. content: {
  20029. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20030. type: "string"
  20031. },
  20032. discussion_number: {
  20033. required: true,
  20034. type: "integer"
  20035. },
  20036. page: {
  20037. type: "integer"
  20038. },
  20039. per_page: {
  20040. type: "integer"
  20041. },
  20042. team_id: {
  20043. required: true,
  20044. type: "integer"
  20045. }
  20046. },
  20047. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20048. }
  20049. },
  20050. repos: {
  20051. acceptInvitation: {
  20052. method: "PATCH",
  20053. params: {
  20054. invitation_id: {
  20055. required: true,
  20056. type: "integer"
  20057. }
  20058. },
  20059. url: "/user/repository_invitations/:invitation_id"
  20060. },
  20061. addCollaborator: {
  20062. method: "PUT",
  20063. params: {
  20064. owner: {
  20065. required: true,
  20066. type: "string"
  20067. },
  20068. permission: {
  20069. enum: ["pull", "push", "admin"],
  20070. type: "string"
  20071. },
  20072. repo: {
  20073. required: true,
  20074. type: "string"
  20075. },
  20076. username: {
  20077. required: true,
  20078. type: "string"
  20079. }
  20080. },
  20081. url: "/repos/:owner/:repo/collaborators/:username"
  20082. },
  20083. addDeployKey: {
  20084. method: "POST",
  20085. params: {
  20086. key: {
  20087. required: true,
  20088. type: "string"
  20089. },
  20090. owner: {
  20091. required: true,
  20092. type: "string"
  20093. },
  20094. read_only: {
  20095. type: "boolean"
  20096. },
  20097. repo: {
  20098. required: true,
  20099. type: "string"
  20100. },
  20101. title: {
  20102. type: "string"
  20103. }
  20104. },
  20105. url: "/repos/:owner/:repo/keys"
  20106. },
  20107. addProtectedBranchAdminEnforcement: {
  20108. method: "POST",
  20109. params: {
  20110. branch: {
  20111. required: true,
  20112. type: "string"
  20113. },
  20114. owner: {
  20115. required: true,
  20116. type: "string"
  20117. },
  20118. repo: {
  20119. required: true,
  20120. type: "string"
  20121. }
  20122. },
  20123. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20124. },
  20125. addProtectedBranchAppRestrictions: {
  20126. method: "POST",
  20127. params: {
  20128. apps: {
  20129. mapTo: "data",
  20130. required: true,
  20131. type: "string[]"
  20132. },
  20133. branch: {
  20134. required: true,
  20135. type: "string"
  20136. },
  20137. owner: {
  20138. required: true,
  20139. type: "string"
  20140. },
  20141. repo: {
  20142. required: true,
  20143. type: "string"
  20144. }
  20145. },
  20146. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20147. },
  20148. addProtectedBranchRequiredSignatures: {
  20149. headers: {
  20150. accept: "application/vnd.github.zzzax-preview+json"
  20151. },
  20152. method: "POST",
  20153. params: {
  20154. branch: {
  20155. required: true,
  20156. type: "string"
  20157. },
  20158. owner: {
  20159. required: true,
  20160. type: "string"
  20161. },
  20162. repo: {
  20163. required: true,
  20164. type: "string"
  20165. }
  20166. },
  20167. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20168. },
  20169. addProtectedBranchRequiredStatusChecksContexts: {
  20170. method: "POST",
  20171. params: {
  20172. branch: {
  20173. required: true,
  20174. type: "string"
  20175. },
  20176. contexts: {
  20177. mapTo: "data",
  20178. required: true,
  20179. type: "string[]"
  20180. },
  20181. owner: {
  20182. required: true,
  20183. type: "string"
  20184. },
  20185. repo: {
  20186. required: true,
  20187. type: "string"
  20188. }
  20189. },
  20190. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20191. },
  20192. addProtectedBranchTeamRestrictions: {
  20193. method: "POST",
  20194. params: {
  20195. branch: {
  20196. required: true,
  20197. type: "string"
  20198. },
  20199. owner: {
  20200. required: true,
  20201. type: "string"
  20202. },
  20203. repo: {
  20204. required: true,
  20205. type: "string"
  20206. },
  20207. teams: {
  20208. mapTo: "data",
  20209. required: true,
  20210. type: "string[]"
  20211. }
  20212. },
  20213. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20214. },
  20215. addProtectedBranchUserRestrictions: {
  20216. method: "POST",
  20217. params: {
  20218. branch: {
  20219. required: true,
  20220. type: "string"
  20221. },
  20222. owner: {
  20223. required: true,
  20224. type: "string"
  20225. },
  20226. repo: {
  20227. required: true,
  20228. type: "string"
  20229. },
  20230. users: {
  20231. mapTo: "data",
  20232. required: true,
  20233. type: "string[]"
  20234. }
  20235. },
  20236. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20237. },
  20238. checkCollaborator: {
  20239. method: "GET",
  20240. params: {
  20241. owner: {
  20242. required: true,
  20243. type: "string"
  20244. },
  20245. repo: {
  20246. required: true,
  20247. type: "string"
  20248. },
  20249. username: {
  20250. required: true,
  20251. type: "string"
  20252. }
  20253. },
  20254. url: "/repos/:owner/:repo/collaborators/:username"
  20255. },
  20256. checkVulnerabilityAlerts: {
  20257. headers: {
  20258. accept: "application/vnd.github.dorian-preview+json"
  20259. },
  20260. method: "GET",
  20261. params: {
  20262. owner: {
  20263. required: true,
  20264. type: "string"
  20265. },
  20266. repo: {
  20267. required: true,
  20268. type: "string"
  20269. }
  20270. },
  20271. url: "/repos/:owner/:repo/vulnerability-alerts"
  20272. },
  20273. compareCommits: {
  20274. method: "GET",
  20275. params: {
  20276. base: {
  20277. required: true,
  20278. type: "string"
  20279. },
  20280. head: {
  20281. required: true,
  20282. type: "string"
  20283. },
  20284. owner: {
  20285. required: true,
  20286. type: "string"
  20287. },
  20288. repo: {
  20289. required: true,
  20290. type: "string"
  20291. }
  20292. },
  20293. url: "/repos/:owner/:repo/compare/:base...:head"
  20294. },
  20295. createCommitComment: {
  20296. method: "POST",
  20297. params: {
  20298. body: {
  20299. required: true,
  20300. type: "string"
  20301. },
  20302. commit_sha: {
  20303. required: true,
  20304. type: "string"
  20305. },
  20306. line: {
  20307. type: "integer"
  20308. },
  20309. owner: {
  20310. required: true,
  20311. type: "string"
  20312. },
  20313. path: {
  20314. type: "string"
  20315. },
  20316. position: {
  20317. type: "integer"
  20318. },
  20319. repo: {
  20320. required: true,
  20321. type: "string"
  20322. },
  20323. sha: {
  20324. alias: "commit_sha",
  20325. deprecated: true,
  20326. type: "string"
  20327. }
  20328. },
  20329. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20330. },
  20331. createDeployment: {
  20332. method: "POST",
  20333. params: {
  20334. auto_merge: {
  20335. type: "boolean"
  20336. },
  20337. description: {
  20338. type: "string"
  20339. },
  20340. environment: {
  20341. type: "string"
  20342. },
  20343. owner: {
  20344. required: true,
  20345. type: "string"
  20346. },
  20347. payload: {
  20348. type: "string"
  20349. },
  20350. production_environment: {
  20351. type: "boolean"
  20352. },
  20353. ref: {
  20354. required: true,
  20355. type: "string"
  20356. },
  20357. repo: {
  20358. required: true,
  20359. type: "string"
  20360. },
  20361. required_contexts: {
  20362. type: "string[]"
  20363. },
  20364. task: {
  20365. type: "string"
  20366. },
  20367. transient_environment: {
  20368. type: "boolean"
  20369. }
  20370. },
  20371. url: "/repos/:owner/:repo/deployments"
  20372. },
  20373. createDeploymentStatus: {
  20374. method: "POST",
  20375. params: {
  20376. auto_inactive: {
  20377. type: "boolean"
  20378. },
  20379. deployment_id: {
  20380. required: true,
  20381. type: "integer"
  20382. },
  20383. description: {
  20384. type: "string"
  20385. },
  20386. environment: {
  20387. enum: ["production", "staging", "qa"],
  20388. type: "string"
  20389. },
  20390. environment_url: {
  20391. type: "string"
  20392. },
  20393. log_url: {
  20394. type: "string"
  20395. },
  20396. owner: {
  20397. required: true,
  20398. type: "string"
  20399. },
  20400. repo: {
  20401. required: true,
  20402. type: "string"
  20403. },
  20404. state: {
  20405. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20406. required: true,
  20407. type: "string"
  20408. },
  20409. target_url: {
  20410. type: "string"
  20411. }
  20412. },
  20413. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20414. },
  20415. createDispatchEvent: {
  20416. method: "POST",
  20417. params: {
  20418. client_payload: {
  20419. type: "object"
  20420. },
  20421. event_type: {
  20422. type: "string"
  20423. },
  20424. owner: {
  20425. required: true,
  20426. type: "string"
  20427. },
  20428. repo: {
  20429. required: true,
  20430. type: "string"
  20431. }
  20432. },
  20433. url: "/repos/:owner/:repo/dispatches"
  20434. },
  20435. createFile: {
  20436. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20437. method: "PUT",
  20438. params: {
  20439. author: {
  20440. type: "object"
  20441. },
  20442. "author.email": {
  20443. required: true,
  20444. type: "string"
  20445. },
  20446. "author.name": {
  20447. required: true,
  20448. type: "string"
  20449. },
  20450. branch: {
  20451. type: "string"
  20452. },
  20453. committer: {
  20454. type: "object"
  20455. },
  20456. "committer.email": {
  20457. required: true,
  20458. type: "string"
  20459. },
  20460. "committer.name": {
  20461. required: true,
  20462. type: "string"
  20463. },
  20464. content: {
  20465. required: true,
  20466. type: "string"
  20467. },
  20468. message: {
  20469. required: true,
  20470. type: "string"
  20471. },
  20472. owner: {
  20473. required: true,
  20474. type: "string"
  20475. },
  20476. path: {
  20477. required: true,
  20478. type: "string"
  20479. },
  20480. repo: {
  20481. required: true,
  20482. type: "string"
  20483. },
  20484. sha: {
  20485. type: "string"
  20486. }
  20487. },
  20488. url: "/repos/:owner/:repo/contents/:path"
  20489. },
  20490. createForAuthenticatedUser: {
  20491. method: "POST",
  20492. params: {
  20493. allow_merge_commit: {
  20494. type: "boolean"
  20495. },
  20496. allow_rebase_merge: {
  20497. type: "boolean"
  20498. },
  20499. allow_squash_merge: {
  20500. type: "boolean"
  20501. },
  20502. auto_init: {
  20503. type: "boolean"
  20504. },
  20505. delete_branch_on_merge: {
  20506. type: "boolean"
  20507. },
  20508. description: {
  20509. type: "string"
  20510. },
  20511. gitignore_template: {
  20512. type: "string"
  20513. },
  20514. has_issues: {
  20515. type: "boolean"
  20516. },
  20517. has_projects: {
  20518. type: "boolean"
  20519. },
  20520. has_wiki: {
  20521. type: "boolean"
  20522. },
  20523. homepage: {
  20524. type: "string"
  20525. },
  20526. is_template: {
  20527. type: "boolean"
  20528. },
  20529. license_template: {
  20530. type: "string"
  20531. },
  20532. name: {
  20533. required: true,
  20534. type: "string"
  20535. },
  20536. private: {
  20537. type: "boolean"
  20538. },
  20539. team_id: {
  20540. type: "integer"
  20541. },
  20542. visibility: {
  20543. enum: ["public", "private", "visibility", "internal"],
  20544. type: "string"
  20545. }
  20546. },
  20547. url: "/user/repos"
  20548. },
  20549. createFork: {
  20550. method: "POST",
  20551. params: {
  20552. organization: {
  20553. type: "string"
  20554. },
  20555. owner: {
  20556. required: true,
  20557. type: "string"
  20558. },
  20559. repo: {
  20560. required: true,
  20561. type: "string"
  20562. }
  20563. },
  20564. url: "/repos/:owner/:repo/forks"
  20565. },
  20566. createHook: {
  20567. method: "POST",
  20568. params: {
  20569. active: {
  20570. type: "boolean"
  20571. },
  20572. config: {
  20573. required: true,
  20574. type: "object"
  20575. },
  20576. "config.content_type": {
  20577. type: "string"
  20578. },
  20579. "config.insecure_ssl": {
  20580. type: "string"
  20581. },
  20582. "config.secret": {
  20583. type: "string"
  20584. },
  20585. "config.url": {
  20586. required: true,
  20587. type: "string"
  20588. },
  20589. events: {
  20590. type: "string[]"
  20591. },
  20592. name: {
  20593. type: "string"
  20594. },
  20595. owner: {
  20596. required: true,
  20597. type: "string"
  20598. },
  20599. repo: {
  20600. required: true,
  20601. type: "string"
  20602. }
  20603. },
  20604. url: "/repos/:owner/:repo/hooks"
  20605. },
  20606. createInOrg: {
  20607. method: "POST",
  20608. params: {
  20609. allow_merge_commit: {
  20610. type: "boolean"
  20611. },
  20612. allow_rebase_merge: {
  20613. type: "boolean"
  20614. },
  20615. allow_squash_merge: {
  20616. type: "boolean"
  20617. },
  20618. auto_init: {
  20619. type: "boolean"
  20620. },
  20621. delete_branch_on_merge: {
  20622. type: "boolean"
  20623. },
  20624. description: {
  20625. type: "string"
  20626. },
  20627. gitignore_template: {
  20628. type: "string"
  20629. },
  20630. has_issues: {
  20631. type: "boolean"
  20632. },
  20633. has_projects: {
  20634. type: "boolean"
  20635. },
  20636. has_wiki: {
  20637. type: "boolean"
  20638. },
  20639. homepage: {
  20640. type: "string"
  20641. },
  20642. is_template: {
  20643. type: "boolean"
  20644. },
  20645. license_template: {
  20646. type: "string"
  20647. },
  20648. name: {
  20649. required: true,
  20650. type: "string"
  20651. },
  20652. org: {
  20653. required: true,
  20654. type: "string"
  20655. },
  20656. private: {
  20657. type: "boolean"
  20658. },
  20659. team_id: {
  20660. type: "integer"
  20661. },
  20662. visibility: {
  20663. enum: ["public", "private", "visibility", "internal"],
  20664. type: "string"
  20665. }
  20666. },
  20667. url: "/orgs/:org/repos"
  20668. },
  20669. createOrUpdateFile: {
  20670. method: "PUT",
  20671. params: {
  20672. author: {
  20673. type: "object"
  20674. },
  20675. "author.email": {
  20676. required: true,
  20677. type: "string"
  20678. },
  20679. "author.name": {
  20680. required: true,
  20681. type: "string"
  20682. },
  20683. branch: {
  20684. type: "string"
  20685. },
  20686. committer: {
  20687. type: "object"
  20688. },
  20689. "committer.email": {
  20690. required: true,
  20691. type: "string"
  20692. },
  20693. "committer.name": {
  20694. required: true,
  20695. type: "string"
  20696. },
  20697. content: {
  20698. required: true,
  20699. type: "string"
  20700. },
  20701. message: {
  20702. required: true,
  20703. type: "string"
  20704. },
  20705. owner: {
  20706. required: true,
  20707. type: "string"
  20708. },
  20709. path: {
  20710. required: true,
  20711. type: "string"
  20712. },
  20713. repo: {
  20714. required: true,
  20715. type: "string"
  20716. },
  20717. sha: {
  20718. type: "string"
  20719. }
  20720. },
  20721. url: "/repos/:owner/:repo/contents/:path"
  20722. },
  20723. createRelease: {
  20724. method: "POST",
  20725. params: {
  20726. body: {
  20727. type: "string"
  20728. },
  20729. draft: {
  20730. type: "boolean"
  20731. },
  20732. name: {
  20733. type: "string"
  20734. },
  20735. owner: {
  20736. required: true,
  20737. type: "string"
  20738. },
  20739. prerelease: {
  20740. type: "boolean"
  20741. },
  20742. repo: {
  20743. required: true,
  20744. type: "string"
  20745. },
  20746. tag_name: {
  20747. required: true,
  20748. type: "string"
  20749. },
  20750. target_commitish: {
  20751. type: "string"
  20752. }
  20753. },
  20754. url: "/repos/:owner/:repo/releases"
  20755. },
  20756. createStatus: {
  20757. method: "POST",
  20758. params: {
  20759. context: {
  20760. type: "string"
  20761. },
  20762. description: {
  20763. type: "string"
  20764. },
  20765. owner: {
  20766. required: true,
  20767. type: "string"
  20768. },
  20769. repo: {
  20770. required: true,
  20771. type: "string"
  20772. },
  20773. sha: {
  20774. required: true,
  20775. type: "string"
  20776. },
  20777. state: {
  20778. enum: ["error", "failure", "pending", "success"],
  20779. required: true,
  20780. type: "string"
  20781. },
  20782. target_url: {
  20783. type: "string"
  20784. }
  20785. },
  20786. url: "/repos/:owner/:repo/statuses/:sha"
  20787. },
  20788. createUsingTemplate: {
  20789. headers: {
  20790. accept: "application/vnd.github.baptiste-preview+json"
  20791. },
  20792. method: "POST",
  20793. params: {
  20794. description: {
  20795. type: "string"
  20796. },
  20797. name: {
  20798. required: true,
  20799. type: "string"
  20800. },
  20801. owner: {
  20802. type: "string"
  20803. },
  20804. private: {
  20805. type: "boolean"
  20806. },
  20807. template_owner: {
  20808. required: true,
  20809. type: "string"
  20810. },
  20811. template_repo: {
  20812. required: true,
  20813. type: "string"
  20814. }
  20815. },
  20816. url: "/repos/:template_owner/:template_repo/generate"
  20817. },
  20818. declineInvitation: {
  20819. method: "DELETE",
  20820. params: {
  20821. invitation_id: {
  20822. required: true,
  20823. type: "integer"
  20824. }
  20825. },
  20826. url: "/user/repository_invitations/:invitation_id"
  20827. },
  20828. delete: {
  20829. method: "DELETE",
  20830. params: {
  20831. owner: {
  20832. required: true,
  20833. type: "string"
  20834. },
  20835. repo: {
  20836. required: true,
  20837. type: "string"
  20838. }
  20839. },
  20840. url: "/repos/:owner/:repo"
  20841. },
  20842. deleteCommitComment: {
  20843. method: "DELETE",
  20844. params: {
  20845. comment_id: {
  20846. required: true,
  20847. type: "integer"
  20848. },
  20849. owner: {
  20850. required: true,
  20851. type: "string"
  20852. },
  20853. repo: {
  20854. required: true,
  20855. type: "string"
  20856. }
  20857. },
  20858. url: "/repos/:owner/:repo/comments/:comment_id"
  20859. },
  20860. deleteDownload: {
  20861. method: "DELETE",
  20862. params: {
  20863. download_id: {
  20864. required: true,
  20865. type: "integer"
  20866. },
  20867. owner: {
  20868. required: true,
  20869. type: "string"
  20870. },
  20871. repo: {
  20872. required: true,
  20873. type: "string"
  20874. }
  20875. },
  20876. url: "/repos/:owner/:repo/downloads/:download_id"
  20877. },
  20878. deleteFile: {
  20879. method: "DELETE",
  20880. params: {
  20881. author: {
  20882. type: "object"
  20883. },
  20884. "author.email": {
  20885. type: "string"
  20886. },
  20887. "author.name": {
  20888. type: "string"
  20889. },
  20890. branch: {
  20891. type: "string"
  20892. },
  20893. committer: {
  20894. type: "object"
  20895. },
  20896. "committer.email": {
  20897. type: "string"
  20898. },
  20899. "committer.name": {
  20900. type: "string"
  20901. },
  20902. message: {
  20903. required: true,
  20904. type: "string"
  20905. },
  20906. owner: {
  20907. required: true,
  20908. type: "string"
  20909. },
  20910. path: {
  20911. required: true,
  20912. type: "string"
  20913. },
  20914. repo: {
  20915. required: true,
  20916. type: "string"
  20917. },
  20918. sha: {
  20919. required: true,
  20920. type: "string"
  20921. }
  20922. },
  20923. url: "/repos/:owner/:repo/contents/:path"
  20924. },
  20925. deleteHook: {
  20926. method: "DELETE",
  20927. params: {
  20928. hook_id: {
  20929. required: true,
  20930. type: "integer"
  20931. },
  20932. owner: {
  20933. required: true,
  20934. type: "string"
  20935. },
  20936. repo: {
  20937. required: true,
  20938. type: "string"
  20939. }
  20940. },
  20941. url: "/repos/:owner/:repo/hooks/:hook_id"
  20942. },
  20943. deleteInvitation: {
  20944. method: "DELETE",
  20945. params: {
  20946. invitation_id: {
  20947. required: true,
  20948. type: "integer"
  20949. },
  20950. owner: {
  20951. required: true,
  20952. type: "string"
  20953. },
  20954. repo: {
  20955. required: true,
  20956. type: "string"
  20957. }
  20958. },
  20959. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20960. },
  20961. deleteRelease: {
  20962. method: "DELETE",
  20963. params: {
  20964. owner: {
  20965. required: true,
  20966. type: "string"
  20967. },
  20968. release_id: {
  20969. required: true,
  20970. type: "integer"
  20971. },
  20972. repo: {
  20973. required: true,
  20974. type: "string"
  20975. }
  20976. },
  20977. url: "/repos/:owner/:repo/releases/:release_id"
  20978. },
  20979. deleteReleaseAsset: {
  20980. method: "DELETE",
  20981. params: {
  20982. asset_id: {
  20983. required: true,
  20984. type: "integer"
  20985. },
  20986. owner: {
  20987. required: true,
  20988. type: "string"
  20989. },
  20990. repo: {
  20991. required: true,
  20992. type: "string"
  20993. }
  20994. },
  20995. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20996. },
  20997. disableAutomatedSecurityFixes: {
  20998. headers: {
  20999. accept: "application/vnd.github.london-preview+json"
  21000. },
  21001. method: "DELETE",
  21002. params: {
  21003. owner: {
  21004. required: true,
  21005. type: "string"
  21006. },
  21007. repo: {
  21008. required: true,
  21009. type: "string"
  21010. }
  21011. },
  21012. url: "/repos/:owner/:repo/automated-security-fixes"
  21013. },
  21014. disablePagesSite: {
  21015. headers: {
  21016. accept: "application/vnd.github.switcheroo-preview+json"
  21017. },
  21018. method: "DELETE",
  21019. params: {
  21020. owner: {
  21021. required: true,
  21022. type: "string"
  21023. },
  21024. repo: {
  21025. required: true,
  21026. type: "string"
  21027. }
  21028. },
  21029. url: "/repos/:owner/:repo/pages"
  21030. },
  21031. disableVulnerabilityAlerts: {
  21032. headers: {
  21033. accept: "application/vnd.github.dorian-preview+json"
  21034. },
  21035. method: "DELETE",
  21036. params: {
  21037. owner: {
  21038. required: true,
  21039. type: "string"
  21040. },
  21041. repo: {
  21042. required: true,
  21043. type: "string"
  21044. }
  21045. },
  21046. url: "/repos/:owner/:repo/vulnerability-alerts"
  21047. },
  21048. enableAutomatedSecurityFixes: {
  21049. headers: {
  21050. accept: "application/vnd.github.london-preview+json"
  21051. },
  21052. method: "PUT",
  21053. params: {
  21054. owner: {
  21055. required: true,
  21056. type: "string"
  21057. },
  21058. repo: {
  21059. required: true,
  21060. type: "string"
  21061. }
  21062. },
  21063. url: "/repos/:owner/:repo/automated-security-fixes"
  21064. },
  21065. enablePagesSite: {
  21066. headers: {
  21067. accept: "application/vnd.github.switcheroo-preview+json"
  21068. },
  21069. method: "POST",
  21070. params: {
  21071. owner: {
  21072. required: true,
  21073. type: "string"
  21074. },
  21075. repo: {
  21076. required: true,
  21077. type: "string"
  21078. },
  21079. source: {
  21080. type: "object"
  21081. },
  21082. "source.branch": {
  21083. enum: ["master", "gh-pages"],
  21084. type: "string"
  21085. },
  21086. "source.path": {
  21087. type: "string"
  21088. }
  21089. },
  21090. url: "/repos/:owner/:repo/pages"
  21091. },
  21092. enableVulnerabilityAlerts: {
  21093. headers: {
  21094. accept: "application/vnd.github.dorian-preview+json"
  21095. },
  21096. method: "PUT",
  21097. params: {
  21098. owner: {
  21099. required: true,
  21100. type: "string"
  21101. },
  21102. repo: {
  21103. required: true,
  21104. type: "string"
  21105. }
  21106. },
  21107. url: "/repos/:owner/:repo/vulnerability-alerts"
  21108. },
  21109. get: {
  21110. method: "GET",
  21111. params: {
  21112. owner: {
  21113. required: true,
  21114. type: "string"
  21115. },
  21116. repo: {
  21117. required: true,
  21118. type: "string"
  21119. }
  21120. },
  21121. url: "/repos/:owner/:repo"
  21122. },
  21123. getAppsWithAccessToProtectedBranch: {
  21124. method: "GET",
  21125. params: {
  21126. branch: {
  21127. required: true,
  21128. type: "string"
  21129. },
  21130. owner: {
  21131. required: true,
  21132. type: "string"
  21133. },
  21134. repo: {
  21135. required: true,
  21136. type: "string"
  21137. }
  21138. },
  21139. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21140. },
  21141. getArchiveLink: {
  21142. method: "GET",
  21143. params: {
  21144. archive_format: {
  21145. required: true,
  21146. type: "string"
  21147. },
  21148. owner: {
  21149. required: true,
  21150. type: "string"
  21151. },
  21152. ref: {
  21153. required: true,
  21154. type: "string"
  21155. },
  21156. repo: {
  21157. required: true,
  21158. type: "string"
  21159. }
  21160. },
  21161. url: "/repos/:owner/:repo/:archive_format/:ref"
  21162. },
  21163. getBranch: {
  21164. method: "GET",
  21165. params: {
  21166. branch: {
  21167. required: true,
  21168. type: "string"
  21169. },
  21170. owner: {
  21171. required: true,
  21172. type: "string"
  21173. },
  21174. repo: {
  21175. required: true,
  21176. type: "string"
  21177. }
  21178. },
  21179. url: "/repos/:owner/:repo/branches/:branch"
  21180. },
  21181. getBranchProtection: {
  21182. method: "GET",
  21183. params: {
  21184. branch: {
  21185. required: true,
  21186. type: "string"
  21187. },
  21188. owner: {
  21189. required: true,
  21190. type: "string"
  21191. },
  21192. repo: {
  21193. required: true,
  21194. type: "string"
  21195. }
  21196. },
  21197. url: "/repos/:owner/:repo/branches/:branch/protection"
  21198. },
  21199. getClones: {
  21200. method: "GET",
  21201. params: {
  21202. owner: {
  21203. required: true,
  21204. type: "string"
  21205. },
  21206. per: {
  21207. enum: ["day", "week"],
  21208. type: "string"
  21209. },
  21210. repo: {
  21211. required: true,
  21212. type: "string"
  21213. }
  21214. },
  21215. url: "/repos/:owner/:repo/traffic/clones"
  21216. },
  21217. getCodeFrequencyStats: {
  21218. method: "GET",
  21219. params: {
  21220. owner: {
  21221. required: true,
  21222. type: "string"
  21223. },
  21224. repo: {
  21225. required: true,
  21226. type: "string"
  21227. }
  21228. },
  21229. url: "/repos/:owner/:repo/stats/code_frequency"
  21230. },
  21231. getCollaboratorPermissionLevel: {
  21232. method: "GET",
  21233. params: {
  21234. owner: {
  21235. required: true,
  21236. type: "string"
  21237. },
  21238. repo: {
  21239. required: true,
  21240. type: "string"
  21241. },
  21242. username: {
  21243. required: true,
  21244. type: "string"
  21245. }
  21246. },
  21247. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21248. },
  21249. getCombinedStatusForRef: {
  21250. method: "GET",
  21251. params: {
  21252. owner: {
  21253. required: true,
  21254. type: "string"
  21255. },
  21256. ref: {
  21257. required: true,
  21258. type: "string"
  21259. },
  21260. repo: {
  21261. required: true,
  21262. type: "string"
  21263. }
  21264. },
  21265. url: "/repos/:owner/:repo/commits/:ref/status"
  21266. },
  21267. getCommit: {
  21268. method: "GET",
  21269. params: {
  21270. commit_sha: {
  21271. alias: "ref",
  21272. deprecated: true,
  21273. type: "string"
  21274. },
  21275. owner: {
  21276. required: true,
  21277. type: "string"
  21278. },
  21279. ref: {
  21280. required: true,
  21281. type: "string"
  21282. },
  21283. repo: {
  21284. required: true,
  21285. type: "string"
  21286. },
  21287. sha: {
  21288. alias: "ref",
  21289. deprecated: true,
  21290. type: "string"
  21291. }
  21292. },
  21293. url: "/repos/:owner/:repo/commits/:ref"
  21294. },
  21295. getCommitActivityStats: {
  21296. method: "GET",
  21297. params: {
  21298. owner: {
  21299. required: true,
  21300. type: "string"
  21301. },
  21302. repo: {
  21303. required: true,
  21304. type: "string"
  21305. }
  21306. },
  21307. url: "/repos/:owner/:repo/stats/commit_activity"
  21308. },
  21309. getCommitComment: {
  21310. method: "GET",
  21311. params: {
  21312. comment_id: {
  21313. required: true,
  21314. type: "integer"
  21315. },
  21316. owner: {
  21317. required: true,
  21318. type: "string"
  21319. },
  21320. repo: {
  21321. required: true,
  21322. type: "string"
  21323. }
  21324. },
  21325. url: "/repos/:owner/:repo/comments/:comment_id"
  21326. },
  21327. getCommitRefSha: {
  21328. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21329. headers: {
  21330. accept: "application/vnd.github.v3.sha"
  21331. },
  21332. method: "GET",
  21333. params: {
  21334. owner: {
  21335. required: true,
  21336. type: "string"
  21337. },
  21338. ref: {
  21339. required: true,
  21340. type: "string"
  21341. },
  21342. repo: {
  21343. required: true,
  21344. type: "string"
  21345. }
  21346. },
  21347. url: "/repos/:owner/:repo/commits/:ref"
  21348. },
  21349. getContents: {
  21350. method: "GET",
  21351. params: {
  21352. owner: {
  21353. required: true,
  21354. type: "string"
  21355. },
  21356. path: {
  21357. required: true,
  21358. type: "string"
  21359. },
  21360. ref: {
  21361. type: "string"
  21362. },
  21363. repo: {
  21364. required: true,
  21365. type: "string"
  21366. }
  21367. },
  21368. url: "/repos/:owner/:repo/contents/:path"
  21369. },
  21370. getContributorsStats: {
  21371. method: "GET",
  21372. params: {
  21373. owner: {
  21374. required: true,
  21375. type: "string"
  21376. },
  21377. repo: {
  21378. required: true,
  21379. type: "string"
  21380. }
  21381. },
  21382. url: "/repos/:owner/:repo/stats/contributors"
  21383. },
  21384. getDeployKey: {
  21385. method: "GET",
  21386. params: {
  21387. key_id: {
  21388. required: true,
  21389. type: "integer"
  21390. },
  21391. owner: {
  21392. required: true,
  21393. type: "string"
  21394. },
  21395. repo: {
  21396. required: true,
  21397. type: "string"
  21398. }
  21399. },
  21400. url: "/repos/:owner/:repo/keys/:key_id"
  21401. },
  21402. getDeployment: {
  21403. method: "GET",
  21404. params: {
  21405. deployment_id: {
  21406. required: true,
  21407. type: "integer"
  21408. },
  21409. owner: {
  21410. required: true,
  21411. type: "string"
  21412. },
  21413. repo: {
  21414. required: true,
  21415. type: "string"
  21416. }
  21417. },
  21418. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21419. },
  21420. getDeploymentStatus: {
  21421. method: "GET",
  21422. params: {
  21423. deployment_id: {
  21424. required: true,
  21425. type: "integer"
  21426. },
  21427. owner: {
  21428. required: true,
  21429. type: "string"
  21430. },
  21431. repo: {
  21432. required: true,
  21433. type: "string"
  21434. },
  21435. status_id: {
  21436. required: true,
  21437. type: "integer"
  21438. }
  21439. },
  21440. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21441. },
  21442. getDownload: {
  21443. method: "GET",
  21444. params: {
  21445. download_id: {
  21446. required: true,
  21447. type: "integer"
  21448. },
  21449. owner: {
  21450. required: true,
  21451. type: "string"
  21452. },
  21453. repo: {
  21454. required: true,
  21455. type: "string"
  21456. }
  21457. },
  21458. url: "/repos/:owner/:repo/downloads/:download_id"
  21459. },
  21460. getHook: {
  21461. method: "GET",
  21462. params: {
  21463. hook_id: {
  21464. required: true,
  21465. type: "integer"
  21466. },
  21467. owner: {
  21468. required: true,
  21469. type: "string"
  21470. },
  21471. repo: {
  21472. required: true,
  21473. type: "string"
  21474. }
  21475. },
  21476. url: "/repos/:owner/:repo/hooks/:hook_id"
  21477. },
  21478. getLatestPagesBuild: {
  21479. method: "GET",
  21480. params: {
  21481. owner: {
  21482. required: true,
  21483. type: "string"
  21484. },
  21485. repo: {
  21486. required: true,
  21487. type: "string"
  21488. }
  21489. },
  21490. url: "/repos/:owner/:repo/pages/builds/latest"
  21491. },
  21492. getLatestRelease: {
  21493. method: "GET",
  21494. params: {
  21495. owner: {
  21496. required: true,
  21497. type: "string"
  21498. },
  21499. repo: {
  21500. required: true,
  21501. type: "string"
  21502. }
  21503. },
  21504. url: "/repos/:owner/:repo/releases/latest"
  21505. },
  21506. getPages: {
  21507. method: "GET",
  21508. params: {
  21509. owner: {
  21510. required: true,
  21511. type: "string"
  21512. },
  21513. repo: {
  21514. required: true,
  21515. type: "string"
  21516. }
  21517. },
  21518. url: "/repos/:owner/:repo/pages"
  21519. },
  21520. getPagesBuild: {
  21521. method: "GET",
  21522. params: {
  21523. build_id: {
  21524. required: true,
  21525. type: "integer"
  21526. },
  21527. owner: {
  21528. required: true,
  21529. type: "string"
  21530. },
  21531. repo: {
  21532. required: true,
  21533. type: "string"
  21534. }
  21535. },
  21536. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21537. },
  21538. getParticipationStats: {
  21539. method: "GET",
  21540. params: {
  21541. owner: {
  21542. required: true,
  21543. type: "string"
  21544. },
  21545. repo: {
  21546. required: true,
  21547. type: "string"
  21548. }
  21549. },
  21550. url: "/repos/:owner/:repo/stats/participation"
  21551. },
  21552. getProtectedBranchAdminEnforcement: {
  21553. method: "GET",
  21554. params: {
  21555. branch: {
  21556. required: true,
  21557. type: "string"
  21558. },
  21559. owner: {
  21560. required: true,
  21561. type: "string"
  21562. },
  21563. repo: {
  21564. required: true,
  21565. type: "string"
  21566. }
  21567. },
  21568. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21569. },
  21570. getProtectedBranchPullRequestReviewEnforcement: {
  21571. method: "GET",
  21572. params: {
  21573. branch: {
  21574. required: true,
  21575. type: "string"
  21576. },
  21577. owner: {
  21578. required: true,
  21579. type: "string"
  21580. },
  21581. repo: {
  21582. required: true,
  21583. type: "string"
  21584. }
  21585. },
  21586. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21587. },
  21588. getProtectedBranchRequiredSignatures: {
  21589. headers: {
  21590. accept: "application/vnd.github.zzzax-preview+json"
  21591. },
  21592. method: "GET",
  21593. params: {
  21594. branch: {
  21595. required: true,
  21596. type: "string"
  21597. },
  21598. owner: {
  21599. required: true,
  21600. type: "string"
  21601. },
  21602. repo: {
  21603. required: true,
  21604. type: "string"
  21605. }
  21606. },
  21607. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21608. },
  21609. getProtectedBranchRequiredStatusChecks: {
  21610. method: "GET",
  21611. params: {
  21612. branch: {
  21613. required: true,
  21614. type: "string"
  21615. },
  21616. owner: {
  21617. required: true,
  21618. type: "string"
  21619. },
  21620. repo: {
  21621. required: true,
  21622. type: "string"
  21623. }
  21624. },
  21625. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21626. },
  21627. getProtectedBranchRestrictions: {
  21628. method: "GET",
  21629. params: {
  21630. branch: {
  21631. required: true,
  21632. type: "string"
  21633. },
  21634. owner: {
  21635. required: true,
  21636. type: "string"
  21637. },
  21638. repo: {
  21639. required: true,
  21640. type: "string"
  21641. }
  21642. },
  21643. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21644. },
  21645. getPunchCardStats: {
  21646. method: "GET",
  21647. params: {
  21648. owner: {
  21649. required: true,
  21650. type: "string"
  21651. },
  21652. repo: {
  21653. required: true,
  21654. type: "string"
  21655. }
  21656. },
  21657. url: "/repos/:owner/:repo/stats/punch_card"
  21658. },
  21659. getReadme: {
  21660. method: "GET",
  21661. params: {
  21662. owner: {
  21663. required: true,
  21664. type: "string"
  21665. },
  21666. ref: {
  21667. type: "string"
  21668. },
  21669. repo: {
  21670. required: true,
  21671. type: "string"
  21672. }
  21673. },
  21674. url: "/repos/:owner/:repo/readme"
  21675. },
  21676. getRelease: {
  21677. method: "GET",
  21678. params: {
  21679. owner: {
  21680. required: true,
  21681. type: "string"
  21682. },
  21683. release_id: {
  21684. required: true,
  21685. type: "integer"
  21686. },
  21687. repo: {
  21688. required: true,
  21689. type: "string"
  21690. }
  21691. },
  21692. url: "/repos/:owner/:repo/releases/:release_id"
  21693. },
  21694. getReleaseAsset: {
  21695. method: "GET",
  21696. params: {
  21697. asset_id: {
  21698. required: true,
  21699. type: "integer"
  21700. },
  21701. owner: {
  21702. required: true,
  21703. type: "string"
  21704. },
  21705. repo: {
  21706. required: true,
  21707. type: "string"
  21708. }
  21709. },
  21710. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21711. },
  21712. getReleaseByTag: {
  21713. method: "GET",
  21714. params: {
  21715. owner: {
  21716. required: true,
  21717. type: "string"
  21718. },
  21719. repo: {
  21720. required: true,
  21721. type: "string"
  21722. },
  21723. tag: {
  21724. required: true,
  21725. type: "string"
  21726. }
  21727. },
  21728. url: "/repos/:owner/:repo/releases/tags/:tag"
  21729. },
  21730. getTeamsWithAccessToProtectedBranch: {
  21731. method: "GET",
  21732. params: {
  21733. branch: {
  21734. required: true,
  21735. type: "string"
  21736. },
  21737. owner: {
  21738. required: true,
  21739. type: "string"
  21740. },
  21741. repo: {
  21742. required: true,
  21743. type: "string"
  21744. }
  21745. },
  21746. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21747. },
  21748. getTopPaths: {
  21749. method: "GET",
  21750. params: {
  21751. owner: {
  21752. required: true,
  21753. type: "string"
  21754. },
  21755. repo: {
  21756. required: true,
  21757. type: "string"
  21758. }
  21759. },
  21760. url: "/repos/:owner/:repo/traffic/popular/paths"
  21761. },
  21762. getTopReferrers: {
  21763. method: "GET",
  21764. params: {
  21765. owner: {
  21766. required: true,
  21767. type: "string"
  21768. },
  21769. repo: {
  21770. required: true,
  21771. type: "string"
  21772. }
  21773. },
  21774. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21775. },
  21776. getUsersWithAccessToProtectedBranch: {
  21777. method: "GET",
  21778. params: {
  21779. branch: {
  21780. required: true,
  21781. type: "string"
  21782. },
  21783. owner: {
  21784. required: true,
  21785. type: "string"
  21786. },
  21787. repo: {
  21788. required: true,
  21789. type: "string"
  21790. }
  21791. },
  21792. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21793. },
  21794. getViews: {
  21795. method: "GET",
  21796. params: {
  21797. owner: {
  21798. required: true,
  21799. type: "string"
  21800. },
  21801. per: {
  21802. enum: ["day", "week"],
  21803. type: "string"
  21804. },
  21805. repo: {
  21806. required: true,
  21807. type: "string"
  21808. }
  21809. },
  21810. url: "/repos/:owner/:repo/traffic/views"
  21811. },
  21812. list: {
  21813. method: "GET",
  21814. params: {
  21815. affiliation: {
  21816. type: "string"
  21817. },
  21818. direction: {
  21819. enum: ["asc", "desc"],
  21820. type: "string"
  21821. },
  21822. page: {
  21823. type: "integer"
  21824. },
  21825. per_page: {
  21826. type: "integer"
  21827. },
  21828. sort: {
  21829. enum: ["created", "updated", "pushed", "full_name"],
  21830. type: "string"
  21831. },
  21832. type: {
  21833. enum: ["all", "owner", "public", "private", "member"],
  21834. type: "string"
  21835. },
  21836. visibility: {
  21837. enum: ["all", "public", "private"],
  21838. type: "string"
  21839. }
  21840. },
  21841. url: "/user/repos"
  21842. },
  21843. listAppsWithAccessToProtectedBranch: {
  21844. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21845. method: "GET",
  21846. params: {
  21847. branch: {
  21848. required: true,
  21849. type: "string"
  21850. },
  21851. owner: {
  21852. required: true,
  21853. type: "string"
  21854. },
  21855. repo: {
  21856. required: true,
  21857. type: "string"
  21858. }
  21859. },
  21860. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21861. },
  21862. listAssetsForRelease: {
  21863. method: "GET",
  21864. params: {
  21865. owner: {
  21866. required: true,
  21867. type: "string"
  21868. },
  21869. page: {
  21870. type: "integer"
  21871. },
  21872. per_page: {
  21873. type: "integer"
  21874. },
  21875. release_id: {
  21876. required: true,
  21877. type: "integer"
  21878. },
  21879. repo: {
  21880. required: true,
  21881. type: "string"
  21882. }
  21883. },
  21884. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21885. },
  21886. listBranches: {
  21887. method: "GET",
  21888. params: {
  21889. owner: {
  21890. required: true,
  21891. type: "string"
  21892. },
  21893. page: {
  21894. type: "integer"
  21895. },
  21896. per_page: {
  21897. type: "integer"
  21898. },
  21899. protected: {
  21900. type: "boolean"
  21901. },
  21902. repo: {
  21903. required: true,
  21904. type: "string"
  21905. }
  21906. },
  21907. url: "/repos/:owner/:repo/branches"
  21908. },
  21909. listBranchesForHeadCommit: {
  21910. headers: {
  21911. accept: "application/vnd.github.groot-preview+json"
  21912. },
  21913. method: "GET",
  21914. params: {
  21915. commit_sha: {
  21916. required: true,
  21917. type: "string"
  21918. },
  21919. owner: {
  21920. required: true,
  21921. type: "string"
  21922. },
  21923. repo: {
  21924. required: true,
  21925. type: "string"
  21926. }
  21927. },
  21928. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21929. },
  21930. listCollaborators: {
  21931. method: "GET",
  21932. params: {
  21933. affiliation: {
  21934. enum: ["outside", "direct", "all"],
  21935. type: "string"
  21936. },
  21937. owner: {
  21938. required: true,
  21939. type: "string"
  21940. },
  21941. page: {
  21942. type: "integer"
  21943. },
  21944. per_page: {
  21945. type: "integer"
  21946. },
  21947. repo: {
  21948. required: true,
  21949. type: "string"
  21950. }
  21951. },
  21952. url: "/repos/:owner/:repo/collaborators"
  21953. },
  21954. listCommentsForCommit: {
  21955. method: "GET",
  21956. params: {
  21957. commit_sha: {
  21958. required: true,
  21959. type: "string"
  21960. },
  21961. owner: {
  21962. required: true,
  21963. type: "string"
  21964. },
  21965. page: {
  21966. type: "integer"
  21967. },
  21968. per_page: {
  21969. type: "integer"
  21970. },
  21971. ref: {
  21972. alias: "commit_sha",
  21973. deprecated: true,
  21974. type: "string"
  21975. },
  21976. repo: {
  21977. required: true,
  21978. type: "string"
  21979. }
  21980. },
  21981. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21982. },
  21983. listCommitComments: {
  21984. method: "GET",
  21985. params: {
  21986. owner: {
  21987. required: true,
  21988. type: "string"
  21989. },
  21990. page: {
  21991. type: "integer"
  21992. },
  21993. per_page: {
  21994. type: "integer"
  21995. },
  21996. repo: {
  21997. required: true,
  21998. type: "string"
  21999. }
  22000. },
  22001. url: "/repos/:owner/:repo/comments"
  22002. },
  22003. listCommits: {
  22004. method: "GET",
  22005. params: {
  22006. author: {
  22007. type: "string"
  22008. },
  22009. owner: {
  22010. required: true,
  22011. type: "string"
  22012. },
  22013. page: {
  22014. type: "integer"
  22015. },
  22016. path: {
  22017. type: "string"
  22018. },
  22019. per_page: {
  22020. type: "integer"
  22021. },
  22022. repo: {
  22023. required: true,
  22024. type: "string"
  22025. },
  22026. sha: {
  22027. type: "string"
  22028. },
  22029. since: {
  22030. type: "string"
  22031. },
  22032. until: {
  22033. type: "string"
  22034. }
  22035. },
  22036. url: "/repos/:owner/:repo/commits"
  22037. },
  22038. listContributors: {
  22039. method: "GET",
  22040. params: {
  22041. anon: {
  22042. type: "string"
  22043. },
  22044. owner: {
  22045. required: true,
  22046. type: "string"
  22047. },
  22048. page: {
  22049. type: "integer"
  22050. },
  22051. per_page: {
  22052. type: "integer"
  22053. },
  22054. repo: {
  22055. required: true,
  22056. type: "string"
  22057. }
  22058. },
  22059. url: "/repos/:owner/:repo/contributors"
  22060. },
  22061. listDeployKeys: {
  22062. method: "GET",
  22063. params: {
  22064. owner: {
  22065. required: true,
  22066. type: "string"
  22067. },
  22068. page: {
  22069. type: "integer"
  22070. },
  22071. per_page: {
  22072. type: "integer"
  22073. },
  22074. repo: {
  22075. required: true,
  22076. type: "string"
  22077. }
  22078. },
  22079. url: "/repos/:owner/:repo/keys"
  22080. },
  22081. listDeploymentStatuses: {
  22082. method: "GET",
  22083. params: {
  22084. deployment_id: {
  22085. required: true,
  22086. type: "integer"
  22087. },
  22088. owner: {
  22089. required: true,
  22090. type: "string"
  22091. },
  22092. page: {
  22093. type: "integer"
  22094. },
  22095. per_page: {
  22096. type: "integer"
  22097. },
  22098. repo: {
  22099. required: true,
  22100. type: "string"
  22101. }
  22102. },
  22103. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22104. },
  22105. listDeployments: {
  22106. method: "GET",
  22107. params: {
  22108. environment: {
  22109. type: "string"
  22110. },
  22111. owner: {
  22112. required: true,
  22113. type: "string"
  22114. },
  22115. page: {
  22116. type: "integer"
  22117. },
  22118. per_page: {
  22119. type: "integer"
  22120. },
  22121. ref: {
  22122. type: "string"
  22123. },
  22124. repo: {
  22125. required: true,
  22126. type: "string"
  22127. },
  22128. sha: {
  22129. type: "string"
  22130. },
  22131. task: {
  22132. type: "string"
  22133. }
  22134. },
  22135. url: "/repos/:owner/:repo/deployments"
  22136. },
  22137. listDownloads: {
  22138. method: "GET",
  22139. params: {
  22140. owner: {
  22141. required: true,
  22142. type: "string"
  22143. },
  22144. page: {
  22145. type: "integer"
  22146. },
  22147. per_page: {
  22148. type: "integer"
  22149. },
  22150. repo: {
  22151. required: true,
  22152. type: "string"
  22153. }
  22154. },
  22155. url: "/repos/:owner/:repo/downloads"
  22156. },
  22157. listForOrg: {
  22158. method: "GET",
  22159. params: {
  22160. direction: {
  22161. enum: ["asc", "desc"],
  22162. type: "string"
  22163. },
  22164. org: {
  22165. required: true,
  22166. type: "string"
  22167. },
  22168. page: {
  22169. type: "integer"
  22170. },
  22171. per_page: {
  22172. type: "integer"
  22173. },
  22174. sort: {
  22175. enum: ["created", "updated", "pushed", "full_name"],
  22176. type: "string"
  22177. },
  22178. type: {
  22179. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22180. type: "string"
  22181. }
  22182. },
  22183. url: "/orgs/:org/repos"
  22184. },
  22185. listForUser: {
  22186. method: "GET",
  22187. params: {
  22188. direction: {
  22189. enum: ["asc", "desc"],
  22190. type: "string"
  22191. },
  22192. page: {
  22193. type: "integer"
  22194. },
  22195. per_page: {
  22196. type: "integer"
  22197. },
  22198. sort: {
  22199. enum: ["created", "updated", "pushed", "full_name"],
  22200. type: "string"
  22201. },
  22202. type: {
  22203. enum: ["all", "owner", "member"],
  22204. type: "string"
  22205. },
  22206. username: {
  22207. required: true,
  22208. type: "string"
  22209. }
  22210. },
  22211. url: "/users/:username/repos"
  22212. },
  22213. listForks: {
  22214. method: "GET",
  22215. params: {
  22216. owner: {
  22217. required: true,
  22218. type: "string"
  22219. },
  22220. page: {
  22221. type: "integer"
  22222. },
  22223. per_page: {
  22224. type: "integer"
  22225. },
  22226. repo: {
  22227. required: true,
  22228. type: "string"
  22229. },
  22230. sort: {
  22231. enum: ["newest", "oldest", "stargazers"],
  22232. type: "string"
  22233. }
  22234. },
  22235. url: "/repos/:owner/:repo/forks"
  22236. },
  22237. listHooks: {
  22238. method: "GET",
  22239. params: {
  22240. owner: {
  22241. required: true,
  22242. type: "string"
  22243. },
  22244. page: {
  22245. type: "integer"
  22246. },
  22247. per_page: {
  22248. type: "integer"
  22249. },
  22250. repo: {
  22251. required: true,
  22252. type: "string"
  22253. }
  22254. },
  22255. url: "/repos/:owner/:repo/hooks"
  22256. },
  22257. listInvitations: {
  22258. method: "GET",
  22259. params: {
  22260. owner: {
  22261. required: true,
  22262. type: "string"
  22263. },
  22264. page: {
  22265. type: "integer"
  22266. },
  22267. per_page: {
  22268. type: "integer"
  22269. },
  22270. repo: {
  22271. required: true,
  22272. type: "string"
  22273. }
  22274. },
  22275. url: "/repos/:owner/:repo/invitations"
  22276. },
  22277. listInvitationsForAuthenticatedUser: {
  22278. method: "GET",
  22279. params: {
  22280. page: {
  22281. type: "integer"
  22282. },
  22283. per_page: {
  22284. type: "integer"
  22285. }
  22286. },
  22287. url: "/user/repository_invitations"
  22288. },
  22289. listLanguages: {
  22290. method: "GET",
  22291. params: {
  22292. owner: {
  22293. required: true,
  22294. type: "string"
  22295. },
  22296. repo: {
  22297. required: true,
  22298. type: "string"
  22299. }
  22300. },
  22301. url: "/repos/:owner/:repo/languages"
  22302. },
  22303. listPagesBuilds: {
  22304. method: "GET",
  22305. params: {
  22306. owner: {
  22307. required: true,
  22308. type: "string"
  22309. },
  22310. page: {
  22311. type: "integer"
  22312. },
  22313. per_page: {
  22314. type: "integer"
  22315. },
  22316. repo: {
  22317. required: true,
  22318. type: "string"
  22319. }
  22320. },
  22321. url: "/repos/:owner/:repo/pages/builds"
  22322. },
  22323. listProtectedBranchRequiredStatusChecksContexts: {
  22324. method: "GET",
  22325. params: {
  22326. branch: {
  22327. required: true,
  22328. type: "string"
  22329. },
  22330. owner: {
  22331. required: true,
  22332. type: "string"
  22333. },
  22334. repo: {
  22335. required: true,
  22336. type: "string"
  22337. }
  22338. },
  22339. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22340. },
  22341. listProtectedBranchTeamRestrictions: {
  22342. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22343. method: "GET",
  22344. params: {
  22345. branch: {
  22346. required: true,
  22347. type: "string"
  22348. },
  22349. owner: {
  22350. required: true,
  22351. type: "string"
  22352. },
  22353. repo: {
  22354. required: true,
  22355. type: "string"
  22356. }
  22357. },
  22358. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22359. },
  22360. listProtectedBranchUserRestrictions: {
  22361. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22362. method: "GET",
  22363. params: {
  22364. branch: {
  22365. required: true,
  22366. type: "string"
  22367. },
  22368. owner: {
  22369. required: true,
  22370. type: "string"
  22371. },
  22372. repo: {
  22373. required: true,
  22374. type: "string"
  22375. }
  22376. },
  22377. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22378. },
  22379. listPublic: {
  22380. method: "GET",
  22381. params: {
  22382. page: {
  22383. type: "integer"
  22384. },
  22385. per_page: {
  22386. type: "integer"
  22387. },
  22388. since: {
  22389. type: "integer"
  22390. }
  22391. },
  22392. url: "/repositories"
  22393. },
  22394. listPullRequestsAssociatedWithCommit: {
  22395. headers: {
  22396. accept: "application/vnd.github.groot-preview+json"
  22397. },
  22398. method: "GET",
  22399. params: {
  22400. commit_sha: {
  22401. required: true,
  22402. type: "string"
  22403. },
  22404. owner: {
  22405. required: true,
  22406. type: "string"
  22407. },
  22408. page: {
  22409. type: "integer"
  22410. },
  22411. per_page: {
  22412. type: "integer"
  22413. },
  22414. repo: {
  22415. required: true,
  22416. type: "string"
  22417. }
  22418. },
  22419. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22420. },
  22421. listReleases: {
  22422. method: "GET",
  22423. params: {
  22424. owner: {
  22425. required: true,
  22426. type: "string"
  22427. },
  22428. page: {
  22429. type: "integer"
  22430. },
  22431. per_page: {
  22432. type: "integer"
  22433. },
  22434. repo: {
  22435. required: true,
  22436. type: "string"
  22437. }
  22438. },
  22439. url: "/repos/:owner/:repo/releases"
  22440. },
  22441. listStatusesForRef: {
  22442. method: "GET",
  22443. params: {
  22444. owner: {
  22445. required: true,
  22446. type: "string"
  22447. },
  22448. page: {
  22449. type: "integer"
  22450. },
  22451. per_page: {
  22452. type: "integer"
  22453. },
  22454. ref: {
  22455. required: true,
  22456. type: "string"
  22457. },
  22458. repo: {
  22459. required: true,
  22460. type: "string"
  22461. }
  22462. },
  22463. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22464. },
  22465. listTags: {
  22466. method: "GET",
  22467. params: {
  22468. owner: {
  22469. required: true,
  22470. type: "string"
  22471. },
  22472. page: {
  22473. type: "integer"
  22474. },
  22475. per_page: {
  22476. type: "integer"
  22477. },
  22478. repo: {
  22479. required: true,
  22480. type: "string"
  22481. }
  22482. },
  22483. url: "/repos/:owner/:repo/tags"
  22484. },
  22485. listTeams: {
  22486. method: "GET",
  22487. params: {
  22488. owner: {
  22489. required: true,
  22490. type: "string"
  22491. },
  22492. page: {
  22493. type: "integer"
  22494. },
  22495. per_page: {
  22496. type: "integer"
  22497. },
  22498. repo: {
  22499. required: true,
  22500. type: "string"
  22501. }
  22502. },
  22503. url: "/repos/:owner/:repo/teams"
  22504. },
  22505. listTeamsWithAccessToProtectedBranch: {
  22506. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22507. method: "GET",
  22508. params: {
  22509. branch: {
  22510. required: true,
  22511. type: "string"
  22512. },
  22513. owner: {
  22514. required: true,
  22515. type: "string"
  22516. },
  22517. repo: {
  22518. required: true,
  22519. type: "string"
  22520. }
  22521. },
  22522. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22523. },
  22524. listTopics: {
  22525. headers: {
  22526. accept: "application/vnd.github.mercy-preview+json"
  22527. },
  22528. method: "GET",
  22529. params: {
  22530. owner: {
  22531. required: true,
  22532. type: "string"
  22533. },
  22534. repo: {
  22535. required: true,
  22536. type: "string"
  22537. }
  22538. },
  22539. url: "/repos/:owner/:repo/topics"
  22540. },
  22541. listUsersWithAccessToProtectedBranch: {
  22542. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22543. method: "GET",
  22544. params: {
  22545. branch: {
  22546. required: true,
  22547. type: "string"
  22548. },
  22549. owner: {
  22550. required: true,
  22551. type: "string"
  22552. },
  22553. repo: {
  22554. required: true,
  22555. type: "string"
  22556. }
  22557. },
  22558. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22559. },
  22560. merge: {
  22561. method: "POST",
  22562. params: {
  22563. base: {
  22564. required: true,
  22565. type: "string"
  22566. },
  22567. commit_message: {
  22568. type: "string"
  22569. },
  22570. head: {
  22571. required: true,
  22572. type: "string"
  22573. },
  22574. owner: {
  22575. required: true,
  22576. type: "string"
  22577. },
  22578. repo: {
  22579. required: true,
  22580. type: "string"
  22581. }
  22582. },
  22583. url: "/repos/:owner/:repo/merges"
  22584. },
  22585. pingHook: {
  22586. method: "POST",
  22587. params: {
  22588. hook_id: {
  22589. required: true,
  22590. type: "integer"
  22591. },
  22592. owner: {
  22593. required: true,
  22594. type: "string"
  22595. },
  22596. repo: {
  22597. required: true,
  22598. type: "string"
  22599. }
  22600. },
  22601. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22602. },
  22603. removeBranchProtection: {
  22604. method: "DELETE",
  22605. params: {
  22606. branch: {
  22607. required: true,
  22608. type: "string"
  22609. },
  22610. owner: {
  22611. required: true,
  22612. type: "string"
  22613. },
  22614. repo: {
  22615. required: true,
  22616. type: "string"
  22617. }
  22618. },
  22619. url: "/repos/:owner/:repo/branches/:branch/protection"
  22620. },
  22621. removeCollaborator: {
  22622. method: "DELETE",
  22623. params: {
  22624. owner: {
  22625. required: true,
  22626. type: "string"
  22627. },
  22628. repo: {
  22629. required: true,
  22630. type: "string"
  22631. },
  22632. username: {
  22633. required: true,
  22634. type: "string"
  22635. }
  22636. },
  22637. url: "/repos/:owner/:repo/collaborators/:username"
  22638. },
  22639. removeDeployKey: {
  22640. method: "DELETE",
  22641. params: {
  22642. key_id: {
  22643. required: true,
  22644. type: "integer"
  22645. },
  22646. owner: {
  22647. required: true,
  22648. type: "string"
  22649. },
  22650. repo: {
  22651. required: true,
  22652. type: "string"
  22653. }
  22654. },
  22655. url: "/repos/:owner/:repo/keys/:key_id"
  22656. },
  22657. removeProtectedBranchAdminEnforcement: {
  22658. method: "DELETE",
  22659. params: {
  22660. branch: {
  22661. required: true,
  22662. type: "string"
  22663. },
  22664. owner: {
  22665. required: true,
  22666. type: "string"
  22667. },
  22668. repo: {
  22669. required: true,
  22670. type: "string"
  22671. }
  22672. },
  22673. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22674. },
  22675. removeProtectedBranchAppRestrictions: {
  22676. method: "DELETE",
  22677. params: {
  22678. apps: {
  22679. mapTo: "data",
  22680. required: true,
  22681. type: "string[]"
  22682. },
  22683. branch: {
  22684. required: true,
  22685. type: "string"
  22686. },
  22687. owner: {
  22688. required: true,
  22689. type: "string"
  22690. },
  22691. repo: {
  22692. required: true,
  22693. type: "string"
  22694. }
  22695. },
  22696. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22697. },
  22698. removeProtectedBranchPullRequestReviewEnforcement: {
  22699. method: "DELETE",
  22700. params: {
  22701. branch: {
  22702. required: true,
  22703. type: "string"
  22704. },
  22705. owner: {
  22706. required: true,
  22707. type: "string"
  22708. },
  22709. repo: {
  22710. required: true,
  22711. type: "string"
  22712. }
  22713. },
  22714. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22715. },
  22716. removeProtectedBranchRequiredSignatures: {
  22717. headers: {
  22718. accept: "application/vnd.github.zzzax-preview+json"
  22719. },
  22720. method: "DELETE",
  22721. params: {
  22722. branch: {
  22723. required: true,
  22724. type: "string"
  22725. },
  22726. owner: {
  22727. required: true,
  22728. type: "string"
  22729. },
  22730. repo: {
  22731. required: true,
  22732. type: "string"
  22733. }
  22734. },
  22735. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22736. },
  22737. removeProtectedBranchRequiredStatusChecks: {
  22738. method: "DELETE",
  22739. params: {
  22740. branch: {
  22741. required: true,
  22742. type: "string"
  22743. },
  22744. owner: {
  22745. required: true,
  22746. type: "string"
  22747. },
  22748. repo: {
  22749. required: true,
  22750. type: "string"
  22751. }
  22752. },
  22753. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22754. },
  22755. removeProtectedBranchRequiredStatusChecksContexts: {
  22756. method: "DELETE",
  22757. params: {
  22758. branch: {
  22759. required: true,
  22760. type: "string"
  22761. },
  22762. contexts: {
  22763. mapTo: "data",
  22764. required: true,
  22765. type: "string[]"
  22766. },
  22767. owner: {
  22768. required: true,
  22769. type: "string"
  22770. },
  22771. repo: {
  22772. required: true,
  22773. type: "string"
  22774. }
  22775. },
  22776. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22777. },
  22778. removeProtectedBranchRestrictions: {
  22779. method: "DELETE",
  22780. params: {
  22781. branch: {
  22782. required: true,
  22783. type: "string"
  22784. },
  22785. owner: {
  22786. required: true,
  22787. type: "string"
  22788. },
  22789. repo: {
  22790. required: true,
  22791. type: "string"
  22792. }
  22793. },
  22794. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22795. },
  22796. removeProtectedBranchTeamRestrictions: {
  22797. method: "DELETE",
  22798. params: {
  22799. branch: {
  22800. required: true,
  22801. type: "string"
  22802. },
  22803. owner: {
  22804. required: true,
  22805. type: "string"
  22806. },
  22807. repo: {
  22808. required: true,
  22809. type: "string"
  22810. },
  22811. teams: {
  22812. mapTo: "data",
  22813. required: true,
  22814. type: "string[]"
  22815. }
  22816. },
  22817. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22818. },
  22819. removeProtectedBranchUserRestrictions: {
  22820. method: "DELETE",
  22821. params: {
  22822. branch: {
  22823. required: true,
  22824. type: "string"
  22825. },
  22826. owner: {
  22827. required: true,
  22828. type: "string"
  22829. },
  22830. repo: {
  22831. required: true,
  22832. type: "string"
  22833. },
  22834. users: {
  22835. mapTo: "data",
  22836. required: true,
  22837. type: "string[]"
  22838. }
  22839. },
  22840. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22841. },
  22842. replaceProtectedBranchAppRestrictions: {
  22843. method: "PUT",
  22844. params: {
  22845. apps: {
  22846. mapTo: "data",
  22847. required: true,
  22848. type: "string[]"
  22849. },
  22850. branch: {
  22851. required: true,
  22852. type: "string"
  22853. },
  22854. owner: {
  22855. required: true,
  22856. type: "string"
  22857. },
  22858. repo: {
  22859. required: true,
  22860. type: "string"
  22861. }
  22862. },
  22863. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22864. },
  22865. replaceProtectedBranchRequiredStatusChecksContexts: {
  22866. method: "PUT",
  22867. params: {
  22868. branch: {
  22869. required: true,
  22870. type: "string"
  22871. },
  22872. contexts: {
  22873. mapTo: "data",
  22874. required: true,
  22875. type: "string[]"
  22876. },
  22877. owner: {
  22878. required: true,
  22879. type: "string"
  22880. },
  22881. repo: {
  22882. required: true,
  22883. type: "string"
  22884. }
  22885. },
  22886. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22887. },
  22888. replaceProtectedBranchTeamRestrictions: {
  22889. method: "PUT",
  22890. params: {
  22891. branch: {
  22892. required: true,
  22893. type: "string"
  22894. },
  22895. owner: {
  22896. required: true,
  22897. type: "string"
  22898. },
  22899. repo: {
  22900. required: true,
  22901. type: "string"
  22902. },
  22903. teams: {
  22904. mapTo: "data",
  22905. required: true,
  22906. type: "string[]"
  22907. }
  22908. },
  22909. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22910. },
  22911. replaceProtectedBranchUserRestrictions: {
  22912. method: "PUT",
  22913. params: {
  22914. branch: {
  22915. required: true,
  22916. type: "string"
  22917. },
  22918. owner: {
  22919. required: true,
  22920. type: "string"
  22921. },
  22922. repo: {
  22923. required: true,
  22924. type: "string"
  22925. },
  22926. users: {
  22927. mapTo: "data",
  22928. required: true,
  22929. type: "string[]"
  22930. }
  22931. },
  22932. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22933. },
  22934. replaceTopics: {
  22935. headers: {
  22936. accept: "application/vnd.github.mercy-preview+json"
  22937. },
  22938. method: "PUT",
  22939. params: {
  22940. names: {
  22941. required: true,
  22942. type: "string[]"
  22943. },
  22944. owner: {
  22945. required: true,
  22946. type: "string"
  22947. },
  22948. repo: {
  22949. required: true,
  22950. type: "string"
  22951. }
  22952. },
  22953. url: "/repos/:owner/:repo/topics"
  22954. },
  22955. requestPageBuild: {
  22956. method: "POST",
  22957. params: {
  22958. owner: {
  22959. required: true,
  22960. type: "string"
  22961. },
  22962. repo: {
  22963. required: true,
  22964. type: "string"
  22965. }
  22966. },
  22967. url: "/repos/:owner/:repo/pages/builds"
  22968. },
  22969. retrieveCommunityProfileMetrics: {
  22970. method: "GET",
  22971. params: {
  22972. owner: {
  22973. required: true,
  22974. type: "string"
  22975. },
  22976. repo: {
  22977. required: true,
  22978. type: "string"
  22979. }
  22980. },
  22981. url: "/repos/:owner/:repo/community/profile"
  22982. },
  22983. testPushHook: {
  22984. method: "POST",
  22985. params: {
  22986. hook_id: {
  22987. required: true,
  22988. type: "integer"
  22989. },
  22990. owner: {
  22991. required: true,
  22992. type: "string"
  22993. },
  22994. repo: {
  22995. required: true,
  22996. type: "string"
  22997. }
  22998. },
  22999. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  23000. },
  23001. transfer: {
  23002. method: "POST",
  23003. params: {
  23004. new_owner: {
  23005. type: "string"
  23006. },
  23007. owner: {
  23008. required: true,
  23009. type: "string"
  23010. },
  23011. repo: {
  23012. required: true,
  23013. type: "string"
  23014. },
  23015. team_ids: {
  23016. type: "integer[]"
  23017. }
  23018. },
  23019. url: "/repos/:owner/:repo/transfer"
  23020. },
  23021. update: {
  23022. method: "PATCH",
  23023. params: {
  23024. allow_merge_commit: {
  23025. type: "boolean"
  23026. },
  23027. allow_rebase_merge: {
  23028. type: "boolean"
  23029. },
  23030. allow_squash_merge: {
  23031. type: "boolean"
  23032. },
  23033. archived: {
  23034. type: "boolean"
  23035. },
  23036. default_branch: {
  23037. type: "string"
  23038. },
  23039. delete_branch_on_merge: {
  23040. type: "boolean"
  23041. },
  23042. description: {
  23043. type: "string"
  23044. },
  23045. has_issues: {
  23046. type: "boolean"
  23047. },
  23048. has_projects: {
  23049. type: "boolean"
  23050. },
  23051. has_wiki: {
  23052. type: "boolean"
  23053. },
  23054. homepage: {
  23055. type: "string"
  23056. },
  23057. is_template: {
  23058. type: "boolean"
  23059. },
  23060. name: {
  23061. type: "string"
  23062. },
  23063. owner: {
  23064. required: true,
  23065. type: "string"
  23066. },
  23067. private: {
  23068. type: "boolean"
  23069. },
  23070. repo: {
  23071. required: true,
  23072. type: "string"
  23073. },
  23074. visibility: {
  23075. enum: ["public", "private", "visibility", "internal"],
  23076. type: "string"
  23077. }
  23078. },
  23079. url: "/repos/:owner/:repo"
  23080. },
  23081. updateBranchProtection: {
  23082. method: "PUT",
  23083. params: {
  23084. allow_deletions: {
  23085. type: "boolean"
  23086. },
  23087. allow_force_pushes: {
  23088. allowNull: true,
  23089. type: "boolean"
  23090. },
  23091. branch: {
  23092. required: true,
  23093. type: "string"
  23094. },
  23095. enforce_admins: {
  23096. allowNull: true,
  23097. required: true,
  23098. type: "boolean"
  23099. },
  23100. owner: {
  23101. required: true,
  23102. type: "string"
  23103. },
  23104. repo: {
  23105. required: true,
  23106. type: "string"
  23107. },
  23108. required_linear_history: {
  23109. type: "boolean"
  23110. },
  23111. required_pull_request_reviews: {
  23112. allowNull: true,
  23113. required: true,
  23114. type: "object"
  23115. },
  23116. "required_pull_request_reviews.dismiss_stale_reviews": {
  23117. type: "boolean"
  23118. },
  23119. "required_pull_request_reviews.dismissal_restrictions": {
  23120. type: "object"
  23121. },
  23122. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23123. type: "string[]"
  23124. },
  23125. "required_pull_request_reviews.dismissal_restrictions.users": {
  23126. type: "string[]"
  23127. },
  23128. "required_pull_request_reviews.require_code_owner_reviews": {
  23129. type: "boolean"
  23130. },
  23131. "required_pull_request_reviews.required_approving_review_count": {
  23132. type: "integer"
  23133. },
  23134. required_status_checks: {
  23135. allowNull: true,
  23136. required: true,
  23137. type: "object"
  23138. },
  23139. "required_status_checks.contexts": {
  23140. required: true,
  23141. type: "string[]"
  23142. },
  23143. "required_status_checks.strict": {
  23144. required: true,
  23145. type: "boolean"
  23146. },
  23147. restrictions: {
  23148. allowNull: true,
  23149. required: true,
  23150. type: "object"
  23151. },
  23152. "restrictions.apps": {
  23153. type: "string[]"
  23154. },
  23155. "restrictions.teams": {
  23156. required: true,
  23157. type: "string[]"
  23158. },
  23159. "restrictions.users": {
  23160. required: true,
  23161. type: "string[]"
  23162. }
  23163. },
  23164. url: "/repos/:owner/:repo/branches/:branch/protection"
  23165. },
  23166. updateCommitComment: {
  23167. method: "PATCH",
  23168. params: {
  23169. body: {
  23170. required: true,
  23171. type: "string"
  23172. },
  23173. comment_id: {
  23174. required: true,
  23175. type: "integer"
  23176. },
  23177. owner: {
  23178. required: true,
  23179. type: "string"
  23180. },
  23181. repo: {
  23182. required: true,
  23183. type: "string"
  23184. }
  23185. },
  23186. url: "/repos/:owner/:repo/comments/:comment_id"
  23187. },
  23188. updateFile: {
  23189. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23190. method: "PUT",
  23191. params: {
  23192. author: {
  23193. type: "object"
  23194. },
  23195. "author.email": {
  23196. required: true,
  23197. type: "string"
  23198. },
  23199. "author.name": {
  23200. required: true,
  23201. type: "string"
  23202. },
  23203. branch: {
  23204. type: "string"
  23205. },
  23206. committer: {
  23207. type: "object"
  23208. },
  23209. "committer.email": {
  23210. required: true,
  23211. type: "string"
  23212. },
  23213. "committer.name": {
  23214. required: true,
  23215. type: "string"
  23216. },
  23217. content: {
  23218. required: true,
  23219. type: "string"
  23220. },
  23221. message: {
  23222. required: true,
  23223. type: "string"
  23224. },
  23225. owner: {
  23226. required: true,
  23227. type: "string"
  23228. },
  23229. path: {
  23230. required: true,
  23231. type: "string"
  23232. },
  23233. repo: {
  23234. required: true,
  23235. type: "string"
  23236. },
  23237. sha: {
  23238. type: "string"
  23239. }
  23240. },
  23241. url: "/repos/:owner/:repo/contents/:path"
  23242. },
  23243. updateHook: {
  23244. method: "PATCH",
  23245. params: {
  23246. active: {
  23247. type: "boolean"
  23248. },
  23249. add_events: {
  23250. type: "string[]"
  23251. },
  23252. config: {
  23253. type: "object"
  23254. },
  23255. "config.content_type": {
  23256. type: "string"
  23257. },
  23258. "config.insecure_ssl": {
  23259. type: "string"
  23260. },
  23261. "config.secret": {
  23262. type: "string"
  23263. },
  23264. "config.url": {
  23265. required: true,
  23266. type: "string"
  23267. },
  23268. events: {
  23269. type: "string[]"
  23270. },
  23271. hook_id: {
  23272. required: true,
  23273. type: "integer"
  23274. },
  23275. owner: {
  23276. required: true,
  23277. type: "string"
  23278. },
  23279. remove_events: {
  23280. type: "string[]"
  23281. },
  23282. repo: {
  23283. required: true,
  23284. type: "string"
  23285. }
  23286. },
  23287. url: "/repos/:owner/:repo/hooks/:hook_id"
  23288. },
  23289. updateInformationAboutPagesSite: {
  23290. method: "PUT",
  23291. params: {
  23292. cname: {
  23293. type: "string"
  23294. },
  23295. owner: {
  23296. required: true,
  23297. type: "string"
  23298. },
  23299. repo: {
  23300. required: true,
  23301. type: "string"
  23302. },
  23303. source: {
  23304. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23305. type: "string"
  23306. }
  23307. },
  23308. url: "/repos/:owner/:repo/pages"
  23309. },
  23310. updateInvitation: {
  23311. method: "PATCH",
  23312. params: {
  23313. invitation_id: {
  23314. required: true,
  23315. type: "integer"
  23316. },
  23317. owner: {
  23318. required: true,
  23319. type: "string"
  23320. },
  23321. permissions: {
  23322. enum: ["read", "write", "admin"],
  23323. type: "string"
  23324. },
  23325. repo: {
  23326. required: true,
  23327. type: "string"
  23328. }
  23329. },
  23330. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23331. },
  23332. updateProtectedBranchPullRequestReviewEnforcement: {
  23333. method: "PATCH",
  23334. params: {
  23335. branch: {
  23336. required: true,
  23337. type: "string"
  23338. },
  23339. dismiss_stale_reviews: {
  23340. type: "boolean"
  23341. },
  23342. dismissal_restrictions: {
  23343. type: "object"
  23344. },
  23345. "dismissal_restrictions.teams": {
  23346. type: "string[]"
  23347. },
  23348. "dismissal_restrictions.users": {
  23349. type: "string[]"
  23350. },
  23351. owner: {
  23352. required: true,
  23353. type: "string"
  23354. },
  23355. repo: {
  23356. required: true,
  23357. type: "string"
  23358. },
  23359. require_code_owner_reviews: {
  23360. type: "boolean"
  23361. },
  23362. required_approving_review_count: {
  23363. type: "integer"
  23364. }
  23365. },
  23366. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23367. },
  23368. updateProtectedBranchRequiredStatusChecks: {
  23369. method: "PATCH",
  23370. params: {
  23371. branch: {
  23372. required: true,
  23373. type: "string"
  23374. },
  23375. contexts: {
  23376. type: "string[]"
  23377. },
  23378. owner: {
  23379. required: true,
  23380. type: "string"
  23381. },
  23382. repo: {
  23383. required: true,
  23384. type: "string"
  23385. },
  23386. strict: {
  23387. type: "boolean"
  23388. }
  23389. },
  23390. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23391. },
  23392. updateRelease: {
  23393. method: "PATCH",
  23394. params: {
  23395. body: {
  23396. type: "string"
  23397. },
  23398. draft: {
  23399. type: "boolean"
  23400. },
  23401. name: {
  23402. type: "string"
  23403. },
  23404. owner: {
  23405. required: true,
  23406. type: "string"
  23407. },
  23408. prerelease: {
  23409. type: "boolean"
  23410. },
  23411. release_id: {
  23412. required: true,
  23413. type: "integer"
  23414. },
  23415. repo: {
  23416. required: true,
  23417. type: "string"
  23418. },
  23419. tag_name: {
  23420. type: "string"
  23421. },
  23422. target_commitish: {
  23423. type: "string"
  23424. }
  23425. },
  23426. url: "/repos/:owner/:repo/releases/:release_id"
  23427. },
  23428. updateReleaseAsset: {
  23429. method: "PATCH",
  23430. params: {
  23431. asset_id: {
  23432. required: true,
  23433. type: "integer"
  23434. },
  23435. label: {
  23436. type: "string"
  23437. },
  23438. name: {
  23439. type: "string"
  23440. },
  23441. owner: {
  23442. required: true,
  23443. type: "string"
  23444. },
  23445. repo: {
  23446. required: true,
  23447. type: "string"
  23448. }
  23449. },
  23450. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23451. },
  23452. uploadReleaseAsset: {
  23453. method: "POST",
  23454. params: {
  23455. data: {
  23456. mapTo: "data",
  23457. required: true,
  23458. type: "string | object"
  23459. },
  23460. file: {
  23461. alias: "data",
  23462. deprecated: true,
  23463. type: "string | object"
  23464. },
  23465. headers: {
  23466. required: true,
  23467. type: "object"
  23468. },
  23469. "headers.content-length": {
  23470. required: true,
  23471. type: "integer"
  23472. },
  23473. "headers.content-type": {
  23474. required: true,
  23475. type: "string"
  23476. },
  23477. label: {
  23478. type: "string"
  23479. },
  23480. name: {
  23481. required: true,
  23482. type: "string"
  23483. },
  23484. url: {
  23485. required: true,
  23486. type: "string"
  23487. }
  23488. },
  23489. url: ":url"
  23490. }
  23491. },
  23492. search: {
  23493. code: {
  23494. method: "GET",
  23495. params: {
  23496. order: {
  23497. enum: ["desc", "asc"],
  23498. type: "string"
  23499. },
  23500. page: {
  23501. type: "integer"
  23502. },
  23503. per_page: {
  23504. type: "integer"
  23505. },
  23506. q: {
  23507. required: true,
  23508. type: "string"
  23509. },
  23510. sort: {
  23511. enum: ["indexed"],
  23512. type: "string"
  23513. }
  23514. },
  23515. url: "/search/code"
  23516. },
  23517. commits: {
  23518. headers: {
  23519. accept: "application/vnd.github.cloak-preview+json"
  23520. },
  23521. method: "GET",
  23522. params: {
  23523. order: {
  23524. enum: ["desc", "asc"],
  23525. type: "string"
  23526. },
  23527. page: {
  23528. type: "integer"
  23529. },
  23530. per_page: {
  23531. type: "integer"
  23532. },
  23533. q: {
  23534. required: true,
  23535. type: "string"
  23536. },
  23537. sort: {
  23538. enum: ["author-date", "committer-date"],
  23539. type: "string"
  23540. }
  23541. },
  23542. url: "/search/commits"
  23543. },
  23544. issues: {
  23545. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23546. method: "GET",
  23547. params: {
  23548. order: {
  23549. enum: ["desc", "asc"],
  23550. type: "string"
  23551. },
  23552. page: {
  23553. type: "integer"
  23554. },
  23555. per_page: {
  23556. type: "integer"
  23557. },
  23558. q: {
  23559. required: true,
  23560. type: "string"
  23561. },
  23562. sort: {
  23563. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23564. type: "string"
  23565. }
  23566. },
  23567. url: "/search/issues"
  23568. },
  23569. issuesAndPullRequests: {
  23570. method: "GET",
  23571. params: {
  23572. order: {
  23573. enum: ["desc", "asc"],
  23574. type: "string"
  23575. },
  23576. page: {
  23577. type: "integer"
  23578. },
  23579. per_page: {
  23580. type: "integer"
  23581. },
  23582. q: {
  23583. required: true,
  23584. type: "string"
  23585. },
  23586. sort: {
  23587. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23588. type: "string"
  23589. }
  23590. },
  23591. url: "/search/issues"
  23592. },
  23593. labels: {
  23594. method: "GET",
  23595. params: {
  23596. order: {
  23597. enum: ["desc", "asc"],
  23598. type: "string"
  23599. },
  23600. q: {
  23601. required: true,
  23602. type: "string"
  23603. },
  23604. repository_id: {
  23605. required: true,
  23606. type: "integer"
  23607. },
  23608. sort: {
  23609. enum: ["created", "updated"],
  23610. type: "string"
  23611. }
  23612. },
  23613. url: "/search/labels"
  23614. },
  23615. repos: {
  23616. method: "GET",
  23617. params: {
  23618. order: {
  23619. enum: ["desc", "asc"],
  23620. type: "string"
  23621. },
  23622. page: {
  23623. type: "integer"
  23624. },
  23625. per_page: {
  23626. type: "integer"
  23627. },
  23628. q: {
  23629. required: true,
  23630. type: "string"
  23631. },
  23632. sort: {
  23633. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23634. type: "string"
  23635. }
  23636. },
  23637. url: "/search/repositories"
  23638. },
  23639. topics: {
  23640. method: "GET",
  23641. params: {
  23642. q: {
  23643. required: true,
  23644. type: "string"
  23645. }
  23646. },
  23647. url: "/search/topics"
  23648. },
  23649. users: {
  23650. method: "GET",
  23651. params: {
  23652. order: {
  23653. enum: ["desc", "asc"],
  23654. type: "string"
  23655. },
  23656. page: {
  23657. type: "integer"
  23658. },
  23659. per_page: {
  23660. type: "integer"
  23661. },
  23662. q: {
  23663. required: true,
  23664. type: "string"
  23665. },
  23666. sort: {
  23667. enum: ["followers", "repositories", "joined"],
  23668. type: "string"
  23669. }
  23670. },
  23671. url: "/search/users"
  23672. }
  23673. },
  23674. teams: {
  23675. addMember: {
  23676. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23677. method: "PUT",
  23678. params: {
  23679. team_id: {
  23680. required: true,
  23681. type: "integer"
  23682. },
  23683. username: {
  23684. required: true,
  23685. type: "string"
  23686. }
  23687. },
  23688. url: "/teams/:team_id/members/:username"
  23689. },
  23690. addMemberLegacy: {
  23691. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23692. method: "PUT",
  23693. params: {
  23694. team_id: {
  23695. required: true,
  23696. type: "integer"
  23697. },
  23698. username: {
  23699. required: true,
  23700. type: "string"
  23701. }
  23702. },
  23703. url: "/teams/:team_id/members/:username"
  23704. },
  23705. addOrUpdateMembership: {
  23706. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23707. method: "PUT",
  23708. params: {
  23709. role: {
  23710. enum: ["member", "maintainer"],
  23711. type: "string"
  23712. },
  23713. team_id: {
  23714. required: true,
  23715. type: "integer"
  23716. },
  23717. username: {
  23718. required: true,
  23719. type: "string"
  23720. }
  23721. },
  23722. url: "/teams/:team_id/memberships/:username"
  23723. },
  23724. addOrUpdateMembershipInOrg: {
  23725. method: "PUT",
  23726. params: {
  23727. org: {
  23728. required: true,
  23729. type: "string"
  23730. },
  23731. role: {
  23732. enum: ["member", "maintainer"],
  23733. type: "string"
  23734. },
  23735. team_slug: {
  23736. required: true,
  23737. type: "string"
  23738. },
  23739. username: {
  23740. required: true,
  23741. type: "string"
  23742. }
  23743. },
  23744. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23745. },
  23746. addOrUpdateMembershipLegacy: {
  23747. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23748. method: "PUT",
  23749. params: {
  23750. role: {
  23751. enum: ["member", "maintainer"],
  23752. type: "string"
  23753. },
  23754. team_id: {
  23755. required: true,
  23756. type: "integer"
  23757. },
  23758. username: {
  23759. required: true,
  23760. type: "string"
  23761. }
  23762. },
  23763. url: "/teams/:team_id/memberships/:username"
  23764. },
  23765. addOrUpdateProject: {
  23766. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23767. headers: {
  23768. accept: "application/vnd.github.inertia-preview+json"
  23769. },
  23770. method: "PUT",
  23771. params: {
  23772. permission: {
  23773. enum: ["read", "write", "admin"],
  23774. type: "string"
  23775. },
  23776. project_id: {
  23777. required: true,
  23778. type: "integer"
  23779. },
  23780. team_id: {
  23781. required: true,
  23782. type: "integer"
  23783. }
  23784. },
  23785. url: "/teams/:team_id/projects/:project_id"
  23786. },
  23787. addOrUpdateProjectInOrg: {
  23788. headers: {
  23789. accept: "application/vnd.github.inertia-preview+json"
  23790. },
  23791. method: "PUT",
  23792. params: {
  23793. org: {
  23794. required: true,
  23795. type: "string"
  23796. },
  23797. permission: {
  23798. enum: ["read", "write", "admin"],
  23799. type: "string"
  23800. },
  23801. project_id: {
  23802. required: true,
  23803. type: "integer"
  23804. },
  23805. team_slug: {
  23806. required: true,
  23807. type: "string"
  23808. }
  23809. },
  23810. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23811. },
  23812. addOrUpdateProjectLegacy: {
  23813. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23814. headers: {
  23815. accept: "application/vnd.github.inertia-preview+json"
  23816. },
  23817. method: "PUT",
  23818. params: {
  23819. permission: {
  23820. enum: ["read", "write", "admin"],
  23821. type: "string"
  23822. },
  23823. project_id: {
  23824. required: true,
  23825. type: "integer"
  23826. },
  23827. team_id: {
  23828. required: true,
  23829. type: "integer"
  23830. }
  23831. },
  23832. url: "/teams/:team_id/projects/:project_id"
  23833. },
  23834. addOrUpdateRepo: {
  23835. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23836. method: "PUT",
  23837. params: {
  23838. owner: {
  23839. required: true,
  23840. type: "string"
  23841. },
  23842. permission: {
  23843. enum: ["pull", "push", "admin"],
  23844. type: "string"
  23845. },
  23846. repo: {
  23847. required: true,
  23848. type: "string"
  23849. },
  23850. team_id: {
  23851. required: true,
  23852. type: "integer"
  23853. }
  23854. },
  23855. url: "/teams/:team_id/repos/:owner/:repo"
  23856. },
  23857. addOrUpdateRepoInOrg: {
  23858. method: "PUT",
  23859. params: {
  23860. org: {
  23861. required: true,
  23862. type: "string"
  23863. },
  23864. owner: {
  23865. required: true,
  23866. type: "string"
  23867. },
  23868. permission: {
  23869. enum: ["pull", "push", "admin"],
  23870. type: "string"
  23871. },
  23872. repo: {
  23873. required: true,
  23874. type: "string"
  23875. },
  23876. team_slug: {
  23877. required: true,
  23878. type: "string"
  23879. }
  23880. },
  23881. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23882. },
  23883. addOrUpdateRepoLegacy: {
  23884. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23885. method: "PUT",
  23886. params: {
  23887. owner: {
  23888. required: true,
  23889. type: "string"
  23890. },
  23891. permission: {
  23892. enum: ["pull", "push", "admin"],
  23893. type: "string"
  23894. },
  23895. repo: {
  23896. required: true,
  23897. type: "string"
  23898. },
  23899. team_id: {
  23900. required: true,
  23901. type: "integer"
  23902. }
  23903. },
  23904. url: "/teams/:team_id/repos/:owner/:repo"
  23905. },
  23906. checkManagesRepo: {
  23907. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23908. method: "GET",
  23909. params: {
  23910. owner: {
  23911. required: true,
  23912. type: "string"
  23913. },
  23914. repo: {
  23915. required: true,
  23916. type: "string"
  23917. },
  23918. team_id: {
  23919. required: true,
  23920. type: "integer"
  23921. }
  23922. },
  23923. url: "/teams/:team_id/repos/:owner/:repo"
  23924. },
  23925. checkManagesRepoInOrg: {
  23926. method: "GET",
  23927. params: {
  23928. org: {
  23929. required: true,
  23930. type: "string"
  23931. },
  23932. owner: {
  23933. required: true,
  23934. type: "string"
  23935. },
  23936. repo: {
  23937. required: true,
  23938. type: "string"
  23939. },
  23940. team_slug: {
  23941. required: true,
  23942. type: "string"
  23943. }
  23944. },
  23945. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23946. },
  23947. checkManagesRepoLegacy: {
  23948. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23949. method: "GET",
  23950. params: {
  23951. owner: {
  23952. required: true,
  23953. type: "string"
  23954. },
  23955. repo: {
  23956. required: true,
  23957. type: "string"
  23958. },
  23959. team_id: {
  23960. required: true,
  23961. type: "integer"
  23962. }
  23963. },
  23964. url: "/teams/:team_id/repos/:owner/:repo"
  23965. },
  23966. create: {
  23967. method: "POST",
  23968. params: {
  23969. description: {
  23970. type: "string"
  23971. },
  23972. maintainers: {
  23973. type: "string[]"
  23974. },
  23975. name: {
  23976. required: true,
  23977. type: "string"
  23978. },
  23979. org: {
  23980. required: true,
  23981. type: "string"
  23982. },
  23983. parent_team_id: {
  23984. type: "integer"
  23985. },
  23986. permission: {
  23987. enum: ["pull", "push", "admin"],
  23988. type: "string"
  23989. },
  23990. privacy: {
  23991. enum: ["secret", "closed"],
  23992. type: "string"
  23993. },
  23994. repo_names: {
  23995. type: "string[]"
  23996. }
  23997. },
  23998. url: "/orgs/:org/teams"
  23999. },
  24000. createDiscussion: {
  24001. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  24002. method: "POST",
  24003. params: {
  24004. body: {
  24005. required: true,
  24006. type: "string"
  24007. },
  24008. private: {
  24009. type: "boolean"
  24010. },
  24011. team_id: {
  24012. required: true,
  24013. type: "integer"
  24014. },
  24015. title: {
  24016. required: true,
  24017. type: "string"
  24018. }
  24019. },
  24020. url: "/teams/:team_id/discussions"
  24021. },
  24022. createDiscussionComment: {
  24023. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  24024. method: "POST",
  24025. params: {
  24026. body: {
  24027. required: true,
  24028. type: "string"
  24029. },
  24030. discussion_number: {
  24031. required: true,
  24032. type: "integer"
  24033. },
  24034. team_id: {
  24035. required: true,
  24036. type: "integer"
  24037. }
  24038. },
  24039. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24040. },
  24041. createDiscussionCommentInOrg: {
  24042. method: "POST",
  24043. params: {
  24044. body: {
  24045. required: true,
  24046. type: "string"
  24047. },
  24048. discussion_number: {
  24049. required: true,
  24050. type: "integer"
  24051. },
  24052. org: {
  24053. required: true,
  24054. type: "string"
  24055. },
  24056. team_slug: {
  24057. required: true,
  24058. type: "string"
  24059. }
  24060. },
  24061. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24062. },
  24063. createDiscussionCommentLegacy: {
  24064. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24065. method: "POST",
  24066. params: {
  24067. body: {
  24068. required: true,
  24069. type: "string"
  24070. },
  24071. discussion_number: {
  24072. required: true,
  24073. type: "integer"
  24074. },
  24075. team_id: {
  24076. required: true,
  24077. type: "integer"
  24078. }
  24079. },
  24080. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24081. },
  24082. createDiscussionInOrg: {
  24083. method: "POST",
  24084. params: {
  24085. body: {
  24086. required: true,
  24087. type: "string"
  24088. },
  24089. org: {
  24090. required: true,
  24091. type: "string"
  24092. },
  24093. private: {
  24094. type: "boolean"
  24095. },
  24096. team_slug: {
  24097. required: true,
  24098. type: "string"
  24099. },
  24100. title: {
  24101. required: true,
  24102. type: "string"
  24103. }
  24104. },
  24105. url: "/orgs/:org/teams/:team_slug/discussions"
  24106. },
  24107. createDiscussionLegacy: {
  24108. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24109. method: "POST",
  24110. params: {
  24111. body: {
  24112. required: true,
  24113. type: "string"
  24114. },
  24115. private: {
  24116. type: "boolean"
  24117. },
  24118. team_id: {
  24119. required: true,
  24120. type: "integer"
  24121. },
  24122. title: {
  24123. required: true,
  24124. type: "string"
  24125. }
  24126. },
  24127. url: "/teams/:team_id/discussions"
  24128. },
  24129. delete: {
  24130. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24131. method: "DELETE",
  24132. params: {
  24133. team_id: {
  24134. required: true,
  24135. type: "integer"
  24136. }
  24137. },
  24138. url: "/teams/:team_id"
  24139. },
  24140. deleteDiscussion: {
  24141. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24142. method: "DELETE",
  24143. params: {
  24144. discussion_number: {
  24145. required: true,
  24146. type: "integer"
  24147. },
  24148. team_id: {
  24149. required: true,
  24150. type: "integer"
  24151. }
  24152. },
  24153. url: "/teams/:team_id/discussions/:discussion_number"
  24154. },
  24155. deleteDiscussionComment: {
  24156. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24157. method: "DELETE",
  24158. params: {
  24159. comment_number: {
  24160. required: true,
  24161. type: "integer"
  24162. },
  24163. discussion_number: {
  24164. required: true,
  24165. type: "integer"
  24166. },
  24167. team_id: {
  24168. required: true,
  24169. type: "integer"
  24170. }
  24171. },
  24172. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24173. },
  24174. deleteDiscussionCommentInOrg: {
  24175. method: "DELETE",
  24176. params: {
  24177. comment_number: {
  24178. required: true,
  24179. type: "integer"
  24180. },
  24181. discussion_number: {
  24182. required: true,
  24183. type: "integer"
  24184. },
  24185. org: {
  24186. required: true,
  24187. type: "string"
  24188. },
  24189. team_slug: {
  24190. required: true,
  24191. type: "string"
  24192. }
  24193. },
  24194. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24195. },
  24196. deleteDiscussionCommentLegacy: {
  24197. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24198. method: "DELETE",
  24199. params: {
  24200. comment_number: {
  24201. required: true,
  24202. type: "integer"
  24203. },
  24204. discussion_number: {
  24205. required: true,
  24206. type: "integer"
  24207. },
  24208. team_id: {
  24209. required: true,
  24210. type: "integer"
  24211. }
  24212. },
  24213. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24214. },
  24215. deleteDiscussionInOrg: {
  24216. method: "DELETE",
  24217. params: {
  24218. discussion_number: {
  24219. required: true,
  24220. type: "integer"
  24221. },
  24222. org: {
  24223. required: true,
  24224. type: "string"
  24225. },
  24226. team_slug: {
  24227. required: true,
  24228. type: "string"
  24229. }
  24230. },
  24231. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24232. },
  24233. deleteDiscussionLegacy: {
  24234. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24235. method: "DELETE",
  24236. params: {
  24237. discussion_number: {
  24238. required: true,
  24239. type: "integer"
  24240. },
  24241. team_id: {
  24242. required: true,
  24243. type: "integer"
  24244. }
  24245. },
  24246. url: "/teams/:team_id/discussions/:discussion_number"
  24247. },
  24248. deleteInOrg: {
  24249. method: "DELETE",
  24250. params: {
  24251. org: {
  24252. required: true,
  24253. type: "string"
  24254. },
  24255. team_slug: {
  24256. required: true,
  24257. type: "string"
  24258. }
  24259. },
  24260. url: "/orgs/:org/teams/:team_slug"
  24261. },
  24262. deleteLegacy: {
  24263. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24264. method: "DELETE",
  24265. params: {
  24266. team_id: {
  24267. required: true,
  24268. type: "integer"
  24269. }
  24270. },
  24271. url: "/teams/:team_id"
  24272. },
  24273. get: {
  24274. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24275. method: "GET",
  24276. params: {
  24277. team_id: {
  24278. required: true,
  24279. type: "integer"
  24280. }
  24281. },
  24282. url: "/teams/:team_id"
  24283. },
  24284. getByName: {
  24285. method: "GET",
  24286. params: {
  24287. org: {
  24288. required: true,
  24289. type: "string"
  24290. },
  24291. team_slug: {
  24292. required: true,
  24293. type: "string"
  24294. }
  24295. },
  24296. url: "/orgs/:org/teams/:team_slug"
  24297. },
  24298. getDiscussion: {
  24299. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24300. method: "GET",
  24301. params: {
  24302. discussion_number: {
  24303. required: true,
  24304. type: "integer"
  24305. },
  24306. team_id: {
  24307. required: true,
  24308. type: "integer"
  24309. }
  24310. },
  24311. url: "/teams/:team_id/discussions/:discussion_number"
  24312. },
  24313. getDiscussionComment: {
  24314. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24315. method: "GET",
  24316. params: {
  24317. comment_number: {
  24318. required: true,
  24319. type: "integer"
  24320. },
  24321. discussion_number: {
  24322. required: true,
  24323. type: "integer"
  24324. },
  24325. team_id: {
  24326. required: true,
  24327. type: "integer"
  24328. }
  24329. },
  24330. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24331. },
  24332. getDiscussionCommentInOrg: {
  24333. method: "GET",
  24334. params: {
  24335. comment_number: {
  24336. required: true,
  24337. type: "integer"
  24338. },
  24339. discussion_number: {
  24340. required: true,
  24341. type: "integer"
  24342. },
  24343. org: {
  24344. required: true,
  24345. type: "string"
  24346. },
  24347. team_slug: {
  24348. required: true,
  24349. type: "string"
  24350. }
  24351. },
  24352. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24353. },
  24354. getDiscussionCommentLegacy: {
  24355. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24356. method: "GET",
  24357. params: {
  24358. comment_number: {
  24359. required: true,
  24360. type: "integer"
  24361. },
  24362. discussion_number: {
  24363. required: true,
  24364. type: "integer"
  24365. },
  24366. team_id: {
  24367. required: true,
  24368. type: "integer"
  24369. }
  24370. },
  24371. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24372. },
  24373. getDiscussionInOrg: {
  24374. method: "GET",
  24375. params: {
  24376. discussion_number: {
  24377. required: true,
  24378. type: "integer"
  24379. },
  24380. org: {
  24381. required: true,
  24382. type: "string"
  24383. },
  24384. team_slug: {
  24385. required: true,
  24386. type: "string"
  24387. }
  24388. },
  24389. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24390. },
  24391. getDiscussionLegacy: {
  24392. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24393. method: "GET",
  24394. params: {
  24395. discussion_number: {
  24396. required: true,
  24397. type: "integer"
  24398. },
  24399. team_id: {
  24400. required: true,
  24401. type: "integer"
  24402. }
  24403. },
  24404. url: "/teams/:team_id/discussions/:discussion_number"
  24405. },
  24406. getLegacy: {
  24407. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24408. method: "GET",
  24409. params: {
  24410. team_id: {
  24411. required: true,
  24412. type: "integer"
  24413. }
  24414. },
  24415. url: "/teams/:team_id"
  24416. },
  24417. getMember: {
  24418. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24419. method: "GET",
  24420. params: {
  24421. team_id: {
  24422. required: true,
  24423. type: "integer"
  24424. },
  24425. username: {
  24426. required: true,
  24427. type: "string"
  24428. }
  24429. },
  24430. url: "/teams/:team_id/members/:username"
  24431. },
  24432. getMemberLegacy: {
  24433. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24434. method: "GET",
  24435. params: {
  24436. team_id: {
  24437. required: true,
  24438. type: "integer"
  24439. },
  24440. username: {
  24441. required: true,
  24442. type: "string"
  24443. }
  24444. },
  24445. url: "/teams/:team_id/members/:username"
  24446. },
  24447. getMembership: {
  24448. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24449. method: "GET",
  24450. params: {
  24451. team_id: {
  24452. required: true,
  24453. type: "integer"
  24454. },
  24455. username: {
  24456. required: true,
  24457. type: "string"
  24458. }
  24459. },
  24460. url: "/teams/:team_id/memberships/:username"
  24461. },
  24462. getMembershipInOrg: {
  24463. method: "GET",
  24464. params: {
  24465. org: {
  24466. required: true,
  24467. type: "string"
  24468. },
  24469. team_slug: {
  24470. required: true,
  24471. type: "string"
  24472. },
  24473. username: {
  24474. required: true,
  24475. type: "string"
  24476. }
  24477. },
  24478. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24479. },
  24480. getMembershipLegacy: {
  24481. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24482. method: "GET",
  24483. params: {
  24484. team_id: {
  24485. required: true,
  24486. type: "integer"
  24487. },
  24488. username: {
  24489. required: true,
  24490. type: "string"
  24491. }
  24492. },
  24493. url: "/teams/:team_id/memberships/:username"
  24494. },
  24495. list: {
  24496. method: "GET",
  24497. params: {
  24498. org: {
  24499. required: true,
  24500. type: "string"
  24501. },
  24502. page: {
  24503. type: "integer"
  24504. },
  24505. per_page: {
  24506. type: "integer"
  24507. }
  24508. },
  24509. url: "/orgs/:org/teams"
  24510. },
  24511. listChild: {
  24512. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24513. method: "GET",
  24514. params: {
  24515. page: {
  24516. type: "integer"
  24517. },
  24518. per_page: {
  24519. type: "integer"
  24520. },
  24521. team_id: {
  24522. required: true,
  24523. type: "integer"
  24524. }
  24525. },
  24526. url: "/teams/:team_id/teams"
  24527. },
  24528. listChildInOrg: {
  24529. method: "GET",
  24530. params: {
  24531. org: {
  24532. required: true,
  24533. type: "string"
  24534. },
  24535. page: {
  24536. type: "integer"
  24537. },
  24538. per_page: {
  24539. type: "integer"
  24540. },
  24541. team_slug: {
  24542. required: true,
  24543. type: "string"
  24544. }
  24545. },
  24546. url: "/orgs/:org/teams/:team_slug/teams"
  24547. },
  24548. listChildLegacy: {
  24549. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24550. method: "GET",
  24551. params: {
  24552. page: {
  24553. type: "integer"
  24554. },
  24555. per_page: {
  24556. type: "integer"
  24557. },
  24558. team_id: {
  24559. required: true,
  24560. type: "integer"
  24561. }
  24562. },
  24563. url: "/teams/:team_id/teams"
  24564. },
  24565. listDiscussionComments: {
  24566. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24567. method: "GET",
  24568. params: {
  24569. direction: {
  24570. enum: ["asc", "desc"],
  24571. type: "string"
  24572. },
  24573. discussion_number: {
  24574. required: true,
  24575. type: "integer"
  24576. },
  24577. page: {
  24578. type: "integer"
  24579. },
  24580. per_page: {
  24581. type: "integer"
  24582. },
  24583. team_id: {
  24584. required: true,
  24585. type: "integer"
  24586. }
  24587. },
  24588. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24589. },
  24590. listDiscussionCommentsInOrg: {
  24591. method: "GET",
  24592. params: {
  24593. direction: {
  24594. enum: ["asc", "desc"],
  24595. type: "string"
  24596. },
  24597. discussion_number: {
  24598. required: true,
  24599. type: "integer"
  24600. },
  24601. org: {
  24602. required: true,
  24603. type: "string"
  24604. },
  24605. page: {
  24606. type: "integer"
  24607. },
  24608. per_page: {
  24609. type: "integer"
  24610. },
  24611. team_slug: {
  24612. required: true,
  24613. type: "string"
  24614. }
  24615. },
  24616. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24617. },
  24618. listDiscussionCommentsLegacy: {
  24619. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24620. method: "GET",
  24621. params: {
  24622. direction: {
  24623. enum: ["asc", "desc"],
  24624. type: "string"
  24625. },
  24626. discussion_number: {
  24627. required: true,
  24628. type: "integer"
  24629. },
  24630. page: {
  24631. type: "integer"
  24632. },
  24633. per_page: {
  24634. type: "integer"
  24635. },
  24636. team_id: {
  24637. required: true,
  24638. type: "integer"
  24639. }
  24640. },
  24641. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24642. },
  24643. listDiscussions: {
  24644. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24645. method: "GET",
  24646. params: {
  24647. direction: {
  24648. enum: ["asc", "desc"],
  24649. type: "string"
  24650. },
  24651. page: {
  24652. type: "integer"
  24653. },
  24654. per_page: {
  24655. type: "integer"
  24656. },
  24657. team_id: {
  24658. required: true,
  24659. type: "integer"
  24660. }
  24661. },
  24662. url: "/teams/:team_id/discussions"
  24663. },
  24664. listDiscussionsInOrg: {
  24665. method: "GET",
  24666. params: {
  24667. direction: {
  24668. enum: ["asc", "desc"],
  24669. type: "string"
  24670. },
  24671. org: {
  24672. required: true,
  24673. type: "string"
  24674. },
  24675. page: {
  24676. type: "integer"
  24677. },
  24678. per_page: {
  24679. type: "integer"
  24680. },
  24681. team_slug: {
  24682. required: true,
  24683. type: "string"
  24684. }
  24685. },
  24686. url: "/orgs/:org/teams/:team_slug/discussions"
  24687. },
  24688. listDiscussionsLegacy: {
  24689. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24690. method: "GET",
  24691. params: {
  24692. direction: {
  24693. enum: ["asc", "desc"],
  24694. type: "string"
  24695. },
  24696. page: {
  24697. type: "integer"
  24698. },
  24699. per_page: {
  24700. type: "integer"
  24701. },
  24702. team_id: {
  24703. required: true,
  24704. type: "integer"
  24705. }
  24706. },
  24707. url: "/teams/:team_id/discussions"
  24708. },
  24709. listForAuthenticatedUser: {
  24710. method: "GET",
  24711. params: {
  24712. page: {
  24713. type: "integer"
  24714. },
  24715. per_page: {
  24716. type: "integer"
  24717. }
  24718. },
  24719. url: "/user/teams"
  24720. },
  24721. listMembers: {
  24722. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24723. method: "GET",
  24724. params: {
  24725. page: {
  24726. type: "integer"
  24727. },
  24728. per_page: {
  24729. type: "integer"
  24730. },
  24731. role: {
  24732. enum: ["member", "maintainer", "all"],
  24733. type: "string"
  24734. },
  24735. team_id: {
  24736. required: true,
  24737. type: "integer"
  24738. }
  24739. },
  24740. url: "/teams/:team_id/members"
  24741. },
  24742. listMembersInOrg: {
  24743. method: "GET",
  24744. params: {
  24745. org: {
  24746. required: true,
  24747. type: "string"
  24748. },
  24749. page: {
  24750. type: "integer"
  24751. },
  24752. per_page: {
  24753. type: "integer"
  24754. },
  24755. role: {
  24756. enum: ["member", "maintainer", "all"],
  24757. type: "string"
  24758. },
  24759. team_slug: {
  24760. required: true,
  24761. type: "string"
  24762. }
  24763. },
  24764. url: "/orgs/:org/teams/:team_slug/members"
  24765. },
  24766. listMembersLegacy: {
  24767. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24768. method: "GET",
  24769. params: {
  24770. page: {
  24771. type: "integer"
  24772. },
  24773. per_page: {
  24774. type: "integer"
  24775. },
  24776. role: {
  24777. enum: ["member", "maintainer", "all"],
  24778. type: "string"
  24779. },
  24780. team_id: {
  24781. required: true,
  24782. type: "integer"
  24783. }
  24784. },
  24785. url: "/teams/:team_id/members"
  24786. },
  24787. listPendingInvitations: {
  24788. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24789. method: "GET",
  24790. params: {
  24791. page: {
  24792. type: "integer"
  24793. },
  24794. per_page: {
  24795. type: "integer"
  24796. },
  24797. team_id: {
  24798. required: true,
  24799. type: "integer"
  24800. }
  24801. },
  24802. url: "/teams/:team_id/invitations"
  24803. },
  24804. listPendingInvitationsInOrg: {
  24805. method: "GET",
  24806. params: {
  24807. org: {
  24808. required: true,
  24809. type: "string"
  24810. },
  24811. page: {
  24812. type: "integer"
  24813. },
  24814. per_page: {
  24815. type: "integer"
  24816. },
  24817. team_slug: {
  24818. required: true,
  24819. type: "string"
  24820. }
  24821. },
  24822. url: "/orgs/:org/teams/:team_slug/invitations"
  24823. },
  24824. listPendingInvitationsLegacy: {
  24825. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24826. method: "GET",
  24827. params: {
  24828. page: {
  24829. type: "integer"
  24830. },
  24831. per_page: {
  24832. type: "integer"
  24833. },
  24834. team_id: {
  24835. required: true,
  24836. type: "integer"
  24837. }
  24838. },
  24839. url: "/teams/:team_id/invitations"
  24840. },
  24841. listProjects: {
  24842. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24843. headers: {
  24844. accept: "application/vnd.github.inertia-preview+json"
  24845. },
  24846. method: "GET",
  24847. params: {
  24848. page: {
  24849. type: "integer"
  24850. },
  24851. per_page: {
  24852. type: "integer"
  24853. },
  24854. team_id: {
  24855. required: true,
  24856. type: "integer"
  24857. }
  24858. },
  24859. url: "/teams/:team_id/projects"
  24860. },
  24861. listProjectsInOrg: {
  24862. headers: {
  24863. accept: "application/vnd.github.inertia-preview+json"
  24864. },
  24865. method: "GET",
  24866. params: {
  24867. org: {
  24868. required: true,
  24869. type: "string"
  24870. },
  24871. page: {
  24872. type: "integer"
  24873. },
  24874. per_page: {
  24875. type: "integer"
  24876. },
  24877. team_slug: {
  24878. required: true,
  24879. type: "string"
  24880. }
  24881. },
  24882. url: "/orgs/:org/teams/:team_slug/projects"
  24883. },
  24884. listProjectsLegacy: {
  24885. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24886. headers: {
  24887. accept: "application/vnd.github.inertia-preview+json"
  24888. },
  24889. method: "GET",
  24890. params: {
  24891. page: {
  24892. type: "integer"
  24893. },
  24894. per_page: {
  24895. type: "integer"
  24896. },
  24897. team_id: {
  24898. required: true,
  24899. type: "integer"
  24900. }
  24901. },
  24902. url: "/teams/:team_id/projects"
  24903. },
  24904. listRepos: {
  24905. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24906. method: "GET",
  24907. params: {
  24908. page: {
  24909. type: "integer"
  24910. },
  24911. per_page: {
  24912. type: "integer"
  24913. },
  24914. team_id: {
  24915. required: true,
  24916. type: "integer"
  24917. }
  24918. },
  24919. url: "/teams/:team_id/repos"
  24920. },
  24921. listReposInOrg: {
  24922. method: "GET",
  24923. params: {
  24924. org: {
  24925. required: true,
  24926. type: "string"
  24927. },
  24928. page: {
  24929. type: "integer"
  24930. },
  24931. per_page: {
  24932. type: "integer"
  24933. },
  24934. team_slug: {
  24935. required: true,
  24936. type: "string"
  24937. }
  24938. },
  24939. url: "/orgs/:org/teams/:team_slug/repos"
  24940. },
  24941. listReposLegacy: {
  24942. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24943. method: "GET",
  24944. params: {
  24945. page: {
  24946. type: "integer"
  24947. },
  24948. per_page: {
  24949. type: "integer"
  24950. },
  24951. team_id: {
  24952. required: true,
  24953. type: "integer"
  24954. }
  24955. },
  24956. url: "/teams/:team_id/repos"
  24957. },
  24958. removeMember: {
  24959. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24960. method: "DELETE",
  24961. params: {
  24962. team_id: {
  24963. required: true,
  24964. type: "integer"
  24965. },
  24966. username: {
  24967. required: true,
  24968. type: "string"
  24969. }
  24970. },
  24971. url: "/teams/:team_id/members/:username"
  24972. },
  24973. removeMemberLegacy: {
  24974. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24975. method: "DELETE",
  24976. params: {
  24977. team_id: {
  24978. required: true,
  24979. type: "integer"
  24980. },
  24981. username: {
  24982. required: true,
  24983. type: "string"
  24984. }
  24985. },
  24986. url: "/teams/:team_id/members/:username"
  24987. },
  24988. removeMembership: {
  24989. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24990. method: "DELETE",
  24991. params: {
  24992. team_id: {
  24993. required: true,
  24994. type: "integer"
  24995. },
  24996. username: {
  24997. required: true,
  24998. type: "string"
  24999. }
  25000. },
  25001. url: "/teams/:team_id/memberships/:username"
  25002. },
  25003. removeMembershipInOrg: {
  25004. method: "DELETE",
  25005. params: {
  25006. org: {
  25007. required: true,
  25008. type: "string"
  25009. },
  25010. team_slug: {
  25011. required: true,
  25012. type: "string"
  25013. },
  25014. username: {
  25015. required: true,
  25016. type: "string"
  25017. }
  25018. },
  25019. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  25020. },
  25021. removeMembershipLegacy: {
  25022. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  25023. method: "DELETE",
  25024. params: {
  25025. team_id: {
  25026. required: true,
  25027. type: "integer"
  25028. },
  25029. username: {
  25030. required: true,
  25031. type: "string"
  25032. }
  25033. },
  25034. url: "/teams/:team_id/memberships/:username"
  25035. },
  25036. removeProject: {
  25037. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  25038. method: "DELETE",
  25039. params: {
  25040. project_id: {
  25041. required: true,
  25042. type: "integer"
  25043. },
  25044. team_id: {
  25045. required: true,
  25046. type: "integer"
  25047. }
  25048. },
  25049. url: "/teams/:team_id/projects/:project_id"
  25050. },
  25051. removeProjectInOrg: {
  25052. method: "DELETE",
  25053. params: {
  25054. org: {
  25055. required: true,
  25056. type: "string"
  25057. },
  25058. project_id: {
  25059. required: true,
  25060. type: "integer"
  25061. },
  25062. team_slug: {
  25063. required: true,
  25064. type: "string"
  25065. }
  25066. },
  25067. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25068. },
  25069. removeProjectLegacy: {
  25070. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25071. method: "DELETE",
  25072. params: {
  25073. project_id: {
  25074. required: true,
  25075. type: "integer"
  25076. },
  25077. team_id: {
  25078. required: true,
  25079. type: "integer"
  25080. }
  25081. },
  25082. url: "/teams/:team_id/projects/:project_id"
  25083. },
  25084. removeRepo: {
  25085. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25086. method: "DELETE",
  25087. params: {
  25088. owner: {
  25089. required: true,
  25090. type: "string"
  25091. },
  25092. repo: {
  25093. required: true,
  25094. type: "string"
  25095. },
  25096. team_id: {
  25097. required: true,
  25098. type: "integer"
  25099. }
  25100. },
  25101. url: "/teams/:team_id/repos/:owner/:repo"
  25102. },
  25103. removeRepoInOrg: {
  25104. method: "DELETE",
  25105. params: {
  25106. org: {
  25107. required: true,
  25108. type: "string"
  25109. },
  25110. owner: {
  25111. required: true,
  25112. type: "string"
  25113. },
  25114. repo: {
  25115. required: true,
  25116. type: "string"
  25117. },
  25118. team_slug: {
  25119. required: true,
  25120. type: "string"
  25121. }
  25122. },
  25123. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25124. },
  25125. removeRepoLegacy: {
  25126. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25127. method: "DELETE",
  25128. params: {
  25129. owner: {
  25130. required: true,
  25131. type: "string"
  25132. },
  25133. repo: {
  25134. required: true,
  25135. type: "string"
  25136. },
  25137. team_id: {
  25138. required: true,
  25139. type: "integer"
  25140. }
  25141. },
  25142. url: "/teams/:team_id/repos/:owner/:repo"
  25143. },
  25144. reviewProject: {
  25145. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25146. headers: {
  25147. accept: "application/vnd.github.inertia-preview+json"
  25148. },
  25149. method: "GET",
  25150. params: {
  25151. project_id: {
  25152. required: true,
  25153. type: "integer"
  25154. },
  25155. team_id: {
  25156. required: true,
  25157. type: "integer"
  25158. }
  25159. },
  25160. url: "/teams/:team_id/projects/:project_id"
  25161. },
  25162. reviewProjectInOrg: {
  25163. headers: {
  25164. accept: "application/vnd.github.inertia-preview+json"
  25165. },
  25166. method: "GET",
  25167. params: {
  25168. org: {
  25169. required: true,
  25170. type: "string"
  25171. },
  25172. project_id: {
  25173. required: true,
  25174. type: "integer"
  25175. },
  25176. team_slug: {
  25177. required: true,
  25178. type: "string"
  25179. }
  25180. },
  25181. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25182. },
  25183. reviewProjectLegacy: {
  25184. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25185. headers: {
  25186. accept: "application/vnd.github.inertia-preview+json"
  25187. },
  25188. method: "GET",
  25189. params: {
  25190. project_id: {
  25191. required: true,
  25192. type: "integer"
  25193. },
  25194. team_id: {
  25195. required: true,
  25196. type: "integer"
  25197. }
  25198. },
  25199. url: "/teams/:team_id/projects/:project_id"
  25200. },
  25201. update: {
  25202. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25203. method: "PATCH",
  25204. params: {
  25205. description: {
  25206. type: "string"
  25207. },
  25208. name: {
  25209. required: true,
  25210. type: "string"
  25211. },
  25212. parent_team_id: {
  25213. type: "integer"
  25214. },
  25215. permission: {
  25216. enum: ["pull", "push", "admin"],
  25217. type: "string"
  25218. },
  25219. privacy: {
  25220. enum: ["secret", "closed"],
  25221. type: "string"
  25222. },
  25223. team_id: {
  25224. required: true,
  25225. type: "integer"
  25226. }
  25227. },
  25228. url: "/teams/:team_id"
  25229. },
  25230. updateDiscussion: {
  25231. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25232. method: "PATCH",
  25233. params: {
  25234. body: {
  25235. type: "string"
  25236. },
  25237. discussion_number: {
  25238. required: true,
  25239. type: "integer"
  25240. },
  25241. team_id: {
  25242. required: true,
  25243. type: "integer"
  25244. },
  25245. title: {
  25246. type: "string"
  25247. }
  25248. },
  25249. url: "/teams/:team_id/discussions/:discussion_number"
  25250. },
  25251. updateDiscussionComment: {
  25252. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25253. method: "PATCH",
  25254. params: {
  25255. body: {
  25256. required: true,
  25257. type: "string"
  25258. },
  25259. comment_number: {
  25260. required: true,
  25261. type: "integer"
  25262. },
  25263. discussion_number: {
  25264. required: true,
  25265. type: "integer"
  25266. },
  25267. team_id: {
  25268. required: true,
  25269. type: "integer"
  25270. }
  25271. },
  25272. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25273. },
  25274. updateDiscussionCommentInOrg: {
  25275. method: "PATCH",
  25276. params: {
  25277. body: {
  25278. required: true,
  25279. type: "string"
  25280. },
  25281. comment_number: {
  25282. required: true,
  25283. type: "integer"
  25284. },
  25285. discussion_number: {
  25286. required: true,
  25287. type: "integer"
  25288. },
  25289. org: {
  25290. required: true,
  25291. type: "string"
  25292. },
  25293. team_slug: {
  25294. required: true,
  25295. type: "string"
  25296. }
  25297. },
  25298. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25299. },
  25300. updateDiscussionCommentLegacy: {
  25301. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25302. method: "PATCH",
  25303. params: {
  25304. body: {
  25305. required: true,
  25306. type: "string"
  25307. },
  25308. comment_number: {
  25309. required: true,
  25310. type: "integer"
  25311. },
  25312. discussion_number: {
  25313. required: true,
  25314. type: "integer"
  25315. },
  25316. team_id: {
  25317. required: true,
  25318. type: "integer"
  25319. }
  25320. },
  25321. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25322. },
  25323. updateDiscussionInOrg: {
  25324. method: "PATCH",
  25325. params: {
  25326. body: {
  25327. type: "string"
  25328. },
  25329. discussion_number: {
  25330. required: true,
  25331. type: "integer"
  25332. },
  25333. org: {
  25334. required: true,
  25335. type: "string"
  25336. },
  25337. team_slug: {
  25338. required: true,
  25339. type: "string"
  25340. },
  25341. title: {
  25342. type: "string"
  25343. }
  25344. },
  25345. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25346. },
  25347. updateDiscussionLegacy: {
  25348. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25349. method: "PATCH",
  25350. params: {
  25351. body: {
  25352. type: "string"
  25353. },
  25354. discussion_number: {
  25355. required: true,
  25356. type: "integer"
  25357. },
  25358. team_id: {
  25359. required: true,
  25360. type: "integer"
  25361. },
  25362. title: {
  25363. type: "string"
  25364. }
  25365. },
  25366. url: "/teams/:team_id/discussions/:discussion_number"
  25367. },
  25368. updateInOrg: {
  25369. method: "PATCH",
  25370. params: {
  25371. description: {
  25372. type: "string"
  25373. },
  25374. name: {
  25375. required: true,
  25376. type: "string"
  25377. },
  25378. org: {
  25379. required: true,
  25380. type: "string"
  25381. },
  25382. parent_team_id: {
  25383. type: "integer"
  25384. },
  25385. permission: {
  25386. enum: ["pull", "push", "admin"],
  25387. type: "string"
  25388. },
  25389. privacy: {
  25390. enum: ["secret", "closed"],
  25391. type: "string"
  25392. },
  25393. team_slug: {
  25394. required: true,
  25395. type: "string"
  25396. }
  25397. },
  25398. url: "/orgs/:org/teams/:team_slug"
  25399. },
  25400. updateLegacy: {
  25401. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25402. method: "PATCH",
  25403. params: {
  25404. description: {
  25405. type: "string"
  25406. },
  25407. name: {
  25408. required: true,
  25409. type: "string"
  25410. },
  25411. parent_team_id: {
  25412. type: "integer"
  25413. },
  25414. permission: {
  25415. enum: ["pull", "push", "admin"],
  25416. type: "string"
  25417. },
  25418. privacy: {
  25419. enum: ["secret", "closed"],
  25420. type: "string"
  25421. },
  25422. team_id: {
  25423. required: true,
  25424. type: "integer"
  25425. }
  25426. },
  25427. url: "/teams/:team_id"
  25428. }
  25429. },
  25430. users: {
  25431. addEmails: {
  25432. method: "POST",
  25433. params: {
  25434. emails: {
  25435. required: true,
  25436. type: "string[]"
  25437. }
  25438. },
  25439. url: "/user/emails"
  25440. },
  25441. block: {
  25442. method: "PUT",
  25443. params: {
  25444. username: {
  25445. required: true,
  25446. type: "string"
  25447. }
  25448. },
  25449. url: "/user/blocks/:username"
  25450. },
  25451. checkBlocked: {
  25452. method: "GET",
  25453. params: {
  25454. username: {
  25455. required: true,
  25456. type: "string"
  25457. }
  25458. },
  25459. url: "/user/blocks/:username"
  25460. },
  25461. checkFollowing: {
  25462. method: "GET",
  25463. params: {
  25464. username: {
  25465. required: true,
  25466. type: "string"
  25467. }
  25468. },
  25469. url: "/user/following/:username"
  25470. },
  25471. checkFollowingForUser: {
  25472. method: "GET",
  25473. params: {
  25474. target_user: {
  25475. required: true,
  25476. type: "string"
  25477. },
  25478. username: {
  25479. required: true,
  25480. type: "string"
  25481. }
  25482. },
  25483. url: "/users/:username/following/:target_user"
  25484. },
  25485. createGpgKey: {
  25486. method: "POST",
  25487. params: {
  25488. armored_public_key: {
  25489. type: "string"
  25490. }
  25491. },
  25492. url: "/user/gpg_keys"
  25493. },
  25494. createPublicKey: {
  25495. method: "POST",
  25496. params: {
  25497. key: {
  25498. type: "string"
  25499. },
  25500. title: {
  25501. type: "string"
  25502. }
  25503. },
  25504. url: "/user/keys"
  25505. },
  25506. deleteEmails: {
  25507. method: "DELETE",
  25508. params: {
  25509. emails: {
  25510. required: true,
  25511. type: "string[]"
  25512. }
  25513. },
  25514. url: "/user/emails"
  25515. },
  25516. deleteGpgKey: {
  25517. method: "DELETE",
  25518. params: {
  25519. gpg_key_id: {
  25520. required: true,
  25521. type: "integer"
  25522. }
  25523. },
  25524. url: "/user/gpg_keys/:gpg_key_id"
  25525. },
  25526. deletePublicKey: {
  25527. method: "DELETE",
  25528. params: {
  25529. key_id: {
  25530. required: true,
  25531. type: "integer"
  25532. }
  25533. },
  25534. url: "/user/keys/:key_id"
  25535. },
  25536. follow: {
  25537. method: "PUT",
  25538. params: {
  25539. username: {
  25540. required: true,
  25541. type: "string"
  25542. }
  25543. },
  25544. url: "/user/following/:username"
  25545. },
  25546. getAuthenticated: {
  25547. method: "GET",
  25548. params: {},
  25549. url: "/user"
  25550. },
  25551. getByUsername: {
  25552. method: "GET",
  25553. params: {
  25554. username: {
  25555. required: true,
  25556. type: "string"
  25557. }
  25558. },
  25559. url: "/users/:username"
  25560. },
  25561. getContextForUser: {
  25562. method: "GET",
  25563. params: {
  25564. subject_id: {
  25565. type: "string"
  25566. },
  25567. subject_type: {
  25568. enum: ["organization", "repository", "issue", "pull_request"],
  25569. type: "string"
  25570. },
  25571. username: {
  25572. required: true,
  25573. type: "string"
  25574. }
  25575. },
  25576. url: "/users/:username/hovercard"
  25577. },
  25578. getGpgKey: {
  25579. method: "GET",
  25580. params: {
  25581. gpg_key_id: {
  25582. required: true,
  25583. type: "integer"
  25584. }
  25585. },
  25586. url: "/user/gpg_keys/:gpg_key_id"
  25587. },
  25588. getPublicKey: {
  25589. method: "GET",
  25590. params: {
  25591. key_id: {
  25592. required: true,
  25593. type: "integer"
  25594. }
  25595. },
  25596. url: "/user/keys/:key_id"
  25597. },
  25598. list: {
  25599. method: "GET",
  25600. params: {
  25601. page: {
  25602. type: "integer"
  25603. },
  25604. per_page: {
  25605. type: "integer"
  25606. },
  25607. since: {
  25608. type: "string"
  25609. }
  25610. },
  25611. url: "/users"
  25612. },
  25613. listBlocked: {
  25614. method: "GET",
  25615. params: {},
  25616. url: "/user/blocks"
  25617. },
  25618. listEmails: {
  25619. method: "GET",
  25620. params: {
  25621. page: {
  25622. type: "integer"
  25623. },
  25624. per_page: {
  25625. type: "integer"
  25626. }
  25627. },
  25628. url: "/user/emails"
  25629. },
  25630. listFollowersForAuthenticatedUser: {
  25631. method: "GET",
  25632. params: {
  25633. page: {
  25634. type: "integer"
  25635. },
  25636. per_page: {
  25637. type: "integer"
  25638. }
  25639. },
  25640. url: "/user/followers"
  25641. },
  25642. listFollowersForUser: {
  25643. method: "GET",
  25644. params: {
  25645. page: {
  25646. type: "integer"
  25647. },
  25648. per_page: {
  25649. type: "integer"
  25650. },
  25651. username: {
  25652. required: true,
  25653. type: "string"
  25654. }
  25655. },
  25656. url: "/users/:username/followers"
  25657. },
  25658. listFollowingForAuthenticatedUser: {
  25659. method: "GET",
  25660. params: {
  25661. page: {
  25662. type: "integer"
  25663. },
  25664. per_page: {
  25665. type: "integer"
  25666. }
  25667. },
  25668. url: "/user/following"
  25669. },
  25670. listFollowingForUser: {
  25671. method: "GET",
  25672. params: {
  25673. page: {
  25674. type: "integer"
  25675. },
  25676. per_page: {
  25677. type: "integer"
  25678. },
  25679. username: {
  25680. required: true,
  25681. type: "string"
  25682. }
  25683. },
  25684. url: "/users/:username/following"
  25685. },
  25686. listGpgKeys: {
  25687. method: "GET",
  25688. params: {
  25689. page: {
  25690. type: "integer"
  25691. },
  25692. per_page: {
  25693. type: "integer"
  25694. }
  25695. },
  25696. url: "/user/gpg_keys"
  25697. },
  25698. listGpgKeysForUser: {
  25699. method: "GET",
  25700. params: {
  25701. page: {
  25702. type: "integer"
  25703. },
  25704. per_page: {
  25705. type: "integer"
  25706. },
  25707. username: {
  25708. required: true,
  25709. type: "string"
  25710. }
  25711. },
  25712. url: "/users/:username/gpg_keys"
  25713. },
  25714. listPublicEmails: {
  25715. method: "GET",
  25716. params: {
  25717. page: {
  25718. type: "integer"
  25719. },
  25720. per_page: {
  25721. type: "integer"
  25722. }
  25723. },
  25724. url: "/user/public_emails"
  25725. },
  25726. listPublicKeys: {
  25727. method: "GET",
  25728. params: {
  25729. page: {
  25730. type: "integer"
  25731. },
  25732. per_page: {
  25733. type: "integer"
  25734. }
  25735. },
  25736. url: "/user/keys"
  25737. },
  25738. listPublicKeysForUser: {
  25739. method: "GET",
  25740. params: {
  25741. page: {
  25742. type: "integer"
  25743. },
  25744. per_page: {
  25745. type: "integer"
  25746. },
  25747. username: {
  25748. required: true,
  25749. type: "string"
  25750. }
  25751. },
  25752. url: "/users/:username/keys"
  25753. },
  25754. togglePrimaryEmailVisibility: {
  25755. method: "PATCH",
  25756. params: {
  25757. email: {
  25758. required: true,
  25759. type: "string"
  25760. },
  25761. visibility: {
  25762. required: true,
  25763. type: "string"
  25764. }
  25765. },
  25766. url: "/user/email/visibility"
  25767. },
  25768. unblock: {
  25769. method: "DELETE",
  25770. params: {
  25771. username: {
  25772. required: true,
  25773. type: "string"
  25774. }
  25775. },
  25776. url: "/user/blocks/:username"
  25777. },
  25778. unfollow: {
  25779. method: "DELETE",
  25780. params: {
  25781. username: {
  25782. required: true,
  25783. type: "string"
  25784. }
  25785. },
  25786. url: "/user/following/:username"
  25787. },
  25788. updateAuthenticated: {
  25789. method: "PATCH",
  25790. params: {
  25791. bio: {
  25792. type: "string"
  25793. },
  25794. blog: {
  25795. type: "string"
  25796. },
  25797. company: {
  25798. type: "string"
  25799. },
  25800. email: {
  25801. type: "string"
  25802. },
  25803. hireable: {
  25804. type: "boolean"
  25805. },
  25806. location: {
  25807. type: "string"
  25808. },
  25809. name: {
  25810. type: "string"
  25811. }
  25812. },
  25813. url: "/user"
  25814. }
  25815. }
  25816. };
  25817. const VERSION = "2.4.0";
  25818. function registerEndpoints(octokit, routes) {
  25819. Object.keys(routes).forEach(namespaceName => {
  25820. if (!octokit[namespaceName]) {
  25821. octokit[namespaceName] = {};
  25822. }
  25823. Object.keys(routes[namespaceName]).forEach(apiName => {
  25824. const apiOptions = routes[namespaceName][apiName];
  25825. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25826. if (typeof apiOptions[key] !== "undefined") {
  25827. map[key] = apiOptions[key];
  25828. }
  25829. return map;
  25830. }, {});
  25831. endpointDefaults.request = {
  25832. validate: apiOptions.params
  25833. };
  25834. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25835. // Not the most elegant solution, but we don’t want to move deprecation
  25836. // logic into octokit/endpoint.js as it’s out of scope
  25837. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25838. if (hasDeprecatedParam) {
  25839. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25840. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25841. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25842. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25843. }
  25844. if (apiOptions.deprecated) {
  25845. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25846. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25847. octokit[namespaceName][apiName] = request;
  25848. return request.apply(null, arguments);
  25849. }, request);
  25850. return;
  25851. }
  25852. octokit[namespaceName][apiName] = request;
  25853. });
  25854. });
  25855. }
  25856. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25857. const patchedMethod = options => {
  25858. options = Object.assign({}, options);
  25859. Object.keys(options).forEach(key => {
  25860. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25861. const aliasKey = apiOptions.params[key].alias;
  25862. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25863. if (!(aliasKey in options)) {
  25864. options[aliasKey] = options[key];
  25865. }
  25866. delete options[key];
  25867. }
  25868. });
  25869. return method(options);
  25870. };
  25871. Object.keys(method).forEach(key => {
  25872. patchedMethod[key] = method[key];
  25873. });
  25874. return patchedMethod;
  25875. }
  25876. /**
  25877. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25878. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25879. * done, we will remove the registerEndpoints methods and return the methods
  25880. * directly as with the other plugins. At that point we will also remove the
  25881. * legacy workarounds and deprecations.
  25882. *
  25883. * See the plan at
  25884. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25885. */
  25886. function restEndpointMethods(octokit) {
  25887. // @ts-ignore
  25888. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25889. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25890. // See https://github.com/octokit/rest.js/pull/1134
  25891. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25892. Object.defineProperty(octokit, deprecatedScope, {
  25893. get() {
  25894. octokit.log.warn( // @ts-ignore
  25895. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25896. return octokit[scope];
  25897. }
  25898. });
  25899. });
  25900. return {};
  25901. }
  25902. restEndpointMethods.VERSION = VERSION;
  25903. exports.restEndpointMethods = restEndpointMethods;
  25904. //# sourceMappingURL=index.js.map
  25905. /***/ }),
  25906. /***/ 850:
  25907. /***/ (function(module, __unusedexports, __webpack_require__) {
  25908. module.exports = paginationMethodsPlugin
  25909. function paginationMethodsPlugin (octokit) {
  25910. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25911. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25912. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25913. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25914. octokit.hasFirstPage = __webpack_require__(536)
  25915. octokit.hasLastPage = __webpack_require__(336)
  25916. octokit.hasNextPage = __webpack_require__(929)
  25917. octokit.hasPreviousPage = __webpack_require__(558)
  25918. }
  25919. /***/ }),
  25920. /***/ 854:
  25921. /***/ (function(module) {
  25922. /**
  25923. * lodash (Custom Build) <https://lodash.com/>
  25924. * Build: `lodash modularize exports="npm" -o ./`
  25925. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25926. * Released under MIT license <https://lodash.com/license>
  25927. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25928. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25929. */
  25930. /** Used as the `TypeError` message for "Functions" methods. */
  25931. var FUNC_ERROR_TEXT = 'Expected a function';
  25932. /** Used to stand-in for `undefined` hash values. */
  25933. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25934. /** Used as references for various `Number` constants. */
  25935. var INFINITY = 1 / 0;
  25936. /** `Object#toString` result references. */
  25937. var funcTag = '[object Function]',
  25938. genTag = '[object GeneratorFunction]',
  25939. symbolTag = '[object Symbol]';
  25940. /** Used to match property names within property paths. */
  25941. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25942. reIsPlainProp = /^\w*$/,
  25943. reLeadingDot = /^\./,
  25944. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25945. /**
  25946. * Used to match `RegExp`
  25947. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25948. */
  25949. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25950. /** Used to match backslashes in property paths. */
  25951. var reEscapeChar = /\\(\\)?/g;
  25952. /** Used to detect host constructors (Safari). */
  25953. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25954. /** Detect free variable `global` from Node.js. */
  25955. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25956. /** Detect free variable `self`. */
  25957. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25958. /** Used as a reference to the global object. */
  25959. var root = freeGlobal || freeSelf || Function('return this')();
  25960. /**
  25961. * Gets the value at `key` of `object`.
  25962. *
  25963. * @private
  25964. * @param {Object} [object] The object to query.
  25965. * @param {string} key The key of the property to get.
  25966. * @returns {*} Returns the property value.
  25967. */
  25968. function getValue(object, key) {
  25969. return object == null ? undefined : object[key];
  25970. }
  25971. /**
  25972. * Checks if `value` is a host object in IE < 9.
  25973. *
  25974. * @private
  25975. * @param {*} value The value to check.
  25976. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25977. */
  25978. function isHostObject(value) {
  25979. // Many host objects are `Object` objects that can coerce to strings
  25980. // despite having improperly defined `toString` methods.
  25981. var result = false;
  25982. if (value != null && typeof value.toString != 'function') {
  25983. try {
  25984. result = !!(value + '');
  25985. } catch (e) {}
  25986. }
  25987. return result;
  25988. }
  25989. /** Used for built-in method references. */
  25990. var arrayProto = Array.prototype,
  25991. funcProto = Function.prototype,
  25992. objectProto = Object.prototype;
  25993. /** Used to detect overreaching core-js shims. */
  25994. var coreJsData = root['__core-js_shared__'];
  25995. /** Used to detect methods masquerading as native. */
  25996. var maskSrcKey = (function() {
  25997. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25998. return uid ? ('Symbol(src)_1.' + uid) : '';
  25999. }());
  26000. /** Used to resolve the decompiled source of functions. */
  26001. var funcToString = funcProto.toString;
  26002. /** Used to check objects for own properties. */
  26003. var hasOwnProperty = objectProto.hasOwnProperty;
  26004. /**
  26005. * Used to resolve the
  26006. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  26007. * of values.
  26008. */
  26009. var objectToString = objectProto.toString;
  26010. /** Used to detect if a method is native. */
  26011. var reIsNative = RegExp('^' +
  26012. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  26013. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  26014. );
  26015. /** Built-in value references. */
  26016. var Symbol = root.Symbol,
  26017. splice = arrayProto.splice;
  26018. /* Built-in method references that are verified to be native. */
  26019. var Map = getNative(root, 'Map'),
  26020. nativeCreate = getNative(Object, 'create');
  26021. /** Used to convert symbols to primitives and strings. */
  26022. var symbolProto = Symbol ? Symbol.prototype : undefined,
  26023. symbolToString = symbolProto ? symbolProto.toString : undefined;
  26024. /**
  26025. * Creates a hash object.
  26026. *
  26027. * @private
  26028. * @constructor
  26029. * @param {Array} [entries] The key-value pairs to cache.
  26030. */
  26031. function Hash(entries) {
  26032. var index = -1,
  26033. length = entries ? entries.length : 0;
  26034. this.clear();
  26035. while (++index < length) {
  26036. var entry = entries[index];
  26037. this.set(entry[0], entry[1]);
  26038. }
  26039. }
  26040. /**
  26041. * Removes all key-value entries from the hash.
  26042. *
  26043. * @private
  26044. * @name clear
  26045. * @memberOf Hash
  26046. */
  26047. function hashClear() {
  26048. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  26049. }
  26050. /**
  26051. * Removes `key` and its value from the hash.
  26052. *
  26053. * @private
  26054. * @name delete
  26055. * @memberOf Hash
  26056. * @param {Object} hash The hash to modify.
  26057. * @param {string} key The key of the value to remove.
  26058. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26059. */
  26060. function hashDelete(key) {
  26061. return this.has(key) && delete this.__data__[key];
  26062. }
  26063. /**
  26064. * Gets the hash value for `key`.
  26065. *
  26066. * @private
  26067. * @name get
  26068. * @memberOf Hash
  26069. * @param {string} key The key of the value to get.
  26070. * @returns {*} Returns the entry value.
  26071. */
  26072. function hashGet(key) {
  26073. var data = this.__data__;
  26074. if (nativeCreate) {
  26075. var result = data[key];
  26076. return result === HASH_UNDEFINED ? undefined : result;
  26077. }
  26078. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26079. }
  26080. /**
  26081. * Checks if a hash value for `key` exists.
  26082. *
  26083. * @private
  26084. * @name has
  26085. * @memberOf Hash
  26086. * @param {string} key The key of the entry to check.
  26087. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26088. */
  26089. function hashHas(key) {
  26090. var data = this.__data__;
  26091. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26092. }
  26093. /**
  26094. * Sets the hash `key` to `value`.
  26095. *
  26096. * @private
  26097. * @name set
  26098. * @memberOf Hash
  26099. * @param {string} key The key of the value to set.
  26100. * @param {*} value The value to set.
  26101. * @returns {Object} Returns the hash instance.
  26102. */
  26103. function hashSet(key, value) {
  26104. var data = this.__data__;
  26105. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26106. return this;
  26107. }
  26108. // Add methods to `Hash`.
  26109. Hash.prototype.clear = hashClear;
  26110. Hash.prototype['delete'] = hashDelete;
  26111. Hash.prototype.get = hashGet;
  26112. Hash.prototype.has = hashHas;
  26113. Hash.prototype.set = hashSet;
  26114. /**
  26115. * Creates an list cache object.
  26116. *
  26117. * @private
  26118. * @constructor
  26119. * @param {Array} [entries] The key-value pairs to cache.
  26120. */
  26121. function ListCache(entries) {
  26122. var index = -1,
  26123. length = entries ? entries.length : 0;
  26124. this.clear();
  26125. while (++index < length) {
  26126. var entry = entries[index];
  26127. this.set(entry[0], entry[1]);
  26128. }
  26129. }
  26130. /**
  26131. * Removes all key-value entries from the list cache.
  26132. *
  26133. * @private
  26134. * @name clear
  26135. * @memberOf ListCache
  26136. */
  26137. function listCacheClear() {
  26138. this.__data__ = [];
  26139. }
  26140. /**
  26141. * Removes `key` and its value from the list cache.
  26142. *
  26143. * @private
  26144. * @name delete
  26145. * @memberOf ListCache
  26146. * @param {string} key The key of the value to remove.
  26147. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26148. */
  26149. function listCacheDelete(key) {
  26150. var data = this.__data__,
  26151. index = assocIndexOf(data, key);
  26152. if (index < 0) {
  26153. return false;
  26154. }
  26155. var lastIndex = data.length - 1;
  26156. if (index == lastIndex) {
  26157. data.pop();
  26158. } else {
  26159. splice.call(data, index, 1);
  26160. }
  26161. return true;
  26162. }
  26163. /**
  26164. * Gets the list cache value for `key`.
  26165. *
  26166. * @private
  26167. * @name get
  26168. * @memberOf ListCache
  26169. * @param {string} key The key of the value to get.
  26170. * @returns {*} Returns the entry value.
  26171. */
  26172. function listCacheGet(key) {
  26173. var data = this.__data__,
  26174. index = assocIndexOf(data, key);
  26175. return index < 0 ? undefined : data[index][1];
  26176. }
  26177. /**
  26178. * Checks if a list cache value for `key` exists.
  26179. *
  26180. * @private
  26181. * @name has
  26182. * @memberOf ListCache
  26183. * @param {string} key The key of the entry to check.
  26184. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26185. */
  26186. function listCacheHas(key) {
  26187. return assocIndexOf(this.__data__, key) > -1;
  26188. }
  26189. /**
  26190. * Sets the list cache `key` to `value`.
  26191. *
  26192. * @private
  26193. * @name set
  26194. * @memberOf ListCache
  26195. * @param {string} key The key of the value to set.
  26196. * @param {*} value The value to set.
  26197. * @returns {Object} Returns the list cache instance.
  26198. */
  26199. function listCacheSet(key, value) {
  26200. var data = this.__data__,
  26201. index = assocIndexOf(data, key);
  26202. if (index < 0) {
  26203. data.push([key, value]);
  26204. } else {
  26205. data[index][1] = value;
  26206. }
  26207. return this;
  26208. }
  26209. // Add methods to `ListCache`.
  26210. ListCache.prototype.clear = listCacheClear;
  26211. ListCache.prototype['delete'] = listCacheDelete;
  26212. ListCache.prototype.get = listCacheGet;
  26213. ListCache.prototype.has = listCacheHas;
  26214. ListCache.prototype.set = listCacheSet;
  26215. /**
  26216. * Creates a map cache object to store key-value pairs.
  26217. *
  26218. * @private
  26219. * @constructor
  26220. * @param {Array} [entries] The key-value pairs to cache.
  26221. */
  26222. function MapCache(entries) {
  26223. var index = -1,
  26224. length = entries ? entries.length : 0;
  26225. this.clear();
  26226. while (++index < length) {
  26227. var entry = entries[index];
  26228. this.set(entry[0], entry[1]);
  26229. }
  26230. }
  26231. /**
  26232. * Removes all key-value entries from the map.
  26233. *
  26234. * @private
  26235. * @name clear
  26236. * @memberOf MapCache
  26237. */
  26238. function mapCacheClear() {
  26239. this.__data__ = {
  26240. 'hash': new Hash,
  26241. 'map': new (Map || ListCache),
  26242. 'string': new Hash
  26243. };
  26244. }
  26245. /**
  26246. * Removes `key` and its value from the map.
  26247. *
  26248. * @private
  26249. * @name delete
  26250. * @memberOf MapCache
  26251. * @param {string} key The key of the value to remove.
  26252. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26253. */
  26254. function mapCacheDelete(key) {
  26255. return getMapData(this, key)['delete'](key);
  26256. }
  26257. /**
  26258. * Gets the map value for `key`.
  26259. *
  26260. * @private
  26261. * @name get
  26262. * @memberOf MapCache
  26263. * @param {string} key The key of the value to get.
  26264. * @returns {*} Returns the entry value.
  26265. */
  26266. function mapCacheGet(key) {
  26267. return getMapData(this, key).get(key);
  26268. }
  26269. /**
  26270. * Checks if a map value for `key` exists.
  26271. *
  26272. * @private
  26273. * @name has
  26274. * @memberOf MapCache
  26275. * @param {string} key The key of the entry to check.
  26276. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26277. */
  26278. function mapCacheHas(key) {
  26279. return getMapData(this, key).has(key);
  26280. }
  26281. /**
  26282. * Sets the map `key` to `value`.
  26283. *
  26284. * @private
  26285. * @name set
  26286. * @memberOf MapCache
  26287. * @param {string} key The key of the value to set.
  26288. * @param {*} value The value to set.
  26289. * @returns {Object} Returns the map cache instance.
  26290. */
  26291. function mapCacheSet(key, value) {
  26292. getMapData(this, key).set(key, value);
  26293. return this;
  26294. }
  26295. // Add methods to `MapCache`.
  26296. MapCache.prototype.clear = mapCacheClear;
  26297. MapCache.prototype['delete'] = mapCacheDelete;
  26298. MapCache.prototype.get = mapCacheGet;
  26299. MapCache.prototype.has = mapCacheHas;
  26300. MapCache.prototype.set = mapCacheSet;
  26301. /**
  26302. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26303. *
  26304. * @private
  26305. * @param {Array} array The array to inspect.
  26306. * @param {*} key The key to search for.
  26307. * @returns {number} Returns the index of the matched value, else `-1`.
  26308. */
  26309. function assocIndexOf(array, key) {
  26310. var length = array.length;
  26311. while (length--) {
  26312. if (eq(array[length][0], key)) {
  26313. return length;
  26314. }
  26315. }
  26316. return -1;
  26317. }
  26318. /**
  26319. * The base implementation of `_.get` without support for default values.
  26320. *
  26321. * @private
  26322. * @param {Object} object The object to query.
  26323. * @param {Array|string} path The path of the property to get.
  26324. * @returns {*} Returns the resolved value.
  26325. */
  26326. function baseGet(object, path) {
  26327. path = isKey(path, object) ? [path] : castPath(path);
  26328. var index = 0,
  26329. length = path.length;
  26330. while (object != null && index < length) {
  26331. object = object[toKey(path[index++])];
  26332. }
  26333. return (index && index == length) ? object : undefined;
  26334. }
  26335. /**
  26336. * The base implementation of `_.isNative` without bad shim checks.
  26337. *
  26338. * @private
  26339. * @param {*} value The value to check.
  26340. * @returns {boolean} Returns `true` if `value` is a native function,
  26341. * else `false`.
  26342. */
  26343. function baseIsNative(value) {
  26344. if (!isObject(value) || isMasked(value)) {
  26345. return false;
  26346. }
  26347. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26348. return pattern.test(toSource(value));
  26349. }
  26350. /**
  26351. * The base implementation of `_.toString` which doesn't convert nullish
  26352. * values to empty strings.
  26353. *
  26354. * @private
  26355. * @param {*} value The value to process.
  26356. * @returns {string} Returns the string.
  26357. */
  26358. function baseToString(value) {
  26359. // Exit early for strings to avoid a performance hit in some environments.
  26360. if (typeof value == 'string') {
  26361. return value;
  26362. }
  26363. if (isSymbol(value)) {
  26364. return symbolToString ? symbolToString.call(value) : '';
  26365. }
  26366. var result = (value + '');
  26367. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26368. }
  26369. /**
  26370. * Casts `value` to a path array if it's not one.
  26371. *
  26372. * @private
  26373. * @param {*} value The value to inspect.
  26374. * @returns {Array} Returns the cast property path array.
  26375. */
  26376. function castPath(value) {
  26377. return isArray(value) ? value : stringToPath(value);
  26378. }
  26379. /**
  26380. * Gets the data for `map`.
  26381. *
  26382. * @private
  26383. * @param {Object} map The map to query.
  26384. * @param {string} key The reference key.
  26385. * @returns {*} Returns the map data.
  26386. */
  26387. function getMapData(map, key) {
  26388. var data = map.__data__;
  26389. return isKeyable(key)
  26390. ? data[typeof key == 'string' ? 'string' : 'hash']
  26391. : data.map;
  26392. }
  26393. /**
  26394. * Gets the native function at `key` of `object`.
  26395. *
  26396. * @private
  26397. * @param {Object} object The object to query.
  26398. * @param {string} key The key of the method to get.
  26399. * @returns {*} Returns the function if it's native, else `undefined`.
  26400. */
  26401. function getNative(object, key) {
  26402. var value = getValue(object, key);
  26403. return baseIsNative(value) ? value : undefined;
  26404. }
  26405. /**
  26406. * Checks if `value` is a property name and not a property path.
  26407. *
  26408. * @private
  26409. * @param {*} value The value to check.
  26410. * @param {Object} [object] The object to query keys on.
  26411. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26412. */
  26413. function isKey(value, object) {
  26414. if (isArray(value)) {
  26415. return false;
  26416. }
  26417. var type = typeof value;
  26418. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26419. value == null || isSymbol(value)) {
  26420. return true;
  26421. }
  26422. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26423. (object != null && value in Object(object));
  26424. }
  26425. /**
  26426. * Checks if `value` is suitable for use as unique object key.
  26427. *
  26428. * @private
  26429. * @param {*} value The value to check.
  26430. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26431. */
  26432. function isKeyable(value) {
  26433. var type = typeof value;
  26434. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26435. ? (value !== '__proto__')
  26436. : (value === null);
  26437. }
  26438. /**
  26439. * Checks if `func` has its source masked.
  26440. *
  26441. * @private
  26442. * @param {Function} func The function to check.
  26443. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26444. */
  26445. function isMasked(func) {
  26446. return !!maskSrcKey && (maskSrcKey in func);
  26447. }
  26448. /**
  26449. * Converts `string` to a property path array.
  26450. *
  26451. * @private
  26452. * @param {string} string The string to convert.
  26453. * @returns {Array} Returns the property path array.
  26454. */
  26455. var stringToPath = memoize(function(string) {
  26456. string = toString(string);
  26457. var result = [];
  26458. if (reLeadingDot.test(string)) {
  26459. result.push('');
  26460. }
  26461. string.replace(rePropName, function(match, number, quote, string) {
  26462. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26463. });
  26464. return result;
  26465. });
  26466. /**
  26467. * Converts `value` to a string key if it's not a string or symbol.
  26468. *
  26469. * @private
  26470. * @param {*} value The value to inspect.
  26471. * @returns {string|symbol} Returns the key.
  26472. */
  26473. function toKey(value) {
  26474. if (typeof value == 'string' || isSymbol(value)) {
  26475. return value;
  26476. }
  26477. var result = (value + '');
  26478. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26479. }
  26480. /**
  26481. * Converts `func` to its source code.
  26482. *
  26483. * @private
  26484. * @param {Function} func The function to process.
  26485. * @returns {string} Returns the source code.
  26486. */
  26487. function toSource(func) {
  26488. if (func != null) {
  26489. try {
  26490. return funcToString.call(func);
  26491. } catch (e) {}
  26492. try {
  26493. return (func + '');
  26494. } catch (e) {}
  26495. }
  26496. return '';
  26497. }
  26498. /**
  26499. * Creates a function that memoizes the result of `func`. If `resolver` is
  26500. * provided, it determines the cache key for storing the result based on the
  26501. * arguments provided to the memoized function. By default, the first argument
  26502. * provided to the memoized function is used as the map cache key. The `func`
  26503. * is invoked with the `this` binding of the memoized function.
  26504. *
  26505. * **Note:** The cache is exposed as the `cache` property on the memoized
  26506. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26507. * constructor with one whose instances implement the
  26508. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26509. * method interface of `delete`, `get`, `has`, and `set`.
  26510. *
  26511. * @static
  26512. * @memberOf _
  26513. * @since 0.1.0
  26514. * @category Function
  26515. * @param {Function} func The function to have its output memoized.
  26516. * @param {Function} [resolver] The function to resolve the cache key.
  26517. * @returns {Function} Returns the new memoized function.
  26518. * @example
  26519. *
  26520. * var object = { 'a': 1, 'b': 2 };
  26521. * var other = { 'c': 3, 'd': 4 };
  26522. *
  26523. * var values = _.memoize(_.values);
  26524. * values(object);
  26525. * // => [1, 2]
  26526. *
  26527. * values(other);
  26528. * // => [3, 4]
  26529. *
  26530. * object.a = 2;
  26531. * values(object);
  26532. * // => [1, 2]
  26533. *
  26534. * // Modify the result cache.
  26535. * values.cache.set(object, ['a', 'b']);
  26536. * values(object);
  26537. * // => ['a', 'b']
  26538. *
  26539. * // Replace `_.memoize.Cache`.
  26540. * _.memoize.Cache = WeakMap;
  26541. */
  26542. function memoize(func, resolver) {
  26543. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26544. throw new TypeError(FUNC_ERROR_TEXT);
  26545. }
  26546. var memoized = function() {
  26547. var args = arguments,
  26548. key = resolver ? resolver.apply(this, args) : args[0],
  26549. cache = memoized.cache;
  26550. if (cache.has(key)) {
  26551. return cache.get(key);
  26552. }
  26553. var result = func.apply(this, args);
  26554. memoized.cache = cache.set(key, result);
  26555. return result;
  26556. };
  26557. memoized.cache = new (memoize.Cache || MapCache);
  26558. return memoized;
  26559. }
  26560. // Assign cache to `_.memoize`.
  26561. memoize.Cache = MapCache;
  26562. /**
  26563. * Performs a
  26564. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26565. * comparison between two values to determine if they are equivalent.
  26566. *
  26567. * @static
  26568. * @memberOf _
  26569. * @since 4.0.0
  26570. * @category Lang
  26571. * @param {*} value The value to compare.
  26572. * @param {*} other The other value to compare.
  26573. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26574. * @example
  26575. *
  26576. * var object = { 'a': 1 };
  26577. * var other = { 'a': 1 };
  26578. *
  26579. * _.eq(object, object);
  26580. * // => true
  26581. *
  26582. * _.eq(object, other);
  26583. * // => false
  26584. *
  26585. * _.eq('a', 'a');
  26586. * // => true
  26587. *
  26588. * _.eq('a', Object('a'));
  26589. * // => false
  26590. *
  26591. * _.eq(NaN, NaN);
  26592. * // => true
  26593. */
  26594. function eq(value, other) {
  26595. return value === other || (value !== value && other !== other);
  26596. }
  26597. /**
  26598. * Checks if `value` is classified as an `Array` object.
  26599. *
  26600. * @static
  26601. * @memberOf _
  26602. * @since 0.1.0
  26603. * @category Lang
  26604. * @param {*} value The value to check.
  26605. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26606. * @example
  26607. *
  26608. * _.isArray([1, 2, 3]);
  26609. * // => true
  26610. *
  26611. * _.isArray(document.body.children);
  26612. * // => false
  26613. *
  26614. * _.isArray('abc');
  26615. * // => false
  26616. *
  26617. * _.isArray(_.noop);
  26618. * // => false
  26619. */
  26620. var isArray = Array.isArray;
  26621. /**
  26622. * Checks if `value` is classified as a `Function` object.
  26623. *
  26624. * @static
  26625. * @memberOf _
  26626. * @since 0.1.0
  26627. * @category Lang
  26628. * @param {*} value The value to check.
  26629. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26630. * @example
  26631. *
  26632. * _.isFunction(_);
  26633. * // => true
  26634. *
  26635. * _.isFunction(/abc/);
  26636. * // => false
  26637. */
  26638. function isFunction(value) {
  26639. // The use of `Object#toString` avoids issues with the `typeof` operator
  26640. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26641. var tag = isObject(value) ? objectToString.call(value) : '';
  26642. return tag == funcTag || tag == genTag;
  26643. }
  26644. /**
  26645. * Checks if `value` is the
  26646. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26647. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26648. *
  26649. * @static
  26650. * @memberOf _
  26651. * @since 0.1.0
  26652. * @category Lang
  26653. * @param {*} value The value to check.
  26654. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26655. * @example
  26656. *
  26657. * _.isObject({});
  26658. * // => true
  26659. *
  26660. * _.isObject([1, 2, 3]);
  26661. * // => true
  26662. *
  26663. * _.isObject(_.noop);
  26664. * // => true
  26665. *
  26666. * _.isObject(null);
  26667. * // => false
  26668. */
  26669. function isObject(value) {
  26670. var type = typeof value;
  26671. return !!value && (type == 'object' || type == 'function');
  26672. }
  26673. /**
  26674. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26675. * and has a `typeof` result of "object".
  26676. *
  26677. * @static
  26678. * @memberOf _
  26679. * @since 4.0.0
  26680. * @category Lang
  26681. * @param {*} value The value to check.
  26682. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26683. * @example
  26684. *
  26685. * _.isObjectLike({});
  26686. * // => true
  26687. *
  26688. * _.isObjectLike([1, 2, 3]);
  26689. * // => true
  26690. *
  26691. * _.isObjectLike(_.noop);
  26692. * // => false
  26693. *
  26694. * _.isObjectLike(null);
  26695. * // => false
  26696. */
  26697. function isObjectLike(value) {
  26698. return !!value && typeof value == 'object';
  26699. }
  26700. /**
  26701. * Checks if `value` is classified as a `Symbol` primitive or object.
  26702. *
  26703. * @static
  26704. * @memberOf _
  26705. * @since 4.0.0
  26706. * @category Lang
  26707. * @param {*} value The value to check.
  26708. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26709. * @example
  26710. *
  26711. * _.isSymbol(Symbol.iterator);
  26712. * // => true
  26713. *
  26714. * _.isSymbol('abc');
  26715. * // => false
  26716. */
  26717. function isSymbol(value) {
  26718. return typeof value == 'symbol' ||
  26719. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26720. }
  26721. /**
  26722. * Converts `value` to a string. An empty string is returned for `null`
  26723. * and `undefined` values. The sign of `-0` is preserved.
  26724. *
  26725. * @static
  26726. * @memberOf _
  26727. * @since 4.0.0
  26728. * @category Lang
  26729. * @param {*} value The value to process.
  26730. * @returns {string} Returns the string.
  26731. * @example
  26732. *
  26733. * _.toString(null);
  26734. * // => ''
  26735. *
  26736. * _.toString(-0);
  26737. * // => '-0'
  26738. *
  26739. * _.toString([1, 2, 3]);
  26740. * // => '1,2,3'
  26741. */
  26742. function toString(value) {
  26743. return value == null ? '' : baseToString(value);
  26744. }
  26745. /**
  26746. * Gets the value at `path` of `object`. If the resolved value is
  26747. * `undefined`, the `defaultValue` is returned in its place.
  26748. *
  26749. * @static
  26750. * @memberOf _
  26751. * @since 3.7.0
  26752. * @category Object
  26753. * @param {Object} object The object to query.
  26754. * @param {Array|string} path The path of the property to get.
  26755. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26756. * @returns {*} Returns the resolved value.
  26757. * @example
  26758. *
  26759. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26760. *
  26761. * _.get(object, 'a[0].b.c');
  26762. * // => 3
  26763. *
  26764. * _.get(object, ['a', '0', 'b', 'c']);
  26765. * // => 3
  26766. *
  26767. * _.get(object, 'a.b.c', 'default');
  26768. * // => 'default'
  26769. */
  26770. function get(object, path, defaultValue) {
  26771. var result = object == null ? undefined : baseGet(object, path);
  26772. return result === undefined ? defaultValue : result;
  26773. }
  26774. module.exports = get;
  26775. /***/ }),
  26776. /***/ 855:
  26777. /***/ (function(module, __unusedexports, __webpack_require__) {
  26778. module.exports = registerPlugin;
  26779. const factory = __webpack_require__(47);
  26780. function registerPlugin(plugins, pluginFunction) {
  26781. return factory(
  26782. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26783. );
  26784. }
  26785. /***/ }),
  26786. /***/ 856:
  26787. /***/ (function(module, __unusedexports, __webpack_require__) {
  26788. module.exports = __webpack_require__(141);
  26789. /***/ }),
  26790. /***/ 863:
  26791. /***/ (function(module, __unusedexports, __webpack_require__) {
  26792. module.exports = authenticationBeforeRequest;
  26793. const btoa = __webpack_require__(675);
  26794. const withAuthorizationPrefix = __webpack_require__(143);
  26795. function authenticationBeforeRequest(state, options) {
  26796. if (typeof state.auth === "string") {
  26797. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26798. return;
  26799. }
  26800. if (state.auth.username) {
  26801. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26802. options.headers.authorization = `Basic ${hash}`;
  26803. if (state.otp) {
  26804. options.headers["x-github-otp"] = state.otp;
  26805. }
  26806. return;
  26807. }
  26808. if (state.auth.clientId) {
  26809. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26810. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26811. // URL though: `/applications/:client_id/tokens/:access_token`.
  26812. //
  26813. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26814. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26815. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26816. //
  26817. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26818. // as well as "/applications/123/tokens/token456"
  26819. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26820. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26821. options.headers.authorization = `Basic ${hash}`;
  26822. return;
  26823. }
  26824. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26825. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26826. return;
  26827. }
  26828. return Promise.resolve()
  26829. .then(() => {
  26830. return state.auth();
  26831. })
  26832. .then(authorization => {
  26833. options.headers.authorization = withAuthorizationPrefix(authorization);
  26834. });
  26835. }
  26836. /***/ }),
  26837. /***/ 866:
  26838. /***/ (function(module, __unusedexports, __webpack_require__) {
  26839. "use strict";
  26840. var shebangRegex = __webpack_require__(816);
  26841. module.exports = function (str) {
  26842. var match = str.match(shebangRegex);
  26843. if (!match) {
  26844. return null;
  26845. }
  26846. var arr = match[0].replace(/#! ?/, '').split(' ');
  26847. var bin = arr[0].split('/').pop();
  26848. var arg = arr[1];
  26849. return (bin === 'env' ?
  26850. arg :
  26851. bin + (arg ? ' ' + arg : '')
  26852. );
  26853. };
  26854. /***/ }),
  26855. /***/ 874:
  26856. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26857. "use strict";
  26858. // Copyright (c) Microsoft. All rights reserved.
  26859. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26861. return new (P || (P = Promise))(function (resolve, reject) {
  26862. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26863. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26864. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26865. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26866. });
  26867. };
  26868. Object.defineProperty(exports, "__esModule", { value: true });
  26869. const url = __webpack_require__(835);
  26870. const http = __webpack_require__(605);
  26871. const https = __webpack_require__(34);
  26872. let fs;
  26873. let tunnel;
  26874. var HttpCodes;
  26875. (function (HttpCodes) {
  26876. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26877. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26878. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26879. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26880. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26881. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26882. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26883. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26884. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26885. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26886. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26887. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26888. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26889. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26890. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26891. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26892. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26893. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26894. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26895. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26896. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26897. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26898. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26899. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26900. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26901. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26902. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26903. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26904. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26905. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26906. const ExponentialBackoffCeiling = 10;
  26907. const ExponentialBackoffTimeSlice = 5;
  26908. class HttpClientResponse {
  26909. constructor(message) {
  26910. this.message = message;
  26911. }
  26912. readBody() {
  26913. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26914. let output = '';
  26915. this.message.on('data', (chunk) => {
  26916. output += chunk;
  26917. });
  26918. this.message.on('end', () => {
  26919. resolve(output);
  26920. });
  26921. }));
  26922. }
  26923. }
  26924. exports.HttpClientResponse = HttpClientResponse;
  26925. function isHttps(requestUrl) {
  26926. let parsedUrl = url.parse(requestUrl);
  26927. return parsedUrl.protocol === 'https:';
  26928. }
  26929. exports.isHttps = isHttps;
  26930. var EnvironmentVariables;
  26931. (function (EnvironmentVariables) {
  26932. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26933. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26934. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26935. class HttpClient {
  26936. constructor(userAgent, handlers, requestOptions) {
  26937. this._ignoreSslError = false;
  26938. this._allowRedirects = true;
  26939. this._maxRedirects = 50;
  26940. this._allowRetries = false;
  26941. this._maxRetries = 1;
  26942. this._keepAlive = false;
  26943. this._disposed = false;
  26944. this.userAgent = userAgent;
  26945. this.handlers = handlers || [];
  26946. this.requestOptions = requestOptions;
  26947. if (requestOptions) {
  26948. if (requestOptions.ignoreSslError != null) {
  26949. this._ignoreSslError = requestOptions.ignoreSslError;
  26950. }
  26951. this._socketTimeout = requestOptions.socketTimeout;
  26952. this._httpProxy = requestOptions.proxy;
  26953. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26954. this._httpProxyBypassHosts = [];
  26955. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26956. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26957. });
  26958. }
  26959. this._certConfig = requestOptions.cert;
  26960. if (this._certConfig) {
  26961. // If using cert, need fs
  26962. fs = __webpack_require__(747);
  26963. // cache the cert content into memory, so we don't have to read it from disk every time
  26964. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26965. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26966. }
  26967. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26968. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26969. }
  26970. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26971. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26972. }
  26973. }
  26974. if (requestOptions.allowRedirects != null) {
  26975. this._allowRedirects = requestOptions.allowRedirects;
  26976. }
  26977. if (requestOptions.maxRedirects != null) {
  26978. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26979. }
  26980. if (requestOptions.keepAlive != null) {
  26981. this._keepAlive = requestOptions.keepAlive;
  26982. }
  26983. if (requestOptions.allowRetries != null) {
  26984. this._allowRetries = requestOptions.allowRetries;
  26985. }
  26986. if (requestOptions.maxRetries != null) {
  26987. this._maxRetries = requestOptions.maxRetries;
  26988. }
  26989. }
  26990. }
  26991. options(requestUrl, additionalHeaders) {
  26992. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26993. }
  26994. get(requestUrl, additionalHeaders) {
  26995. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26996. }
  26997. del(requestUrl, additionalHeaders) {
  26998. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26999. }
  27000. post(requestUrl, data, additionalHeaders) {
  27001. return this.request('POST', requestUrl, data, additionalHeaders || {});
  27002. }
  27003. patch(requestUrl, data, additionalHeaders) {
  27004. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  27005. }
  27006. put(requestUrl, data, additionalHeaders) {
  27007. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  27008. }
  27009. head(requestUrl, additionalHeaders) {
  27010. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  27011. }
  27012. sendStream(verb, requestUrl, stream, additionalHeaders) {
  27013. return this.request(verb, requestUrl, stream, additionalHeaders);
  27014. }
  27015. /**
  27016. * Makes a raw http request.
  27017. * All other methods such as get, post, patch, and request ultimately call this.
  27018. * Prefer get, del, post and patch
  27019. */
  27020. request(verb, requestUrl, data, headers) {
  27021. return __awaiter(this, void 0, void 0, function* () {
  27022. if (this._disposed) {
  27023. throw new Error("Client has already been disposed.");
  27024. }
  27025. let info = this._prepareRequest(verb, requestUrl, headers);
  27026. // Only perform retries on reads since writes may not be idempotent.
  27027. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  27028. let numTries = 0;
  27029. let response;
  27030. while (numTries < maxTries) {
  27031. response = yield this.requestRaw(info, data);
  27032. // Check if it's an authentication challenge
  27033. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  27034. let authenticationHandler;
  27035. for (let i = 0; i < this.handlers.length; i++) {
  27036. if (this.handlers[i].canHandleAuthentication(response)) {
  27037. authenticationHandler = this.handlers[i];
  27038. break;
  27039. }
  27040. }
  27041. if (authenticationHandler) {
  27042. return authenticationHandler.handleAuthentication(this, info, data);
  27043. }
  27044. else {
  27045. // We have received an unauthorized response but have no handlers to handle it.
  27046. // Let the response return to the caller.
  27047. return response;
  27048. }
  27049. }
  27050. let redirectsRemaining = this._maxRedirects;
  27051. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  27052. && this._allowRedirects
  27053. && redirectsRemaining > 0) {
  27054. const redirectUrl = response.message.headers["location"];
  27055. if (!redirectUrl) {
  27056. // if there's no location to redirect to, we won't
  27057. break;
  27058. }
  27059. // we need to finish reading the response before reassigning response
  27060. // which will leak the open socket.
  27061. yield response.readBody();
  27062. // let's make the request with the new redirectUrl
  27063. info = this._prepareRequest(verb, redirectUrl, headers);
  27064. response = yield this.requestRaw(info, data);
  27065. redirectsRemaining--;
  27066. }
  27067. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27068. // If not a retry code, return immediately instead of retrying
  27069. return response;
  27070. }
  27071. numTries += 1;
  27072. if (numTries < maxTries) {
  27073. yield response.readBody();
  27074. yield this._performExponentialBackoff(numTries);
  27075. }
  27076. }
  27077. return response;
  27078. });
  27079. }
  27080. /**
  27081. * Needs to be called if keepAlive is set to true in request options.
  27082. */
  27083. dispose() {
  27084. if (this._agent) {
  27085. this._agent.destroy();
  27086. }
  27087. this._disposed = true;
  27088. }
  27089. /**
  27090. * Raw request.
  27091. * @param info
  27092. * @param data
  27093. */
  27094. requestRaw(info, data) {
  27095. return new Promise((resolve, reject) => {
  27096. let callbackForResult = function (err, res) {
  27097. if (err) {
  27098. reject(err);
  27099. }
  27100. resolve(res);
  27101. };
  27102. this.requestRawWithCallback(info, data, callbackForResult);
  27103. });
  27104. }
  27105. /**
  27106. * Raw request with callback.
  27107. * @param info
  27108. * @param data
  27109. * @param onResult
  27110. */
  27111. requestRawWithCallback(info, data, onResult) {
  27112. let socket;
  27113. let isDataString = typeof (data) === 'string';
  27114. if (typeof (data) === 'string') {
  27115. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27116. }
  27117. let callbackCalled = false;
  27118. let handleResult = (err, res) => {
  27119. if (!callbackCalled) {
  27120. callbackCalled = true;
  27121. onResult(err, res);
  27122. }
  27123. };
  27124. let req = info.httpModule.request(info.options, (msg) => {
  27125. let res = new HttpClientResponse(msg);
  27126. handleResult(null, res);
  27127. });
  27128. req.on('socket', (sock) => {
  27129. socket = sock;
  27130. });
  27131. // If we ever get disconnected, we want the socket to timeout eventually
  27132. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27133. if (socket) {
  27134. socket.end();
  27135. }
  27136. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27137. });
  27138. req.on('error', function (err) {
  27139. // err has statusCode property
  27140. // res should have headers
  27141. handleResult(err, null);
  27142. });
  27143. if (data && typeof (data) === 'string') {
  27144. req.write(data, 'utf8');
  27145. }
  27146. if (data && typeof (data) !== 'string') {
  27147. data.on('close', function () {
  27148. req.end();
  27149. });
  27150. data.pipe(req);
  27151. }
  27152. else {
  27153. req.end();
  27154. }
  27155. }
  27156. _prepareRequest(method, requestUrl, headers) {
  27157. const info = {};
  27158. info.parsedUrl = url.parse(requestUrl);
  27159. const usingSsl = info.parsedUrl.protocol === 'https:';
  27160. info.httpModule = usingSsl ? https : http;
  27161. const defaultPort = usingSsl ? 443 : 80;
  27162. info.options = {};
  27163. info.options.host = info.parsedUrl.hostname;
  27164. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27165. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27166. info.options.method = method;
  27167. info.options.headers = this._mergeHeaders(headers);
  27168. info.options.headers["user-agent"] = this.userAgent;
  27169. info.options.agent = this._getAgent(requestUrl);
  27170. // gives handlers an opportunity to participate
  27171. if (this.handlers && !this._isPresigned(requestUrl)) {
  27172. this.handlers.forEach((handler) => {
  27173. handler.prepareRequest(info.options);
  27174. });
  27175. }
  27176. return info;
  27177. }
  27178. _isPresigned(requestUrl) {
  27179. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27180. const patterns = this.requestOptions.presignedUrlPatterns;
  27181. for (let i = 0; i < patterns.length; i++) {
  27182. if (requestUrl.match(patterns[i])) {
  27183. return true;
  27184. }
  27185. }
  27186. }
  27187. return false;
  27188. }
  27189. _mergeHeaders(headers) {
  27190. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27191. if (this.requestOptions && this.requestOptions.headers) {
  27192. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27193. }
  27194. return lowercaseKeys(headers || {});
  27195. }
  27196. _getAgent(requestUrl) {
  27197. let agent;
  27198. let proxy = this._getProxy(requestUrl);
  27199. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27200. if (this._keepAlive && useProxy) {
  27201. agent = this._proxyAgent;
  27202. }
  27203. if (this._keepAlive && !useProxy) {
  27204. agent = this._agent;
  27205. }
  27206. // if agent is already assigned use that agent.
  27207. if (!!agent) {
  27208. return agent;
  27209. }
  27210. let parsedUrl = url.parse(requestUrl);
  27211. const usingSsl = parsedUrl.protocol === 'https:';
  27212. let maxSockets = 100;
  27213. if (!!this.requestOptions) {
  27214. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27215. }
  27216. if (useProxy) {
  27217. // If using proxy, need tunnel
  27218. if (!tunnel) {
  27219. tunnel = __webpack_require__(856);
  27220. }
  27221. const agentOptions = {
  27222. maxSockets: maxSockets,
  27223. keepAlive: this._keepAlive,
  27224. proxy: {
  27225. proxyAuth: proxy.proxyAuth,
  27226. host: proxy.proxyUrl.hostname,
  27227. port: proxy.proxyUrl.port
  27228. },
  27229. };
  27230. let tunnelAgent;
  27231. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27232. if (usingSsl) {
  27233. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27234. }
  27235. else {
  27236. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27237. }
  27238. agent = tunnelAgent(agentOptions);
  27239. this._proxyAgent = agent;
  27240. }
  27241. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27242. if (this._keepAlive && !agent) {
  27243. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27244. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27245. this._agent = agent;
  27246. }
  27247. // if not using private agent and tunnel agent isn't setup then use global agent
  27248. if (!agent) {
  27249. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27250. }
  27251. if (usingSsl && this._ignoreSslError) {
  27252. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27253. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27254. // we have to cast it to any and change it directly
  27255. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27256. }
  27257. if (usingSsl && this._certConfig) {
  27258. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27259. }
  27260. return agent;
  27261. }
  27262. _getProxy(requestUrl) {
  27263. const parsedUrl = url.parse(requestUrl);
  27264. let usingSsl = parsedUrl.protocol === 'https:';
  27265. let proxyConfig = this._httpProxy;
  27266. // fallback to http_proxy and https_proxy env
  27267. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27268. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27269. if (!proxyConfig) {
  27270. if (https_proxy && usingSsl) {
  27271. proxyConfig = {
  27272. proxyUrl: https_proxy
  27273. };
  27274. }
  27275. else if (http_proxy) {
  27276. proxyConfig = {
  27277. proxyUrl: http_proxy
  27278. };
  27279. }
  27280. }
  27281. let proxyUrl;
  27282. let proxyAuth;
  27283. if (proxyConfig) {
  27284. if (proxyConfig.proxyUrl.length > 0) {
  27285. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27286. }
  27287. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27288. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27289. }
  27290. }
  27291. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27292. }
  27293. _isBypassProxy(requestUrl) {
  27294. if (!this._httpProxyBypassHosts) {
  27295. return false;
  27296. }
  27297. let bypass = false;
  27298. this._httpProxyBypassHosts.forEach(bypassHost => {
  27299. if (bypassHost.test(requestUrl)) {
  27300. bypass = true;
  27301. }
  27302. });
  27303. return bypass;
  27304. }
  27305. _performExponentialBackoff(retryNumber) {
  27306. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27307. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27308. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27309. }
  27310. }
  27311. exports.HttpClient = HttpClient;
  27312. /***/ }),
  27313. /***/ 881:
  27314. /***/ (function(module) {
  27315. "use strict";
  27316. const isWin = process.platform === 'win32';
  27317. function notFoundError(original, syscall) {
  27318. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27319. code: 'ENOENT',
  27320. errno: 'ENOENT',
  27321. syscall: `${syscall} ${original.command}`,
  27322. path: original.command,
  27323. spawnargs: original.args,
  27324. });
  27325. }
  27326. function hookChildProcess(cp, parsed) {
  27327. if (!isWin) {
  27328. return;
  27329. }
  27330. const originalEmit = cp.emit;
  27331. cp.emit = function (name, arg1) {
  27332. // If emitting "exit" event and exit code is 1, we need to check if
  27333. // the command exists and emit an "error" instead
  27334. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27335. if (name === 'exit') {
  27336. const err = verifyENOENT(arg1, parsed, 'spawn');
  27337. if (err) {
  27338. return originalEmit.call(cp, 'error', err);
  27339. }
  27340. }
  27341. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27342. };
  27343. }
  27344. function verifyENOENT(status, parsed) {
  27345. if (isWin && status === 1 && !parsed.file) {
  27346. return notFoundError(parsed.original, 'spawn');
  27347. }
  27348. return null;
  27349. }
  27350. function verifyENOENTSync(status, parsed) {
  27351. if (isWin && status === 1 && !parsed.file) {
  27352. return notFoundError(parsed.original, 'spawnSync');
  27353. }
  27354. return null;
  27355. }
  27356. module.exports = {
  27357. hookChildProcess,
  27358. verifyENOENT,
  27359. verifyENOENTSync,
  27360. notFoundError,
  27361. };
  27362. /***/ }),
  27363. /***/ 883:
  27364. /***/ (function(module) {
  27365. /**
  27366. * lodash (Custom Build) <https://lodash.com/>
  27367. * Build: `lodash modularize exports="npm" -o ./`
  27368. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27369. * Released under MIT license <https://lodash.com/license>
  27370. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27371. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27372. */
  27373. /** Used as the `TypeError` message for "Functions" methods. */
  27374. var FUNC_ERROR_TEXT = 'Expected a function';
  27375. /** Used to stand-in for `undefined` hash values. */
  27376. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27377. /** Used as references for various `Number` constants. */
  27378. var INFINITY = 1 / 0,
  27379. MAX_SAFE_INTEGER = 9007199254740991;
  27380. /** `Object#toString` result references. */
  27381. var funcTag = '[object Function]',
  27382. genTag = '[object GeneratorFunction]',
  27383. symbolTag = '[object Symbol]';
  27384. /** Used to match property names within property paths. */
  27385. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27386. reIsPlainProp = /^\w*$/,
  27387. reLeadingDot = /^\./,
  27388. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27389. /**
  27390. * Used to match `RegExp`
  27391. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27392. */
  27393. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27394. /** Used to match backslashes in property paths. */
  27395. var reEscapeChar = /\\(\\)?/g;
  27396. /** Used to detect host constructors (Safari). */
  27397. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27398. /** Used to detect unsigned integer values. */
  27399. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27400. /** Detect free variable `global` from Node.js. */
  27401. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27402. /** Detect free variable `self`. */
  27403. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27404. /** Used as a reference to the global object. */
  27405. var root = freeGlobal || freeSelf || Function('return this')();
  27406. /**
  27407. * Gets the value at `key` of `object`.
  27408. *
  27409. * @private
  27410. * @param {Object} [object] The object to query.
  27411. * @param {string} key The key of the property to get.
  27412. * @returns {*} Returns the property value.
  27413. */
  27414. function getValue(object, key) {
  27415. return object == null ? undefined : object[key];
  27416. }
  27417. /**
  27418. * Checks if `value` is a host object in IE < 9.
  27419. *
  27420. * @private
  27421. * @param {*} value The value to check.
  27422. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27423. */
  27424. function isHostObject(value) {
  27425. // Many host objects are `Object` objects that can coerce to strings
  27426. // despite having improperly defined `toString` methods.
  27427. var result = false;
  27428. if (value != null && typeof value.toString != 'function') {
  27429. try {
  27430. result = !!(value + '');
  27431. } catch (e) {}
  27432. }
  27433. return result;
  27434. }
  27435. /** Used for built-in method references. */
  27436. var arrayProto = Array.prototype,
  27437. funcProto = Function.prototype,
  27438. objectProto = Object.prototype;
  27439. /** Used to detect overreaching core-js shims. */
  27440. var coreJsData = root['__core-js_shared__'];
  27441. /** Used to detect methods masquerading as native. */
  27442. var maskSrcKey = (function() {
  27443. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27444. return uid ? ('Symbol(src)_1.' + uid) : '';
  27445. }());
  27446. /** Used to resolve the decompiled source of functions. */
  27447. var funcToString = funcProto.toString;
  27448. /** Used to check objects for own properties. */
  27449. var hasOwnProperty = objectProto.hasOwnProperty;
  27450. /**
  27451. * Used to resolve the
  27452. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27453. * of values.
  27454. */
  27455. var objectToString = objectProto.toString;
  27456. /** Used to detect if a method is native. */
  27457. var reIsNative = RegExp('^' +
  27458. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27459. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27460. );
  27461. /** Built-in value references. */
  27462. var Symbol = root.Symbol,
  27463. splice = arrayProto.splice;
  27464. /* Built-in method references that are verified to be native. */
  27465. var Map = getNative(root, 'Map'),
  27466. nativeCreate = getNative(Object, 'create');
  27467. /** Used to convert symbols to primitives and strings. */
  27468. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27469. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27470. /**
  27471. * Creates a hash object.
  27472. *
  27473. * @private
  27474. * @constructor
  27475. * @param {Array} [entries] The key-value pairs to cache.
  27476. */
  27477. function Hash(entries) {
  27478. var index = -1,
  27479. length = entries ? entries.length : 0;
  27480. this.clear();
  27481. while (++index < length) {
  27482. var entry = entries[index];
  27483. this.set(entry[0], entry[1]);
  27484. }
  27485. }
  27486. /**
  27487. * Removes all key-value entries from the hash.
  27488. *
  27489. * @private
  27490. * @name clear
  27491. * @memberOf Hash
  27492. */
  27493. function hashClear() {
  27494. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27495. }
  27496. /**
  27497. * Removes `key` and its value from the hash.
  27498. *
  27499. * @private
  27500. * @name delete
  27501. * @memberOf Hash
  27502. * @param {Object} hash The hash to modify.
  27503. * @param {string} key The key of the value to remove.
  27504. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27505. */
  27506. function hashDelete(key) {
  27507. return this.has(key) && delete this.__data__[key];
  27508. }
  27509. /**
  27510. * Gets the hash value for `key`.
  27511. *
  27512. * @private
  27513. * @name get
  27514. * @memberOf Hash
  27515. * @param {string} key The key of the value to get.
  27516. * @returns {*} Returns the entry value.
  27517. */
  27518. function hashGet(key) {
  27519. var data = this.__data__;
  27520. if (nativeCreate) {
  27521. var result = data[key];
  27522. return result === HASH_UNDEFINED ? undefined : result;
  27523. }
  27524. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27525. }
  27526. /**
  27527. * Checks if a hash value for `key` exists.
  27528. *
  27529. * @private
  27530. * @name has
  27531. * @memberOf Hash
  27532. * @param {string} key The key of the entry to check.
  27533. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27534. */
  27535. function hashHas(key) {
  27536. var data = this.__data__;
  27537. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27538. }
  27539. /**
  27540. * Sets the hash `key` to `value`.
  27541. *
  27542. * @private
  27543. * @name set
  27544. * @memberOf Hash
  27545. * @param {string} key The key of the value to set.
  27546. * @param {*} value The value to set.
  27547. * @returns {Object} Returns the hash instance.
  27548. */
  27549. function hashSet(key, value) {
  27550. var data = this.__data__;
  27551. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27552. return this;
  27553. }
  27554. // Add methods to `Hash`.
  27555. Hash.prototype.clear = hashClear;
  27556. Hash.prototype['delete'] = hashDelete;
  27557. Hash.prototype.get = hashGet;
  27558. Hash.prototype.has = hashHas;
  27559. Hash.prototype.set = hashSet;
  27560. /**
  27561. * Creates an list cache object.
  27562. *
  27563. * @private
  27564. * @constructor
  27565. * @param {Array} [entries] The key-value pairs to cache.
  27566. */
  27567. function ListCache(entries) {
  27568. var index = -1,
  27569. length = entries ? entries.length : 0;
  27570. this.clear();
  27571. while (++index < length) {
  27572. var entry = entries[index];
  27573. this.set(entry[0], entry[1]);
  27574. }
  27575. }
  27576. /**
  27577. * Removes all key-value entries from the list cache.
  27578. *
  27579. * @private
  27580. * @name clear
  27581. * @memberOf ListCache
  27582. */
  27583. function listCacheClear() {
  27584. this.__data__ = [];
  27585. }
  27586. /**
  27587. * Removes `key` and its value from the list cache.
  27588. *
  27589. * @private
  27590. * @name delete
  27591. * @memberOf ListCache
  27592. * @param {string} key The key of the value to remove.
  27593. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27594. */
  27595. function listCacheDelete(key) {
  27596. var data = this.__data__,
  27597. index = assocIndexOf(data, key);
  27598. if (index < 0) {
  27599. return false;
  27600. }
  27601. var lastIndex = data.length - 1;
  27602. if (index == lastIndex) {
  27603. data.pop();
  27604. } else {
  27605. splice.call(data, index, 1);
  27606. }
  27607. return true;
  27608. }
  27609. /**
  27610. * Gets the list cache value for `key`.
  27611. *
  27612. * @private
  27613. * @name get
  27614. * @memberOf ListCache
  27615. * @param {string} key The key of the value to get.
  27616. * @returns {*} Returns the entry value.
  27617. */
  27618. function listCacheGet(key) {
  27619. var data = this.__data__,
  27620. index = assocIndexOf(data, key);
  27621. return index < 0 ? undefined : data[index][1];
  27622. }
  27623. /**
  27624. * Checks if a list cache value for `key` exists.
  27625. *
  27626. * @private
  27627. * @name has
  27628. * @memberOf ListCache
  27629. * @param {string} key The key of the entry to check.
  27630. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27631. */
  27632. function listCacheHas(key) {
  27633. return assocIndexOf(this.__data__, key) > -1;
  27634. }
  27635. /**
  27636. * Sets the list cache `key` to `value`.
  27637. *
  27638. * @private
  27639. * @name set
  27640. * @memberOf ListCache
  27641. * @param {string} key The key of the value to set.
  27642. * @param {*} value The value to set.
  27643. * @returns {Object} Returns the list cache instance.
  27644. */
  27645. function listCacheSet(key, value) {
  27646. var data = this.__data__,
  27647. index = assocIndexOf(data, key);
  27648. if (index < 0) {
  27649. data.push([key, value]);
  27650. } else {
  27651. data[index][1] = value;
  27652. }
  27653. return this;
  27654. }
  27655. // Add methods to `ListCache`.
  27656. ListCache.prototype.clear = listCacheClear;
  27657. ListCache.prototype['delete'] = listCacheDelete;
  27658. ListCache.prototype.get = listCacheGet;
  27659. ListCache.prototype.has = listCacheHas;
  27660. ListCache.prototype.set = listCacheSet;
  27661. /**
  27662. * Creates a map cache object to store key-value pairs.
  27663. *
  27664. * @private
  27665. * @constructor
  27666. * @param {Array} [entries] The key-value pairs to cache.
  27667. */
  27668. function MapCache(entries) {
  27669. var index = -1,
  27670. length = entries ? entries.length : 0;
  27671. this.clear();
  27672. while (++index < length) {
  27673. var entry = entries[index];
  27674. this.set(entry[0], entry[1]);
  27675. }
  27676. }
  27677. /**
  27678. * Removes all key-value entries from the map.
  27679. *
  27680. * @private
  27681. * @name clear
  27682. * @memberOf MapCache
  27683. */
  27684. function mapCacheClear() {
  27685. this.__data__ = {
  27686. 'hash': new Hash,
  27687. 'map': new (Map || ListCache),
  27688. 'string': new Hash
  27689. };
  27690. }
  27691. /**
  27692. * Removes `key` and its value from the map.
  27693. *
  27694. * @private
  27695. * @name delete
  27696. * @memberOf MapCache
  27697. * @param {string} key The key of the value to remove.
  27698. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27699. */
  27700. function mapCacheDelete(key) {
  27701. return getMapData(this, key)['delete'](key);
  27702. }
  27703. /**
  27704. * Gets the map value for `key`.
  27705. *
  27706. * @private
  27707. * @name get
  27708. * @memberOf MapCache
  27709. * @param {string} key The key of the value to get.
  27710. * @returns {*} Returns the entry value.
  27711. */
  27712. function mapCacheGet(key) {
  27713. return getMapData(this, key).get(key);
  27714. }
  27715. /**
  27716. * Checks if a map value for `key` exists.
  27717. *
  27718. * @private
  27719. * @name has
  27720. * @memberOf MapCache
  27721. * @param {string} key The key of the entry to check.
  27722. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27723. */
  27724. function mapCacheHas(key) {
  27725. return getMapData(this, key).has(key);
  27726. }
  27727. /**
  27728. * Sets the map `key` to `value`.
  27729. *
  27730. * @private
  27731. * @name set
  27732. * @memberOf MapCache
  27733. * @param {string} key The key of the value to set.
  27734. * @param {*} value The value to set.
  27735. * @returns {Object} Returns the map cache instance.
  27736. */
  27737. function mapCacheSet(key, value) {
  27738. getMapData(this, key).set(key, value);
  27739. return this;
  27740. }
  27741. // Add methods to `MapCache`.
  27742. MapCache.prototype.clear = mapCacheClear;
  27743. MapCache.prototype['delete'] = mapCacheDelete;
  27744. MapCache.prototype.get = mapCacheGet;
  27745. MapCache.prototype.has = mapCacheHas;
  27746. MapCache.prototype.set = mapCacheSet;
  27747. /**
  27748. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27749. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27750. * for equality comparisons.
  27751. *
  27752. * @private
  27753. * @param {Object} object The object to modify.
  27754. * @param {string} key The key of the property to assign.
  27755. * @param {*} value The value to assign.
  27756. */
  27757. function assignValue(object, key, value) {
  27758. var objValue = object[key];
  27759. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27760. (value === undefined && !(key in object))) {
  27761. object[key] = value;
  27762. }
  27763. }
  27764. /**
  27765. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27766. *
  27767. * @private
  27768. * @param {Array} array The array to inspect.
  27769. * @param {*} key The key to search for.
  27770. * @returns {number} Returns the index of the matched value, else `-1`.
  27771. */
  27772. function assocIndexOf(array, key) {
  27773. var length = array.length;
  27774. while (length--) {
  27775. if (eq(array[length][0], key)) {
  27776. return length;
  27777. }
  27778. }
  27779. return -1;
  27780. }
  27781. /**
  27782. * The base implementation of `_.isNative` without bad shim checks.
  27783. *
  27784. * @private
  27785. * @param {*} value The value to check.
  27786. * @returns {boolean} Returns `true` if `value` is a native function,
  27787. * else `false`.
  27788. */
  27789. function baseIsNative(value) {
  27790. if (!isObject(value) || isMasked(value)) {
  27791. return false;
  27792. }
  27793. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27794. return pattern.test(toSource(value));
  27795. }
  27796. /**
  27797. * The base implementation of `_.set`.
  27798. *
  27799. * @private
  27800. * @param {Object} object The object to modify.
  27801. * @param {Array|string} path The path of the property to set.
  27802. * @param {*} value The value to set.
  27803. * @param {Function} [customizer] The function to customize path creation.
  27804. * @returns {Object} Returns `object`.
  27805. */
  27806. function baseSet(object, path, value, customizer) {
  27807. if (!isObject(object)) {
  27808. return object;
  27809. }
  27810. path = isKey(path, object) ? [path] : castPath(path);
  27811. var index = -1,
  27812. length = path.length,
  27813. lastIndex = length - 1,
  27814. nested = object;
  27815. while (nested != null && ++index < length) {
  27816. var key = toKey(path[index]),
  27817. newValue = value;
  27818. if (index != lastIndex) {
  27819. var objValue = nested[key];
  27820. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27821. if (newValue === undefined) {
  27822. newValue = isObject(objValue)
  27823. ? objValue
  27824. : (isIndex(path[index + 1]) ? [] : {});
  27825. }
  27826. }
  27827. assignValue(nested, key, newValue);
  27828. nested = nested[key];
  27829. }
  27830. return object;
  27831. }
  27832. /**
  27833. * The base implementation of `_.toString` which doesn't convert nullish
  27834. * values to empty strings.
  27835. *
  27836. * @private
  27837. * @param {*} value The value to process.
  27838. * @returns {string} Returns the string.
  27839. */
  27840. function baseToString(value) {
  27841. // Exit early for strings to avoid a performance hit in some environments.
  27842. if (typeof value == 'string') {
  27843. return value;
  27844. }
  27845. if (isSymbol(value)) {
  27846. return symbolToString ? symbolToString.call(value) : '';
  27847. }
  27848. var result = (value + '');
  27849. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27850. }
  27851. /**
  27852. * Casts `value` to a path array if it's not one.
  27853. *
  27854. * @private
  27855. * @param {*} value The value to inspect.
  27856. * @returns {Array} Returns the cast property path array.
  27857. */
  27858. function castPath(value) {
  27859. return isArray(value) ? value : stringToPath(value);
  27860. }
  27861. /**
  27862. * Gets the data for `map`.
  27863. *
  27864. * @private
  27865. * @param {Object} map The map to query.
  27866. * @param {string} key The reference key.
  27867. * @returns {*} Returns the map data.
  27868. */
  27869. function getMapData(map, key) {
  27870. var data = map.__data__;
  27871. return isKeyable(key)
  27872. ? data[typeof key == 'string' ? 'string' : 'hash']
  27873. : data.map;
  27874. }
  27875. /**
  27876. * Gets the native function at `key` of `object`.
  27877. *
  27878. * @private
  27879. * @param {Object} object The object to query.
  27880. * @param {string} key The key of the method to get.
  27881. * @returns {*} Returns the function if it's native, else `undefined`.
  27882. */
  27883. function getNative(object, key) {
  27884. var value = getValue(object, key);
  27885. return baseIsNative(value) ? value : undefined;
  27886. }
  27887. /**
  27888. * Checks if `value` is a valid array-like index.
  27889. *
  27890. * @private
  27891. * @param {*} value The value to check.
  27892. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27893. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27894. */
  27895. function isIndex(value, length) {
  27896. length = length == null ? MAX_SAFE_INTEGER : length;
  27897. return !!length &&
  27898. (typeof value == 'number' || reIsUint.test(value)) &&
  27899. (value > -1 && value % 1 == 0 && value < length);
  27900. }
  27901. /**
  27902. * Checks if `value` is a property name and not a property path.
  27903. *
  27904. * @private
  27905. * @param {*} value The value to check.
  27906. * @param {Object} [object] The object to query keys on.
  27907. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27908. */
  27909. function isKey(value, object) {
  27910. if (isArray(value)) {
  27911. return false;
  27912. }
  27913. var type = typeof value;
  27914. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27915. value == null || isSymbol(value)) {
  27916. return true;
  27917. }
  27918. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27919. (object != null && value in Object(object));
  27920. }
  27921. /**
  27922. * Checks if `value` is suitable for use as unique object key.
  27923. *
  27924. * @private
  27925. * @param {*} value The value to check.
  27926. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27927. */
  27928. function isKeyable(value) {
  27929. var type = typeof value;
  27930. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27931. ? (value !== '__proto__')
  27932. : (value === null);
  27933. }
  27934. /**
  27935. * Checks if `func` has its source masked.
  27936. *
  27937. * @private
  27938. * @param {Function} func The function to check.
  27939. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27940. */
  27941. function isMasked(func) {
  27942. return !!maskSrcKey && (maskSrcKey in func);
  27943. }
  27944. /**
  27945. * Converts `string` to a property path array.
  27946. *
  27947. * @private
  27948. * @param {string} string The string to convert.
  27949. * @returns {Array} Returns the property path array.
  27950. */
  27951. var stringToPath = memoize(function(string) {
  27952. string = toString(string);
  27953. var result = [];
  27954. if (reLeadingDot.test(string)) {
  27955. result.push('');
  27956. }
  27957. string.replace(rePropName, function(match, number, quote, string) {
  27958. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27959. });
  27960. return result;
  27961. });
  27962. /**
  27963. * Converts `value` to a string key if it's not a string or symbol.
  27964. *
  27965. * @private
  27966. * @param {*} value The value to inspect.
  27967. * @returns {string|symbol} Returns the key.
  27968. */
  27969. function toKey(value) {
  27970. if (typeof value == 'string' || isSymbol(value)) {
  27971. return value;
  27972. }
  27973. var result = (value + '');
  27974. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27975. }
  27976. /**
  27977. * Converts `func` to its source code.
  27978. *
  27979. * @private
  27980. * @param {Function} func The function to process.
  27981. * @returns {string} Returns the source code.
  27982. */
  27983. function toSource(func) {
  27984. if (func != null) {
  27985. try {
  27986. return funcToString.call(func);
  27987. } catch (e) {}
  27988. try {
  27989. return (func + '');
  27990. } catch (e) {}
  27991. }
  27992. return '';
  27993. }
  27994. /**
  27995. * Creates a function that memoizes the result of `func`. If `resolver` is
  27996. * provided, it determines the cache key for storing the result based on the
  27997. * arguments provided to the memoized function. By default, the first argument
  27998. * provided to the memoized function is used as the map cache key. The `func`
  27999. * is invoked with the `this` binding of the memoized function.
  28000. *
  28001. * **Note:** The cache is exposed as the `cache` property on the memoized
  28002. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28003. * constructor with one whose instances implement the
  28004. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28005. * method interface of `delete`, `get`, `has`, and `set`.
  28006. *
  28007. * @static
  28008. * @memberOf _
  28009. * @since 0.1.0
  28010. * @category Function
  28011. * @param {Function} func The function to have its output memoized.
  28012. * @param {Function} [resolver] The function to resolve the cache key.
  28013. * @returns {Function} Returns the new memoized function.
  28014. * @example
  28015. *
  28016. * var object = { 'a': 1, 'b': 2 };
  28017. * var other = { 'c': 3, 'd': 4 };
  28018. *
  28019. * var values = _.memoize(_.values);
  28020. * values(object);
  28021. * // => [1, 2]
  28022. *
  28023. * values(other);
  28024. * // => [3, 4]
  28025. *
  28026. * object.a = 2;
  28027. * values(object);
  28028. * // => [1, 2]
  28029. *
  28030. * // Modify the result cache.
  28031. * values.cache.set(object, ['a', 'b']);
  28032. * values(object);
  28033. * // => ['a', 'b']
  28034. *
  28035. * // Replace `_.memoize.Cache`.
  28036. * _.memoize.Cache = WeakMap;
  28037. */
  28038. function memoize(func, resolver) {
  28039. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28040. throw new TypeError(FUNC_ERROR_TEXT);
  28041. }
  28042. var memoized = function() {
  28043. var args = arguments,
  28044. key = resolver ? resolver.apply(this, args) : args[0],
  28045. cache = memoized.cache;
  28046. if (cache.has(key)) {
  28047. return cache.get(key);
  28048. }
  28049. var result = func.apply(this, args);
  28050. memoized.cache = cache.set(key, result);
  28051. return result;
  28052. };
  28053. memoized.cache = new (memoize.Cache || MapCache);
  28054. return memoized;
  28055. }
  28056. // Assign cache to `_.memoize`.
  28057. memoize.Cache = MapCache;
  28058. /**
  28059. * Performs a
  28060. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28061. * comparison between two values to determine if they are equivalent.
  28062. *
  28063. * @static
  28064. * @memberOf _
  28065. * @since 4.0.0
  28066. * @category Lang
  28067. * @param {*} value The value to compare.
  28068. * @param {*} other The other value to compare.
  28069. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28070. * @example
  28071. *
  28072. * var object = { 'a': 1 };
  28073. * var other = { 'a': 1 };
  28074. *
  28075. * _.eq(object, object);
  28076. * // => true
  28077. *
  28078. * _.eq(object, other);
  28079. * // => false
  28080. *
  28081. * _.eq('a', 'a');
  28082. * // => true
  28083. *
  28084. * _.eq('a', Object('a'));
  28085. * // => false
  28086. *
  28087. * _.eq(NaN, NaN);
  28088. * // => true
  28089. */
  28090. function eq(value, other) {
  28091. return value === other || (value !== value && other !== other);
  28092. }
  28093. /**
  28094. * Checks if `value` is classified as an `Array` object.
  28095. *
  28096. * @static
  28097. * @memberOf _
  28098. * @since 0.1.0
  28099. * @category Lang
  28100. * @param {*} value The value to check.
  28101. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28102. * @example
  28103. *
  28104. * _.isArray([1, 2, 3]);
  28105. * // => true
  28106. *
  28107. * _.isArray(document.body.children);
  28108. * // => false
  28109. *
  28110. * _.isArray('abc');
  28111. * // => false
  28112. *
  28113. * _.isArray(_.noop);
  28114. * // => false
  28115. */
  28116. var isArray = Array.isArray;
  28117. /**
  28118. * Checks if `value` is classified as a `Function` object.
  28119. *
  28120. * @static
  28121. * @memberOf _
  28122. * @since 0.1.0
  28123. * @category Lang
  28124. * @param {*} value The value to check.
  28125. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28126. * @example
  28127. *
  28128. * _.isFunction(_);
  28129. * // => true
  28130. *
  28131. * _.isFunction(/abc/);
  28132. * // => false
  28133. */
  28134. function isFunction(value) {
  28135. // The use of `Object#toString` avoids issues with the `typeof` operator
  28136. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28137. var tag = isObject(value) ? objectToString.call(value) : '';
  28138. return tag == funcTag || tag == genTag;
  28139. }
  28140. /**
  28141. * Checks if `value` is the
  28142. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28143. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28144. *
  28145. * @static
  28146. * @memberOf _
  28147. * @since 0.1.0
  28148. * @category Lang
  28149. * @param {*} value The value to check.
  28150. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28151. * @example
  28152. *
  28153. * _.isObject({});
  28154. * // => true
  28155. *
  28156. * _.isObject([1, 2, 3]);
  28157. * // => true
  28158. *
  28159. * _.isObject(_.noop);
  28160. * // => true
  28161. *
  28162. * _.isObject(null);
  28163. * // => false
  28164. */
  28165. function isObject(value) {
  28166. var type = typeof value;
  28167. return !!value && (type == 'object' || type == 'function');
  28168. }
  28169. /**
  28170. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28171. * and has a `typeof` result of "object".
  28172. *
  28173. * @static
  28174. * @memberOf _
  28175. * @since 4.0.0
  28176. * @category Lang
  28177. * @param {*} value The value to check.
  28178. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28179. * @example
  28180. *
  28181. * _.isObjectLike({});
  28182. * // => true
  28183. *
  28184. * _.isObjectLike([1, 2, 3]);
  28185. * // => true
  28186. *
  28187. * _.isObjectLike(_.noop);
  28188. * // => false
  28189. *
  28190. * _.isObjectLike(null);
  28191. * // => false
  28192. */
  28193. function isObjectLike(value) {
  28194. return !!value && typeof value == 'object';
  28195. }
  28196. /**
  28197. * Checks if `value` is classified as a `Symbol` primitive or object.
  28198. *
  28199. * @static
  28200. * @memberOf _
  28201. * @since 4.0.0
  28202. * @category Lang
  28203. * @param {*} value The value to check.
  28204. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28205. * @example
  28206. *
  28207. * _.isSymbol(Symbol.iterator);
  28208. * // => true
  28209. *
  28210. * _.isSymbol('abc');
  28211. * // => false
  28212. */
  28213. function isSymbol(value) {
  28214. return typeof value == 'symbol' ||
  28215. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28216. }
  28217. /**
  28218. * Converts `value` to a string. An empty string is returned for `null`
  28219. * and `undefined` values. The sign of `-0` is preserved.
  28220. *
  28221. * @static
  28222. * @memberOf _
  28223. * @since 4.0.0
  28224. * @category Lang
  28225. * @param {*} value The value to process.
  28226. * @returns {string} Returns the string.
  28227. * @example
  28228. *
  28229. * _.toString(null);
  28230. * // => ''
  28231. *
  28232. * _.toString(-0);
  28233. * // => '-0'
  28234. *
  28235. * _.toString([1, 2, 3]);
  28236. * // => '1,2,3'
  28237. */
  28238. function toString(value) {
  28239. return value == null ? '' : baseToString(value);
  28240. }
  28241. /**
  28242. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28243. * it's created. Arrays are created for missing index properties while objects
  28244. * are created for all other missing properties. Use `_.setWith` to customize
  28245. * `path` creation.
  28246. *
  28247. * **Note:** This method mutates `object`.
  28248. *
  28249. * @static
  28250. * @memberOf _
  28251. * @since 3.7.0
  28252. * @category Object
  28253. * @param {Object} object The object to modify.
  28254. * @param {Array|string} path The path of the property to set.
  28255. * @param {*} value The value to set.
  28256. * @returns {Object} Returns `object`.
  28257. * @example
  28258. *
  28259. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28260. *
  28261. * _.set(object, 'a[0].b.c', 4);
  28262. * console.log(object.a[0].b.c);
  28263. * // => 4
  28264. *
  28265. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28266. * console.log(object.x[0].y.z);
  28267. * // => 5
  28268. */
  28269. function set(object, path, value) {
  28270. return object == null ? object : baseSet(object, path, value);
  28271. }
  28272. module.exports = set;
  28273. /***/ }),
  28274. /***/ 898:
  28275. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28276. "use strict";
  28277. Object.defineProperty(exports, '__esModule', { value: true });
  28278. var request = __webpack_require__(753);
  28279. var universalUserAgent = __webpack_require__(796);
  28280. const VERSION = "4.3.1";
  28281. class GraphqlError extends Error {
  28282. constructor(request, response) {
  28283. const message = response.data.errors[0].message;
  28284. super(message);
  28285. Object.assign(this, response.data);
  28286. this.name = "GraphqlError";
  28287. this.request = request; // Maintains proper stack trace (only available on V8)
  28288. /* istanbul ignore next */
  28289. if (Error.captureStackTrace) {
  28290. Error.captureStackTrace(this, this.constructor);
  28291. }
  28292. }
  28293. }
  28294. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28295. function graphql(request, query, options) {
  28296. options = typeof query === "string" ? options = Object.assign({
  28297. query
  28298. }, options) : options = query;
  28299. const requestOptions = Object.keys(options).reduce((result, key) => {
  28300. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28301. result[key] = options[key];
  28302. return result;
  28303. }
  28304. if (!result.variables) {
  28305. result.variables = {};
  28306. }
  28307. result.variables[key] = options[key];
  28308. return result;
  28309. }, {});
  28310. return request(requestOptions).then(response => {
  28311. if (response.data.errors) {
  28312. throw new GraphqlError(requestOptions, {
  28313. data: response.data
  28314. });
  28315. }
  28316. return response.data.data;
  28317. });
  28318. }
  28319. function withDefaults(request$1, newDefaults) {
  28320. const newRequest = request$1.defaults(newDefaults);
  28321. const newApi = (query, options) => {
  28322. return graphql(newRequest, query, options);
  28323. };
  28324. return Object.assign(newApi, {
  28325. defaults: withDefaults.bind(null, newRequest),
  28326. endpoint: request.request.endpoint
  28327. });
  28328. }
  28329. const graphql$1 = withDefaults(request.request, {
  28330. headers: {
  28331. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28332. },
  28333. method: "POST",
  28334. url: "/graphql"
  28335. });
  28336. function withCustomRequest(customRequest) {
  28337. return withDefaults(customRequest, {
  28338. method: "POST",
  28339. url: "/graphql"
  28340. });
  28341. }
  28342. exports.graphql = graphql$1;
  28343. exports.withCustomRequest = withCustomRequest;
  28344. //# sourceMappingURL=index.js.map
  28345. /***/ }),
  28346. /***/ 916:
  28347. /***/ (function(__unusedmodule, exports) {
  28348. "use strict";
  28349. Object.defineProperty(exports, '__esModule', { value: true });
  28350. const VERSION = "1.0.0";
  28351. /**
  28352. * @param octokit Octokit instance
  28353. * @param options Options passed to Octokit constructor
  28354. */
  28355. function requestLog(octokit) {
  28356. octokit.hook.wrap("request", (request, options) => {
  28357. octokit.log.debug("request", options);
  28358. const start = Date.now();
  28359. const requestOptions = octokit.request.endpoint.parse(options);
  28360. const path = requestOptions.url.replace(options.baseUrl, "");
  28361. return request(options).then(response => {
  28362. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28363. return response;
  28364. }).catch(error => {
  28365. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28366. throw error;
  28367. });
  28368. });
  28369. }
  28370. requestLog.VERSION = VERSION;
  28371. exports.requestLog = requestLog;
  28372. //# sourceMappingURL=index.js.map
  28373. /***/ }),
  28374. /***/ 929:
  28375. /***/ (function(module, __unusedexports, __webpack_require__) {
  28376. module.exports = hasNextPage
  28377. const deprecate = __webpack_require__(370)
  28378. const getPageLinks = __webpack_require__(577)
  28379. function hasNextPage (link) {
  28380. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28381. return getPageLinks(link).next
  28382. }
  28383. /***/ }),
  28384. /***/ 948:
  28385. /***/ (function(module) {
  28386. "use strict";
  28387. /**
  28388. * Tries to execute a function and discards any error that occurs.
  28389. * @param {Function} fn - Function that might or might not throw an error.
  28390. * @returns {?*} Return-value of the function when no error occurred.
  28391. */
  28392. module.exports = function(fn) {
  28393. try { return fn() } catch (e) {}
  28394. }
  28395. /***/ }),
  28396. /***/ 950:
  28397. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28398. "use strict";
  28399. Object.defineProperty(exports, "__esModule", { value: true });
  28400. const url = __webpack_require__(835);
  28401. function getProxyUrl(reqUrl) {
  28402. let usingSsl = reqUrl.protocol === 'https:';
  28403. let proxyUrl;
  28404. if (checkBypass(reqUrl)) {
  28405. return proxyUrl;
  28406. }
  28407. let proxyVar;
  28408. if (usingSsl) {
  28409. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28410. }
  28411. else {
  28412. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28413. }
  28414. if (proxyVar) {
  28415. proxyUrl = url.parse(proxyVar);
  28416. }
  28417. return proxyUrl;
  28418. }
  28419. exports.getProxyUrl = getProxyUrl;
  28420. function checkBypass(reqUrl) {
  28421. if (!reqUrl.hostname) {
  28422. return false;
  28423. }
  28424. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28425. if (!noProxy) {
  28426. return false;
  28427. }
  28428. // Determine the request port
  28429. let reqPort;
  28430. if (reqUrl.port) {
  28431. reqPort = Number(reqUrl.port);
  28432. }
  28433. else if (reqUrl.protocol === 'http:') {
  28434. reqPort = 80;
  28435. }
  28436. else if (reqUrl.protocol === 'https:') {
  28437. reqPort = 443;
  28438. }
  28439. // Format the request hostname and hostname with port
  28440. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28441. if (typeof reqPort === 'number') {
  28442. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28443. }
  28444. // Compare request host against noproxy
  28445. for (let upperNoProxyItem of noProxy
  28446. .split(',')
  28447. .map(x => x.trim().toUpperCase())
  28448. .filter(x => x)) {
  28449. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28450. return true;
  28451. }
  28452. }
  28453. return false;
  28454. }
  28455. exports.checkBypass = checkBypass;
  28456. /***/ }),
  28457. /***/ 954:
  28458. /***/ (function(module) {
  28459. module.exports = validateAuth;
  28460. function validateAuth(auth) {
  28461. if (typeof auth === "string") {
  28462. return;
  28463. }
  28464. if (typeof auth === "function") {
  28465. return;
  28466. }
  28467. if (auth.username && auth.password) {
  28468. return;
  28469. }
  28470. if (auth.clientId && auth.clientSecret) {
  28471. return;
  28472. }
  28473. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28474. }
  28475. /***/ }),
  28476. /***/ 955:
  28477. /***/ (function(module, __unusedexports, __webpack_require__) {
  28478. "use strict";
  28479. const path = __webpack_require__(622);
  28480. const childProcess = __webpack_require__(129);
  28481. const crossSpawn = __webpack_require__(20);
  28482. const stripEof = __webpack_require__(768);
  28483. const npmRunPath = __webpack_require__(621);
  28484. const isStream = __webpack_require__(323);
  28485. const _getStream = __webpack_require__(145);
  28486. const pFinally = __webpack_require__(697);
  28487. const onExit = __webpack_require__(260);
  28488. const errname = __webpack_require__(427);
  28489. const stdio = __webpack_require__(168);
  28490. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28491. function handleArgs(cmd, args, opts) {
  28492. let parsed;
  28493. opts = Object.assign({
  28494. extendEnv: true,
  28495. env: {}
  28496. }, opts);
  28497. if (opts.extendEnv) {
  28498. opts.env = Object.assign({}, process.env, opts.env);
  28499. }
  28500. if (opts.__winShell === true) {
  28501. delete opts.__winShell;
  28502. parsed = {
  28503. command: cmd,
  28504. args,
  28505. options: opts,
  28506. file: cmd,
  28507. original: {
  28508. cmd,
  28509. args
  28510. }
  28511. };
  28512. } else {
  28513. parsed = crossSpawn._parse(cmd, args, opts);
  28514. }
  28515. opts = Object.assign({
  28516. maxBuffer: TEN_MEGABYTES,
  28517. buffer: true,
  28518. stripEof: true,
  28519. preferLocal: true,
  28520. localDir: parsed.options.cwd || process.cwd(),
  28521. encoding: 'utf8',
  28522. reject: true,
  28523. cleanup: true
  28524. }, parsed.options);
  28525. opts.stdio = stdio(opts);
  28526. if (opts.preferLocal) {
  28527. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28528. }
  28529. if (opts.detached) {
  28530. // #115
  28531. opts.cleanup = false;
  28532. }
  28533. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28534. // #116
  28535. parsed.args.unshift('/q');
  28536. }
  28537. return {
  28538. cmd: parsed.command,
  28539. args: parsed.args,
  28540. opts,
  28541. parsed
  28542. };
  28543. }
  28544. function handleInput(spawned, input) {
  28545. if (input === null || input === undefined) {
  28546. return;
  28547. }
  28548. if (isStream(input)) {
  28549. input.pipe(spawned.stdin);
  28550. } else {
  28551. spawned.stdin.end(input);
  28552. }
  28553. }
  28554. function handleOutput(opts, val) {
  28555. if (val && opts.stripEof) {
  28556. val = stripEof(val);
  28557. }
  28558. return val;
  28559. }
  28560. function handleShell(fn, cmd, opts) {
  28561. let file = '/bin/sh';
  28562. let args = ['-c', cmd];
  28563. opts = Object.assign({}, opts);
  28564. if (process.platform === 'win32') {
  28565. opts.__winShell = true;
  28566. file = process.env.comspec || 'cmd.exe';
  28567. args = ['/s', '/c', `"${cmd}"`];
  28568. opts.windowsVerbatimArguments = true;
  28569. }
  28570. if (opts.shell) {
  28571. file = opts.shell;
  28572. delete opts.shell;
  28573. }
  28574. return fn(file, args, opts);
  28575. }
  28576. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28577. if (!process[stream]) {
  28578. return null;
  28579. }
  28580. let ret;
  28581. if (!buffer) {
  28582. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28583. ret = new Promise((resolve, reject) => {
  28584. process[stream]
  28585. .once('end', resolve)
  28586. .once('error', reject);
  28587. });
  28588. } else if (encoding) {
  28589. ret = _getStream(process[stream], {
  28590. encoding,
  28591. maxBuffer
  28592. });
  28593. } else {
  28594. ret = _getStream.buffer(process[stream], {maxBuffer});
  28595. }
  28596. return ret.catch(err => {
  28597. err.stream = stream;
  28598. err.message = `${stream} ${err.message}`;
  28599. throw err;
  28600. });
  28601. }
  28602. function makeError(result, options) {
  28603. const {stdout, stderr} = result;
  28604. let err = result.error;
  28605. const {code, signal} = result;
  28606. const {parsed, joinedCmd} = options;
  28607. const timedOut = options.timedOut || false;
  28608. if (!err) {
  28609. let output = '';
  28610. if (Array.isArray(parsed.opts.stdio)) {
  28611. if (parsed.opts.stdio[2] !== 'inherit') {
  28612. output += output.length > 0 ? stderr : `\n${stderr}`;
  28613. }
  28614. if (parsed.opts.stdio[1] !== 'inherit') {
  28615. output += `\n${stdout}`;
  28616. }
  28617. } else if (parsed.opts.stdio !== 'inherit') {
  28618. output = `\n${stderr}${stdout}`;
  28619. }
  28620. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28621. err.code = code < 0 ? errname(code) : code;
  28622. }
  28623. err.stdout = stdout;
  28624. err.stderr = stderr;
  28625. err.failed = true;
  28626. err.signal = signal || null;
  28627. err.cmd = joinedCmd;
  28628. err.timedOut = timedOut;
  28629. return err;
  28630. }
  28631. function joinCmd(cmd, args) {
  28632. let joinedCmd = cmd;
  28633. if (Array.isArray(args) && args.length > 0) {
  28634. joinedCmd += ' ' + args.join(' ');
  28635. }
  28636. return joinedCmd;
  28637. }
  28638. module.exports = (cmd, args, opts) => {
  28639. const parsed = handleArgs(cmd, args, opts);
  28640. const {encoding, buffer, maxBuffer} = parsed.opts;
  28641. const joinedCmd = joinCmd(cmd, args);
  28642. let spawned;
  28643. try {
  28644. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28645. } catch (err) {
  28646. return Promise.reject(err);
  28647. }
  28648. let removeExitHandler;
  28649. if (parsed.opts.cleanup) {
  28650. removeExitHandler = onExit(() => {
  28651. spawned.kill();
  28652. });
  28653. }
  28654. let timeoutId = null;
  28655. let timedOut = false;
  28656. const cleanup = () => {
  28657. if (timeoutId) {
  28658. clearTimeout(timeoutId);
  28659. timeoutId = null;
  28660. }
  28661. if (removeExitHandler) {
  28662. removeExitHandler();
  28663. }
  28664. };
  28665. if (parsed.opts.timeout > 0) {
  28666. timeoutId = setTimeout(() => {
  28667. timeoutId = null;
  28668. timedOut = true;
  28669. spawned.kill(parsed.opts.killSignal);
  28670. }, parsed.opts.timeout);
  28671. }
  28672. const processDone = new Promise(resolve => {
  28673. spawned.on('exit', (code, signal) => {
  28674. cleanup();
  28675. resolve({code, signal});
  28676. });
  28677. spawned.on('error', err => {
  28678. cleanup();
  28679. resolve({error: err});
  28680. });
  28681. if (spawned.stdin) {
  28682. spawned.stdin.on('error', err => {
  28683. cleanup();
  28684. resolve({error: err});
  28685. });
  28686. }
  28687. });
  28688. function destroy() {
  28689. if (spawned.stdout) {
  28690. spawned.stdout.destroy();
  28691. }
  28692. if (spawned.stderr) {
  28693. spawned.stderr.destroy();
  28694. }
  28695. }
  28696. const handlePromise = () => pFinally(Promise.all([
  28697. processDone,
  28698. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28699. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28700. ]).then(arr => {
  28701. const result = arr[0];
  28702. result.stdout = arr[1];
  28703. result.stderr = arr[2];
  28704. if (result.error || result.code !== 0 || result.signal !== null) {
  28705. const err = makeError(result, {
  28706. joinedCmd,
  28707. parsed,
  28708. timedOut
  28709. });
  28710. // TODO: missing some timeout logic for killed
  28711. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28712. // err.killed = spawned.killed || killed;
  28713. err.killed = err.killed || spawned.killed;
  28714. if (!parsed.opts.reject) {
  28715. return err;
  28716. }
  28717. throw err;
  28718. }
  28719. return {
  28720. stdout: handleOutput(parsed.opts, result.stdout),
  28721. stderr: handleOutput(parsed.opts, result.stderr),
  28722. code: 0,
  28723. failed: false,
  28724. killed: false,
  28725. signal: null,
  28726. cmd: joinedCmd,
  28727. timedOut: false
  28728. };
  28729. }), destroy);
  28730. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28731. handleInput(spawned, parsed.opts.input);
  28732. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28733. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28734. return spawned;
  28735. };
  28736. // TODO: set `stderr: 'ignore'` when that option is implemented
  28737. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28738. // TODO: set `stdout: 'ignore'` when that option is implemented
  28739. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28740. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28741. module.exports.sync = (cmd, args, opts) => {
  28742. const parsed = handleArgs(cmd, args, opts);
  28743. const joinedCmd = joinCmd(cmd, args);
  28744. if (isStream(parsed.opts.input)) {
  28745. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28746. }
  28747. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28748. result.code = result.status;
  28749. if (result.error || result.status !== 0 || result.signal !== null) {
  28750. const err = makeError(result, {
  28751. joinedCmd,
  28752. parsed
  28753. });
  28754. if (!parsed.opts.reject) {
  28755. return err;
  28756. }
  28757. throw err;
  28758. }
  28759. return {
  28760. stdout: handleOutput(parsed.opts, result.stdout),
  28761. stderr: handleOutput(parsed.opts, result.stderr),
  28762. code: 0,
  28763. failed: false,
  28764. signal: null,
  28765. cmd: joinedCmd,
  28766. timedOut: false
  28767. };
  28768. };
  28769. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28770. /***/ }),
  28771. /***/ 966:
  28772. /***/ (function(module, __unusedexports, __webpack_require__) {
  28773. "use strict";
  28774. const {PassThrough} = __webpack_require__(413);
  28775. module.exports = options => {
  28776. options = Object.assign({}, options);
  28777. const {array} = options;
  28778. let {encoding} = options;
  28779. const buffer = encoding === 'buffer';
  28780. let objectMode = false;
  28781. if (array) {
  28782. objectMode = !(encoding || buffer);
  28783. } else {
  28784. encoding = encoding || 'utf8';
  28785. }
  28786. if (buffer) {
  28787. encoding = null;
  28788. }
  28789. let len = 0;
  28790. const ret = [];
  28791. const stream = new PassThrough({objectMode});
  28792. if (encoding) {
  28793. stream.setEncoding(encoding);
  28794. }
  28795. stream.on('data', chunk => {
  28796. ret.push(chunk);
  28797. if (objectMode) {
  28798. len = ret.length;
  28799. } else {
  28800. len += chunk.length;
  28801. }
  28802. });
  28803. stream.getBufferedValue = () => {
  28804. if (array) {
  28805. return ret;
  28806. }
  28807. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28808. };
  28809. stream.getBufferedLength = () => len;
  28810. return stream;
  28811. };
  28812. /***/ }),
  28813. /***/ 969:
  28814. /***/ (function(module, __unusedexports, __webpack_require__) {
  28815. var wrappy = __webpack_require__(11)
  28816. module.exports = wrappy(once)
  28817. module.exports.strict = wrappy(onceStrict)
  28818. once.proto = once(function () {
  28819. Object.defineProperty(Function.prototype, 'once', {
  28820. value: function () {
  28821. return once(this)
  28822. },
  28823. configurable: true
  28824. })
  28825. Object.defineProperty(Function.prototype, 'onceStrict', {
  28826. value: function () {
  28827. return onceStrict(this)
  28828. },
  28829. configurable: true
  28830. })
  28831. })
  28832. function once (fn) {
  28833. var f = function () {
  28834. if (f.called) return f.value
  28835. f.called = true
  28836. return f.value = fn.apply(this, arguments)
  28837. }
  28838. f.called = false
  28839. return f
  28840. }
  28841. function onceStrict (fn) {
  28842. var f = function () {
  28843. if (f.called)
  28844. throw new Error(f.onceError)
  28845. f.called = true
  28846. return f.value = fn.apply(this, arguments)
  28847. }
  28848. var name = fn.name || 'Function wrapped with `once`'
  28849. f.onceError = name + " shouldn't be called more than once"
  28850. f.called = false
  28851. return f
  28852. }
  28853. /***/ }),
  28854. /***/ 986:
  28855. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28856. "use strict";
  28857. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28858. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28859. return new (P || (P = Promise))(function (resolve, reject) {
  28860. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28861. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28862. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28863. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28864. });
  28865. };
  28866. Object.defineProperty(exports, "__esModule", { value: true });
  28867. const tr = __webpack_require__(9);
  28868. /**
  28869. * Exec a command.
  28870. * Output will be streamed to the live console.
  28871. * Returns promise with return code
  28872. *
  28873. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28874. * @param args optional arguments for tool. Escaping is handled by the lib.
  28875. * @param options optional exec options. See ExecOptions
  28876. * @returns Promise<number> exit code
  28877. */
  28878. function exec(commandLine, args, options) {
  28879. return __awaiter(this, void 0, void 0, function* () {
  28880. const commandArgs = tr.argStringToArray(commandLine);
  28881. if (commandArgs.length === 0) {
  28882. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28883. }
  28884. // Path to tool to execute should be first arg
  28885. const toolPath = commandArgs[0];
  28886. args = commandArgs.slice(1).concat(args || []);
  28887. const runner = new tr.ToolRunner(toolPath, args, options);
  28888. return runner.exec();
  28889. });
  28890. }
  28891. exports.exec = exec;
  28892. //# sourceMappingURL=exec.js.map
  28893. /***/ }),
  28894. /***/ 991:
  28895. /***/ (function(module, __unusedexports, __webpack_require__) {
  28896. module.exports = authenticationRequestError;
  28897. const { RequestError } = __webpack_require__(497);
  28898. function authenticationRequestError(state, error, options) {
  28899. if (!error.headers) throw error;
  28900. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28901. // handle "2FA required" error only
  28902. if (error.status !== 401 || !otpRequired) {
  28903. throw error;
  28904. }
  28905. if (
  28906. error.status === 401 &&
  28907. otpRequired &&
  28908. error.request &&
  28909. error.request.headers["x-github-otp"]
  28910. ) {
  28911. if (state.otp) {
  28912. delete state.otp; // no longer valid, request again
  28913. } else {
  28914. throw new RequestError(
  28915. "Invalid one-time password for two-factor authentication",
  28916. 401,
  28917. {
  28918. headers: error.headers,
  28919. request: options
  28920. }
  28921. );
  28922. }
  28923. }
  28924. if (typeof state.auth.on2fa !== "function") {
  28925. throw new RequestError(
  28926. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28927. 401,
  28928. {
  28929. headers: error.headers,
  28930. request: options
  28931. }
  28932. );
  28933. }
  28934. return Promise.resolve()
  28935. .then(() => {
  28936. return state.auth.on2fa();
  28937. })
  28938. .then(oneTimePassword => {
  28939. const newOptions = Object.assign(options, {
  28940. headers: Object.assign(options.headers, {
  28941. "x-github-otp": oneTimePassword
  28942. })
  28943. });
  28944. return state.octokit.request(newOptions).then(response => {
  28945. // If OTP still valid, then persist it for following requests
  28946. state.otp = oneTimePassword;
  28947. return response;
  28948. });
  28949. });
  28950. }
  28951. /***/ })
  28952. /******/ });