index.js 810 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const { requestLog } = __webpack_require__(916);
  48. const {
  49. restEndpointMethods
  50. } = __webpack_require__(842);
  51. const Core = __webpack_require__(529);
  52. const CORE_PLUGINS = [
  53. __webpack_require__(190),
  54. __webpack_require__(19), // deprecated: remove in v17
  55. requestLog,
  56. __webpack_require__(148),
  57. restEndpointMethods,
  58. __webpack_require__(430),
  59. __webpack_require__(850) // deprecated: remove in v17
  60. ];
  61. const OctokitRest = Core.plugin(CORE_PLUGINS);
  62. function DeprecatedOctokit(options) {
  63. const warn =
  64. options && options.log && options.log.warn
  65. ? options.log.warn
  66. : console.warn;
  67. warn(
  68. '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead'
  69. );
  70. return new OctokitRest(options);
  71. }
  72. const Octokit = Object.assign(DeprecatedOctokit, {
  73. Octokit: OctokitRest
  74. });
  75. Object.keys(OctokitRest).forEach(key => {
  76. /* istanbul ignore else */
  77. if (OctokitRest.hasOwnProperty(key)) {
  78. Octokit[key] = OctokitRest[key];
  79. }
  80. });
  81. module.exports = Octokit;
  82. /***/ }),
  83. /***/ 1:
  84. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  85. "use strict";
  86. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  87. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  88. return new (P || (P = Promise))(function (resolve, reject) {
  89. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  90. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  91. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  92. step((generator = generator.apply(thisArg, _arguments || [])).next());
  93. });
  94. };
  95. Object.defineProperty(exports, "__esModule", { value: true });
  96. const childProcess = __webpack_require__(129);
  97. const path = __webpack_require__(622);
  98. const util_1 = __webpack_require__(669);
  99. const ioUtil = __webpack_require__(672);
  100. const exec = util_1.promisify(childProcess.exec);
  101. /**
  102. * Copies a file or folder.
  103. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  104. *
  105. * @param source source path
  106. * @param dest destination path
  107. * @param options optional. See CopyOptions.
  108. */
  109. function cp(source, dest, options = {}) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const { force, recursive } = readCopyOptions(options);
  112. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  113. // Dest is an existing file, but not forcing
  114. if (destStat && destStat.isFile() && !force) {
  115. return;
  116. }
  117. // If dest is an existing directory, should copy inside.
  118. const newDest = destStat && destStat.isDirectory()
  119. ? path.join(dest, path.basename(source))
  120. : dest;
  121. if (!(yield ioUtil.exists(source))) {
  122. throw new Error(`no such file or directory: ${source}`);
  123. }
  124. const sourceStat = yield ioUtil.stat(source);
  125. if (sourceStat.isDirectory()) {
  126. if (!recursive) {
  127. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  128. }
  129. else {
  130. yield cpDirRecursive(source, newDest, 0, force);
  131. }
  132. }
  133. else {
  134. if (path.relative(source, newDest) === '') {
  135. // a file cannot be copied to itself
  136. throw new Error(`'${newDest}' and '${source}' are the same file`);
  137. }
  138. yield copyFile(source, newDest, force);
  139. }
  140. });
  141. }
  142. exports.cp = cp;
  143. /**
  144. * Moves a path.
  145. *
  146. * @param source source path
  147. * @param dest destination path
  148. * @param options optional. See MoveOptions.
  149. */
  150. function mv(source, dest, options = {}) {
  151. return __awaiter(this, void 0, void 0, function* () {
  152. if (yield ioUtil.exists(dest)) {
  153. let destExists = true;
  154. if (yield ioUtil.isDirectory(dest)) {
  155. // If dest is directory copy src into dest
  156. dest = path.join(dest, path.basename(source));
  157. destExists = yield ioUtil.exists(dest);
  158. }
  159. if (destExists) {
  160. if (options.force == null || options.force) {
  161. yield rmRF(dest);
  162. }
  163. else {
  164. throw new Error('Destination already exists');
  165. }
  166. }
  167. }
  168. yield mkdirP(path.dirname(dest));
  169. yield ioUtil.rename(source, dest);
  170. });
  171. }
  172. exports.mv = mv;
  173. /**
  174. * Remove a path recursively with force
  175. *
  176. * @param inputPath path to remove
  177. */
  178. function rmRF(inputPath) {
  179. return __awaiter(this, void 0, void 0, function* () {
  180. if (ioUtil.IS_WINDOWS) {
  181. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  182. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  183. try {
  184. if (yield ioUtil.isDirectory(inputPath, true)) {
  185. yield exec(`rd /s /q "${inputPath}"`);
  186. }
  187. else {
  188. yield exec(`del /f /a "${inputPath}"`);
  189. }
  190. }
  191. catch (err) {
  192. // if you try to delete a file that doesn't exist, desired result is achieved
  193. // other errors are valid
  194. if (err.code !== 'ENOENT')
  195. throw err;
  196. }
  197. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  198. try {
  199. yield ioUtil.unlink(inputPath);
  200. }
  201. catch (err) {
  202. // if you try to delete a file that doesn't exist, desired result is achieved
  203. // other errors are valid
  204. if (err.code !== 'ENOENT')
  205. throw err;
  206. }
  207. }
  208. else {
  209. let isDir = false;
  210. try {
  211. isDir = yield ioUtil.isDirectory(inputPath);
  212. }
  213. catch (err) {
  214. // if you try to delete a file that doesn't exist, desired result is achieved
  215. // other errors are valid
  216. if (err.code !== 'ENOENT')
  217. throw err;
  218. return;
  219. }
  220. if (isDir) {
  221. yield exec(`rm -rf "${inputPath}"`);
  222. }
  223. else {
  224. yield ioUtil.unlink(inputPath);
  225. }
  226. }
  227. });
  228. }
  229. exports.rmRF = rmRF;
  230. /**
  231. * Make a directory. Creates the full path with folders in between
  232. * Will throw if it fails
  233. *
  234. * @param fsPath path to create
  235. * @returns Promise<void>
  236. */
  237. function mkdirP(fsPath) {
  238. return __awaiter(this, void 0, void 0, function* () {
  239. yield ioUtil.mkdirP(fsPath);
  240. });
  241. }
  242. exports.mkdirP = mkdirP;
  243. /**
  244. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  245. * If you check and the tool does not exist, it will throw.
  246. *
  247. * @param tool name of the tool
  248. * @param check whether to check if tool exists
  249. * @returns Promise<string> path to tool
  250. */
  251. function which(tool, check) {
  252. return __awaiter(this, void 0, void 0, function* () {
  253. if (!tool) {
  254. throw new Error("parameter 'tool' is required");
  255. }
  256. // recursive when check=true
  257. if (check) {
  258. const result = yield which(tool, false);
  259. if (!result) {
  260. if (ioUtil.IS_WINDOWS) {
  261. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  262. }
  263. else {
  264. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  265. }
  266. }
  267. }
  268. try {
  269. // build the list of extensions to try
  270. const extensions = [];
  271. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  272. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  273. if (extension) {
  274. extensions.push(extension);
  275. }
  276. }
  277. }
  278. // if it's rooted, return it if exists. otherwise return empty.
  279. if (ioUtil.isRooted(tool)) {
  280. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  281. if (filePath) {
  282. return filePath;
  283. }
  284. return '';
  285. }
  286. // if any path separators, return empty
  287. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  288. return '';
  289. }
  290. // build the list of directories
  291. //
  292. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  293. // it feels like we should not do this. Checking the current directory seems like more of a use
  294. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  295. // across platforms.
  296. const directories = [];
  297. if (process.env.PATH) {
  298. for (const p of process.env.PATH.split(path.delimiter)) {
  299. if (p) {
  300. directories.push(p);
  301. }
  302. }
  303. }
  304. // return the first match
  305. for (const directory of directories) {
  306. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  307. if (filePath) {
  308. return filePath;
  309. }
  310. }
  311. return '';
  312. }
  313. catch (err) {
  314. throw new Error(`which failed with message ${err.message}`);
  315. }
  316. });
  317. }
  318. exports.which = which;
  319. function readCopyOptions(options) {
  320. const force = options.force == null ? true : options.force;
  321. const recursive = Boolean(options.recursive);
  322. return { force, recursive };
  323. }
  324. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  325. return __awaiter(this, void 0, void 0, function* () {
  326. // Ensure there is not a run away recursive copy
  327. if (currentDepth >= 255)
  328. return;
  329. currentDepth++;
  330. yield mkdirP(destDir);
  331. const files = yield ioUtil.readdir(sourceDir);
  332. for (const fileName of files) {
  333. const srcFile = `${sourceDir}/${fileName}`;
  334. const destFile = `${destDir}/${fileName}`;
  335. const srcFileStat = yield ioUtil.lstat(srcFile);
  336. if (srcFileStat.isDirectory()) {
  337. // Recurse
  338. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  339. }
  340. else {
  341. yield copyFile(srcFile, destFile, force);
  342. }
  343. }
  344. // Change the mode for the newly created directory
  345. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  346. });
  347. }
  348. // Buffered file copy
  349. function copyFile(srcFile, destFile, force) {
  350. return __awaiter(this, void 0, void 0, function* () {
  351. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  352. // unlink/re-link it
  353. try {
  354. yield ioUtil.lstat(destFile);
  355. yield ioUtil.unlink(destFile);
  356. }
  357. catch (e) {
  358. // Try to override file permission
  359. if (e.code === 'EPERM') {
  360. yield ioUtil.chmod(destFile, '0666');
  361. yield ioUtil.unlink(destFile);
  362. }
  363. // other errors = it doesn't exist, no work to do
  364. }
  365. // Copy over symlink
  366. const symlinkFull = yield ioUtil.readlink(srcFile);
  367. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  368. }
  369. else if (!(yield ioUtil.exists(destFile)) || force) {
  370. yield ioUtil.copyFile(srcFile, destFile);
  371. }
  372. });
  373. }
  374. //# sourceMappingURL=io.js.map
  375. /***/ }),
  376. /***/ 2:
  377. /***/ (function(module, __unusedexports, __webpack_require__) {
  378. "use strict";
  379. const os = __webpack_require__(87);
  380. const macosRelease = __webpack_require__(118);
  381. const winRelease = __webpack_require__(49);
  382. const osName = (platform, release) => {
  383. if (!platform && release) {
  384. throw new Error('You can\'t specify a `release` without specifying `platform`');
  385. }
  386. platform = platform || os.platform();
  387. let id;
  388. if (platform === 'darwin') {
  389. if (!release && os.platform() === 'darwin') {
  390. release = os.release();
  391. }
  392. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  393. id = release ? macosRelease(release).name : '';
  394. return prefix + (id ? ' ' + id : '');
  395. }
  396. if (platform === 'linux') {
  397. if (!release && os.platform() === 'linux') {
  398. release = os.release();
  399. }
  400. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  401. return 'Linux' + (id ? ' ' + id : '');
  402. }
  403. if (platform === 'win32') {
  404. if (!release && os.platform() === 'win32') {
  405. release = os.release();
  406. }
  407. id = release ? winRelease(release) : '';
  408. return 'Windows' + (id ? ' ' + id : '');
  409. }
  410. return platform;
  411. };
  412. module.exports = osName;
  413. /***/ }),
  414. /***/ 3:
  415. /***/ (function(module, __unusedexports, __webpack_require__) {
  416. var once = __webpack_require__(969);
  417. var noop = function() {};
  418. var isRequest = function(stream) {
  419. return stream.setHeader && typeof stream.abort === 'function';
  420. };
  421. var isChildProcess = function(stream) {
  422. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  423. };
  424. var eos = function(stream, opts, callback) {
  425. if (typeof opts === 'function') return eos(stream, null, opts);
  426. if (!opts) opts = {};
  427. callback = once(callback || noop);
  428. var ws = stream._writableState;
  429. var rs = stream._readableState;
  430. var readable = opts.readable || (opts.readable !== false && stream.readable);
  431. var writable = opts.writable || (opts.writable !== false && stream.writable);
  432. var cancelled = false;
  433. var onlegacyfinish = function() {
  434. if (!stream.writable) onfinish();
  435. };
  436. var onfinish = function() {
  437. writable = false;
  438. if (!readable) callback.call(stream);
  439. };
  440. var onend = function() {
  441. readable = false;
  442. if (!writable) callback.call(stream);
  443. };
  444. var onexit = function(exitCode) {
  445. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  446. };
  447. var onerror = function(err) {
  448. callback.call(stream, err);
  449. };
  450. var onclose = function() {
  451. process.nextTick(onclosenexttick);
  452. };
  453. var onclosenexttick = function() {
  454. if (cancelled) return;
  455. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  456. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  457. };
  458. var onrequest = function() {
  459. stream.req.on('finish', onfinish);
  460. };
  461. if (isRequest(stream)) {
  462. stream.on('complete', onfinish);
  463. stream.on('abort', onclose);
  464. if (stream.req) onrequest();
  465. else stream.on('request', onrequest);
  466. } else if (writable && !ws) { // legacy streams
  467. stream.on('end', onlegacyfinish);
  468. stream.on('close', onlegacyfinish);
  469. }
  470. if (isChildProcess(stream)) stream.on('exit', onexit);
  471. stream.on('end', onend);
  472. stream.on('finish', onfinish);
  473. if (opts.error !== false) stream.on('error', onerror);
  474. stream.on('close', onclose);
  475. return function() {
  476. cancelled = true;
  477. stream.removeListener('complete', onfinish);
  478. stream.removeListener('abort', onclose);
  479. stream.removeListener('request', onrequest);
  480. if (stream.req) stream.req.removeListener('finish', onfinish);
  481. stream.removeListener('end', onlegacyfinish);
  482. stream.removeListener('close', onlegacyfinish);
  483. stream.removeListener('finish', onfinish);
  484. stream.removeListener('exit', onexit);
  485. stream.removeListener('end', onend);
  486. stream.removeListener('error', onerror);
  487. stream.removeListener('close', onclose);
  488. };
  489. };
  490. module.exports = eos;
  491. /***/ }),
  492. /***/ 9:
  493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  494. "use strict";
  495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  497. return new (P || (P = Promise))(function (resolve, reject) {
  498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  502. });
  503. };
  504. Object.defineProperty(exports, "__esModule", { value: true });
  505. const os = __webpack_require__(87);
  506. const events = __webpack_require__(614);
  507. const child = __webpack_require__(129);
  508. /* eslint-disable @typescript-eslint/unbound-method */
  509. const IS_WINDOWS = process.platform === 'win32';
  510. /*
  511. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  512. */
  513. class ToolRunner extends events.EventEmitter {
  514. constructor(toolPath, args, options) {
  515. super();
  516. if (!toolPath) {
  517. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  518. }
  519. this.toolPath = toolPath;
  520. this.args = args || [];
  521. this.options = options || {};
  522. }
  523. _debug(message) {
  524. if (this.options.listeners && this.options.listeners.debug) {
  525. this.options.listeners.debug(message);
  526. }
  527. }
  528. _getCommandString(options, noPrefix) {
  529. const toolPath = this._getSpawnFileName();
  530. const args = this._getSpawnArgs(options);
  531. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  532. if (IS_WINDOWS) {
  533. // Windows + cmd file
  534. if (this._isCmdFile()) {
  535. cmd += toolPath;
  536. for (const a of args) {
  537. cmd += ` ${a}`;
  538. }
  539. }
  540. // Windows + verbatim
  541. else if (options.windowsVerbatimArguments) {
  542. cmd += `"${toolPath}"`;
  543. for (const a of args) {
  544. cmd += ` ${a}`;
  545. }
  546. }
  547. // Windows (regular)
  548. else {
  549. cmd += this._windowsQuoteCmdArg(toolPath);
  550. for (const a of args) {
  551. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  552. }
  553. }
  554. }
  555. else {
  556. // OSX/Linux - this can likely be improved with some form of quoting.
  557. // creating processes on Unix is fundamentally different than Windows.
  558. // on Unix, execvp() takes an arg array.
  559. cmd += toolPath;
  560. for (const a of args) {
  561. cmd += ` ${a}`;
  562. }
  563. }
  564. return cmd;
  565. }
  566. _processLineBuffer(data, strBuffer, onLine) {
  567. try {
  568. let s = strBuffer + data.toString();
  569. let n = s.indexOf(os.EOL);
  570. while (n > -1) {
  571. const line = s.substring(0, n);
  572. onLine(line);
  573. // the rest of the string ...
  574. s = s.substring(n + os.EOL.length);
  575. n = s.indexOf(os.EOL);
  576. }
  577. strBuffer = s;
  578. }
  579. catch (err) {
  580. // streaming lines to console is best effort. Don't fail a build.
  581. this._debug(`error processing line. Failed with error ${err}`);
  582. }
  583. }
  584. _getSpawnFileName() {
  585. if (IS_WINDOWS) {
  586. if (this._isCmdFile()) {
  587. return process.env['COMSPEC'] || 'cmd.exe';
  588. }
  589. }
  590. return this.toolPath;
  591. }
  592. _getSpawnArgs(options) {
  593. if (IS_WINDOWS) {
  594. if (this._isCmdFile()) {
  595. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  596. for (const a of this.args) {
  597. argline += ' ';
  598. argline += options.windowsVerbatimArguments
  599. ? a
  600. : this._windowsQuoteCmdArg(a);
  601. }
  602. argline += '"';
  603. return [argline];
  604. }
  605. }
  606. return this.args;
  607. }
  608. _endsWith(str, end) {
  609. return str.endsWith(end);
  610. }
  611. _isCmdFile() {
  612. const upperToolPath = this.toolPath.toUpperCase();
  613. return (this._endsWith(upperToolPath, '.CMD') ||
  614. this._endsWith(upperToolPath, '.BAT'));
  615. }
  616. _windowsQuoteCmdArg(arg) {
  617. // for .exe, apply the normal quoting rules that libuv applies
  618. if (!this._isCmdFile()) {
  619. return this._uvQuoteCmdArg(arg);
  620. }
  621. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  622. // the libuv rules are generic and are not designed specifically for cmd.exe
  623. // command line parser.
  624. //
  625. // for a detailed description of the cmd.exe command line parser, refer to
  626. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  627. // need quotes for empty arg
  628. if (!arg) {
  629. return '""';
  630. }
  631. // determine whether the arg needs to be quoted
  632. const cmdSpecialChars = [
  633. ' ',
  634. '\t',
  635. '&',
  636. '(',
  637. ')',
  638. '[',
  639. ']',
  640. '{',
  641. '}',
  642. '^',
  643. '=',
  644. ';',
  645. '!',
  646. "'",
  647. '+',
  648. ',',
  649. '`',
  650. '~',
  651. '|',
  652. '<',
  653. '>',
  654. '"'
  655. ];
  656. let needsQuotes = false;
  657. for (const char of arg) {
  658. if (cmdSpecialChars.some(x => x === char)) {
  659. needsQuotes = true;
  660. break;
  661. }
  662. }
  663. // short-circuit if quotes not needed
  664. if (!needsQuotes) {
  665. return arg;
  666. }
  667. // the following quoting rules are very similar to the rules that by libuv applies.
  668. //
  669. // 1) wrap the string in quotes
  670. //
  671. // 2) double-up quotes - i.e. " => ""
  672. //
  673. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  674. // doesn't work well with a cmd.exe command line.
  675. //
  676. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  677. // for example, the command line:
  678. // foo.exe "myarg:""my val"""
  679. // is parsed by a .NET console app into an arg array:
  680. // [ "myarg:\"my val\"" ]
  681. // which is the same end result when applying libuv quoting rules. although the actual
  682. // command line from libuv quoting rules would look like:
  683. // foo.exe "myarg:\"my val\""
  684. //
  685. // 3) double-up slashes that precede a quote,
  686. // e.g. hello \world => "hello \world"
  687. // hello\"world => "hello\\""world"
  688. // hello\\"world => "hello\\\\""world"
  689. // hello world\ => "hello world\\"
  690. //
  691. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  692. // the reasons for including this as a .cmd quoting rule are:
  693. //
  694. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  695. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  696. //
  697. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  698. // haven't heard any complaints about that aspect.
  699. //
  700. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  701. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  702. // by using %%.
  703. //
  704. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  705. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  706. //
  707. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  708. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  709. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  710. // to an external program.
  711. //
  712. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  713. // % can be escaped within a .cmd file.
  714. let reverse = '"';
  715. let quoteHit = true;
  716. for (let i = arg.length; i > 0; i--) {
  717. // walk the string in reverse
  718. reverse += arg[i - 1];
  719. if (quoteHit && arg[i - 1] === '\\') {
  720. reverse += '\\'; // double the slash
  721. }
  722. else if (arg[i - 1] === '"') {
  723. quoteHit = true;
  724. reverse += '"'; // double the quote
  725. }
  726. else {
  727. quoteHit = false;
  728. }
  729. }
  730. reverse += '"';
  731. return reverse
  732. .split('')
  733. .reverse()
  734. .join('');
  735. }
  736. _uvQuoteCmdArg(arg) {
  737. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  738. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  739. // is used.
  740. //
  741. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  742. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  743. // pasting copyright notice from Node within this function:
  744. //
  745. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  746. //
  747. // Permission is hereby granted, free of charge, to any person obtaining a copy
  748. // of this software and associated documentation files (the "Software"), to
  749. // deal in the Software without restriction, including without limitation the
  750. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  751. // sell copies of the Software, and to permit persons to whom the Software is
  752. // furnished to do so, subject to the following conditions:
  753. //
  754. // The above copyright notice and this permission notice shall be included in
  755. // all copies or substantial portions of the Software.
  756. //
  757. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  758. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  759. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  760. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  761. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  762. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  763. // IN THE SOFTWARE.
  764. if (!arg) {
  765. // Need double quotation for empty argument
  766. return '""';
  767. }
  768. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  769. // No quotation needed
  770. return arg;
  771. }
  772. if (!arg.includes('"') && !arg.includes('\\')) {
  773. // No embedded double quotes or backslashes, so I can just wrap
  774. // quote marks around the whole thing.
  775. return `"${arg}"`;
  776. }
  777. // Expected input/output:
  778. // input : hello"world
  779. // output: "hello\"world"
  780. // input : hello""world
  781. // output: "hello\"\"world"
  782. // input : hello\world
  783. // output: hello\world
  784. // input : hello\\world
  785. // output: hello\\world
  786. // input : hello\"world
  787. // output: "hello\\\"world"
  788. // input : hello\\"world
  789. // output: "hello\\\\\"world"
  790. // input : hello world\
  791. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  792. // but it appears the comment is wrong, it should be "hello world\\"
  793. let reverse = '"';
  794. let quoteHit = true;
  795. for (let i = arg.length; i > 0; i--) {
  796. // walk the string in reverse
  797. reverse += arg[i - 1];
  798. if (quoteHit && arg[i - 1] === '\\') {
  799. reverse += '\\';
  800. }
  801. else if (arg[i - 1] === '"') {
  802. quoteHit = true;
  803. reverse += '\\';
  804. }
  805. else {
  806. quoteHit = false;
  807. }
  808. }
  809. reverse += '"';
  810. return reverse
  811. .split('')
  812. .reverse()
  813. .join('');
  814. }
  815. _cloneExecOptions(options) {
  816. options = options || {};
  817. const result = {
  818. cwd: options.cwd || process.cwd(),
  819. env: options.env || process.env,
  820. silent: options.silent || false,
  821. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  822. failOnStdErr: options.failOnStdErr || false,
  823. ignoreReturnCode: options.ignoreReturnCode || false,
  824. delay: options.delay || 10000
  825. };
  826. result.outStream = options.outStream || process.stdout;
  827. result.errStream = options.errStream || process.stderr;
  828. return result;
  829. }
  830. _getSpawnOptions(options, toolPath) {
  831. options = options || {};
  832. const result = {};
  833. result.cwd = options.cwd;
  834. result.env = options.env;
  835. result['windowsVerbatimArguments'] =
  836. options.windowsVerbatimArguments || this._isCmdFile();
  837. if (options.windowsVerbatimArguments) {
  838. result.argv0 = `"${toolPath}"`;
  839. }
  840. return result;
  841. }
  842. /**
  843. * Exec a tool.
  844. * Output will be streamed to the live console.
  845. * Returns promise with return code
  846. *
  847. * @param tool path to tool to exec
  848. * @param options optional exec options. See ExecOptions
  849. * @returns number
  850. */
  851. exec() {
  852. return __awaiter(this, void 0, void 0, function* () {
  853. return new Promise((resolve, reject) => {
  854. this._debug(`exec tool: ${this.toolPath}`);
  855. this._debug('arguments:');
  856. for (const arg of this.args) {
  857. this._debug(` ${arg}`);
  858. }
  859. const optionsNonNull = this._cloneExecOptions(this.options);
  860. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  861. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  862. }
  863. const state = new ExecState(optionsNonNull, this.toolPath);
  864. state.on('debug', (message) => {
  865. this._debug(message);
  866. });
  867. const fileName = this._getSpawnFileName();
  868. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  869. const stdbuffer = '';
  870. if (cp.stdout) {
  871. cp.stdout.on('data', (data) => {
  872. if (this.options.listeners && this.options.listeners.stdout) {
  873. this.options.listeners.stdout(data);
  874. }
  875. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  876. optionsNonNull.outStream.write(data);
  877. }
  878. this._processLineBuffer(data, stdbuffer, (line) => {
  879. if (this.options.listeners && this.options.listeners.stdline) {
  880. this.options.listeners.stdline(line);
  881. }
  882. });
  883. });
  884. }
  885. const errbuffer = '';
  886. if (cp.stderr) {
  887. cp.stderr.on('data', (data) => {
  888. state.processStderr = true;
  889. if (this.options.listeners && this.options.listeners.stderr) {
  890. this.options.listeners.stderr(data);
  891. }
  892. if (!optionsNonNull.silent &&
  893. optionsNonNull.errStream &&
  894. optionsNonNull.outStream) {
  895. const s = optionsNonNull.failOnStdErr
  896. ? optionsNonNull.errStream
  897. : optionsNonNull.outStream;
  898. s.write(data);
  899. }
  900. this._processLineBuffer(data, errbuffer, (line) => {
  901. if (this.options.listeners && this.options.listeners.errline) {
  902. this.options.listeners.errline(line);
  903. }
  904. });
  905. });
  906. }
  907. cp.on('error', (err) => {
  908. state.processError = err.message;
  909. state.processExited = true;
  910. state.processClosed = true;
  911. state.CheckComplete();
  912. });
  913. cp.on('exit', (code) => {
  914. state.processExitCode = code;
  915. state.processExited = true;
  916. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  917. state.CheckComplete();
  918. });
  919. cp.on('close', (code) => {
  920. state.processExitCode = code;
  921. state.processExited = true;
  922. state.processClosed = true;
  923. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  924. state.CheckComplete();
  925. });
  926. state.on('done', (error, exitCode) => {
  927. if (stdbuffer.length > 0) {
  928. this.emit('stdline', stdbuffer);
  929. }
  930. if (errbuffer.length > 0) {
  931. this.emit('errline', errbuffer);
  932. }
  933. cp.removeAllListeners();
  934. if (error) {
  935. reject(error);
  936. }
  937. else {
  938. resolve(exitCode);
  939. }
  940. });
  941. });
  942. });
  943. }
  944. }
  945. exports.ToolRunner = ToolRunner;
  946. /**
  947. * Convert an arg string to an array of args. Handles escaping
  948. *
  949. * @param argString string of arguments
  950. * @returns string[] array of arguments
  951. */
  952. function argStringToArray(argString) {
  953. const args = [];
  954. let inQuotes = false;
  955. let escaped = false;
  956. let arg = '';
  957. function append(c) {
  958. // we only escape double quotes.
  959. if (escaped && c !== '"') {
  960. arg += '\\';
  961. }
  962. arg += c;
  963. escaped = false;
  964. }
  965. for (let i = 0; i < argString.length; i++) {
  966. const c = argString.charAt(i);
  967. if (c === '"') {
  968. if (!escaped) {
  969. inQuotes = !inQuotes;
  970. }
  971. else {
  972. append(c);
  973. }
  974. continue;
  975. }
  976. if (c === '\\' && escaped) {
  977. append(c);
  978. continue;
  979. }
  980. if (c === '\\' && inQuotes) {
  981. escaped = true;
  982. continue;
  983. }
  984. if (c === ' ' && !inQuotes) {
  985. if (arg.length > 0) {
  986. args.push(arg);
  987. arg = '';
  988. }
  989. continue;
  990. }
  991. append(c);
  992. }
  993. if (arg.length > 0) {
  994. args.push(arg.trim());
  995. }
  996. return args;
  997. }
  998. exports.argStringToArray = argStringToArray;
  999. class ExecState extends events.EventEmitter {
  1000. constructor(options, toolPath) {
  1001. super();
  1002. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  1003. this.processError = '';
  1004. this.processExitCode = 0;
  1005. this.processExited = false; // tracks whether the process has exited
  1006. this.processStderr = false; // tracks whether stderr was written to
  1007. this.delay = 10000; // 10 seconds
  1008. this.done = false;
  1009. this.timeout = null;
  1010. if (!toolPath) {
  1011. throw new Error('toolPath must not be empty');
  1012. }
  1013. this.options = options;
  1014. this.toolPath = toolPath;
  1015. if (options.delay) {
  1016. this.delay = options.delay;
  1017. }
  1018. }
  1019. CheckComplete() {
  1020. if (this.done) {
  1021. return;
  1022. }
  1023. if (this.processClosed) {
  1024. this._setResult();
  1025. }
  1026. else if (this.processExited) {
  1027. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  1028. }
  1029. }
  1030. _debug(message) {
  1031. this.emit('debug', message);
  1032. }
  1033. _setResult() {
  1034. // determine whether there is an error
  1035. let error;
  1036. if (this.processExited) {
  1037. if (this.processError) {
  1038. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  1039. }
  1040. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  1041. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  1042. }
  1043. else if (this.processStderr && this.options.failOnStdErr) {
  1044. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  1045. }
  1046. }
  1047. // clear the timeout
  1048. if (this.timeout) {
  1049. clearTimeout(this.timeout);
  1050. this.timeout = null;
  1051. }
  1052. this.done = true;
  1053. this.emit('done', error, this.processExitCode);
  1054. }
  1055. static HandleTimeout(state) {
  1056. if (state.done) {
  1057. return;
  1058. }
  1059. if (!state.processClosed && state.processExited) {
  1060. const message = `The STDIO streams did not close within ${state.delay /
  1061. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  1062. state._debug(message);
  1063. }
  1064. state._setResult();
  1065. }
  1066. }
  1067. //# sourceMappingURL=toolrunner.js.map
  1068. /***/ }),
  1069. /***/ 11:
  1070. /***/ (function(module) {
  1071. // Returns a wrapper function that returns a wrapped callback
  1072. // The wrapper function should do some stuff, and return a
  1073. // presumably different callback function.
  1074. // This makes sure that own properties are retained, so that
  1075. // decorations and such are not lost along the way.
  1076. module.exports = wrappy
  1077. function wrappy (fn, cb) {
  1078. if (fn && cb) return wrappy(fn)(cb)
  1079. if (typeof fn !== 'function')
  1080. throw new TypeError('need wrapper function')
  1081. Object.keys(fn).forEach(function (k) {
  1082. wrapper[k] = fn[k]
  1083. })
  1084. return wrapper
  1085. function wrapper() {
  1086. var args = new Array(arguments.length)
  1087. for (var i = 0; i < args.length; i++) {
  1088. args[i] = arguments[i]
  1089. }
  1090. var ret = fn.apply(this, args)
  1091. var cb = args[args.length-1]
  1092. if (typeof ret === 'function' && ret !== cb) {
  1093. Object.keys(cb).forEach(function (k) {
  1094. ret[k] = cb[k]
  1095. })
  1096. }
  1097. return ret
  1098. }
  1099. }
  1100. /***/ }),
  1101. /***/ 16:
  1102. /***/ (function(module) {
  1103. module.exports = require("tls");
  1104. /***/ }),
  1105. /***/ 18:
  1106. /***/ (function() {
  1107. eval("require")("encoding");
  1108. /***/ }),
  1109. /***/ 19:
  1110. /***/ (function(module, __unusedexports, __webpack_require__) {
  1111. module.exports = authenticationPlugin;
  1112. const { Deprecation } = __webpack_require__(692);
  1113. const once = __webpack_require__(969);
  1114. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1115. const authenticate = __webpack_require__(674);
  1116. const beforeRequest = __webpack_require__(471);
  1117. const requestError = __webpack_require__(349);
  1118. function authenticationPlugin(octokit, options) {
  1119. if (options.auth) {
  1120. octokit.authenticate = () => {
  1121. deprecateAuthenticate(
  1122. octokit.log,
  1123. new Deprecation(
  1124. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1125. )
  1126. );
  1127. };
  1128. return;
  1129. }
  1130. const state = {
  1131. octokit,
  1132. auth: false
  1133. };
  1134. octokit.authenticate = authenticate.bind(null, state);
  1135. octokit.hook.before("request", beforeRequest.bind(null, state));
  1136. octokit.hook.error("request", requestError.bind(null, state));
  1137. }
  1138. /***/ }),
  1139. /***/ 20:
  1140. /***/ (function(module, __unusedexports, __webpack_require__) {
  1141. "use strict";
  1142. const cp = __webpack_require__(129);
  1143. const parse = __webpack_require__(568);
  1144. const enoent = __webpack_require__(881);
  1145. function spawn(command, args, options) {
  1146. // Parse the arguments
  1147. const parsed = parse(command, args, options);
  1148. // Spawn the child process
  1149. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1150. // Hook into child process "exit" event to emit an error if the command
  1151. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1152. enoent.hookChildProcess(spawned, parsed);
  1153. return spawned;
  1154. }
  1155. function spawnSync(command, args, options) {
  1156. // Parse the arguments
  1157. const parsed = parse(command, args, options);
  1158. // Spawn the child process
  1159. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1160. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1161. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1162. return result;
  1163. }
  1164. module.exports = spawn;
  1165. module.exports.spawn = spawn;
  1166. module.exports.sync = spawnSync;
  1167. module.exports._parse = parse;
  1168. module.exports._enoent = enoent;
  1169. /***/ }),
  1170. /***/ 34:
  1171. /***/ (function(module) {
  1172. module.exports = require("https");
  1173. /***/ }),
  1174. /***/ 39:
  1175. /***/ (function(module) {
  1176. "use strict";
  1177. module.exports = opts => {
  1178. opts = opts || {};
  1179. const env = opts.env || process.env;
  1180. const platform = opts.platform || process.platform;
  1181. if (platform !== 'win32') {
  1182. return 'PATH';
  1183. }
  1184. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1185. };
  1186. /***/ }),
  1187. /***/ 47:
  1188. /***/ (function(module, __unusedexports, __webpack_require__) {
  1189. module.exports = factory;
  1190. const Octokit = __webpack_require__(402);
  1191. const registerPlugin = __webpack_require__(855);
  1192. function factory(plugins) {
  1193. const Api = Octokit.bind(null, plugins || []);
  1194. Api.plugin = registerPlugin.bind(null, plugins || []);
  1195. return Api;
  1196. }
  1197. /***/ }),
  1198. /***/ 49:
  1199. /***/ (function(module, __unusedexports, __webpack_require__) {
  1200. "use strict";
  1201. const os = __webpack_require__(87);
  1202. const execa = __webpack_require__(955);
  1203. // Reference: https://www.gaijin.at/en/lstwinver.php
  1204. const names = new Map([
  1205. ['10.0', '10'],
  1206. ['6.3', '8.1'],
  1207. ['6.2', '8'],
  1208. ['6.1', '7'],
  1209. ['6.0', 'Vista'],
  1210. ['5.2', 'Server 2003'],
  1211. ['5.1', 'XP'],
  1212. ['5.0', '2000'],
  1213. ['4.9', 'ME'],
  1214. ['4.1', '98'],
  1215. ['4.0', '95']
  1216. ]);
  1217. const windowsRelease = release => {
  1218. const version = /\d+\.\d/.exec(release || os.release());
  1219. if (release && !version) {
  1220. throw new Error('`release` argument doesn\'t match `n.n`');
  1221. }
  1222. const ver = (version || [])[0];
  1223. // Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
  1224. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1225. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1226. // If `wmic` is obsoloete (later versions of Windows 10), use PowerShell instead.
  1227. // If the resulting caption contains the year 2008, 2012, 2016 or 2019, it is a server version, so return a server OS name.
  1228. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1229. let stdout;
  1230. try {
  1231. stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
  1232. } catch (_) {
  1233. stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1234. }
  1235. const year = (stdout.match(/2008|2012|2016|2019/) || [])[0];
  1236. if (year) {
  1237. return `Server ${year}`;
  1238. }
  1239. }
  1240. return names.get(ver);
  1241. };
  1242. module.exports = windowsRelease;
  1243. /***/ }),
  1244. /***/ 81:
  1245. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1246. "use strict";
  1247. var __importStar = (this && this.__importStar) || function (mod) {
  1248. if (mod && mod.__esModule) return mod;
  1249. var result = {};
  1250. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1251. result["default"] = mod;
  1252. return result;
  1253. };
  1254. Object.defineProperty(exports, "__esModule", { value: true });
  1255. const assert = __importStar(__webpack_require__(357));
  1256. const url_1 = __webpack_require__(835);
  1257. function getFetchUrl(settings) {
  1258. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1259. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1260. const serviceUrl = getServerUrl();
  1261. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1262. const encodedName = encodeURIComponent(settings.repositoryName);
  1263. if (settings.sshKey) {
  1264. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1265. }
  1266. // "origin" is SCHEME://HOSTNAME[:PORT]
  1267. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1268. }
  1269. exports.getFetchUrl = getFetchUrl;
  1270. function getServerUrl() {
  1271. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  1272. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  1273. process.env['GITHUB_URL'] ||
  1274. 'https://github.com');
  1275. }
  1276. exports.getServerUrl = getServerUrl;
  1277. /***/ }),
  1278. /***/ 87:
  1279. /***/ (function(module) {
  1280. module.exports = require("os");
  1281. /***/ }),
  1282. /***/ 118:
  1283. /***/ (function(module, __unusedexports, __webpack_require__) {
  1284. "use strict";
  1285. const os = __webpack_require__(87);
  1286. const nameMap = new Map([
  1287. [19, 'Catalina'],
  1288. [18, 'Mojave'],
  1289. [17, 'High Sierra'],
  1290. [16, 'Sierra'],
  1291. [15, 'El Capitan'],
  1292. [14, 'Yosemite'],
  1293. [13, 'Mavericks'],
  1294. [12, 'Mountain Lion'],
  1295. [11, 'Lion'],
  1296. [10, 'Snow Leopard'],
  1297. [9, 'Leopard'],
  1298. [8, 'Tiger'],
  1299. [7, 'Panther'],
  1300. [6, 'Jaguar'],
  1301. [5, 'Puma']
  1302. ]);
  1303. const macosRelease = release => {
  1304. release = Number((release || os.release()).split('.')[0]);
  1305. return {
  1306. name: nameMap.get(release),
  1307. version: '10.' + (release - 4)
  1308. };
  1309. };
  1310. module.exports = macosRelease;
  1311. // TODO: remove this in the next major version
  1312. module.exports.default = macosRelease;
  1313. /***/ }),
  1314. /***/ 126:
  1315. /***/ (function(module) {
  1316. /**
  1317. * lodash (Custom Build) <https://lodash.com/>
  1318. * Build: `lodash modularize exports="npm" -o ./`
  1319. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1320. * Released under MIT license <https://lodash.com/license>
  1321. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1322. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1323. */
  1324. /** Used as the size to enable large array optimizations. */
  1325. var LARGE_ARRAY_SIZE = 200;
  1326. /** Used to stand-in for `undefined` hash values. */
  1327. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1328. /** Used as references for various `Number` constants. */
  1329. var INFINITY = 1 / 0;
  1330. /** `Object#toString` result references. */
  1331. var funcTag = '[object Function]',
  1332. genTag = '[object GeneratorFunction]';
  1333. /**
  1334. * Used to match `RegExp`
  1335. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1336. */
  1337. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1338. /** Used to detect host constructors (Safari). */
  1339. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1340. /** Detect free variable `global` from Node.js. */
  1341. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1342. /** Detect free variable `self`. */
  1343. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1344. /** Used as a reference to the global object. */
  1345. var root = freeGlobal || freeSelf || Function('return this')();
  1346. /**
  1347. * A specialized version of `_.includes` for arrays without support for
  1348. * specifying an index to search from.
  1349. *
  1350. * @private
  1351. * @param {Array} [array] The array to inspect.
  1352. * @param {*} target The value to search for.
  1353. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1354. */
  1355. function arrayIncludes(array, value) {
  1356. var length = array ? array.length : 0;
  1357. return !!length && baseIndexOf(array, value, 0) > -1;
  1358. }
  1359. /**
  1360. * This function is like `arrayIncludes` except that it accepts a comparator.
  1361. *
  1362. * @private
  1363. * @param {Array} [array] The array to inspect.
  1364. * @param {*} target The value to search for.
  1365. * @param {Function} comparator The comparator invoked per element.
  1366. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1367. */
  1368. function arrayIncludesWith(array, value, comparator) {
  1369. var index = -1,
  1370. length = array ? array.length : 0;
  1371. while (++index < length) {
  1372. if (comparator(value, array[index])) {
  1373. return true;
  1374. }
  1375. }
  1376. return false;
  1377. }
  1378. /**
  1379. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1380. * support for iteratee shorthands.
  1381. *
  1382. * @private
  1383. * @param {Array} array The array to inspect.
  1384. * @param {Function} predicate The function invoked per iteration.
  1385. * @param {number} fromIndex The index to search from.
  1386. * @param {boolean} [fromRight] Specify iterating from right to left.
  1387. * @returns {number} Returns the index of the matched value, else `-1`.
  1388. */
  1389. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1390. var length = array.length,
  1391. index = fromIndex + (fromRight ? 1 : -1);
  1392. while ((fromRight ? index-- : ++index < length)) {
  1393. if (predicate(array[index], index, array)) {
  1394. return index;
  1395. }
  1396. }
  1397. return -1;
  1398. }
  1399. /**
  1400. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1401. *
  1402. * @private
  1403. * @param {Array} array The array to inspect.
  1404. * @param {*} value The value to search for.
  1405. * @param {number} fromIndex The index to search from.
  1406. * @returns {number} Returns the index of the matched value, else `-1`.
  1407. */
  1408. function baseIndexOf(array, value, fromIndex) {
  1409. if (value !== value) {
  1410. return baseFindIndex(array, baseIsNaN, fromIndex);
  1411. }
  1412. var index = fromIndex - 1,
  1413. length = array.length;
  1414. while (++index < length) {
  1415. if (array[index] === value) {
  1416. return index;
  1417. }
  1418. }
  1419. return -1;
  1420. }
  1421. /**
  1422. * The base implementation of `_.isNaN` without support for number objects.
  1423. *
  1424. * @private
  1425. * @param {*} value The value to check.
  1426. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1427. */
  1428. function baseIsNaN(value) {
  1429. return value !== value;
  1430. }
  1431. /**
  1432. * Checks if a cache value for `key` exists.
  1433. *
  1434. * @private
  1435. * @param {Object} cache The cache to query.
  1436. * @param {string} key The key of the entry to check.
  1437. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1438. */
  1439. function cacheHas(cache, key) {
  1440. return cache.has(key);
  1441. }
  1442. /**
  1443. * Gets the value at `key` of `object`.
  1444. *
  1445. * @private
  1446. * @param {Object} [object] The object to query.
  1447. * @param {string} key The key of the property to get.
  1448. * @returns {*} Returns the property value.
  1449. */
  1450. function getValue(object, key) {
  1451. return object == null ? undefined : object[key];
  1452. }
  1453. /**
  1454. * Checks if `value` is a host object in IE < 9.
  1455. *
  1456. * @private
  1457. * @param {*} value The value to check.
  1458. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1459. */
  1460. function isHostObject(value) {
  1461. // Many host objects are `Object` objects that can coerce to strings
  1462. // despite having improperly defined `toString` methods.
  1463. var result = false;
  1464. if (value != null && typeof value.toString != 'function') {
  1465. try {
  1466. result = !!(value + '');
  1467. } catch (e) {}
  1468. }
  1469. return result;
  1470. }
  1471. /**
  1472. * Converts `set` to an array of its values.
  1473. *
  1474. * @private
  1475. * @param {Object} set The set to convert.
  1476. * @returns {Array} Returns the values.
  1477. */
  1478. function setToArray(set) {
  1479. var index = -1,
  1480. result = Array(set.size);
  1481. set.forEach(function(value) {
  1482. result[++index] = value;
  1483. });
  1484. return result;
  1485. }
  1486. /** Used for built-in method references. */
  1487. var arrayProto = Array.prototype,
  1488. funcProto = Function.prototype,
  1489. objectProto = Object.prototype;
  1490. /** Used to detect overreaching core-js shims. */
  1491. var coreJsData = root['__core-js_shared__'];
  1492. /** Used to detect methods masquerading as native. */
  1493. var maskSrcKey = (function() {
  1494. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1495. return uid ? ('Symbol(src)_1.' + uid) : '';
  1496. }());
  1497. /** Used to resolve the decompiled source of functions. */
  1498. var funcToString = funcProto.toString;
  1499. /** Used to check objects for own properties. */
  1500. var hasOwnProperty = objectProto.hasOwnProperty;
  1501. /**
  1502. * Used to resolve the
  1503. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1504. * of values.
  1505. */
  1506. var objectToString = objectProto.toString;
  1507. /** Used to detect if a method is native. */
  1508. var reIsNative = RegExp('^' +
  1509. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1510. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1511. );
  1512. /** Built-in value references. */
  1513. var splice = arrayProto.splice;
  1514. /* Built-in method references that are verified to be native. */
  1515. var Map = getNative(root, 'Map'),
  1516. Set = getNative(root, 'Set'),
  1517. nativeCreate = getNative(Object, 'create');
  1518. /**
  1519. * Creates a hash object.
  1520. *
  1521. * @private
  1522. * @constructor
  1523. * @param {Array} [entries] The key-value pairs to cache.
  1524. */
  1525. function Hash(entries) {
  1526. var index = -1,
  1527. length = entries ? entries.length : 0;
  1528. this.clear();
  1529. while (++index < length) {
  1530. var entry = entries[index];
  1531. this.set(entry[0], entry[1]);
  1532. }
  1533. }
  1534. /**
  1535. * Removes all key-value entries from the hash.
  1536. *
  1537. * @private
  1538. * @name clear
  1539. * @memberOf Hash
  1540. */
  1541. function hashClear() {
  1542. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1543. }
  1544. /**
  1545. * Removes `key` and its value from the hash.
  1546. *
  1547. * @private
  1548. * @name delete
  1549. * @memberOf Hash
  1550. * @param {Object} hash The hash to modify.
  1551. * @param {string} key The key of the value to remove.
  1552. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1553. */
  1554. function hashDelete(key) {
  1555. return this.has(key) && delete this.__data__[key];
  1556. }
  1557. /**
  1558. * Gets the hash value for `key`.
  1559. *
  1560. * @private
  1561. * @name get
  1562. * @memberOf Hash
  1563. * @param {string} key The key of the value to get.
  1564. * @returns {*} Returns the entry value.
  1565. */
  1566. function hashGet(key) {
  1567. var data = this.__data__;
  1568. if (nativeCreate) {
  1569. var result = data[key];
  1570. return result === HASH_UNDEFINED ? undefined : result;
  1571. }
  1572. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1573. }
  1574. /**
  1575. * Checks if a hash value for `key` exists.
  1576. *
  1577. * @private
  1578. * @name has
  1579. * @memberOf Hash
  1580. * @param {string} key The key of the entry to check.
  1581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1582. */
  1583. function hashHas(key) {
  1584. var data = this.__data__;
  1585. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1586. }
  1587. /**
  1588. * Sets the hash `key` to `value`.
  1589. *
  1590. * @private
  1591. * @name set
  1592. * @memberOf Hash
  1593. * @param {string} key The key of the value to set.
  1594. * @param {*} value The value to set.
  1595. * @returns {Object} Returns the hash instance.
  1596. */
  1597. function hashSet(key, value) {
  1598. var data = this.__data__;
  1599. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1600. return this;
  1601. }
  1602. // Add methods to `Hash`.
  1603. Hash.prototype.clear = hashClear;
  1604. Hash.prototype['delete'] = hashDelete;
  1605. Hash.prototype.get = hashGet;
  1606. Hash.prototype.has = hashHas;
  1607. Hash.prototype.set = hashSet;
  1608. /**
  1609. * Creates an list cache object.
  1610. *
  1611. * @private
  1612. * @constructor
  1613. * @param {Array} [entries] The key-value pairs to cache.
  1614. */
  1615. function ListCache(entries) {
  1616. var index = -1,
  1617. length = entries ? entries.length : 0;
  1618. this.clear();
  1619. while (++index < length) {
  1620. var entry = entries[index];
  1621. this.set(entry[0], entry[1]);
  1622. }
  1623. }
  1624. /**
  1625. * Removes all key-value entries from the list cache.
  1626. *
  1627. * @private
  1628. * @name clear
  1629. * @memberOf ListCache
  1630. */
  1631. function listCacheClear() {
  1632. this.__data__ = [];
  1633. }
  1634. /**
  1635. * Removes `key` and its value from the list cache.
  1636. *
  1637. * @private
  1638. * @name delete
  1639. * @memberOf ListCache
  1640. * @param {string} key The key of the value to remove.
  1641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1642. */
  1643. function listCacheDelete(key) {
  1644. var data = this.__data__,
  1645. index = assocIndexOf(data, key);
  1646. if (index < 0) {
  1647. return false;
  1648. }
  1649. var lastIndex = data.length - 1;
  1650. if (index == lastIndex) {
  1651. data.pop();
  1652. } else {
  1653. splice.call(data, index, 1);
  1654. }
  1655. return true;
  1656. }
  1657. /**
  1658. * Gets the list cache value for `key`.
  1659. *
  1660. * @private
  1661. * @name get
  1662. * @memberOf ListCache
  1663. * @param {string} key The key of the value to get.
  1664. * @returns {*} Returns the entry value.
  1665. */
  1666. function listCacheGet(key) {
  1667. var data = this.__data__,
  1668. index = assocIndexOf(data, key);
  1669. return index < 0 ? undefined : data[index][1];
  1670. }
  1671. /**
  1672. * Checks if a list cache value for `key` exists.
  1673. *
  1674. * @private
  1675. * @name has
  1676. * @memberOf ListCache
  1677. * @param {string} key The key of the entry to check.
  1678. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1679. */
  1680. function listCacheHas(key) {
  1681. return assocIndexOf(this.__data__, key) > -1;
  1682. }
  1683. /**
  1684. * Sets the list cache `key` to `value`.
  1685. *
  1686. * @private
  1687. * @name set
  1688. * @memberOf ListCache
  1689. * @param {string} key The key of the value to set.
  1690. * @param {*} value The value to set.
  1691. * @returns {Object} Returns the list cache instance.
  1692. */
  1693. function listCacheSet(key, value) {
  1694. var data = this.__data__,
  1695. index = assocIndexOf(data, key);
  1696. if (index < 0) {
  1697. data.push([key, value]);
  1698. } else {
  1699. data[index][1] = value;
  1700. }
  1701. return this;
  1702. }
  1703. // Add methods to `ListCache`.
  1704. ListCache.prototype.clear = listCacheClear;
  1705. ListCache.prototype['delete'] = listCacheDelete;
  1706. ListCache.prototype.get = listCacheGet;
  1707. ListCache.prototype.has = listCacheHas;
  1708. ListCache.prototype.set = listCacheSet;
  1709. /**
  1710. * Creates a map cache object to store key-value pairs.
  1711. *
  1712. * @private
  1713. * @constructor
  1714. * @param {Array} [entries] The key-value pairs to cache.
  1715. */
  1716. function MapCache(entries) {
  1717. var index = -1,
  1718. length = entries ? entries.length : 0;
  1719. this.clear();
  1720. while (++index < length) {
  1721. var entry = entries[index];
  1722. this.set(entry[0], entry[1]);
  1723. }
  1724. }
  1725. /**
  1726. * Removes all key-value entries from the map.
  1727. *
  1728. * @private
  1729. * @name clear
  1730. * @memberOf MapCache
  1731. */
  1732. function mapCacheClear() {
  1733. this.__data__ = {
  1734. 'hash': new Hash,
  1735. 'map': new (Map || ListCache),
  1736. 'string': new Hash
  1737. };
  1738. }
  1739. /**
  1740. * Removes `key` and its value from the map.
  1741. *
  1742. * @private
  1743. * @name delete
  1744. * @memberOf MapCache
  1745. * @param {string} key The key of the value to remove.
  1746. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1747. */
  1748. function mapCacheDelete(key) {
  1749. return getMapData(this, key)['delete'](key);
  1750. }
  1751. /**
  1752. * Gets the map value for `key`.
  1753. *
  1754. * @private
  1755. * @name get
  1756. * @memberOf MapCache
  1757. * @param {string} key The key of the value to get.
  1758. * @returns {*} Returns the entry value.
  1759. */
  1760. function mapCacheGet(key) {
  1761. return getMapData(this, key).get(key);
  1762. }
  1763. /**
  1764. * Checks if a map value for `key` exists.
  1765. *
  1766. * @private
  1767. * @name has
  1768. * @memberOf MapCache
  1769. * @param {string} key The key of the entry to check.
  1770. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1771. */
  1772. function mapCacheHas(key) {
  1773. return getMapData(this, key).has(key);
  1774. }
  1775. /**
  1776. * Sets the map `key` to `value`.
  1777. *
  1778. * @private
  1779. * @name set
  1780. * @memberOf MapCache
  1781. * @param {string} key The key of the value to set.
  1782. * @param {*} value The value to set.
  1783. * @returns {Object} Returns the map cache instance.
  1784. */
  1785. function mapCacheSet(key, value) {
  1786. getMapData(this, key).set(key, value);
  1787. return this;
  1788. }
  1789. // Add methods to `MapCache`.
  1790. MapCache.prototype.clear = mapCacheClear;
  1791. MapCache.prototype['delete'] = mapCacheDelete;
  1792. MapCache.prototype.get = mapCacheGet;
  1793. MapCache.prototype.has = mapCacheHas;
  1794. MapCache.prototype.set = mapCacheSet;
  1795. /**
  1796. *
  1797. * Creates an array cache object to store unique values.
  1798. *
  1799. * @private
  1800. * @constructor
  1801. * @param {Array} [values] The values to cache.
  1802. */
  1803. function SetCache(values) {
  1804. var index = -1,
  1805. length = values ? values.length : 0;
  1806. this.__data__ = new MapCache;
  1807. while (++index < length) {
  1808. this.add(values[index]);
  1809. }
  1810. }
  1811. /**
  1812. * Adds `value` to the array cache.
  1813. *
  1814. * @private
  1815. * @name add
  1816. * @memberOf SetCache
  1817. * @alias push
  1818. * @param {*} value The value to cache.
  1819. * @returns {Object} Returns the cache instance.
  1820. */
  1821. function setCacheAdd(value) {
  1822. this.__data__.set(value, HASH_UNDEFINED);
  1823. return this;
  1824. }
  1825. /**
  1826. * Checks if `value` is in the array cache.
  1827. *
  1828. * @private
  1829. * @name has
  1830. * @memberOf SetCache
  1831. * @param {*} value The value to search for.
  1832. * @returns {number} Returns `true` if `value` is found, else `false`.
  1833. */
  1834. function setCacheHas(value) {
  1835. return this.__data__.has(value);
  1836. }
  1837. // Add methods to `SetCache`.
  1838. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1839. SetCache.prototype.has = setCacheHas;
  1840. /**
  1841. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1842. *
  1843. * @private
  1844. * @param {Array} array The array to inspect.
  1845. * @param {*} key The key to search for.
  1846. * @returns {number} Returns the index of the matched value, else `-1`.
  1847. */
  1848. function assocIndexOf(array, key) {
  1849. var length = array.length;
  1850. while (length--) {
  1851. if (eq(array[length][0], key)) {
  1852. return length;
  1853. }
  1854. }
  1855. return -1;
  1856. }
  1857. /**
  1858. * The base implementation of `_.isNative` without bad shim checks.
  1859. *
  1860. * @private
  1861. * @param {*} value The value to check.
  1862. * @returns {boolean} Returns `true` if `value` is a native function,
  1863. * else `false`.
  1864. */
  1865. function baseIsNative(value) {
  1866. if (!isObject(value) || isMasked(value)) {
  1867. return false;
  1868. }
  1869. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1870. return pattern.test(toSource(value));
  1871. }
  1872. /**
  1873. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {Function} [iteratee] The iteratee invoked per element.
  1878. * @param {Function} [comparator] The comparator invoked per element.
  1879. * @returns {Array} Returns the new duplicate free array.
  1880. */
  1881. function baseUniq(array, iteratee, comparator) {
  1882. var index = -1,
  1883. includes = arrayIncludes,
  1884. length = array.length,
  1885. isCommon = true,
  1886. result = [],
  1887. seen = result;
  1888. if (comparator) {
  1889. isCommon = false;
  1890. includes = arrayIncludesWith;
  1891. }
  1892. else if (length >= LARGE_ARRAY_SIZE) {
  1893. var set = iteratee ? null : createSet(array);
  1894. if (set) {
  1895. return setToArray(set);
  1896. }
  1897. isCommon = false;
  1898. includes = cacheHas;
  1899. seen = new SetCache;
  1900. }
  1901. else {
  1902. seen = iteratee ? [] : result;
  1903. }
  1904. outer:
  1905. while (++index < length) {
  1906. var value = array[index],
  1907. computed = iteratee ? iteratee(value) : value;
  1908. value = (comparator || value !== 0) ? value : 0;
  1909. if (isCommon && computed === computed) {
  1910. var seenIndex = seen.length;
  1911. while (seenIndex--) {
  1912. if (seen[seenIndex] === computed) {
  1913. continue outer;
  1914. }
  1915. }
  1916. if (iteratee) {
  1917. seen.push(computed);
  1918. }
  1919. result.push(value);
  1920. }
  1921. else if (!includes(seen, computed, comparator)) {
  1922. if (seen !== result) {
  1923. seen.push(computed);
  1924. }
  1925. result.push(value);
  1926. }
  1927. }
  1928. return result;
  1929. }
  1930. /**
  1931. * Creates a set object of `values`.
  1932. *
  1933. * @private
  1934. * @param {Array} values The values to add to the set.
  1935. * @returns {Object} Returns the new set.
  1936. */
  1937. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1938. return new Set(values);
  1939. };
  1940. /**
  1941. * Gets the data for `map`.
  1942. *
  1943. * @private
  1944. * @param {Object} map The map to query.
  1945. * @param {string} key The reference key.
  1946. * @returns {*} Returns the map data.
  1947. */
  1948. function getMapData(map, key) {
  1949. var data = map.__data__;
  1950. return isKeyable(key)
  1951. ? data[typeof key == 'string' ? 'string' : 'hash']
  1952. : data.map;
  1953. }
  1954. /**
  1955. * Gets the native function at `key` of `object`.
  1956. *
  1957. * @private
  1958. * @param {Object} object The object to query.
  1959. * @param {string} key The key of the method to get.
  1960. * @returns {*} Returns the function if it's native, else `undefined`.
  1961. */
  1962. function getNative(object, key) {
  1963. var value = getValue(object, key);
  1964. return baseIsNative(value) ? value : undefined;
  1965. }
  1966. /**
  1967. * Checks if `value` is suitable for use as unique object key.
  1968. *
  1969. * @private
  1970. * @param {*} value The value to check.
  1971. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1972. */
  1973. function isKeyable(value) {
  1974. var type = typeof value;
  1975. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1976. ? (value !== '__proto__')
  1977. : (value === null);
  1978. }
  1979. /**
  1980. * Checks if `func` has its source masked.
  1981. *
  1982. * @private
  1983. * @param {Function} func The function to check.
  1984. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1985. */
  1986. function isMasked(func) {
  1987. return !!maskSrcKey && (maskSrcKey in func);
  1988. }
  1989. /**
  1990. * Converts `func` to its source code.
  1991. *
  1992. * @private
  1993. * @param {Function} func The function to process.
  1994. * @returns {string} Returns the source code.
  1995. */
  1996. function toSource(func) {
  1997. if (func != null) {
  1998. try {
  1999. return funcToString.call(func);
  2000. } catch (e) {}
  2001. try {
  2002. return (func + '');
  2003. } catch (e) {}
  2004. }
  2005. return '';
  2006. }
  2007. /**
  2008. * Creates a duplicate-free version of an array, using
  2009. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2010. * for equality comparisons, in which only the first occurrence of each
  2011. * element is kept.
  2012. *
  2013. * @static
  2014. * @memberOf _
  2015. * @since 0.1.0
  2016. * @category Array
  2017. * @param {Array} array The array to inspect.
  2018. * @returns {Array} Returns the new duplicate free array.
  2019. * @example
  2020. *
  2021. * _.uniq([2, 1, 2]);
  2022. * // => [2, 1]
  2023. */
  2024. function uniq(array) {
  2025. return (array && array.length)
  2026. ? baseUniq(array)
  2027. : [];
  2028. }
  2029. /**
  2030. * Performs a
  2031. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2032. * comparison between two values to determine if they are equivalent.
  2033. *
  2034. * @static
  2035. * @memberOf _
  2036. * @since 4.0.0
  2037. * @category Lang
  2038. * @param {*} value The value to compare.
  2039. * @param {*} other The other value to compare.
  2040. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2041. * @example
  2042. *
  2043. * var object = { 'a': 1 };
  2044. * var other = { 'a': 1 };
  2045. *
  2046. * _.eq(object, object);
  2047. * // => true
  2048. *
  2049. * _.eq(object, other);
  2050. * // => false
  2051. *
  2052. * _.eq('a', 'a');
  2053. * // => true
  2054. *
  2055. * _.eq('a', Object('a'));
  2056. * // => false
  2057. *
  2058. * _.eq(NaN, NaN);
  2059. * // => true
  2060. */
  2061. function eq(value, other) {
  2062. return value === other || (value !== value && other !== other);
  2063. }
  2064. /**
  2065. * Checks if `value` is classified as a `Function` object.
  2066. *
  2067. * @static
  2068. * @memberOf _
  2069. * @since 0.1.0
  2070. * @category Lang
  2071. * @param {*} value The value to check.
  2072. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2073. * @example
  2074. *
  2075. * _.isFunction(_);
  2076. * // => true
  2077. *
  2078. * _.isFunction(/abc/);
  2079. * // => false
  2080. */
  2081. function isFunction(value) {
  2082. // The use of `Object#toString` avoids issues with the `typeof` operator
  2083. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2084. var tag = isObject(value) ? objectToString.call(value) : '';
  2085. return tag == funcTag || tag == genTag;
  2086. }
  2087. /**
  2088. * Checks if `value` is the
  2089. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2090. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2091. *
  2092. * @static
  2093. * @memberOf _
  2094. * @since 0.1.0
  2095. * @category Lang
  2096. * @param {*} value The value to check.
  2097. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2098. * @example
  2099. *
  2100. * _.isObject({});
  2101. * // => true
  2102. *
  2103. * _.isObject([1, 2, 3]);
  2104. * // => true
  2105. *
  2106. * _.isObject(_.noop);
  2107. * // => true
  2108. *
  2109. * _.isObject(null);
  2110. * // => false
  2111. */
  2112. function isObject(value) {
  2113. var type = typeof value;
  2114. return !!value && (type == 'object' || type == 'function');
  2115. }
  2116. /**
  2117. * This method returns `undefined`.
  2118. *
  2119. * @static
  2120. * @memberOf _
  2121. * @since 2.3.0
  2122. * @category Util
  2123. * @example
  2124. *
  2125. * _.times(2, _.noop);
  2126. * // => [undefined, undefined]
  2127. */
  2128. function noop() {
  2129. // No operation performed.
  2130. }
  2131. module.exports = uniq;
  2132. /***/ }),
  2133. /***/ 129:
  2134. /***/ (function(module) {
  2135. module.exports = require("child_process");
  2136. /***/ }),
  2137. /***/ 139:
  2138. /***/ (function(module, __unusedexports, __webpack_require__) {
  2139. // Unique ID creation requires a high quality random # generator. In node.js
  2140. // this is pretty straight-forward - we use the crypto API.
  2141. var crypto = __webpack_require__(417);
  2142. module.exports = function nodeRNG() {
  2143. return crypto.randomBytes(16);
  2144. };
  2145. /***/ }),
  2146. /***/ 141:
  2147. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2148. "use strict";
  2149. var net = __webpack_require__(631);
  2150. var tls = __webpack_require__(16);
  2151. var http = __webpack_require__(605);
  2152. var https = __webpack_require__(34);
  2153. var events = __webpack_require__(614);
  2154. var assert = __webpack_require__(357);
  2155. var util = __webpack_require__(669);
  2156. exports.httpOverHttp = httpOverHttp;
  2157. exports.httpsOverHttp = httpsOverHttp;
  2158. exports.httpOverHttps = httpOverHttps;
  2159. exports.httpsOverHttps = httpsOverHttps;
  2160. function httpOverHttp(options) {
  2161. var agent = new TunnelingAgent(options);
  2162. agent.request = http.request;
  2163. return agent;
  2164. }
  2165. function httpsOverHttp(options) {
  2166. var agent = new TunnelingAgent(options);
  2167. agent.request = http.request;
  2168. agent.createSocket = createSecureSocket;
  2169. return agent;
  2170. }
  2171. function httpOverHttps(options) {
  2172. var agent = new TunnelingAgent(options);
  2173. agent.request = https.request;
  2174. return agent;
  2175. }
  2176. function httpsOverHttps(options) {
  2177. var agent = new TunnelingAgent(options);
  2178. agent.request = https.request;
  2179. agent.createSocket = createSecureSocket;
  2180. return agent;
  2181. }
  2182. function TunnelingAgent(options) {
  2183. var self = this;
  2184. self.options = options || {};
  2185. self.proxyOptions = self.options.proxy || {};
  2186. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2187. self.requests = [];
  2188. self.sockets = [];
  2189. self.on('free', function onFree(socket, host, port, localAddress) {
  2190. var options = toOptions(host, port, localAddress);
  2191. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2192. var pending = self.requests[i];
  2193. if (pending.host === options.host && pending.port === options.port) {
  2194. // Detect the request to connect same origin server,
  2195. // reuse the connection.
  2196. self.requests.splice(i, 1);
  2197. pending.request.onSocket(socket);
  2198. return;
  2199. }
  2200. }
  2201. socket.destroy();
  2202. self.removeSocket(socket);
  2203. });
  2204. }
  2205. util.inherits(TunnelingAgent, events.EventEmitter);
  2206. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2207. var self = this;
  2208. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2209. if (self.sockets.length >= this.maxSockets) {
  2210. // We are over limit so we'll add it to the queue.
  2211. self.requests.push(options);
  2212. return;
  2213. }
  2214. // If we are under maxSockets create a new one.
  2215. self.createSocket(options, function(socket) {
  2216. socket.on('free', onFree);
  2217. socket.on('close', onCloseOrRemove);
  2218. socket.on('agentRemove', onCloseOrRemove);
  2219. req.onSocket(socket);
  2220. function onFree() {
  2221. self.emit('free', socket, options);
  2222. }
  2223. function onCloseOrRemove(err) {
  2224. self.removeSocket(socket);
  2225. socket.removeListener('free', onFree);
  2226. socket.removeListener('close', onCloseOrRemove);
  2227. socket.removeListener('agentRemove', onCloseOrRemove);
  2228. }
  2229. });
  2230. };
  2231. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2232. var self = this;
  2233. var placeholder = {};
  2234. self.sockets.push(placeholder);
  2235. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2236. method: 'CONNECT',
  2237. path: options.host + ':' + options.port,
  2238. agent: false
  2239. });
  2240. if (connectOptions.proxyAuth) {
  2241. connectOptions.headers = connectOptions.headers || {};
  2242. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2243. new Buffer(connectOptions.proxyAuth).toString('base64');
  2244. }
  2245. debug('making CONNECT request');
  2246. var connectReq = self.request(connectOptions);
  2247. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2248. connectReq.once('response', onResponse); // for v0.6
  2249. connectReq.once('upgrade', onUpgrade); // for v0.6
  2250. connectReq.once('connect', onConnect); // for v0.7 or later
  2251. connectReq.once('error', onError);
  2252. connectReq.end();
  2253. function onResponse(res) {
  2254. // Very hacky. This is necessary to avoid http-parser leaks.
  2255. res.upgrade = true;
  2256. }
  2257. function onUpgrade(res, socket, head) {
  2258. // Hacky.
  2259. process.nextTick(function() {
  2260. onConnect(res, socket, head);
  2261. });
  2262. }
  2263. function onConnect(res, socket, head) {
  2264. connectReq.removeAllListeners();
  2265. socket.removeAllListeners();
  2266. if (res.statusCode === 200) {
  2267. assert.equal(head.length, 0);
  2268. debug('tunneling connection has established');
  2269. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2270. cb(socket);
  2271. } else {
  2272. debug('tunneling socket could not be established, statusCode=%d',
  2273. res.statusCode);
  2274. var error = new Error('tunneling socket could not be established, ' +
  2275. 'statusCode=' + res.statusCode);
  2276. error.code = 'ECONNRESET';
  2277. options.request.emit('error', error);
  2278. self.removeSocket(placeholder);
  2279. }
  2280. }
  2281. function onError(cause) {
  2282. connectReq.removeAllListeners();
  2283. debug('tunneling socket could not be established, cause=%s\n',
  2284. cause.message, cause.stack);
  2285. var error = new Error('tunneling socket could not be established, ' +
  2286. 'cause=' + cause.message);
  2287. error.code = 'ECONNRESET';
  2288. options.request.emit('error', error);
  2289. self.removeSocket(placeholder);
  2290. }
  2291. };
  2292. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2293. var pos = this.sockets.indexOf(socket)
  2294. if (pos === -1) {
  2295. return;
  2296. }
  2297. this.sockets.splice(pos, 1);
  2298. var pending = this.requests.shift();
  2299. if (pending) {
  2300. // If we have pending requests and a socket gets closed a new one
  2301. // needs to be created to take over in the pool for the one that closed.
  2302. this.createSocket(pending, function(socket) {
  2303. pending.request.onSocket(socket);
  2304. });
  2305. }
  2306. };
  2307. function createSecureSocket(options, cb) {
  2308. var self = this;
  2309. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2310. var hostHeader = options.request.getHeader('host');
  2311. var tlsOptions = mergeOptions({}, self.options, {
  2312. socket: socket,
  2313. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2314. });
  2315. // 0 is dummy port for v0.6
  2316. var secureSocket = tls.connect(0, tlsOptions);
  2317. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2318. cb(secureSocket);
  2319. });
  2320. }
  2321. function toOptions(host, port, localAddress) {
  2322. if (typeof host === 'string') { // since v0.10
  2323. return {
  2324. host: host,
  2325. port: port,
  2326. localAddress: localAddress
  2327. };
  2328. }
  2329. return host; // for v0.11 or later
  2330. }
  2331. function mergeOptions(target) {
  2332. for (var i = 1, len = arguments.length; i < len; ++i) {
  2333. var overrides = arguments[i];
  2334. if (typeof overrides === 'object') {
  2335. var keys = Object.keys(overrides);
  2336. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2337. var k = keys[j];
  2338. if (overrides[k] !== undefined) {
  2339. target[k] = overrides[k];
  2340. }
  2341. }
  2342. }
  2343. }
  2344. return target;
  2345. }
  2346. var debug;
  2347. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2348. debug = function() {
  2349. var args = Array.prototype.slice.call(arguments);
  2350. if (typeof args[0] === 'string') {
  2351. args[0] = 'TUNNEL: ' + args[0];
  2352. } else {
  2353. args.unshift('TUNNEL:');
  2354. }
  2355. console.error.apply(console, args);
  2356. }
  2357. } else {
  2358. debug = function() {};
  2359. }
  2360. exports.debug = debug; // for test
  2361. /***/ }),
  2362. /***/ 143:
  2363. /***/ (function(module, __unusedexports, __webpack_require__) {
  2364. module.exports = withAuthorizationPrefix;
  2365. const atob = __webpack_require__(368);
  2366. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2367. function withAuthorizationPrefix(authorization) {
  2368. if (/^(basic|bearer|token) /i.test(authorization)) {
  2369. return authorization;
  2370. }
  2371. try {
  2372. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2373. return `basic ${authorization}`;
  2374. }
  2375. } catch (error) {}
  2376. if (authorization.split(/\./).length === 3) {
  2377. return `bearer ${authorization}`;
  2378. }
  2379. return `token ${authorization}`;
  2380. }
  2381. /***/ }),
  2382. /***/ 145:
  2383. /***/ (function(module, __unusedexports, __webpack_require__) {
  2384. "use strict";
  2385. const pump = __webpack_require__(453);
  2386. const bufferStream = __webpack_require__(966);
  2387. class MaxBufferError extends Error {
  2388. constructor() {
  2389. super('maxBuffer exceeded');
  2390. this.name = 'MaxBufferError';
  2391. }
  2392. }
  2393. function getStream(inputStream, options) {
  2394. if (!inputStream) {
  2395. return Promise.reject(new Error('Expected a stream'));
  2396. }
  2397. options = Object.assign({maxBuffer: Infinity}, options);
  2398. const {maxBuffer} = options;
  2399. let stream;
  2400. return new Promise((resolve, reject) => {
  2401. const rejectPromise = error => {
  2402. if (error) { // A null check
  2403. error.bufferedData = stream.getBufferedValue();
  2404. }
  2405. reject(error);
  2406. };
  2407. stream = pump(inputStream, bufferStream(options), error => {
  2408. if (error) {
  2409. rejectPromise(error);
  2410. return;
  2411. }
  2412. resolve();
  2413. });
  2414. stream.on('data', () => {
  2415. if (stream.getBufferedLength() > maxBuffer) {
  2416. rejectPromise(new MaxBufferError());
  2417. }
  2418. });
  2419. }).then(() => stream.getBufferedValue());
  2420. }
  2421. module.exports = getStream;
  2422. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2423. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2424. module.exports.MaxBufferError = MaxBufferError;
  2425. /***/ }),
  2426. /***/ 148:
  2427. /***/ (function(module, __unusedexports, __webpack_require__) {
  2428. module.exports = paginatePlugin;
  2429. const { paginateRest } = __webpack_require__(299);
  2430. function paginatePlugin(octokit) {
  2431. Object.assign(octokit, paginateRest(octokit));
  2432. }
  2433. /***/ }),
  2434. /***/ 153:
  2435. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2436. "use strict";
  2437. var __importStar = (this && this.__importStar) || function (mod) {
  2438. if (mod && mod.__esModule) return mod;
  2439. var result = {};
  2440. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2441. result["default"] = mod;
  2442. return result;
  2443. };
  2444. Object.defineProperty(exports, "__esModule", { value: true });
  2445. const coreCommand = __importStar(__webpack_require__(431));
  2446. /**
  2447. * Indicates whether the POST action is running
  2448. */
  2449. exports.IsPost = !!process.env['STATE_isPost'];
  2450. /**
  2451. * The repository path for the POST action. The value is empty during the MAIN action.
  2452. */
  2453. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2454. /**
  2455. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2456. */
  2457. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2458. /**
  2459. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2460. */
  2461. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2462. /**
  2463. * Save the repository path so the POST action can retrieve the value.
  2464. */
  2465. function setRepositoryPath(repositoryPath) {
  2466. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2467. }
  2468. exports.setRepositoryPath = setRepositoryPath;
  2469. /**
  2470. * Save the SSH key path so the POST action can retrieve the value.
  2471. */
  2472. function setSshKeyPath(sshKeyPath) {
  2473. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2474. }
  2475. exports.setSshKeyPath = setSshKeyPath;
  2476. /**
  2477. * Save the SSH known hosts path so the POST action can retrieve the value.
  2478. */
  2479. function setSshKnownHostsPath(sshKnownHostsPath) {
  2480. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2481. }
  2482. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2483. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2484. // This is necessary since we don't have a separate entry point.
  2485. if (!exports.IsPost) {
  2486. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2487. }
  2488. /***/ }),
  2489. /***/ 168:
  2490. /***/ (function(module) {
  2491. "use strict";
  2492. const alias = ['stdin', 'stdout', 'stderr'];
  2493. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2494. module.exports = opts => {
  2495. if (!opts) {
  2496. return null;
  2497. }
  2498. if (opts.stdio && hasAlias(opts)) {
  2499. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2500. }
  2501. if (typeof opts.stdio === 'string') {
  2502. return opts.stdio;
  2503. }
  2504. const stdio = opts.stdio || [];
  2505. if (!Array.isArray(stdio)) {
  2506. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2507. }
  2508. const result = [];
  2509. const len = Math.max(stdio.length, alias.length);
  2510. for (let i = 0; i < len; i++) {
  2511. let value = null;
  2512. if (stdio[i] !== undefined) {
  2513. value = stdio[i];
  2514. } else if (opts[alias[i]] !== undefined) {
  2515. value = opts[alias[i]];
  2516. }
  2517. result[i] = value;
  2518. }
  2519. return result;
  2520. };
  2521. /***/ }),
  2522. /***/ 179:
  2523. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2524. "use strict";
  2525. var net = __webpack_require__(631);
  2526. var tls = __webpack_require__(16);
  2527. var http = __webpack_require__(605);
  2528. var https = __webpack_require__(34);
  2529. var events = __webpack_require__(614);
  2530. var assert = __webpack_require__(357);
  2531. var util = __webpack_require__(669);
  2532. exports.httpOverHttp = httpOverHttp;
  2533. exports.httpsOverHttp = httpsOverHttp;
  2534. exports.httpOverHttps = httpOverHttps;
  2535. exports.httpsOverHttps = httpsOverHttps;
  2536. function httpOverHttp(options) {
  2537. var agent = new TunnelingAgent(options);
  2538. agent.request = http.request;
  2539. return agent;
  2540. }
  2541. function httpsOverHttp(options) {
  2542. var agent = new TunnelingAgent(options);
  2543. agent.request = http.request;
  2544. agent.createSocket = createSecureSocket;
  2545. agent.defaultPort = 443;
  2546. return agent;
  2547. }
  2548. function httpOverHttps(options) {
  2549. var agent = new TunnelingAgent(options);
  2550. agent.request = https.request;
  2551. return agent;
  2552. }
  2553. function httpsOverHttps(options) {
  2554. var agent = new TunnelingAgent(options);
  2555. agent.request = https.request;
  2556. agent.createSocket = createSecureSocket;
  2557. agent.defaultPort = 443;
  2558. return agent;
  2559. }
  2560. function TunnelingAgent(options) {
  2561. var self = this;
  2562. self.options = options || {};
  2563. self.proxyOptions = self.options.proxy || {};
  2564. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2565. self.requests = [];
  2566. self.sockets = [];
  2567. self.on('free', function onFree(socket, host, port, localAddress) {
  2568. var options = toOptions(host, port, localAddress);
  2569. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2570. var pending = self.requests[i];
  2571. if (pending.host === options.host && pending.port === options.port) {
  2572. // Detect the request to connect same origin server,
  2573. // reuse the connection.
  2574. self.requests.splice(i, 1);
  2575. pending.request.onSocket(socket);
  2576. return;
  2577. }
  2578. }
  2579. socket.destroy();
  2580. self.removeSocket(socket);
  2581. });
  2582. }
  2583. util.inherits(TunnelingAgent, events.EventEmitter);
  2584. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2585. var self = this;
  2586. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2587. if (self.sockets.length >= this.maxSockets) {
  2588. // We are over limit so we'll add it to the queue.
  2589. self.requests.push(options);
  2590. return;
  2591. }
  2592. // If we are under maxSockets create a new one.
  2593. self.createSocket(options, function(socket) {
  2594. socket.on('free', onFree);
  2595. socket.on('close', onCloseOrRemove);
  2596. socket.on('agentRemove', onCloseOrRemove);
  2597. req.onSocket(socket);
  2598. function onFree() {
  2599. self.emit('free', socket, options);
  2600. }
  2601. function onCloseOrRemove(err) {
  2602. self.removeSocket(socket);
  2603. socket.removeListener('free', onFree);
  2604. socket.removeListener('close', onCloseOrRemove);
  2605. socket.removeListener('agentRemove', onCloseOrRemove);
  2606. }
  2607. });
  2608. };
  2609. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2610. var self = this;
  2611. var placeholder = {};
  2612. self.sockets.push(placeholder);
  2613. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2614. method: 'CONNECT',
  2615. path: options.host + ':' + options.port,
  2616. agent: false,
  2617. headers: {
  2618. host: options.host + ':' + options.port
  2619. }
  2620. });
  2621. if (options.localAddress) {
  2622. connectOptions.localAddress = options.localAddress;
  2623. }
  2624. if (connectOptions.proxyAuth) {
  2625. connectOptions.headers = connectOptions.headers || {};
  2626. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2627. new Buffer(connectOptions.proxyAuth).toString('base64');
  2628. }
  2629. debug('making CONNECT request');
  2630. var connectReq = self.request(connectOptions);
  2631. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2632. connectReq.once('response', onResponse); // for v0.6
  2633. connectReq.once('upgrade', onUpgrade); // for v0.6
  2634. connectReq.once('connect', onConnect); // for v0.7 or later
  2635. connectReq.once('error', onError);
  2636. connectReq.end();
  2637. function onResponse(res) {
  2638. // Very hacky. This is necessary to avoid http-parser leaks.
  2639. res.upgrade = true;
  2640. }
  2641. function onUpgrade(res, socket, head) {
  2642. // Hacky.
  2643. process.nextTick(function() {
  2644. onConnect(res, socket, head);
  2645. });
  2646. }
  2647. function onConnect(res, socket, head) {
  2648. connectReq.removeAllListeners();
  2649. socket.removeAllListeners();
  2650. if (res.statusCode !== 200) {
  2651. debug('tunneling socket could not be established, statusCode=%d',
  2652. res.statusCode);
  2653. socket.destroy();
  2654. var error = new Error('tunneling socket could not be established, ' +
  2655. 'statusCode=' + res.statusCode);
  2656. error.code = 'ECONNRESET';
  2657. options.request.emit('error', error);
  2658. self.removeSocket(placeholder);
  2659. return;
  2660. }
  2661. if (head.length > 0) {
  2662. debug('got illegal response body from proxy');
  2663. socket.destroy();
  2664. var error = new Error('got illegal response body from proxy');
  2665. error.code = 'ECONNRESET';
  2666. options.request.emit('error', error);
  2667. self.removeSocket(placeholder);
  2668. return;
  2669. }
  2670. debug('tunneling connection has established');
  2671. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2672. return cb(socket);
  2673. }
  2674. function onError(cause) {
  2675. connectReq.removeAllListeners();
  2676. debug('tunneling socket could not be established, cause=%s\n',
  2677. cause.message, cause.stack);
  2678. var error = new Error('tunneling socket could not be established, ' +
  2679. 'cause=' + cause.message);
  2680. error.code = 'ECONNRESET';
  2681. options.request.emit('error', error);
  2682. self.removeSocket(placeholder);
  2683. }
  2684. };
  2685. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2686. var pos = this.sockets.indexOf(socket)
  2687. if (pos === -1) {
  2688. return;
  2689. }
  2690. this.sockets.splice(pos, 1);
  2691. var pending = this.requests.shift();
  2692. if (pending) {
  2693. // If we have pending requests and a socket gets closed a new one
  2694. // needs to be created to take over in the pool for the one that closed.
  2695. this.createSocket(pending, function(socket) {
  2696. pending.request.onSocket(socket);
  2697. });
  2698. }
  2699. };
  2700. function createSecureSocket(options, cb) {
  2701. var self = this;
  2702. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2703. var hostHeader = options.request.getHeader('host');
  2704. var tlsOptions = mergeOptions({}, self.options, {
  2705. socket: socket,
  2706. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2707. });
  2708. // 0 is dummy port for v0.6
  2709. var secureSocket = tls.connect(0, tlsOptions);
  2710. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2711. cb(secureSocket);
  2712. });
  2713. }
  2714. function toOptions(host, port, localAddress) {
  2715. if (typeof host === 'string') { // since v0.10
  2716. return {
  2717. host: host,
  2718. port: port,
  2719. localAddress: localAddress
  2720. };
  2721. }
  2722. return host; // for v0.11 or later
  2723. }
  2724. function mergeOptions(target) {
  2725. for (var i = 1, len = arguments.length; i < len; ++i) {
  2726. var overrides = arguments[i];
  2727. if (typeof overrides === 'object') {
  2728. var keys = Object.keys(overrides);
  2729. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2730. var k = keys[j];
  2731. if (overrides[k] !== undefined) {
  2732. target[k] = overrides[k];
  2733. }
  2734. }
  2735. }
  2736. }
  2737. return target;
  2738. }
  2739. var debug;
  2740. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2741. debug = function() {
  2742. var args = Array.prototype.slice.call(arguments);
  2743. if (typeof args[0] === 'string') {
  2744. args[0] = 'TUNNEL: ' + args[0];
  2745. } else {
  2746. args.unshift('TUNNEL:');
  2747. }
  2748. console.error.apply(console, args);
  2749. }
  2750. } else {
  2751. debug = function() {};
  2752. }
  2753. exports.debug = debug; // for test
  2754. /***/ }),
  2755. /***/ 190:
  2756. /***/ (function(module, __unusedexports, __webpack_require__) {
  2757. module.exports = authenticationPlugin;
  2758. const { createTokenAuth } = __webpack_require__(813);
  2759. const { Deprecation } = __webpack_require__(692);
  2760. const once = __webpack_require__(969);
  2761. const beforeRequest = __webpack_require__(863);
  2762. const requestError = __webpack_require__(991);
  2763. const validate = __webpack_require__(954);
  2764. const withAuthorizationPrefix = __webpack_require__(143);
  2765. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2766. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2767. function authenticationPlugin(octokit, options) {
  2768. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2769. if (options.authStrategy) {
  2770. const auth = options.authStrategy(options.auth);
  2771. octokit.hook.wrap("request", auth.hook);
  2772. octokit.auth = auth;
  2773. return;
  2774. }
  2775. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2776. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2777. if (!options.auth) {
  2778. octokit.auth = () =>
  2779. Promise.resolve({
  2780. type: "unauthenticated"
  2781. });
  2782. return;
  2783. }
  2784. const isBasicAuthString =
  2785. typeof options.auth === "string" &&
  2786. /^basic/.test(withAuthorizationPrefix(options.auth));
  2787. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2788. if (typeof options.auth === "string" && !isBasicAuthString) {
  2789. const auth = createTokenAuth(options.auth);
  2790. octokit.hook.wrap("request", auth.hook);
  2791. octokit.auth = auth;
  2792. return;
  2793. }
  2794. // Otherwise log a deprecation message
  2795. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2796. ? [
  2797. deprecateAuthBasic,
  2798. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2799. ]
  2800. : [
  2801. deprecateAuthObject,
  2802. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2803. ];
  2804. deprecationMethod(
  2805. octokit.log,
  2806. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2807. );
  2808. octokit.auth = () =>
  2809. Promise.resolve({
  2810. type: "deprecated",
  2811. message: deprecationMessapge
  2812. });
  2813. validate(options.auth);
  2814. const state = {
  2815. octokit,
  2816. auth: options.auth
  2817. };
  2818. octokit.hook.before("request", beforeRequest.bind(null, state));
  2819. octokit.hook.error("request", requestError.bind(null, state));
  2820. }
  2821. /***/ }),
  2822. /***/ 197:
  2823. /***/ (function(module, __unusedexports, __webpack_require__) {
  2824. module.exports = isexe
  2825. isexe.sync = sync
  2826. var fs = __webpack_require__(747)
  2827. function isexe (path, options, cb) {
  2828. fs.stat(path, function (er, stat) {
  2829. cb(er, er ? false : checkStat(stat, options))
  2830. })
  2831. }
  2832. function sync (path, options) {
  2833. return checkStat(fs.statSync(path), options)
  2834. }
  2835. function checkStat (stat, options) {
  2836. return stat.isFile() && checkMode(stat, options)
  2837. }
  2838. function checkMode (stat, options) {
  2839. var mod = stat.mode
  2840. var uid = stat.uid
  2841. var gid = stat.gid
  2842. var myUid = options.uid !== undefined ?
  2843. options.uid : process.getuid && process.getuid()
  2844. var myGid = options.gid !== undefined ?
  2845. options.gid : process.getgid && process.getgid()
  2846. var u = parseInt('100', 8)
  2847. var g = parseInt('010', 8)
  2848. var o = parseInt('001', 8)
  2849. var ug = u | g
  2850. var ret = (mod & o) ||
  2851. (mod & g) && gid === myGid ||
  2852. (mod & u) && uid === myUid ||
  2853. (mod & ug) && myUid === 0
  2854. return ret
  2855. }
  2856. /***/ }),
  2857. /***/ 198:
  2858. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2859. "use strict";
  2860. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2861. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2862. return new (P || (P = Promise))(function (resolve, reject) {
  2863. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2864. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2865. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2866. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2867. });
  2868. };
  2869. var __importStar = (this && this.__importStar) || function (mod) {
  2870. if (mod && mod.__esModule) return mod;
  2871. var result = {};
  2872. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2873. result["default"] = mod;
  2874. return result;
  2875. };
  2876. Object.defineProperty(exports, "__esModule", { value: true });
  2877. const core = __importStar(__webpack_require__(470));
  2878. const coreCommand = __importStar(__webpack_require__(431));
  2879. const gitSourceProvider = __importStar(__webpack_require__(293));
  2880. const inputHelper = __importStar(__webpack_require__(821));
  2881. const path = __importStar(__webpack_require__(622));
  2882. const stateHelper = __importStar(__webpack_require__(153));
  2883. function run() {
  2884. return __awaiter(this, void 0, void 0, function* () {
  2885. try {
  2886. const sourceSettings = inputHelper.getInputs();
  2887. try {
  2888. // Register problem matcher
  2889. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2890. // Get sources
  2891. yield gitSourceProvider.getSource(sourceSettings);
  2892. }
  2893. finally {
  2894. // Unregister problem matcher
  2895. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2896. }
  2897. }
  2898. catch (error) {
  2899. core.setFailed(error.message);
  2900. }
  2901. });
  2902. }
  2903. function cleanup() {
  2904. return __awaiter(this, void 0, void 0, function* () {
  2905. try {
  2906. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2907. }
  2908. catch (error) {
  2909. core.warning(error.message);
  2910. }
  2911. });
  2912. }
  2913. // Main
  2914. if (!stateHelper.IsPost) {
  2915. run();
  2916. }
  2917. // Post
  2918. else {
  2919. cleanup();
  2920. }
  2921. /***/ }),
  2922. /***/ 211:
  2923. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2924. "use strict";
  2925. Object.defineProperty(exports, '__esModule', { value: true });
  2926. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  2927. var osName = _interopDefault(__webpack_require__(2));
  2928. function getUserAgent() {
  2929. try {
  2930. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  2931. } catch (error) {
  2932. if (/wmic os get Caption/.test(error.message)) {
  2933. return "Windows <version undetectable>";
  2934. }
  2935. return "<environment undetectable>";
  2936. }
  2937. }
  2938. exports.getUserAgent = getUserAgent;
  2939. //# sourceMappingURL=index.js.map
  2940. /***/ }),
  2941. /***/ 215:
  2942. /***/ (function(module) {
  2943. module.exports = {"name":"@octokit/rest","version":"16.43.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/plugin-paginate-rest":"^1.1.1","@octokit/plugin-request-log":"^1.0.0","@octokit/plugin-rest-endpoint-methods":"2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^4.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","lolex":"^5.1.2","mkdirp":"^1.0.0","mocha":"^7.0.1","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^17.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.43.1.tgz","_integrity":"sha512-gfFKwRT/wFxq5qlNjnW2dh+qh74XgTQ2B179UX5K1HYCluioWj8Ndbgqw2PVqa1NnVJkGHp2ovMpVn/DImlmkw==","_from":"@octokit/rest@16.43.1"};
  2944. /***/ }),
  2945. /***/ 227:
  2946. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2947. "use strict";
  2948. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2949. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2950. return new (P || (P = Promise))(function (resolve, reject) {
  2951. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2952. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2953. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2954. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2955. });
  2956. };
  2957. var __importStar = (this && this.__importStar) || function (mod) {
  2958. if (mod && mod.__esModule) return mod;
  2959. var result = {};
  2960. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2961. result["default"] = mod;
  2962. return result;
  2963. };
  2964. Object.defineProperty(exports, "__esModule", { value: true });
  2965. const url_1 = __webpack_require__(835);
  2966. const core = __importStar(__webpack_require__(470));
  2967. const github = __importStar(__webpack_require__(469));
  2968. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  2969. function getCheckoutInfo(git, ref, commit) {
  2970. return __awaiter(this, void 0, void 0, function* () {
  2971. if (!git) {
  2972. throw new Error('Arg git cannot be empty');
  2973. }
  2974. if (!ref && !commit) {
  2975. throw new Error('Args ref and commit cannot both be empty');
  2976. }
  2977. const result = {};
  2978. const upperRef = (ref || '').toUpperCase();
  2979. // SHA only
  2980. if (!ref) {
  2981. result.ref = commit;
  2982. }
  2983. // refs/heads/
  2984. else if (upperRef.startsWith('REFS/HEADS/')) {
  2985. const branch = ref.substring('refs/heads/'.length);
  2986. result.ref = branch;
  2987. result.startPoint = `refs/remotes/origin/${branch}`;
  2988. }
  2989. // refs/pull/
  2990. else if (upperRef.startsWith('REFS/PULL/')) {
  2991. const branch = ref.substring('refs/pull/'.length);
  2992. result.ref = `refs/remotes/pull/${branch}`;
  2993. }
  2994. // refs/tags/
  2995. else if (upperRef.startsWith('REFS/')) {
  2996. result.ref = ref;
  2997. }
  2998. // Unqualified ref, check for a matching branch or tag
  2999. else {
  3000. if (yield git.branchExists(true, `origin/${ref}`)) {
  3001. result.ref = ref;
  3002. result.startPoint = `refs/remotes/origin/${ref}`;
  3003. }
  3004. else if (yield git.tagExists(`${ref}`)) {
  3005. result.ref = `refs/tags/${ref}`;
  3006. }
  3007. else {
  3008. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3009. }
  3010. }
  3011. return result;
  3012. });
  3013. }
  3014. exports.getCheckoutInfo = getCheckoutInfo;
  3015. function getRefSpecForAllHistory(ref, commit) {
  3016. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3017. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3018. const branch = ref.substring('refs/pull/'.length);
  3019. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3020. }
  3021. return result;
  3022. }
  3023. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3024. function getRefSpec(ref, commit) {
  3025. if (!ref && !commit) {
  3026. throw new Error('Args ref and commit cannot both be empty');
  3027. }
  3028. const upperRef = (ref || '').toUpperCase();
  3029. // SHA
  3030. if (commit) {
  3031. // refs/heads
  3032. if (upperRef.startsWith('REFS/HEADS/')) {
  3033. const branch = ref.substring('refs/heads/'.length);
  3034. return [`+${commit}:refs/remotes/origin/${branch}`];
  3035. }
  3036. // refs/pull/
  3037. else if (upperRef.startsWith('REFS/PULL/')) {
  3038. const branch = ref.substring('refs/pull/'.length);
  3039. return [`+${commit}:refs/remotes/pull/${branch}`];
  3040. }
  3041. // refs/tags/
  3042. else if (upperRef.startsWith('REFS/TAGS/')) {
  3043. return [`+${commit}:${ref}`];
  3044. }
  3045. // Otherwise no destination ref
  3046. else {
  3047. return [commit];
  3048. }
  3049. }
  3050. // Unqualified ref, check for a matching branch or tag
  3051. else if (!upperRef.startsWith('REFS/')) {
  3052. return [
  3053. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3054. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3055. ];
  3056. }
  3057. // refs/heads/
  3058. else if (upperRef.startsWith('REFS/HEADS/')) {
  3059. const branch = ref.substring('refs/heads/'.length);
  3060. return [`+${ref}:refs/remotes/origin/${branch}`];
  3061. }
  3062. // refs/pull/
  3063. else if (upperRef.startsWith('REFS/PULL/')) {
  3064. const branch = ref.substring('refs/pull/'.length);
  3065. return [`+${ref}:refs/remotes/pull/${branch}`];
  3066. }
  3067. // refs/tags/
  3068. else {
  3069. return [`+${ref}:${ref}`];
  3070. }
  3071. }
  3072. exports.getRefSpec = getRefSpec;
  3073. /**
  3074. * Tests whether the initial fetch created the ref at the expected commit
  3075. */
  3076. function testRef(git, ref, commit) {
  3077. return __awaiter(this, void 0, void 0, function* () {
  3078. if (!git) {
  3079. throw new Error('Arg git cannot be empty');
  3080. }
  3081. if (!ref && !commit) {
  3082. throw new Error('Args ref and commit cannot both be empty');
  3083. }
  3084. // No SHA? Nothing to test
  3085. if (!commit) {
  3086. return true;
  3087. }
  3088. // SHA only?
  3089. else if (!ref) {
  3090. return yield git.shaExists(commit);
  3091. }
  3092. const upperRef = ref.toUpperCase();
  3093. // refs/heads/
  3094. if (upperRef.startsWith('REFS/HEADS/')) {
  3095. const branch = ref.substring('refs/heads/'.length);
  3096. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3097. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3098. }
  3099. // refs/pull/
  3100. else if (upperRef.startsWith('REFS/PULL/')) {
  3101. // Assume matches because fetched using the commit
  3102. return true;
  3103. }
  3104. // refs/tags/
  3105. else if (upperRef.startsWith('REFS/TAGS/')) {
  3106. const tagName = ref.substring('refs/tags/'.length);
  3107. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3108. }
  3109. // Unexpected
  3110. else {
  3111. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3112. return true;
  3113. }
  3114. });
  3115. }
  3116. exports.testRef = testRef;
  3117. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3118. return __awaiter(this, void 0, void 0, function* () {
  3119. try {
  3120. // GHES?
  3121. if (isGhes()) {
  3122. return;
  3123. }
  3124. // Auth token?
  3125. if (!token) {
  3126. return;
  3127. }
  3128. // Public PR synchronize, for workflow repo?
  3129. if (fromPayload('repository.private') !== false ||
  3130. github.context.eventName !== 'pull_request' ||
  3131. fromPayload('action') !== 'synchronize' ||
  3132. repositoryOwner !== github.context.repo.owner ||
  3133. repositoryName !== github.context.repo.repo ||
  3134. ref !== github.context.ref ||
  3135. !ref.startsWith('refs/pull/') ||
  3136. commit !== github.context.sha) {
  3137. return;
  3138. }
  3139. // Head SHA
  3140. const expectedHeadSha = fromPayload('after');
  3141. if (!expectedHeadSha) {
  3142. core.debug('Unable to determine head sha');
  3143. return;
  3144. }
  3145. // Base SHA
  3146. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3147. if (!expectedBaseSha) {
  3148. core.debug('Unable to determine base sha');
  3149. return;
  3150. }
  3151. // Expected message?
  3152. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3153. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3154. return;
  3155. }
  3156. // Extract details from message
  3157. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3158. if (!match) {
  3159. core.debug('Unexpected message format');
  3160. return;
  3161. }
  3162. // Post telemetry
  3163. const actualHeadSha = match[1];
  3164. if (actualHeadSha !== expectedHeadSha) {
  3165. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3166. const octokit = new github.GitHub(token, {
  3167. userAgent: `actions-checkout-tracepoint/1.0 (code=STALE_MERGE;owner=${repositoryOwner};repo=${repositoryName};pr=${fromPayload('number')};run_id=${process.env['GITHUB_RUN_ID']};expected_head_sha=${expectedHeadSha};actual_head_sha=${actualHeadSha})`
  3168. });
  3169. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3170. }
  3171. }
  3172. catch (err) {
  3173. core.debug(`Error when validating commit info: ${err.stack}`);
  3174. }
  3175. });
  3176. }
  3177. exports.checkCommitInfo = checkCommitInfo;
  3178. function fromPayload(path) {
  3179. return select(github.context.payload, path);
  3180. }
  3181. function select(obj, path) {
  3182. if (!obj) {
  3183. return undefined;
  3184. }
  3185. const i = path.indexOf('.');
  3186. if (i < 0) {
  3187. return obj[path];
  3188. }
  3189. const key = path.substr(0, i);
  3190. return select(obj[key], path.substr(i + 1));
  3191. }
  3192. function isGhes() {
  3193. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3194. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3195. }
  3196. /***/ }),
  3197. /***/ 260:
  3198. /***/ (function(module, __unusedexports, __webpack_require__) {
  3199. // Note: since nyc uses this module to output coverage, any lines
  3200. // that are in the direct sync flow of nyc's outputCoverage are
  3201. // ignored, since we can never get coverage for them.
  3202. var assert = __webpack_require__(357)
  3203. var signals = __webpack_require__(654)
  3204. var EE = __webpack_require__(614)
  3205. /* istanbul ignore if */
  3206. if (typeof EE !== 'function') {
  3207. EE = EE.EventEmitter
  3208. }
  3209. var emitter
  3210. if (process.__signal_exit_emitter__) {
  3211. emitter = process.__signal_exit_emitter__
  3212. } else {
  3213. emitter = process.__signal_exit_emitter__ = new EE()
  3214. emitter.count = 0
  3215. emitter.emitted = {}
  3216. }
  3217. // Because this emitter is a global, we have to check to see if a
  3218. // previous version of this library failed to enable infinite listeners.
  3219. // I know what you're about to say. But literally everything about
  3220. // signal-exit is a compromise with evil. Get used to it.
  3221. if (!emitter.infinite) {
  3222. emitter.setMaxListeners(Infinity)
  3223. emitter.infinite = true
  3224. }
  3225. module.exports = function (cb, opts) {
  3226. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3227. if (loaded === false) {
  3228. load()
  3229. }
  3230. var ev = 'exit'
  3231. if (opts && opts.alwaysLast) {
  3232. ev = 'afterexit'
  3233. }
  3234. var remove = function () {
  3235. emitter.removeListener(ev, cb)
  3236. if (emitter.listeners('exit').length === 0 &&
  3237. emitter.listeners('afterexit').length === 0) {
  3238. unload()
  3239. }
  3240. }
  3241. emitter.on(ev, cb)
  3242. return remove
  3243. }
  3244. module.exports.unload = unload
  3245. function unload () {
  3246. if (!loaded) {
  3247. return
  3248. }
  3249. loaded = false
  3250. signals.forEach(function (sig) {
  3251. try {
  3252. process.removeListener(sig, sigListeners[sig])
  3253. } catch (er) {}
  3254. })
  3255. process.emit = originalProcessEmit
  3256. process.reallyExit = originalProcessReallyExit
  3257. emitter.count -= 1
  3258. }
  3259. function emit (event, code, signal) {
  3260. if (emitter.emitted[event]) {
  3261. return
  3262. }
  3263. emitter.emitted[event] = true
  3264. emitter.emit(event, code, signal)
  3265. }
  3266. // { <signal>: <listener fn>, ... }
  3267. var sigListeners = {}
  3268. signals.forEach(function (sig) {
  3269. sigListeners[sig] = function listener () {
  3270. // If there are no other listeners, an exit is coming!
  3271. // Simplest way: remove us and then re-send the signal.
  3272. // We know that this will kill the process, so we can
  3273. // safely emit now.
  3274. var listeners = process.listeners(sig)
  3275. if (listeners.length === emitter.count) {
  3276. unload()
  3277. emit('exit', null, sig)
  3278. /* istanbul ignore next */
  3279. emit('afterexit', null, sig)
  3280. /* istanbul ignore next */
  3281. process.kill(process.pid, sig)
  3282. }
  3283. }
  3284. })
  3285. module.exports.signals = function () {
  3286. return signals
  3287. }
  3288. module.exports.load = load
  3289. var loaded = false
  3290. function load () {
  3291. if (loaded) {
  3292. return
  3293. }
  3294. loaded = true
  3295. // This is the number of onSignalExit's that are in play.
  3296. // It's important so that we can count the correct number of
  3297. // listeners on signals, and don't wait for the other one to
  3298. // handle it instead of us.
  3299. emitter.count += 1
  3300. signals = signals.filter(function (sig) {
  3301. try {
  3302. process.on(sig, sigListeners[sig])
  3303. return true
  3304. } catch (er) {
  3305. return false
  3306. }
  3307. })
  3308. process.emit = processEmit
  3309. process.reallyExit = processReallyExit
  3310. }
  3311. var originalProcessReallyExit = process.reallyExit
  3312. function processReallyExit (code) {
  3313. process.exitCode = code || 0
  3314. emit('exit', process.exitCode, null)
  3315. /* istanbul ignore next */
  3316. emit('afterexit', process.exitCode, null)
  3317. /* istanbul ignore next */
  3318. originalProcessReallyExit.call(process, process.exitCode)
  3319. }
  3320. var originalProcessEmit = process.emit
  3321. function processEmit (ev, arg) {
  3322. if (ev === 'exit') {
  3323. if (arg !== undefined) {
  3324. process.exitCode = arg
  3325. }
  3326. var ret = originalProcessEmit.apply(this, arguments)
  3327. emit('exit', process.exitCode, null)
  3328. /* istanbul ignore next */
  3329. emit('afterexit', process.exitCode, null)
  3330. return ret
  3331. } else {
  3332. return originalProcessEmit.apply(this, arguments)
  3333. }
  3334. }
  3335. /***/ }),
  3336. /***/ 262:
  3337. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3338. "use strict";
  3339. Object.defineProperty(exports, "__esModule", { value: true });
  3340. const fs_1 = __webpack_require__(747);
  3341. const os_1 = __webpack_require__(87);
  3342. class Context {
  3343. /**
  3344. * Hydrate the context from the environment
  3345. */
  3346. constructor() {
  3347. this.payload = {};
  3348. if (process.env.GITHUB_EVENT_PATH) {
  3349. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3350. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3351. }
  3352. else {
  3353. const path = process.env.GITHUB_EVENT_PATH;
  3354. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3355. }
  3356. }
  3357. this.eventName = process.env.GITHUB_EVENT_NAME;
  3358. this.sha = process.env.GITHUB_SHA;
  3359. this.ref = process.env.GITHUB_REF;
  3360. this.workflow = process.env.GITHUB_WORKFLOW;
  3361. this.action = process.env.GITHUB_ACTION;
  3362. this.actor = process.env.GITHUB_ACTOR;
  3363. }
  3364. get issue() {
  3365. const payload = this.payload;
  3366. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3367. }
  3368. get repo() {
  3369. if (process.env.GITHUB_REPOSITORY) {
  3370. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3371. return { owner, repo };
  3372. }
  3373. if (this.payload.repository) {
  3374. return {
  3375. owner: this.payload.repository.owner.login,
  3376. repo: this.payload.repository.name
  3377. };
  3378. }
  3379. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3380. }
  3381. }
  3382. exports.Context = Context;
  3383. //# sourceMappingURL=context.js.map
  3384. /***/ }),
  3385. /***/ 265:
  3386. /***/ (function(module, __unusedexports, __webpack_require__) {
  3387. module.exports = getPage
  3388. const deprecate = __webpack_require__(370)
  3389. const getPageLinks = __webpack_require__(577)
  3390. const HttpError = __webpack_require__(297)
  3391. function getPage (octokit, link, which, headers) {
  3392. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  3393. const url = getPageLinks(link)[which]
  3394. if (!url) {
  3395. const urlError = new HttpError(`No ${which} page found`, 404)
  3396. return Promise.reject(urlError)
  3397. }
  3398. const requestOptions = {
  3399. url,
  3400. headers: applyAcceptHeader(link, headers)
  3401. }
  3402. const promise = octokit.request(requestOptions)
  3403. return promise
  3404. }
  3405. function applyAcceptHeader (res, headers) {
  3406. const previous = res.headers && res.headers['x-github-media-type']
  3407. if (!previous || (headers && headers.accept)) {
  3408. return headers
  3409. }
  3410. headers = headers || {}
  3411. headers.accept = 'application/vnd.' + previous
  3412. .replace('; param=', '.')
  3413. .replace('; format=', '+')
  3414. return headers
  3415. }
  3416. /***/ }),
  3417. /***/ 280:
  3418. /***/ (function(module, exports) {
  3419. exports = module.exports = SemVer
  3420. var debug
  3421. /* istanbul ignore next */
  3422. if (typeof process === 'object' &&
  3423. process.env &&
  3424. process.env.NODE_DEBUG &&
  3425. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3426. debug = function () {
  3427. var args = Array.prototype.slice.call(arguments, 0)
  3428. args.unshift('SEMVER')
  3429. console.log.apply(console, args)
  3430. }
  3431. } else {
  3432. debug = function () {}
  3433. }
  3434. // Note: this is the semver.org version of the spec that it implements
  3435. // Not necessarily the package version of this code.
  3436. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3437. var MAX_LENGTH = 256
  3438. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3439. /* istanbul ignore next */ 9007199254740991
  3440. // Max safe segment length for coercion.
  3441. var MAX_SAFE_COMPONENT_LENGTH = 16
  3442. // The actual regexps go on exports.re
  3443. var re = exports.re = []
  3444. var src = exports.src = []
  3445. var R = 0
  3446. // The following Regular Expressions can be used for tokenizing,
  3447. // validating, and parsing SemVer version strings.
  3448. // ## Numeric Identifier
  3449. // A single `0`, or a non-zero digit followed by zero or more digits.
  3450. var NUMERICIDENTIFIER = R++
  3451. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3452. var NUMERICIDENTIFIERLOOSE = R++
  3453. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3454. // ## Non-numeric Identifier
  3455. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3456. // more letters, digits, or hyphens.
  3457. var NONNUMERICIDENTIFIER = R++
  3458. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3459. // ## Main Version
  3460. // Three dot-separated numeric identifiers.
  3461. var MAINVERSION = R++
  3462. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3463. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3464. '(' + src[NUMERICIDENTIFIER] + ')'
  3465. var MAINVERSIONLOOSE = R++
  3466. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3467. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3468. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3469. // ## Pre-release Version Identifier
  3470. // A numeric identifier, or a non-numeric identifier.
  3471. var PRERELEASEIDENTIFIER = R++
  3472. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3473. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3474. var PRERELEASEIDENTIFIERLOOSE = R++
  3475. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3476. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3477. // ## Pre-release Version
  3478. // Hyphen, followed by one or more dot-separated pre-release version
  3479. // identifiers.
  3480. var PRERELEASE = R++
  3481. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3482. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3483. var PRERELEASELOOSE = R++
  3484. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3485. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3486. // ## Build Metadata Identifier
  3487. // Any combination of digits, letters, or hyphens.
  3488. var BUILDIDENTIFIER = R++
  3489. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3490. // ## Build Metadata
  3491. // Plus sign, followed by one or more period-separated build metadata
  3492. // identifiers.
  3493. var BUILD = R++
  3494. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3495. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3496. // ## Full Version String
  3497. // A main version, followed optionally by a pre-release version and
  3498. // build metadata.
  3499. // Note that the only major, minor, patch, and pre-release sections of
  3500. // the version string are capturing groups. The build metadata is not a
  3501. // capturing group, because it should not ever be used in version
  3502. // comparison.
  3503. var FULL = R++
  3504. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3505. src[PRERELEASE] + '?' +
  3506. src[BUILD] + '?'
  3507. src[FULL] = '^' + FULLPLAIN + '$'
  3508. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3509. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3510. // common in the npm registry.
  3511. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3512. src[PRERELEASELOOSE] + '?' +
  3513. src[BUILD] + '?'
  3514. var LOOSE = R++
  3515. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3516. var GTLT = R++
  3517. src[GTLT] = '((?:<|>)?=?)'
  3518. // Something like "2.*" or "1.2.x".
  3519. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3520. // Only the first item is strictly required.
  3521. var XRANGEIDENTIFIERLOOSE = R++
  3522. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3523. var XRANGEIDENTIFIER = R++
  3524. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3525. var XRANGEPLAIN = R++
  3526. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3527. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3528. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3529. '(?:' + src[PRERELEASE] + ')?' +
  3530. src[BUILD] + '?' +
  3531. ')?)?'
  3532. var XRANGEPLAINLOOSE = R++
  3533. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3534. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3535. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3536. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3537. src[BUILD] + '?' +
  3538. ')?)?'
  3539. var XRANGE = R++
  3540. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3541. var XRANGELOOSE = R++
  3542. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3543. // Coercion.
  3544. // Extract anything that could conceivably be a part of a valid semver
  3545. var COERCE = R++
  3546. src[COERCE] = '(?:^|[^\\d])' +
  3547. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3548. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3549. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3550. '(?:$|[^\\d])'
  3551. // Tilde ranges.
  3552. // Meaning is "reasonably at or greater than"
  3553. var LONETILDE = R++
  3554. src[LONETILDE] = '(?:~>?)'
  3555. var TILDETRIM = R++
  3556. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3557. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3558. var tildeTrimReplace = '$1~'
  3559. var TILDE = R++
  3560. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3561. var TILDELOOSE = R++
  3562. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3563. // Caret ranges.
  3564. // Meaning is "at least and backwards compatible with"
  3565. var LONECARET = R++
  3566. src[LONECARET] = '(?:\\^)'
  3567. var CARETTRIM = R++
  3568. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3569. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3570. var caretTrimReplace = '$1^'
  3571. var CARET = R++
  3572. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3573. var CARETLOOSE = R++
  3574. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3575. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3576. var COMPARATORLOOSE = R++
  3577. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3578. var COMPARATOR = R++
  3579. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3580. // An expression to strip any whitespace between the gtlt and the thing
  3581. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3582. var COMPARATORTRIM = R++
  3583. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3584. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3585. // this one has to use the /g flag
  3586. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3587. var comparatorTrimReplace = '$1$2$3'
  3588. // Something like `1.2.3 - 1.2.4`
  3589. // Note that these all use the loose form, because they'll be
  3590. // checked against either the strict or loose comparator form
  3591. // later.
  3592. var HYPHENRANGE = R++
  3593. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3594. '\\s+-\\s+' +
  3595. '(' + src[XRANGEPLAIN] + ')' +
  3596. '\\s*$'
  3597. var HYPHENRANGELOOSE = R++
  3598. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3599. '\\s+-\\s+' +
  3600. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3601. '\\s*$'
  3602. // Star ranges basically just allow anything at all.
  3603. var STAR = R++
  3604. src[STAR] = '(<|>)?=?\\s*\\*'
  3605. // Compile to actual regexp objects.
  3606. // All are flag-free, unless they were created above with a flag.
  3607. for (var i = 0; i < R; i++) {
  3608. debug(i, src[i])
  3609. if (!re[i]) {
  3610. re[i] = new RegExp(src[i])
  3611. }
  3612. }
  3613. exports.parse = parse
  3614. function parse (version, options) {
  3615. if (!options || typeof options !== 'object') {
  3616. options = {
  3617. loose: !!options,
  3618. includePrerelease: false
  3619. }
  3620. }
  3621. if (version instanceof SemVer) {
  3622. return version
  3623. }
  3624. if (typeof version !== 'string') {
  3625. return null
  3626. }
  3627. if (version.length > MAX_LENGTH) {
  3628. return null
  3629. }
  3630. var r = options.loose ? re[LOOSE] : re[FULL]
  3631. if (!r.test(version)) {
  3632. return null
  3633. }
  3634. try {
  3635. return new SemVer(version, options)
  3636. } catch (er) {
  3637. return null
  3638. }
  3639. }
  3640. exports.valid = valid
  3641. function valid (version, options) {
  3642. var v = parse(version, options)
  3643. return v ? v.version : null
  3644. }
  3645. exports.clean = clean
  3646. function clean (version, options) {
  3647. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3648. return s ? s.version : null
  3649. }
  3650. exports.SemVer = SemVer
  3651. function SemVer (version, options) {
  3652. if (!options || typeof options !== 'object') {
  3653. options = {
  3654. loose: !!options,
  3655. includePrerelease: false
  3656. }
  3657. }
  3658. if (version instanceof SemVer) {
  3659. if (version.loose === options.loose) {
  3660. return version
  3661. } else {
  3662. version = version.version
  3663. }
  3664. } else if (typeof version !== 'string') {
  3665. throw new TypeError('Invalid Version: ' + version)
  3666. }
  3667. if (version.length > MAX_LENGTH) {
  3668. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3669. }
  3670. if (!(this instanceof SemVer)) {
  3671. return new SemVer(version, options)
  3672. }
  3673. debug('SemVer', version, options)
  3674. this.options = options
  3675. this.loose = !!options.loose
  3676. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3677. if (!m) {
  3678. throw new TypeError('Invalid Version: ' + version)
  3679. }
  3680. this.raw = version
  3681. // these are actually numbers
  3682. this.major = +m[1]
  3683. this.minor = +m[2]
  3684. this.patch = +m[3]
  3685. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3686. throw new TypeError('Invalid major version')
  3687. }
  3688. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3689. throw new TypeError('Invalid minor version')
  3690. }
  3691. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3692. throw new TypeError('Invalid patch version')
  3693. }
  3694. // numberify any prerelease numeric ids
  3695. if (!m[4]) {
  3696. this.prerelease = []
  3697. } else {
  3698. this.prerelease = m[4].split('.').map(function (id) {
  3699. if (/^[0-9]+$/.test(id)) {
  3700. var num = +id
  3701. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3702. return num
  3703. }
  3704. }
  3705. return id
  3706. })
  3707. }
  3708. this.build = m[5] ? m[5].split('.') : []
  3709. this.format()
  3710. }
  3711. SemVer.prototype.format = function () {
  3712. this.version = this.major + '.' + this.minor + '.' + this.patch
  3713. if (this.prerelease.length) {
  3714. this.version += '-' + this.prerelease.join('.')
  3715. }
  3716. return this.version
  3717. }
  3718. SemVer.prototype.toString = function () {
  3719. return this.version
  3720. }
  3721. SemVer.prototype.compare = function (other) {
  3722. debug('SemVer.compare', this.version, this.options, other)
  3723. if (!(other instanceof SemVer)) {
  3724. other = new SemVer(other, this.options)
  3725. }
  3726. return this.compareMain(other) || this.comparePre(other)
  3727. }
  3728. SemVer.prototype.compareMain = function (other) {
  3729. if (!(other instanceof SemVer)) {
  3730. other = new SemVer(other, this.options)
  3731. }
  3732. return compareIdentifiers(this.major, other.major) ||
  3733. compareIdentifiers(this.minor, other.minor) ||
  3734. compareIdentifiers(this.patch, other.patch)
  3735. }
  3736. SemVer.prototype.comparePre = function (other) {
  3737. if (!(other instanceof SemVer)) {
  3738. other = new SemVer(other, this.options)
  3739. }
  3740. // NOT having a prerelease is > having one
  3741. if (this.prerelease.length && !other.prerelease.length) {
  3742. return -1
  3743. } else if (!this.prerelease.length && other.prerelease.length) {
  3744. return 1
  3745. } else if (!this.prerelease.length && !other.prerelease.length) {
  3746. return 0
  3747. }
  3748. var i = 0
  3749. do {
  3750. var a = this.prerelease[i]
  3751. var b = other.prerelease[i]
  3752. debug('prerelease compare', i, a, b)
  3753. if (a === undefined && b === undefined) {
  3754. return 0
  3755. } else if (b === undefined) {
  3756. return 1
  3757. } else if (a === undefined) {
  3758. return -1
  3759. } else if (a === b) {
  3760. continue
  3761. } else {
  3762. return compareIdentifiers(a, b)
  3763. }
  3764. } while (++i)
  3765. }
  3766. // preminor will bump the version up to the next minor release, and immediately
  3767. // down to pre-release. premajor and prepatch work the same way.
  3768. SemVer.prototype.inc = function (release, identifier) {
  3769. switch (release) {
  3770. case 'premajor':
  3771. this.prerelease.length = 0
  3772. this.patch = 0
  3773. this.minor = 0
  3774. this.major++
  3775. this.inc('pre', identifier)
  3776. break
  3777. case 'preminor':
  3778. this.prerelease.length = 0
  3779. this.patch = 0
  3780. this.minor++
  3781. this.inc('pre', identifier)
  3782. break
  3783. case 'prepatch':
  3784. // If this is already a prerelease, it will bump to the next version
  3785. // drop any prereleases that might already exist, since they are not
  3786. // relevant at this point.
  3787. this.prerelease.length = 0
  3788. this.inc('patch', identifier)
  3789. this.inc('pre', identifier)
  3790. break
  3791. // If the input is a non-prerelease version, this acts the same as
  3792. // prepatch.
  3793. case 'prerelease':
  3794. if (this.prerelease.length === 0) {
  3795. this.inc('patch', identifier)
  3796. }
  3797. this.inc('pre', identifier)
  3798. break
  3799. case 'major':
  3800. // If this is a pre-major version, bump up to the same major version.
  3801. // Otherwise increment major.
  3802. // 1.0.0-5 bumps to 1.0.0
  3803. // 1.1.0 bumps to 2.0.0
  3804. if (this.minor !== 0 ||
  3805. this.patch !== 0 ||
  3806. this.prerelease.length === 0) {
  3807. this.major++
  3808. }
  3809. this.minor = 0
  3810. this.patch = 0
  3811. this.prerelease = []
  3812. break
  3813. case 'minor':
  3814. // If this is a pre-minor version, bump up to the same minor version.
  3815. // Otherwise increment minor.
  3816. // 1.2.0-5 bumps to 1.2.0
  3817. // 1.2.1 bumps to 1.3.0
  3818. if (this.patch !== 0 || this.prerelease.length === 0) {
  3819. this.minor++
  3820. }
  3821. this.patch = 0
  3822. this.prerelease = []
  3823. break
  3824. case 'patch':
  3825. // If this is not a pre-release version, it will increment the patch.
  3826. // If it is a pre-release it will bump up to the same patch version.
  3827. // 1.2.0-5 patches to 1.2.0
  3828. // 1.2.0 patches to 1.2.1
  3829. if (this.prerelease.length === 0) {
  3830. this.patch++
  3831. }
  3832. this.prerelease = []
  3833. break
  3834. // This probably shouldn't be used publicly.
  3835. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3836. case 'pre':
  3837. if (this.prerelease.length === 0) {
  3838. this.prerelease = [0]
  3839. } else {
  3840. var i = this.prerelease.length
  3841. while (--i >= 0) {
  3842. if (typeof this.prerelease[i] === 'number') {
  3843. this.prerelease[i]++
  3844. i = -2
  3845. }
  3846. }
  3847. if (i === -1) {
  3848. // didn't increment anything
  3849. this.prerelease.push(0)
  3850. }
  3851. }
  3852. if (identifier) {
  3853. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3854. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3855. if (this.prerelease[0] === identifier) {
  3856. if (isNaN(this.prerelease[1])) {
  3857. this.prerelease = [identifier, 0]
  3858. }
  3859. } else {
  3860. this.prerelease = [identifier, 0]
  3861. }
  3862. }
  3863. break
  3864. default:
  3865. throw new Error('invalid increment argument: ' + release)
  3866. }
  3867. this.format()
  3868. this.raw = this.version
  3869. return this
  3870. }
  3871. exports.inc = inc
  3872. function inc (version, release, loose, identifier) {
  3873. if (typeof (loose) === 'string') {
  3874. identifier = loose
  3875. loose = undefined
  3876. }
  3877. try {
  3878. return new SemVer(version, loose).inc(release, identifier).version
  3879. } catch (er) {
  3880. return null
  3881. }
  3882. }
  3883. exports.diff = diff
  3884. function diff (version1, version2) {
  3885. if (eq(version1, version2)) {
  3886. return null
  3887. } else {
  3888. var v1 = parse(version1)
  3889. var v2 = parse(version2)
  3890. var prefix = ''
  3891. if (v1.prerelease.length || v2.prerelease.length) {
  3892. prefix = 'pre'
  3893. var defaultResult = 'prerelease'
  3894. }
  3895. for (var key in v1) {
  3896. if (key === 'major' || key === 'minor' || key === 'patch') {
  3897. if (v1[key] !== v2[key]) {
  3898. return prefix + key
  3899. }
  3900. }
  3901. }
  3902. return defaultResult // may be undefined
  3903. }
  3904. }
  3905. exports.compareIdentifiers = compareIdentifiers
  3906. var numeric = /^[0-9]+$/
  3907. function compareIdentifiers (a, b) {
  3908. var anum = numeric.test(a)
  3909. var bnum = numeric.test(b)
  3910. if (anum && bnum) {
  3911. a = +a
  3912. b = +b
  3913. }
  3914. return a === b ? 0
  3915. : (anum && !bnum) ? -1
  3916. : (bnum && !anum) ? 1
  3917. : a < b ? -1
  3918. : 1
  3919. }
  3920. exports.rcompareIdentifiers = rcompareIdentifiers
  3921. function rcompareIdentifiers (a, b) {
  3922. return compareIdentifiers(b, a)
  3923. }
  3924. exports.major = major
  3925. function major (a, loose) {
  3926. return new SemVer(a, loose).major
  3927. }
  3928. exports.minor = minor
  3929. function minor (a, loose) {
  3930. return new SemVer(a, loose).minor
  3931. }
  3932. exports.patch = patch
  3933. function patch (a, loose) {
  3934. return new SemVer(a, loose).patch
  3935. }
  3936. exports.compare = compare
  3937. function compare (a, b, loose) {
  3938. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3939. }
  3940. exports.compareLoose = compareLoose
  3941. function compareLoose (a, b) {
  3942. return compare(a, b, true)
  3943. }
  3944. exports.rcompare = rcompare
  3945. function rcompare (a, b, loose) {
  3946. return compare(b, a, loose)
  3947. }
  3948. exports.sort = sort
  3949. function sort (list, loose) {
  3950. return list.sort(function (a, b) {
  3951. return exports.compare(a, b, loose)
  3952. })
  3953. }
  3954. exports.rsort = rsort
  3955. function rsort (list, loose) {
  3956. return list.sort(function (a, b) {
  3957. return exports.rcompare(a, b, loose)
  3958. })
  3959. }
  3960. exports.gt = gt
  3961. function gt (a, b, loose) {
  3962. return compare(a, b, loose) > 0
  3963. }
  3964. exports.lt = lt
  3965. function lt (a, b, loose) {
  3966. return compare(a, b, loose) < 0
  3967. }
  3968. exports.eq = eq
  3969. function eq (a, b, loose) {
  3970. return compare(a, b, loose) === 0
  3971. }
  3972. exports.neq = neq
  3973. function neq (a, b, loose) {
  3974. return compare(a, b, loose) !== 0
  3975. }
  3976. exports.gte = gte
  3977. function gte (a, b, loose) {
  3978. return compare(a, b, loose) >= 0
  3979. }
  3980. exports.lte = lte
  3981. function lte (a, b, loose) {
  3982. return compare(a, b, loose) <= 0
  3983. }
  3984. exports.cmp = cmp
  3985. function cmp (a, op, b, loose) {
  3986. switch (op) {
  3987. case '===':
  3988. if (typeof a === 'object')
  3989. a = a.version
  3990. if (typeof b === 'object')
  3991. b = b.version
  3992. return a === b
  3993. case '!==':
  3994. if (typeof a === 'object')
  3995. a = a.version
  3996. if (typeof b === 'object')
  3997. b = b.version
  3998. return a !== b
  3999. case '':
  4000. case '=':
  4001. case '==':
  4002. return eq(a, b, loose)
  4003. case '!=':
  4004. return neq(a, b, loose)
  4005. case '>':
  4006. return gt(a, b, loose)
  4007. case '>=':
  4008. return gte(a, b, loose)
  4009. case '<':
  4010. return lt(a, b, loose)
  4011. case '<=':
  4012. return lte(a, b, loose)
  4013. default:
  4014. throw new TypeError('Invalid operator: ' + op)
  4015. }
  4016. }
  4017. exports.Comparator = Comparator
  4018. function Comparator (comp, options) {
  4019. if (!options || typeof options !== 'object') {
  4020. options = {
  4021. loose: !!options,
  4022. includePrerelease: false
  4023. }
  4024. }
  4025. if (comp instanceof Comparator) {
  4026. if (comp.loose === !!options.loose) {
  4027. return comp
  4028. } else {
  4029. comp = comp.value
  4030. }
  4031. }
  4032. if (!(this instanceof Comparator)) {
  4033. return new Comparator(comp, options)
  4034. }
  4035. debug('comparator', comp, options)
  4036. this.options = options
  4037. this.loose = !!options.loose
  4038. this.parse(comp)
  4039. if (this.semver === ANY) {
  4040. this.value = ''
  4041. } else {
  4042. this.value = this.operator + this.semver.version
  4043. }
  4044. debug('comp', this)
  4045. }
  4046. var ANY = {}
  4047. Comparator.prototype.parse = function (comp) {
  4048. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4049. var m = comp.match(r)
  4050. if (!m) {
  4051. throw new TypeError('Invalid comparator: ' + comp)
  4052. }
  4053. this.operator = m[1]
  4054. if (this.operator === '=') {
  4055. this.operator = ''
  4056. }
  4057. // if it literally is just '>' or '' then allow anything.
  4058. if (!m[2]) {
  4059. this.semver = ANY
  4060. } else {
  4061. this.semver = new SemVer(m[2], this.options.loose)
  4062. }
  4063. }
  4064. Comparator.prototype.toString = function () {
  4065. return this.value
  4066. }
  4067. Comparator.prototype.test = function (version) {
  4068. debug('Comparator.test', version, this.options.loose)
  4069. if (this.semver === ANY) {
  4070. return true
  4071. }
  4072. if (typeof version === 'string') {
  4073. version = new SemVer(version, this.options)
  4074. }
  4075. return cmp(version, this.operator, this.semver, this.options)
  4076. }
  4077. Comparator.prototype.intersects = function (comp, options) {
  4078. if (!(comp instanceof Comparator)) {
  4079. throw new TypeError('a Comparator is required')
  4080. }
  4081. if (!options || typeof options !== 'object') {
  4082. options = {
  4083. loose: !!options,
  4084. includePrerelease: false
  4085. }
  4086. }
  4087. var rangeTmp
  4088. if (this.operator === '') {
  4089. rangeTmp = new Range(comp.value, options)
  4090. return satisfies(this.value, rangeTmp, options)
  4091. } else if (comp.operator === '') {
  4092. rangeTmp = new Range(this.value, options)
  4093. return satisfies(comp.semver, rangeTmp, options)
  4094. }
  4095. var sameDirectionIncreasing =
  4096. (this.operator === '>=' || this.operator === '>') &&
  4097. (comp.operator === '>=' || comp.operator === '>')
  4098. var sameDirectionDecreasing =
  4099. (this.operator === '<=' || this.operator === '<') &&
  4100. (comp.operator === '<=' || comp.operator === '<')
  4101. var sameSemVer = this.semver.version === comp.semver.version
  4102. var differentDirectionsInclusive =
  4103. (this.operator === '>=' || this.operator === '<=') &&
  4104. (comp.operator === '>=' || comp.operator === '<=')
  4105. var oppositeDirectionsLessThan =
  4106. cmp(this.semver, '<', comp.semver, options) &&
  4107. ((this.operator === '>=' || this.operator === '>') &&
  4108. (comp.operator === '<=' || comp.operator === '<'))
  4109. var oppositeDirectionsGreaterThan =
  4110. cmp(this.semver, '>', comp.semver, options) &&
  4111. ((this.operator === '<=' || this.operator === '<') &&
  4112. (comp.operator === '>=' || comp.operator === '>'))
  4113. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4114. (sameSemVer && differentDirectionsInclusive) ||
  4115. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4116. }
  4117. exports.Range = Range
  4118. function Range (range, options) {
  4119. if (!options || typeof options !== 'object') {
  4120. options = {
  4121. loose: !!options,
  4122. includePrerelease: false
  4123. }
  4124. }
  4125. if (range instanceof Range) {
  4126. if (range.loose === !!options.loose &&
  4127. range.includePrerelease === !!options.includePrerelease) {
  4128. return range
  4129. } else {
  4130. return new Range(range.raw, options)
  4131. }
  4132. }
  4133. if (range instanceof Comparator) {
  4134. return new Range(range.value, options)
  4135. }
  4136. if (!(this instanceof Range)) {
  4137. return new Range(range, options)
  4138. }
  4139. this.options = options
  4140. this.loose = !!options.loose
  4141. this.includePrerelease = !!options.includePrerelease
  4142. // First, split based on boolean or ||
  4143. this.raw = range
  4144. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4145. return this.parseRange(range.trim())
  4146. }, this).filter(function (c) {
  4147. // throw out any that are not relevant for whatever reason
  4148. return c.length
  4149. })
  4150. if (!this.set.length) {
  4151. throw new TypeError('Invalid SemVer Range: ' + range)
  4152. }
  4153. this.format()
  4154. }
  4155. Range.prototype.format = function () {
  4156. this.range = this.set.map(function (comps) {
  4157. return comps.join(' ').trim()
  4158. }).join('||').trim()
  4159. return this.range
  4160. }
  4161. Range.prototype.toString = function () {
  4162. return this.range
  4163. }
  4164. Range.prototype.parseRange = function (range) {
  4165. var loose = this.options.loose
  4166. range = range.trim()
  4167. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4168. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4169. range = range.replace(hr, hyphenReplace)
  4170. debug('hyphen replace', range)
  4171. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4172. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4173. debug('comparator trim', range, re[COMPARATORTRIM])
  4174. // `~ 1.2.3` => `~1.2.3`
  4175. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4176. // `^ 1.2.3` => `^1.2.3`
  4177. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4178. // normalize spaces
  4179. range = range.split(/\s+/).join(' ')
  4180. // At this point, the range is completely trimmed and
  4181. // ready to be split into comparators.
  4182. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4183. var set = range.split(' ').map(function (comp) {
  4184. return parseComparator(comp, this.options)
  4185. }, this).join(' ').split(/\s+/)
  4186. if (this.options.loose) {
  4187. // in loose mode, throw out any that are not valid comparators
  4188. set = set.filter(function (comp) {
  4189. return !!comp.match(compRe)
  4190. })
  4191. }
  4192. set = set.map(function (comp) {
  4193. return new Comparator(comp, this.options)
  4194. }, this)
  4195. return set
  4196. }
  4197. Range.prototype.intersects = function (range, options) {
  4198. if (!(range instanceof Range)) {
  4199. throw new TypeError('a Range is required')
  4200. }
  4201. return this.set.some(function (thisComparators) {
  4202. return thisComparators.every(function (thisComparator) {
  4203. return range.set.some(function (rangeComparators) {
  4204. return rangeComparators.every(function (rangeComparator) {
  4205. return thisComparator.intersects(rangeComparator, options)
  4206. })
  4207. })
  4208. })
  4209. })
  4210. }
  4211. // Mostly just for testing and legacy API reasons
  4212. exports.toComparators = toComparators
  4213. function toComparators (range, options) {
  4214. return new Range(range, options).set.map(function (comp) {
  4215. return comp.map(function (c) {
  4216. return c.value
  4217. }).join(' ').trim().split(' ')
  4218. })
  4219. }
  4220. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4221. // already replaced the hyphen ranges
  4222. // turn into a set of JUST comparators.
  4223. function parseComparator (comp, options) {
  4224. debug('comp', comp, options)
  4225. comp = replaceCarets(comp, options)
  4226. debug('caret', comp)
  4227. comp = replaceTildes(comp, options)
  4228. debug('tildes', comp)
  4229. comp = replaceXRanges(comp, options)
  4230. debug('xrange', comp)
  4231. comp = replaceStars(comp, options)
  4232. debug('stars', comp)
  4233. return comp
  4234. }
  4235. function isX (id) {
  4236. return !id || id.toLowerCase() === 'x' || id === '*'
  4237. }
  4238. // ~, ~> --> * (any, kinda silly)
  4239. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4240. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4241. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4242. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4243. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4244. function replaceTildes (comp, options) {
  4245. return comp.trim().split(/\s+/).map(function (comp) {
  4246. return replaceTilde(comp, options)
  4247. }).join(' ')
  4248. }
  4249. function replaceTilde (comp, options) {
  4250. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4251. return comp.replace(r, function (_, M, m, p, pr) {
  4252. debug('tilde', comp, _, M, m, p, pr)
  4253. var ret
  4254. if (isX(M)) {
  4255. ret = ''
  4256. } else if (isX(m)) {
  4257. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4258. } else if (isX(p)) {
  4259. // ~1.2 == >=1.2.0 <1.3.0
  4260. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4261. } else if (pr) {
  4262. debug('replaceTilde pr', pr)
  4263. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4264. ' <' + M + '.' + (+m + 1) + '.0'
  4265. } else {
  4266. // ~1.2.3 == >=1.2.3 <1.3.0
  4267. ret = '>=' + M + '.' + m + '.' + p +
  4268. ' <' + M + '.' + (+m + 1) + '.0'
  4269. }
  4270. debug('tilde return', ret)
  4271. return ret
  4272. })
  4273. }
  4274. // ^ --> * (any, kinda silly)
  4275. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4276. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4277. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4278. // ^1.2.3 --> >=1.2.3 <2.0.0
  4279. // ^1.2.0 --> >=1.2.0 <2.0.0
  4280. function replaceCarets (comp, options) {
  4281. return comp.trim().split(/\s+/).map(function (comp) {
  4282. return replaceCaret(comp, options)
  4283. }).join(' ')
  4284. }
  4285. function replaceCaret (comp, options) {
  4286. debug('caret', comp, options)
  4287. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4288. return comp.replace(r, function (_, M, m, p, pr) {
  4289. debug('caret', comp, _, M, m, p, pr)
  4290. var ret
  4291. if (isX(M)) {
  4292. ret = ''
  4293. } else if (isX(m)) {
  4294. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4295. } else if (isX(p)) {
  4296. if (M === '0') {
  4297. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4298. } else {
  4299. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4300. }
  4301. } else if (pr) {
  4302. debug('replaceCaret pr', pr)
  4303. if (M === '0') {
  4304. if (m === '0') {
  4305. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4306. ' <' + M + '.' + m + '.' + (+p + 1)
  4307. } else {
  4308. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4309. ' <' + M + '.' + (+m + 1) + '.0'
  4310. }
  4311. } else {
  4312. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4313. ' <' + (+M + 1) + '.0.0'
  4314. }
  4315. } else {
  4316. debug('no pr')
  4317. if (M === '0') {
  4318. if (m === '0') {
  4319. ret = '>=' + M + '.' + m + '.' + p +
  4320. ' <' + M + '.' + m + '.' + (+p + 1)
  4321. } else {
  4322. ret = '>=' + M + '.' + m + '.' + p +
  4323. ' <' + M + '.' + (+m + 1) + '.0'
  4324. }
  4325. } else {
  4326. ret = '>=' + M + '.' + m + '.' + p +
  4327. ' <' + (+M + 1) + '.0.0'
  4328. }
  4329. }
  4330. debug('caret return', ret)
  4331. return ret
  4332. })
  4333. }
  4334. function replaceXRanges (comp, options) {
  4335. debug('replaceXRanges', comp, options)
  4336. return comp.split(/\s+/).map(function (comp) {
  4337. return replaceXRange(comp, options)
  4338. }).join(' ')
  4339. }
  4340. function replaceXRange (comp, options) {
  4341. comp = comp.trim()
  4342. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4343. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4344. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4345. var xM = isX(M)
  4346. var xm = xM || isX(m)
  4347. var xp = xm || isX(p)
  4348. var anyX = xp
  4349. if (gtlt === '=' && anyX) {
  4350. gtlt = ''
  4351. }
  4352. if (xM) {
  4353. if (gtlt === '>' || gtlt === '<') {
  4354. // nothing is allowed
  4355. ret = '<0.0.0'
  4356. } else {
  4357. // nothing is forbidden
  4358. ret = '*'
  4359. }
  4360. } else if (gtlt && anyX) {
  4361. // we know patch is an x, because we have any x at all.
  4362. // replace X with 0
  4363. if (xm) {
  4364. m = 0
  4365. }
  4366. p = 0
  4367. if (gtlt === '>') {
  4368. // >1 => >=2.0.0
  4369. // >1.2 => >=1.3.0
  4370. // >1.2.3 => >= 1.2.4
  4371. gtlt = '>='
  4372. if (xm) {
  4373. M = +M + 1
  4374. m = 0
  4375. p = 0
  4376. } else {
  4377. m = +m + 1
  4378. p = 0
  4379. }
  4380. } else if (gtlt === '<=') {
  4381. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4382. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4383. gtlt = '<'
  4384. if (xm) {
  4385. M = +M + 1
  4386. } else {
  4387. m = +m + 1
  4388. }
  4389. }
  4390. ret = gtlt + M + '.' + m + '.' + p
  4391. } else if (xm) {
  4392. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4393. } else if (xp) {
  4394. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4395. }
  4396. debug('xRange return', ret)
  4397. return ret
  4398. })
  4399. }
  4400. // Because * is AND-ed with everything else in the comparator,
  4401. // and '' means "any version", just remove the *s entirely.
  4402. function replaceStars (comp, options) {
  4403. debug('replaceStars', comp, options)
  4404. // Looseness is ignored here. star is always as loose as it gets!
  4405. return comp.trim().replace(re[STAR], '')
  4406. }
  4407. // This function is passed to string.replace(re[HYPHENRANGE])
  4408. // M, m, patch, prerelease, build
  4409. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4410. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4411. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4412. function hyphenReplace ($0,
  4413. from, fM, fm, fp, fpr, fb,
  4414. to, tM, tm, tp, tpr, tb) {
  4415. if (isX(fM)) {
  4416. from = ''
  4417. } else if (isX(fm)) {
  4418. from = '>=' + fM + '.0.0'
  4419. } else if (isX(fp)) {
  4420. from = '>=' + fM + '.' + fm + '.0'
  4421. } else {
  4422. from = '>=' + from
  4423. }
  4424. if (isX(tM)) {
  4425. to = ''
  4426. } else if (isX(tm)) {
  4427. to = '<' + (+tM + 1) + '.0.0'
  4428. } else if (isX(tp)) {
  4429. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4430. } else if (tpr) {
  4431. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4432. } else {
  4433. to = '<=' + to
  4434. }
  4435. return (from + ' ' + to).trim()
  4436. }
  4437. // if ANY of the sets match ALL of its comparators, then pass
  4438. Range.prototype.test = function (version) {
  4439. if (!version) {
  4440. return false
  4441. }
  4442. if (typeof version === 'string') {
  4443. version = new SemVer(version, this.options)
  4444. }
  4445. for (var i = 0; i < this.set.length; i++) {
  4446. if (testSet(this.set[i], version, this.options)) {
  4447. return true
  4448. }
  4449. }
  4450. return false
  4451. }
  4452. function testSet (set, version, options) {
  4453. for (var i = 0; i < set.length; i++) {
  4454. if (!set[i].test(version)) {
  4455. return false
  4456. }
  4457. }
  4458. if (version.prerelease.length && !options.includePrerelease) {
  4459. // Find the set of versions that are allowed to have prereleases
  4460. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4461. // That should allow `1.2.3-pr.2` to pass.
  4462. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4463. // even though it's within the range set by the comparators.
  4464. for (i = 0; i < set.length; i++) {
  4465. debug(set[i].semver)
  4466. if (set[i].semver === ANY) {
  4467. continue
  4468. }
  4469. if (set[i].semver.prerelease.length > 0) {
  4470. var allowed = set[i].semver
  4471. if (allowed.major === version.major &&
  4472. allowed.minor === version.minor &&
  4473. allowed.patch === version.patch) {
  4474. return true
  4475. }
  4476. }
  4477. }
  4478. // Version has a -pre, but it's not one of the ones we like.
  4479. return false
  4480. }
  4481. return true
  4482. }
  4483. exports.satisfies = satisfies
  4484. function satisfies (version, range, options) {
  4485. try {
  4486. range = new Range(range, options)
  4487. } catch (er) {
  4488. return false
  4489. }
  4490. return range.test(version)
  4491. }
  4492. exports.maxSatisfying = maxSatisfying
  4493. function maxSatisfying (versions, range, options) {
  4494. var max = null
  4495. var maxSV = null
  4496. try {
  4497. var rangeObj = new Range(range, options)
  4498. } catch (er) {
  4499. return null
  4500. }
  4501. versions.forEach(function (v) {
  4502. if (rangeObj.test(v)) {
  4503. // satisfies(v, range, options)
  4504. if (!max || maxSV.compare(v) === -1) {
  4505. // compare(max, v, true)
  4506. max = v
  4507. maxSV = new SemVer(max, options)
  4508. }
  4509. }
  4510. })
  4511. return max
  4512. }
  4513. exports.minSatisfying = minSatisfying
  4514. function minSatisfying (versions, range, options) {
  4515. var min = null
  4516. var minSV = null
  4517. try {
  4518. var rangeObj = new Range(range, options)
  4519. } catch (er) {
  4520. return null
  4521. }
  4522. versions.forEach(function (v) {
  4523. if (rangeObj.test(v)) {
  4524. // satisfies(v, range, options)
  4525. if (!min || minSV.compare(v) === 1) {
  4526. // compare(min, v, true)
  4527. min = v
  4528. minSV = new SemVer(min, options)
  4529. }
  4530. }
  4531. })
  4532. return min
  4533. }
  4534. exports.minVersion = minVersion
  4535. function minVersion (range, loose) {
  4536. range = new Range(range, loose)
  4537. var minver = new SemVer('0.0.0')
  4538. if (range.test(minver)) {
  4539. return minver
  4540. }
  4541. minver = new SemVer('0.0.0-0')
  4542. if (range.test(minver)) {
  4543. return minver
  4544. }
  4545. minver = null
  4546. for (var i = 0; i < range.set.length; ++i) {
  4547. var comparators = range.set[i]
  4548. comparators.forEach(function (comparator) {
  4549. // Clone to avoid manipulating the comparator's semver object.
  4550. var compver = new SemVer(comparator.semver.version)
  4551. switch (comparator.operator) {
  4552. case '>':
  4553. if (compver.prerelease.length === 0) {
  4554. compver.patch++
  4555. } else {
  4556. compver.prerelease.push(0)
  4557. }
  4558. compver.raw = compver.format()
  4559. /* fallthrough */
  4560. case '':
  4561. case '>=':
  4562. if (!minver || gt(minver, compver)) {
  4563. minver = compver
  4564. }
  4565. break
  4566. case '<':
  4567. case '<=':
  4568. /* Ignore maximum versions */
  4569. break
  4570. /* istanbul ignore next */
  4571. default:
  4572. throw new Error('Unexpected operation: ' + comparator.operator)
  4573. }
  4574. })
  4575. }
  4576. if (minver && range.test(minver)) {
  4577. return minver
  4578. }
  4579. return null
  4580. }
  4581. exports.validRange = validRange
  4582. function validRange (range, options) {
  4583. try {
  4584. // Return '*' instead of '' so that truthiness works.
  4585. // This will throw if it's invalid anyway
  4586. return new Range(range, options).range || '*'
  4587. } catch (er) {
  4588. return null
  4589. }
  4590. }
  4591. // Determine if version is less than all the versions possible in the range
  4592. exports.ltr = ltr
  4593. function ltr (version, range, options) {
  4594. return outside(version, range, '<', options)
  4595. }
  4596. // Determine if version is greater than all the versions possible in the range.
  4597. exports.gtr = gtr
  4598. function gtr (version, range, options) {
  4599. return outside(version, range, '>', options)
  4600. }
  4601. exports.outside = outside
  4602. function outside (version, range, hilo, options) {
  4603. version = new SemVer(version, options)
  4604. range = new Range(range, options)
  4605. var gtfn, ltefn, ltfn, comp, ecomp
  4606. switch (hilo) {
  4607. case '>':
  4608. gtfn = gt
  4609. ltefn = lte
  4610. ltfn = lt
  4611. comp = '>'
  4612. ecomp = '>='
  4613. break
  4614. case '<':
  4615. gtfn = lt
  4616. ltefn = gte
  4617. ltfn = gt
  4618. comp = '<'
  4619. ecomp = '<='
  4620. break
  4621. default:
  4622. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4623. }
  4624. // If it satisifes the range it is not outside
  4625. if (satisfies(version, range, options)) {
  4626. return false
  4627. }
  4628. // From now on, variable terms are as if we're in "gtr" mode.
  4629. // but note that everything is flipped for the "ltr" function.
  4630. for (var i = 0; i < range.set.length; ++i) {
  4631. var comparators = range.set[i]
  4632. var high = null
  4633. var low = null
  4634. comparators.forEach(function (comparator) {
  4635. if (comparator.semver === ANY) {
  4636. comparator = new Comparator('>=0.0.0')
  4637. }
  4638. high = high || comparator
  4639. low = low || comparator
  4640. if (gtfn(comparator.semver, high.semver, options)) {
  4641. high = comparator
  4642. } else if (ltfn(comparator.semver, low.semver, options)) {
  4643. low = comparator
  4644. }
  4645. })
  4646. // If the edge version comparator has a operator then our version
  4647. // isn't outside it
  4648. if (high.operator === comp || high.operator === ecomp) {
  4649. return false
  4650. }
  4651. // If the lowest version comparator has an operator and our version
  4652. // is less than it then it isn't higher than the range
  4653. if ((!low.operator || low.operator === comp) &&
  4654. ltefn(version, low.semver)) {
  4655. return false
  4656. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4657. return false
  4658. }
  4659. }
  4660. return true
  4661. }
  4662. exports.prerelease = prerelease
  4663. function prerelease (version, options) {
  4664. var parsed = parse(version, options)
  4665. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4666. }
  4667. exports.intersects = intersects
  4668. function intersects (r1, r2, options) {
  4669. r1 = new Range(r1, options)
  4670. r2 = new Range(r2, options)
  4671. return r1.intersects(r2)
  4672. }
  4673. exports.coerce = coerce
  4674. function coerce (version) {
  4675. if (version instanceof SemVer) {
  4676. return version
  4677. }
  4678. if (typeof version !== 'string') {
  4679. return null
  4680. }
  4681. var match = version.match(re[COERCE])
  4682. if (match == null) {
  4683. return null
  4684. }
  4685. return parse(match[1] +
  4686. '.' + (match[2] || '0') +
  4687. '.' + (match[3] || '0'))
  4688. }
  4689. /***/ }),
  4690. /***/ 287:
  4691. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4692. "use strict";
  4693. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4694. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4695. return new (P || (P = Promise))(function (resolve, reject) {
  4696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4698. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4700. });
  4701. };
  4702. var __importStar = (this && this.__importStar) || function (mod) {
  4703. if (mod && mod.__esModule) return mod;
  4704. var result = {};
  4705. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4706. result["default"] = mod;
  4707. return result;
  4708. };
  4709. var __importDefault = (this && this.__importDefault) || function (mod) {
  4710. return (mod && mod.__esModule) ? mod : { "default": mod };
  4711. };
  4712. Object.defineProperty(exports, "__esModule", { value: true });
  4713. const assert = __importStar(__webpack_require__(357));
  4714. const core = __importStar(__webpack_require__(470));
  4715. const exec = __importStar(__webpack_require__(986));
  4716. const fs = __importStar(__webpack_require__(747));
  4717. const io = __importStar(__webpack_require__(1));
  4718. const os = __importStar(__webpack_require__(87));
  4719. const path = __importStar(__webpack_require__(622));
  4720. const regexpHelper = __importStar(__webpack_require__(528));
  4721. const stateHelper = __importStar(__webpack_require__(153));
  4722. const urlHelper = __importStar(__webpack_require__(81));
  4723. const v4_1 = __importDefault(__webpack_require__(826));
  4724. const IS_WINDOWS = process.platform === 'win32';
  4725. const SSH_COMMAND_KEY = 'core.sshCommand';
  4726. function createAuthHelper(git, settings) {
  4727. return new GitAuthHelper(git, settings);
  4728. }
  4729. exports.createAuthHelper = createAuthHelper;
  4730. class GitAuthHelper {
  4731. constructor(gitCommandManager, gitSourceSettings) {
  4732. this.sshCommand = '';
  4733. this.sshKeyPath = '';
  4734. this.sshKnownHostsPath = '';
  4735. this.temporaryHomePath = '';
  4736. this.git = gitCommandManager;
  4737. this.settings = gitSourceSettings || {};
  4738. // Token auth header
  4739. const serverUrl = urlHelper.getServerUrl();
  4740. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4741. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4742. core.setSecret(basicCredential);
  4743. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4744. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4745. // Instead of SSH URL
  4746. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4747. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4748. }
  4749. configureAuth() {
  4750. return __awaiter(this, void 0, void 0, function* () {
  4751. // Remove possible previous values
  4752. yield this.removeAuth();
  4753. // Configure new values
  4754. yield this.configureSsh();
  4755. yield this.configureToken();
  4756. });
  4757. }
  4758. configureGlobalAuth() {
  4759. return __awaiter(this, void 0, void 0, function* () {
  4760. // Create a temp home directory
  4761. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4762. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4763. const uniqueId = v4_1.default();
  4764. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4765. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4766. // Copy the global git config
  4767. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4768. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4769. let configExists = false;
  4770. try {
  4771. yield fs.promises.stat(gitConfigPath);
  4772. configExists = true;
  4773. }
  4774. catch (err) {
  4775. if (err.code !== 'ENOENT') {
  4776. throw err;
  4777. }
  4778. }
  4779. if (configExists) {
  4780. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4781. yield io.cp(gitConfigPath, newGitConfigPath);
  4782. }
  4783. else {
  4784. yield fs.promises.writeFile(newGitConfigPath, '');
  4785. }
  4786. try {
  4787. // Override HOME
  4788. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4789. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4790. // Configure the token
  4791. yield this.configureToken(newGitConfigPath, true);
  4792. // Configure HTTPS instead of SSH
  4793. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4794. if (!this.settings.sshKey) {
  4795. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4796. }
  4797. }
  4798. catch (err) {
  4799. // Unset in case somehow written to the real global config
  4800. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4801. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4802. throw err;
  4803. }
  4804. });
  4805. }
  4806. configureSubmoduleAuth() {
  4807. return __awaiter(this, void 0, void 0, function* () {
  4808. // Remove possible previous HTTPS instead of SSH
  4809. yield this.removeGitConfig(this.insteadOfKey, true);
  4810. if (this.settings.persistCredentials) {
  4811. // Configure a placeholder value. This approach avoids the credential being captured
  4812. // by process creation audit events, which are commonly logged. For more information,
  4813. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4814. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4815. // Replace the placeholder
  4816. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4817. for (const configPath of configPaths) {
  4818. core.debug(`Replacing token placeholder in '${configPath}'`);
  4819. this.replaceTokenPlaceholder(configPath);
  4820. }
  4821. if (this.settings.sshKey) {
  4822. // Configure core.sshCommand
  4823. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4824. }
  4825. else {
  4826. // Configure HTTPS instead of SSH
  4827. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4828. }
  4829. }
  4830. });
  4831. }
  4832. removeAuth() {
  4833. return __awaiter(this, void 0, void 0, function* () {
  4834. yield this.removeSsh();
  4835. yield this.removeToken();
  4836. });
  4837. }
  4838. removeGlobalAuth() {
  4839. return __awaiter(this, void 0, void 0, function* () {
  4840. core.debug(`Unsetting HOME override`);
  4841. this.git.removeEnvironmentVariable('HOME');
  4842. yield io.rmRF(this.temporaryHomePath);
  4843. });
  4844. }
  4845. configureSsh() {
  4846. return __awaiter(this, void 0, void 0, function* () {
  4847. if (!this.settings.sshKey) {
  4848. return;
  4849. }
  4850. // Write key
  4851. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4852. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4853. const uniqueId = v4_1.default();
  4854. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4855. stateHelper.setSshKeyPath(this.sshKeyPath);
  4856. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4857. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4858. // Remove inherited permissions on Windows
  4859. if (IS_WINDOWS) {
  4860. const icacls = yield io.which('icacls.exe');
  4861. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4862. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4863. }
  4864. // Write known hosts
  4865. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4866. let userKnownHosts = '';
  4867. try {
  4868. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4869. }
  4870. catch (err) {
  4871. if (err.code !== 'ENOENT') {
  4872. throw err;
  4873. }
  4874. }
  4875. let knownHosts = '';
  4876. if (userKnownHosts) {
  4877. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4878. }
  4879. if (this.settings.sshKnownHosts) {
  4880. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4881. }
  4882. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4883. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4884. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4885. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4886. // Configure GIT_SSH_COMMAND
  4887. const sshPath = yield io.which('ssh', true);
  4888. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4889. if (this.settings.sshStrict) {
  4890. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4891. }
  4892. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4893. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4894. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4895. // Configure core.sshCommand
  4896. if (this.settings.persistCredentials) {
  4897. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4898. }
  4899. });
  4900. }
  4901. configureToken(configPath, globalConfig) {
  4902. return __awaiter(this, void 0, void 0, function* () {
  4903. // Validate args
  4904. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4905. // Default config path
  4906. if (!configPath && !globalConfig) {
  4907. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4908. }
  4909. // Configure a placeholder value. This approach avoids the credential being captured
  4910. // by process creation audit events, which are commonly logged. For more information,
  4911. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4912. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4913. // Replace the placeholder
  4914. yield this.replaceTokenPlaceholder(configPath || '');
  4915. });
  4916. }
  4917. replaceTokenPlaceholder(configPath) {
  4918. return __awaiter(this, void 0, void 0, function* () {
  4919. assert.ok(configPath, 'configPath is not defined');
  4920. let content = (yield fs.promises.readFile(configPath)).toString();
  4921. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4922. if (placeholderIndex < 0 ||
  4923. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4924. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4925. }
  4926. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4927. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4928. yield fs.promises.writeFile(configPath, content);
  4929. });
  4930. }
  4931. removeSsh() {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. // SSH key
  4934. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4935. if (keyPath) {
  4936. try {
  4937. yield io.rmRF(keyPath);
  4938. }
  4939. catch (err) {
  4940. core.debug(err.message);
  4941. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4942. }
  4943. }
  4944. // SSH known hosts
  4945. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4946. if (knownHostsPath) {
  4947. try {
  4948. yield io.rmRF(knownHostsPath);
  4949. }
  4950. catch (_a) {
  4951. // Intentionally empty
  4952. }
  4953. }
  4954. // SSH command
  4955. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4956. });
  4957. }
  4958. removeToken() {
  4959. return __awaiter(this, void 0, void 0, function* () {
  4960. // HTTP extra header
  4961. yield this.removeGitConfig(this.tokenConfigKey);
  4962. });
  4963. }
  4964. removeGitConfig(configKey, submoduleOnly = false) {
  4965. return __awaiter(this, void 0, void 0, function* () {
  4966. if (!submoduleOnly) {
  4967. if ((yield this.git.configExists(configKey)) &&
  4968. !(yield this.git.tryConfigUnset(configKey))) {
  4969. // Load the config contents
  4970. core.warning(`Failed to remove '${configKey}' from the git config`);
  4971. }
  4972. }
  4973. const pattern = regexpHelper.escape(configKey);
  4974. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4975. });
  4976. }
  4977. }
  4978. /***/ }),
  4979. /***/ 289:
  4980. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4981. "use strict";
  4982. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4983. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4984. return new (P || (P = Promise))(function (resolve, reject) {
  4985. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4986. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4987. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4988. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4989. });
  4990. };
  4991. var __importStar = (this && this.__importStar) || function (mod) {
  4992. if (mod && mod.__esModule) return mod;
  4993. var result = {};
  4994. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4995. result["default"] = mod;
  4996. return result;
  4997. };
  4998. Object.defineProperty(exports, "__esModule", { value: true });
  4999. const core = __importStar(__webpack_require__(470));
  5000. const exec = __importStar(__webpack_require__(986));
  5001. const fshelper = __importStar(__webpack_require__(618));
  5002. const io = __importStar(__webpack_require__(1));
  5003. const path = __importStar(__webpack_require__(622));
  5004. const refHelper = __importStar(__webpack_require__(227));
  5005. const regexpHelper = __importStar(__webpack_require__(528));
  5006. const retryHelper = __importStar(__webpack_require__(587));
  5007. const git_version_1 = __webpack_require__(559);
  5008. // Auth header not supported before 2.9
  5009. // Wire protocol v2 not supported before 2.18
  5010. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5011. function createCommandManager(workingDirectory, lfs) {
  5012. return __awaiter(this, void 0, void 0, function* () {
  5013. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5014. });
  5015. }
  5016. exports.createCommandManager = createCommandManager;
  5017. class GitCommandManager {
  5018. // Private constructor; use createCommandManager()
  5019. constructor() {
  5020. this.gitEnv = {
  5021. GIT_TERMINAL_PROMPT: '0',
  5022. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5023. };
  5024. this.gitPath = '';
  5025. this.lfs = false;
  5026. this.workingDirectory = '';
  5027. }
  5028. branchDelete(remote, branch) {
  5029. return __awaiter(this, void 0, void 0, function* () {
  5030. const args = ['branch', '--delete', '--force'];
  5031. if (remote) {
  5032. args.push('--remote');
  5033. }
  5034. args.push(branch);
  5035. yield this.execGit(args);
  5036. });
  5037. }
  5038. branchExists(remote, pattern) {
  5039. return __awaiter(this, void 0, void 0, function* () {
  5040. const args = ['branch', '--list'];
  5041. if (remote) {
  5042. args.push('--remote');
  5043. }
  5044. args.push(pattern);
  5045. const output = yield this.execGit(args);
  5046. return !!output.stdout.trim();
  5047. });
  5048. }
  5049. branchList(remote) {
  5050. return __awaiter(this, void 0, void 0, function* () {
  5051. const result = [];
  5052. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5053. // "branch --list" is more difficult when in a detached HEAD state.
  5054. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5055. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5056. const args = ['rev-parse', '--symbolic-full-name'];
  5057. if (remote) {
  5058. args.push('--remotes=origin');
  5059. }
  5060. else {
  5061. args.push('--branches');
  5062. }
  5063. const output = yield this.execGit(args);
  5064. for (let branch of output.stdout.trim().split('\n')) {
  5065. branch = branch.trim();
  5066. if (branch) {
  5067. if (branch.startsWith('refs/heads/')) {
  5068. branch = branch.substr('refs/heads/'.length);
  5069. }
  5070. else if (branch.startsWith('refs/remotes/')) {
  5071. branch = branch.substr('refs/remotes/'.length);
  5072. }
  5073. result.push(branch);
  5074. }
  5075. }
  5076. return result;
  5077. });
  5078. }
  5079. checkout(ref, startPoint) {
  5080. return __awaiter(this, void 0, void 0, function* () {
  5081. const args = ['checkout', '--progress', '--force'];
  5082. if (startPoint) {
  5083. args.push('-B', ref, startPoint);
  5084. }
  5085. else {
  5086. args.push(ref);
  5087. }
  5088. yield this.execGit(args);
  5089. });
  5090. }
  5091. checkoutDetach() {
  5092. return __awaiter(this, void 0, void 0, function* () {
  5093. const args = ['checkout', '--detach'];
  5094. yield this.execGit(args);
  5095. });
  5096. }
  5097. config(configKey, configValue, globalConfig) {
  5098. return __awaiter(this, void 0, void 0, function* () {
  5099. yield this.execGit([
  5100. 'config',
  5101. globalConfig ? '--global' : '--local',
  5102. configKey,
  5103. configValue
  5104. ]);
  5105. });
  5106. }
  5107. configExists(configKey, globalConfig) {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. const pattern = regexpHelper.escape(configKey);
  5110. const output = yield this.execGit([
  5111. 'config',
  5112. globalConfig ? '--global' : '--local',
  5113. '--name-only',
  5114. '--get-regexp',
  5115. pattern
  5116. ], true);
  5117. return output.exitCode === 0;
  5118. });
  5119. }
  5120. fetch(refSpec, fetchDepth) {
  5121. return __awaiter(this, void 0, void 0, function* () {
  5122. const args = ['-c', 'protocol.version=2', 'fetch'];
  5123. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5124. args.push('--no-tags');
  5125. }
  5126. args.push('--prune', '--progress', '--no-recurse-submodules');
  5127. if (fetchDepth && fetchDepth > 0) {
  5128. args.push(`--depth=${fetchDepth}`);
  5129. }
  5130. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5131. args.push('--unshallow');
  5132. }
  5133. args.push('origin');
  5134. for (const arg of refSpec) {
  5135. args.push(arg);
  5136. }
  5137. const that = this;
  5138. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5139. yield that.execGit(args);
  5140. }));
  5141. });
  5142. }
  5143. getDefaultBranch(repositoryUrl) {
  5144. return __awaiter(this, void 0, void 0, function* () {
  5145. let output;
  5146. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5147. output = yield this.execGit([
  5148. 'ls-remote',
  5149. '--quiet',
  5150. '--exit-code',
  5151. '--symref',
  5152. repositoryUrl,
  5153. 'HEAD'
  5154. ]);
  5155. }));
  5156. if (output) {
  5157. // Satisfy compiler, will always be set
  5158. for (let line of output.stdout.trim().split('\n')) {
  5159. line = line.trim();
  5160. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  5161. return line
  5162. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  5163. .trim();
  5164. }
  5165. }
  5166. }
  5167. throw new Error('Unexpected output when retrieving default branch');
  5168. });
  5169. }
  5170. getWorkingDirectory() {
  5171. return this.workingDirectory;
  5172. }
  5173. init() {
  5174. return __awaiter(this, void 0, void 0, function* () {
  5175. yield this.execGit(['init', this.workingDirectory]);
  5176. });
  5177. }
  5178. isDetached() {
  5179. return __awaiter(this, void 0, void 0, function* () {
  5180. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5181. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5182. return !output.stdout.trim().startsWith('refs/heads/');
  5183. });
  5184. }
  5185. lfsFetch(ref) {
  5186. return __awaiter(this, void 0, void 0, function* () {
  5187. const args = ['lfs', 'fetch', 'origin', ref];
  5188. const that = this;
  5189. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5190. yield that.execGit(args);
  5191. }));
  5192. });
  5193. }
  5194. lfsInstall() {
  5195. return __awaiter(this, void 0, void 0, function* () {
  5196. yield this.execGit(['lfs', 'install', '--local']);
  5197. });
  5198. }
  5199. log1() {
  5200. return __awaiter(this, void 0, void 0, function* () {
  5201. const output = yield this.execGit(['log', '-1']);
  5202. return output.stdout;
  5203. });
  5204. }
  5205. remoteAdd(remoteName, remoteUrl) {
  5206. return __awaiter(this, void 0, void 0, function* () {
  5207. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5208. });
  5209. }
  5210. removeEnvironmentVariable(name) {
  5211. delete this.gitEnv[name];
  5212. }
  5213. /**
  5214. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5215. * For an annotated tag, the tag SHA is returned.
  5216. * @param {string} ref For example: 'refs/heads/master' or '/refs/tags/v1'
  5217. * @returns {Promise<string>}
  5218. */
  5219. revParse(ref) {
  5220. return __awaiter(this, void 0, void 0, function* () {
  5221. const output = yield this.execGit(['rev-parse', ref]);
  5222. return output.stdout.trim();
  5223. });
  5224. }
  5225. setEnvironmentVariable(name, value) {
  5226. this.gitEnv[name] = value;
  5227. }
  5228. shaExists(sha) {
  5229. return __awaiter(this, void 0, void 0, function* () {
  5230. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5231. const output = yield this.execGit(args, true);
  5232. return output.exitCode === 0;
  5233. });
  5234. }
  5235. submoduleForeach(command, recursive) {
  5236. return __awaiter(this, void 0, void 0, function* () {
  5237. const args = ['submodule', 'foreach'];
  5238. if (recursive) {
  5239. args.push('--recursive');
  5240. }
  5241. args.push(command);
  5242. const output = yield this.execGit(args);
  5243. return output.stdout;
  5244. });
  5245. }
  5246. submoduleSync(recursive) {
  5247. return __awaiter(this, void 0, void 0, function* () {
  5248. const args = ['submodule', 'sync'];
  5249. if (recursive) {
  5250. args.push('--recursive');
  5251. }
  5252. yield this.execGit(args);
  5253. });
  5254. }
  5255. submoduleUpdate(fetchDepth, recursive) {
  5256. return __awaiter(this, void 0, void 0, function* () {
  5257. const args = ['-c', 'protocol.version=2'];
  5258. args.push('submodule', 'update', '--init', '--force');
  5259. if (fetchDepth > 0) {
  5260. args.push(`--depth=${fetchDepth}`);
  5261. }
  5262. if (recursive) {
  5263. args.push('--recursive');
  5264. }
  5265. yield this.execGit(args);
  5266. });
  5267. }
  5268. tagExists(pattern) {
  5269. return __awaiter(this, void 0, void 0, function* () {
  5270. const output = yield this.execGit(['tag', '--list', pattern]);
  5271. return !!output.stdout.trim();
  5272. });
  5273. }
  5274. tryClean() {
  5275. return __awaiter(this, void 0, void 0, function* () {
  5276. const output = yield this.execGit(['clean', '-ffdx'], true);
  5277. return output.exitCode === 0;
  5278. });
  5279. }
  5280. tryConfigUnset(configKey, globalConfig) {
  5281. return __awaiter(this, void 0, void 0, function* () {
  5282. const output = yield this.execGit([
  5283. 'config',
  5284. globalConfig ? '--global' : '--local',
  5285. '--unset-all',
  5286. configKey
  5287. ], true);
  5288. return output.exitCode === 0;
  5289. });
  5290. }
  5291. tryDisableAutomaticGarbageCollection() {
  5292. return __awaiter(this, void 0, void 0, function* () {
  5293. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5294. return output.exitCode === 0;
  5295. });
  5296. }
  5297. tryGetFetchUrl() {
  5298. return __awaiter(this, void 0, void 0, function* () {
  5299. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5300. if (output.exitCode !== 0) {
  5301. return '';
  5302. }
  5303. const stdout = output.stdout.trim();
  5304. if (stdout.includes('\n')) {
  5305. return '';
  5306. }
  5307. return stdout;
  5308. });
  5309. }
  5310. tryReset() {
  5311. return __awaiter(this, void 0, void 0, function* () {
  5312. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5313. return output.exitCode === 0;
  5314. });
  5315. }
  5316. static createCommandManager(workingDirectory, lfs) {
  5317. return __awaiter(this, void 0, void 0, function* () {
  5318. const result = new GitCommandManager();
  5319. yield result.initializeCommandManager(workingDirectory, lfs);
  5320. return result;
  5321. });
  5322. }
  5323. execGit(args, allowAllExitCodes = false) {
  5324. return __awaiter(this, void 0, void 0, function* () {
  5325. fshelper.directoryExistsSync(this.workingDirectory, true);
  5326. const result = new GitOutput();
  5327. const env = {};
  5328. for (const key of Object.keys(process.env)) {
  5329. env[key] = process.env[key];
  5330. }
  5331. for (const key of Object.keys(this.gitEnv)) {
  5332. env[key] = this.gitEnv[key];
  5333. }
  5334. const stdout = [];
  5335. const options = {
  5336. cwd: this.workingDirectory,
  5337. env,
  5338. ignoreReturnCode: allowAllExitCodes,
  5339. listeners: {
  5340. stdout: (data) => {
  5341. stdout.push(data.toString());
  5342. }
  5343. }
  5344. };
  5345. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5346. result.stdout = stdout.join('');
  5347. return result;
  5348. });
  5349. }
  5350. initializeCommandManager(workingDirectory, lfs) {
  5351. return __awaiter(this, void 0, void 0, function* () {
  5352. this.workingDirectory = workingDirectory;
  5353. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5354. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5355. this.lfs = lfs;
  5356. if (!this.lfs) {
  5357. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5358. }
  5359. this.gitPath = yield io.which('git', true);
  5360. // Git version
  5361. core.debug('Getting git version');
  5362. let gitVersion = new git_version_1.GitVersion();
  5363. let gitOutput = yield this.execGit(['version']);
  5364. let stdout = gitOutput.stdout.trim();
  5365. if (!stdout.includes('\n')) {
  5366. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5367. if (match) {
  5368. gitVersion = new git_version_1.GitVersion(match[0]);
  5369. }
  5370. }
  5371. if (!gitVersion.isValid()) {
  5372. throw new Error('Unable to determine git version');
  5373. }
  5374. // Minimum git version
  5375. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5376. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5377. }
  5378. if (this.lfs) {
  5379. // Git-lfs version
  5380. core.debug('Getting git-lfs version');
  5381. let gitLfsVersion = new git_version_1.GitVersion();
  5382. const gitLfsPath = yield io.which('git-lfs', true);
  5383. gitOutput = yield this.execGit(['lfs', 'version']);
  5384. stdout = gitOutput.stdout.trim();
  5385. if (!stdout.includes('\n')) {
  5386. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5387. if (match) {
  5388. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5389. }
  5390. }
  5391. if (!gitLfsVersion.isValid()) {
  5392. throw new Error('Unable to determine git-lfs version');
  5393. }
  5394. // Minimum git-lfs version
  5395. // Note:
  5396. // - Auth header not supported before 2.1
  5397. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5398. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5399. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5400. }
  5401. }
  5402. // Set the user agent
  5403. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5404. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5405. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5406. });
  5407. }
  5408. }
  5409. class GitOutput {
  5410. constructor() {
  5411. this.stdout = '';
  5412. this.exitCode = 0;
  5413. }
  5414. }
  5415. /***/ }),
  5416. /***/ 293:
  5417. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5418. "use strict";
  5419. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5420. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5421. return new (P || (P = Promise))(function (resolve, reject) {
  5422. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5423. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5424. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5425. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5426. });
  5427. };
  5428. var __importStar = (this && this.__importStar) || function (mod) {
  5429. if (mod && mod.__esModule) return mod;
  5430. var result = {};
  5431. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5432. result["default"] = mod;
  5433. return result;
  5434. };
  5435. Object.defineProperty(exports, "__esModule", { value: true });
  5436. const core = __importStar(__webpack_require__(470));
  5437. const fsHelper = __importStar(__webpack_require__(618));
  5438. const gitAuthHelper = __importStar(__webpack_require__(287));
  5439. const gitCommandManager = __importStar(__webpack_require__(289));
  5440. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5441. const githubApiHelper = __importStar(__webpack_require__(464));
  5442. const io = __importStar(__webpack_require__(1));
  5443. const path = __importStar(__webpack_require__(622));
  5444. const refHelper = __importStar(__webpack_require__(227));
  5445. const stateHelper = __importStar(__webpack_require__(153));
  5446. const urlHelper = __importStar(__webpack_require__(81));
  5447. function getSource(settings) {
  5448. return __awaiter(this, void 0, void 0, function* () {
  5449. // Repository URL
  5450. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5451. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5452. // Remove conflicting file path
  5453. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5454. yield io.rmRF(settings.repositoryPath);
  5455. }
  5456. // Create directory
  5457. let isExisting = true;
  5458. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5459. isExisting = false;
  5460. yield io.mkdirP(settings.repositoryPath);
  5461. }
  5462. // Git command manager
  5463. core.startGroup('Getting Git version info');
  5464. const git = yield getGitCommandManager(settings);
  5465. core.endGroup();
  5466. // Prepare existing directory, otherwise recreate
  5467. if (isExisting) {
  5468. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5469. }
  5470. if (!git) {
  5471. // Downloading using REST API
  5472. core.info(`The repository will be downloaded using the GitHub REST API`);
  5473. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5474. if (settings.submodules) {
  5475. 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.`);
  5476. }
  5477. else if (settings.sshKey) {
  5478. 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.`);
  5479. }
  5480. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5481. return;
  5482. }
  5483. // Save state for POST action
  5484. stateHelper.setRepositoryPath(settings.repositoryPath);
  5485. // Initialize the repository
  5486. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5487. core.startGroup('Initializing the repository');
  5488. yield git.init();
  5489. yield git.remoteAdd('origin', repositoryUrl);
  5490. core.endGroup();
  5491. }
  5492. // Disable automatic garbage collection
  5493. core.startGroup('Disabling automatic garbage collection');
  5494. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5495. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5496. }
  5497. core.endGroup();
  5498. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5499. try {
  5500. // Configure auth
  5501. core.startGroup('Setting up auth');
  5502. yield authHelper.configureAuth();
  5503. core.endGroup();
  5504. // Determine the default branch
  5505. if (!settings.ref && !settings.commit) {
  5506. core.startGroup('Determining the default branch');
  5507. if (settings.sshKey) {
  5508. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  5509. }
  5510. else {
  5511. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5512. }
  5513. core.endGroup();
  5514. }
  5515. // LFS install
  5516. if (settings.lfs) {
  5517. yield git.lfsInstall();
  5518. }
  5519. // Fetch
  5520. core.startGroup('Fetching the repository');
  5521. if (settings.fetchDepth <= 0) {
  5522. // Fetch all branches and tags
  5523. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5524. yield git.fetch(refSpec);
  5525. // When all history is fetched, the ref we're interested in may have moved to a different
  5526. // commit (push or force push). If so, fetch again with a targeted refspec.
  5527. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5528. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5529. yield git.fetch(refSpec);
  5530. }
  5531. }
  5532. else {
  5533. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5534. yield git.fetch(refSpec, settings.fetchDepth);
  5535. }
  5536. core.endGroup();
  5537. // Checkout info
  5538. core.startGroup('Determining the checkout info');
  5539. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5540. core.endGroup();
  5541. // LFS fetch
  5542. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5543. // Explicit lfs fetch will fetch lfs objects in parallel.
  5544. if (settings.lfs) {
  5545. core.startGroup('Fetching LFS objects');
  5546. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5547. core.endGroup();
  5548. }
  5549. // Checkout
  5550. core.startGroup('Checking out the ref');
  5551. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5552. core.endGroup();
  5553. // Submodules
  5554. if (settings.submodules) {
  5555. try {
  5556. // Temporarily override global config
  5557. core.startGroup('Setting up auth for fetching submodules');
  5558. yield authHelper.configureGlobalAuth();
  5559. core.endGroup();
  5560. // Checkout submodules
  5561. core.startGroup('Fetching submodules');
  5562. yield git.submoduleSync(settings.nestedSubmodules);
  5563. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5564. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5565. core.endGroup();
  5566. // Persist credentials
  5567. if (settings.persistCredentials) {
  5568. core.startGroup('Persisting credentials for submodules');
  5569. yield authHelper.configureSubmoduleAuth();
  5570. core.endGroup();
  5571. }
  5572. }
  5573. finally {
  5574. // Remove temporary global config override
  5575. yield authHelper.removeGlobalAuth();
  5576. }
  5577. }
  5578. // Dump some info about the checked out commit
  5579. const commitInfo = yield git.log1();
  5580. // Check for incorrect pull request merge commit
  5581. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5582. }
  5583. finally {
  5584. // Remove auth
  5585. if (!settings.persistCredentials) {
  5586. core.startGroup('Removing auth');
  5587. yield authHelper.removeAuth();
  5588. core.endGroup();
  5589. }
  5590. }
  5591. });
  5592. }
  5593. exports.getSource = getSource;
  5594. function cleanup(repositoryPath) {
  5595. return __awaiter(this, void 0, void 0, function* () {
  5596. // Repo exists?
  5597. if (!repositoryPath ||
  5598. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5599. return;
  5600. }
  5601. let git;
  5602. try {
  5603. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5604. }
  5605. catch (_a) {
  5606. return;
  5607. }
  5608. // Remove auth
  5609. const authHelper = gitAuthHelper.createAuthHelper(git);
  5610. yield authHelper.removeAuth();
  5611. });
  5612. }
  5613. exports.cleanup = cleanup;
  5614. function getGitCommandManager(settings) {
  5615. return __awaiter(this, void 0, void 0, function* () {
  5616. core.info(`Working directory is '${settings.repositoryPath}'`);
  5617. try {
  5618. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5619. }
  5620. catch (err) {
  5621. // Git is required for LFS
  5622. if (settings.lfs) {
  5623. throw err;
  5624. }
  5625. // Otherwise fallback to REST API
  5626. return undefined;
  5627. }
  5628. });
  5629. }
  5630. /***/ }),
  5631. /***/ 294:
  5632. /***/ (function(module, __unusedexports, __webpack_require__) {
  5633. module.exports = parseOptions;
  5634. const { Deprecation } = __webpack_require__(692);
  5635. const { getUserAgent } = __webpack_require__(796);
  5636. const once = __webpack_require__(969);
  5637. const pkg = __webpack_require__(215);
  5638. const deprecateOptionsTimeout = once((log, deprecation) =>
  5639. log.warn(deprecation)
  5640. );
  5641. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5642. const deprecateOptionsHeaders = once((log, deprecation) =>
  5643. log.warn(deprecation)
  5644. );
  5645. function parseOptions(options, log, hook) {
  5646. if (options.headers) {
  5647. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5648. newObj[key.toLowerCase()] = options.headers[key];
  5649. return newObj;
  5650. }, {});
  5651. }
  5652. const clientDefaults = {
  5653. headers: options.headers || {},
  5654. request: options.request || {},
  5655. mediaType: {
  5656. previews: [],
  5657. format: ""
  5658. }
  5659. };
  5660. if (options.baseUrl) {
  5661. clientDefaults.baseUrl = options.baseUrl;
  5662. }
  5663. if (options.userAgent) {
  5664. clientDefaults.headers["user-agent"] = options.userAgent;
  5665. }
  5666. if (options.previews) {
  5667. clientDefaults.mediaType.previews = options.previews;
  5668. }
  5669. if (options.timeZone) {
  5670. clientDefaults.headers["time-zone"] = options.timeZone;
  5671. }
  5672. if (options.timeout) {
  5673. deprecateOptionsTimeout(
  5674. log,
  5675. new Deprecation(
  5676. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5677. )
  5678. );
  5679. clientDefaults.request.timeout = options.timeout;
  5680. }
  5681. if (options.agent) {
  5682. deprecateOptionsAgent(
  5683. log,
  5684. new Deprecation(
  5685. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5686. )
  5687. );
  5688. clientDefaults.request.agent = options.agent;
  5689. }
  5690. if (options.headers) {
  5691. deprecateOptionsHeaders(
  5692. log,
  5693. new Deprecation(
  5694. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5695. )
  5696. );
  5697. }
  5698. const userAgentOption = clientDefaults.headers["user-agent"];
  5699. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5700. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5701. .filter(Boolean)
  5702. .join(" ");
  5703. clientDefaults.request.hook = hook.bind(null, "request");
  5704. return clientDefaults;
  5705. }
  5706. /***/ }),
  5707. /***/ 297:
  5708. /***/ (function(module) {
  5709. module.exports = class HttpError extends Error {
  5710. constructor (message, code, headers) {
  5711. super(message)
  5712. // Maintains proper stack trace (only available on V8)
  5713. /* istanbul ignore next */
  5714. if (Error.captureStackTrace) {
  5715. Error.captureStackTrace(this, this.constructor)
  5716. }
  5717. this.name = 'HttpError'
  5718. this.code = code
  5719. this.headers = headers
  5720. }
  5721. }
  5722. /***/ }),
  5723. /***/ 299:
  5724. /***/ (function(__unusedmodule, exports) {
  5725. "use strict";
  5726. Object.defineProperty(exports, '__esModule', { value: true });
  5727. const VERSION = "1.1.2";
  5728. /**
  5729. * Some “list” response that can be paginated have a different response structure
  5730. *
  5731. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5732. * /installation/repositories also has `repository_selection`), as well as a key with
  5733. * the list of the items which name varies from endpoint to endpoint:
  5734. *
  5735. * - https://developer.github.com/v3/search/#example (key `items`)
  5736. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5737. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5738. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5739. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5740. *
  5741. * Octokit normalizes these responses so that paginated results are always returned following
  5742. * the same structure. One challenge is that if the list response has only one page, no Link
  5743. * header is provided, so this header alone is not sufficient to check wether a response is
  5744. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5745. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5746. * property because it also exists in the response of Get the combined status for a specific ref.
  5747. */
  5748. 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))?([^/]|$)/];
  5749. function normalizePaginatedListResponse(octokit, url, response) {
  5750. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5751. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5752. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5753. // to retrieve the same information.
  5754. const incompleteResults = response.data.incomplete_results;
  5755. const repositorySelection = response.data.repository_selection;
  5756. const totalCount = response.data.total_count;
  5757. delete response.data.incomplete_results;
  5758. delete response.data.repository_selection;
  5759. delete response.data.total_count;
  5760. const namespaceKey = Object.keys(response.data)[0];
  5761. const data = response.data[namespaceKey];
  5762. response.data = data;
  5763. if (typeof incompleteResults !== "undefined") {
  5764. response.data.incomplete_results = incompleteResults;
  5765. }
  5766. if (typeof repositorySelection !== "undefined") {
  5767. response.data.repository_selection = repositorySelection;
  5768. }
  5769. response.data.total_count = totalCount;
  5770. Object.defineProperty(response.data, namespaceKey, {
  5771. get() {
  5772. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5773. return Array.from(data);
  5774. }
  5775. });
  5776. }
  5777. function iterator(octokit, route, parameters) {
  5778. const options = octokit.request.endpoint(route, parameters);
  5779. const method = options.method;
  5780. const headers = options.headers;
  5781. let url = options.url;
  5782. return {
  5783. [Symbol.asyncIterator]: () => ({
  5784. next() {
  5785. if (!url) {
  5786. return Promise.resolve({
  5787. done: true
  5788. });
  5789. }
  5790. return octokit.request({
  5791. method,
  5792. url,
  5793. headers
  5794. }).then(response => {
  5795. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5796. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5797. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5798. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5799. return {
  5800. value: response
  5801. };
  5802. });
  5803. }
  5804. })
  5805. };
  5806. }
  5807. function paginate(octokit, route, parameters, mapFn) {
  5808. if (typeof parameters === "function") {
  5809. mapFn = parameters;
  5810. parameters = undefined;
  5811. }
  5812. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5813. }
  5814. function gather(octokit, results, iterator, mapFn) {
  5815. return iterator.next().then(result => {
  5816. if (result.done) {
  5817. return results;
  5818. }
  5819. let earlyExit = false;
  5820. function done() {
  5821. earlyExit = true;
  5822. }
  5823. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5824. if (earlyExit) {
  5825. return results;
  5826. }
  5827. return gather(octokit, results, iterator, mapFn);
  5828. });
  5829. }
  5830. /**
  5831. * @param octokit Octokit instance
  5832. * @param options Options passed to Octokit constructor
  5833. */
  5834. function paginateRest(octokit) {
  5835. return {
  5836. paginate: Object.assign(paginate.bind(null, octokit), {
  5837. iterator: iterator.bind(null, octokit)
  5838. })
  5839. };
  5840. }
  5841. paginateRest.VERSION = VERSION;
  5842. exports.paginateRest = paginateRest;
  5843. //# sourceMappingURL=index.js.map
  5844. /***/ }),
  5845. /***/ 323:
  5846. /***/ (function(module) {
  5847. "use strict";
  5848. var isStream = module.exports = function (stream) {
  5849. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5850. };
  5851. isStream.writable = function (stream) {
  5852. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5853. };
  5854. isStream.readable = function (stream) {
  5855. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5856. };
  5857. isStream.duplex = function (stream) {
  5858. return isStream.writable(stream) && isStream.readable(stream);
  5859. };
  5860. isStream.transform = function (stream) {
  5861. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5862. };
  5863. /***/ }),
  5864. /***/ 335:
  5865. /***/ (function(module, __unusedexports, __webpack_require__) {
  5866. module.exports = __webpack_require__(179);
  5867. /***/ }),
  5868. /***/ 336:
  5869. /***/ (function(module, __unusedexports, __webpack_require__) {
  5870. module.exports = hasLastPage
  5871. const deprecate = __webpack_require__(370)
  5872. const getPageLinks = __webpack_require__(577)
  5873. function hasLastPage (link) {
  5874. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5875. return getPageLinks(link).last
  5876. }
  5877. /***/ }),
  5878. /***/ 348:
  5879. /***/ (function(module, __unusedexports, __webpack_require__) {
  5880. "use strict";
  5881. module.exports = validate;
  5882. const { RequestError } = __webpack_require__(497);
  5883. const get = __webpack_require__(854);
  5884. const set = __webpack_require__(883);
  5885. function validate(octokit, options) {
  5886. if (!options.request.validate) {
  5887. return;
  5888. }
  5889. const { validate: params } = options.request;
  5890. Object.keys(params).forEach(parameterName => {
  5891. const parameter = get(params, parameterName);
  5892. const expectedType = parameter.type;
  5893. let parentParameterName;
  5894. let parentValue;
  5895. let parentParamIsPresent = true;
  5896. let parentParameterIsArray = false;
  5897. if (/\./.test(parameterName)) {
  5898. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5899. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5900. if (parentParameterIsArray) {
  5901. parentParameterName = parentParameterName.slice(0, -2);
  5902. }
  5903. parentValue = get(options, parentParameterName);
  5904. parentParamIsPresent =
  5905. parentParameterName === "headers" ||
  5906. (typeof parentValue === "object" && parentValue !== null);
  5907. }
  5908. const values = parentParameterIsArray
  5909. ? (get(options, parentParameterName) || []).map(
  5910. value => value[parameterName.split(/\./).pop()]
  5911. )
  5912. : [get(options, parameterName)];
  5913. values.forEach((value, i) => {
  5914. const valueIsPresent = typeof value !== "undefined";
  5915. const valueIsNull = value === null;
  5916. const currentParameterName = parentParameterIsArray
  5917. ? parameterName.replace(/\[\]/, `[${i}]`)
  5918. : parameterName;
  5919. if (!parameter.required && !valueIsPresent) {
  5920. return;
  5921. }
  5922. // if the parent parameter is of type object but allows null
  5923. // then the child parameters can be ignored
  5924. if (!parentParamIsPresent) {
  5925. return;
  5926. }
  5927. if (parameter.allowNull && valueIsNull) {
  5928. return;
  5929. }
  5930. if (!parameter.allowNull && valueIsNull) {
  5931. throw new RequestError(
  5932. `'${currentParameterName}' cannot be null`,
  5933. 400,
  5934. {
  5935. request: options
  5936. }
  5937. );
  5938. }
  5939. if (parameter.required && !valueIsPresent) {
  5940. throw new RequestError(
  5941. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5942. value
  5943. )}`,
  5944. 400,
  5945. {
  5946. request: options
  5947. }
  5948. );
  5949. }
  5950. // parse to integer before checking for enum
  5951. // so that string "1" will match enum with number 1
  5952. if (expectedType === "integer") {
  5953. const unparsedValue = value;
  5954. value = parseInt(value, 10);
  5955. if (isNaN(value)) {
  5956. throw new RequestError(
  5957. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5958. unparsedValue
  5959. )} is NaN`,
  5960. 400,
  5961. {
  5962. request: options
  5963. }
  5964. );
  5965. }
  5966. }
  5967. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5968. throw new RequestError(
  5969. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5970. value
  5971. )}`,
  5972. 400,
  5973. {
  5974. request: options
  5975. }
  5976. );
  5977. }
  5978. if (parameter.validation) {
  5979. const regex = new RegExp(parameter.validation);
  5980. if (!regex.test(value)) {
  5981. throw new RequestError(
  5982. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5983. value
  5984. )}`,
  5985. 400,
  5986. {
  5987. request: options
  5988. }
  5989. );
  5990. }
  5991. }
  5992. if (expectedType === "object" && typeof value === "string") {
  5993. try {
  5994. value = JSON.parse(value);
  5995. } catch (exception) {
  5996. throw new RequestError(
  5997. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5998. value
  5999. )}`,
  6000. 400,
  6001. {
  6002. request: options
  6003. }
  6004. );
  6005. }
  6006. }
  6007. set(options, parameter.mapTo || currentParameterName, value);
  6008. });
  6009. });
  6010. return options;
  6011. }
  6012. /***/ }),
  6013. /***/ 349:
  6014. /***/ (function(module, __unusedexports, __webpack_require__) {
  6015. module.exports = authenticationRequestError;
  6016. const { RequestError } = __webpack_require__(497);
  6017. function authenticationRequestError(state, error, options) {
  6018. /* istanbul ignore next */
  6019. if (!error.headers) throw error;
  6020. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  6021. // handle "2FA required" error only
  6022. if (error.status !== 401 || !otpRequired) {
  6023. throw error;
  6024. }
  6025. if (
  6026. error.status === 401 &&
  6027. otpRequired &&
  6028. error.request &&
  6029. error.request.headers["x-github-otp"]
  6030. ) {
  6031. throw new RequestError(
  6032. "Invalid one-time password for two-factor authentication",
  6033. 401,
  6034. {
  6035. headers: error.headers,
  6036. request: options
  6037. }
  6038. );
  6039. }
  6040. if (typeof state.auth.on2fa !== "function") {
  6041. throw new RequestError(
  6042. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6043. 401,
  6044. {
  6045. headers: error.headers,
  6046. request: options
  6047. }
  6048. );
  6049. }
  6050. return Promise.resolve()
  6051. .then(() => {
  6052. return state.auth.on2fa();
  6053. })
  6054. .then(oneTimePassword => {
  6055. const newOptions = Object.assign(options, {
  6056. headers: Object.assign(
  6057. { "x-github-otp": oneTimePassword },
  6058. options.headers
  6059. )
  6060. });
  6061. return state.octokit.request(newOptions);
  6062. });
  6063. }
  6064. /***/ }),
  6065. /***/ 357:
  6066. /***/ (function(module) {
  6067. module.exports = require("assert");
  6068. /***/ }),
  6069. /***/ 363:
  6070. /***/ (function(module) {
  6071. module.exports = register
  6072. function register (state, name, method, options) {
  6073. if (typeof method !== 'function') {
  6074. throw new Error('method for before hook must be a function')
  6075. }
  6076. if (!options) {
  6077. options = {}
  6078. }
  6079. if (Array.isArray(name)) {
  6080. return name.reverse().reduce(function (callback, name) {
  6081. return register.bind(null, state, name, callback, options)
  6082. }, method)()
  6083. }
  6084. return Promise.resolve()
  6085. .then(function () {
  6086. if (!state.registry[name]) {
  6087. return method(options)
  6088. }
  6089. return (state.registry[name]).reduce(function (method, registered) {
  6090. return registered.hook.bind(null, method, options)
  6091. }, method)()
  6092. })
  6093. }
  6094. /***/ }),
  6095. /***/ 368:
  6096. /***/ (function(module) {
  6097. module.exports = function atob(str) {
  6098. return Buffer.from(str, 'base64').toString('binary')
  6099. }
  6100. /***/ }),
  6101. /***/ 370:
  6102. /***/ (function(module) {
  6103. module.exports = deprecate
  6104. const loggedMessages = {}
  6105. function deprecate (message) {
  6106. if (loggedMessages[message]) {
  6107. return
  6108. }
  6109. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6110. loggedMessages[message] = 1
  6111. }
  6112. /***/ }),
  6113. /***/ 385:
  6114. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6115. "use strict";
  6116. Object.defineProperty(exports, '__esModule', { value: true });
  6117. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6118. var isPlainObject = _interopDefault(__webpack_require__(696));
  6119. var universalUserAgent = __webpack_require__(562);
  6120. function lowercaseKeys(object) {
  6121. if (!object) {
  6122. return {};
  6123. }
  6124. return Object.keys(object).reduce((newObj, key) => {
  6125. newObj[key.toLowerCase()] = object[key];
  6126. return newObj;
  6127. }, {});
  6128. }
  6129. function mergeDeep(defaults, options) {
  6130. const result = Object.assign({}, defaults);
  6131. Object.keys(options).forEach(key => {
  6132. if (isPlainObject(options[key])) {
  6133. if (!(key in defaults)) Object.assign(result, {
  6134. [key]: options[key]
  6135. });else result[key] = mergeDeep(defaults[key], options[key]);
  6136. } else {
  6137. Object.assign(result, {
  6138. [key]: options[key]
  6139. });
  6140. }
  6141. });
  6142. return result;
  6143. }
  6144. function merge(defaults, route, options) {
  6145. if (typeof route === "string") {
  6146. let [method, url] = route.split(" ");
  6147. options = Object.assign(url ? {
  6148. method,
  6149. url
  6150. } : {
  6151. url: method
  6152. }, options);
  6153. } else {
  6154. options = Object.assign({}, route);
  6155. } // lowercase header names before merging with defaults to avoid duplicates
  6156. options.headers = lowercaseKeys(options.headers);
  6157. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6158. if (defaults && defaults.mediaType.previews.length) {
  6159. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6160. }
  6161. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6162. return mergedOptions;
  6163. }
  6164. function addQueryParameters(url, parameters) {
  6165. const separator = /\?/.test(url) ? "&" : "?";
  6166. const names = Object.keys(parameters);
  6167. if (names.length === 0) {
  6168. return url;
  6169. }
  6170. return url + separator + names.map(name => {
  6171. if (name === "q") {
  6172. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6173. }
  6174. return `${name}=${encodeURIComponent(parameters[name])}`;
  6175. }).join("&");
  6176. }
  6177. const urlVariableRegex = /\{[^}]+\}/g;
  6178. function removeNonChars(variableName) {
  6179. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6180. }
  6181. function extractUrlVariableNames(url) {
  6182. const matches = url.match(urlVariableRegex);
  6183. if (!matches) {
  6184. return [];
  6185. }
  6186. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6187. }
  6188. function omit(object, keysToOmit) {
  6189. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6190. obj[key] = object[key];
  6191. return obj;
  6192. }, {});
  6193. }
  6194. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6195. // TODO: create separate package.
  6196. //
  6197. // Copyright (c) 2012-2014, Bram Stein
  6198. // All rights reserved.
  6199. // Redistribution and use in source and binary forms, with or without
  6200. // modification, are permitted provided that the following conditions
  6201. // are met:
  6202. // 1. Redistributions of source code must retain the above copyright
  6203. // notice, this list of conditions and the following disclaimer.
  6204. // 2. Redistributions in binary form must reproduce the above copyright
  6205. // notice, this list of conditions and the following disclaimer in the
  6206. // documentation and/or other materials provided with the distribution.
  6207. // 3. The name of the author may not be used to endorse or promote products
  6208. // derived from this software without specific prior written permission.
  6209. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6210. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6211. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6212. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6213. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6214. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6215. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6216. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6217. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6218. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6219. /* istanbul ignore file */
  6220. function encodeReserved(str) {
  6221. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6222. if (!/%[0-9A-Fa-f]/.test(part)) {
  6223. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6224. }
  6225. return part;
  6226. }).join("");
  6227. }
  6228. function encodeUnreserved(str) {
  6229. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6230. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6231. });
  6232. }
  6233. function encodeValue(operator, value, key) {
  6234. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6235. if (key) {
  6236. return encodeUnreserved(key) + "=" + value;
  6237. } else {
  6238. return value;
  6239. }
  6240. }
  6241. function isDefined(value) {
  6242. return value !== undefined && value !== null;
  6243. }
  6244. function isKeyOperator(operator) {
  6245. return operator === ";" || operator === "&" || operator === "?";
  6246. }
  6247. function getValues(context, operator, key, modifier) {
  6248. var value = context[key],
  6249. result = [];
  6250. if (isDefined(value) && value !== "") {
  6251. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6252. value = value.toString();
  6253. if (modifier && modifier !== "*") {
  6254. value = value.substring(0, parseInt(modifier, 10));
  6255. }
  6256. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6257. } else {
  6258. if (modifier === "*") {
  6259. if (Array.isArray(value)) {
  6260. value.filter(isDefined).forEach(function (value) {
  6261. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6262. });
  6263. } else {
  6264. Object.keys(value).forEach(function (k) {
  6265. if (isDefined(value[k])) {
  6266. result.push(encodeValue(operator, value[k], k));
  6267. }
  6268. });
  6269. }
  6270. } else {
  6271. const tmp = [];
  6272. if (Array.isArray(value)) {
  6273. value.filter(isDefined).forEach(function (value) {
  6274. tmp.push(encodeValue(operator, value));
  6275. });
  6276. } else {
  6277. Object.keys(value).forEach(function (k) {
  6278. if (isDefined(value[k])) {
  6279. tmp.push(encodeUnreserved(k));
  6280. tmp.push(encodeValue(operator, value[k].toString()));
  6281. }
  6282. });
  6283. }
  6284. if (isKeyOperator(operator)) {
  6285. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6286. } else if (tmp.length !== 0) {
  6287. result.push(tmp.join(","));
  6288. }
  6289. }
  6290. }
  6291. } else {
  6292. if (operator === ";") {
  6293. if (isDefined(value)) {
  6294. result.push(encodeUnreserved(key));
  6295. }
  6296. } else if (value === "" && (operator === "&" || operator === "?")) {
  6297. result.push(encodeUnreserved(key) + "=");
  6298. } else if (value === "") {
  6299. result.push("");
  6300. }
  6301. }
  6302. return result;
  6303. }
  6304. function parseUrl(template) {
  6305. return {
  6306. expand: expand.bind(null, template)
  6307. };
  6308. }
  6309. function expand(template, context) {
  6310. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6311. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6312. if (expression) {
  6313. let operator = "";
  6314. const values = [];
  6315. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6316. operator = expression.charAt(0);
  6317. expression = expression.substr(1);
  6318. }
  6319. expression.split(/,/g).forEach(function (variable) {
  6320. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6321. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6322. });
  6323. if (operator && operator !== "+") {
  6324. var separator = ",";
  6325. if (operator === "?") {
  6326. separator = "&";
  6327. } else if (operator !== "#") {
  6328. separator = operator;
  6329. }
  6330. return (values.length !== 0 ? operator : "") + values.join(separator);
  6331. } else {
  6332. return values.join(",");
  6333. }
  6334. } else {
  6335. return encodeReserved(literal);
  6336. }
  6337. });
  6338. }
  6339. function parse(options) {
  6340. // https://fetch.spec.whatwg.org/#methods
  6341. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6342. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6343. let headers = Object.assign({}, options.headers);
  6344. let body;
  6345. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6346. const urlVariableNames = extractUrlVariableNames(url);
  6347. url = parseUrl(url).expand(parameters);
  6348. if (!/^http/.test(url)) {
  6349. url = options.baseUrl + url;
  6350. }
  6351. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6352. const remainingParameters = omit(parameters, omittedParameters);
  6353. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6354. if (!isBinaryRequset) {
  6355. if (options.mediaType.format) {
  6356. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6357. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6358. }
  6359. if (options.mediaType.previews.length) {
  6360. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6361. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6362. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6363. return `application/vnd.github.${preview}-preview${format}`;
  6364. }).join(",");
  6365. }
  6366. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6367. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6368. if (["GET", "HEAD"].includes(method)) {
  6369. url = addQueryParameters(url, remainingParameters);
  6370. } else {
  6371. if ("data" in remainingParameters) {
  6372. body = remainingParameters.data;
  6373. } else {
  6374. if (Object.keys(remainingParameters).length) {
  6375. body = remainingParameters;
  6376. } else {
  6377. headers["content-length"] = 0;
  6378. }
  6379. }
  6380. } // default content-type for JSON if body is set
  6381. if (!headers["content-type"] && typeof body !== "undefined") {
  6382. headers["content-type"] = "application/json; charset=utf-8";
  6383. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6384. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6385. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6386. body = "";
  6387. } // Only return body/request keys if present
  6388. return Object.assign({
  6389. method,
  6390. url,
  6391. headers
  6392. }, typeof body !== "undefined" ? {
  6393. body
  6394. } : null, options.request ? {
  6395. request: options.request
  6396. } : null);
  6397. }
  6398. function endpointWithDefaults(defaults, route, options) {
  6399. return parse(merge(defaults, route, options));
  6400. }
  6401. function withDefaults(oldDefaults, newDefaults) {
  6402. const DEFAULTS = merge(oldDefaults, newDefaults);
  6403. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6404. return Object.assign(endpoint, {
  6405. DEFAULTS,
  6406. defaults: withDefaults.bind(null, DEFAULTS),
  6407. merge: merge.bind(null, DEFAULTS),
  6408. parse
  6409. });
  6410. }
  6411. const VERSION = "6.0.1";
  6412. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6413. // So we use RequestParameters and add method as additional required property.
  6414. const DEFAULTS = {
  6415. method: "GET",
  6416. baseUrl: "https://api.github.com",
  6417. headers: {
  6418. accept: "application/vnd.github.v3+json",
  6419. "user-agent": userAgent
  6420. },
  6421. mediaType: {
  6422. format: "",
  6423. previews: []
  6424. }
  6425. };
  6426. const endpoint = withDefaults(null, DEFAULTS);
  6427. exports.endpoint = endpoint;
  6428. //# sourceMappingURL=index.js.map
  6429. /***/ }),
  6430. /***/ 389:
  6431. /***/ (function(module, __unusedexports, __webpack_require__) {
  6432. "use strict";
  6433. const fs = __webpack_require__(747);
  6434. const shebangCommand = __webpack_require__(866);
  6435. function readShebang(command) {
  6436. // Read the first 150 bytes from the file
  6437. const size = 150;
  6438. let buffer;
  6439. if (Buffer.alloc) {
  6440. // Node.js v4.5+ / v5.10+
  6441. buffer = Buffer.alloc(size);
  6442. } else {
  6443. // Old Node.js API
  6444. buffer = new Buffer(size);
  6445. buffer.fill(0); // zero-fill
  6446. }
  6447. let fd;
  6448. try {
  6449. fd = fs.openSync(command, 'r');
  6450. fs.readSync(fd, buffer, 0, size, 0);
  6451. fs.closeSync(fd);
  6452. } catch (e) { /* Empty */ }
  6453. // Attempt to extract shebang (null is returned if not a shebang)
  6454. return shebangCommand(buffer.toString());
  6455. }
  6456. module.exports = readShebang;
  6457. /***/ }),
  6458. /***/ 402:
  6459. /***/ (function(module, __unusedexports, __webpack_require__) {
  6460. module.exports = Octokit;
  6461. const { request } = __webpack_require__(753);
  6462. const Hook = __webpack_require__(523);
  6463. const parseClientOptions = __webpack_require__(294);
  6464. function Octokit(plugins, options) {
  6465. options = options || {};
  6466. const hook = new Hook.Collection();
  6467. const log = Object.assign(
  6468. {
  6469. debug: () => {},
  6470. info: () => {},
  6471. warn: console.warn,
  6472. error: console.error
  6473. },
  6474. options && options.log
  6475. );
  6476. const api = {
  6477. hook,
  6478. log,
  6479. request: request.defaults(parseClientOptions(options, log, hook))
  6480. };
  6481. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6482. return api;
  6483. }
  6484. /***/ }),
  6485. /***/ 413:
  6486. /***/ (function(module) {
  6487. module.exports = require("stream");
  6488. /***/ }),
  6489. /***/ 417:
  6490. /***/ (function(module) {
  6491. module.exports = require("crypto");
  6492. /***/ }),
  6493. /***/ 427:
  6494. /***/ (function(module, __unusedexports, __webpack_require__) {
  6495. "use strict";
  6496. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6497. // In that case, fall back to a deprecated internal.
  6498. const util = __webpack_require__(669);
  6499. let uv;
  6500. if (typeof util.getSystemErrorName === 'function') {
  6501. module.exports = util.getSystemErrorName;
  6502. } else {
  6503. try {
  6504. uv = process.binding('uv');
  6505. if (typeof uv.errname !== 'function') {
  6506. throw new TypeError('uv.errname is not a function');
  6507. }
  6508. } catch (err) {
  6509. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6510. uv = null;
  6511. }
  6512. module.exports = code => errname(uv, code);
  6513. }
  6514. // Used for testing the fallback behavior
  6515. module.exports.__test__ = errname;
  6516. function errname(uv, code) {
  6517. if (uv) {
  6518. return uv.errname(code);
  6519. }
  6520. if (!(code < 0)) {
  6521. throw new Error('err >= 0');
  6522. }
  6523. return `Unknown system error ${code}`;
  6524. }
  6525. /***/ }),
  6526. /***/ 430:
  6527. /***/ (function(module, __unusedexports, __webpack_require__) {
  6528. module.exports = octokitValidate;
  6529. const validate = __webpack_require__(348);
  6530. function octokitValidate(octokit) {
  6531. octokit.hook.before("request", validate.bind(null, octokit));
  6532. }
  6533. /***/ }),
  6534. /***/ 431:
  6535. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6536. "use strict";
  6537. Object.defineProperty(exports, "__esModule", { value: true });
  6538. const os = __webpack_require__(87);
  6539. /**
  6540. * Commands
  6541. *
  6542. * Command Format:
  6543. * ##[name key=value;key=value]message
  6544. *
  6545. * Examples:
  6546. * ##[warning]This is the user warning message
  6547. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6548. */
  6549. function issueCommand(command, properties, message) {
  6550. const cmd = new Command(command, properties, message);
  6551. process.stdout.write(cmd.toString() + os.EOL);
  6552. }
  6553. exports.issueCommand = issueCommand;
  6554. function issue(name, message = '') {
  6555. issueCommand(name, {}, message);
  6556. }
  6557. exports.issue = issue;
  6558. const CMD_STRING = '::';
  6559. class Command {
  6560. constructor(command, properties, message) {
  6561. if (!command) {
  6562. command = 'missing.command';
  6563. }
  6564. this.command = command;
  6565. this.properties = properties;
  6566. this.message = message;
  6567. }
  6568. toString() {
  6569. let cmdStr = CMD_STRING + this.command;
  6570. if (this.properties && Object.keys(this.properties).length > 0) {
  6571. cmdStr += ' ';
  6572. for (const key in this.properties) {
  6573. if (this.properties.hasOwnProperty(key)) {
  6574. const val = this.properties[key];
  6575. if (val) {
  6576. // safely append the val - avoid blowing up when attempting to
  6577. // call .replace() if message is not a string for some reason
  6578. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6579. }
  6580. }
  6581. }
  6582. }
  6583. cmdStr += CMD_STRING;
  6584. // safely append the message - avoid blowing up when attempting to
  6585. // call .replace() if message is not a string for some reason
  6586. const message = `${this.message || ''}`;
  6587. cmdStr += escapeData(message);
  6588. return cmdStr;
  6589. }
  6590. }
  6591. function escapeData(s) {
  6592. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6593. }
  6594. function escape(s) {
  6595. return s
  6596. .replace(/\r/g, '%0D')
  6597. .replace(/\n/g, '%0A')
  6598. .replace(/]/g, '%5D')
  6599. .replace(/;/g, '%3B');
  6600. }
  6601. //# sourceMappingURL=command.js.map
  6602. /***/ }),
  6603. /***/ 438:
  6604. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6605. "use strict";
  6606. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6607. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6608. return new (P || (P = Promise))(function (resolve, reject) {
  6609. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6610. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6611. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6612. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6613. });
  6614. };
  6615. var __importStar = (this && this.__importStar) || function (mod) {
  6616. if (mod && mod.__esModule) return mod;
  6617. var result = {};
  6618. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6619. result["default"] = mod;
  6620. return result;
  6621. };
  6622. Object.defineProperty(exports, "__esModule", { value: true });
  6623. const assert = __importStar(__webpack_require__(357));
  6624. const core = __importStar(__webpack_require__(470));
  6625. const fs = __importStar(__webpack_require__(747));
  6626. const fsHelper = __importStar(__webpack_require__(618));
  6627. const io = __importStar(__webpack_require__(1));
  6628. const path = __importStar(__webpack_require__(622));
  6629. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6630. return __awaiter(this, void 0, void 0, function* () {
  6631. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6632. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6633. // Indicates whether to delete the directory contents
  6634. let remove = false;
  6635. // Check whether using git or REST API
  6636. if (!git) {
  6637. remove = true;
  6638. }
  6639. // Fetch URL does not match
  6640. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6641. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6642. remove = true;
  6643. }
  6644. else {
  6645. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6646. const lockPaths = [
  6647. path.join(repositoryPath, '.git', 'index.lock'),
  6648. path.join(repositoryPath, '.git', 'shallow.lock')
  6649. ];
  6650. for (const lockPath of lockPaths) {
  6651. try {
  6652. yield io.rmRF(lockPath);
  6653. }
  6654. catch (error) {
  6655. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6656. }
  6657. }
  6658. try {
  6659. core.startGroup('Removing previously created refs, to avoid conflicts');
  6660. // Checkout detached HEAD
  6661. if (!(yield git.isDetached())) {
  6662. yield git.checkoutDetach();
  6663. }
  6664. // Remove all refs/heads/*
  6665. let branches = yield git.branchList(false);
  6666. for (const branch of branches) {
  6667. yield git.branchDelete(false, branch);
  6668. }
  6669. // Remove any conflicting refs/remotes/origin/*
  6670. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6671. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6672. if (ref) {
  6673. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6674. if (ref.startsWith('refs/heads/')) {
  6675. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6676. const upperName1Slash = `${upperName1}/`;
  6677. branches = yield git.branchList(true);
  6678. for (const branch of branches) {
  6679. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6680. const upperName2Slash = `${upperName2}/`;
  6681. if (upperName1.startsWith(upperName2Slash) ||
  6682. upperName2.startsWith(upperName1Slash)) {
  6683. yield git.branchDelete(true, branch);
  6684. }
  6685. }
  6686. }
  6687. }
  6688. core.endGroup();
  6689. // Clean
  6690. if (clean) {
  6691. core.startGroup('Cleaning the repository');
  6692. if (!(yield git.tryClean())) {
  6693. 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}'.`);
  6694. remove = true;
  6695. }
  6696. else if (!(yield git.tryReset())) {
  6697. remove = true;
  6698. }
  6699. core.endGroup();
  6700. if (remove) {
  6701. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6702. }
  6703. }
  6704. }
  6705. catch (error) {
  6706. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6707. remove = true;
  6708. }
  6709. }
  6710. if (remove) {
  6711. // Delete the contents of the directory. Don't delete the directory itself
  6712. // since it might be the current working directory.
  6713. core.info(`Deleting the contents of '${repositoryPath}'`);
  6714. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6715. yield io.rmRF(path.join(repositoryPath, file));
  6716. }
  6717. }
  6718. });
  6719. }
  6720. exports.prepareExistingDirectory = prepareExistingDirectory;
  6721. /***/ }),
  6722. /***/ 453:
  6723. /***/ (function(module, __unusedexports, __webpack_require__) {
  6724. var once = __webpack_require__(969)
  6725. var eos = __webpack_require__(3)
  6726. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6727. var noop = function () {}
  6728. var ancient = /^v?\.0/.test(process.version)
  6729. var isFn = function (fn) {
  6730. return typeof fn === 'function'
  6731. }
  6732. var isFS = function (stream) {
  6733. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6734. if (!fs) return false // browser
  6735. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6736. }
  6737. var isRequest = function (stream) {
  6738. return stream.setHeader && isFn(stream.abort)
  6739. }
  6740. var destroyer = function (stream, reading, writing, callback) {
  6741. callback = once(callback)
  6742. var closed = false
  6743. stream.on('close', function () {
  6744. closed = true
  6745. })
  6746. eos(stream, {readable: reading, writable: writing}, function (err) {
  6747. if (err) return callback(err)
  6748. closed = true
  6749. callback()
  6750. })
  6751. var destroyed = false
  6752. return function (err) {
  6753. if (closed) return
  6754. if (destroyed) return
  6755. destroyed = true
  6756. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6757. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6758. if (isFn(stream.destroy)) return stream.destroy()
  6759. callback(err || new Error('stream was destroyed'))
  6760. }
  6761. }
  6762. var call = function (fn) {
  6763. fn()
  6764. }
  6765. var pipe = function (from, to) {
  6766. return from.pipe(to)
  6767. }
  6768. var pump = function () {
  6769. var streams = Array.prototype.slice.call(arguments)
  6770. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6771. if (Array.isArray(streams[0])) streams = streams[0]
  6772. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6773. var error
  6774. var destroys = streams.map(function (stream, i) {
  6775. var reading = i < streams.length - 1
  6776. var writing = i > 0
  6777. return destroyer(stream, reading, writing, function (err) {
  6778. if (!error) error = err
  6779. if (err) destroys.forEach(call)
  6780. if (reading) return
  6781. destroys.forEach(call)
  6782. callback(error)
  6783. })
  6784. })
  6785. return streams.reduce(pipe)
  6786. }
  6787. module.exports = pump
  6788. /***/ }),
  6789. /***/ 454:
  6790. /***/ (function(module, exports, __webpack_require__) {
  6791. "use strict";
  6792. Object.defineProperty(exports, '__esModule', { value: true });
  6793. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6794. var Stream = _interopDefault(__webpack_require__(413));
  6795. var http = _interopDefault(__webpack_require__(605));
  6796. var Url = _interopDefault(__webpack_require__(835));
  6797. var https = _interopDefault(__webpack_require__(34));
  6798. var zlib = _interopDefault(__webpack_require__(761));
  6799. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6800. // fix for "Readable" isn't a named export issue
  6801. const Readable = Stream.Readable;
  6802. const BUFFER = Symbol('buffer');
  6803. const TYPE = Symbol('type');
  6804. class Blob {
  6805. constructor() {
  6806. this[TYPE] = '';
  6807. const blobParts = arguments[0];
  6808. const options = arguments[1];
  6809. const buffers = [];
  6810. let size = 0;
  6811. if (blobParts) {
  6812. const a = blobParts;
  6813. const length = Number(a.length);
  6814. for (let i = 0; i < length; i++) {
  6815. const element = a[i];
  6816. let buffer;
  6817. if (element instanceof Buffer) {
  6818. buffer = element;
  6819. } else if (ArrayBuffer.isView(element)) {
  6820. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6821. } else if (element instanceof ArrayBuffer) {
  6822. buffer = Buffer.from(element);
  6823. } else if (element instanceof Blob) {
  6824. buffer = element[BUFFER];
  6825. } else {
  6826. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6827. }
  6828. size += buffer.length;
  6829. buffers.push(buffer);
  6830. }
  6831. }
  6832. this[BUFFER] = Buffer.concat(buffers);
  6833. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6834. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6835. this[TYPE] = type;
  6836. }
  6837. }
  6838. get size() {
  6839. return this[BUFFER].length;
  6840. }
  6841. get type() {
  6842. return this[TYPE];
  6843. }
  6844. text() {
  6845. return Promise.resolve(this[BUFFER].toString());
  6846. }
  6847. arrayBuffer() {
  6848. const buf = this[BUFFER];
  6849. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6850. return Promise.resolve(ab);
  6851. }
  6852. stream() {
  6853. const readable = new Readable();
  6854. readable._read = function () {};
  6855. readable.push(this[BUFFER]);
  6856. readable.push(null);
  6857. return readable;
  6858. }
  6859. toString() {
  6860. return '[object Blob]';
  6861. }
  6862. slice() {
  6863. const size = this.size;
  6864. const start = arguments[0];
  6865. const end = arguments[1];
  6866. let relativeStart, relativeEnd;
  6867. if (start === undefined) {
  6868. relativeStart = 0;
  6869. } else if (start < 0) {
  6870. relativeStart = Math.max(size + start, 0);
  6871. } else {
  6872. relativeStart = Math.min(start, size);
  6873. }
  6874. if (end === undefined) {
  6875. relativeEnd = size;
  6876. } else if (end < 0) {
  6877. relativeEnd = Math.max(size + end, 0);
  6878. } else {
  6879. relativeEnd = Math.min(end, size);
  6880. }
  6881. const span = Math.max(relativeEnd - relativeStart, 0);
  6882. const buffer = this[BUFFER];
  6883. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6884. const blob = new Blob([], { type: arguments[2] });
  6885. blob[BUFFER] = slicedBuffer;
  6886. return blob;
  6887. }
  6888. }
  6889. Object.defineProperties(Blob.prototype, {
  6890. size: { enumerable: true },
  6891. type: { enumerable: true },
  6892. slice: { enumerable: true }
  6893. });
  6894. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6895. value: 'Blob',
  6896. writable: false,
  6897. enumerable: false,
  6898. configurable: true
  6899. });
  6900. /**
  6901. * fetch-error.js
  6902. *
  6903. * FetchError interface for operational errors
  6904. */
  6905. /**
  6906. * Create FetchError instance
  6907. *
  6908. * @param String message Error message for human
  6909. * @param String type Error type for machine
  6910. * @param String systemError For Node.js system error
  6911. * @return FetchError
  6912. */
  6913. function FetchError(message, type, systemError) {
  6914. Error.call(this, message);
  6915. this.message = message;
  6916. this.type = type;
  6917. // when err.type is `system`, err.code contains system error code
  6918. if (systemError) {
  6919. this.code = this.errno = systemError.code;
  6920. }
  6921. // hide custom error implementation details from end-users
  6922. Error.captureStackTrace(this, this.constructor);
  6923. }
  6924. FetchError.prototype = Object.create(Error.prototype);
  6925. FetchError.prototype.constructor = FetchError;
  6926. FetchError.prototype.name = 'FetchError';
  6927. let convert;
  6928. try {
  6929. convert = __webpack_require__(18).convert;
  6930. } catch (e) {}
  6931. const INTERNALS = Symbol('Body internals');
  6932. // fix an issue where "PassThrough" isn't a named export for node <10
  6933. const PassThrough = Stream.PassThrough;
  6934. /**
  6935. * Body mixin
  6936. *
  6937. * Ref: https://fetch.spec.whatwg.org/#body
  6938. *
  6939. * @param Stream body Readable stream
  6940. * @param Object opts Response options
  6941. * @return Void
  6942. */
  6943. function Body(body) {
  6944. var _this = this;
  6945. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6946. _ref$size = _ref.size;
  6947. let size = _ref$size === undefined ? 0 : _ref$size;
  6948. var _ref$timeout = _ref.timeout;
  6949. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6950. if (body == null) {
  6951. // body is undefined or null
  6952. body = null;
  6953. } else if (isURLSearchParams(body)) {
  6954. // body is a URLSearchParams
  6955. body = Buffer.from(body.toString());
  6956. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6957. // body is ArrayBuffer
  6958. body = Buffer.from(body);
  6959. } else if (ArrayBuffer.isView(body)) {
  6960. // body is ArrayBufferView
  6961. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6962. } else if (body instanceof Stream) ; else {
  6963. // none of the above
  6964. // coerce to string then buffer
  6965. body = Buffer.from(String(body));
  6966. }
  6967. this[INTERNALS] = {
  6968. body,
  6969. disturbed: false,
  6970. error: null
  6971. };
  6972. this.size = size;
  6973. this.timeout = timeout;
  6974. if (body instanceof Stream) {
  6975. body.on('error', function (err) {
  6976. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6977. _this[INTERNALS].error = error;
  6978. });
  6979. }
  6980. }
  6981. Body.prototype = {
  6982. get body() {
  6983. return this[INTERNALS].body;
  6984. },
  6985. get bodyUsed() {
  6986. return this[INTERNALS].disturbed;
  6987. },
  6988. /**
  6989. * Decode response as ArrayBuffer
  6990. *
  6991. * @return Promise
  6992. */
  6993. arrayBuffer() {
  6994. return consumeBody.call(this).then(function (buf) {
  6995. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6996. });
  6997. },
  6998. /**
  6999. * Return raw response as Blob
  7000. *
  7001. * @return Promise
  7002. */
  7003. blob() {
  7004. let ct = this.headers && this.headers.get('content-type') || '';
  7005. return consumeBody.call(this).then(function (buf) {
  7006. return Object.assign(
  7007. // Prevent copying
  7008. new Blob([], {
  7009. type: ct.toLowerCase()
  7010. }), {
  7011. [BUFFER]: buf
  7012. });
  7013. });
  7014. },
  7015. /**
  7016. * Decode response as json
  7017. *
  7018. * @return Promise
  7019. */
  7020. json() {
  7021. var _this2 = this;
  7022. return consumeBody.call(this).then(function (buffer) {
  7023. try {
  7024. return JSON.parse(buffer.toString());
  7025. } catch (err) {
  7026. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  7027. }
  7028. });
  7029. },
  7030. /**
  7031. * Decode response as text
  7032. *
  7033. * @return Promise
  7034. */
  7035. text() {
  7036. return consumeBody.call(this).then(function (buffer) {
  7037. return buffer.toString();
  7038. });
  7039. },
  7040. /**
  7041. * Decode response as buffer (non-spec api)
  7042. *
  7043. * @return Promise
  7044. */
  7045. buffer() {
  7046. return consumeBody.call(this);
  7047. },
  7048. /**
  7049. * Decode response as text, while automatically detecting the encoding and
  7050. * trying to decode to UTF-8 (non-spec api)
  7051. *
  7052. * @return Promise
  7053. */
  7054. textConverted() {
  7055. var _this3 = this;
  7056. return consumeBody.call(this).then(function (buffer) {
  7057. return convertBody(buffer, _this3.headers);
  7058. });
  7059. }
  7060. };
  7061. // In browsers, all properties are enumerable.
  7062. Object.defineProperties(Body.prototype, {
  7063. body: { enumerable: true },
  7064. bodyUsed: { enumerable: true },
  7065. arrayBuffer: { enumerable: true },
  7066. blob: { enumerable: true },
  7067. json: { enumerable: true },
  7068. text: { enumerable: true }
  7069. });
  7070. Body.mixIn = function (proto) {
  7071. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7072. // istanbul ignore else: future proof
  7073. if (!(name in proto)) {
  7074. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7075. Object.defineProperty(proto, name, desc);
  7076. }
  7077. }
  7078. };
  7079. /**
  7080. * Consume and convert an entire Body to a Buffer.
  7081. *
  7082. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7083. *
  7084. * @return Promise
  7085. */
  7086. function consumeBody() {
  7087. var _this4 = this;
  7088. if (this[INTERNALS].disturbed) {
  7089. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7090. }
  7091. this[INTERNALS].disturbed = true;
  7092. if (this[INTERNALS].error) {
  7093. return Body.Promise.reject(this[INTERNALS].error);
  7094. }
  7095. let body = this.body;
  7096. // body is null
  7097. if (body === null) {
  7098. return Body.Promise.resolve(Buffer.alloc(0));
  7099. }
  7100. // body is blob
  7101. if (isBlob(body)) {
  7102. body = body.stream();
  7103. }
  7104. // body is buffer
  7105. if (Buffer.isBuffer(body)) {
  7106. return Body.Promise.resolve(body);
  7107. }
  7108. // istanbul ignore if: should never happen
  7109. if (!(body instanceof Stream)) {
  7110. return Body.Promise.resolve(Buffer.alloc(0));
  7111. }
  7112. // body is stream
  7113. // get ready to actually consume the body
  7114. let accum = [];
  7115. let accumBytes = 0;
  7116. let abort = false;
  7117. return new Body.Promise(function (resolve, reject) {
  7118. let resTimeout;
  7119. // allow timeout on slow response body
  7120. if (_this4.timeout) {
  7121. resTimeout = setTimeout(function () {
  7122. abort = true;
  7123. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7124. }, _this4.timeout);
  7125. }
  7126. // handle stream errors
  7127. body.on('error', function (err) {
  7128. if (err.name === 'AbortError') {
  7129. // if the request was aborted, reject with this Error
  7130. abort = true;
  7131. reject(err);
  7132. } else {
  7133. // other errors, such as incorrect content-encoding
  7134. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7135. }
  7136. });
  7137. body.on('data', function (chunk) {
  7138. if (abort || chunk === null) {
  7139. return;
  7140. }
  7141. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7142. abort = true;
  7143. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7144. return;
  7145. }
  7146. accumBytes += chunk.length;
  7147. accum.push(chunk);
  7148. });
  7149. body.on('end', function () {
  7150. if (abort) {
  7151. return;
  7152. }
  7153. clearTimeout(resTimeout);
  7154. try {
  7155. resolve(Buffer.concat(accum, accumBytes));
  7156. } catch (err) {
  7157. // handle streams that have accumulated too much data (issue #414)
  7158. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7159. }
  7160. });
  7161. });
  7162. }
  7163. /**
  7164. * Detect buffer encoding and convert to target encoding
  7165. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7166. *
  7167. * @param Buffer buffer Incoming buffer
  7168. * @param String encoding Target encoding
  7169. * @return String
  7170. */
  7171. function convertBody(buffer, headers) {
  7172. if (typeof convert !== 'function') {
  7173. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7174. }
  7175. const ct = headers.get('content-type');
  7176. let charset = 'utf-8';
  7177. let res, str;
  7178. // header
  7179. if (ct) {
  7180. res = /charset=([^;]*)/i.exec(ct);
  7181. }
  7182. // no charset in content type, peek at response body for at most 1024 bytes
  7183. str = buffer.slice(0, 1024).toString();
  7184. // html5
  7185. if (!res && str) {
  7186. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7187. }
  7188. // html4
  7189. if (!res && str) {
  7190. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7191. if (res) {
  7192. res = /charset=(.*)/i.exec(res.pop());
  7193. }
  7194. }
  7195. // xml
  7196. if (!res && str) {
  7197. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7198. }
  7199. // found charset
  7200. if (res) {
  7201. charset = res.pop();
  7202. // prevent decode issues when sites use incorrect encoding
  7203. // ref: https://hsivonen.fi/encoding-menu/
  7204. if (charset === 'gb2312' || charset === 'gbk') {
  7205. charset = 'gb18030';
  7206. }
  7207. }
  7208. // turn raw buffers into a single utf-8 buffer
  7209. return convert(buffer, 'UTF-8', charset).toString();
  7210. }
  7211. /**
  7212. * Detect a URLSearchParams object
  7213. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7214. *
  7215. * @param Object obj Object to detect by type or brand
  7216. * @return String
  7217. */
  7218. function isURLSearchParams(obj) {
  7219. // Duck-typing as a necessary condition.
  7220. 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') {
  7221. return false;
  7222. }
  7223. // Brand-checking and more duck-typing as optional condition.
  7224. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7225. }
  7226. /**
  7227. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7228. * @param {*} obj
  7229. * @return {boolean}
  7230. */
  7231. function isBlob(obj) {
  7232. 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]);
  7233. }
  7234. /**
  7235. * Clone body given Res/Req instance
  7236. *
  7237. * @param Mixed instance Response or Request instance
  7238. * @return Mixed
  7239. */
  7240. function clone(instance) {
  7241. let p1, p2;
  7242. let body = instance.body;
  7243. // don't allow cloning a used body
  7244. if (instance.bodyUsed) {
  7245. throw new Error('cannot clone body after it is used');
  7246. }
  7247. // check that body is a stream and not form-data object
  7248. // note: we can't clone the form-data object without having it as a dependency
  7249. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7250. // tee instance body
  7251. p1 = new PassThrough();
  7252. p2 = new PassThrough();
  7253. body.pipe(p1);
  7254. body.pipe(p2);
  7255. // set instance body to teed body and return the other teed body
  7256. instance[INTERNALS].body = p1;
  7257. body = p2;
  7258. }
  7259. return body;
  7260. }
  7261. /**
  7262. * Performs the operation "extract a `Content-Type` value from |object|" as
  7263. * specified in the specification:
  7264. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7265. *
  7266. * This function assumes that instance.body is present.
  7267. *
  7268. * @param Mixed instance Any options.body input
  7269. */
  7270. function extractContentType(body) {
  7271. if (body === null) {
  7272. // body is null
  7273. return null;
  7274. } else if (typeof body === 'string') {
  7275. // body is string
  7276. return 'text/plain;charset=UTF-8';
  7277. } else if (isURLSearchParams(body)) {
  7278. // body is a URLSearchParams
  7279. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7280. } else if (isBlob(body)) {
  7281. // body is blob
  7282. return body.type || null;
  7283. } else if (Buffer.isBuffer(body)) {
  7284. // body is buffer
  7285. return null;
  7286. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7287. // body is ArrayBuffer
  7288. return null;
  7289. } else if (ArrayBuffer.isView(body)) {
  7290. // body is ArrayBufferView
  7291. return null;
  7292. } else if (typeof body.getBoundary === 'function') {
  7293. // detect form data input from form-data module
  7294. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7295. } else if (body instanceof Stream) {
  7296. // body is stream
  7297. // can't really do much about this
  7298. return null;
  7299. } else {
  7300. // Body constructor defaults other things to string
  7301. return 'text/plain;charset=UTF-8';
  7302. }
  7303. }
  7304. /**
  7305. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7306. * For us, we have to explicitly get it with a function.
  7307. *
  7308. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7309. *
  7310. * @param Body instance Instance of Body
  7311. * @return Number? Number of bytes, or null if not possible
  7312. */
  7313. function getTotalBytes(instance) {
  7314. const body = instance.body;
  7315. if (body === null) {
  7316. // body is null
  7317. return 0;
  7318. } else if (isBlob(body)) {
  7319. return body.size;
  7320. } else if (Buffer.isBuffer(body)) {
  7321. // body is buffer
  7322. return body.length;
  7323. } else if (body && typeof body.getLengthSync === 'function') {
  7324. // detect form data input from form-data module
  7325. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7326. body.hasKnownLength && body.hasKnownLength()) {
  7327. // 2.x
  7328. return body.getLengthSync();
  7329. }
  7330. return null;
  7331. } else {
  7332. // body is stream
  7333. return null;
  7334. }
  7335. }
  7336. /**
  7337. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7338. *
  7339. * @param Body instance Instance of Body
  7340. * @return Void
  7341. */
  7342. function writeToStream(dest, instance) {
  7343. const body = instance.body;
  7344. if (body === null) {
  7345. // body is null
  7346. dest.end();
  7347. } else if (isBlob(body)) {
  7348. body.stream().pipe(dest);
  7349. } else if (Buffer.isBuffer(body)) {
  7350. // body is buffer
  7351. dest.write(body);
  7352. dest.end();
  7353. } else {
  7354. // body is stream
  7355. body.pipe(dest);
  7356. }
  7357. }
  7358. // expose Promise
  7359. Body.Promise = global.Promise;
  7360. /**
  7361. * headers.js
  7362. *
  7363. * Headers class offers convenient helpers
  7364. */
  7365. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7366. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7367. function validateName(name) {
  7368. name = `${name}`;
  7369. if (invalidTokenRegex.test(name) || name === '') {
  7370. throw new TypeError(`${name} is not a legal HTTP header name`);
  7371. }
  7372. }
  7373. function validateValue(value) {
  7374. value = `${value}`;
  7375. if (invalidHeaderCharRegex.test(value)) {
  7376. throw new TypeError(`${value} is not a legal HTTP header value`);
  7377. }
  7378. }
  7379. /**
  7380. * Find the key in the map object given a header name.
  7381. *
  7382. * Returns undefined if not found.
  7383. *
  7384. * @param String name Header name
  7385. * @return String|Undefined
  7386. */
  7387. function find(map, name) {
  7388. name = name.toLowerCase();
  7389. for (const key in map) {
  7390. if (key.toLowerCase() === name) {
  7391. return key;
  7392. }
  7393. }
  7394. return undefined;
  7395. }
  7396. const MAP = Symbol('map');
  7397. class Headers {
  7398. /**
  7399. * Headers class
  7400. *
  7401. * @param Object headers Response headers
  7402. * @return Void
  7403. */
  7404. constructor() {
  7405. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7406. this[MAP] = Object.create(null);
  7407. if (init instanceof Headers) {
  7408. const rawHeaders = init.raw();
  7409. const headerNames = Object.keys(rawHeaders);
  7410. for (const headerName of headerNames) {
  7411. for (const value of rawHeaders[headerName]) {
  7412. this.append(headerName, value);
  7413. }
  7414. }
  7415. return;
  7416. }
  7417. // We don't worry about converting prop to ByteString here as append()
  7418. // will handle it.
  7419. if (init == null) ; else if (typeof init === 'object') {
  7420. const method = init[Symbol.iterator];
  7421. if (method != null) {
  7422. if (typeof method !== 'function') {
  7423. throw new TypeError('Header pairs must be iterable');
  7424. }
  7425. // sequence<sequence<ByteString>>
  7426. // Note: per spec we have to first exhaust the lists then process them
  7427. const pairs = [];
  7428. for (const pair of init) {
  7429. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7430. throw new TypeError('Each header pair must be iterable');
  7431. }
  7432. pairs.push(Array.from(pair));
  7433. }
  7434. for (const pair of pairs) {
  7435. if (pair.length !== 2) {
  7436. throw new TypeError('Each header pair must be a name/value tuple');
  7437. }
  7438. this.append(pair[0], pair[1]);
  7439. }
  7440. } else {
  7441. // record<ByteString, ByteString>
  7442. for (const key of Object.keys(init)) {
  7443. const value = init[key];
  7444. this.append(key, value);
  7445. }
  7446. }
  7447. } else {
  7448. throw new TypeError('Provided initializer must be an object');
  7449. }
  7450. }
  7451. /**
  7452. * Return combined header value given name
  7453. *
  7454. * @param String name Header name
  7455. * @return Mixed
  7456. */
  7457. get(name) {
  7458. name = `${name}`;
  7459. validateName(name);
  7460. const key = find(this[MAP], name);
  7461. if (key === undefined) {
  7462. return null;
  7463. }
  7464. return this[MAP][key].join(', ');
  7465. }
  7466. /**
  7467. * Iterate over all headers
  7468. *
  7469. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7470. * @param Boolean thisArg `this` context for callback function
  7471. * @return Void
  7472. */
  7473. forEach(callback) {
  7474. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7475. let pairs = getHeaders(this);
  7476. let i = 0;
  7477. while (i < pairs.length) {
  7478. var _pairs$i = pairs[i];
  7479. const name = _pairs$i[0],
  7480. value = _pairs$i[1];
  7481. callback.call(thisArg, value, name, this);
  7482. pairs = getHeaders(this);
  7483. i++;
  7484. }
  7485. }
  7486. /**
  7487. * Overwrite header values given name
  7488. *
  7489. * @param String name Header name
  7490. * @param String value Header value
  7491. * @return Void
  7492. */
  7493. set(name, value) {
  7494. name = `${name}`;
  7495. value = `${value}`;
  7496. validateName(name);
  7497. validateValue(value);
  7498. const key = find(this[MAP], name);
  7499. this[MAP][key !== undefined ? key : name] = [value];
  7500. }
  7501. /**
  7502. * Append a value onto existing header
  7503. *
  7504. * @param String name Header name
  7505. * @param String value Header value
  7506. * @return Void
  7507. */
  7508. append(name, value) {
  7509. name = `${name}`;
  7510. value = `${value}`;
  7511. validateName(name);
  7512. validateValue(value);
  7513. const key = find(this[MAP], name);
  7514. if (key !== undefined) {
  7515. this[MAP][key].push(value);
  7516. } else {
  7517. this[MAP][name] = [value];
  7518. }
  7519. }
  7520. /**
  7521. * Check for header name existence
  7522. *
  7523. * @param String name Header name
  7524. * @return Boolean
  7525. */
  7526. has(name) {
  7527. name = `${name}`;
  7528. validateName(name);
  7529. return find(this[MAP], name) !== undefined;
  7530. }
  7531. /**
  7532. * Delete all header values given name
  7533. *
  7534. * @param String name Header name
  7535. * @return Void
  7536. */
  7537. delete(name) {
  7538. name = `${name}`;
  7539. validateName(name);
  7540. const key = find(this[MAP], name);
  7541. if (key !== undefined) {
  7542. delete this[MAP][key];
  7543. }
  7544. }
  7545. /**
  7546. * Return raw headers (non-spec api)
  7547. *
  7548. * @return Object
  7549. */
  7550. raw() {
  7551. return this[MAP];
  7552. }
  7553. /**
  7554. * Get an iterator on keys.
  7555. *
  7556. * @return Iterator
  7557. */
  7558. keys() {
  7559. return createHeadersIterator(this, 'key');
  7560. }
  7561. /**
  7562. * Get an iterator on values.
  7563. *
  7564. * @return Iterator
  7565. */
  7566. values() {
  7567. return createHeadersIterator(this, 'value');
  7568. }
  7569. /**
  7570. * Get an iterator on entries.
  7571. *
  7572. * This is the default iterator of the Headers object.
  7573. *
  7574. * @return Iterator
  7575. */
  7576. [Symbol.iterator]() {
  7577. return createHeadersIterator(this, 'key+value');
  7578. }
  7579. }
  7580. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7581. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7582. value: 'Headers',
  7583. writable: false,
  7584. enumerable: false,
  7585. configurable: true
  7586. });
  7587. Object.defineProperties(Headers.prototype, {
  7588. get: { enumerable: true },
  7589. forEach: { enumerable: true },
  7590. set: { enumerable: true },
  7591. append: { enumerable: true },
  7592. has: { enumerable: true },
  7593. delete: { enumerable: true },
  7594. keys: { enumerable: true },
  7595. values: { enumerable: true },
  7596. entries: { enumerable: true }
  7597. });
  7598. function getHeaders(headers) {
  7599. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7600. const keys = Object.keys(headers[MAP]).sort();
  7601. return keys.map(kind === 'key' ? function (k) {
  7602. return k.toLowerCase();
  7603. } : kind === 'value' ? function (k) {
  7604. return headers[MAP][k].join(', ');
  7605. } : function (k) {
  7606. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7607. });
  7608. }
  7609. const INTERNAL = Symbol('internal');
  7610. function createHeadersIterator(target, kind) {
  7611. const iterator = Object.create(HeadersIteratorPrototype);
  7612. iterator[INTERNAL] = {
  7613. target,
  7614. kind,
  7615. index: 0
  7616. };
  7617. return iterator;
  7618. }
  7619. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7620. next() {
  7621. // istanbul ignore if
  7622. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7623. throw new TypeError('Value of `this` is not a HeadersIterator');
  7624. }
  7625. var _INTERNAL = this[INTERNAL];
  7626. const target = _INTERNAL.target,
  7627. kind = _INTERNAL.kind,
  7628. index = _INTERNAL.index;
  7629. const values = getHeaders(target, kind);
  7630. const len = values.length;
  7631. if (index >= len) {
  7632. return {
  7633. value: undefined,
  7634. done: true
  7635. };
  7636. }
  7637. this[INTERNAL].index = index + 1;
  7638. return {
  7639. value: values[index],
  7640. done: false
  7641. };
  7642. }
  7643. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7644. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7645. value: 'HeadersIterator',
  7646. writable: false,
  7647. enumerable: false,
  7648. configurable: true
  7649. });
  7650. /**
  7651. * Export the Headers object in a form that Node.js can consume.
  7652. *
  7653. * @param Headers headers
  7654. * @return Object
  7655. */
  7656. function exportNodeCompatibleHeaders(headers) {
  7657. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7658. // http.request() only supports string as Host header. This hack makes
  7659. // specifying custom Host header possible.
  7660. const hostHeaderKey = find(headers[MAP], 'Host');
  7661. if (hostHeaderKey !== undefined) {
  7662. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7663. }
  7664. return obj;
  7665. }
  7666. /**
  7667. * Create a Headers object from an object of headers, ignoring those that do
  7668. * not conform to HTTP grammar productions.
  7669. *
  7670. * @param Object obj Object of headers
  7671. * @return Headers
  7672. */
  7673. function createHeadersLenient(obj) {
  7674. const headers = new Headers();
  7675. for (const name of Object.keys(obj)) {
  7676. if (invalidTokenRegex.test(name)) {
  7677. continue;
  7678. }
  7679. if (Array.isArray(obj[name])) {
  7680. for (const val of obj[name]) {
  7681. if (invalidHeaderCharRegex.test(val)) {
  7682. continue;
  7683. }
  7684. if (headers[MAP][name] === undefined) {
  7685. headers[MAP][name] = [val];
  7686. } else {
  7687. headers[MAP][name].push(val);
  7688. }
  7689. }
  7690. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7691. headers[MAP][name] = [obj[name]];
  7692. }
  7693. }
  7694. return headers;
  7695. }
  7696. const INTERNALS$1 = Symbol('Response internals');
  7697. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7698. const STATUS_CODES = http.STATUS_CODES;
  7699. /**
  7700. * Response class
  7701. *
  7702. * @param Stream body Readable stream
  7703. * @param Object opts Response options
  7704. * @return Void
  7705. */
  7706. class Response {
  7707. constructor() {
  7708. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7709. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7710. Body.call(this, body, opts);
  7711. const status = opts.status || 200;
  7712. const headers = new Headers(opts.headers);
  7713. if (body != null && !headers.has('Content-Type')) {
  7714. const contentType = extractContentType(body);
  7715. if (contentType) {
  7716. headers.append('Content-Type', contentType);
  7717. }
  7718. }
  7719. this[INTERNALS$1] = {
  7720. url: opts.url,
  7721. status,
  7722. statusText: opts.statusText || STATUS_CODES[status],
  7723. headers,
  7724. counter: opts.counter
  7725. };
  7726. }
  7727. get url() {
  7728. return this[INTERNALS$1].url || '';
  7729. }
  7730. get status() {
  7731. return this[INTERNALS$1].status;
  7732. }
  7733. /**
  7734. * Convenience property representing if the request ended normally
  7735. */
  7736. get ok() {
  7737. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7738. }
  7739. get redirected() {
  7740. return this[INTERNALS$1].counter > 0;
  7741. }
  7742. get statusText() {
  7743. return this[INTERNALS$1].statusText;
  7744. }
  7745. get headers() {
  7746. return this[INTERNALS$1].headers;
  7747. }
  7748. /**
  7749. * Clone this response
  7750. *
  7751. * @return Response
  7752. */
  7753. clone() {
  7754. return new Response(clone(this), {
  7755. url: this.url,
  7756. status: this.status,
  7757. statusText: this.statusText,
  7758. headers: this.headers,
  7759. ok: this.ok,
  7760. redirected: this.redirected
  7761. });
  7762. }
  7763. }
  7764. Body.mixIn(Response.prototype);
  7765. Object.defineProperties(Response.prototype, {
  7766. url: { enumerable: true },
  7767. status: { enumerable: true },
  7768. ok: { enumerable: true },
  7769. redirected: { enumerable: true },
  7770. statusText: { enumerable: true },
  7771. headers: { enumerable: true },
  7772. clone: { enumerable: true }
  7773. });
  7774. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7775. value: 'Response',
  7776. writable: false,
  7777. enumerable: false,
  7778. configurable: true
  7779. });
  7780. const INTERNALS$2 = Symbol('Request internals');
  7781. // fix an issue where "format", "parse" aren't a named export for node <10
  7782. const parse_url = Url.parse;
  7783. const format_url = Url.format;
  7784. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7785. /**
  7786. * Check if a value is an instance of Request.
  7787. *
  7788. * @param Mixed input
  7789. * @return Boolean
  7790. */
  7791. function isRequest(input) {
  7792. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7793. }
  7794. function isAbortSignal(signal) {
  7795. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7796. return !!(proto && proto.constructor.name === 'AbortSignal');
  7797. }
  7798. /**
  7799. * Request class
  7800. *
  7801. * @param Mixed input Url or Request instance
  7802. * @param Object init Custom options
  7803. * @return Void
  7804. */
  7805. class Request {
  7806. constructor(input) {
  7807. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7808. let parsedURL;
  7809. // normalize input
  7810. if (!isRequest(input)) {
  7811. if (input && input.href) {
  7812. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7813. // will fall into this branch also (since their `toString()` will return
  7814. // `href` property anyway)
  7815. parsedURL = parse_url(input.href);
  7816. } else {
  7817. // coerce input to a string before attempting to parse
  7818. parsedURL = parse_url(`${input}`);
  7819. }
  7820. input = {};
  7821. } else {
  7822. parsedURL = parse_url(input.url);
  7823. }
  7824. let method = init.method || input.method || 'GET';
  7825. method = method.toUpperCase();
  7826. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7827. throw new TypeError('Request with GET/HEAD method cannot have body');
  7828. }
  7829. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7830. Body.call(this, inputBody, {
  7831. timeout: init.timeout || input.timeout || 0,
  7832. size: init.size || input.size || 0
  7833. });
  7834. const headers = new Headers(init.headers || input.headers || {});
  7835. if (inputBody != null && !headers.has('Content-Type')) {
  7836. const contentType = extractContentType(inputBody);
  7837. if (contentType) {
  7838. headers.append('Content-Type', contentType);
  7839. }
  7840. }
  7841. let signal = isRequest(input) ? input.signal : null;
  7842. if ('signal' in init) signal = init.signal;
  7843. if (signal != null && !isAbortSignal(signal)) {
  7844. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7845. }
  7846. this[INTERNALS$2] = {
  7847. method,
  7848. redirect: init.redirect || input.redirect || 'follow',
  7849. headers,
  7850. parsedURL,
  7851. signal
  7852. };
  7853. // node-fetch-only options
  7854. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7855. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7856. this.counter = init.counter || input.counter || 0;
  7857. this.agent = init.agent || input.agent;
  7858. }
  7859. get method() {
  7860. return this[INTERNALS$2].method;
  7861. }
  7862. get url() {
  7863. return format_url(this[INTERNALS$2].parsedURL);
  7864. }
  7865. get headers() {
  7866. return this[INTERNALS$2].headers;
  7867. }
  7868. get redirect() {
  7869. return this[INTERNALS$2].redirect;
  7870. }
  7871. get signal() {
  7872. return this[INTERNALS$2].signal;
  7873. }
  7874. /**
  7875. * Clone this request
  7876. *
  7877. * @return Request
  7878. */
  7879. clone() {
  7880. return new Request(this);
  7881. }
  7882. }
  7883. Body.mixIn(Request.prototype);
  7884. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7885. value: 'Request',
  7886. writable: false,
  7887. enumerable: false,
  7888. configurable: true
  7889. });
  7890. Object.defineProperties(Request.prototype, {
  7891. method: { enumerable: true },
  7892. url: { enumerable: true },
  7893. headers: { enumerable: true },
  7894. redirect: { enumerable: true },
  7895. clone: { enumerable: true },
  7896. signal: { enumerable: true }
  7897. });
  7898. /**
  7899. * Convert a Request to Node.js http request options.
  7900. *
  7901. * @param Request A Request instance
  7902. * @return Object The options object to be passed to http.request
  7903. */
  7904. function getNodeRequestOptions(request) {
  7905. const parsedURL = request[INTERNALS$2].parsedURL;
  7906. const headers = new Headers(request[INTERNALS$2].headers);
  7907. // fetch step 1.3
  7908. if (!headers.has('Accept')) {
  7909. headers.set('Accept', '*/*');
  7910. }
  7911. // Basic fetch
  7912. if (!parsedURL.protocol || !parsedURL.hostname) {
  7913. throw new TypeError('Only absolute URLs are supported');
  7914. }
  7915. if (!/^https?:$/.test(parsedURL.protocol)) {
  7916. throw new TypeError('Only HTTP(S) protocols are supported');
  7917. }
  7918. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7919. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7920. }
  7921. // HTTP-network-or-cache fetch steps 2.4-2.7
  7922. let contentLengthValue = null;
  7923. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7924. contentLengthValue = '0';
  7925. }
  7926. if (request.body != null) {
  7927. const totalBytes = getTotalBytes(request);
  7928. if (typeof totalBytes === 'number') {
  7929. contentLengthValue = String(totalBytes);
  7930. }
  7931. }
  7932. if (contentLengthValue) {
  7933. headers.set('Content-Length', contentLengthValue);
  7934. }
  7935. // HTTP-network-or-cache fetch step 2.11
  7936. if (!headers.has('User-Agent')) {
  7937. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7938. }
  7939. // HTTP-network-or-cache fetch step 2.15
  7940. if (request.compress && !headers.has('Accept-Encoding')) {
  7941. headers.set('Accept-Encoding', 'gzip,deflate');
  7942. }
  7943. let agent = request.agent;
  7944. if (typeof agent === 'function') {
  7945. agent = agent(parsedURL);
  7946. }
  7947. if (!headers.has('Connection') && !agent) {
  7948. headers.set('Connection', 'close');
  7949. }
  7950. // HTTP-network fetch step 4.2
  7951. // chunked encoding is handled by Node.js
  7952. return Object.assign({}, parsedURL, {
  7953. method: request.method,
  7954. headers: exportNodeCompatibleHeaders(headers),
  7955. agent
  7956. });
  7957. }
  7958. /**
  7959. * abort-error.js
  7960. *
  7961. * AbortError interface for cancelled requests
  7962. */
  7963. /**
  7964. * Create AbortError instance
  7965. *
  7966. * @param String message Error message for human
  7967. * @return AbortError
  7968. */
  7969. function AbortError(message) {
  7970. Error.call(this, message);
  7971. this.type = 'aborted';
  7972. this.message = message;
  7973. // hide custom error implementation details from end-users
  7974. Error.captureStackTrace(this, this.constructor);
  7975. }
  7976. AbortError.prototype = Object.create(Error.prototype);
  7977. AbortError.prototype.constructor = AbortError;
  7978. AbortError.prototype.name = 'AbortError';
  7979. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7980. const PassThrough$1 = Stream.PassThrough;
  7981. const resolve_url = Url.resolve;
  7982. /**
  7983. * Fetch function
  7984. *
  7985. * @param Mixed url Absolute url or Request instance
  7986. * @param Object opts Fetch options
  7987. * @return Promise
  7988. */
  7989. function fetch(url, opts) {
  7990. // allow custom promise
  7991. if (!fetch.Promise) {
  7992. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7993. }
  7994. Body.Promise = fetch.Promise;
  7995. // wrap http.request into fetch
  7996. return new fetch.Promise(function (resolve, reject) {
  7997. // build request object
  7998. const request = new Request(url, opts);
  7999. const options = getNodeRequestOptions(request);
  8000. const send = (options.protocol === 'https:' ? https : http).request;
  8001. const signal = request.signal;
  8002. let response = null;
  8003. const abort = function abort() {
  8004. let error = new AbortError('The user aborted a request.');
  8005. reject(error);
  8006. if (request.body && request.body instanceof Stream.Readable) {
  8007. request.body.destroy(error);
  8008. }
  8009. if (!response || !response.body) return;
  8010. response.body.emit('error', error);
  8011. };
  8012. if (signal && signal.aborted) {
  8013. abort();
  8014. return;
  8015. }
  8016. const abortAndFinalize = function abortAndFinalize() {
  8017. abort();
  8018. finalize();
  8019. };
  8020. // send request
  8021. const req = send(options);
  8022. let reqTimeout;
  8023. if (signal) {
  8024. signal.addEventListener('abort', abortAndFinalize);
  8025. }
  8026. function finalize() {
  8027. req.abort();
  8028. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8029. clearTimeout(reqTimeout);
  8030. }
  8031. if (request.timeout) {
  8032. req.once('socket', function (socket) {
  8033. reqTimeout = setTimeout(function () {
  8034. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8035. finalize();
  8036. }, request.timeout);
  8037. });
  8038. }
  8039. req.on('error', function (err) {
  8040. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8041. finalize();
  8042. });
  8043. req.on('response', function (res) {
  8044. clearTimeout(reqTimeout);
  8045. const headers = createHeadersLenient(res.headers);
  8046. // HTTP fetch step 5
  8047. if (fetch.isRedirect(res.statusCode)) {
  8048. // HTTP fetch step 5.2
  8049. const location = headers.get('Location');
  8050. // HTTP fetch step 5.3
  8051. const locationURL = location === null ? null : resolve_url(request.url, location);
  8052. // HTTP fetch step 5.5
  8053. switch (request.redirect) {
  8054. case 'error':
  8055. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8056. finalize();
  8057. return;
  8058. case 'manual':
  8059. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8060. if (locationURL !== null) {
  8061. // handle corrupted header
  8062. try {
  8063. headers.set('Location', locationURL);
  8064. } catch (err) {
  8065. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8066. reject(err);
  8067. }
  8068. }
  8069. break;
  8070. case 'follow':
  8071. // HTTP-redirect fetch step 2
  8072. if (locationURL === null) {
  8073. break;
  8074. }
  8075. // HTTP-redirect fetch step 5
  8076. if (request.counter >= request.follow) {
  8077. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8078. finalize();
  8079. return;
  8080. }
  8081. // HTTP-redirect fetch step 6 (counter increment)
  8082. // Create a new Request object.
  8083. const requestOpts = {
  8084. headers: new Headers(request.headers),
  8085. follow: request.follow,
  8086. counter: request.counter + 1,
  8087. agent: request.agent,
  8088. compress: request.compress,
  8089. method: request.method,
  8090. body: request.body,
  8091. signal: request.signal,
  8092. timeout: request.timeout
  8093. };
  8094. // HTTP-redirect fetch step 9
  8095. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8096. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8097. finalize();
  8098. return;
  8099. }
  8100. // HTTP-redirect fetch step 11
  8101. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8102. requestOpts.method = 'GET';
  8103. requestOpts.body = undefined;
  8104. requestOpts.headers.delete('content-length');
  8105. }
  8106. // HTTP-redirect fetch step 15
  8107. resolve(fetch(new Request(locationURL, requestOpts)));
  8108. finalize();
  8109. return;
  8110. }
  8111. }
  8112. // prepare response
  8113. res.once('end', function () {
  8114. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8115. });
  8116. let body = res.pipe(new PassThrough$1());
  8117. const response_options = {
  8118. url: request.url,
  8119. status: res.statusCode,
  8120. statusText: res.statusMessage,
  8121. headers: headers,
  8122. size: request.size,
  8123. timeout: request.timeout,
  8124. counter: request.counter
  8125. };
  8126. // HTTP-network fetch step 12.1.1.3
  8127. const codings = headers.get('Content-Encoding');
  8128. // HTTP-network fetch step 12.1.1.4: handle content codings
  8129. // in following scenarios we ignore compression support
  8130. // 1. compression support is disabled
  8131. // 2. HEAD request
  8132. // 3. no Content-Encoding header
  8133. // 4. no content response (204)
  8134. // 5. content not modified response (304)
  8135. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8136. response = new Response(body, response_options);
  8137. resolve(response);
  8138. return;
  8139. }
  8140. // For Node v6+
  8141. // Be less strict when decoding compressed responses, since sometimes
  8142. // servers send slightly invalid responses that are still accepted
  8143. // by common browsers.
  8144. // Always using Z_SYNC_FLUSH is what cURL does.
  8145. const zlibOptions = {
  8146. flush: zlib.Z_SYNC_FLUSH,
  8147. finishFlush: zlib.Z_SYNC_FLUSH
  8148. };
  8149. // for gzip
  8150. if (codings == 'gzip' || codings == 'x-gzip') {
  8151. body = body.pipe(zlib.createGunzip(zlibOptions));
  8152. response = new Response(body, response_options);
  8153. resolve(response);
  8154. return;
  8155. }
  8156. // for deflate
  8157. if (codings == 'deflate' || codings == 'x-deflate') {
  8158. // handle the infamous raw deflate response from old servers
  8159. // a hack for old IIS and Apache servers
  8160. const raw = res.pipe(new PassThrough$1());
  8161. raw.once('data', function (chunk) {
  8162. // see http://stackoverflow.com/questions/37519828
  8163. if ((chunk[0] & 0x0F) === 0x08) {
  8164. body = body.pipe(zlib.createInflate());
  8165. } else {
  8166. body = body.pipe(zlib.createInflateRaw());
  8167. }
  8168. response = new Response(body, response_options);
  8169. resolve(response);
  8170. });
  8171. return;
  8172. }
  8173. // for br
  8174. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8175. body = body.pipe(zlib.createBrotliDecompress());
  8176. response = new Response(body, response_options);
  8177. resolve(response);
  8178. return;
  8179. }
  8180. // otherwise, use response as-is
  8181. response = new Response(body, response_options);
  8182. resolve(response);
  8183. });
  8184. writeToStream(req, request);
  8185. });
  8186. }
  8187. /**
  8188. * Redirect code matching
  8189. *
  8190. * @param Number code Status code
  8191. * @return Boolean
  8192. */
  8193. fetch.isRedirect = function (code) {
  8194. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8195. };
  8196. // expose Promise
  8197. fetch.Promise = global.Promise;
  8198. module.exports = exports = fetch;
  8199. Object.defineProperty(exports, "__esModule", { value: true });
  8200. exports.default = exports;
  8201. exports.Headers = Headers;
  8202. exports.Request = Request;
  8203. exports.Response = Response;
  8204. exports.FetchError = FetchError;
  8205. /***/ }),
  8206. /***/ 462:
  8207. /***/ (function(module) {
  8208. "use strict";
  8209. // See http://www.robvanderwoude.com/escapechars.php
  8210. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8211. function escapeCommand(arg) {
  8212. // Escape meta chars
  8213. arg = arg.replace(metaCharsRegExp, '^$1');
  8214. return arg;
  8215. }
  8216. function escapeArgument(arg, doubleEscapeMetaChars) {
  8217. // Convert to string
  8218. arg = `${arg}`;
  8219. // Algorithm below is based on https://qntm.org/cmd
  8220. // Sequence of backslashes followed by a double quote:
  8221. // double up all the backslashes and escape the double quote
  8222. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8223. // Sequence of backslashes followed by the end of the string
  8224. // (which will become a double quote later):
  8225. // double up all the backslashes
  8226. arg = arg.replace(/(\\*)$/, '$1$1');
  8227. // All other backslashes occur literally
  8228. // Quote the whole thing:
  8229. arg = `"${arg}"`;
  8230. // Escape meta chars
  8231. arg = arg.replace(metaCharsRegExp, '^$1');
  8232. // Double escape meta chars if necessary
  8233. if (doubleEscapeMetaChars) {
  8234. arg = arg.replace(metaCharsRegExp, '^$1');
  8235. }
  8236. return arg;
  8237. }
  8238. module.exports.command = escapeCommand;
  8239. module.exports.argument = escapeArgument;
  8240. /***/ }),
  8241. /***/ 463:
  8242. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8243. "use strict";
  8244. Object.defineProperty(exports, '__esModule', { value: true });
  8245. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8246. var deprecation = __webpack_require__(692);
  8247. var once = _interopDefault(__webpack_require__(969));
  8248. const logOnce = once(deprecation => console.warn(deprecation));
  8249. /**
  8250. * Error with extra properties to help with debugging
  8251. */
  8252. class RequestError extends Error {
  8253. constructor(message, statusCode, options) {
  8254. super(message); // Maintains proper stack trace (only available on V8)
  8255. /* istanbul ignore next */
  8256. if (Error.captureStackTrace) {
  8257. Error.captureStackTrace(this, this.constructor);
  8258. }
  8259. this.name = "HttpError";
  8260. this.status = statusCode;
  8261. Object.defineProperty(this, "code", {
  8262. get() {
  8263. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8264. return statusCode;
  8265. }
  8266. });
  8267. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8268. const requestCopy = Object.assign({}, options.request);
  8269. if (options.request.headers.authorization) {
  8270. requestCopy.headers = Object.assign({}, options.request.headers, {
  8271. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8272. });
  8273. }
  8274. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8275. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8276. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8277. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8278. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8279. this.request = requestCopy;
  8280. }
  8281. }
  8282. exports.RequestError = RequestError;
  8283. //# sourceMappingURL=index.js.map
  8284. /***/ }),
  8285. /***/ 464:
  8286. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8287. "use strict";
  8288. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8289. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8290. return new (P || (P = Promise))(function (resolve, reject) {
  8291. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8292. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8293. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8294. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8295. });
  8296. };
  8297. var __importStar = (this && this.__importStar) || function (mod) {
  8298. if (mod && mod.__esModule) return mod;
  8299. var result = {};
  8300. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8301. result["default"] = mod;
  8302. return result;
  8303. };
  8304. var __importDefault = (this && this.__importDefault) || function (mod) {
  8305. return (mod && mod.__esModule) ? mod : { "default": mod };
  8306. };
  8307. Object.defineProperty(exports, "__esModule", { value: true });
  8308. const assert = __importStar(__webpack_require__(357));
  8309. const core = __importStar(__webpack_require__(470));
  8310. const fs = __importStar(__webpack_require__(747));
  8311. const github = __importStar(__webpack_require__(469));
  8312. const io = __importStar(__webpack_require__(1));
  8313. const path = __importStar(__webpack_require__(622));
  8314. const retryHelper = __importStar(__webpack_require__(587));
  8315. const toolCache = __importStar(__webpack_require__(533));
  8316. const v4_1 = __importDefault(__webpack_require__(826));
  8317. const IS_WINDOWS = process.platform === 'win32';
  8318. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8319. return __awaiter(this, void 0, void 0, function* () {
  8320. // Determine the default branch
  8321. if (!ref && !commit) {
  8322. core.info('Determining the default branch');
  8323. ref = yield getDefaultBranch(authToken, owner, repo);
  8324. }
  8325. // Download the archive
  8326. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8327. core.info('Downloading the archive');
  8328. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8329. }));
  8330. // Write archive to disk
  8331. core.info('Writing archive to disk');
  8332. const uniqueId = v4_1.default();
  8333. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8334. yield fs.promises.writeFile(archivePath, archiveData);
  8335. archiveData = Buffer.from(''); // Free memory
  8336. // Extract archive
  8337. core.info('Extracting the archive');
  8338. const extractPath = path.join(repositoryPath, uniqueId);
  8339. yield io.mkdirP(extractPath);
  8340. if (IS_WINDOWS) {
  8341. yield toolCache.extractZip(archivePath, extractPath);
  8342. }
  8343. else {
  8344. yield toolCache.extractTar(archivePath, extractPath);
  8345. }
  8346. io.rmRF(archivePath);
  8347. // Determine the path of the repository content. The archive contains
  8348. // a top-level folder and the repository content is inside.
  8349. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8350. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8351. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8352. core.info(`Resolved version ${archiveVersion}`);
  8353. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8354. // Move the files
  8355. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8356. const sourcePath = path.join(tempRepositoryPath, fileName);
  8357. const targetPath = path.join(repositoryPath, fileName);
  8358. if (IS_WINDOWS) {
  8359. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8360. }
  8361. else {
  8362. yield io.mv(sourcePath, targetPath);
  8363. }
  8364. }
  8365. io.rmRF(extractPath);
  8366. });
  8367. }
  8368. exports.downloadRepository = downloadRepository;
  8369. /**
  8370. * Looks up the default branch name
  8371. */
  8372. function getDefaultBranch(authToken, owner, repo) {
  8373. return __awaiter(this, void 0, void 0, function* () {
  8374. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8375. core.info('Retrieving the default branch name');
  8376. const octokit = new github.GitHub(authToken);
  8377. let result;
  8378. try {
  8379. // Get the default branch from the repo info
  8380. const response = yield octokit.repos.get({ owner, repo });
  8381. result = response.data.default_branch;
  8382. assert.ok(result, 'default_branch cannot be empty');
  8383. }
  8384. catch (err) {
  8385. // Handle .wiki repo
  8386. if (err['status'] === 404 && repo.toUpperCase().endsWith('.WIKI')) {
  8387. result = 'master';
  8388. }
  8389. // Otherwise error
  8390. else {
  8391. throw err;
  8392. }
  8393. }
  8394. // Print the default branch
  8395. core.info(`Default branch '${result}'`);
  8396. // Prefix with 'refs/heads'
  8397. if (!result.startsWith('refs/')) {
  8398. result = `refs/heads/${result}`;
  8399. }
  8400. return result;
  8401. }));
  8402. });
  8403. }
  8404. exports.getDefaultBranch = getDefaultBranch;
  8405. function downloadArchive(authToken, owner, repo, ref, commit) {
  8406. return __awaiter(this, void 0, void 0, function* () {
  8407. const octokit = new github.GitHub(authToken);
  8408. const params = {
  8409. owner: owner,
  8410. repo: repo,
  8411. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8412. ref: commit || ref
  8413. };
  8414. const response = yield octokit.repos.getArchiveLink(params);
  8415. if (response.status != 200) {
  8416. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8417. }
  8418. return Buffer.from(response.data); // response.data is ArrayBuffer
  8419. });
  8420. }
  8421. /***/ }),
  8422. /***/ 469:
  8423. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8424. "use strict";
  8425. var __importStar = (this && this.__importStar) || function (mod) {
  8426. if (mod && mod.__esModule) return mod;
  8427. var result = {};
  8428. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8429. result["default"] = mod;
  8430. return result;
  8431. };
  8432. Object.defineProperty(exports, "__esModule", { value: true });
  8433. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8434. const graphql_1 = __webpack_require__(898);
  8435. const rest_1 = __webpack_require__(0);
  8436. const Context = __importStar(__webpack_require__(262));
  8437. const httpClient = __importStar(__webpack_require__(539));
  8438. // We need this in order to extend Octokit
  8439. rest_1.Octokit.prototype = new rest_1.Octokit();
  8440. exports.context = new Context.Context();
  8441. class GitHub extends rest_1.Octokit {
  8442. constructor(token, opts) {
  8443. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8444. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8445. }
  8446. /**
  8447. * Disambiguates the constructor overload parameters
  8448. */
  8449. static disambiguate(token, opts) {
  8450. return [
  8451. typeof token === 'string' ? token : '',
  8452. typeof token === 'object' ? token : opts || {}
  8453. ];
  8454. }
  8455. static getOctokitOptions(args) {
  8456. const token = args[0];
  8457. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8458. // Base URL - GHES or Dotcom
  8459. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8460. // Auth
  8461. const auth = GitHub.getAuthString(token, options);
  8462. if (auth) {
  8463. options.auth = auth;
  8464. }
  8465. // Proxy
  8466. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8467. if (agent) {
  8468. // Shallow clone - don't mutate the object provided by the caller
  8469. options.request = options.request ? Object.assign({}, options.request) : {};
  8470. // Set the agent
  8471. options.request.agent = agent;
  8472. }
  8473. return options;
  8474. }
  8475. static getGraphQL(args) {
  8476. const defaults = {};
  8477. defaults.baseUrl = this.getGraphQLBaseUrl();
  8478. const token = args[0];
  8479. const options = args[1];
  8480. // Authorization
  8481. const auth = this.getAuthString(token, options);
  8482. if (auth) {
  8483. defaults.headers = {
  8484. authorization: auth
  8485. };
  8486. }
  8487. // Proxy
  8488. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8489. if (agent) {
  8490. defaults.request = { agent };
  8491. }
  8492. return graphql_1.graphql.defaults(defaults);
  8493. }
  8494. static getAuthString(token, options) {
  8495. // Validate args
  8496. if (!token && !options.auth) {
  8497. throw new Error('Parameter token or opts.auth is required');
  8498. }
  8499. else if (token && options.auth) {
  8500. throw new Error('Parameters token and opts.auth may not both be specified');
  8501. }
  8502. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8503. }
  8504. static getProxyAgent(destinationUrl, options) {
  8505. var _a;
  8506. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8507. if (httpClient.getProxyUrl(destinationUrl)) {
  8508. const hc = new httpClient.HttpClient();
  8509. return hc.getAgent(destinationUrl);
  8510. }
  8511. }
  8512. return undefined;
  8513. }
  8514. static getApiBaseUrl() {
  8515. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8516. }
  8517. static getGraphQLBaseUrl() {
  8518. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8519. // Shouldn't be a trailing slash, but remove if so
  8520. if (url.endsWith('/')) {
  8521. url = url.substr(0, url.length - 1);
  8522. }
  8523. // Remove trailing "/graphql"
  8524. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8525. url = url.substr(0, url.length - '/graphql'.length);
  8526. }
  8527. return url;
  8528. }
  8529. }
  8530. exports.GitHub = GitHub;
  8531. //# sourceMappingURL=github.js.map
  8532. /***/ }),
  8533. /***/ 470:
  8534. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8535. "use strict";
  8536. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8537. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8538. return new (P || (P = Promise))(function (resolve, reject) {
  8539. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8540. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8541. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8542. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8543. });
  8544. };
  8545. Object.defineProperty(exports, "__esModule", { value: true });
  8546. const command_1 = __webpack_require__(431);
  8547. const os = __webpack_require__(87);
  8548. const path = __webpack_require__(622);
  8549. /**
  8550. * The code to exit an action
  8551. */
  8552. var ExitCode;
  8553. (function (ExitCode) {
  8554. /**
  8555. * A code indicating that the action was successful
  8556. */
  8557. ExitCode[ExitCode["Success"] = 0] = "Success";
  8558. /**
  8559. * A code indicating that the action was a failure
  8560. */
  8561. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8562. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8563. //-----------------------------------------------------------------------
  8564. // Variables
  8565. //-----------------------------------------------------------------------
  8566. /**
  8567. * Sets env variable for this action and future actions in the job
  8568. * @param name the name of the variable to set
  8569. * @param val the value of the variable
  8570. */
  8571. function exportVariable(name, val) {
  8572. process.env[name] = val;
  8573. command_1.issueCommand('set-env', { name }, val);
  8574. }
  8575. exports.exportVariable = exportVariable;
  8576. /**
  8577. * Registers a secret which will get masked from logs
  8578. * @param secret value of the secret
  8579. */
  8580. function setSecret(secret) {
  8581. command_1.issueCommand('add-mask', {}, secret);
  8582. }
  8583. exports.setSecret = setSecret;
  8584. /**
  8585. * Prepends inputPath to the PATH (for this action and future actions)
  8586. * @param inputPath
  8587. */
  8588. function addPath(inputPath) {
  8589. command_1.issueCommand('add-path', {}, inputPath);
  8590. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8591. }
  8592. exports.addPath = addPath;
  8593. /**
  8594. * Gets the value of an input. The value is also trimmed.
  8595. *
  8596. * @param name name of the input to get
  8597. * @param options optional. See InputOptions.
  8598. * @returns string
  8599. */
  8600. function getInput(name, options) {
  8601. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8602. if (options && options.required && !val) {
  8603. throw new Error(`Input required and not supplied: ${name}`);
  8604. }
  8605. return val.trim();
  8606. }
  8607. exports.getInput = getInput;
  8608. /**
  8609. * Sets the value of an output.
  8610. *
  8611. * @param name name of the output to set
  8612. * @param value value to store
  8613. */
  8614. function setOutput(name, value) {
  8615. command_1.issueCommand('set-output', { name }, value);
  8616. }
  8617. exports.setOutput = setOutput;
  8618. //-----------------------------------------------------------------------
  8619. // Results
  8620. //-----------------------------------------------------------------------
  8621. /**
  8622. * Sets the action status to failed.
  8623. * When the action exits it will be with an exit code of 1
  8624. * @param message add error issue message
  8625. */
  8626. function setFailed(message) {
  8627. process.exitCode = ExitCode.Failure;
  8628. error(message);
  8629. }
  8630. exports.setFailed = setFailed;
  8631. //-----------------------------------------------------------------------
  8632. // Logging Commands
  8633. //-----------------------------------------------------------------------
  8634. /**
  8635. * Writes debug message to user log
  8636. * @param message debug message
  8637. */
  8638. function debug(message) {
  8639. command_1.issueCommand('debug', {}, message);
  8640. }
  8641. exports.debug = debug;
  8642. /**
  8643. * Adds an error issue
  8644. * @param message error issue message
  8645. */
  8646. function error(message) {
  8647. command_1.issue('error', message);
  8648. }
  8649. exports.error = error;
  8650. /**
  8651. * Adds an warning issue
  8652. * @param message warning issue message
  8653. */
  8654. function warning(message) {
  8655. command_1.issue('warning', message);
  8656. }
  8657. exports.warning = warning;
  8658. /**
  8659. * Writes info to log with console.log.
  8660. * @param message info message
  8661. */
  8662. function info(message) {
  8663. process.stdout.write(message + os.EOL);
  8664. }
  8665. exports.info = info;
  8666. /**
  8667. * Begin an output group.
  8668. *
  8669. * Output until the next `groupEnd` will be foldable in this group
  8670. *
  8671. * @param name The name of the output group
  8672. */
  8673. function startGroup(name) {
  8674. command_1.issue('group', name);
  8675. }
  8676. exports.startGroup = startGroup;
  8677. /**
  8678. * End an output group.
  8679. */
  8680. function endGroup() {
  8681. command_1.issue('endgroup');
  8682. }
  8683. exports.endGroup = endGroup;
  8684. /**
  8685. * Wrap an asynchronous function call in a group.
  8686. *
  8687. * Returns the same type as the function itself.
  8688. *
  8689. * @param name The name of the group
  8690. * @param fn The function to wrap in the group
  8691. */
  8692. function group(name, fn) {
  8693. return __awaiter(this, void 0, void 0, function* () {
  8694. startGroup(name);
  8695. let result;
  8696. try {
  8697. result = yield fn();
  8698. }
  8699. finally {
  8700. endGroup();
  8701. }
  8702. return result;
  8703. });
  8704. }
  8705. exports.group = group;
  8706. //# sourceMappingURL=core.js.map
  8707. /***/ }),
  8708. /***/ 471:
  8709. /***/ (function(module, __unusedexports, __webpack_require__) {
  8710. module.exports = authenticationBeforeRequest;
  8711. const btoa = __webpack_require__(675);
  8712. const uniq = __webpack_require__(126);
  8713. function authenticationBeforeRequest(state, options) {
  8714. if (!state.auth.type) {
  8715. return;
  8716. }
  8717. if (state.auth.type === "basic") {
  8718. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8719. options.headers.authorization = `Basic ${hash}`;
  8720. return;
  8721. }
  8722. if (state.auth.type === "token") {
  8723. options.headers.authorization = `token ${state.auth.token}`;
  8724. return;
  8725. }
  8726. if (state.auth.type === "app") {
  8727. options.headers.authorization = `Bearer ${state.auth.token}`;
  8728. const acceptHeaders = options.headers.accept
  8729. .split(",")
  8730. .concat("application/vnd.github.machine-man-preview+json");
  8731. options.headers.accept = uniq(acceptHeaders)
  8732. .filter(Boolean)
  8733. .join(",");
  8734. return;
  8735. }
  8736. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8737. if (state.auth.token) {
  8738. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8739. return;
  8740. }
  8741. const key = encodeURIComponent(state.auth.key);
  8742. const secret = encodeURIComponent(state.auth.secret);
  8743. options.url += `client_id=${key}&client_secret=${secret}`;
  8744. }
  8745. /***/ }),
  8746. /***/ 489:
  8747. /***/ (function(module, __unusedexports, __webpack_require__) {
  8748. "use strict";
  8749. const path = __webpack_require__(622);
  8750. const which = __webpack_require__(814);
  8751. const pathKey = __webpack_require__(39)();
  8752. function resolveCommandAttempt(parsed, withoutPathExt) {
  8753. const cwd = process.cwd();
  8754. const hasCustomCwd = parsed.options.cwd != null;
  8755. // If a custom `cwd` was specified, we need to change the process cwd
  8756. // because `which` will do stat calls but does not support a custom cwd
  8757. if (hasCustomCwd) {
  8758. try {
  8759. process.chdir(parsed.options.cwd);
  8760. } catch (err) {
  8761. /* Empty */
  8762. }
  8763. }
  8764. let resolved;
  8765. try {
  8766. resolved = which.sync(parsed.command, {
  8767. path: (parsed.options.env || process.env)[pathKey],
  8768. pathExt: withoutPathExt ? path.delimiter : undefined,
  8769. });
  8770. } catch (e) {
  8771. /* Empty */
  8772. } finally {
  8773. process.chdir(cwd);
  8774. }
  8775. // If we successfully resolved, ensure that an absolute path is returned
  8776. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8777. if (resolved) {
  8778. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8779. }
  8780. return resolved;
  8781. }
  8782. function resolveCommand(parsed) {
  8783. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8784. }
  8785. module.exports = resolveCommand;
  8786. /***/ }),
  8787. /***/ 497:
  8788. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8789. "use strict";
  8790. Object.defineProperty(exports, '__esModule', { value: true });
  8791. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8792. var deprecation = __webpack_require__(692);
  8793. var once = _interopDefault(__webpack_require__(969));
  8794. const logOnce = once(deprecation => console.warn(deprecation));
  8795. /**
  8796. * Error with extra properties to help with debugging
  8797. */
  8798. class RequestError extends Error {
  8799. constructor(message, statusCode, options) {
  8800. super(message); // Maintains proper stack trace (only available on V8)
  8801. /* istanbul ignore next */
  8802. if (Error.captureStackTrace) {
  8803. Error.captureStackTrace(this, this.constructor);
  8804. }
  8805. this.name = "HttpError";
  8806. this.status = statusCode;
  8807. Object.defineProperty(this, "code", {
  8808. get() {
  8809. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8810. return statusCode;
  8811. }
  8812. });
  8813. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8814. const requestCopy = Object.assign({}, options.request);
  8815. if (options.request.headers.authorization) {
  8816. requestCopy.headers = Object.assign({}, options.request.headers, {
  8817. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8818. });
  8819. }
  8820. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8821. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8822. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8823. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8824. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8825. this.request = requestCopy;
  8826. }
  8827. }
  8828. exports.RequestError = RequestError;
  8829. //# sourceMappingURL=index.js.map
  8830. /***/ }),
  8831. /***/ 510:
  8832. /***/ (function(module) {
  8833. module.exports = addHook
  8834. function addHook (state, kind, name, hook) {
  8835. var orig = hook
  8836. if (!state.registry[name]) {
  8837. state.registry[name] = []
  8838. }
  8839. if (kind === 'before') {
  8840. hook = function (method, options) {
  8841. return Promise.resolve()
  8842. .then(orig.bind(null, options))
  8843. .then(method.bind(null, options))
  8844. }
  8845. }
  8846. if (kind === 'after') {
  8847. hook = function (method, options) {
  8848. var result
  8849. return Promise.resolve()
  8850. .then(method.bind(null, options))
  8851. .then(function (result_) {
  8852. result = result_
  8853. return orig(result, options)
  8854. })
  8855. .then(function () {
  8856. return result
  8857. })
  8858. }
  8859. }
  8860. if (kind === 'error') {
  8861. hook = function (method, options) {
  8862. return Promise.resolve()
  8863. .then(method.bind(null, options))
  8864. .catch(function (error) {
  8865. return orig(error, options)
  8866. })
  8867. }
  8868. }
  8869. state.registry[name].push({
  8870. hook: hook,
  8871. orig: orig
  8872. })
  8873. }
  8874. /***/ }),
  8875. /***/ 523:
  8876. /***/ (function(module, __unusedexports, __webpack_require__) {
  8877. var register = __webpack_require__(363)
  8878. var addHook = __webpack_require__(510)
  8879. var removeHook = __webpack_require__(763)
  8880. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8881. var bind = Function.bind
  8882. var bindable = bind.bind(bind)
  8883. function bindApi (hook, state, name) {
  8884. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8885. hook.api = { remove: removeHookRef }
  8886. hook.remove = removeHookRef
  8887. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8888. var args = name ? [state, kind, name] : [state, kind]
  8889. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8890. })
  8891. }
  8892. function HookSingular () {
  8893. var singularHookName = 'h'
  8894. var singularHookState = {
  8895. registry: {}
  8896. }
  8897. var singularHook = register.bind(null, singularHookState, singularHookName)
  8898. bindApi(singularHook, singularHookState, singularHookName)
  8899. return singularHook
  8900. }
  8901. function HookCollection () {
  8902. var state = {
  8903. registry: {}
  8904. }
  8905. var hook = register.bind(null, state)
  8906. bindApi(hook, state)
  8907. return hook
  8908. }
  8909. var collectionHookDeprecationMessageDisplayed = false
  8910. function Hook () {
  8911. if (!collectionHookDeprecationMessageDisplayed) {
  8912. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8913. collectionHookDeprecationMessageDisplayed = true
  8914. }
  8915. return HookCollection()
  8916. }
  8917. Hook.Singular = HookSingular.bind()
  8918. Hook.Collection = HookCollection.bind()
  8919. module.exports = Hook
  8920. // expose constructors as a named property for TypeScript
  8921. module.exports.Hook = Hook
  8922. module.exports.Singular = Hook.Singular
  8923. module.exports.Collection = Hook.Collection
  8924. /***/ }),
  8925. /***/ 528:
  8926. /***/ (function(__unusedmodule, exports) {
  8927. "use strict";
  8928. Object.defineProperty(exports, "__esModule", { value: true });
  8929. function escape(value) {
  8930. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8931. return `\\${x}`;
  8932. });
  8933. }
  8934. exports.escape = escape;
  8935. /***/ }),
  8936. /***/ 529:
  8937. /***/ (function(module, __unusedexports, __webpack_require__) {
  8938. const factory = __webpack_require__(47);
  8939. module.exports = factory();
  8940. /***/ }),
  8941. /***/ 533:
  8942. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8943. "use strict";
  8944. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8945. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8946. return new (P || (P = Promise))(function (resolve, reject) {
  8947. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8948. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8949. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8950. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8951. });
  8952. };
  8953. Object.defineProperty(exports, "__esModule", { value: true });
  8954. const core = __webpack_require__(470);
  8955. const io = __webpack_require__(1);
  8956. const fs = __webpack_require__(747);
  8957. const os = __webpack_require__(87);
  8958. const path = __webpack_require__(622);
  8959. const httpm = __webpack_require__(874);
  8960. const semver = __webpack_require__(656);
  8961. const uuidV4 = __webpack_require__(826);
  8962. const exec_1 = __webpack_require__(986);
  8963. const assert_1 = __webpack_require__(357);
  8964. class HTTPError extends Error {
  8965. constructor(httpStatusCode) {
  8966. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8967. this.httpStatusCode = httpStatusCode;
  8968. Object.setPrototypeOf(this, new.target.prototype);
  8969. }
  8970. }
  8971. exports.HTTPError = HTTPError;
  8972. const IS_WINDOWS = process.platform === 'win32';
  8973. const userAgent = 'actions/tool-cache';
  8974. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8975. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8976. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8977. // If directories not found, place them in common temp locations
  8978. if (!tempDirectory || !cacheRoot) {
  8979. let baseLocation;
  8980. if (IS_WINDOWS) {
  8981. // On windows use the USERPROFILE env variable
  8982. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8983. }
  8984. else {
  8985. if (process.platform === 'darwin') {
  8986. baseLocation = '/Users';
  8987. }
  8988. else {
  8989. baseLocation = '/home';
  8990. }
  8991. }
  8992. if (!tempDirectory) {
  8993. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8994. }
  8995. if (!cacheRoot) {
  8996. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8997. }
  8998. }
  8999. /**
  9000. * Download a tool from an url and stream it into a file
  9001. *
  9002. * @param url url of tool to download
  9003. * @returns path to downloaded tool
  9004. */
  9005. function downloadTool(url) {
  9006. return __awaiter(this, void 0, void 0, function* () {
  9007. // Wrap in a promise so that we can resolve from within stream callbacks
  9008. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  9009. try {
  9010. const http = new httpm.HttpClient(userAgent, [], {
  9011. allowRetries: true,
  9012. maxRetries: 3
  9013. });
  9014. const destPath = path.join(tempDirectory, uuidV4());
  9015. yield io.mkdirP(tempDirectory);
  9016. core.debug(`Downloading ${url}`);
  9017. core.debug(`Downloading ${destPath}`);
  9018. if (fs.existsSync(destPath)) {
  9019. throw new Error(`Destination file path ${destPath} already exists`);
  9020. }
  9021. const response = yield http.get(url);
  9022. if (response.message.statusCode !== 200) {
  9023. const err = new HTTPError(response.message.statusCode);
  9024. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9025. throw err;
  9026. }
  9027. const file = fs.createWriteStream(destPath);
  9028. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  9029. try {
  9030. const stream = response.message.pipe(file);
  9031. stream.on('close', () => {
  9032. core.debug('download complete');
  9033. resolve(destPath);
  9034. });
  9035. }
  9036. catch (err) {
  9037. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9038. reject(err);
  9039. }
  9040. }));
  9041. file.on('error', err => {
  9042. file.end();
  9043. reject(err);
  9044. });
  9045. }
  9046. catch (err) {
  9047. reject(err);
  9048. }
  9049. }));
  9050. });
  9051. }
  9052. exports.downloadTool = downloadTool;
  9053. /**
  9054. * Extract a .7z file
  9055. *
  9056. * @param file path to the .7z file
  9057. * @param dest destination directory. Optional.
  9058. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9059. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9060. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9061. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9062. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9063. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9064. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9065. * to 7zr.exe can be pass to this function.
  9066. * @returns path to the destination directory
  9067. */
  9068. function extract7z(file, dest, _7zPath) {
  9069. return __awaiter(this, void 0, void 0, function* () {
  9070. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9071. assert_1.ok(file, 'parameter "file" is required');
  9072. dest = dest || (yield _createExtractFolder(dest));
  9073. const originalCwd = process.cwd();
  9074. process.chdir(dest);
  9075. if (_7zPath) {
  9076. try {
  9077. const args = [
  9078. 'x',
  9079. '-bb1',
  9080. '-bd',
  9081. '-sccUTF-8',
  9082. file
  9083. ];
  9084. const options = {
  9085. silent: true
  9086. };
  9087. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9088. }
  9089. finally {
  9090. process.chdir(originalCwd);
  9091. }
  9092. }
  9093. else {
  9094. const escapedScript = path
  9095. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9096. .replace(/'/g, "''")
  9097. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9098. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9099. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9100. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9101. const args = [
  9102. '-NoLogo',
  9103. '-Sta',
  9104. '-NoProfile',
  9105. '-NonInteractive',
  9106. '-ExecutionPolicy',
  9107. 'Unrestricted',
  9108. '-Command',
  9109. command
  9110. ];
  9111. const options = {
  9112. silent: true
  9113. };
  9114. try {
  9115. const powershellPath = yield io.which('powershell', true);
  9116. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9117. }
  9118. finally {
  9119. process.chdir(originalCwd);
  9120. }
  9121. }
  9122. return dest;
  9123. });
  9124. }
  9125. exports.extract7z = extract7z;
  9126. /**
  9127. * Extract a tar
  9128. *
  9129. * @param file path to the tar
  9130. * @param dest destination directory. Optional.
  9131. * @param flags flags for the tar. Optional.
  9132. * @returns path to the destination directory
  9133. */
  9134. function extractTar(file, dest, flags = 'xz') {
  9135. return __awaiter(this, void 0, void 0, function* () {
  9136. if (!file) {
  9137. throw new Error("parameter 'file' is required");
  9138. }
  9139. dest = dest || (yield _createExtractFolder(dest));
  9140. const tarPath = yield io.which('tar', true);
  9141. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9142. return dest;
  9143. });
  9144. }
  9145. exports.extractTar = extractTar;
  9146. /**
  9147. * Extract a zip
  9148. *
  9149. * @param file path to the zip
  9150. * @param dest destination directory. Optional.
  9151. * @returns path to the destination directory
  9152. */
  9153. function extractZip(file, dest) {
  9154. return __awaiter(this, void 0, void 0, function* () {
  9155. if (!file) {
  9156. throw new Error("parameter 'file' is required");
  9157. }
  9158. dest = dest || (yield _createExtractFolder(dest));
  9159. if (IS_WINDOWS) {
  9160. yield extractZipWin(file, dest);
  9161. }
  9162. else {
  9163. yield extractZipNix(file, dest);
  9164. }
  9165. return dest;
  9166. });
  9167. }
  9168. exports.extractZip = extractZip;
  9169. function extractZipWin(file, dest) {
  9170. return __awaiter(this, void 0, void 0, function* () {
  9171. // build the powershell command
  9172. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9173. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9174. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9175. // run powershell
  9176. const powershellPath = yield io.which('powershell');
  9177. const args = [
  9178. '-NoLogo',
  9179. '-Sta',
  9180. '-NoProfile',
  9181. '-NonInteractive',
  9182. '-ExecutionPolicy',
  9183. 'Unrestricted',
  9184. '-Command',
  9185. command
  9186. ];
  9187. yield exec_1.exec(`"${powershellPath}"`, args);
  9188. });
  9189. }
  9190. function extractZipNix(file, dest) {
  9191. return __awaiter(this, void 0, void 0, function* () {
  9192. const unzipPath = yield io.which('unzip');
  9193. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9194. });
  9195. }
  9196. /**
  9197. * Caches a directory and installs it into the tool cacheDir
  9198. *
  9199. * @param sourceDir the directory to cache into tools
  9200. * @param tool tool name
  9201. * @param version version of the tool. semver format
  9202. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9203. */
  9204. function cacheDir(sourceDir, tool, version, arch) {
  9205. return __awaiter(this, void 0, void 0, function* () {
  9206. version = semver.clean(version) || version;
  9207. arch = arch || os.arch();
  9208. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9209. core.debug(`source dir: ${sourceDir}`);
  9210. if (!fs.statSync(sourceDir).isDirectory()) {
  9211. throw new Error('sourceDir is not a directory');
  9212. }
  9213. // Create the tool dir
  9214. const destPath = yield _createToolPath(tool, version, arch);
  9215. // copy each child item. do not move. move can fail on Windows
  9216. // due to anti-virus software having an open handle on a file.
  9217. for (const itemName of fs.readdirSync(sourceDir)) {
  9218. const s = path.join(sourceDir, itemName);
  9219. yield io.cp(s, destPath, { recursive: true });
  9220. }
  9221. // write .complete
  9222. _completeToolPath(tool, version, arch);
  9223. return destPath;
  9224. });
  9225. }
  9226. exports.cacheDir = cacheDir;
  9227. /**
  9228. * Caches a downloaded file (GUID) and installs it
  9229. * into the tool cache with a given targetName
  9230. *
  9231. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9232. * @param targetFile the name of the file name in the tools directory
  9233. * @param tool tool name
  9234. * @param version version of the tool. semver format
  9235. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9236. */
  9237. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9238. return __awaiter(this, void 0, void 0, function* () {
  9239. version = semver.clean(version) || version;
  9240. arch = arch || os.arch();
  9241. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9242. core.debug(`source file: ${sourceFile}`);
  9243. if (!fs.statSync(sourceFile).isFile()) {
  9244. throw new Error('sourceFile is not a file');
  9245. }
  9246. // create the tool dir
  9247. const destFolder = yield _createToolPath(tool, version, arch);
  9248. // copy instead of move. move can fail on Windows due to
  9249. // anti-virus software having an open handle on a file.
  9250. const destPath = path.join(destFolder, targetFile);
  9251. core.debug(`destination file ${destPath}`);
  9252. yield io.cp(sourceFile, destPath);
  9253. // write .complete
  9254. _completeToolPath(tool, version, arch);
  9255. return destFolder;
  9256. });
  9257. }
  9258. exports.cacheFile = cacheFile;
  9259. /**
  9260. * Finds the path to a tool version in the local installed tool cache
  9261. *
  9262. * @param toolName name of the tool
  9263. * @param versionSpec version of the tool
  9264. * @param arch optional arch. defaults to arch of computer
  9265. */
  9266. function find(toolName, versionSpec, arch) {
  9267. if (!toolName) {
  9268. throw new Error('toolName parameter is required');
  9269. }
  9270. if (!versionSpec) {
  9271. throw new Error('versionSpec parameter is required');
  9272. }
  9273. arch = arch || os.arch();
  9274. // attempt to resolve an explicit version
  9275. if (!_isExplicitVersion(versionSpec)) {
  9276. const localVersions = findAllVersions(toolName, arch);
  9277. const match = _evaluateVersions(localVersions, versionSpec);
  9278. versionSpec = match;
  9279. }
  9280. // check for the explicit version in the cache
  9281. let toolPath = '';
  9282. if (versionSpec) {
  9283. versionSpec = semver.clean(versionSpec) || '';
  9284. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9285. core.debug(`checking cache: ${cachePath}`);
  9286. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9287. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9288. toolPath = cachePath;
  9289. }
  9290. else {
  9291. core.debug('not found');
  9292. }
  9293. }
  9294. return toolPath;
  9295. }
  9296. exports.find = find;
  9297. /**
  9298. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9299. *
  9300. * @param toolName name of the tool
  9301. * @param arch optional arch. defaults to arch of computer
  9302. */
  9303. function findAllVersions(toolName, arch) {
  9304. const versions = [];
  9305. arch = arch || os.arch();
  9306. const toolPath = path.join(cacheRoot, toolName);
  9307. if (fs.existsSync(toolPath)) {
  9308. const children = fs.readdirSync(toolPath);
  9309. for (const child of children) {
  9310. if (_isExplicitVersion(child)) {
  9311. const fullPath = path.join(toolPath, child, arch || '');
  9312. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9313. versions.push(child);
  9314. }
  9315. }
  9316. }
  9317. }
  9318. return versions;
  9319. }
  9320. exports.findAllVersions = findAllVersions;
  9321. function _createExtractFolder(dest) {
  9322. return __awaiter(this, void 0, void 0, function* () {
  9323. if (!dest) {
  9324. // create a temp dir
  9325. dest = path.join(tempDirectory, uuidV4());
  9326. }
  9327. yield io.mkdirP(dest);
  9328. return dest;
  9329. });
  9330. }
  9331. function _createToolPath(tool, version, arch) {
  9332. return __awaiter(this, void 0, void 0, function* () {
  9333. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9334. core.debug(`destination ${folderPath}`);
  9335. const markerPath = `${folderPath}.complete`;
  9336. yield io.rmRF(folderPath);
  9337. yield io.rmRF(markerPath);
  9338. yield io.mkdirP(folderPath);
  9339. return folderPath;
  9340. });
  9341. }
  9342. function _completeToolPath(tool, version, arch) {
  9343. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9344. const markerPath = `${folderPath}.complete`;
  9345. fs.writeFileSync(markerPath, '');
  9346. core.debug('finished caching tool');
  9347. }
  9348. function _isExplicitVersion(versionSpec) {
  9349. const c = semver.clean(versionSpec) || '';
  9350. core.debug(`isExplicit: ${c}`);
  9351. const valid = semver.valid(c) != null;
  9352. core.debug(`explicit? ${valid}`);
  9353. return valid;
  9354. }
  9355. function _evaluateVersions(versions, versionSpec) {
  9356. let version = '';
  9357. core.debug(`evaluating ${versions.length} versions`);
  9358. versions = versions.sort((a, b) => {
  9359. if (semver.gt(a, b)) {
  9360. return 1;
  9361. }
  9362. return -1;
  9363. });
  9364. for (let i = versions.length - 1; i >= 0; i--) {
  9365. const potential = versions[i];
  9366. const satisfied = semver.satisfies(potential, versionSpec);
  9367. if (satisfied) {
  9368. version = potential;
  9369. break;
  9370. }
  9371. }
  9372. if (version) {
  9373. core.debug(`matched: ${version}`);
  9374. }
  9375. else {
  9376. core.debug('match not found');
  9377. }
  9378. return version;
  9379. }
  9380. //# sourceMappingURL=tool-cache.js.map
  9381. /***/ }),
  9382. /***/ 536:
  9383. /***/ (function(module, __unusedexports, __webpack_require__) {
  9384. module.exports = hasFirstPage
  9385. const deprecate = __webpack_require__(370)
  9386. const getPageLinks = __webpack_require__(577)
  9387. function hasFirstPage (link) {
  9388. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9389. return getPageLinks(link).first
  9390. }
  9391. /***/ }),
  9392. /***/ 539:
  9393. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9394. "use strict";
  9395. Object.defineProperty(exports, "__esModule", { value: true });
  9396. const url = __webpack_require__(835);
  9397. const http = __webpack_require__(605);
  9398. const https = __webpack_require__(34);
  9399. const pm = __webpack_require__(950);
  9400. let tunnel;
  9401. var HttpCodes;
  9402. (function (HttpCodes) {
  9403. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9404. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9405. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9406. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9407. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9408. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9409. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9410. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9411. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9412. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9413. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9414. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9415. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9416. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9417. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9418. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9419. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9420. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9421. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9422. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9423. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9424. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9425. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9426. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9427. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9428. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9429. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9430. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9431. var Headers;
  9432. (function (Headers) {
  9433. Headers["Accept"] = "accept";
  9434. Headers["ContentType"] = "content-type";
  9435. })(Headers = exports.Headers || (exports.Headers = {}));
  9436. var MediaTypes;
  9437. (function (MediaTypes) {
  9438. MediaTypes["ApplicationJson"] = "application/json";
  9439. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9440. /**
  9441. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9442. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9443. */
  9444. function getProxyUrl(serverUrl) {
  9445. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9446. return proxyUrl ? proxyUrl.href : '';
  9447. }
  9448. exports.getProxyUrl = getProxyUrl;
  9449. const HttpRedirectCodes = [
  9450. HttpCodes.MovedPermanently,
  9451. HttpCodes.ResourceMoved,
  9452. HttpCodes.SeeOther,
  9453. HttpCodes.TemporaryRedirect,
  9454. HttpCodes.PermanentRedirect
  9455. ];
  9456. const HttpResponseRetryCodes = [
  9457. HttpCodes.BadGateway,
  9458. HttpCodes.ServiceUnavailable,
  9459. HttpCodes.GatewayTimeout
  9460. ];
  9461. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9462. const ExponentialBackoffCeiling = 10;
  9463. const ExponentialBackoffTimeSlice = 5;
  9464. class HttpClientResponse {
  9465. constructor(message) {
  9466. this.message = message;
  9467. }
  9468. readBody() {
  9469. return new Promise(async (resolve, reject) => {
  9470. let output = Buffer.alloc(0);
  9471. this.message.on('data', (chunk) => {
  9472. output = Buffer.concat([output, chunk]);
  9473. });
  9474. this.message.on('end', () => {
  9475. resolve(output.toString());
  9476. });
  9477. });
  9478. }
  9479. }
  9480. exports.HttpClientResponse = HttpClientResponse;
  9481. function isHttps(requestUrl) {
  9482. let parsedUrl = url.parse(requestUrl);
  9483. return parsedUrl.protocol === 'https:';
  9484. }
  9485. exports.isHttps = isHttps;
  9486. class HttpClient {
  9487. constructor(userAgent, handlers, requestOptions) {
  9488. this._ignoreSslError = false;
  9489. this._allowRedirects = true;
  9490. this._allowRedirectDowngrade = false;
  9491. this._maxRedirects = 50;
  9492. this._allowRetries = false;
  9493. this._maxRetries = 1;
  9494. this._keepAlive = false;
  9495. this._disposed = false;
  9496. this.userAgent = userAgent;
  9497. this.handlers = handlers || [];
  9498. this.requestOptions = requestOptions;
  9499. if (requestOptions) {
  9500. if (requestOptions.ignoreSslError != null) {
  9501. this._ignoreSslError = requestOptions.ignoreSslError;
  9502. }
  9503. this._socketTimeout = requestOptions.socketTimeout;
  9504. if (requestOptions.allowRedirects != null) {
  9505. this._allowRedirects = requestOptions.allowRedirects;
  9506. }
  9507. if (requestOptions.allowRedirectDowngrade != null) {
  9508. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9509. }
  9510. if (requestOptions.maxRedirects != null) {
  9511. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9512. }
  9513. if (requestOptions.keepAlive != null) {
  9514. this._keepAlive = requestOptions.keepAlive;
  9515. }
  9516. if (requestOptions.allowRetries != null) {
  9517. this._allowRetries = requestOptions.allowRetries;
  9518. }
  9519. if (requestOptions.maxRetries != null) {
  9520. this._maxRetries = requestOptions.maxRetries;
  9521. }
  9522. }
  9523. }
  9524. options(requestUrl, additionalHeaders) {
  9525. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9526. }
  9527. get(requestUrl, additionalHeaders) {
  9528. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9529. }
  9530. del(requestUrl, additionalHeaders) {
  9531. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9532. }
  9533. post(requestUrl, data, additionalHeaders) {
  9534. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9535. }
  9536. patch(requestUrl, data, additionalHeaders) {
  9537. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9538. }
  9539. put(requestUrl, data, additionalHeaders) {
  9540. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9541. }
  9542. head(requestUrl, additionalHeaders) {
  9543. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9544. }
  9545. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9546. return this.request(verb, requestUrl, stream, additionalHeaders);
  9547. }
  9548. /**
  9549. * Gets a typed object from an endpoint
  9550. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9551. */
  9552. async getJson(requestUrl, additionalHeaders = {}) {
  9553. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9554. let res = await this.get(requestUrl, additionalHeaders);
  9555. return this._processResponse(res, this.requestOptions);
  9556. }
  9557. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9558. let data = JSON.stringify(obj, null, 2);
  9559. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9560. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9561. let res = await this.post(requestUrl, data, additionalHeaders);
  9562. return this._processResponse(res, this.requestOptions);
  9563. }
  9564. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9565. let data = JSON.stringify(obj, null, 2);
  9566. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9567. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9568. let res = await this.put(requestUrl, data, additionalHeaders);
  9569. return this._processResponse(res, this.requestOptions);
  9570. }
  9571. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9572. let data = JSON.stringify(obj, null, 2);
  9573. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9574. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9575. let res = await this.patch(requestUrl, data, additionalHeaders);
  9576. return this._processResponse(res, this.requestOptions);
  9577. }
  9578. /**
  9579. * Makes a raw http request.
  9580. * All other methods such as get, post, patch, and request ultimately call this.
  9581. * Prefer get, del, post and patch
  9582. */
  9583. async request(verb, requestUrl, data, headers) {
  9584. if (this._disposed) {
  9585. throw new Error('Client has already been disposed.');
  9586. }
  9587. let parsedUrl = url.parse(requestUrl);
  9588. let info = this._prepareRequest(verb, parsedUrl, headers);
  9589. // Only perform retries on reads since writes may not be idempotent.
  9590. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9591. ? this._maxRetries + 1
  9592. : 1;
  9593. let numTries = 0;
  9594. let response;
  9595. while (numTries < maxTries) {
  9596. response = await this.requestRaw(info, data);
  9597. // Check if it's an authentication challenge
  9598. if (response &&
  9599. response.message &&
  9600. response.message.statusCode === HttpCodes.Unauthorized) {
  9601. let authenticationHandler;
  9602. for (let i = 0; i < this.handlers.length; i++) {
  9603. if (this.handlers[i].canHandleAuthentication(response)) {
  9604. authenticationHandler = this.handlers[i];
  9605. break;
  9606. }
  9607. }
  9608. if (authenticationHandler) {
  9609. return authenticationHandler.handleAuthentication(this, info, data);
  9610. }
  9611. else {
  9612. // We have received an unauthorized response but have no handlers to handle it.
  9613. // Let the response return to the caller.
  9614. return response;
  9615. }
  9616. }
  9617. let redirectsRemaining = this._maxRedirects;
  9618. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9619. this._allowRedirects &&
  9620. redirectsRemaining > 0) {
  9621. const redirectUrl = response.message.headers['location'];
  9622. if (!redirectUrl) {
  9623. // if there's no location to redirect to, we won't
  9624. break;
  9625. }
  9626. let parsedRedirectUrl = url.parse(redirectUrl);
  9627. if (parsedUrl.protocol == 'https:' &&
  9628. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9629. !this._allowRedirectDowngrade) {
  9630. 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.');
  9631. }
  9632. // we need to finish reading the response before reassigning response
  9633. // which will leak the open socket.
  9634. await response.readBody();
  9635. // strip authorization header if redirected to a different hostname
  9636. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9637. for (let header in headers) {
  9638. // header names are case insensitive
  9639. if (header.toLowerCase() === 'authorization') {
  9640. delete headers[header];
  9641. }
  9642. }
  9643. }
  9644. // let's make the request with the new redirectUrl
  9645. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9646. response = await this.requestRaw(info, data);
  9647. redirectsRemaining--;
  9648. }
  9649. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9650. // If not a retry code, return immediately instead of retrying
  9651. return response;
  9652. }
  9653. numTries += 1;
  9654. if (numTries < maxTries) {
  9655. await response.readBody();
  9656. await this._performExponentialBackoff(numTries);
  9657. }
  9658. }
  9659. return response;
  9660. }
  9661. /**
  9662. * Needs to be called if keepAlive is set to true in request options.
  9663. */
  9664. dispose() {
  9665. if (this._agent) {
  9666. this._agent.destroy();
  9667. }
  9668. this._disposed = true;
  9669. }
  9670. /**
  9671. * Raw request.
  9672. * @param info
  9673. * @param data
  9674. */
  9675. requestRaw(info, data) {
  9676. return new Promise((resolve, reject) => {
  9677. let callbackForResult = function (err, res) {
  9678. if (err) {
  9679. reject(err);
  9680. }
  9681. resolve(res);
  9682. };
  9683. this.requestRawWithCallback(info, data, callbackForResult);
  9684. });
  9685. }
  9686. /**
  9687. * Raw request with callback.
  9688. * @param info
  9689. * @param data
  9690. * @param onResult
  9691. */
  9692. requestRawWithCallback(info, data, onResult) {
  9693. let socket;
  9694. if (typeof data === 'string') {
  9695. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9696. }
  9697. let callbackCalled = false;
  9698. let handleResult = (err, res) => {
  9699. if (!callbackCalled) {
  9700. callbackCalled = true;
  9701. onResult(err, res);
  9702. }
  9703. };
  9704. let req = info.httpModule.request(info.options, (msg) => {
  9705. let res = new HttpClientResponse(msg);
  9706. handleResult(null, res);
  9707. });
  9708. req.on('socket', sock => {
  9709. socket = sock;
  9710. });
  9711. // If we ever get disconnected, we want the socket to timeout eventually
  9712. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9713. if (socket) {
  9714. socket.end();
  9715. }
  9716. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9717. });
  9718. req.on('error', function (err) {
  9719. // err has statusCode property
  9720. // res should have headers
  9721. handleResult(err, null);
  9722. });
  9723. if (data && typeof data === 'string') {
  9724. req.write(data, 'utf8');
  9725. }
  9726. if (data && typeof data !== 'string') {
  9727. data.on('close', function () {
  9728. req.end();
  9729. });
  9730. data.pipe(req);
  9731. }
  9732. else {
  9733. req.end();
  9734. }
  9735. }
  9736. /**
  9737. * Gets an http agent. This function is useful when you need an http agent that handles
  9738. * routing through a proxy server - depending upon the url and proxy environment variables.
  9739. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9740. */
  9741. getAgent(serverUrl) {
  9742. let parsedUrl = url.parse(serverUrl);
  9743. return this._getAgent(parsedUrl);
  9744. }
  9745. _prepareRequest(method, requestUrl, headers) {
  9746. const info = {};
  9747. info.parsedUrl = requestUrl;
  9748. const usingSsl = info.parsedUrl.protocol === 'https:';
  9749. info.httpModule = usingSsl ? https : http;
  9750. const defaultPort = usingSsl ? 443 : 80;
  9751. info.options = {};
  9752. info.options.host = info.parsedUrl.hostname;
  9753. info.options.port = info.parsedUrl.port
  9754. ? parseInt(info.parsedUrl.port)
  9755. : defaultPort;
  9756. info.options.path =
  9757. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9758. info.options.method = method;
  9759. info.options.headers = this._mergeHeaders(headers);
  9760. if (this.userAgent != null) {
  9761. info.options.headers['user-agent'] = this.userAgent;
  9762. }
  9763. info.options.agent = this._getAgent(info.parsedUrl);
  9764. // gives handlers an opportunity to participate
  9765. if (this.handlers) {
  9766. this.handlers.forEach(handler => {
  9767. handler.prepareRequest(info.options);
  9768. });
  9769. }
  9770. return info;
  9771. }
  9772. _mergeHeaders(headers) {
  9773. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9774. if (this.requestOptions && this.requestOptions.headers) {
  9775. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9776. }
  9777. return lowercaseKeys(headers || {});
  9778. }
  9779. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  9780. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  9781. let clientHeader;
  9782. if (this.requestOptions && this.requestOptions.headers) {
  9783. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  9784. }
  9785. return additionalHeaders[header] || clientHeader || _default;
  9786. }
  9787. _getAgent(parsedUrl) {
  9788. let agent;
  9789. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9790. let useProxy = proxyUrl && proxyUrl.hostname;
  9791. if (this._keepAlive && useProxy) {
  9792. agent = this._proxyAgent;
  9793. }
  9794. if (this._keepAlive && !useProxy) {
  9795. agent = this._agent;
  9796. }
  9797. // if agent is already assigned use that agent.
  9798. if (!!agent) {
  9799. return agent;
  9800. }
  9801. const usingSsl = parsedUrl.protocol === 'https:';
  9802. let maxSockets = 100;
  9803. if (!!this.requestOptions) {
  9804. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9805. }
  9806. if (useProxy) {
  9807. // If using proxy, need tunnel
  9808. if (!tunnel) {
  9809. tunnel = __webpack_require__(335);
  9810. }
  9811. const agentOptions = {
  9812. maxSockets: maxSockets,
  9813. keepAlive: this._keepAlive,
  9814. proxy: {
  9815. proxyAuth: proxyUrl.auth,
  9816. host: proxyUrl.hostname,
  9817. port: proxyUrl.port
  9818. }
  9819. };
  9820. let tunnelAgent;
  9821. const overHttps = proxyUrl.protocol === 'https:';
  9822. if (usingSsl) {
  9823. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9824. }
  9825. else {
  9826. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9827. }
  9828. agent = tunnelAgent(agentOptions);
  9829. this._proxyAgent = agent;
  9830. }
  9831. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9832. if (this._keepAlive && !agent) {
  9833. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9834. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9835. this._agent = agent;
  9836. }
  9837. // if not using private agent and tunnel agent isn't setup then use global agent
  9838. if (!agent) {
  9839. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9840. }
  9841. if (usingSsl && this._ignoreSslError) {
  9842. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9843. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9844. // we have to cast it to any and change it directly
  9845. agent.options = Object.assign(agent.options || {}, {
  9846. rejectUnauthorized: false
  9847. });
  9848. }
  9849. return agent;
  9850. }
  9851. _performExponentialBackoff(retryNumber) {
  9852. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9853. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9854. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9855. }
  9856. static dateTimeDeserializer(key, value) {
  9857. if (typeof value === 'string') {
  9858. let a = new Date(value);
  9859. if (!isNaN(a.valueOf())) {
  9860. return a;
  9861. }
  9862. }
  9863. return value;
  9864. }
  9865. async _processResponse(res, options) {
  9866. return new Promise(async (resolve, reject) => {
  9867. const statusCode = res.message.statusCode;
  9868. const response = {
  9869. statusCode: statusCode,
  9870. result: null,
  9871. headers: {}
  9872. };
  9873. // not found leads to null obj returned
  9874. if (statusCode == HttpCodes.NotFound) {
  9875. resolve(response);
  9876. }
  9877. let obj;
  9878. let contents;
  9879. // get the result from the body
  9880. try {
  9881. contents = await res.readBody();
  9882. if (contents && contents.length > 0) {
  9883. if (options && options.deserializeDates) {
  9884. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  9885. }
  9886. else {
  9887. obj = JSON.parse(contents);
  9888. }
  9889. response.result = obj;
  9890. }
  9891. response.headers = res.message.headers;
  9892. }
  9893. catch (err) {
  9894. // Invalid resource (contents not json); leaving result obj null
  9895. }
  9896. // note that 3xx redirects are handled by the http layer.
  9897. if (statusCode > 299) {
  9898. let msg;
  9899. // if exception/error in body, attempt to get better error
  9900. if (obj && obj.message) {
  9901. msg = obj.message;
  9902. }
  9903. else if (contents && contents.length > 0) {
  9904. // it may be the case that the exception is in the body message as string
  9905. msg = contents;
  9906. }
  9907. else {
  9908. msg = 'Failed request: (' + statusCode + ')';
  9909. }
  9910. let err = new Error(msg);
  9911. // attach statusCode and body obj (if available) to the error object
  9912. err['statusCode'] = statusCode;
  9913. if (response.result) {
  9914. err['result'] = response.result;
  9915. }
  9916. reject(err);
  9917. }
  9918. else {
  9919. resolve(response);
  9920. }
  9921. });
  9922. }
  9923. }
  9924. exports.HttpClient = HttpClient;
  9925. /***/ }),
  9926. /***/ 550:
  9927. /***/ (function(module, __unusedexports, __webpack_require__) {
  9928. module.exports = getNextPage
  9929. const getPage = __webpack_require__(265)
  9930. function getNextPage (octokit, link, headers) {
  9931. return getPage(octokit, link, 'next', headers)
  9932. }
  9933. /***/ }),
  9934. /***/ 558:
  9935. /***/ (function(module, __unusedexports, __webpack_require__) {
  9936. module.exports = hasPreviousPage
  9937. const deprecate = __webpack_require__(370)
  9938. const getPageLinks = __webpack_require__(577)
  9939. function hasPreviousPage (link) {
  9940. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9941. return getPageLinks(link).prev
  9942. }
  9943. /***/ }),
  9944. /***/ 559:
  9945. /***/ (function(__unusedmodule, exports) {
  9946. "use strict";
  9947. Object.defineProperty(exports, "__esModule", { value: true });
  9948. class GitVersion {
  9949. /**
  9950. * Used for comparing the version of git and git-lfs against the minimum required version
  9951. * @param version the version string, e.g. 1.2 or 1.2.3
  9952. */
  9953. constructor(version) {
  9954. this.major = NaN;
  9955. this.minor = NaN;
  9956. this.patch = NaN;
  9957. if (version) {
  9958. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9959. if (match) {
  9960. this.major = Number(match[1]);
  9961. this.minor = Number(match[2]);
  9962. if (match[4]) {
  9963. this.patch = Number(match[4]);
  9964. }
  9965. }
  9966. }
  9967. }
  9968. /**
  9969. * Compares the instance against a minimum required version
  9970. * @param minimum Minimum version
  9971. */
  9972. checkMinimum(minimum) {
  9973. if (!minimum.isValid()) {
  9974. throw new Error('Arg minimum is not a valid version');
  9975. }
  9976. // Major is insufficient
  9977. if (this.major < minimum.major) {
  9978. return false;
  9979. }
  9980. // Major is equal
  9981. if (this.major === minimum.major) {
  9982. // Minor is insufficient
  9983. if (this.minor < minimum.minor) {
  9984. return false;
  9985. }
  9986. // Minor is equal
  9987. if (this.minor === minimum.minor) {
  9988. // Patch is insufficient
  9989. if (this.patch && this.patch < (minimum.patch || 0)) {
  9990. return false;
  9991. }
  9992. }
  9993. }
  9994. return true;
  9995. }
  9996. /**
  9997. * Indicates whether the instance was constructed from a valid version string
  9998. */
  9999. isValid() {
  10000. return !isNaN(this.major);
  10001. }
  10002. /**
  10003. * Returns the version as a string, e.g. 1.2 or 1.2.3
  10004. */
  10005. toString() {
  10006. let result = '';
  10007. if (this.isValid()) {
  10008. result = `${this.major}.${this.minor}`;
  10009. if (!isNaN(this.patch)) {
  10010. result += `.${this.patch}`;
  10011. }
  10012. }
  10013. return result;
  10014. }
  10015. }
  10016. exports.GitVersion = GitVersion;
  10017. /***/ }),
  10018. /***/ 562:
  10019. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10020. "use strict";
  10021. Object.defineProperty(exports, '__esModule', { value: true });
  10022. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10023. var osName = _interopDefault(__webpack_require__(2));
  10024. function getUserAgent() {
  10025. try {
  10026. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10027. } catch (error) {
  10028. if (/wmic os get Caption/.test(error.message)) {
  10029. return "Windows <version undetectable>";
  10030. }
  10031. return "<environment undetectable>";
  10032. }
  10033. }
  10034. exports.getUserAgent = getUserAgent;
  10035. //# sourceMappingURL=index.js.map
  10036. /***/ }),
  10037. /***/ 563:
  10038. /***/ (function(module, __unusedexports, __webpack_require__) {
  10039. module.exports = getPreviousPage
  10040. const getPage = __webpack_require__(265)
  10041. function getPreviousPage (octokit, link, headers) {
  10042. return getPage(octokit, link, 'prev', headers)
  10043. }
  10044. /***/ }),
  10045. /***/ 568:
  10046. /***/ (function(module, __unusedexports, __webpack_require__) {
  10047. "use strict";
  10048. const path = __webpack_require__(622);
  10049. const niceTry = __webpack_require__(948);
  10050. const resolveCommand = __webpack_require__(489);
  10051. const escape = __webpack_require__(462);
  10052. const readShebang = __webpack_require__(389);
  10053. const semver = __webpack_require__(280);
  10054. const isWin = process.platform === 'win32';
  10055. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10056. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10057. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10058. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10059. function detectShebang(parsed) {
  10060. parsed.file = resolveCommand(parsed);
  10061. const shebang = parsed.file && readShebang(parsed.file);
  10062. if (shebang) {
  10063. parsed.args.unshift(parsed.file);
  10064. parsed.command = shebang;
  10065. return resolveCommand(parsed);
  10066. }
  10067. return parsed.file;
  10068. }
  10069. function parseNonShell(parsed) {
  10070. if (!isWin) {
  10071. return parsed;
  10072. }
  10073. // Detect & add support for shebangs
  10074. const commandFile = detectShebang(parsed);
  10075. // We don't need a shell if the command filename is an executable
  10076. const needsShell = !isExecutableRegExp.test(commandFile);
  10077. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10078. // Note that `forceShell` is an hidden option used only in tests
  10079. if (parsed.options.forceShell || needsShell) {
  10080. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10081. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10082. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10083. // we need to double escape them
  10084. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10085. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10086. // This is necessary otherwise it will always fail with ENOENT in those cases
  10087. parsed.command = path.normalize(parsed.command);
  10088. // Escape command & arguments
  10089. parsed.command = escape.command(parsed.command);
  10090. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10091. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10092. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10093. parsed.command = process.env.comspec || 'cmd.exe';
  10094. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10095. }
  10096. return parsed;
  10097. }
  10098. function parseShell(parsed) {
  10099. // If node supports the shell option, there's no need to mimic its behavior
  10100. if (supportsShellOption) {
  10101. return parsed;
  10102. }
  10103. // Mimic node shell option
  10104. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10105. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10106. if (isWin) {
  10107. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10108. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10109. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10110. } else {
  10111. if (typeof parsed.options.shell === 'string') {
  10112. parsed.command = parsed.options.shell;
  10113. } else if (process.platform === 'android') {
  10114. parsed.command = '/system/bin/sh';
  10115. } else {
  10116. parsed.command = '/bin/sh';
  10117. }
  10118. parsed.args = ['-c', shellCommand];
  10119. }
  10120. return parsed;
  10121. }
  10122. function parse(command, args, options) {
  10123. // Normalize arguments, similar to nodejs
  10124. if (args && !Array.isArray(args)) {
  10125. options = args;
  10126. args = null;
  10127. }
  10128. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10129. options = Object.assign({}, options); // Clone object to avoid changing the original
  10130. // Build our parsed object
  10131. const parsed = {
  10132. command,
  10133. args,
  10134. options,
  10135. file: undefined,
  10136. original: {
  10137. command,
  10138. args,
  10139. },
  10140. };
  10141. // Delegate further parsing to shell or non-shell
  10142. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10143. }
  10144. module.exports = parse;
  10145. /***/ }),
  10146. /***/ 577:
  10147. /***/ (function(module) {
  10148. module.exports = getPageLinks
  10149. function getPageLinks (link) {
  10150. link = link.link || link.headers.link || ''
  10151. const links = {}
  10152. // link format:
  10153. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10154. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10155. links[type] = uri
  10156. })
  10157. return links
  10158. }
  10159. /***/ }),
  10160. /***/ 587:
  10161. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10162. "use strict";
  10163. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10164. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10165. return new (P || (P = Promise))(function (resolve, reject) {
  10166. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10167. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10168. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10169. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10170. });
  10171. };
  10172. var __importStar = (this && this.__importStar) || function (mod) {
  10173. if (mod && mod.__esModule) return mod;
  10174. var result = {};
  10175. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10176. result["default"] = mod;
  10177. return result;
  10178. };
  10179. Object.defineProperty(exports, "__esModule", { value: true });
  10180. const core = __importStar(__webpack_require__(470));
  10181. const defaultMaxAttempts = 3;
  10182. const defaultMinSeconds = 10;
  10183. const defaultMaxSeconds = 20;
  10184. class RetryHelper {
  10185. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10186. this.maxAttempts = maxAttempts;
  10187. this.minSeconds = Math.floor(minSeconds);
  10188. this.maxSeconds = Math.floor(maxSeconds);
  10189. if (this.minSeconds > this.maxSeconds) {
  10190. throw new Error('min seconds should be less than or equal to max seconds');
  10191. }
  10192. }
  10193. execute(action) {
  10194. return __awaiter(this, void 0, void 0, function* () {
  10195. let attempt = 1;
  10196. while (attempt < this.maxAttempts) {
  10197. // Try
  10198. try {
  10199. return yield action();
  10200. }
  10201. catch (err) {
  10202. core.info(err.message);
  10203. }
  10204. // Sleep
  10205. const seconds = this.getSleepAmount();
  10206. core.info(`Waiting ${seconds} seconds before trying again`);
  10207. yield this.sleep(seconds);
  10208. attempt++;
  10209. }
  10210. // Last attempt
  10211. return yield action();
  10212. });
  10213. }
  10214. getSleepAmount() {
  10215. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10216. this.minSeconds);
  10217. }
  10218. sleep(seconds) {
  10219. return __awaiter(this, void 0, void 0, function* () {
  10220. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10221. });
  10222. }
  10223. }
  10224. exports.RetryHelper = RetryHelper;
  10225. function execute(action) {
  10226. return __awaiter(this, void 0, void 0, function* () {
  10227. const retryHelper = new RetryHelper();
  10228. return yield retryHelper.execute(action);
  10229. });
  10230. }
  10231. exports.execute = execute;
  10232. /***/ }),
  10233. /***/ 605:
  10234. /***/ (function(module) {
  10235. module.exports = require("http");
  10236. /***/ }),
  10237. /***/ 614:
  10238. /***/ (function(module) {
  10239. module.exports = require("events");
  10240. /***/ }),
  10241. /***/ 618:
  10242. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10243. "use strict";
  10244. var __importStar = (this && this.__importStar) || function (mod) {
  10245. if (mod && mod.__esModule) return mod;
  10246. var result = {};
  10247. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10248. result["default"] = mod;
  10249. return result;
  10250. };
  10251. Object.defineProperty(exports, "__esModule", { value: true });
  10252. const fs = __importStar(__webpack_require__(747));
  10253. function directoryExistsSync(path, required) {
  10254. if (!path) {
  10255. throw new Error("Arg 'path' must not be empty");
  10256. }
  10257. let stats;
  10258. try {
  10259. stats = fs.statSync(path);
  10260. }
  10261. catch (error) {
  10262. if (error.code === 'ENOENT') {
  10263. if (!required) {
  10264. return false;
  10265. }
  10266. throw new Error(`Directory '${path}' does not exist`);
  10267. }
  10268. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10269. }
  10270. if (stats.isDirectory()) {
  10271. return true;
  10272. }
  10273. else if (!required) {
  10274. return false;
  10275. }
  10276. throw new Error(`Directory '${path}' does not exist`);
  10277. }
  10278. exports.directoryExistsSync = directoryExistsSync;
  10279. function existsSync(path) {
  10280. if (!path) {
  10281. throw new Error("Arg 'path' must not be empty");
  10282. }
  10283. try {
  10284. fs.statSync(path);
  10285. }
  10286. catch (error) {
  10287. if (error.code === 'ENOENT') {
  10288. return false;
  10289. }
  10290. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10291. }
  10292. return true;
  10293. }
  10294. exports.existsSync = existsSync;
  10295. function fileExistsSync(path) {
  10296. if (!path) {
  10297. throw new Error("Arg 'path' must not be empty");
  10298. }
  10299. let stats;
  10300. try {
  10301. stats = fs.statSync(path);
  10302. }
  10303. catch (error) {
  10304. if (error.code === 'ENOENT') {
  10305. return false;
  10306. }
  10307. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  10308. }
  10309. if (!stats.isDirectory()) {
  10310. return true;
  10311. }
  10312. return false;
  10313. }
  10314. exports.fileExistsSync = fileExistsSync;
  10315. /***/ }),
  10316. /***/ 621:
  10317. /***/ (function(module, __unusedexports, __webpack_require__) {
  10318. "use strict";
  10319. const path = __webpack_require__(622);
  10320. const pathKey = __webpack_require__(39);
  10321. module.exports = opts => {
  10322. opts = Object.assign({
  10323. cwd: process.cwd(),
  10324. path: process.env[pathKey()]
  10325. }, opts);
  10326. let prev;
  10327. let pth = path.resolve(opts.cwd);
  10328. const ret = [];
  10329. while (prev !== pth) {
  10330. ret.push(path.join(pth, 'node_modules/.bin'));
  10331. prev = pth;
  10332. pth = path.resolve(pth, '..');
  10333. }
  10334. // ensure the running `node` binary is used
  10335. ret.push(path.dirname(process.execPath));
  10336. return ret.concat(opts.path).join(path.delimiter);
  10337. };
  10338. module.exports.env = opts => {
  10339. opts = Object.assign({
  10340. env: process.env
  10341. }, opts);
  10342. const env = Object.assign({}, opts.env);
  10343. const path = pathKey({env});
  10344. opts.path = env[path];
  10345. env[path] = module.exports(opts);
  10346. return env;
  10347. };
  10348. /***/ }),
  10349. /***/ 622:
  10350. /***/ (function(module) {
  10351. module.exports = require("path");
  10352. /***/ }),
  10353. /***/ 631:
  10354. /***/ (function(module) {
  10355. module.exports = require("net");
  10356. /***/ }),
  10357. /***/ 649:
  10358. /***/ (function(module, __unusedexports, __webpack_require__) {
  10359. module.exports = getLastPage
  10360. const getPage = __webpack_require__(265)
  10361. function getLastPage (octokit, link, headers) {
  10362. return getPage(octokit, link, 'last', headers)
  10363. }
  10364. /***/ }),
  10365. /***/ 654:
  10366. /***/ (function(module) {
  10367. // This is not the set of all possible signals.
  10368. //
  10369. // It IS, however, the set of all signals that trigger
  10370. // an exit on either Linux or BSD systems. Linux is a
  10371. // superset of the signal names supported on BSD, and
  10372. // the unknown signals just fail to register, so we can
  10373. // catch that easily enough.
  10374. //
  10375. // Don't bother with SIGKILL. It's uncatchable, which
  10376. // means that we can't fire any callbacks anyway.
  10377. //
  10378. // If a user does happen to register a handler on a non-
  10379. // fatal signal like SIGWINCH or something, and then
  10380. // exit, it'll end up firing `process.emit('exit')`, so
  10381. // the handler will be fired anyway.
  10382. //
  10383. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10384. // artificially, inherently leave the process in a
  10385. // state from which it is not safe to try and enter JS
  10386. // listeners.
  10387. module.exports = [
  10388. 'SIGABRT',
  10389. 'SIGALRM',
  10390. 'SIGHUP',
  10391. 'SIGINT',
  10392. 'SIGTERM'
  10393. ]
  10394. if (process.platform !== 'win32') {
  10395. module.exports.push(
  10396. 'SIGVTALRM',
  10397. 'SIGXCPU',
  10398. 'SIGXFSZ',
  10399. 'SIGUSR2',
  10400. 'SIGTRAP',
  10401. 'SIGSYS',
  10402. 'SIGQUIT',
  10403. 'SIGIOT'
  10404. // should detect profiler and enable/disable accordingly.
  10405. // see #21
  10406. // 'SIGPROF'
  10407. )
  10408. }
  10409. if (process.platform === 'linux') {
  10410. module.exports.push(
  10411. 'SIGIO',
  10412. 'SIGPOLL',
  10413. 'SIGPWR',
  10414. 'SIGSTKFLT',
  10415. 'SIGUNUSED'
  10416. )
  10417. }
  10418. /***/ }),
  10419. /***/ 656:
  10420. /***/ (function(module, exports) {
  10421. exports = module.exports = SemVer
  10422. var debug
  10423. /* istanbul ignore next */
  10424. if (typeof process === 'object' &&
  10425. process.env &&
  10426. process.env.NODE_DEBUG &&
  10427. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10428. debug = function () {
  10429. var args = Array.prototype.slice.call(arguments, 0)
  10430. args.unshift('SEMVER')
  10431. console.log.apply(console, args)
  10432. }
  10433. } else {
  10434. debug = function () {}
  10435. }
  10436. // Note: this is the semver.org version of the spec that it implements
  10437. // Not necessarily the package version of this code.
  10438. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10439. var MAX_LENGTH = 256
  10440. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10441. /* istanbul ignore next */ 9007199254740991
  10442. // Max safe segment length for coercion.
  10443. var MAX_SAFE_COMPONENT_LENGTH = 16
  10444. // The actual regexps go on exports.re
  10445. var re = exports.re = []
  10446. var src = exports.src = []
  10447. var t = exports.tokens = {}
  10448. var R = 0
  10449. function tok (n) {
  10450. t[n] = R++
  10451. }
  10452. // The following Regular Expressions can be used for tokenizing,
  10453. // validating, and parsing SemVer version strings.
  10454. // ## Numeric Identifier
  10455. // A single `0`, or a non-zero digit followed by zero or more digits.
  10456. tok('NUMERICIDENTIFIER')
  10457. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10458. tok('NUMERICIDENTIFIERLOOSE')
  10459. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10460. // ## Non-numeric Identifier
  10461. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10462. // more letters, digits, or hyphens.
  10463. tok('NONNUMERICIDENTIFIER')
  10464. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10465. // ## Main Version
  10466. // Three dot-separated numeric identifiers.
  10467. tok('MAINVERSION')
  10468. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10469. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10470. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10471. tok('MAINVERSIONLOOSE')
  10472. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10473. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10474. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10475. // ## Pre-release Version Identifier
  10476. // A numeric identifier, or a non-numeric identifier.
  10477. tok('PRERELEASEIDENTIFIER')
  10478. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10479. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10480. tok('PRERELEASEIDENTIFIERLOOSE')
  10481. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10482. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10483. // ## Pre-release Version
  10484. // Hyphen, followed by one or more dot-separated pre-release version
  10485. // identifiers.
  10486. tok('PRERELEASE')
  10487. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10488. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10489. tok('PRERELEASELOOSE')
  10490. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10491. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10492. // ## Build Metadata Identifier
  10493. // Any combination of digits, letters, or hyphens.
  10494. tok('BUILDIDENTIFIER')
  10495. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10496. // ## Build Metadata
  10497. // Plus sign, followed by one or more period-separated build metadata
  10498. // identifiers.
  10499. tok('BUILD')
  10500. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10501. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10502. // ## Full Version String
  10503. // A main version, followed optionally by a pre-release version and
  10504. // build metadata.
  10505. // Note that the only major, minor, patch, and pre-release sections of
  10506. // the version string are capturing groups. The build metadata is not a
  10507. // capturing group, because it should not ever be used in version
  10508. // comparison.
  10509. tok('FULL')
  10510. tok('FULLPLAIN')
  10511. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10512. src[t.PRERELEASE] + '?' +
  10513. src[t.BUILD] + '?'
  10514. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10515. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10516. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10517. // common in the npm registry.
  10518. tok('LOOSEPLAIN')
  10519. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10520. src[t.PRERELEASELOOSE] + '?' +
  10521. src[t.BUILD] + '?'
  10522. tok('LOOSE')
  10523. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10524. tok('GTLT')
  10525. src[t.GTLT] = '((?:<|>)?=?)'
  10526. // Something like "2.*" or "1.2.x".
  10527. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10528. // Only the first item is strictly required.
  10529. tok('XRANGEIDENTIFIERLOOSE')
  10530. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10531. tok('XRANGEIDENTIFIER')
  10532. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10533. tok('XRANGEPLAIN')
  10534. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10535. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10536. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10537. '(?:' + src[t.PRERELEASE] + ')?' +
  10538. src[t.BUILD] + '?' +
  10539. ')?)?'
  10540. tok('XRANGEPLAINLOOSE')
  10541. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10542. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10543. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10544. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10545. src[t.BUILD] + '?' +
  10546. ')?)?'
  10547. tok('XRANGE')
  10548. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10549. tok('XRANGELOOSE')
  10550. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10551. // Coercion.
  10552. // Extract anything that could conceivably be a part of a valid semver
  10553. tok('COERCE')
  10554. src[t.COERCE] = '(^|[^\\d])' +
  10555. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10556. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10557. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10558. '(?:$|[^\\d])'
  10559. tok('COERCERTL')
  10560. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10561. // Tilde ranges.
  10562. // Meaning is "reasonably at or greater than"
  10563. tok('LONETILDE')
  10564. src[t.LONETILDE] = '(?:~>?)'
  10565. tok('TILDETRIM')
  10566. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10567. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10568. var tildeTrimReplace = '$1~'
  10569. tok('TILDE')
  10570. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10571. tok('TILDELOOSE')
  10572. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10573. // Caret ranges.
  10574. // Meaning is "at least and backwards compatible with"
  10575. tok('LONECARET')
  10576. src[t.LONECARET] = '(?:\\^)'
  10577. tok('CARETTRIM')
  10578. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10579. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10580. var caretTrimReplace = '$1^'
  10581. tok('CARET')
  10582. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10583. tok('CARETLOOSE')
  10584. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10585. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10586. tok('COMPARATORLOOSE')
  10587. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10588. tok('COMPARATOR')
  10589. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10590. // An expression to strip any whitespace between the gtlt and the thing
  10591. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10592. tok('COMPARATORTRIM')
  10593. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10594. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10595. // this one has to use the /g flag
  10596. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10597. var comparatorTrimReplace = '$1$2$3'
  10598. // Something like `1.2.3 - 1.2.4`
  10599. // Note that these all use the loose form, because they'll be
  10600. // checked against either the strict or loose comparator form
  10601. // later.
  10602. tok('HYPHENRANGE')
  10603. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10604. '\\s+-\\s+' +
  10605. '(' + src[t.XRANGEPLAIN] + ')' +
  10606. '\\s*$'
  10607. tok('HYPHENRANGELOOSE')
  10608. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10609. '\\s+-\\s+' +
  10610. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10611. '\\s*$'
  10612. // Star ranges basically just allow anything at all.
  10613. tok('STAR')
  10614. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10615. // Compile to actual regexp objects.
  10616. // All are flag-free, unless they were created above with a flag.
  10617. for (var i = 0; i < R; i++) {
  10618. debug(i, src[i])
  10619. if (!re[i]) {
  10620. re[i] = new RegExp(src[i])
  10621. }
  10622. }
  10623. exports.parse = parse
  10624. function parse (version, options) {
  10625. if (!options || typeof options !== 'object') {
  10626. options = {
  10627. loose: !!options,
  10628. includePrerelease: false
  10629. }
  10630. }
  10631. if (version instanceof SemVer) {
  10632. return version
  10633. }
  10634. if (typeof version !== 'string') {
  10635. return null
  10636. }
  10637. if (version.length > MAX_LENGTH) {
  10638. return null
  10639. }
  10640. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10641. if (!r.test(version)) {
  10642. return null
  10643. }
  10644. try {
  10645. return new SemVer(version, options)
  10646. } catch (er) {
  10647. return null
  10648. }
  10649. }
  10650. exports.valid = valid
  10651. function valid (version, options) {
  10652. var v = parse(version, options)
  10653. return v ? v.version : null
  10654. }
  10655. exports.clean = clean
  10656. function clean (version, options) {
  10657. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10658. return s ? s.version : null
  10659. }
  10660. exports.SemVer = SemVer
  10661. function SemVer (version, options) {
  10662. if (!options || typeof options !== 'object') {
  10663. options = {
  10664. loose: !!options,
  10665. includePrerelease: false
  10666. }
  10667. }
  10668. if (version instanceof SemVer) {
  10669. if (version.loose === options.loose) {
  10670. return version
  10671. } else {
  10672. version = version.version
  10673. }
  10674. } else if (typeof version !== 'string') {
  10675. throw new TypeError('Invalid Version: ' + version)
  10676. }
  10677. if (version.length > MAX_LENGTH) {
  10678. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10679. }
  10680. if (!(this instanceof SemVer)) {
  10681. return new SemVer(version, options)
  10682. }
  10683. debug('SemVer', version, options)
  10684. this.options = options
  10685. this.loose = !!options.loose
  10686. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10687. if (!m) {
  10688. throw new TypeError('Invalid Version: ' + version)
  10689. }
  10690. this.raw = version
  10691. // these are actually numbers
  10692. this.major = +m[1]
  10693. this.minor = +m[2]
  10694. this.patch = +m[3]
  10695. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10696. throw new TypeError('Invalid major version')
  10697. }
  10698. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10699. throw new TypeError('Invalid minor version')
  10700. }
  10701. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10702. throw new TypeError('Invalid patch version')
  10703. }
  10704. // numberify any prerelease numeric ids
  10705. if (!m[4]) {
  10706. this.prerelease = []
  10707. } else {
  10708. this.prerelease = m[4].split('.').map(function (id) {
  10709. if (/^[0-9]+$/.test(id)) {
  10710. var num = +id
  10711. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10712. return num
  10713. }
  10714. }
  10715. return id
  10716. })
  10717. }
  10718. this.build = m[5] ? m[5].split('.') : []
  10719. this.format()
  10720. }
  10721. SemVer.prototype.format = function () {
  10722. this.version = this.major + '.' + this.minor + '.' + this.patch
  10723. if (this.prerelease.length) {
  10724. this.version += '-' + this.prerelease.join('.')
  10725. }
  10726. return this.version
  10727. }
  10728. SemVer.prototype.toString = function () {
  10729. return this.version
  10730. }
  10731. SemVer.prototype.compare = function (other) {
  10732. debug('SemVer.compare', this.version, this.options, other)
  10733. if (!(other instanceof SemVer)) {
  10734. other = new SemVer(other, this.options)
  10735. }
  10736. return this.compareMain(other) || this.comparePre(other)
  10737. }
  10738. SemVer.prototype.compareMain = function (other) {
  10739. if (!(other instanceof SemVer)) {
  10740. other = new SemVer(other, this.options)
  10741. }
  10742. return compareIdentifiers(this.major, other.major) ||
  10743. compareIdentifiers(this.minor, other.minor) ||
  10744. compareIdentifiers(this.patch, other.patch)
  10745. }
  10746. SemVer.prototype.comparePre = function (other) {
  10747. if (!(other instanceof SemVer)) {
  10748. other = new SemVer(other, this.options)
  10749. }
  10750. // NOT having a prerelease is > having one
  10751. if (this.prerelease.length && !other.prerelease.length) {
  10752. return -1
  10753. } else if (!this.prerelease.length && other.prerelease.length) {
  10754. return 1
  10755. } else if (!this.prerelease.length && !other.prerelease.length) {
  10756. return 0
  10757. }
  10758. var i = 0
  10759. do {
  10760. var a = this.prerelease[i]
  10761. var b = other.prerelease[i]
  10762. debug('prerelease compare', i, a, b)
  10763. if (a === undefined && b === undefined) {
  10764. return 0
  10765. } else if (b === undefined) {
  10766. return 1
  10767. } else if (a === undefined) {
  10768. return -1
  10769. } else if (a === b) {
  10770. continue
  10771. } else {
  10772. return compareIdentifiers(a, b)
  10773. }
  10774. } while (++i)
  10775. }
  10776. SemVer.prototype.compareBuild = function (other) {
  10777. if (!(other instanceof SemVer)) {
  10778. other = new SemVer(other, this.options)
  10779. }
  10780. var i = 0
  10781. do {
  10782. var a = this.build[i]
  10783. var b = other.build[i]
  10784. debug('prerelease compare', i, a, b)
  10785. if (a === undefined && b === undefined) {
  10786. return 0
  10787. } else if (b === undefined) {
  10788. return 1
  10789. } else if (a === undefined) {
  10790. return -1
  10791. } else if (a === b) {
  10792. continue
  10793. } else {
  10794. return compareIdentifiers(a, b)
  10795. }
  10796. } while (++i)
  10797. }
  10798. // preminor will bump the version up to the next minor release, and immediately
  10799. // down to pre-release. premajor and prepatch work the same way.
  10800. SemVer.prototype.inc = function (release, identifier) {
  10801. switch (release) {
  10802. case 'premajor':
  10803. this.prerelease.length = 0
  10804. this.patch = 0
  10805. this.minor = 0
  10806. this.major++
  10807. this.inc('pre', identifier)
  10808. break
  10809. case 'preminor':
  10810. this.prerelease.length = 0
  10811. this.patch = 0
  10812. this.minor++
  10813. this.inc('pre', identifier)
  10814. break
  10815. case 'prepatch':
  10816. // If this is already a prerelease, it will bump to the next version
  10817. // drop any prereleases that might already exist, since they are not
  10818. // relevant at this point.
  10819. this.prerelease.length = 0
  10820. this.inc('patch', identifier)
  10821. this.inc('pre', identifier)
  10822. break
  10823. // If the input is a non-prerelease version, this acts the same as
  10824. // prepatch.
  10825. case 'prerelease':
  10826. if (this.prerelease.length === 0) {
  10827. this.inc('patch', identifier)
  10828. }
  10829. this.inc('pre', identifier)
  10830. break
  10831. case 'major':
  10832. // If this is a pre-major version, bump up to the same major version.
  10833. // Otherwise increment major.
  10834. // 1.0.0-5 bumps to 1.0.0
  10835. // 1.1.0 bumps to 2.0.0
  10836. if (this.minor !== 0 ||
  10837. this.patch !== 0 ||
  10838. this.prerelease.length === 0) {
  10839. this.major++
  10840. }
  10841. this.minor = 0
  10842. this.patch = 0
  10843. this.prerelease = []
  10844. break
  10845. case 'minor':
  10846. // If this is a pre-minor version, bump up to the same minor version.
  10847. // Otherwise increment minor.
  10848. // 1.2.0-5 bumps to 1.2.0
  10849. // 1.2.1 bumps to 1.3.0
  10850. if (this.patch !== 0 || this.prerelease.length === 0) {
  10851. this.minor++
  10852. }
  10853. this.patch = 0
  10854. this.prerelease = []
  10855. break
  10856. case 'patch':
  10857. // If this is not a pre-release version, it will increment the patch.
  10858. // If it is a pre-release it will bump up to the same patch version.
  10859. // 1.2.0-5 patches to 1.2.0
  10860. // 1.2.0 patches to 1.2.1
  10861. if (this.prerelease.length === 0) {
  10862. this.patch++
  10863. }
  10864. this.prerelease = []
  10865. break
  10866. // This probably shouldn't be used publicly.
  10867. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10868. case 'pre':
  10869. if (this.prerelease.length === 0) {
  10870. this.prerelease = [0]
  10871. } else {
  10872. var i = this.prerelease.length
  10873. while (--i >= 0) {
  10874. if (typeof this.prerelease[i] === 'number') {
  10875. this.prerelease[i]++
  10876. i = -2
  10877. }
  10878. }
  10879. if (i === -1) {
  10880. // didn't increment anything
  10881. this.prerelease.push(0)
  10882. }
  10883. }
  10884. if (identifier) {
  10885. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10886. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10887. if (this.prerelease[0] === identifier) {
  10888. if (isNaN(this.prerelease[1])) {
  10889. this.prerelease = [identifier, 0]
  10890. }
  10891. } else {
  10892. this.prerelease = [identifier, 0]
  10893. }
  10894. }
  10895. break
  10896. default:
  10897. throw new Error('invalid increment argument: ' + release)
  10898. }
  10899. this.format()
  10900. this.raw = this.version
  10901. return this
  10902. }
  10903. exports.inc = inc
  10904. function inc (version, release, loose, identifier) {
  10905. if (typeof (loose) === 'string') {
  10906. identifier = loose
  10907. loose = undefined
  10908. }
  10909. try {
  10910. return new SemVer(version, loose).inc(release, identifier).version
  10911. } catch (er) {
  10912. return null
  10913. }
  10914. }
  10915. exports.diff = diff
  10916. function diff (version1, version2) {
  10917. if (eq(version1, version2)) {
  10918. return null
  10919. } else {
  10920. var v1 = parse(version1)
  10921. var v2 = parse(version2)
  10922. var prefix = ''
  10923. if (v1.prerelease.length || v2.prerelease.length) {
  10924. prefix = 'pre'
  10925. var defaultResult = 'prerelease'
  10926. }
  10927. for (var key in v1) {
  10928. if (key === 'major' || key === 'minor' || key === 'patch') {
  10929. if (v1[key] !== v2[key]) {
  10930. return prefix + key
  10931. }
  10932. }
  10933. }
  10934. return defaultResult // may be undefined
  10935. }
  10936. }
  10937. exports.compareIdentifiers = compareIdentifiers
  10938. var numeric = /^[0-9]+$/
  10939. function compareIdentifiers (a, b) {
  10940. var anum = numeric.test(a)
  10941. var bnum = numeric.test(b)
  10942. if (anum && bnum) {
  10943. a = +a
  10944. b = +b
  10945. }
  10946. return a === b ? 0
  10947. : (anum && !bnum) ? -1
  10948. : (bnum && !anum) ? 1
  10949. : a < b ? -1
  10950. : 1
  10951. }
  10952. exports.rcompareIdentifiers = rcompareIdentifiers
  10953. function rcompareIdentifiers (a, b) {
  10954. return compareIdentifiers(b, a)
  10955. }
  10956. exports.major = major
  10957. function major (a, loose) {
  10958. return new SemVer(a, loose).major
  10959. }
  10960. exports.minor = minor
  10961. function minor (a, loose) {
  10962. return new SemVer(a, loose).minor
  10963. }
  10964. exports.patch = patch
  10965. function patch (a, loose) {
  10966. return new SemVer(a, loose).patch
  10967. }
  10968. exports.compare = compare
  10969. function compare (a, b, loose) {
  10970. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10971. }
  10972. exports.compareLoose = compareLoose
  10973. function compareLoose (a, b) {
  10974. return compare(a, b, true)
  10975. }
  10976. exports.compareBuild = compareBuild
  10977. function compareBuild (a, b, loose) {
  10978. var versionA = new SemVer(a, loose)
  10979. var versionB = new SemVer(b, loose)
  10980. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10981. }
  10982. exports.rcompare = rcompare
  10983. function rcompare (a, b, loose) {
  10984. return compare(b, a, loose)
  10985. }
  10986. exports.sort = sort
  10987. function sort (list, loose) {
  10988. return list.sort(function (a, b) {
  10989. return exports.compareBuild(a, b, loose)
  10990. })
  10991. }
  10992. exports.rsort = rsort
  10993. function rsort (list, loose) {
  10994. return list.sort(function (a, b) {
  10995. return exports.compareBuild(b, a, loose)
  10996. })
  10997. }
  10998. exports.gt = gt
  10999. function gt (a, b, loose) {
  11000. return compare(a, b, loose) > 0
  11001. }
  11002. exports.lt = lt
  11003. function lt (a, b, loose) {
  11004. return compare(a, b, loose) < 0
  11005. }
  11006. exports.eq = eq
  11007. function eq (a, b, loose) {
  11008. return compare(a, b, loose) === 0
  11009. }
  11010. exports.neq = neq
  11011. function neq (a, b, loose) {
  11012. return compare(a, b, loose) !== 0
  11013. }
  11014. exports.gte = gte
  11015. function gte (a, b, loose) {
  11016. return compare(a, b, loose) >= 0
  11017. }
  11018. exports.lte = lte
  11019. function lte (a, b, loose) {
  11020. return compare(a, b, loose) <= 0
  11021. }
  11022. exports.cmp = cmp
  11023. function cmp (a, op, b, loose) {
  11024. switch (op) {
  11025. case '===':
  11026. if (typeof a === 'object')
  11027. a = a.version
  11028. if (typeof b === 'object')
  11029. b = b.version
  11030. return a === b
  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. case '=':
  11039. case '==':
  11040. return eq(a, b, loose)
  11041. case '!=':
  11042. return neq(a, b, loose)
  11043. case '>':
  11044. return gt(a, b, loose)
  11045. case '>=':
  11046. return gte(a, b, loose)
  11047. case '<':
  11048. return lt(a, b, loose)
  11049. case '<=':
  11050. return lte(a, b, loose)
  11051. default:
  11052. throw new TypeError('Invalid operator: ' + op)
  11053. }
  11054. }
  11055. exports.Comparator = Comparator
  11056. function Comparator (comp, options) {
  11057. if (!options || typeof options !== 'object') {
  11058. options = {
  11059. loose: !!options,
  11060. includePrerelease: false
  11061. }
  11062. }
  11063. if (comp instanceof Comparator) {
  11064. if (comp.loose === !!options.loose) {
  11065. return comp
  11066. } else {
  11067. comp = comp.value
  11068. }
  11069. }
  11070. if (!(this instanceof Comparator)) {
  11071. return new Comparator(comp, options)
  11072. }
  11073. debug('comparator', comp, options)
  11074. this.options = options
  11075. this.loose = !!options.loose
  11076. this.parse(comp)
  11077. if (this.semver === ANY) {
  11078. this.value = ''
  11079. } else {
  11080. this.value = this.operator + this.semver.version
  11081. }
  11082. debug('comp', this)
  11083. }
  11084. var ANY = {}
  11085. Comparator.prototype.parse = function (comp) {
  11086. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11087. var m = comp.match(r)
  11088. if (!m) {
  11089. throw new TypeError('Invalid comparator: ' + comp)
  11090. }
  11091. this.operator = m[1] !== undefined ? m[1] : ''
  11092. if (this.operator === '=') {
  11093. this.operator = ''
  11094. }
  11095. // if it literally is just '>' or '' then allow anything.
  11096. if (!m[2]) {
  11097. this.semver = ANY
  11098. } else {
  11099. this.semver = new SemVer(m[2], this.options.loose)
  11100. }
  11101. }
  11102. Comparator.prototype.toString = function () {
  11103. return this.value
  11104. }
  11105. Comparator.prototype.test = function (version) {
  11106. debug('Comparator.test', version, this.options.loose)
  11107. if (this.semver === ANY || version === ANY) {
  11108. return true
  11109. }
  11110. if (typeof version === 'string') {
  11111. try {
  11112. version = new SemVer(version, this.options)
  11113. } catch (er) {
  11114. return false
  11115. }
  11116. }
  11117. return cmp(version, this.operator, this.semver, this.options)
  11118. }
  11119. Comparator.prototype.intersects = function (comp, options) {
  11120. if (!(comp instanceof Comparator)) {
  11121. throw new TypeError('a Comparator is required')
  11122. }
  11123. if (!options || typeof options !== 'object') {
  11124. options = {
  11125. loose: !!options,
  11126. includePrerelease: false
  11127. }
  11128. }
  11129. var rangeTmp
  11130. if (this.operator === '') {
  11131. if (this.value === '') {
  11132. return true
  11133. }
  11134. rangeTmp = new Range(comp.value, options)
  11135. return satisfies(this.value, rangeTmp, options)
  11136. } else if (comp.operator === '') {
  11137. if (comp.value === '') {
  11138. return true
  11139. }
  11140. rangeTmp = new Range(this.value, options)
  11141. return satisfies(comp.semver, rangeTmp, options)
  11142. }
  11143. var sameDirectionIncreasing =
  11144. (this.operator === '>=' || this.operator === '>') &&
  11145. (comp.operator === '>=' || comp.operator === '>')
  11146. var sameDirectionDecreasing =
  11147. (this.operator === '<=' || this.operator === '<') &&
  11148. (comp.operator === '<=' || comp.operator === '<')
  11149. var sameSemVer = this.semver.version === comp.semver.version
  11150. var differentDirectionsInclusive =
  11151. (this.operator === '>=' || this.operator === '<=') &&
  11152. (comp.operator === '>=' || comp.operator === '<=')
  11153. var oppositeDirectionsLessThan =
  11154. cmp(this.semver, '<', comp.semver, options) &&
  11155. ((this.operator === '>=' || this.operator === '>') &&
  11156. (comp.operator === '<=' || comp.operator === '<'))
  11157. var oppositeDirectionsGreaterThan =
  11158. cmp(this.semver, '>', comp.semver, options) &&
  11159. ((this.operator === '<=' || this.operator === '<') &&
  11160. (comp.operator === '>=' || comp.operator === '>'))
  11161. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11162. (sameSemVer && differentDirectionsInclusive) ||
  11163. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11164. }
  11165. exports.Range = Range
  11166. function Range (range, options) {
  11167. if (!options || typeof options !== 'object') {
  11168. options = {
  11169. loose: !!options,
  11170. includePrerelease: false
  11171. }
  11172. }
  11173. if (range instanceof Range) {
  11174. if (range.loose === !!options.loose &&
  11175. range.includePrerelease === !!options.includePrerelease) {
  11176. return range
  11177. } else {
  11178. return new Range(range.raw, options)
  11179. }
  11180. }
  11181. if (range instanceof Comparator) {
  11182. return new Range(range.value, options)
  11183. }
  11184. if (!(this instanceof Range)) {
  11185. return new Range(range, options)
  11186. }
  11187. this.options = options
  11188. this.loose = !!options.loose
  11189. this.includePrerelease = !!options.includePrerelease
  11190. // First, split based on boolean or ||
  11191. this.raw = range
  11192. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11193. return this.parseRange(range.trim())
  11194. }, this).filter(function (c) {
  11195. // throw out any that are not relevant for whatever reason
  11196. return c.length
  11197. })
  11198. if (!this.set.length) {
  11199. throw new TypeError('Invalid SemVer Range: ' + range)
  11200. }
  11201. this.format()
  11202. }
  11203. Range.prototype.format = function () {
  11204. this.range = this.set.map(function (comps) {
  11205. return comps.join(' ').trim()
  11206. }).join('||').trim()
  11207. return this.range
  11208. }
  11209. Range.prototype.toString = function () {
  11210. return this.range
  11211. }
  11212. Range.prototype.parseRange = function (range) {
  11213. var loose = this.options.loose
  11214. range = range.trim()
  11215. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11216. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11217. range = range.replace(hr, hyphenReplace)
  11218. debug('hyphen replace', range)
  11219. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11220. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11221. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11222. // `~ 1.2.3` => `~1.2.3`
  11223. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11224. // `^ 1.2.3` => `^1.2.3`
  11225. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11226. // normalize spaces
  11227. range = range.split(/\s+/).join(' ')
  11228. // At this point, the range is completely trimmed and
  11229. // ready to be split into comparators.
  11230. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11231. var set = range.split(' ').map(function (comp) {
  11232. return parseComparator(comp, this.options)
  11233. }, this).join(' ').split(/\s+/)
  11234. if (this.options.loose) {
  11235. // in loose mode, throw out any that are not valid comparators
  11236. set = set.filter(function (comp) {
  11237. return !!comp.match(compRe)
  11238. })
  11239. }
  11240. set = set.map(function (comp) {
  11241. return new Comparator(comp, this.options)
  11242. }, this)
  11243. return set
  11244. }
  11245. Range.prototype.intersects = function (range, options) {
  11246. if (!(range instanceof Range)) {
  11247. throw new TypeError('a Range is required')
  11248. }
  11249. return this.set.some(function (thisComparators) {
  11250. return (
  11251. isSatisfiable(thisComparators, options) &&
  11252. range.set.some(function (rangeComparators) {
  11253. return (
  11254. isSatisfiable(rangeComparators, options) &&
  11255. thisComparators.every(function (thisComparator) {
  11256. return rangeComparators.every(function (rangeComparator) {
  11257. return thisComparator.intersects(rangeComparator, options)
  11258. })
  11259. })
  11260. )
  11261. })
  11262. )
  11263. })
  11264. }
  11265. // take a set of comparators and determine whether there
  11266. // exists a version which can satisfy it
  11267. function isSatisfiable (comparators, options) {
  11268. var result = true
  11269. var remainingComparators = comparators.slice()
  11270. var testComparator = remainingComparators.pop()
  11271. while (result && remainingComparators.length) {
  11272. result = remainingComparators.every(function (otherComparator) {
  11273. return testComparator.intersects(otherComparator, options)
  11274. })
  11275. testComparator = remainingComparators.pop()
  11276. }
  11277. return result
  11278. }
  11279. // Mostly just for testing and legacy API reasons
  11280. exports.toComparators = toComparators
  11281. function toComparators (range, options) {
  11282. return new Range(range, options).set.map(function (comp) {
  11283. return comp.map(function (c) {
  11284. return c.value
  11285. }).join(' ').trim().split(' ')
  11286. })
  11287. }
  11288. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11289. // already replaced the hyphen ranges
  11290. // turn into a set of JUST comparators.
  11291. function parseComparator (comp, options) {
  11292. debug('comp', comp, options)
  11293. comp = replaceCarets(comp, options)
  11294. debug('caret', comp)
  11295. comp = replaceTildes(comp, options)
  11296. debug('tildes', comp)
  11297. comp = replaceXRanges(comp, options)
  11298. debug('xrange', comp)
  11299. comp = replaceStars(comp, options)
  11300. debug('stars', comp)
  11301. return comp
  11302. }
  11303. function isX (id) {
  11304. return !id || id.toLowerCase() === 'x' || id === '*'
  11305. }
  11306. // ~, ~> --> * (any, kinda silly)
  11307. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11308. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11309. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11310. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11311. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11312. function replaceTildes (comp, options) {
  11313. return comp.trim().split(/\s+/).map(function (comp) {
  11314. return replaceTilde(comp, options)
  11315. }).join(' ')
  11316. }
  11317. function replaceTilde (comp, options) {
  11318. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11319. return comp.replace(r, function (_, M, m, p, pr) {
  11320. debug('tilde', comp, _, M, m, p, pr)
  11321. var ret
  11322. if (isX(M)) {
  11323. ret = ''
  11324. } else if (isX(m)) {
  11325. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11326. } else if (isX(p)) {
  11327. // ~1.2 == >=1.2.0 <1.3.0
  11328. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11329. } else if (pr) {
  11330. debug('replaceTilde pr', pr)
  11331. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11332. ' <' + M + '.' + (+m + 1) + '.0'
  11333. } else {
  11334. // ~1.2.3 == >=1.2.3 <1.3.0
  11335. ret = '>=' + M + '.' + m + '.' + p +
  11336. ' <' + M + '.' + (+m + 1) + '.0'
  11337. }
  11338. debug('tilde return', ret)
  11339. return ret
  11340. })
  11341. }
  11342. // ^ --> * (any, kinda silly)
  11343. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11344. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11345. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11346. // ^1.2.3 --> >=1.2.3 <2.0.0
  11347. // ^1.2.0 --> >=1.2.0 <2.0.0
  11348. function replaceCarets (comp, options) {
  11349. return comp.trim().split(/\s+/).map(function (comp) {
  11350. return replaceCaret(comp, options)
  11351. }).join(' ')
  11352. }
  11353. function replaceCaret (comp, options) {
  11354. debug('caret', comp, options)
  11355. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11356. return comp.replace(r, function (_, M, m, p, pr) {
  11357. debug('caret', comp, _, M, m, p, pr)
  11358. var ret
  11359. if (isX(M)) {
  11360. ret = ''
  11361. } else if (isX(m)) {
  11362. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11363. } else if (isX(p)) {
  11364. if (M === '0') {
  11365. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11366. } else {
  11367. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11368. }
  11369. } else if (pr) {
  11370. debug('replaceCaret pr', pr)
  11371. if (M === '0') {
  11372. if (m === '0') {
  11373. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11374. ' <' + M + '.' + m + '.' + (+p + 1)
  11375. } else {
  11376. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11377. ' <' + M + '.' + (+m + 1) + '.0'
  11378. }
  11379. } else {
  11380. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11381. ' <' + (+M + 1) + '.0.0'
  11382. }
  11383. } else {
  11384. debug('no pr')
  11385. if (M === '0') {
  11386. if (m === '0') {
  11387. ret = '>=' + M + '.' + m + '.' + p +
  11388. ' <' + M + '.' + m + '.' + (+p + 1)
  11389. } else {
  11390. ret = '>=' + M + '.' + m + '.' + p +
  11391. ' <' + M + '.' + (+m + 1) + '.0'
  11392. }
  11393. } else {
  11394. ret = '>=' + M + '.' + m + '.' + p +
  11395. ' <' + (+M + 1) + '.0.0'
  11396. }
  11397. }
  11398. debug('caret return', ret)
  11399. return ret
  11400. })
  11401. }
  11402. function replaceXRanges (comp, options) {
  11403. debug('replaceXRanges', comp, options)
  11404. return comp.split(/\s+/).map(function (comp) {
  11405. return replaceXRange(comp, options)
  11406. }).join(' ')
  11407. }
  11408. function replaceXRange (comp, options) {
  11409. comp = comp.trim()
  11410. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11411. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11412. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11413. var xM = isX(M)
  11414. var xm = xM || isX(m)
  11415. var xp = xm || isX(p)
  11416. var anyX = xp
  11417. if (gtlt === '=' && anyX) {
  11418. gtlt = ''
  11419. }
  11420. // if we're including prereleases in the match, then we need
  11421. // to fix this to -0, the lowest possible prerelease value
  11422. pr = options.includePrerelease ? '-0' : ''
  11423. if (xM) {
  11424. if (gtlt === '>' || gtlt === '<') {
  11425. // nothing is allowed
  11426. ret = '<0.0.0-0'
  11427. } else {
  11428. // nothing is forbidden
  11429. ret = '*'
  11430. }
  11431. } else if (gtlt && anyX) {
  11432. // we know patch is an x, because we have any x at all.
  11433. // replace X with 0
  11434. if (xm) {
  11435. m = 0
  11436. }
  11437. p = 0
  11438. if (gtlt === '>') {
  11439. // >1 => >=2.0.0
  11440. // >1.2 => >=1.3.0
  11441. // >1.2.3 => >= 1.2.4
  11442. gtlt = '>='
  11443. if (xm) {
  11444. M = +M + 1
  11445. m = 0
  11446. p = 0
  11447. } else {
  11448. m = +m + 1
  11449. p = 0
  11450. }
  11451. } else if (gtlt === '<=') {
  11452. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11453. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11454. gtlt = '<'
  11455. if (xm) {
  11456. M = +M + 1
  11457. } else {
  11458. m = +m + 1
  11459. }
  11460. }
  11461. ret = gtlt + M + '.' + m + '.' + p + pr
  11462. } else if (xm) {
  11463. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11464. } else if (xp) {
  11465. ret = '>=' + M + '.' + m + '.0' + pr +
  11466. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11467. }
  11468. debug('xRange return', ret)
  11469. return ret
  11470. })
  11471. }
  11472. // Because * is AND-ed with everything else in the comparator,
  11473. // and '' means "any version", just remove the *s entirely.
  11474. function replaceStars (comp, options) {
  11475. debug('replaceStars', comp, options)
  11476. // Looseness is ignored here. star is always as loose as it gets!
  11477. return comp.trim().replace(re[t.STAR], '')
  11478. }
  11479. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11480. // M, m, patch, prerelease, build
  11481. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11482. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11483. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11484. function hyphenReplace ($0,
  11485. from, fM, fm, fp, fpr, fb,
  11486. to, tM, tm, tp, tpr, tb) {
  11487. if (isX(fM)) {
  11488. from = ''
  11489. } else if (isX(fm)) {
  11490. from = '>=' + fM + '.0.0'
  11491. } else if (isX(fp)) {
  11492. from = '>=' + fM + '.' + fm + '.0'
  11493. } else {
  11494. from = '>=' + from
  11495. }
  11496. if (isX(tM)) {
  11497. to = ''
  11498. } else if (isX(tm)) {
  11499. to = '<' + (+tM + 1) + '.0.0'
  11500. } else if (isX(tp)) {
  11501. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11502. } else if (tpr) {
  11503. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11504. } else {
  11505. to = '<=' + to
  11506. }
  11507. return (from + ' ' + to).trim()
  11508. }
  11509. // if ANY of the sets match ALL of its comparators, then pass
  11510. Range.prototype.test = function (version) {
  11511. if (!version) {
  11512. return false
  11513. }
  11514. if (typeof version === 'string') {
  11515. try {
  11516. version = new SemVer(version, this.options)
  11517. } catch (er) {
  11518. return false
  11519. }
  11520. }
  11521. for (var i = 0; i < this.set.length; i++) {
  11522. if (testSet(this.set[i], version, this.options)) {
  11523. return true
  11524. }
  11525. }
  11526. return false
  11527. }
  11528. function testSet (set, version, options) {
  11529. for (var i = 0; i < set.length; i++) {
  11530. if (!set[i].test(version)) {
  11531. return false
  11532. }
  11533. }
  11534. if (version.prerelease.length && !options.includePrerelease) {
  11535. // Find the set of versions that are allowed to have prereleases
  11536. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11537. // That should allow `1.2.3-pr.2` to pass.
  11538. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11539. // even though it's within the range set by the comparators.
  11540. for (i = 0; i < set.length; i++) {
  11541. debug(set[i].semver)
  11542. if (set[i].semver === ANY) {
  11543. continue
  11544. }
  11545. if (set[i].semver.prerelease.length > 0) {
  11546. var allowed = set[i].semver
  11547. if (allowed.major === version.major &&
  11548. allowed.minor === version.minor &&
  11549. allowed.patch === version.patch) {
  11550. return true
  11551. }
  11552. }
  11553. }
  11554. // Version has a -pre, but it's not one of the ones we like.
  11555. return false
  11556. }
  11557. return true
  11558. }
  11559. exports.satisfies = satisfies
  11560. function satisfies (version, range, options) {
  11561. try {
  11562. range = new Range(range, options)
  11563. } catch (er) {
  11564. return false
  11565. }
  11566. return range.test(version)
  11567. }
  11568. exports.maxSatisfying = maxSatisfying
  11569. function maxSatisfying (versions, range, options) {
  11570. var max = null
  11571. var maxSV = null
  11572. try {
  11573. var rangeObj = new Range(range, options)
  11574. } catch (er) {
  11575. return null
  11576. }
  11577. versions.forEach(function (v) {
  11578. if (rangeObj.test(v)) {
  11579. // satisfies(v, range, options)
  11580. if (!max || maxSV.compare(v) === -1) {
  11581. // compare(max, v, true)
  11582. max = v
  11583. maxSV = new SemVer(max, options)
  11584. }
  11585. }
  11586. })
  11587. return max
  11588. }
  11589. exports.minSatisfying = minSatisfying
  11590. function minSatisfying (versions, range, options) {
  11591. var min = null
  11592. var minSV = null
  11593. try {
  11594. var rangeObj = new Range(range, options)
  11595. } catch (er) {
  11596. return null
  11597. }
  11598. versions.forEach(function (v) {
  11599. if (rangeObj.test(v)) {
  11600. // satisfies(v, range, options)
  11601. if (!min || minSV.compare(v) === 1) {
  11602. // compare(min, v, true)
  11603. min = v
  11604. minSV = new SemVer(min, options)
  11605. }
  11606. }
  11607. })
  11608. return min
  11609. }
  11610. exports.minVersion = minVersion
  11611. function minVersion (range, loose) {
  11612. range = new Range(range, loose)
  11613. var minver = new SemVer('0.0.0')
  11614. if (range.test(minver)) {
  11615. return minver
  11616. }
  11617. minver = new SemVer('0.0.0-0')
  11618. if (range.test(minver)) {
  11619. return minver
  11620. }
  11621. minver = null
  11622. for (var i = 0; i < range.set.length; ++i) {
  11623. var comparators = range.set[i]
  11624. comparators.forEach(function (comparator) {
  11625. // Clone to avoid manipulating the comparator's semver object.
  11626. var compver = new SemVer(comparator.semver.version)
  11627. switch (comparator.operator) {
  11628. case '>':
  11629. if (compver.prerelease.length === 0) {
  11630. compver.patch++
  11631. } else {
  11632. compver.prerelease.push(0)
  11633. }
  11634. compver.raw = compver.format()
  11635. /* fallthrough */
  11636. case '':
  11637. case '>=':
  11638. if (!minver || gt(minver, compver)) {
  11639. minver = compver
  11640. }
  11641. break
  11642. case '<':
  11643. case '<=':
  11644. /* Ignore maximum versions */
  11645. break
  11646. /* istanbul ignore next */
  11647. default:
  11648. throw new Error('Unexpected operation: ' + comparator.operator)
  11649. }
  11650. })
  11651. }
  11652. if (minver && range.test(minver)) {
  11653. return minver
  11654. }
  11655. return null
  11656. }
  11657. exports.validRange = validRange
  11658. function validRange (range, options) {
  11659. try {
  11660. // Return '*' instead of '' so that truthiness works.
  11661. // This will throw if it's invalid anyway
  11662. return new Range(range, options).range || '*'
  11663. } catch (er) {
  11664. return null
  11665. }
  11666. }
  11667. // Determine if version is less than all the versions possible in the range
  11668. exports.ltr = ltr
  11669. function ltr (version, range, options) {
  11670. return outside(version, range, '<', options)
  11671. }
  11672. // Determine if version is greater than all the versions possible in the range.
  11673. exports.gtr = gtr
  11674. function gtr (version, range, options) {
  11675. return outside(version, range, '>', options)
  11676. }
  11677. exports.outside = outside
  11678. function outside (version, range, hilo, options) {
  11679. version = new SemVer(version, options)
  11680. range = new Range(range, options)
  11681. var gtfn, ltefn, ltfn, comp, ecomp
  11682. switch (hilo) {
  11683. case '>':
  11684. gtfn = gt
  11685. ltefn = lte
  11686. ltfn = lt
  11687. comp = '>'
  11688. ecomp = '>='
  11689. break
  11690. case '<':
  11691. gtfn = lt
  11692. ltefn = gte
  11693. ltfn = gt
  11694. comp = '<'
  11695. ecomp = '<='
  11696. break
  11697. default:
  11698. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11699. }
  11700. // If it satisifes the range it is not outside
  11701. if (satisfies(version, range, options)) {
  11702. return false
  11703. }
  11704. // From now on, variable terms are as if we're in "gtr" mode.
  11705. // but note that everything is flipped for the "ltr" function.
  11706. for (var i = 0; i < range.set.length; ++i) {
  11707. var comparators = range.set[i]
  11708. var high = null
  11709. var low = null
  11710. comparators.forEach(function (comparator) {
  11711. if (comparator.semver === ANY) {
  11712. comparator = new Comparator('>=0.0.0')
  11713. }
  11714. high = high || comparator
  11715. low = low || comparator
  11716. if (gtfn(comparator.semver, high.semver, options)) {
  11717. high = comparator
  11718. } else if (ltfn(comparator.semver, low.semver, options)) {
  11719. low = comparator
  11720. }
  11721. })
  11722. // If the edge version comparator has a operator then our version
  11723. // isn't outside it
  11724. if (high.operator === comp || high.operator === ecomp) {
  11725. return false
  11726. }
  11727. // If the lowest version comparator has an operator and our version
  11728. // is less than it then it isn't higher than the range
  11729. if ((!low.operator || low.operator === comp) &&
  11730. ltefn(version, low.semver)) {
  11731. return false
  11732. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11733. return false
  11734. }
  11735. }
  11736. return true
  11737. }
  11738. exports.prerelease = prerelease
  11739. function prerelease (version, options) {
  11740. var parsed = parse(version, options)
  11741. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11742. }
  11743. exports.intersects = intersects
  11744. function intersects (r1, r2, options) {
  11745. r1 = new Range(r1, options)
  11746. r2 = new Range(r2, options)
  11747. return r1.intersects(r2)
  11748. }
  11749. exports.coerce = coerce
  11750. function coerce (version, options) {
  11751. if (version instanceof SemVer) {
  11752. return version
  11753. }
  11754. if (typeof version === 'number') {
  11755. version = String(version)
  11756. }
  11757. if (typeof version !== 'string') {
  11758. return null
  11759. }
  11760. options = options || {}
  11761. var match = null
  11762. if (!options.rtl) {
  11763. match = version.match(re[t.COERCE])
  11764. } else {
  11765. // Find the right-most coercible string that does not share
  11766. // a terminus with a more left-ward coercible string.
  11767. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11768. //
  11769. // Walk through the string checking with a /g regexp
  11770. // Manually set the index so as to pick up overlapping matches.
  11771. // Stop when we get a match that ends at the string end, since no
  11772. // coercible string can be more right-ward without the same terminus.
  11773. var next
  11774. while ((next = re[t.COERCERTL].exec(version)) &&
  11775. (!match || match.index + match[0].length !== version.length)
  11776. ) {
  11777. if (!match ||
  11778. next.index + next[0].length !== match.index + match[0].length) {
  11779. match = next
  11780. }
  11781. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11782. }
  11783. // leave it in a clean state
  11784. re[t.COERCERTL].lastIndex = -1
  11785. }
  11786. if (match === null) {
  11787. return null
  11788. }
  11789. return parse(match[2] +
  11790. '.' + (match[3] || '0') +
  11791. '.' + (match[4] || '0'), options)
  11792. }
  11793. /***/ }),
  11794. /***/ 669:
  11795. /***/ (function(module) {
  11796. module.exports = require("util");
  11797. /***/ }),
  11798. /***/ 672:
  11799. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11800. "use strict";
  11801. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11802. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11803. return new (P || (P = Promise))(function (resolve, reject) {
  11804. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11805. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11806. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11807. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11808. });
  11809. };
  11810. var _a;
  11811. Object.defineProperty(exports, "__esModule", { value: true });
  11812. const assert_1 = __webpack_require__(357);
  11813. const fs = __webpack_require__(747);
  11814. const path = __webpack_require__(622);
  11815. _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;
  11816. exports.IS_WINDOWS = process.platform === 'win32';
  11817. function exists(fsPath) {
  11818. return __awaiter(this, void 0, void 0, function* () {
  11819. try {
  11820. yield exports.stat(fsPath);
  11821. }
  11822. catch (err) {
  11823. if (err.code === 'ENOENT') {
  11824. return false;
  11825. }
  11826. throw err;
  11827. }
  11828. return true;
  11829. });
  11830. }
  11831. exports.exists = exists;
  11832. function isDirectory(fsPath, useStat = false) {
  11833. return __awaiter(this, void 0, void 0, function* () {
  11834. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11835. return stats.isDirectory();
  11836. });
  11837. }
  11838. exports.isDirectory = isDirectory;
  11839. /**
  11840. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11841. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11842. */
  11843. function isRooted(p) {
  11844. p = normalizeSeparators(p);
  11845. if (!p) {
  11846. throw new Error('isRooted() parameter "p" cannot be empty');
  11847. }
  11848. if (exports.IS_WINDOWS) {
  11849. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11850. ); // e.g. C: or C:\hello
  11851. }
  11852. return p.startsWith('/');
  11853. }
  11854. exports.isRooted = isRooted;
  11855. /**
  11856. * Recursively create a directory at `fsPath`.
  11857. *
  11858. * This implementation is optimistic, meaning it attempts to create the full
  11859. * path first, and backs up the path stack from there.
  11860. *
  11861. * @param fsPath The path to create
  11862. * @param maxDepth The maximum recursion depth
  11863. * @param depth The current recursion depth
  11864. */
  11865. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11866. return __awaiter(this, void 0, void 0, function* () {
  11867. assert_1.ok(fsPath, 'a path argument must be provided');
  11868. fsPath = path.resolve(fsPath);
  11869. if (depth >= maxDepth)
  11870. return exports.mkdir(fsPath);
  11871. try {
  11872. yield exports.mkdir(fsPath);
  11873. return;
  11874. }
  11875. catch (err) {
  11876. switch (err.code) {
  11877. case 'ENOENT': {
  11878. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11879. yield exports.mkdir(fsPath);
  11880. return;
  11881. }
  11882. default: {
  11883. let stats;
  11884. try {
  11885. stats = yield exports.stat(fsPath);
  11886. }
  11887. catch (err2) {
  11888. throw err;
  11889. }
  11890. if (!stats.isDirectory())
  11891. throw err;
  11892. }
  11893. }
  11894. }
  11895. });
  11896. }
  11897. exports.mkdirP = mkdirP;
  11898. /**
  11899. * Best effort attempt to determine whether a file exists and is executable.
  11900. * @param filePath file path to check
  11901. * @param extensions additional file extensions to try
  11902. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11903. */
  11904. function tryGetExecutablePath(filePath, extensions) {
  11905. return __awaiter(this, void 0, void 0, function* () {
  11906. let stats = undefined;
  11907. try {
  11908. // test file exists
  11909. stats = yield exports.stat(filePath);
  11910. }
  11911. catch (err) {
  11912. if (err.code !== 'ENOENT') {
  11913. // eslint-disable-next-line no-console
  11914. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11915. }
  11916. }
  11917. if (stats && stats.isFile()) {
  11918. if (exports.IS_WINDOWS) {
  11919. // on Windows, test for valid extension
  11920. const upperExt = path.extname(filePath).toUpperCase();
  11921. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11922. return filePath;
  11923. }
  11924. }
  11925. else {
  11926. if (isUnixExecutable(stats)) {
  11927. return filePath;
  11928. }
  11929. }
  11930. }
  11931. // try each extension
  11932. const originalFilePath = filePath;
  11933. for (const extension of extensions) {
  11934. filePath = originalFilePath + extension;
  11935. stats = undefined;
  11936. try {
  11937. stats = yield exports.stat(filePath);
  11938. }
  11939. catch (err) {
  11940. if (err.code !== 'ENOENT') {
  11941. // eslint-disable-next-line no-console
  11942. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11943. }
  11944. }
  11945. if (stats && stats.isFile()) {
  11946. if (exports.IS_WINDOWS) {
  11947. // preserve the case of the actual file (since an extension was appended)
  11948. try {
  11949. const directory = path.dirname(filePath);
  11950. const upperName = path.basename(filePath).toUpperCase();
  11951. for (const actualName of yield exports.readdir(directory)) {
  11952. if (upperName === actualName.toUpperCase()) {
  11953. filePath = path.join(directory, actualName);
  11954. break;
  11955. }
  11956. }
  11957. }
  11958. catch (err) {
  11959. // eslint-disable-next-line no-console
  11960. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11961. }
  11962. return filePath;
  11963. }
  11964. else {
  11965. if (isUnixExecutable(stats)) {
  11966. return filePath;
  11967. }
  11968. }
  11969. }
  11970. }
  11971. return '';
  11972. });
  11973. }
  11974. exports.tryGetExecutablePath = tryGetExecutablePath;
  11975. function normalizeSeparators(p) {
  11976. p = p || '';
  11977. if (exports.IS_WINDOWS) {
  11978. // convert slashes on Windows
  11979. p = p.replace(/\//g, '\\');
  11980. // remove redundant slashes
  11981. return p.replace(/\\\\+/g, '\\');
  11982. }
  11983. // remove redundant slashes
  11984. return p.replace(/\/\/+/g, '/');
  11985. }
  11986. // on Mac/Linux, test the execute bit
  11987. // R W X R W X R W X
  11988. // 256 128 64 32 16 8 4 2 1
  11989. function isUnixExecutable(stats) {
  11990. return ((stats.mode & 1) > 0 ||
  11991. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11992. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11993. }
  11994. //# sourceMappingURL=io-util.js.map
  11995. /***/ }),
  11996. /***/ 674:
  11997. /***/ (function(module, __unusedexports, __webpack_require__) {
  11998. module.exports = authenticate;
  11999. const { Deprecation } = __webpack_require__(692);
  12000. const once = __webpack_require__(969);
  12001. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  12002. function authenticate(state, options) {
  12003. deprecateAuthenticate(
  12004. state.octokit.log,
  12005. new Deprecation(
  12006. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  12007. )
  12008. );
  12009. if (!options) {
  12010. state.auth = false;
  12011. return;
  12012. }
  12013. switch (options.type) {
  12014. case "basic":
  12015. if (!options.username || !options.password) {
  12016. throw new Error(
  12017. "Basic authentication requires both a username and password to be set"
  12018. );
  12019. }
  12020. break;
  12021. case "oauth":
  12022. if (!options.token && !(options.key && options.secret)) {
  12023. throw new Error(
  12024. "OAuth2 authentication requires a token or key & secret to be set"
  12025. );
  12026. }
  12027. break;
  12028. case "token":
  12029. case "app":
  12030. if (!options.token) {
  12031. throw new Error("Token authentication requires a token to be set");
  12032. }
  12033. break;
  12034. default:
  12035. throw new Error(
  12036. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  12037. );
  12038. }
  12039. state.auth = options;
  12040. }
  12041. /***/ }),
  12042. /***/ 675:
  12043. /***/ (function(module) {
  12044. module.exports = function btoa(str) {
  12045. return new Buffer(str).toString('base64')
  12046. }
  12047. /***/ }),
  12048. /***/ 692:
  12049. /***/ (function(__unusedmodule, exports) {
  12050. "use strict";
  12051. Object.defineProperty(exports, '__esModule', { value: true });
  12052. class Deprecation extends Error {
  12053. constructor(message) {
  12054. super(message); // Maintains proper stack trace (only available on V8)
  12055. /* istanbul ignore next */
  12056. if (Error.captureStackTrace) {
  12057. Error.captureStackTrace(this, this.constructor);
  12058. }
  12059. this.name = 'Deprecation';
  12060. }
  12061. }
  12062. exports.Deprecation = Deprecation;
  12063. /***/ }),
  12064. /***/ 696:
  12065. /***/ (function(module) {
  12066. "use strict";
  12067. /*!
  12068. * isobject <https://github.com/jonschlinkert/isobject>
  12069. *
  12070. * Copyright (c) 2014-2017, Jon Schlinkert.
  12071. * Released under the MIT License.
  12072. */
  12073. function isObject(val) {
  12074. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12075. }
  12076. /*!
  12077. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12078. *
  12079. * Copyright (c) 2014-2017, Jon Schlinkert.
  12080. * Released under the MIT License.
  12081. */
  12082. function isObjectObject(o) {
  12083. return isObject(o) === true
  12084. && Object.prototype.toString.call(o) === '[object Object]';
  12085. }
  12086. function isPlainObject(o) {
  12087. var ctor,prot;
  12088. if (isObjectObject(o) === false) return false;
  12089. // If has modified constructor
  12090. ctor = o.constructor;
  12091. if (typeof ctor !== 'function') return false;
  12092. // If has modified prototype
  12093. prot = ctor.prototype;
  12094. if (isObjectObject(prot) === false) return false;
  12095. // If constructor does not have an Object-specific method
  12096. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12097. return false;
  12098. }
  12099. // Most likely a plain Object
  12100. return true;
  12101. }
  12102. module.exports = isPlainObject;
  12103. /***/ }),
  12104. /***/ 697:
  12105. /***/ (function(module) {
  12106. "use strict";
  12107. module.exports = (promise, onFinally) => {
  12108. onFinally = onFinally || (() => {});
  12109. return promise.then(
  12110. val => new Promise(resolve => {
  12111. resolve(onFinally());
  12112. }).then(() => val),
  12113. err => new Promise(resolve => {
  12114. resolve(onFinally());
  12115. }).then(() => {
  12116. throw err;
  12117. })
  12118. );
  12119. };
  12120. /***/ }),
  12121. /***/ 722:
  12122. /***/ (function(module) {
  12123. /**
  12124. * Convert array of 16 byte values to UUID string format of the form:
  12125. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12126. */
  12127. var byteToHex = [];
  12128. for (var i = 0; i < 256; ++i) {
  12129. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12130. }
  12131. function bytesToUuid(buf, offset) {
  12132. var i = offset || 0;
  12133. var bth = byteToHex;
  12134. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12135. return ([bth[buf[i++]], bth[buf[i++]],
  12136. bth[buf[i++]], bth[buf[i++]], '-',
  12137. bth[buf[i++]], bth[buf[i++]], '-',
  12138. bth[buf[i++]], bth[buf[i++]], '-',
  12139. bth[buf[i++]], bth[buf[i++]], '-',
  12140. bth[buf[i++]], bth[buf[i++]],
  12141. bth[buf[i++]], bth[buf[i++]],
  12142. bth[buf[i++]], bth[buf[i++]]]).join('');
  12143. }
  12144. module.exports = bytesToUuid;
  12145. /***/ }),
  12146. /***/ 742:
  12147. /***/ (function(module, __unusedexports, __webpack_require__) {
  12148. var fs = __webpack_require__(747)
  12149. var core
  12150. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12151. core = __webpack_require__(818)
  12152. } else {
  12153. core = __webpack_require__(197)
  12154. }
  12155. module.exports = isexe
  12156. isexe.sync = sync
  12157. function isexe (path, options, cb) {
  12158. if (typeof options === 'function') {
  12159. cb = options
  12160. options = {}
  12161. }
  12162. if (!cb) {
  12163. if (typeof Promise !== 'function') {
  12164. throw new TypeError('callback not provided')
  12165. }
  12166. return new Promise(function (resolve, reject) {
  12167. isexe(path, options || {}, function (er, is) {
  12168. if (er) {
  12169. reject(er)
  12170. } else {
  12171. resolve(is)
  12172. }
  12173. })
  12174. })
  12175. }
  12176. core(path, options || {}, function (er, is) {
  12177. // ignore EACCES because that just means we aren't allowed to run it
  12178. if (er) {
  12179. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12180. er = null
  12181. is = false
  12182. }
  12183. }
  12184. cb(er, is)
  12185. })
  12186. }
  12187. function sync (path, options) {
  12188. // my kingdom for a filtered catch
  12189. try {
  12190. return core.sync(path, options || {})
  12191. } catch (er) {
  12192. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12193. return false
  12194. } else {
  12195. throw er
  12196. }
  12197. }
  12198. }
  12199. /***/ }),
  12200. /***/ 747:
  12201. /***/ (function(module) {
  12202. module.exports = require("fs");
  12203. /***/ }),
  12204. /***/ 753:
  12205. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12206. "use strict";
  12207. Object.defineProperty(exports, '__esModule', { value: true });
  12208. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12209. var endpoint = __webpack_require__(385);
  12210. var universalUserAgent = __webpack_require__(211);
  12211. var isPlainObject = _interopDefault(__webpack_require__(696));
  12212. var nodeFetch = _interopDefault(__webpack_require__(454));
  12213. var requestError = __webpack_require__(463);
  12214. const VERSION = "5.4.2";
  12215. function getBufferResponse(response) {
  12216. return response.arrayBuffer();
  12217. }
  12218. function fetchWrapper(requestOptions) {
  12219. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12220. requestOptions.body = JSON.stringify(requestOptions.body);
  12221. }
  12222. let headers = {};
  12223. let status;
  12224. let url;
  12225. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12226. return fetch(requestOptions.url, Object.assign({
  12227. method: requestOptions.method,
  12228. body: requestOptions.body,
  12229. headers: requestOptions.headers,
  12230. redirect: requestOptions.redirect
  12231. }, requestOptions.request)).then(response => {
  12232. url = response.url;
  12233. status = response.status;
  12234. for (const keyAndValue of response.headers) {
  12235. headers[keyAndValue[0]] = keyAndValue[1];
  12236. }
  12237. if (status === 204 || status === 205) {
  12238. return;
  12239. } // GitHub API returns 200 for HEAD requests
  12240. if (requestOptions.method === "HEAD") {
  12241. if (status < 400) {
  12242. return;
  12243. }
  12244. throw new requestError.RequestError(response.statusText, status, {
  12245. headers,
  12246. request: requestOptions
  12247. });
  12248. }
  12249. if (status === 304) {
  12250. throw new requestError.RequestError("Not modified", status, {
  12251. headers,
  12252. request: requestOptions
  12253. });
  12254. }
  12255. if (status >= 400) {
  12256. return response.text().then(message => {
  12257. const error = new requestError.RequestError(message, status, {
  12258. headers,
  12259. request: requestOptions
  12260. });
  12261. try {
  12262. let responseBody = JSON.parse(error.message);
  12263. Object.assign(error, responseBody);
  12264. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12265. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12266. } catch (e) {// ignore, see octokit/rest.js#684
  12267. }
  12268. throw error;
  12269. });
  12270. }
  12271. const contentType = response.headers.get("content-type");
  12272. if (/application\/json/.test(contentType)) {
  12273. return response.json();
  12274. }
  12275. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12276. return response.text();
  12277. }
  12278. return getBufferResponse(response);
  12279. }).then(data => {
  12280. return {
  12281. status,
  12282. url,
  12283. headers,
  12284. data
  12285. };
  12286. }).catch(error => {
  12287. if (error instanceof requestError.RequestError) {
  12288. throw error;
  12289. }
  12290. throw new requestError.RequestError(error.message, 500, {
  12291. headers,
  12292. request: requestOptions
  12293. });
  12294. });
  12295. }
  12296. function withDefaults(oldEndpoint, newDefaults) {
  12297. const endpoint = oldEndpoint.defaults(newDefaults);
  12298. const newApi = function (route, parameters) {
  12299. const endpointOptions = endpoint.merge(route, parameters);
  12300. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12301. return fetchWrapper(endpoint.parse(endpointOptions));
  12302. }
  12303. const request = (route, parameters) => {
  12304. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12305. };
  12306. Object.assign(request, {
  12307. endpoint,
  12308. defaults: withDefaults.bind(null, endpoint)
  12309. });
  12310. return endpointOptions.request.hook(request, endpointOptions);
  12311. };
  12312. return Object.assign(newApi, {
  12313. endpoint,
  12314. defaults: withDefaults.bind(null, endpoint)
  12315. });
  12316. }
  12317. const request = withDefaults(endpoint.endpoint, {
  12318. headers: {
  12319. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12320. }
  12321. });
  12322. exports.request = request;
  12323. //# sourceMappingURL=index.js.map
  12324. /***/ }),
  12325. /***/ 761:
  12326. /***/ (function(module) {
  12327. module.exports = require("zlib");
  12328. /***/ }),
  12329. /***/ 763:
  12330. /***/ (function(module) {
  12331. module.exports = removeHook
  12332. function removeHook (state, name, method) {
  12333. if (!state.registry[name]) {
  12334. return
  12335. }
  12336. var index = state.registry[name]
  12337. .map(function (registered) { return registered.orig })
  12338. .indexOf(method)
  12339. if (index === -1) {
  12340. return
  12341. }
  12342. state.registry[name].splice(index, 1)
  12343. }
  12344. /***/ }),
  12345. /***/ 768:
  12346. /***/ (function(module) {
  12347. "use strict";
  12348. module.exports = function (x) {
  12349. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12350. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12351. if (x[x.length - 1] === lf) {
  12352. x = x.slice(0, x.length - 1);
  12353. }
  12354. if (x[x.length - 1] === cr) {
  12355. x = x.slice(0, x.length - 1);
  12356. }
  12357. return x;
  12358. };
  12359. /***/ }),
  12360. /***/ 777:
  12361. /***/ (function(module, __unusedexports, __webpack_require__) {
  12362. module.exports = getFirstPage
  12363. const getPage = __webpack_require__(265)
  12364. function getFirstPage (octokit, link, headers) {
  12365. return getPage(octokit, link, 'first', headers)
  12366. }
  12367. /***/ }),
  12368. /***/ 796:
  12369. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12370. "use strict";
  12371. Object.defineProperty(exports, '__esModule', { value: true });
  12372. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12373. var osName = _interopDefault(__webpack_require__(2));
  12374. function getUserAgent() {
  12375. try {
  12376. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12377. } catch (error) {
  12378. if (/wmic os get Caption/.test(error.message)) {
  12379. return "Windows <version undetectable>";
  12380. }
  12381. throw error;
  12382. }
  12383. }
  12384. exports.getUserAgent = getUserAgent;
  12385. //# sourceMappingURL=index.js.map
  12386. /***/ }),
  12387. /***/ 813:
  12388. /***/ (function(__unusedmodule, exports) {
  12389. "use strict";
  12390. Object.defineProperty(exports, '__esModule', { value: true });
  12391. async function auth(token) {
  12392. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12393. return {
  12394. type: "token",
  12395. token: token,
  12396. tokenType
  12397. };
  12398. }
  12399. /**
  12400. * Prefix token for usage in the Authorization header
  12401. *
  12402. * @param token OAuth token or JSON Web Token
  12403. */
  12404. function withAuthorizationPrefix(token) {
  12405. if (token.split(/\./).length === 3) {
  12406. return `bearer ${token}`;
  12407. }
  12408. return `token ${token}`;
  12409. }
  12410. async function hook(token, request, route, parameters) {
  12411. const endpoint = request.endpoint.merge(route, parameters);
  12412. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12413. return request(endpoint);
  12414. }
  12415. const createTokenAuth = function createTokenAuth(token) {
  12416. if (!token) {
  12417. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12418. }
  12419. if (typeof token !== "string") {
  12420. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12421. }
  12422. token = token.replace(/^(token|bearer) +/i, "");
  12423. return Object.assign(auth.bind(null, token), {
  12424. hook: hook.bind(null, token)
  12425. });
  12426. };
  12427. exports.createTokenAuth = createTokenAuth;
  12428. //# sourceMappingURL=index.js.map
  12429. /***/ }),
  12430. /***/ 814:
  12431. /***/ (function(module, __unusedexports, __webpack_require__) {
  12432. module.exports = which
  12433. which.sync = whichSync
  12434. var isWindows = process.platform === 'win32' ||
  12435. process.env.OSTYPE === 'cygwin' ||
  12436. process.env.OSTYPE === 'msys'
  12437. var path = __webpack_require__(622)
  12438. var COLON = isWindows ? ';' : ':'
  12439. var isexe = __webpack_require__(742)
  12440. function getNotFoundError (cmd) {
  12441. var er = new Error('not found: ' + cmd)
  12442. er.code = 'ENOENT'
  12443. return er
  12444. }
  12445. function getPathInfo (cmd, opt) {
  12446. var colon = opt.colon || COLON
  12447. var pathEnv = opt.path || process.env.PATH || ''
  12448. var pathExt = ['']
  12449. pathEnv = pathEnv.split(colon)
  12450. var pathExtExe = ''
  12451. if (isWindows) {
  12452. pathEnv.unshift(process.cwd())
  12453. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12454. pathExt = pathExtExe.split(colon)
  12455. // Always test the cmd itself first. isexe will check to make sure
  12456. // it's found in the pathExt set.
  12457. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12458. pathExt.unshift('')
  12459. }
  12460. // If it has a slash, then we don't bother searching the pathenv.
  12461. // just check the file itself, and that's it.
  12462. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12463. pathEnv = ['']
  12464. return {
  12465. env: pathEnv,
  12466. ext: pathExt,
  12467. extExe: pathExtExe
  12468. }
  12469. }
  12470. function which (cmd, opt, cb) {
  12471. if (typeof opt === 'function') {
  12472. cb = opt
  12473. opt = {}
  12474. }
  12475. var info = getPathInfo(cmd, opt)
  12476. var pathEnv = info.env
  12477. var pathExt = info.ext
  12478. var pathExtExe = info.extExe
  12479. var found = []
  12480. ;(function F (i, l) {
  12481. if (i === l) {
  12482. if (opt.all && found.length)
  12483. return cb(null, found)
  12484. else
  12485. return cb(getNotFoundError(cmd))
  12486. }
  12487. var pathPart = pathEnv[i]
  12488. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12489. pathPart = pathPart.slice(1, -1)
  12490. var p = path.join(pathPart, cmd)
  12491. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12492. p = cmd.slice(0, 2) + p
  12493. }
  12494. ;(function E (ii, ll) {
  12495. if (ii === ll) return F(i + 1, l)
  12496. var ext = pathExt[ii]
  12497. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12498. if (!er && is) {
  12499. if (opt.all)
  12500. found.push(p + ext)
  12501. else
  12502. return cb(null, p + ext)
  12503. }
  12504. return E(ii + 1, ll)
  12505. })
  12506. })(0, pathExt.length)
  12507. })(0, pathEnv.length)
  12508. }
  12509. function whichSync (cmd, opt) {
  12510. opt = opt || {}
  12511. var info = getPathInfo(cmd, opt)
  12512. var pathEnv = info.env
  12513. var pathExt = info.ext
  12514. var pathExtExe = info.extExe
  12515. var found = []
  12516. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12517. var pathPart = pathEnv[i]
  12518. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12519. pathPart = pathPart.slice(1, -1)
  12520. var p = path.join(pathPart, cmd)
  12521. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12522. p = cmd.slice(0, 2) + p
  12523. }
  12524. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12525. var cur = p + pathExt[j]
  12526. var is
  12527. try {
  12528. is = isexe.sync(cur, { pathExt: pathExtExe })
  12529. if (is) {
  12530. if (opt.all)
  12531. found.push(cur)
  12532. else
  12533. return cur
  12534. }
  12535. } catch (ex) {}
  12536. }
  12537. }
  12538. if (opt.all && found.length)
  12539. return found
  12540. if (opt.nothrow)
  12541. return null
  12542. throw getNotFoundError(cmd)
  12543. }
  12544. /***/ }),
  12545. /***/ 816:
  12546. /***/ (function(module) {
  12547. "use strict";
  12548. module.exports = /^#!.*/;
  12549. /***/ }),
  12550. /***/ 818:
  12551. /***/ (function(module, __unusedexports, __webpack_require__) {
  12552. module.exports = isexe
  12553. isexe.sync = sync
  12554. var fs = __webpack_require__(747)
  12555. function checkPathExt (path, options) {
  12556. var pathext = options.pathExt !== undefined ?
  12557. options.pathExt : process.env.PATHEXT
  12558. if (!pathext) {
  12559. return true
  12560. }
  12561. pathext = pathext.split(';')
  12562. if (pathext.indexOf('') !== -1) {
  12563. return true
  12564. }
  12565. for (var i = 0; i < pathext.length; i++) {
  12566. var p = pathext[i].toLowerCase()
  12567. if (p && path.substr(-p.length).toLowerCase() === p) {
  12568. return true
  12569. }
  12570. }
  12571. return false
  12572. }
  12573. function checkStat (stat, path, options) {
  12574. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12575. return false
  12576. }
  12577. return checkPathExt(path, options)
  12578. }
  12579. function isexe (path, options, cb) {
  12580. fs.stat(path, function (er, stat) {
  12581. cb(er, er ? false : checkStat(stat, path, options))
  12582. })
  12583. }
  12584. function sync (path, options) {
  12585. return checkStat(fs.statSync(path), path, options)
  12586. }
  12587. /***/ }),
  12588. /***/ 821:
  12589. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12590. "use strict";
  12591. var __importStar = (this && this.__importStar) || function (mod) {
  12592. if (mod && mod.__esModule) return mod;
  12593. var result = {};
  12594. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12595. result["default"] = mod;
  12596. return result;
  12597. };
  12598. Object.defineProperty(exports, "__esModule", { value: true });
  12599. const core = __importStar(__webpack_require__(470));
  12600. const fsHelper = __importStar(__webpack_require__(618));
  12601. const github = __importStar(__webpack_require__(469));
  12602. const path = __importStar(__webpack_require__(622));
  12603. function getInputs() {
  12604. const result = {};
  12605. // GitHub workspace
  12606. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12607. if (!githubWorkspacePath) {
  12608. throw new Error('GITHUB_WORKSPACE not defined');
  12609. }
  12610. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12611. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12612. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12613. // Qualified repository
  12614. const qualifiedRepository = core.getInput('repository') ||
  12615. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12616. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12617. const splitRepository = qualifiedRepository.split('/');
  12618. if (splitRepository.length !== 2 ||
  12619. !splitRepository[0] ||
  12620. !splitRepository[1]) {
  12621. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12622. }
  12623. result.repositoryOwner = splitRepository[0];
  12624. result.repositoryName = splitRepository[1];
  12625. // Repository path
  12626. result.repositoryPath = core.getInput('path') || '.';
  12627. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12628. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12629. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12630. }
  12631. // Workflow repository?
  12632. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12633. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12634. // Source branch, source version
  12635. result.ref = core.getInput('ref');
  12636. if (!result.ref) {
  12637. if (isWorkflowRepository) {
  12638. result.ref = github.context.ref;
  12639. result.commit = github.context.sha;
  12640. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12641. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12642. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12643. result.ref = `refs/heads/${result.ref}`;
  12644. }
  12645. }
  12646. }
  12647. // SHA?
  12648. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12649. result.commit = result.ref;
  12650. result.ref = '';
  12651. }
  12652. core.debug(`ref = '${result.ref}'`);
  12653. core.debug(`commit = '${result.commit}'`);
  12654. // Clean
  12655. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12656. core.debug(`clean = ${result.clean}`);
  12657. // Fetch depth
  12658. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12659. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12660. result.fetchDepth = 0;
  12661. }
  12662. core.debug(`fetch depth = ${result.fetchDepth}`);
  12663. // LFS
  12664. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12665. core.debug(`lfs = ${result.lfs}`);
  12666. // Submodules
  12667. result.submodules = false;
  12668. result.nestedSubmodules = false;
  12669. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12670. if (submodulesString == 'RECURSIVE') {
  12671. result.submodules = true;
  12672. result.nestedSubmodules = true;
  12673. }
  12674. else if (submodulesString == 'TRUE') {
  12675. result.submodules = true;
  12676. }
  12677. core.debug(`submodules = ${result.submodules}`);
  12678. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12679. // Auth token
  12680. result.authToken = core.getInput('token', { required: true });
  12681. // SSH
  12682. result.sshKey = core.getInput('ssh-key');
  12683. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12684. result.sshStrict =
  12685. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12686. // Persist credentials
  12687. result.persistCredentials =
  12688. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12689. return result;
  12690. }
  12691. exports.getInputs = getInputs;
  12692. /***/ }),
  12693. /***/ 826:
  12694. /***/ (function(module, __unusedexports, __webpack_require__) {
  12695. var rng = __webpack_require__(139);
  12696. var bytesToUuid = __webpack_require__(722);
  12697. function v4(options, buf, offset) {
  12698. var i = buf && offset || 0;
  12699. if (typeof(options) == 'string') {
  12700. buf = options === 'binary' ? new Array(16) : null;
  12701. options = null;
  12702. }
  12703. options = options || {};
  12704. var rnds = options.random || (options.rng || rng)();
  12705. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12706. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12707. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12708. // Copy bytes to buffer, if provided
  12709. if (buf) {
  12710. for (var ii = 0; ii < 16; ++ii) {
  12711. buf[i + ii] = rnds[ii];
  12712. }
  12713. }
  12714. return buf || bytesToUuid(rnds);
  12715. }
  12716. module.exports = v4;
  12717. /***/ }),
  12718. /***/ 835:
  12719. /***/ (function(module) {
  12720. module.exports = require("url");
  12721. /***/ }),
  12722. /***/ 842:
  12723. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12724. "use strict";
  12725. Object.defineProperty(exports, '__esModule', { value: true });
  12726. var deprecation = __webpack_require__(692);
  12727. var endpointsByScope = {
  12728. actions: {
  12729. cancelWorkflowRun: {
  12730. method: "POST",
  12731. params: {
  12732. owner: {
  12733. required: true,
  12734. type: "string"
  12735. },
  12736. repo: {
  12737. required: true,
  12738. type: "string"
  12739. },
  12740. run_id: {
  12741. required: true,
  12742. type: "integer"
  12743. }
  12744. },
  12745. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  12746. },
  12747. createOrUpdateSecretForRepo: {
  12748. method: "PUT",
  12749. params: {
  12750. encrypted_value: {
  12751. type: "string"
  12752. },
  12753. key_id: {
  12754. type: "string"
  12755. },
  12756. name: {
  12757. required: true,
  12758. type: "string"
  12759. },
  12760. owner: {
  12761. required: true,
  12762. type: "string"
  12763. },
  12764. repo: {
  12765. required: true,
  12766. type: "string"
  12767. }
  12768. },
  12769. url: "/repos/:owner/:repo/actions/secrets/:name"
  12770. },
  12771. createRegistrationToken: {
  12772. method: "POST",
  12773. params: {
  12774. owner: {
  12775. required: true,
  12776. type: "string"
  12777. },
  12778. repo: {
  12779. required: true,
  12780. type: "string"
  12781. }
  12782. },
  12783. url: "/repos/:owner/:repo/actions/runners/registration-token"
  12784. },
  12785. createRemoveToken: {
  12786. method: "POST",
  12787. params: {
  12788. owner: {
  12789. required: true,
  12790. type: "string"
  12791. },
  12792. repo: {
  12793. required: true,
  12794. type: "string"
  12795. }
  12796. },
  12797. url: "/repos/:owner/:repo/actions/runners/remove-token"
  12798. },
  12799. deleteArtifact: {
  12800. method: "DELETE",
  12801. params: {
  12802. artifact_id: {
  12803. required: true,
  12804. type: "integer"
  12805. },
  12806. owner: {
  12807. required: true,
  12808. type: "string"
  12809. },
  12810. repo: {
  12811. required: true,
  12812. type: "string"
  12813. }
  12814. },
  12815. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12816. },
  12817. deleteSecretFromRepo: {
  12818. method: "DELETE",
  12819. params: {
  12820. name: {
  12821. required: true,
  12822. type: "string"
  12823. },
  12824. owner: {
  12825. required: true,
  12826. type: "string"
  12827. },
  12828. repo: {
  12829. required: true,
  12830. type: "string"
  12831. }
  12832. },
  12833. url: "/repos/:owner/:repo/actions/secrets/:name"
  12834. },
  12835. downloadArtifact: {
  12836. method: "GET",
  12837. params: {
  12838. archive_format: {
  12839. required: true,
  12840. type: "string"
  12841. },
  12842. artifact_id: {
  12843. required: true,
  12844. type: "integer"
  12845. },
  12846. owner: {
  12847. required: true,
  12848. type: "string"
  12849. },
  12850. repo: {
  12851. required: true,
  12852. type: "string"
  12853. }
  12854. },
  12855. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  12856. },
  12857. getArtifact: {
  12858. method: "GET",
  12859. params: {
  12860. artifact_id: {
  12861. required: true,
  12862. type: "integer"
  12863. },
  12864. owner: {
  12865. required: true,
  12866. type: "string"
  12867. },
  12868. repo: {
  12869. required: true,
  12870. type: "string"
  12871. }
  12872. },
  12873. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  12874. },
  12875. getPublicKey: {
  12876. method: "GET",
  12877. params: {
  12878. owner: {
  12879. required: true,
  12880. type: "string"
  12881. },
  12882. repo: {
  12883. required: true,
  12884. type: "string"
  12885. }
  12886. },
  12887. url: "/repos/:owner/:repo/actions/secrets/public-key"
  12888. },
  12889. getSecret: {
  12890. method: "GET",
  12891. params: {
  12892. name: {
  12893. required: true,
  12894. type: "string"
  12895. },
  12896. owner: {
  12897. required: true,
  12898. type: "string"
  12899. },
  12900. page: {
  12901. type: "integer"
  12902. },
  12903. per_page: {
  12904. type: "integer"
  12905. },
  12906. repo: {
  12907. required: true,
  12908. type: "string"
  12909. }
  12910. },
  12911. url: "/repos/:owner/:repo/actions/secrets/:name"
  12912. },
  12913. getSelfHostedRunner: {
  12914. method: "GET",
  12915. params: {
  12916. owner: {
  12917. required: true,
  12918. type: "string"
  12919. },
  12920. repo: {
  12921. required: true,
  12922. type: "string"
  12923. },
  12924. runner_id: {
  12925. required: true,
  12926. type: "integer"
  12927. }
  12928. },
  12929. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  12930. },
  12931. getWorkflow: {
  12932. method: "GET",
  12933. params: {
  12934. owner: {
  12935. required: true,
  12936. type: "string"
  12937. },
  12938. repo: {
  12939. required: true,
  12940. type: "string"
  12941. },
  12942. workflow_id: {
  12943. required: true,
  12944. type: "integer"
  12945. }
  12946. },
  12947. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  12948. },
  12949. getWorkflowJob: {
  12950. method: "GET",
  12951. params: {
  12952. job_id: {
  12953. required: true,
  12954. type: "integer"
  12955. },
  12956. owner: {
  12957. required: true,
  12958. type: "string"
  12959. },
  12960. repo: {
  12961. required: true,
  12962. type: "string"
  12963. }
  12964. },
  12965. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  12966. },
  12967. getWorkflowRun: {
  12968. method: "GET",
  12969. params: {
  12970. owner: {
  12971. required: true,
  12972. type: "string"
  12973. },
  12974. repo: {
  12975. required: true,
  12976. type: "string"
  12977. },
  12978. run_id: {
  12979. required: true,
  12980. type: "integer"
  12981. }
  12982. },
  12983. url: "/repos/:owner/:repo/actions/runs/:run_id"
  12984. },
  12985. listDownloadsForSelfHostedRunnerApplication: {
  12986. method: "GET",
  12987. params: {
  12988. owner: {
  12989. required: true,
  12990. type: "string"
  12991. },
  12992. repo: {
  12993. required: true,
  12994. type: "string"
  12995. }
  12996. },
  12997. url: "/repos/:owner/:repo/actions/runners/downloads"
  12998. },
  12999. listJobsForWorkflowRun: {
  13000. method: "GET",
  13001. params: {
  13002. owner: {
  13003. required: true,
  13004. type: "string"
  13005. },
  13006. page: {
  13007. type: "integer"
  13008. },
  13009. per_page: {
  13010. type: "integer"
  13011. },
  13012. repo: {
  13013. required: true,
  13014. type: "string"
  13015. },
  13016. run_id: {
  13017. required: true,
  13018. type: "integer"
  13019. }
  13020. },
  13021. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  13022. },
  13023. listRepoWorkflowRuns: {
  13024. method: "GET",
  13025. params: {
  13026. actor: {
  13027. type: "string"
  13028. },
  13029. branch: {
  13030. type: "string"
  13031. },
  13032. event: {
  13033. type: "string"
  13034. },
  13035. owner: {
  13036. required: true,
  13037. type: "string"
  13038. },
  13039. page: {
  13040. type: "integer"
  13041. },
  13042. per_page: {
  13043. type: "integer"
  13044. },
  13045. repo: {
  13046. required: true,
  13047. type: "string"
  13048. },
  13049. status: {
  13050. enum: ["completed", "status", "conclusion"],
  13051. type: "string"
  13052. }
  13053. },
  13054. url: "/repos/:owner/:repo/actions/runs"
  13055. },
  13056. listRepoWorkflows: {
  13057. method: "GET",
  13058. params: {
  13059. owner: {
  13060. required: true,
  13061. type: "string"
  13062. },
  13063. page: {
  13064. type: "integer"
  13065. },
  13066. per_page: {
  13067. type: "integer"
  13068. },
  13069. repo: {
  13070. required: true,
  13071. type: "string"
  13072. }
  13073. },
  13074. url: "/repos/:owner/:repo/actions/workflows"
  13075. },
  13076. listSecretsForRepo: {
  13077. method: "GET",
  13078. params: {
  13079. owner: {
  13080. required: true,
  13081. type: "string"
  13082. },
  13083. page: {
  13084. type: "integer"
  13085. },
  13086. per_page: {
  13087. type: "integer"
  13088. },
  13089. repo: {
  13090. required: true,
  13091. type: "string"
  13092. }
  13093. },
  13094. url: "/repos/:owner/:repo/actions/secrets"
  13095. },
  13096. listSelfHostedRunnersForRepo: {
  13097. method: "GET",
  13098. params: {
  13099. owner: {
  13100. required: true,
  13101. type: "string"
  13102. },
  13103. page: {
  13104. type: "integer"
  13105. },
  13106. per_page: {
  13107. type: "integer"
  13108. },
  13109. repo: {
  13110. required: true,
  13111. type: "string"
  13112. }
  13113. },
  13114. url: "/repos/:owner/:repo/actions/runners"
  13115. },
  13116. listWorkflowJobLogs: {
  13117. method: "GET",
  13118. params: {
  13119. job_id: {
  13120. required: true,
  13121. type: "integer"
  13122. },
  13123. owner: {
  13124. required: true,
  13125. type: "string"
  13126. },
  13127. page: {
  13128. type: "integer"
  13129. },
  13130. per_page: {
  13131. type: "integer"
  13132. },
  13133. repo: {
  13134. required: true,
  13135. type: "string"
  13136. }
  13137. },
  13138. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13139. },
  13140. listWorkflowRunArtifacts: {
  13141. method: "GET",
  13142. params: {
  13143. owner: {
  13144. required: true,
  13145. type: "string"
  13146. },
  13147. page: {
  13148. type: "integer"
  13149. },
  13150. per_page: {
  13151. type: "integer"
  13152. },
  13153. repo: {
  13154. required: true,
  13155. type: "string"
  13156. },
  13157. run_id: {
  13158. required: true,
  13159. type: "integer"
  13160. }
  13161. },
  13162. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13163. },
  13164. listWorkflowRunLogs: {
  13165. method: "GET",
  13166. params: {
  13167. owner: {
  13168. required: true,
  13169. type: "string"
  13170. },
  13171. page: {
  13172. type: "integer"
  13173. },
  13174. per_page: {
  13175. type: "integer"
  13176. },
  13177. repo: {
  13178. required: true,
  13179. type: "string"
  13180. },
  13181. run_id: {
  13182. required: true,
  13183. type: "integer"
  13184. }
  13185. },
  13186. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13187. },
  13188. listWorkflowRuns: {
  13189. method: "GET",
  13190. params: {
  13191. actor: {
  13192. type: "string"
  13193. },
  13194. branch: {
  13195. type: "string"
  13196. },
  13197. event: {
  13198. type: "string"
  13199. },
  13200. owner: {
  13201. required: true,
  13202. type: "string"
  13203. },
  13204. page: {
  13205. type: "integer"
  13206. },
  13207. per_page: {
  13208. type: "integer"
  13209. },
  13210. repo: {
  13211. required: true,
  13212. type: "string"
  13213. },
  13214. status: {
  13215. enum: ["completed", "status", "conclusion"],
  13216. type: "string"
  13217. },
  13218. workflow_id: {
  13219. required: true,
  13220. type: "integer"
  13221. }
  13222. },
  13223. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13224. },
  13225. reRunWorkflow: {
  13226. method: "POST",
  13227. params: {
  13228. owner: {
  13229. required: true,
  13230. type: "string"
  13231. },
  13232. repo: {
  13233. required: true,
  13234. type: "string"
  13235. },
  13236. run_id: {
  13237. required: true,
  13238. type: "integer"
  13239. }
  13240. },
  13241. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13242. },
  13243. removeSelfHostedRunner: {
  13244. method: "DELETE",
  13245. params: {
  13246. owner: {
  13247. required: true,
  13248. type: "string"
  13249. },
  13250. repo: {
  13251. required: true,
  13252. type: "string"
  13253. },
  13254. runner_id: {
  13255. required: true,
  13256. type: "integer"
  13257. }
  13258. },
  13259. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13260. }
  13261. },
  13262. activity: {
  13263. checkStarringRepo: {
  13264. method: "GET",
  13265. params: {
  13266. owner: {
  13267. required: true,
  13268. type: "string"
  13269. },
  13270. repo: {
  13271. required: true,
  13272. type: "string"
  13273. }
  13274. },
  13275. url: "/user/starred/:owner/:repo"
  13276. },
  13277. deleteRepoSubscription: {
  13278. method: "DELETE",
  13279. params: {
  13280. owner: {
  13281. required: true,
  13282. type: "string"
  13283. },
  13284. repo: {
  13285. required: true,
  13286. type: "string"
  13287. }
  13288. },
  13289. url: "/repos/:owner/:repo/subscription"
  13290. },
  13291. deleteThreadSubscription: {
  13292. method: "DELETE",
  13293. params: {
  13294. thread_id: {
  13295. required: true,
  13296. type: "integer"
  13297. }
  13298. },
  13299. url: "/notifications/threads/:thread_id/subscription"
  13300. },
  13301. getRepoSubscription: {
  13302. method: "GET",
  13303. params: {
  13304. owner: {
  13305. required: true,
  13306. type: "string"
  13307. },
  13308. repo: {
  13309. required: true,
  13310. type: "string"
  13311. }
  13312. },
  13313. url: "/repos/:owner/:repo/subscription"
  13314. },
  13315. getThread: {
  13316. method: "GET",
  13317. params: {
  13318. thread_id: {
  13319. required: true,
  13320. type: "integer"
  13321. }
  13322. },
  13323. url: "/notifications/threads/:thread_id"
  13324. },
  13325. getThreadSubscription: {
  13326. method: "GET",
  13327. params: {
  13328. thread_id: {
  13329. required: true,
  13330. type: "integer"
  13331. }
  13332. },
  13333. url: "/notifications/threads/:thread_id/subscription"
  13334. },
  13335. listEventsForOrg: {
  13336. method: "GET",
  13337. params: {
  13338. org: {
  13339. required: true,
  13340. type: "string"
  13341. },
  13342. page: {
  13343. type: "integer"
  13344. },
  13345. per_page: {
  13346. type: "integer"
  13347. },
  13348. username: {
  13349. required: true,
  13350. type: "string"
  13351. }
  13352. },
  13353. url: "/users/:username/events/orgs/:org"
  13354. },
  13355. listEventsForUser: {
  13356. method: "GET",
  13357. params: {
  13358. page: {
  13359. type: "integer"
  13360. },
  13361. per_page: {
  13362. type: "integer"
  13363. },
  13364. username: {
  13365. required: true,
  13366. type: "string"
  13367. }
  13368. },
  13369. url: "/users/:username/events"
  13370. },
  13371. listFeeds: {
  13372. method: "GET",
  13373. params: {},
  13374. url: "/feeds"
  13375. },
  13376. listNotifications: {
  13377. method: "GET",
  13378. params: {
  13379. all: {
  13380. type: "boolean"
  13381. },
  13382. before: {
  13383. type: "string"
  13384. },
  13385. page: {
  13386. type: "integer"
  13387. },
  13388. participating: {
  13389. type: "boolean"
  13390. },
  13391. per_page: {
  13392. type: "integer"
  13393. },
  13394. since: {
  13395. type: "string"
  13396. }
  13397. },
  13398. url: "/notifications"
  13399. },
  13400. listNotificationsForRepo: {
  13401. method: "GET",
  13402. params: {
  13403. all: {
  13404. type: "boolean"
  13405. },
  13406. before: {
  13407. type: "string"
  13408. },
  13409. owner: {
  13410. required: true,
  13411. type: "string"
  13412. },
  13413. page: {
  13414. type: "integer"
  13415. },
  13416. participating: {
  13417. type: "boolean"
  13418. },
  13419. per_page: {
  13420. type: "integer"
  13421. },
  13422. repo: {
  13423. required: true,
  13424. type: "string"
  13425. },
  13426. since: {
  13427. type: "string"
  13428. }
  13429. },
  13430. url: "/repos/:owner/:repo/notifications"
  13431. },
  13432. listPublicEvents: {
  13433. method: "GET",
  13434. params: {
  13435. page: {
  13436. type: "integer"
  13437. },
  13438. per_page: {
  13439. type: "integer"
  13440. }
  13441. },
  13442. url: "/events"
  13443. },
  13444. listPublicEventsForOrg: {
  13445. method: "GET",
  13446. params: {
  13447. org: {
  13448. required: true,
  13449. type: "string"
  13450. },
  13451. page: {
  13452. type: "integer"
  13453. },
  13454. per_page: {
  13455. type: "integer"
  13456. }
  13457. },
  13458. url: "/orgs/:org/events"
  13459. },
  13460. listPublicEventsForRepoNetwork: {
  13461. method: "GET",
  13462. params: {
  13463. owner: {
  13464. required: true,
  13465. type: "string"
  13466. },
  13467. page: {
  13468. type: "integer"
  13469. },
  13470. per_page: {
  13471. type: "integer"
  13472. },
  13473. repo: {
  13474. required: true,
  13475. type: "string"
  13476. }
  13477. },
  13478. url: "/networks/:owner/:repo/events"
  13479. },
  13480. listPublicEventsForUser: {
  13481. method: "GET",
  13482. params: {
  13483. page: {
  13484. type: "integer"
  13485. },
  13486. per_page: {
  13487. type: "integer"
  13488. },
  13489. username: {
  13490. required: true,
  13491. type: "string"
  13492. }
  13493. },
  13494. url: "/users/:username/events/public"
  13495. },
  13496. listReceivedEventsForUser: {
  13497. method: "GET",
  13498. params: {
  13499. page: {
  13500. type: "integer"
  13501. },
  13502. per_page: {
  13503. type: "integer"
  13504. },
  13505. username: {
  13506. required: true,
  13507. type: "string"
  13508. }
  13509. },
  13510. url: "/users/:username/received_events"
  13511. },
  13512. listReceivedPublicEventsForUser: {
  13513. method: "GET",
  13514. params: {
  13515. page: {
  13516. type: "integer"
  13517. },
  13518. per_page: {
  13519. type: "integer"
  13520. },
  13521. username: {
  13522. required: true,
  13523. type: "string"
  13524. }
  13525. },
  13526. url: "/users/:username/received_events/public"
  13527. },
  13528. listRepoEvents: {
  13529. method: "GET",
  13530. params: {
  13531. owner: {
  13532. required: true,
  13533. type: "string"
  13534. },
  13535. page: {
  13536. type: "integer"
  13537. },
  13538. per_page: {
  13539. type: "integer"
  13540. },
  13541. repo: {
  13542. required: true,
  13543. type: "string"
  13544. }
  13545. },
  13546. url: "/repos/:owner/:repo/events"
  13547. },
  13548. listReposStarredByAuthenticatedUser: {
  13549. method: "GET",
  13550. params: {
  13551. direction: {
  13552. enum: ["asc", "desc"],
  13553. type: "string"
  13554. },
  13555. page: {
  13556. type: "integer"
  13557. },
  13558. per_page: {
  13559. type: "integer"
  13560. },
  13561. sort: {
  13562. enum: ["created", "updated"],
  13563. type: "string"
  13564. }
  13565. },
  13566. url: "/user/starred"
  13567. },
  13568. listReposStarredByUser: {
  13569. method: "GET",
  13570. params: {
  13571. direction: {
  13572. enum: ["asc", "desc"],
  13573. type: "string"
  13574. },
  13575. page: {
  13576. type: "integer"
  13577. },
  13578. per_page: {
  13579. type: "integer"
  13580. },
  13581. sort: {
  13582. enum: ["created", "updated"],
  13583. type: "string"
  13584. },
  13585. username: {
  13586. required: true,
  13587. type: "string"
  13588. }
  13589. },
  13590. url: "/users/:username/starred"
  13591. },
  13592. listReposWatchedByUser: {
  13593. method: "GET",
  13594. params: {
  13595. page: {
  13596. type: "integer"
  13597. },
  13598. per_page: {
  13599. type: "integer"
  13600. },
  13601. username: {
  13602. required: true,
  13603. type: "string"
  13604. }
  13605. },
  13606. url: "/users/:username/subscriptions"
  13607. },
  13608. listStargazersForRepo: {
  13609. method: "GET",
  13610. params: {
  13611. owner: {
  13612. required: true,
  13613. type: "string"
  13614. },
  13615. page: {
  13616. type: "integer"
  13617. },
  13618. per_page: {
  13619. type: "integer"
  13620. },
  13621. repo: {
  13622. required: true,
  13623. type: "string"
  13624. }
  13625. },
  13626. url: "/repos/:owner/:repo/stargazers"
  13627. },
  13628. listWatchedReposForAuthenticatedUser: {
  13629. method: "GET",
  13630. params: {
  13631. page: {
  13632. type: "integer"
  13633. },
  13634. per_page: {
  13635. type: "integer"
  13636. }
  13637. },
  13638. url: "/user/subscriptions"
  13639. },
  13640. listWatchersForRepo: {
  13641. method: "GET",
  13642. params: {
  13643. owner: {
  13644. required: true,
  13645. type: "string"
  13646. },
  13647. page: {
  13648. type: "integer"
  13649. },
  13650. per_page: {
  13651. type: "integer"
  13652. },
  13653. repo: {
  13654. required: true,
  13655. type: "string"
  13656. }
  13657. },
  13658. url: "/repos/:owner/:repo/subscribers"
  13659. },
  13660. markAsRead: {
  13661. method: "PUT",
  13662. params: {
  13663. last_read_at: {
  13664. type: "string"
  13665. }
  13666. },
  13667. url: "/notifications"
  13668. },
  13669. markNotificationsAsReadForRepo: {
  13670. method: "PUT",
  13671. params: {
  13672. last_read_at: {
  13673. type: "string"
  13674. },
  13675. owner: {
  13676. required: true,
  13677. type: "string"
  13678. },
  13679. repo: {
  13680. required: true,
  13681. type: "string"
  13682. }
  13683. },
  13684. url: "/repos/:owner/:repo/notifications"
  13685. },
  13686. markThreadAsRead: {
  13687. method: "PATCH",
  13688. params: {
  13689. thread_id: {
  13690. required: true,
  13691. type: "integer"
  13692. }
  13693. },
  13694. url: "/notifications/threads/:thread_id"
  13695. },
  13696. setRepoSubscription: {
  13697. method: "PUT",
  13698. params: {
  13699. ignored: {
  13700. type: "boolean"
  13701. },
  13702. owner: {
  13703. required: true,
  13704. type: "string"
  13705. },
  13706. repo: {
  13707. required: true,
  13708. type: "string"
  13709. },
  13710. subscribed: {
  13711. type: "boolean"
  13712. }
  13713. },
  13714. url: "/repos/:owner/:repo/subscription"
  13715. },
  13716. setThreadSubscription: {
  13717. method: "PUT",
  13718. params: {
  13719. ignored: {
  13720. type: "boolean"
  13721. },
  13722. thread_id: {
  13723. required: true,
  13724. type: "integer"
  13725. }
  13726. },
  13727. url: "/notifications/threads/:thread_id/subscription"
  13728. },
  13729. starRepo: {
  13730. method: "PUT",
  13731. params: {
  13732. owner: {
  13733. required: true,
  13734. type: "string"
  13735. },
  13736. repo: {
  13737. required: true,
  13738. type: "string"
  13739. }
  13740. },
  13741. url: "/user/starred/:owner/:repo"
  13742. },
  13743. unstarRepo: {
  13744. method: "DELETE",
  13745. params: {
  13746. owner: {
  13747. required: true,
  13748. type: "string"
  13749. },
  13750. repo: {
  13751. required: true,
  13752. type: "string"
  13753. }
  13754. },
  13755. url: "/user/starred/:owner/:repo"
  13756. }
  13757. },
  13758. apps: {
  13759. addRepoToInstallation: {
  13760. headers: {
  13761. accept: "application/vnd.github.machine-man-preview+json"
  13762. },
  13763. method: "PUT",
  13764. params: {
  13765. installation_id: {
  13766. required: true,
  13767. type: "integer"
  13768. },
  13769. repository_id: {
  13770. required: true,
  13771. type: "integer"
  13772. }
  13773. },
  13774. url: "/user/installations/:installation_id/repositories/:repository_id"
  13775. },
  13776. checkAccountIsAssociatedWithAny: {
  13777. method: "GET",
  13778. params: {
  13779. account_id: {
  13780. required: true,
  13781. type: "integer"
  13782. }
  13783. },
  13784. url: "/marketplace_listing/accounts/:account_id"
  13785. },
  13786. checkAccountIsAssociatedWithAnyStubbed: {
  13787. method: "GET",
  13788. params: {
  13789. account_id: {
  13790. required: true,
  13791. type: "integer"
  13792. }
  13793. },
  13794. url: "/marketplace_listing/stubbed/accounts/:account_id"
  13795. },
  13796. checkAuthorization: {
  13797. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  13798. method: "GET",
  13799. params: {
  13800. access_token: {
  13801. required: true,
  13802. type: "string"
  13803. },
  13804. client_id: {
  13805. required: true,
  13806. type: "string"
  13807. }
  13808. },
  13809. url: "/applications/:client_id/tokens/:access_token"
  13810. },
  13811. checkToken: {
  13812. headers: {
  13813. accept: "application/vnd.github.doctor-strange-preview+json"
  13814. },
  13815. method: "POST",
  13816. params: {
  13817. access_token: {
  13818. type: "string"
  13819. },
  13820. client_id: {
  13821. required: true,
  13822. type: "string"
  13823. }
  13824. },
  13825. url: "/applications/:client_id/token"
  13826. },
  13827. createContentAttachment: {
  13828. headers: {
  13829. accept: "application/vnd.github.corsair-preview+json"
  13830. },
  13831. method: "POST",
  13832. params: {
  13833. body: {
  13834. required: true,
  13835. type: "string"
  13836. },
  13837. content_reference_id: {
  13838. required: true,
  13839. type: "integer"
  13840. },
  13841. title: {
  13842. required: true,
  13843. type: "string"
  13844. }
  13845. },
  13846. url: "/content_references/:content_reference_id/attachments"
  13847. },
  13848. createFromManifest: {
  13849. headers: {
  13850. accept: "application/vnd.github.fury-preview+json"
  13851. },
  13852. method: "POST",
  13853. params: {
  13854. code: {
  13855. required: true,
  13856. type: "string"
  13857. }
  13858. },
  13859. url: "/app-manifests/:code/conversions"
  13860. },
  13861. createInstallationToken: {
  13862. headers: {
  13863. accept: "application/vnd.github.machine-man-preview+json"
  13864. },
  13865. method: "POST",
  13866. params: {
  13867. installation_id: {
  13868. required: true,
  13869. type: "integer"
  13870. },
  13871. permissions: {
  13872. type: "object"
  13873. },
  13874. repository_ids: {
  13875. type: "integer[]"
  13876. }
  13877. },
  13878. url: "/app/installations/:installation_id/access_tokens"
  13879. },
  13880. deleteAuthorization: {
  13881. headers: {
  13882. accept: "application/vnd.github.doctor-strange-preview+json"
  13883. },
  13884. method: "DELETE",
  13885. params: {
  13886. access_token: {
  13887. type: "string"
  13888. },
  13889. client_id: {
  13890. required: true,
  13891. type: "string"
  13892. }
  13893. },
  13894. url: "/applications/:client_id/grant"
  13895. },
  13896. deleteInstallation: {
  13897. headers: {
  13898. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  13899. },
  13900. method: "DELETE",
  13901. params: {
  13902. installation_id: {
  13903. required: true,
  13904. type: "integer"
  13905. }
  13906. },
  13907. url: "/app/installations/:installation_id"
  13908. },
  13909. deleteToken: {
  13910. headers: {
  13911. accept: "application/vnd.github.doctor-strange-preview+json"
  13912. },
  13913. method: "DELETE",
  13914. params: {
  13915. access_token: {
  13916. type: "string"
  13917. },
  13918. client_id: {
  13919. required: true,
  13920. type: "string"
  13921. }
  13922. },
  13923. url: "/applications/:client_id/token"
  13924. },
  13925. findOrgInstallation: {
  13926. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  13927. headers: {
  13928. accept: "application/vnd.github.machine-man-preview+json"
  13929. },
  13930. method: "GET",
  13931. params: {
  13932. org: {
  13933. required: true,
  13934. type: "string"
  13935. }
  13936. },
  13937. url: "/orgs/:org/installation"
  13938. },
  13939. findRepoInstallation: {
  13940. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  13941. headers: {
  13942. accept: "application/vnd.github.machine-man-preview+json"
  13943. },
  13944. method: "GET",
  13945. params: {
  13946. owner: {
  13947. required: true,
  13948. type: "string"
  13949. },
  13950. repo: {
  13951. required: true,
  13952. type: "string"
  13953. }
  13954. },
  13955. url: "/repos/:owner/:repo/installation"
  13956. },
  13957. findUserInstallation: {
  13958. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  13959. headers: {
  13960. accept: "application/vnd.github.machine-man-preview+json"
  13961. },
  13962. method: "GET",
  13963. params: {
  13964. username: {
  13965. required: true,
  13966. type: "string"
  13967. }
  13968. },
  13969. url: "/users/:username/installation"
  13970. },
  13971. getAuthenticated: {
  13972. headers: {
  13973. accept: "application/vnd.github.machine-man-preview+json"
  13974. },
  13975. method: "GET",
  13976. params: {},
  13977. url: "/app"
  13978. },
  13979. getBySlug: {
  13980. headers: {
  13981. accept: "application/vnd.github.machine-man-preview+json"
  13982. },
  13983. method: "GET",
  13984. params: {
  13985. app_slug: {
  13986. required: true,
  13987. type: "string"
  13988. }
  13989. },
  13990. url: "/apps/:app_slug"
  13991. },
  13992. getInstallation: {
  13993. headers: {
  13994. accept: "application/vnd.github.machine-man-preview+json"
  13995. },
  13996. method: "GET",
  13997. params: {
  13998. installation_id: {
  13999. required: true,
  14000. type: "integer"
  14001. }
  14002. },
  14003. url: "/app/installations/:installation_id"
  14004. },
  14005. getOrgInstallation: {
  14006. headers: {
  14007. accept: "application/vnd.github.machine-man-preview+json"
  14008. },
  14009. method: "GET",
  14010. params: {
  14011. org: {
  14012. required: true,
  14013. type: "string"
  14014. }
  14015. },
  14016. url: "/orgs/:org/installation"
  14017. },
  14018. getRepoInstallation: {
  14019. headers: {
  14020. accept: "application/vnd.github.machine-man-preview+json"
  14021. },
  14022. method: "GET",
  14023. params: {
  14024. owner: {
  14025. required: true,
  14026. type: "string"
  14027. },
  14028. repo: {
  14029. required: true,
  14030. type: "string"
  14031. }
  14032. },
  14033. url: "/repos/:owner/:repo/installation"
  14034. },
  14035. getUserInstallation: {
  14036. headers: {
  14037. accept: "application/vnd.github.machine-man-preview+json"
  14038. },
  14039. method: "GET",
  14040. params: {
  14041. username: {
  14042. required: true,
  14043. type: "string"
  14044. }
  14045. },
  14046. url: "/users/:username/installation"
  14047. },
  14048. listAccountsUserOrOrgOnPlan: {
  14049. method: "GET",
  14050. params: {
  14051. direction: {
  14052. enum: ["asc", "desc"],
  14053. type: "string"
  14054. },
  14055. page: {
  14056. type: "integer"
  14057. },
  14058. per_page: {
  14059. type: "integer"
  14060. },
  14061. plan_id: {
  14062. required: true,
  14063. type: "integer"
  14064. },
  14065. sort: {
  14066. enum: ["created", "updated"],
  14067. type: "string"
  14068. }
  14069. },
  14070. url: "/marketplace_listing/plans/:plan_id/accounts"
  14071. },
  14072. listAccountsUserOrOrgOnPlanStubbed: {
  14073. method: "GET",
  14074. params: {
  14075. direction: {
  14076. enum: ["asc", "desc"],
  14077. type: "string"
  14078. },
  14079. page: {
  14080. type: "integer"
  14081. },
  14082. per_page: {
  14083. type: "integer"
  14084. },
  14085. plan_id: {
  14086. required: true,
  14087. type: "integer"
  14088. },
  14089. sort: {
  14090. enum: ["created", "updated"],
  14091. type: "string"
  14092. }
  14093. },
  14094. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14095. },
  14096. listInstallationReposForAuthenticatedUser: {
  14097. headers: {
  14098. accept: "application/vnd.github.machine-man-preview+json"
  14099. },
  14100. method: "GET",
  14101. params: {
  14102. installation_id: {
  14103. required: true,
  14104. type: "integer"
  14105. },
  14106. page: {
  14107. type: "integer"
  14108. },
  14109. per_page: {
  14110. type: "integer"
  14111. }
  14112. },
  14113. url: "/user/installations/:installation_id/repositories"
  14114. },
  14115. listInstallations: {
  14116. headers: {
  14117. accept: "application/vnd.github.machine-man-preview+json"
  14118. },
  14119. method: "GET",
  14120. params: {
  14121. page: {
  14122. type: "integer"
  14123. },
  14124. per_page: {
  14125. type: "integer"
  14126. }
  14127. },
  14128. url: "/app/installations"
  14129. },
  14130. listInstallationsForAuthenticatedUser: {
  14131. headers: {
  14132. accept: "application/vnd.github.machine-man-preview+json"
  14133. },
  14134. method: "GET",
  14135. params: {
  14136. page: {
  14137. type: "integer"
  14138. },
  14139. per_page: {
  14140. type: "integer"
  14141. }
  14142. },
  14143. url: "/user/installations"
  14144. },
  14145. listMarketplacePurchasesForAuthenticatedUser: {
  14146. method: "GET",
  14147. params: {
  14148. page: {
  14149. type: "integer"
  14150. },
  14151. per_page: {
  14152. type: "integer"
  14153. }
  14154. },
  14155. url: "/user/marketplace_purchases"
  14156. },
  14157. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14158. method: "GET",
  14159. params: {
  14160. page: {
  14161. type: "integer"
  14162. },
  14163. per_page: {
  14164. type: "integer"
  14165. }
  14166. },
  14167. url: "/user/marketplace_purchases/stubbed"
  14168. },
  14169. listPlans: {
  14170. method: "GET",
  14171. params: {
  14172. page: {
  14173. type: "integer"
  14174. },
  14175. per_page: {
  14176. type: "integer"
  14177. }
  14178. },
  14179. url: "/marketplace_listing/plans"
  14180. },
  14181. listPlansStubbed: {
  14182. method: "GET",
  14183. params: {
  14184. page: {
  14185. type: "integer"
  14186. },
  14187. per_page: {
  14188. type: "integer"
  14189. }
  14190. },
  14191. url: "/marketplace_listing/stubbed/plans"
  14192. },
  14193. listRepos: {
  14194. headers: {
  14195. accept: "application/vnd.github.machine-man-preview+json"
  14196. },
  14197. method: "GET",
  14198. params: {
  14199. page: {
  14200. type: "integer"
  14201. },
  14202. per_page: {
  14203. type: "integer"
  14204. }
  14205. },
  14206. url: "/installation/repositories"
  14207. },
  14208. removeRepoFromInstallation: {
  14209. headers: {
  14210. accept: "application/vnd.github.machine-man-preview+json"
  14211. },
  14212. method: "DELETE",
  14213. params: {
  14214. installation_id: {
  14215. required: true,
  14216. type: "integer"
  14217. },
  14218. repository_id: {
  14219. required: true,
  14220. type: "integer"
  14221. }
  14222. },
  14223. url: "/user/installations/:installation_id/repositories/:repository_id"
  14224. },
  14225. resetAuthorization: {
  14226. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14227. method: "POST",
  14228. params: {
  14229. access_token: {
  14230. required: true,
  14231. type: "string"
  14232. },
  14233. client_id: {
  14234. required: true,
  14235. type: "string"
  14236. }
  14237. },
  14238. url: "/applications/:client_id/tokens/:access_token"
  14239. },
  14240. resetToken: {
  14241. headers: {
  14242. accept: "application/vnd.github.doctor-strange-preview+json"
  14243. },
  14244. method: "PATCH",
  14245. params: {
  14246. access_token: {
  14247. type: "string"
  14248. },
  14249. client_id: {
  14250. required: true,
  14251. type: "string"
  14252. }
  14253. },
  14254. url: "/applications/:client_id/token"
  14255. },
  14256. revokeAuthorizationForApplication: {
  14257. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14258. method: "DELETE",
  14259. params: {
  14260. access_token: {
  14261. required: true,
  14262. type: "string"
  14263. },
  14264. client_id: {
  14265. required: true,
  14266. type: "string"
  14267. }
  14268. },
  14269. url: "/applications/:client_id/tokens/:access_token"
  14270. },
  14271. revokeGrantForApplication: {
  14272. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14273. method: "DELETE",
  14274. params: {
  14275. access_token: {
  14276. required: true,
  14277. type: "string"
  14278. },
  14279. client_id: {
  14280. required: true,
  14281. type: "string"
  14282. }
  14283. },
  14284. url: "/applications/:client_id/grants/:access_token"
  14285. },
  14286. revokeInstallationToken: {
  14287. headers: {
  14288. accept: "application/vnd.github.gambit-preview+json"
  14289. },
  14290. method: "DELETE",
  14291. params: {},
  14292. url: "/installation/token"
  14293. }
  14294. },
  14295. checks: {
  14296. create: {
  14297. headers: {
  14298. accept: "application/vnd.github.antiope-preview+json"
  14299. },
  14300. method: "POST",
  14301. params: {
  14302. actions: {
  14303. type: "object[]"
  14304. },
  14305. "actions[].description": {
  14306. required: true,
  14307. type: "string"
  14308. },
  14309. "actions[].identifier": {
  14310. required: true,
  14311. type: "string"
  14312. },
  14313. "actions[].label": {
  14314. required: true,
  14315. type: "string"
  14316. },
  14317. completed_at: {
  14318. type: "string"
  14319. },
  14320. conclusion: {
  14321. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14322. type: "string"
  14323. },
  14324. details_url: {
  14325. type: "string"
  14326. },
  14327. external_id: {
  14328. type: "string"
  14329. },
  14330. head_sha: {
  14331. required: true,
  14332. type: "string"
  14333. },
  14334. name: {
  14335. required: true,
  14336. type: "string"
  14337. },
  14338. output: {
  14339. type: "object"
  14340. },
  14341. "output.annotations": {
  14342. type: "object[]"
  14343. },
  14344. "output.annotations[].annotation_level": {
  14345. enum: ["notice", "warning", "failure"],
  14346. required: true,
  14347. type: "string"
  14348. },
  14349. "output.annotations[].end_column": {
  14350. type: "integer"
  14351. },
  14352. "output.annotations[].end_line": {
  14353. required: true,
  14354. type: "integer"
  14355. },
  14356. "output.annotations[].message": {
  14357. required: true,
  14358. type: "string"
  14359. },
  14360. "output.annotations[].path": {
  14361. required: true,
  14362. type: "string"
  14363. },
  14364. "output.annotations[].raw_details": {
  14365. type: "string"
  14366. },
  14367. "output.annotations[].start_column": {
  14368. type: "integer"
  14369. },
  14370. "output.annotations[].start_line": {
  14371. required: true,
  14372. type: "integer"
  14373. },
  14374. "output.annotations[].title": {
  14375. type: "string"
  14376. },
  14377. "output.images": {
  14378. type: "object[]"
  14379. },
  14380. "output.images[].alt": {
  14381. required: true,
  14382. type: "string"
  14383. },
  14384. "output.images[].caption": {
  14385. type: "string"
  14386. },
  14387. "output.images[].image_url": {
  14388. required: true,
  14389. type: "string"
  14390. },
  14391. "output.summary": {
  14392. required: true,
  14393. type: "string"
  14394. },
  14395. "output.text": {
  14396. type: "string"
  14397. },
  14398. "output.title": {
  14399. required: true,
  14400. type: "string"
  14401. },
  14402. owner: {
  14403. required: true,
  14404. type: "string"
  14405. },
  14406. repo: {
  14407. required: true,
  14408. type: "string"
  14409. },
  14410. started_at: {
  14411. type: "string"
  14412. },
  14413. status: {
  14414. enum: ["queued", "in_progress", "completed"],
  14415. type: "string"
  14416. }
  14417. },
  14418. url: "/repos/:owner/:repo/check-runs"
  14419. },
  14420. createSuite: {
  14421. headers: {
  14422. accept: "application/vnd.github.antiope-preview+json"
  14423. },
  14424. method: "POST",
  14425. params: {
  14426. head_sha: {
  14427. required: true,
  14428. type: "string"
  14429. },
  14430. owner: {
  14431. required: true,
  14432. type: "string"
  14433. },
  14434. repo: {
  14435. required: true,
  14436. type: "string"
  14437. }
  14438. },
  14439. url: "/repos/:owner/:repo/check-suites"
  14440. },
  14441. get: {
  14442. headers: {
  14443. accept: "application/vnd.github.antiope-preview+json"
  14444. },
  14445. method: "GET",
  14446. params: {
  14447. check_run_id: {
  14448. required: true,
  14449. type: "integer"
  14450. },
  14451. owner: {
  14452. required: true,
  14453. type: "string"
  14454. },
  14455. repo: {
  14456. required: true,
  14457. type: "string"
  14458. }
  14459. },
  14460. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14461. },
  14462. getSuite: {
  14463. headers: {
  14464. accept: "application/vnd.github.antiope-preview+json"
  14465. },
  14466. method: "GET",
  14467. params: {
  14468. check_suite_id: {
  14469. required: true,
  14470. type: "integer"
  14471. },
  14472. owner: {
  14473. required: true,
  14474. type: "string"
  14475. },
  14476. repo: {
  14477. required: true,
  14478. type: "string"
  14479. }
  14480. },
  14481. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14482. },
  14483. listAnnotations: {
  14484. headers: {
  14485. accept: "application/vnd.github.antiope-preview+json"
  14486. },
  14487. method: "GET",
  14488. params: {
  14489. check_run_id: {
  14490. required: true,
  14491. type: "integer"
  14492. },
  14493. owner: {
  14494. required: true,
  14495. type: "string"
  14496. },
  14497. page: {
  14498. type: "integer"
  14499. },
  14500. per_page: {
  14501. type: "integer"
  14502. },
  14503. repo: {
  14504. required: true,
  14505. type: "string"
  14506. }
  14507. },
  14508. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14509. },
  14510. listForRef: {
  14511. headers: {
  14512. accept: "application/vnd.github.antiope-preview+json"
  14513. },
  14514. method: "GET",
  14515. params: {
  14516. check_name: {
  14517. type: "string"
  14518. },
  14519. filter: {
  14520. enum: ["latest", "all"],
  14521. type: "string"
  14522. },
  14523. owner: {
  14524. required: true,
  14525. type: "string"
  14526. },
  14527. page: {
  14528. type: "integer"
  14529. },
  14530. per_page: {
  14531. type: "integer"
  14532. },
  14533. ref: {
  14534. required: true,
  14535. type: "string"
  14536. },
  14537. repo: {
  14538. required: true,
  14539. type: "string"
  14540. },
  14541. status: {
  14542. enum: ["queued", "in_progress", "completed"],
  14543. type: "string"
  14544. }
  14545. },
  14546. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14547. },
  14548. listForSuite: {
  14549. headers: {
  14550. accept: "application/vnd.github.antiope-preview+json"
  14551. },
  14552. method: "GET",
  14553. params: {
  14554. check_name: {
  14555. type: "string"
  14556. },
  14557. check_suite_id: {
  14558. required: true,
  14559. type: "integer"
  14560. },
  14561. filter: {
  14562. enum: ["latest", "all"],
  14563. type: "string"
  14564. },
  14565. owner: {
  14566. required: true,
  14567. type: "string"
  14568. },
  14569. page: {
  14570. type: "integer"
  14571. },
  14572. per_page: {
  14573. type: "integer"
  14574. },
  14575. repo: {
  14576. required: true,
  14577. type: "string"
  14578. },
  14579. status: {
  14580. enum: ["queued", "in_progress", "completed"],
  14581. type: "string"
  14582. }
  14583. },
  14584. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14585. },
  14586. listSuitesForRef: {
  14587. headers: {
  14588. accept: "application/vnd.github.antiope-preview+json"
  14589. },
  14590. method: "GET",
  14591. params: {
  14592. app_id: {
  14593. type: "integer"
  14594. },
  14595. check_name: {
  14596. type: "string"
  14597. },
  14598. owner: {
  14599. required: true,
  14600. type: "string"
  14601. },
  14602. page: {
  14603. type: "integer"
  14604. },
  14605. per_page: {
  14606. type: "integer"
  14607. },
  14608. ref: {
  14609. required: true,
  14610. type: "string"
  14611. },
  14612. repo: {
  14613. required: true,
  14614. type: "string"
  14615. }
  14616. },
  14617. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14618. },
  14619. rerequestSuite: {
  14620. headers: {
  14621. accept: "application/vnd.github.antiope-preview+json"
  14622. },
  14623. method: "POST",
  14624. params: {
  14625. check_suite_id: {
  14626. required: true,
  14627. type: "integer"
  14628. },
  14629. owner: {
  14630. required: true,
  14631. type: "string"
  14632. },
  14633. repo: {
  14634. required: true,
  14635. type: "string"
  14636. }
  14637. },
  14638. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14639. },
  14640. setSuitesPreferences: {
  14641. headers: {
  14642. accept: "application/vnd.github.antiope-preview+json"
  14643. },
  14644. method: "PATCH",
  14645. params: {
  14646. auto_trigger_checks: {
  14647. type: "object[]"
  14648. },
  14649. "auto_trigger_checks[].app_id": {
  14650. required: true,
  14651. type: "integer"
  14652. },
  14653. "auto_trigger_checks[].setting": {
  14654. required: true,
  14655. type: "boolean"
  14656. },
  14657. owner: {
  14658. required: true,
  14659. type: "string"
  14660. },
  14661. repo: {
  14662. required: true,
  14663. type: "string"
  14664. }
  14665. },
  14666. url: "/repos/:owner/:repo/check-suites/preferences"
  14667. },
  14668. update: {
  14669. headers: {
  14670. accept: "application/vnd.github.antiope-preview+json"
  14671. },
  14672. method: "PATCH",
  14673. params: {
  14674. actions: {
  14675. type: "object[]"
  14676. },
  14677. "actions[].description": {
  14678. required: true,
  14679. type: "string"
  14680. },
  14681. "actions[].identifier": {
  14682. required: true,
  14683. type: "string"
  14684. },
  14685. "actions[].label": {
  14686. required: true,
  14687. type: "string"
  14688. },
  14689. check_run_id: {
  14690. required: true,
  14691. type: "integer"
  14692. },
  14693. completed_at: {
  14694. type: "string"
  14695. },
  14696. conclusion: {
  14697. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14698. type: "string"
  14699. },
  14700. details_url: {
  14701. type: "string"
  14702. },
  14703. external_id: {
  14704. type: "string"
  14705. },
  14706. name: {
  14707. type: "string"
  14708. },
  14709. output: {
  14710. type: "object"
  14711. },
  14712. "output.annotations": {
  14713. type: "object[]"
  14714. },
  14715. "output.annotations[].annotation_level": {
  14716. enum: ["notice", "warning", "failure"],
  14717. required: true,
  14718. type: "string"
  14719. },
  14720. "output.annotations[].end_column": {
  14721. type: "integer"
  14722. },
  14723. "output.annotations[].end_line": {
  14724. required: true,
  14725. type: "integer"
  14726. },
  14727. "output.annotations[].message": {
  14728. required: true,
  14729. type: "string"
  14730. },
  14731. "output.annotations[].path": {
  14732. required: true,
  14733. type: "string"
  14734. },
  14735. "output.annotations[].raw_details": {
  14736. type: "string"
  14737. },
  14738. "output.annotations[].start_column": {
  14739. type: "integer"
  14740. },
  14741. "output.annotations[].start_line": {
  14742. required: true,
  14743. type: "integer"
  14744. },
  14745. "output.annotations[].title": {
  14746. type: "string"
  14747. },
  14748. "output.images": {
  14749. type: "object[]"
  14750. },
  14751. "output.images[].alt": {
  14752. required: true,
  14753. type: "string"
  14754. },
  14755. "output.images[].caption": {
  14756. type: "string"
  14757. },
  14758. "output.images[].image_url": {
  14759. required: true,
  14760. type: "string"
  14761. },
  14762. "output.summary": {
  14763. required: true,
  14764. type: "string"
  14765. },
  14766. "output.text": {
  14767. type: "string"
  14768. },
  14769. "output.title": {
  14770. type: "string"
  14771. },
  14772. owner: {
  14773. required: true,
  14774. type: "string"
  14775. },
  14776. repo: {
  14777. required: true,
  14778. type: "string"
  14779. },
  14780. started_at: {
  14781. type: "string"
  14782. },
  14783. status: {
  14784. enum: ["queued", "in_progress", "completed"],
  14785. type: "string"
  14786. }
  14787. },
  14788. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14789. }
  14790. },
  14791. codesOfConduct: {
  14792. getConductCode: {
  14793. headers: {
  14794. accept: "application/vnd.github.scarlet-witch-preview+json"
  14795. },
  14796. method: "GET",
  14797. params: {
  14798. key: {
  14799. required: true,
  14800. type: "string"
  14801. }
  14802. },
  14803. url: "/codes_of_conduct/:key"
  14804. },
  14805. getForRepo: {
  14806. headers: {
  14807. accept: "application/vnd.github.scarlet-witch-preview+json"
  14808. },
  14809. method: "GET",
  14810. params: {
  14811. owner: {
  14812. required: true,
  14813. type: "string"
  14814. },
  14815. repo: {
  14816. required: true,
  14817. type: "string"
  14818. }
  14819. },
  14820. url: "/repos/:owner/:repo/community/code_of_conduct"
  14821. },
  14822. listConductCodes: {
  14823. headers: {
  14824. accept: "application/vnd.github.scarlet-witch-preview+json"
  14825. },
  14826. method: "GET",
  14827. params: {},
  14828. url: "/codes_of_conduct"
  14829. }
  14830. },
  14831. emojis: {
  14832. get: {
  14833. method: "GET",
  14834. params: {},
  14835. url: "/emojis"
  14836. }
  14837. },
  14838. gists: {
  14839. checkIsStarred: {
  14840. method: "GET",
  14841. params: {
  14842. gist_id: {
  14843. required: true,
  14844. type: "string"
  14845. }
  14846. },
  14847. url: "/gists/:gist_id/star"
  14848. },
  14849. create: {
  14850. method: "POST",
  14851. params: {
  14852. description: {
  14853. type: "string"
  14854. },
  14855. files: {
  14856. required: true,
  14857. type: "object"
  14858. },
  14859. "files.content": {
  14860. type: "string"
  14861. },
  14862. public: {
  14863. type: "boolean"
  14864. }
  14865. },
  14866. url: "/gists"
  14867. },
  14868. createComment: {
  14869. method: "POST",
  14870. params: {
  14871. body: {
  14872. required: true,
  14873. type: "string"
  14874. },
  14875. gist_id: {
  14876. required: true,
  14877. type: "string"
  14878. }
  14879. },
  14880. url: "/gists/:gist_id/comments"
  14881. },
  14882. delete: {
  14883. method: "DELETE",
  14884. params: {
  14885. gist_id: {
  14886. required: true,
  14887. type: "string"
  14888. }
  14889. },
  14890. url: "/gists/:gist_id"
  14891. },
  14892. deleteComment: {
  14893. method: "DELETE",
  14894. params: {
  14895. comment_id: {
  14896. required: true,
  14897. type: "integer"
  14898. },
  14899. gist_id: {
  14900. required: true,
  14901. type: "string"
  14902. }
  14903. },
  14904. url: "/gists/:gist_id/comments/:comment_id"
  14905. },
  14906. fork: {
  14907. method: "POST",
  14908. params: {
  14909. gist_id: {
  14910. required: true,
  14911. type: "string"
  14912. }
  14913. },
  14914. url: "/gists/:gist_id/forks"
  14915. },
  14916. get: {
  14917. method: "GET",
  14918. params: {
  14919. gist_id: {
  14920. required: true,
  14921. type: "string"
  14922. }
  14923. },
  14924. url: "/gists/:gist_id"
  14925. },
  14926. getComment: {
  14927. method: "GET",
  14928. params: {
  14929. comment_id: {
  14930. required: true,
  14931. type: "integer"
  14932. },
  14933. gist_id: {
  14934. required: true,
  14935. type: "string"
  14936. }
  14937. },
  14938. url: "/gists/:gist_id/comments/:comment_id"
  14939. },
  14940. getRevision: {
  14941. method: "GET",
  14942. params: {
  14943. gist_id: {
  14944. required: true,
  14945. type: "string"
  14946. },
  14947. sha: {
  14948. required: true,
  14949. type: "string"
  14950. }
  14951. },
  14952. url: "/gists/:gist_id/:sha"
  14953. },
  14954. list: {
  14955. method: "GET",
  14956. params: {
  14957. page: {
  14958. type: "integer"
  14959. },
  14960. per_page: {
  14961. type: "integer"
  14962. },
  14963. since: {
  14964. type: "string"
  14965. }
  14966. },
  14967. url: "/gists"
  14968. },
  14969. listComments: {
  14970. method: "GET",
  14971. params: {
  14972. gist_id: {
  14973. required: true,
  14974. type: "string"
  14975. },
  14976. page: {
  14977. type: "integer"
  14978. },
  14979. per_page: {
  14980. type: "integer"
  14981. }
  14982. },
  14983. url: "/gists/:gist_id/comments"
  14984. },
  14985. listCommits: {
  14986. method: "GET",
  14987. params: {
  14988. gist_id: {
  14989. required: true,
  14990. type: "string"
  14991. },
  14992. page: {
  14993. type: "integer"
  14994. },
  14995. per_page: {
  14996. type: "integer"
  14997. }
  14998. },
  14999. url: "/gists/:gist_id/commits"
  15000. },
  15001. listForks: {
  15002. method: "GET",
  15003. params: {
  15004. gist_id: {
  15005. required: true,
  15006. type: "string"
  15007. },
  15008. page: {
  15009. type: "integer"
  15010. },
  15011. per_page: {
  15012. type: "integer"
  15013. }
  15014. },
  15015. url: "/gists/:gist_id/forks"
  15016. },
  15017. listPublic: {
  15018. method: "GET",
  15019. params: {
  15020. page: {
  15021. type: "integer"
  15022. },
  15023. per_page: {
  15024. type: "integer"
  15025. },
  15026. since: {
  15027. type: "string"
  15028. }
  15029. },
  15030. url: "/gists/public"
  15031. },
  15032. listPublicForUser: {
  15033. method: "GET",
  15034. params: {
  15035. page: {
  15036. type: "integer"
  15037. },
  15038. per_page: {
  15039. type: "integer"
  15040. },
  15041. since: {
  15042. type: "string"
  15043. },
  15044. username: {
  15045. required: true,
  15046. type: "string"
  15047. }
  15048. },
  15049. url: "/users/:username/gists"
  15050. },
  15051. listStarred: {
  15052. method: "GET",
  15053. params: {
  15054. page: {
  15055. type: "integer"
  15056. },
  15057. per_page: {
  15058. type: "integer"
  15059. },
  15060. since: {
  15061. type: "string"
  15062. }
  15063. },
  15064. url: "/gists/starred"
  15065. },
  15066. star: {
  15067. method: "PUT",
  15068. params: {
  15069. gist_id: {
  15070. required: true,
  15071. type: "string"
  15072. }
  15073. },
  15074. url: "/gists/:gist_id/star"
  15075. },
  15076. unstar: {
  15077. method: "DELETE",
  15078. params: {
  15079. gist_id: {
  15080. required: true,
  15081. type: "string"
  15082. }
  15083. },
  15084. url: "/gists/:gist_id/star"
  15085. },
  15086. update: {
  15087. method: "PATCH",
  15088. params: {
  15089. description: {
  15090. type: "string"
  15091. },
  15092. files: {
  15093. type: "object"
  15094. },
  15095. "files.content": {
  15096. type: "string"
  15097. },
  15098. "files.filename": {
  15099. type: "string"
  15100. },
  15101. gist_id: {
  15102. required: true,
  15103. type: "string"
  15104. }
  15105. },
  15106. url: "/gists/:gist_id"
  15107. },
  15108. updateComment: {
  15109. method: "PATCH",
  15110. params: {
  15111. body: {
  15112. required: true,
  15113. type: "string"
  15114. },
  15115. comment_id: {
  15116. required: true,
  15117. type: "integer"
  15118. },
  15119. gist_id: {
  15120. required: true,
  15121. type: "string"
  15122. }
  15123. },
  15124. url: "/gists/:gist_id/comments/:comment_id"
  15125. }
  15126. },
  15127. git: {
  15128. createBlob: {
  15129. method: "POST",
  15130. params: {
  15131. content: {
  15132. required: true,
  15133. type: "string"
  15134. },
  15135. encoding: {
  15136. type: "string"
  15137. },
  15138. owner: {
  15139. required: true,
  15140. type: "string"
  15141. },
  15142. repo: {
  15143. required: true,
  15144. type: "string"
  15145. }
  15146. },
  15147. url: "/repos/:owner/:repo/git/blobs"
  15148. },
  15149. createCommit: {
  15150. method: "POST",
  15151. params: {
  15152. author: {
  15153. type: "object"
  15154. },
  15155. "author.date": {
  15156. type: "string"
  15157. },
  15158. "author.email": {
  15159. type: "string"
  15160. },
  15161. "author.name": {
  15162. type: "string"
  15163. },
  15164. committer: {
  15165. type: "object"
  15166. },
  15167. "committer.date": {
  15168. type: "string"
  15169. },
  15170. "committer.email": {
  15171. type: "string"
  15172. },
  15173. "committer.name": {
  15174. type: "string"
  15175. },
  15176. message: {
  15177. required: true,
  15178. type: "string"
  15179. },
  15180. owner: {
  15181. required: true,
  15182. type: "string"
  15183. },
  15184. parents: {
  15185. required: true,
  15186. type: "string[]"
  15187. },
  15188. repo: {
  15189. required: true,
  15190. type: "string"
  15191. },
  15192. signature: {
  15193. type: "string"
  15194. },
  15195. tree: {
  15196. required: true,
  15197. type: "string"
  15198. }
  15199. },
  15200. url: "/repos/:owner/:repo/git/commits"
  15201. },
  15202. createRef: {
  15203. method: "POST",
  15204. params: {
  15205. owner: {
  15206. required: true,
  15207. type: "string"
  15208. },
  15209. ref: {
  15210. required: true,
  15211. type: "string"
  15212. },
  15213. repo: {
  15214. required: true,
  15215. type: "string"
  15216. },
  15217. sha: {
  15218. required: true,
  15219. type: "string"
  15220. }
  15221. },
  15222. url: "/repos/:owner/:repo/git/refs"
  15223. },
  15224. createTag: {
  15225. method: "POST",
  15226. params: {
  15227. message: {
  15228. required: true,
  15229. type: "string"
  15230. },
  15231. object: {
  15232. required: true,
  15233. type: "string"
  15234. },
  15235. owner: {
  15236. required: true,
  15237. type: "string"
  15238. },
  15239. repo: {
  15240. required: true,
  15241. type: "string"
  15242. },
  15243. tag: {
  15244. required: true,
  15245. type: "string"
  15246. },
  15247. tagger: {
  15248. type: "object"
  15249. },
  15250. "tagger.date": {
  15251. type: "string"
  15252. },
  15253. "tagger.email": {
  15254. type: "string"
  15255. },
  15256. "tagger.name": {
  15257. type: "string"
  15258. },
  15259. type: {
  15260. enum: ["commit", "tree", "blob"],
  15261. required: true,
  15262. type: "string"
  15263. }
  15264. },
  15265. url: "/repos/:owner/:repo/git/tags"
  15266. },
  15267. createTree: {
  15268. method: "POST",
  15269. params: {
  15270. base_tree: {
  15271. type: "string"
  15272. },
  15273. owner: {
  15274. required: true,
  15275. type: "string"
  15276. },
  15277. repo: {
  15278. required: true,
  15279. type: "string"
  15280. },
  15281. tree: {
  15282. required: true,
  15283. type: "object[]"
  15284. },
  15285. "tree[].content": {
  15286. type: "string"
  15287. },
  15288. "tree[].mode": {
  15289. enum: ["100644", "100755", "040000", "160000", "120000"],
  15290. type: "string"
  15291. },
  15292. "tree[].path": {
  15293. type: "string"
  15294. },
  15295. "tree[].sha": {
  15296. allowNull: true,
  15297. type: "string"
  15298. },
  15299. "tree[].type": {
  15300. enum: ["blob", "tree", "commit"],
  15301. type: "string"
  15302. }
  15303. },
  15304. url: "/repos/:owner/:repo/git/trees"
  15305. },
  15306. deleteRef: {
  15307. method: "DELETE",
  15308. params: {
  15309. owner: {
  15310. required: true,
  15311. type: "string"
  15312. },
  15313. ref: {
  15314. required: true,
  15315. type: "string"
  15316. },
  15317. repo: {
  15318. required: true,
  15319. type: "string"
  15320. }
  15321. },
  15322. url: "/repos/:owner/:repo/git/refs/:ref"
  15323. },
  15324. getBlob: {
  15325. method: "GET",
  15326. params: {
  15327. file_sha: {
  15328. required: true,
  15329. type: "string"
  15330. },
  15331. owner: {
  15332. required: true,
  15333. type: "string"
  15334. },
  15335. repo: {
  15336. required: true,
  15337. type: "string"
  15338. }
  15339. },
  15340. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15341. },
  15342. getCommit: {
  15343. method: "GET",
  15344. params: {
  15345. commit_sha: {
  15346. required: true,
  15347. type: "string"
  15348. },
  15349. owner: {
  15350. required: true,
  15351. type: "string"
  15352. },
  15353. repo: {
  15354. required: true,
  15355. type: "string"
  15356. }
  15357. },
  15358. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15359. },
  15360. getRef: {
  15361. method: "GET",
  15362. params: {
  15363. owner: {
  15364. required: true,
  15365. type: "string"
  15366. },
  15367. ref: {
  15368. required: true,
  15369. type: "string"
  15370. },
  15371. repo: {
  15372. required: true,
  15373. type: "string"
  15374. }
  15375. },
  15376. url: "/repos/:owner/:repo/git/ref/:ref"
  15377. },
  15378. getTag: {
  15379. method: "GET",
  15380. params: {
  15381. owner: {
  15382. required: true,
  15383. type: "string"
  15384. },
  15385. repo: {
  15386. required: true,
  15387. type: "string"
  15388. },
  15389. tag_sha: {
  15390. required: true,
  15391. type: "string"
  15392. }
  15393. },
  15394. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15395. },
  15396. getTree: {
  15397. method: "GET",
  15398. params: {
  15399. owner: {
  15400. required: true,
  15401. type: "string"
  15402. },
  15403. recursive: {
  15404. enum: ["1"],
  15405. type: "integer"
  15406. },
  15407. repo: {
  15408. required: true,
  15409. type: "string"
  15410. },
  15411. tree_sha: {
  15412. required: true,
  15413. type: "string"
  15414. }
  15415. },
  15416. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15417. },
  15418. listMatchingRefs: {
  15419. method: "GET",
  15420. params: {
  15421. owner: {
  15422. required: true,
  15423. type: "string"
  15424. },
  15425. page: {
  15426. type: "integer"
  15427. },
  15428. per_page: {
  15429. type: "integer"
  15430. },
  15431. ref: {
  15432. required: true,
  15433. type: "string"
  15434. },
  15435. repo: {
  15436. required: true,
  15437. type: "string"
  15438. }
  15439. },
  15440. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15441. },
  15442. listRefs: {
  15443. method: "GET",
  15444. params: {
  15445. namespace: {
  15446. type: "string"
  15447. },
  15448. owner: {
  15449. required: true,
  15450. type: "string"
  15451. },
  15452. page: {
  15453. type: "integer"
  15454. },
  15455. per_page: {
  15456. type: "integer"
  15457. },
  15458. repo: {
  15459. required: true,
  15460. type: "string"
  15461. }
  15462. },
  15463. url: "/repos/:owner/:repo/git/refs/:namespace"
  15464. },
  15465. updateRef: {
  15466. method: "PATCH",
  15467. params: {
  15468. force: {
  15469. type: "boolean"
  15470. },
  15471. owner: {
  15472. required: true,
  15473. type: "string"
  15474. },
  15475. ref: {
  15476. required: true,
  15477. type: "string"
  15478. },
  15479. repo: {
  15480. required: true,
  15481. type: "string"
  15482. },
  15483. sha: {
  15484. required: true,
  15485. type: "string"
  15486. }
  15487. },
  15488. url: "/repos/:owner/:repo/git/refs/:ref"
  15489. }
  15490. },
  15491. gitignore: {
  15492. getTemplate: {
  15493. method: "GET",
  15494. params: {
  15495. name: {
  15496. required: true,
  15497. type: "string"
  15498. }
  15499. },
  15500. url: "/gitignore/templates/:name"
  15501. },
  15502. listTemplates: {
  15503. method: "GET",
  15504. params: {},
  15505. url: "/gitignore/templates"
  15506. }
  15507. },
  15508. interactions: {
  15509. addOrUpdateRestrictionsForOrg: {
  15510. headers: {
  15511. accept: "application/vnd.github.sombra-preview+json"
  15512. },
  15513. method: "PUT",
  15514. params: {
  15515. limit: {
  15516. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15517. required: true,
  15518. type: "string"
  15519. },
  15520. org: {
  15521. required: true,
  15522. type: "string"
  15523. }
  15524. },
  15525. url: "/orgs/:org/interaction-limits"
  15526. },
  15527. addOrUpdateRestrictionsForRepo: {
  15528. headers: {
  15529. accept: "application/vnd.github.sombra-preview+json"
  15530. },
  15531. method: "PUT",
  15532. params: {
  15533. limit: {
  15534. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15535. required: true,
  15536. type: "string"
  15537. },
  15538. owner: {
  15539. required: true,
  15540. type: "string"
  15541. },
  15542. repo: {
  15543. required: true,
  15544. type: "string"
  15545. }
  15546. },
  15547. url: "/repos/:owner/:repo/interaction-limits"
  15548. },
  15549. getRestrictionsForOrg: {
  15550. headers: {
  15551. accept: "application/vnd.github.sombra-preview+json"
  15552. },
  15553. method: "GET",
  15554. params: {
  15555. org: {
  15556. required: true,
  15557. type: "string"
  15558. }
  15559. },
  15560. url: "/orgs/:org/interaction-limits"
  15561. },
  15562. getRestrictionsForRepo: {
  15563. headers: {
  15564. accept: "application/vnd.github.sombra-preview+json"
  15565. },
  15566. method: "GET",
  15567. params: {
  15568. owner: {
  15569. required: true,
  15570. type: "string"
  15571. },
  15572. repo: {
  15573. required: true,
  15574. type: "string"
  15575. }
  15576. },
  15577. url: "/repos/:owner/:repo/interaction-limits"
  15578. },
  15579. removeRestrictionsForOrg: {
  15580. headers: {
  15581. accept: "application/vnd.github.sombra-preview+json"
  15582. },
  15583. method: "DELETE",
  15584. params: {
  15585. org: {
  15586. required: true,
  15587. type: "string"
  15588. }
  15589. },
  15590. url: "/orgs/:org/interaction-limits"
  15591. },
  15592. removeRestrictionsForRepo: {
  15593. headers: {
  15594. accept: "application/vnd.github.sombra-preview+json"
  15595. },
  15596. method: "DELETE",
  15597. params: {
  15598. owner: {
  15599. required: true,
  15600. type: "string"
  15601. },
  15602. repo: {
  15603. required: true,
  15604. type: "string"
  15605. }
  15606. },
  15607. url: "/repos/:owner/:repo/interaction-limits"
  15608. }
  15609. },
  15610. issues: {
  15611. addAssignees: {
  15612. method: "POST",
  15613. params: {
  15614. assignees: {
  15615. type: "string[]"
  15616. },
  15617. issue_number: {
  15618. required: true,
  15619. type: "integer"
  15620. },
  15621. number: {
  15622. alias: "issue_number",
  15623. deprecated: true,
  15624. type: "integer"
  15625. },
  15626. owner: {
  15627. required: true,
  15628. type: "string"
  15629. },
  15630. repo: {
  15631. required: true,
  15632. type: "string"
  15633. }
  15634. },
  15635. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15636. },
  15637. addLabels: {
  15638. method: "POST",
  15639. params: {
  15640. issue_number: {
  15641. required: true,
  15642. type: "integer"
  15643. },
  15644. labels: {
  15645. required: true,
  15646. type: "string[]"
  15647. },
  15648. number: {
  15649. alias: "issue_number",
  15650. deprecated: true,
  15651. type: "integer"
  15652. },
  15653. owner: {
  15654. required: true,
  15655. type: "string"
  15656. },
  15657. repo: {
  15658. required: true,
  15659. type: "string"
  15660. }
  15661. },
  15662. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15663. },
  15664. checkAssignee: {
  15665. method: "GET",
  15666. params: {
  15667. assignee: {
  15668. required: true,
  15669. type: "string"
  15670. },
  15671. owner: {
  15672. required: true,
  15673. type: "string"
  15674. },
  15675. repo: {
  15676. required: true,
  15677. type: "string"
  15678. }
  15679. },
  15680. url: "/repos/:owner/:repo/assignees/:assignee"
  15681. },
  15682. create: {
  15683. method: "POST",
  15684. params: {
  15685. assignee: {
  15686. type: "string"
  15687. },
  15688. assignees: {
  15689. type: "string[]"
  15690. },
  15691. body: {
  15692. type: "string"
  15693. },
  15694. labels: {
  15695. type: "string[]"
  15696. },
  15697. milestone: {
  15698. type: "integer"
  15699. },
  15700. owner: {
  15701. required: true,
  15702. type: "string"
  15703. },
  15704. repo: {
  15705. required: true,
  15706. type: "string"
  15707. },
  15708. title: {
  15709. required: true,
  15710. type: "string"
  15711. }
  15712. },
  15713. url: "/repos/:owner/:repo/issues"
  15714. },
  15715. createComment: {
  15716. method: "POST",
  15717. params: {
  15718. body: {
  15719. required: true,
  15720. type: "string"
  15721. },
  15722. issue_number: {
  15723. required: true,
  15724. type: "integer"
  15725. },
  15726. number: {
  15727. alias: "issue_number",
  15728. deprecated: true,
  15729. type: "integer"
  15730. },
  15731. owner: {
  15732. required: true,
  15733. type: "string"
  15734. },
  15735. repo: {
  15736. required: true,
  15737. type: "string"
  15738. }
  15739. },
  15740. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  15741. },
  15742. createLabel: {
  15743. method: "POST",
  15744. params: {
  15745. color: {
  15746. required: true,
  15747. type: "string"
  15748. },
  15749. description: {
  15750. type: "string"
  15751. },
  15752. name: {
  15753. required: true,
  15754. type: "string"
  15755. },
  15756. owner: {
  15757. required: true,
  15758. type: "string"
  15759. },
  15760. repo: {
  15761. required: true,
  15762. type: "string"
  15763. }
  15764. },
  15765. url: "/repos/:owner/:repo/labels"
  15766. },
  15767. createMilestone: {
  15768. method: "POST",
  15769. params: {
  15770. description: {
  15771. type: "string"
  15772. },
  15773. due_on: {
  15774. type: "string"
  15775. },
  15776. owner: {
  15777. required: true,
  15778. type: "string"
  15779. },
  15780. repo: {
  15781. required: true,
  15782. type: "string"
  15783. },
  15784. state: {
  15785. enum: ["open", "closed"],
  15786. type: "string"
  15787. },
  15788. title: {
  15789. required: true,
  15790. type: "string"
  15791. }
  15792. },
  15793. url: "/repos/:owner/:repo/milestones"
  15794. },
  15795. deleteComment: {
  15796. method: "DELETE",
  15797. params: {
  15798. comment_id: {
  15799. required: true,
  15800. type: "integer"
  15801. },
  15802. owner: {
  15803. required: true,
  15804. type: "string"
  15805. },
  15806. repo: {
  15807. required: true,
  15808. type: "string"
  15809. }
  15810. },
  15811. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15812. },
  15813. deleteLabel: {
  15814. method: "DELETE",
  15815. params: {
  15816. name: {
  15817. required: true,
  15818. type: "string"
  15819. },
  15820. owner: {
  15821. required: true,
  15822. type: "string"
  15823. },
  15824. repo: {
  15825. required: true,
  15826. type: "string"
  15827. }
  15828. },
  15829. url: "/repos/:owner/:repo/labels/:name"
  15830. },
  15831. deleteMilestone: {
  15832. method: "DELETE",
  15833. params: {
  15834. milestone_number: {
  15835. required: true,
  15836. type: "integer"
  15837. },
  15838. number: {
  15839. alias: "milestone_number",
  15840. deprecated: true,
  15841. type: "integer"
  15842. },
  15843. owner: {
  15844. required: true,
  15845. type: "string"
  15846. },
  15847. repo: {
  15848. required: true,
  15849. type: "string"
  15850. }
  15851. },
  15852. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15853. },
  15854. get: {
  15855. method: "GET",
  15856. params: {
  15857. issue_number: {
  15858. required: true,
  15859. type: "integer"
  15860. },
  15861. number: {
  15862. alias: "issue_number",
  15863. deprecated: true,
  15864. type: "integer"
  15865. },
  15866. owner: {
  15867. required: true,
  15868. type: "string"
  15869. },
  15870. repo: {
  15871. required: true,
  15872. type: "string"
  15873. }
  15874. },
  15875. url: "/repos/:owner/:repo/issues/:issue_number"
  15876. },
  15877. getComment: {
  15878. method: "GET",
  15879. params: {
  15880. comment_id: {
  15881. required: true,
  15882. type: "integer"
  15883. },
  15884. owner: {
  15885. required: true,
  15886. type: "string"
  15887. },
  15888. repo: {
  15889. required: true,
  15890. type: "string"
  15891. }
  15892. },
  15893. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  15894. },
  15895. getEvent: {
  15896. method: "GET",
  15897. params: {
  15898. event_id: {
  15899. required: true,
  15900. type: "integer"
  15901. },
  15902. owner: {
  15903. required: true,
  15904. type: "string"
  15905. },
  15906. repo: {
  15907. required: true,
  15908. type: "string"
  15909. }
  15910. },
  15911. url: "/repos/:owner/:repo/issues/events/:event_id"
  15912. },
  15913. getLabel: {
  15914. method: "GET",
  15915. params: {
  15916. name: {
  15917. required: true,
  15918. type: "string"
  15919. },
  15920. owner: {
  15921. required: true,
  15922. type: "string"
  15923. },
  15924. repo: {
  15925. required: true,
  15926. type: "string"
  15927. }
  15928. },
  15929. url: "/repos/:owner/:repo/labels/:name"
  15930. },
  15931. getMilestone: {
  15932. method: "GET",
  15933. params: {
  15934. milestone_number: {
  15935. required: true,
  15936. type: "integer"
  15937. },
  15938. number: {
  15939. alias: "milestone_number",
  15940. deprecated: true,
  15941. type: "integer"
  15942. },
  15943. owner: {
  15944. required: true,
  15945. type: "string"
  15946. },
  15947. repo: {
  15948. required: true,
  15949. type: "string"
  15950. }
  15951. },
  15952. url: "/repos/:owner/:repo/milestones/:milestone_number"
  15953. },
  15954. list: {
  15955. method: "GET",
  15956. params: {
  15957. direction: {
  15958. enum: ["asc", "desc"],
  15959. type: "string"
  15960. },
  15961. filter: {
  15962. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  15963. type: "string"
  15964. },
  15965. labels: {
  15966. type: "string"
  15967. },
  15968. page: {
  15969. type: "integer"
  15970. },
  15971. per_page: {
  15972. type: "integer"
  15973. },
  15974. since: {
  15975. type: "string"
  15976. },
  15977. sort: {
  15978. enum: ["created", "updated", "comments"],
  15979. type: "string"
  15980. },
  15981. state: {
  15982. enum: ["open", "closed", "all"],
  15983. type: "string"
  15984. }
  15985. },
  15986. url: "/issues"
  15987. },
  15988. listAssignees: {
  15989. method: "GET",
  15990. params: {
  15991. owner: {
  15992. required: true,
  15993. type: "string"
  15994. },
  15995. page: {
  15996. type: "integer"
  15997. },
  15998. per_page: {
  15999. type: "integer"
  16000. },
  16001. repo: {
  16002. required: true,
  16003. type: "string"
  16004. }
  16005. },
  16006. url: "/repos/:owner/:repo/assignees"
  16007. },
  16008. listComments: {
  16009. method: "GET",
  16010. params: {
  16011. issue_number: {
  16012. required: true,
  16013. type: "integer"
  16014. },
  16015. number: {
  16016. alias: "issue_number",
  16017. deprecated: true,
  16018. type: "integer"
  16019. },
  16020. owner: {
  16021. required: true,
  16022. type: "string"
  16023. },
  16024. page: {
  16025. type: "integer"
  16026. },
  16027. per_page: {
  16028. type: "integer"
  16029. },
  16030. repo: {
  16031. required: true,
  16032. type: "string"
  16033. },
  16034. since: {
  16035. type: "string"
  16036. }
  16037. },
  16038. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16039. },
  16040. listCommentsForRepo: {
  16041. method: "GET",
  16042. params: {
  16043. direction: {
  16044. enum: ["asc", "desc"],
  16045. type: "string"
  16046. },
  16047. owner: {
  16048. required: true,
  16049. type: "string"
  16050. },
  16051. repo: {
  16052. required: true,
  16053. type: "string"
  16054. },
  16055. since: {
  16056. type: "string"
  16057. },
  16058. sort: {
  16059. enum: ["created", "updated"],
  16060. type: "string"
  16061. }
  16062. },
  16063. url: "/repos/:owner/:repo/issues/comments"
  16064. },
  16065. listEvents: {
  16066. method: "GET",
  16067. params: {
  16068. issue_number: {
  16069. required: true,
  16070. type: "integer"
  16071. },
  16072. number: {
  16073. alias: "issue_number",
  16074. deprecated: true,
  16075. type: "integer"
  16076. },
  16077. owner: {
  16078. required: true,
  16079. type: "string"
  16080. },
  16081. page: {
  16082. type: "integer"
  16083. },
  16084. per_page: {
  16085. type: "integer"
  16086. },
  16087. repo: {
  16088. required: true,
  16089. type: "string"
  16090. }
  16091. },
  16092. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16093. },
  16094. listEventsForRepo: {
  16095. method: "GET",
  16096. params: {
  16097. owner: {
  16098. required: true,
  16099. type: "string"
  16100. },
  16101. page: {
  16102. type: "integer"
  16103. },
  16104. per_page: {
  16105. type: "integer"
  16106. },
  16107. repo: {
  16108. required: true,
  16109. type: "string"
  16110. }
  16111. },
  16112. url: "/repos/:owner/:repo/issues/events"
  16113. },
  16114. listEventsForTimeline: {
  16115. headers: {
  16116. accept: "application/vnd.github.mockingbird-preview+json"
  16117. },
  16118. method: "GET",
  16119. params: {
  16120. issue_number: {
  16121. required: true,
  16122. type: "integer"
  16123. },
  16124. number: {
  16125. alias: "issue_number",
  16126. deprecated: true,
  16127. type: "integer"
  16128. },
  16129. owner: {
  16130. required: true,
  16131. type: "string"
  16132. },
  16133. page: {
  16134. type: "integer"
  16135. },
  16136. per_page: {
  16137. type: "integer"
  16138. },
  16139. repo: {
  16140. required: true,
  16141. type: "string"
  16142. }
  16143. },
  16144. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16145. },
  16146. listForAuthenticatedUser: {
  16147. method: "GET",
  16148. params: {
  16149. direction: {
  16150. enum: ["asc", "desc"],
  16151. type: "string"
  16152. },
  16153. filter: {
  16154. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16155. type: "string"
  16156. },
  16157. labels: {
  16158. type: "string"
  16159. },
  16160. page: {
  16161. type: "integer"
  16162. },
  16163. per_page: {
  16164. type: "integer"
  16165. },
  16166. since: {
  16167. type: "string"
  16168. },
  16169. sort: {
  16170. enum: ["created", "updated", "comments"],
  16171. type: "string"
  16172. },
  16173. state: {
  16174. enum: ["open", "closed", "all"],
  16175. type: "string"
  16176. }
  16177. },
  16178. url: "/user/issues"
  16179. },
  16180. listForOrg: {
  16181. method: "GET",
  16182. params: {
  16183. direction: {
  16184. enum: ["asc", "desc"],
  16185. type: "string"
  16186. },
  16187. filter: {
  16188. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16189. type: "string"
  16190. },
  16191. labels: {
  16192. type: "string"
  16193. },
  16194. org: {
  16195. required: true,
  16196. type: "string"
  16197. },
  16198. page: {
  16199. type: "integer"
  16200. },
  16201. per_page: {
  16202. type: "integer"
  16203. },
  16204. since: {
  16205. type: "string"
  16206. },
  16207. sort: {
  16208. enum: ["created", "updated", "comments"],
  16209. type: "string"
  16210. },
  16211. state: {
  16212. enum: ["open", "closed", "all"],
  16213. type: "string"
  16214. }
  16215. },
  16216. url: "/orgs/:org/issues"
  16217. },
  16218. listForRepo: {
  16219. method: "GET",
  16220. params: {
  16221. assignee: {
  16222. type: "string"
  16223. },
  16224. creator: {
  16225. type: "string"
  16226. },
  16227. direction: {
  16228. enum: ["asc", "desc"],
  16229. type: "string"
  16230. },
  16231. labels: {
  16232. type: "string"
  16233. },
  16234. mentioned: {
  16235. type: "string"
  16236. },
  16237. milestone: {
  16238. type: "string"
  16239. },
  16240. owner: {
  16241. required: true,
  16242. type: "string"
  16243. },
  16244. page: {
  16245. type: "integer"
  16246. },
  16247. per_page: {
  16248. type: "integer"
  16249. },
  16250. repo: {
  16251. required: true,
  16252. type: "string"
  16253. },
  16254. since: {
  16255. type: "string"
  16256. },
  16257. sort: {
  16258. enum: ["created", "updated", "comments"],
  16259. type: "string"
  16260. },
  16261. state: {
  16262. enum: ["open", "closed", "all"],
  16263. type: "string"
  16264. }
  16265. },
  16266. url: "/repos/:owner/:repo/issues"
  16267. },
  16268. listLabelsForMilestone: {
  16269. method: "GET",
  16270. params: {
  16271. milestone_number: {
  16272. required: true,
  16273. type: "integer"
  16274. },
  16275. number: {
  16276. alias: "milestone_number",
  16277. deprecated: true,
  16278. type: "integer"
  16279. },
  16280. owner: {
  16281. required: true,
  16282. type: "string"
  16283. },
  16284. page: {
  16285. type: "integer"
  16286. },
  16287. per_page: {
  16288. type: "integer"
  16289. },
  16290. repo: {
  16291. required: true,
  16292. type: "string"
  16293. }
  16294. },
  16295. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16296. },
  16297. listLabelsForRepo: {
  16298. method: "GET",
  16299. params: {
  16300. owner: {
  16301. required: true,
  16302. type: "string"
  16303. },
  16304. page: {
  16305. type: "integer"
  16306. },
  16307. per_page: {
  16308. type: "integer"
  16309. },
  16310. repo: {
  16311. required: true,
  16312. type: "string"
  16313. }
  16314. },
  16315. url: "/repos/:owner/:repo/labels"
  16316. },
  16317. listLabelsOnIssue: {
  16318. method: "GET",
  16319. params: {
  16320. issue_number: {
  16321. required: true,
  16322. type: "integer"
  16323. },
  16324. number: {
  16325. alias: "issue_number",
  16326. deprecated: true,
  16327. type: "integer"
  16328. },
  16329. owner: {
  16330. required: true,
  16331. type: "string"
  16332. },
  16333. page: {
  16334. type: "integer"
  16335. },
  16336. per_page: {
  16337. type: "integer"
  16338. },
  16339. repo: {
  16340. required: true,
  16341. type: "string"
  16342. }
  16343. },
  16344. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16345. },
  16346. listMilestonesForRepo: {
  16347. method: "GET",
  16348. params: {
  16349. direction: {
  16350. enum: ["asc", "desc"],
  16351. type: "string"
  16352. },
  16353. owner: {
  16354. required: true,
  16355. type: "string"
  16356. },
  16357. page: {
  16358. type: "integer"
  16359. },
  16360. per_page: {
  16361. type: "integer"
  16362. },
  16363. repo: {
  16364. required: true,
  16365. type: "string"
  16366. },
  16367. sort: {
  16368. enum: ["due_on", "completeness"],
  16369. type: "string"
  16370. },
  16371. state: {
  16372. enum: ["open", "closed", "all"],
  16373. type: "string"
  16374. }
  16375. },
  16376. url: "/repos/:owner/:repo/milestones"
  16377. },
  16378. lock: {
  16379. method: "PUT",
  16380. params: {
  16381. issue_number: {
  16382. required: true,
  16383. type: "integer"
  16384. },
  16385. lock_reason: {
  16386. enum: ["off-topic", "too heated", "resolved", "spam"],
  16387. type: "string"
  16388. },
  16389. number: {
  16390. alias: "issue_number",
  16391. deprecated: true,
  16392. type: "integer"
  16393. },
  16394. owner: {
  16395. required: true,
  16396. type: "string"
  16397. },
  16398. repo: {
  16399. required: true,
  16400. type: "string"
  16401. }
  16402. },
  16403. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16404. },
  16405. removeAssignees: {
  16406. method: "DELETE",
  16407. params: {
  16408. assignees: {
  16409. type: "string[]"
  16410. },
  16411. issue_number: {
  16412. required: true,
  16413. type: "integer"
  16414. },
  16415. number: {
  16416. alias: "issue_number",
  16417. deprecated: true,
  16418. type: "integer"
  16419. },
  16420. owner: {
  16421. required: true,
  16422. type: "string"
  16423. },
  16424. repo: {
  16425. required: true,
  16426. type: "string"
  16427. }
  16428. },
  16429. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16430. },
  16431. removeLabel: {
  16432. method: "DELETE",
  16433. params: {
  16434. issue_number: {
  16435. required: true,
  16436. type: "integer"
  16437. },
  16438. name: {
  16439. required: true,
  16440. type: "string"
  16441. },
  16442. number: {
  16443. alias: "issue_number",
  16444. deprecated: true,
  16445. type: "integer"
  16446. },
  16447. owner: {
  16448. required: true,
  16449. type: "string"
  16450. },
  16451. repo: {
  16452. required: true,
  16453. type: "string"
  16454. }
  16455. },
  16456. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16457. },
  16458. removeLabels: {
  16459. method: "DELETE",
  16460. params: {
  16461. issue_number: {
  16462. required: true,
  16463. type: "integer"
  16464. },
  16465. number: {
  16466. alias: "issue_number",
  16467. deprecated: true,
  16468. type: "integer"
  16469. },
  16470. owner: {
  16471. required: true,
  16472. type: "string"
  16473. },
  16474. repo: {
  16475. required: true,
  16476. type: "string"
  16477. }
  16478. },
  16479. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16480. },
  16481. replaceLabels: {
  16482. method: "PUT",
  16483. params: {
  16484. issue_number: {
  16485. required: true,
  16486. type: "integer"
  16487. },
  16488. labels: {
  16489. type: "string[]"
  16490. },
  16491. number: {
  16492. alias: "issue_number",
  16493. deprecated: true,
  16494. type: "integer"
  16495. },
  16496. owner: {
  16497. required: true,
  16498. type: "string"
  16499. },
  16500. repo: {
  16501. required: true,
  16502. type: "string"
  16503. }
  16504. },
  16505. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16506. },
  16507. unlock: {
  16508. method: "DELETE",
  16509. params: {
  16510. issue_number: {
  16511. required: true,
  16512. type: "integer"
  16513. },
  16514. number: {
  16515. alias: "issue_number",
  16516. deprecated: true,
  16517. type: "integer"
  16518. },
  16519. owner: {
  16520. required: true,
  16521. type: "string"
  16522. },
  16523. repo: {
  16524. required: true,
  16525. type: "string"
  16526. }
  16527. },
  16528. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16529. },
  16530. update: {
  16531. method: "PATCH",
  16532. params: {
  16533. assignee: {
  16534. type: "string"
  16535. },
  16536. assignees: {
  16537. type: "string[]"
  16538. },
  16539. body: {
  16540. type: "string"
  16541. },
  16542. issue_number: {
  16543. required: true,
  16544. type: "integer"
  16545. },
  16546. labels: {
  16547. type: "string[]"
  16548. },
  16549. milestone: {
  16550. allowNull: true,
  16551. type: "integer"
  16552. },
  16553. number: {
  16554. alias: "issue_number",
  16555. deprecated: true,
  16556. type: "integer"
  16557. },
  16558. owner: {
  16559. required: true,
  16560. type: "string"
  16561. },
  16562. repo: {
  16563. required: true,
  16564. type: "string"
  16565. },
  16566. state: {
  16567. enum: ["open", "closed"],
  16568. type: "string"
  16569. },
  16570. title: {
  16571. type: "string"
  16572. }
  16573. },
  16574. url: "/repos/:owner/:repo/issues/:issue_number"
  16575. },
  16576. updateComment: {
  16577. method: "PATCH",
  16578. params: {
  16579. body: {
  16580. required: true,
  16581. type: "string"
  16582. },
  16583. comment_id: {
  16584. required: true,
  16585. type: "integer"
  16586. },
  16587. owner: {
  16588. required: true,
  16589. type: "string"
  16590. },
  16591. repo: {
  16592. required: true,
  16593. type: "string"
  16594. }
  16595. },
  16596. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16597. },
  16598. updateLabel: {
  16599. method: "PATCH",
  16600. params: {
  16601. color: {
  16602. type: "string"
  16603. },
  16604. current_name: {
  16605. required: true,
  16606. type: "string"
  16607. },
  16608. description: {
  16609. type: "string"
  16610. },
  16611. name: {
  16612. type: "string"
  16613. },
  16614. owner: {
  16615. required: true,
  16616. type: "string"
  16617. },
  16618. repo: {
  16619. required: true,
  16620. type: "string"
  16621. }
  16622. },
  16623. url: "/repos/:owner/:repo/labels/:current_name"
  16624. },
  16625. updateMilestone: {
  16626. method: "PATCH",
  16627. params: {
  16628. description: {
  16629. type: "string"
  16630. },
  16631. due_on: {
  16632. type: "string"
  16633. },
  16634. milestone_number: {
  16635. required: true,
  16636. type: "integer"
  16637. },
  16638. number: {
  16639. alias: "milestone_number",
  16640. deprecated: true,
  16641. type: "integer"
  16642. },
  16643. owner: {
  16644. required: true,
  16645. type: "string"
  16646. },
  16647. repo: {
  16648. required: true,
  16649. type: "string"
  16650. },
  16651. state: {
  16652. enum: ["open", "closed"],
  16653. type: "string"
  16654. },
  16655. title: {
  16656. type: "string"
  16657. }
  16658. },
  16659. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16660. }
  16661. },
  16662. licenses: {
  16663. get: {
  16664. method: "GET",
  16665. params: {
  16666. license: {
  16667. required: true,
  16668. type: "string"
  16669. }
  16670. },
  16671. url: "/licenses/:license"
  16672. },
  16673. getForRepo: {
  16674. method: "GET",
  16675. params: {
  16676. owner: {
  16677. required: true,
  16678. type: "string"
  16679. },
  16680. repo: {
  16681. required: true,
  16682. type: "string"
  16683. }
  16684. },
  16685. url: "/repos/:owner/:repo/license"
  16686. },
  16687. list: {
  16688. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16689. method: "GET",
  16690. params: {},
  16691. url: "/licenses"
  16692. },
  16693. listCommonlyUsed: {
  16694. method: "GET",
  16695. params: {},
  16696. url: "/licenses"
  16697. }
  16698. },
  16699. markdown: {
  16700. render: {
  16701. method: "POST",
  16702. params: {
  16703. context: {
  16704. type: "string"
  16705. },
  16706. mode: {
  16707. enum: ["markdown", "gfm"],
  16708. type: "string"
  16709. },
  16710. text: {
  16711. required: true,
  16712. type: "string"
  16713. }
  16714. },
  16715. url: "/markdown"
  16716. },
  16717. renderRaw: {
  16718. headers: {
  16719. "content-type": "text/plain; charset=utf-8"
  16720. },
  16721. method: "POST",
  16722. params: {
  16723. data: {
  16724. mapTo: "data",
  16725. required: true,
  16726. type: "string"
  16727. }
  16728. },
  16729. url: "/markdown/raw"
  16730. }
  16731. },
  16732. meta: {
  16733. get: {
  16734. method: "GET",
  16735. params: {},
  16736. url: "/meta"
  16737. }
  16738. },
  16739. migrations: {
  16740. cancelImport: {
  16741. method: "DELETE",
  16742. params: {
  16743. owner: {
  16744. required: true,
  16745. type: "string"
  16746. },
  16747. repo: {
  16748. required: true,
  16749. type: "string"
  16750. }
  16751. },
  16752. url: "/repos/:owner/:repo/import"
  16753. },
  16754. deleteArchiveForAuthenticatedUser: {
  16755. headers: {
  16756. accept: "application/vnd.github.wyandotte-preview+json"
  16757. },
  16758. method: "DELETE",
  16759. params: {
  16760. migration_id: {
  16761. required: true,
  16762. type: "integer"
  16763. }
  16764. },
  16765. url: "/user/migrations/:migration_id/archive"
  16766. },
  16767. deleteArchiveForOrg: {
  16768. headers: {
  16769. accept: "application/vnd.github.wyandotte-preview+json"
  16770. },
  16771. method: "DELETE",
  16772. params: {
  16773. migration_id: {
  16774. required: true,
  16775. type: "integer"
  16776. },
  16777. org: {
  16778. required: true,
  16779. type: "string"
  16780. }
  16781. },
  16782. url: "/orgs/:org/migrations/:migration_id/archive"
  16783. },
  16784. downloadArchiveForOrg: {
  16785. headers: {
  16786. accept: "application/vnd.github.wyandotte-preview+json"
  16787. },
  16788. method: "GET",
  16789. params: {
  16790. migration_id: {
  16791. required: true,
  16792. type: "integer"
  16793. },
  16794. org: {
  16795. required: true,
  16796. type: "string"
  16797. }
  16798. },
  16799. url: "/orgs/:org/migrations/:migration_id/archive"
  16800. },
  16801. getArchiveForAuthenticatedUser: {
  16802. headers: {
  16803. accept: "application/vnd.github.wyandotte-preview+json"
  16804. },
  16805. method: "GET",
  16806. params: {
  16807. migration_id: {
  16808. required: true,
  16809. type: "integer"
  16810. }
  16811. },
  16812. url: "/user/migrations/:migration_id/archive"
  16813. },
  16814. getArchiveForOrg: {
  16815. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  16816. headers: {
  16817. accept: "application/vnd.github.wyandotte-preview+json"
  16818. },
  16819. method: "GET",
  16820. params: {
  16821. migration_id: {
  16822. required: true,
  16823. type: "integer"
  16824. },
  16825. org: {
  16826. required: true,
  16827. type: "string"
  16828. }
  16829. },
  16830. url: "/orgs/:org/migrations/:migration_id/archive"
  16831. },
  16832. getCommitAuthors: {
  16833. method: "GET",
  16834. params: {
  16835. owner: {
  16836. required: true,
  16837. type: "string"
  16838. },
  16839. repo: {
  16840. required: true,
  16841. type: "string"
  16842. },
  16843. since: {
  16844. type: "string"
  16845. }
  16846. },
  16847. url: "/repos/:owner/:repo/import/authors"
  16848. },
  16849. getImportProgress: {
  16850. method: "GET",
  16851. params: {
  16852. owner: {
  16853. required: true,
  16854. type: "string"
  16855. },
  16856. repo: {
  16857. required: true,
  16858. type: "string"
  16859. }
  16860. },
  16861. url: "/repos/:owner/:repo/import"
  16862. },
  16863. getLargeFiles: {
  16864. method: "GET",
  16865. params: {
  16866. owner: {
  16867. required: true,
  16868. type: "string"
  16869. },
  16870. repo: {
  16871. required: true,
  16872. type: "string"
  16873. }
  16874. },
  16875. url: "/repos/:owner/:repo/import/large_files"
  16876. },
  16877. getStatusForAuthenticatedUser: {
  16878. headers: {
  16879. accept: "application/vnd.github.wyandotte-preview+json"
  16880. },
  16881. method: "GET",
  16882. params: {
  16883. migration_id: {
  16884. required: true,
  16885. type: "integer"
  16886. }
  16887. },
  16888. url: "/user/migrations/:migration_id"
  16889. },
  16890. getStatusForOrg: {
  16891. headers: {
  16892. accept: "application/vnd.github.wyandotte-preview+json"
  16893. },
  16894. method: "GET",
  16895. params: {
  16896. migration_id: {
  16897. required: true,
  16898. type: "integer"
  16899. },
  16900. org: {
  16901. required: true,
  16902. type: "string"
  16903. }
  16904. },
  16905. url: "/orgs/:org/migrations/:migration_id"
  16906. },
  16907. listForAuthenticatedUser: {
  16908. headers: {
  16909. accept: "application/vnd.github.wyandotte-preview+json"
  16910. },
  16911. method: "GET",
  16912. params: {
  16913. page: {
  16914. type: "integer"
  16915. },
  16916. per_page: {
  16917. type: "integer"
  16918. }
  16919. },
  16920. url: "/user/migrations"
  16921. },
  16922. listForOrg: {
  16923. headers: {
  16924. accept: "application/vnd.github.wyandotte-preview+json"
  16925. },
  16926. method: "GET",
  16927. params: {
  16928. org: {
  16929. required: true,
  16930. type: "string"
  16931. },
  16932. page: {
  16933. type: "integer"
  16934. },
  16935. per_page: {
  16936. type: "integer"
  16937. }
  16938. },
  16939. url: "/orgs/:org/migrations"
  16940. },
  16941. listReposForOrg: {
  16942. headers: {
  16943. accept: "application/vnd.github.wyandotte-preview+json"
  16944. },
  16945. method: "GET",
  16946. params: {
  16947. migration_id: {
  16948. required: true,
  16949. type: "integer"
  16950. },
  16951. org: {
  16952. required: true,
  16953. type: "string"
  16954. },
  16955. page: {
  16956. type: "integer"
  16957. },
  16958. per_page: {
  16959. type: "integer"
  16960. }
  16961. },
  16962. url: "/orgs/:org/migrations/:migration_id/repositories"
  16963. },
  16964. listReposForUser: {
  16965. headers: {
  16966. accept: "application/vnd.github.wyandotte-preview+json"
  16967. },
  16968. method: "GET",
  16969. params: {
  16970. migration_id: {
  16971. required: true,
  16972. type: "integer"
  16973. },
  16974. page: {
  16975. type: "integer"
  16976. },
  16977. per_page: {
  16978. type: "integer"
  16979. }
  16980. },
  16981. url: "/user/:migration_id/repositories"
  16982. },
  16983. mapCommitAuthor: {
  16984. method: "PATCH",
  16985. params: {
  16986. author_id: {
  16987. required: true,
  16988. type: "integer"
  16989. },
  16990. email: {
  16991. type: "string"
  16992. },
  16993. name: {
  16994. type: "string"
  16995. },
  16996. owner: {
  16997. required: true,
  16998. type: "string"
  16999. },
  17000. repo: {
  17001. required: true,
  17002. type: "string"
  17003. }
  17004. },
  17005. url: "/repos/:owner/:repo/import/authors/:author_id"
  17006. },
  17007. setLfsPreference: {
  17008. method: "PATCH",
  17009. params: {
  17010. owner: {
  17011. required: true,
  17012. type: "string"
  17013. },
  17014. repo: {
  17015. required: true,
  17016. type: "string"
  17017. },
  17018. use_lfs: {
  17019. enum: ["opt_in", "opt_out"],
  17020. required: true,
  17021. type: "string"
  17022. }
  17023. },
  17024. url: "/repos/:owner/:repo/import/lfs"
  17025. },
  17026. startForAuthenticatedUser: {
  17027. method: "POST",
  17028. params: {
  17029. exclude_attachments: {
  17030. type: "boolean"
  17031. },
  17032. lock_repositories: {
  17033. type: "boolean"
  17034. },
  17035. repositories: {
  17036. required: true,
  17037. type: "string[]"
  17038. }
  17039. },
  17040. url: "/user/migrations"
  17041. },
  17042. startForOrg: {
  17043. method: "POST",
  17044. params: {
  17045. exclude_attachments: {
  17046. type: "boolean"
  17047. },
  17048. lock_repositories: {
  17049. type: "boolean"
  17050. },
  17051. org: {
  17052. required: true,
  17053. type: "string"
  17054. },
  17055. repositories: {
  17056. required: true,
  17057. type: "string[]"
  17058. }
  17059. },
  17060. url: "/orgs/:org/migrations"
  17061. },
  17062. startImport: {
  17063. method: "PUT",
  17064. params: {
  17065. owner: {
  17066. required: true,
  17067. type: "string"
  17068. },
  17069. repo: {
  17070. required: true,
  17071. type: "string"
  17072. },
  17073. tfvc_project: {
  17074. type: "string"
  17075. },
  17076. vcs: {
  17077. enum: ["subversion", "git", "mercurial", "tfvc"],
  17078. type: "string"
  17079. },
  17080. vcs_password: {
  17081. type: "string"
  17082. },
  17083. vcs_url: {
  17084. required: true,
  17085. type: "string"
  17086. },
  17087. vcs_username: {
  17088. type: "string"
  17089. }
  17090. },
  17091. url: "/repos/:owner/:repo/import"
  17092. },
  17093. unlockRepoForAuthenticatedUser: {
  17094. headers: {
  17095. accept: "application/vnd.github.wyandotte-preview+json"
  17096. },
  17097. method: "DELETE",
  17098. params: {
  17099. migration_id: {
  17100. required: true,
  17101. type: "integer"
  17102. },
  17103. repo_name: {
  17104. required: true,
  17105. type: "string"
  17106. }
  17107. },
  17108. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17109. },
  17110. unlockRepoForOrg: {
  17111. headers: {
  17112. accept: "application/vnd.github.wyandotte-preview+json"
  17113. },
  17114. method: "DELETE",
  17115. params: {
  17116. migration_id: {
  17117. required: true,
  17118. type: "integer"
  17119. },
  17120. org: {
  17121. required: true,
  17122. type: "string"
  17123. },
  17124. repo_name: {
  17125. required: true,
  17126. type: "string"
  17127. }
  17128. },
  17129. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17130. },
  17131. updateImport: {
  17132. method: "PATCH",
  17133. params: {
  17134. owner: {
  17135. required: true,
  17136. type: "string"
  17137. },
  17138. repo: {
  17139. required: true,
  17140. type: "string"
  17141. },
  17142. vcs_password: {
  17143. type: "string"
  17144. },
  17145. vcs_username: {
  17146. type: "string"
  17147. }
  17148. },
  17149. url: "/repos/:owner/:repo/import"
  17150. }
  17151. },
  17152. oauthAuthorizations: {
  17153. checkAuthorization: {
  17154. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17155. method: "GET",
  17156. params: {
  17157. access_token: {
  17158. required: true,
  17159. type: "string"
  17160. },
  17161. client_id: {
  17162. required: true,
  17163. type: "string"
  17164. }
  17165. },
  17166. url: "/applications/:client_id/tokens/:access_token"
  17167. },
  17168. createAuthorization: {
  17169. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17170. method: "POST",
  17171. params: {
  17172. client_id: {
  17173. type: "string"
  17174. },
  17175. client_secret: {
  17176. type: "string"
  17177. },
  17178. fingerprint: {
  17179. type: "string"
  17180. },
  17181. note: {
  17182. required: true,
  17183. type: "string"
  17184. },
  17185. note_url: {
  17186. type: "string"
  17187. },
  17188. scopes: {
  17189. type: "string[]"
  17190. }
  17191. },
  17192. url: "/authorizations"
  17193. },
  17194. deleteAuthorization: {
  17195. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17196. method: "DELETE",
  17197. params: {
  17198. authorization_id: {
  17199. required: true,
  17200. type: "integer"
  17201. }
  17202. },
  17203. url: "/authorizations/:authorization_id"
  17204. },
  17205. deleteGrant: {
  17206. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17207. method: "DELETE",
  17208. params: {
  17209. grant_id: {
  17210. required: true,
  17211. type: "integer"
  17212. }
  17213. },
  17214. url: "/applications/grants/:grant_id"
  17215. },
  17216. getAuthorization: {
  17217. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17218. method: "GET",
  17219. params: {
  17220. authorization_id: {
  17221. required: true,
  17222. type: "integer"
  17223. }
  17224. },
  17225. url: "/authorizations/:authorization_id"
  17226. },
  17227. getGrant: {
  17228. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17229. method: "GET",
  17230. params: {
  17231. grant_id: {
  17232. required: true,
  17233. type: "integer"
  17234. }
  17235. },
  17236. url: "/applications/grants/:grant_id"
  17237. },
  17238. getOrCreateAuthorizationForApp: {
  17239. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17240. method: "PUT",
  17241. params: {
  17242. client_id: {
  17243. required: true,
  17244. type: "string"
  17245. },
  17246. client_secret: {
  17247. required: true,
  17248. type: "string"
  17249. },
  17250. fingerprint: {
  17251. type: "string"
  17252. },
  17253. note: {
  17254. type: "string"
  17255. },
  17256. note_url: {
  17257. type: "string"
  17258. },
  17259. scopes: {
  17260. type: "string[]"
  17261. }
  17262. },
  17263. url: "/authorizations/clients/:client_id"
  17264. },
  17265. getOrCreateAuthorizationForAppAndFingerprint: {
  17266. 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",
  17267. method: "PUT",
  17268. params: {
  17269. client_id: {
  17270. required: true,
  17271. type: "string"
  17272. },
  17273. client_secret: {
  17274. required: true,
  17275. type: "string"
  17276. },
  17277. fingerprint: {
  17278. required: true,
  17279. type: "string"
  17280. },
  17281. note: {
  17282. type: "string"
  17283. },
  17284. note_url: {
  17285. type: "string"
  17286. },
  17287. scopes: {
  17288. type: "string[]"
  17289. }
  17290. },
  17291. url: "/authorizations/clients/:client_id/:fingerprint"
  17292. },
  17293. getOrCreateAuthorizationForAppFingerprint: {
  17294. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17295. method: "PUT",
  17296. params: {
  17297. client_id: {
  17298. required: true,
  17299. type: "string"
  17300. },
  17301. client_secret: {
  17302. required: true,
  17303. type: "string"
  17304. },
  17305. fingerprint: {
  17306. required: true,
  17307. type: "string"
  17308. },
  17309. note: {
  17310. type: "string"
  17311. },
  17312. note_url: {
  17313. type: "string"
  17314. },
  17315. scopes: {
  17316. type: "string[]"
  17317. }
  17318. },
  17319. url: "/authorizations/clients/:client_id/:fingerprint"
  17320. },
  17321. listAuthorizations: {
  17322. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17323. method: "GET",
  17324. params: {
  17325. page: {
  17326. type: "integer"
  17327. },
  17328. per_page: {
  17329. type: "integer"
  17330. }
  17331. },
  17332. url: "/authorizations"
  17333. },
  17334. listGrants: {
  17335. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17336. method: "GET",
  17337. params: {
  17338. page: {
  17339. type: "integer"
  17340. },
  17341. per_page: {
  17342. type: "integer"
  17343. }
  17344. },
  17345. url: "/applications/grants"
  17346. },
  17347. resetAuthorization: {
  17348. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17349. method: "POST",
  17350. params: {
  17351. access_token: {
  17352. required: true,
  17353. type: "string"
  17354. },
  17355. client_id: {
  17356. required: true,
  17357. type: "string"
  17358. }
  17359. },
  17360. url: "/applications/:client_id/tokens/:access_token"
  17361. },
  17362. revokeAuthorizationForApplication: {
  17363. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17364. method: "DELETE",
  17365. params: {
  17366. access_token: {
  17367. required: true,
  17368. type: "string"
  17369. },
  17370. client_id: {
  17371. required: true,
  17372. type: "string"
  17373. }
  17374. },
  17375. url: "/applications/:client_id/tokens/:access_token"
  17376. },
  17377. revokeGrantForApplication: {
  17378. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17379. method: "DELETE",
  17380. params: {
  17381. access_token: {
  17382. required: true,
  17383. type: "string"
  17384. },
  17385. client_id: {
  17386. required: true,
  17387. type: "string"
  17388. }
  17389. },
  17390. url: "/applications/:client_id/grants/:access_token"
  17391. },
  17392. updateAuthorization: {
  17393. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17394. method: "PATCH",
  17395. params: {
  17396. add_scopes: {
  17397. type: "string[]"
  17398. },
  17399. authorization_id: {
  17400. required: true,
  17401. type: "integer"
  17402. },
  17403. fingerprint: {
  17404. type: "string"
  17405. },
  17406. note: {
  17407. type: "string"
  17408. },
  17409. note_url: {
  17410. type: "string"
  17411. },
  17412. remove_scopes: {
  17413. type: "string[]"
  17414. },
  17415. scopes: {
  17416. type: "string[]"
  17417. }
  17418. },
  17419. url: "/authorizations/:authorization_id"
  17420. }
  17421. },
  17422. orgs: {
  17423. addOrUpdateMembership: {
  17424. method: "PUT",
  17425. params: {
  17426. org: {
  17427. required: true,
  17428. type: "string"
  17429. },
  17430. role: {
  17431. enum: ["admin", "member"],
  17432. type: "string"
  17433. },
  17434. username: {
  17435. required: true,
  17436. type: "string"
  17437. }
  17438. },
  17439. url: "/orgs/:org/memberships/:username"
  17440. },
  17441. blockUser: {
  17442. method: "PUT",
  17443. params: {
  17444. org: {
  17445. required: true,
  17446. type: "string"
  17447. },
  17448. username: {
  17449. required: true,
  17450. type: "string"
  17451. }
  17452. },
  17453. url: "/orgs/:org/blocks/:username"
  17454. },
  17455. checkBlockedUser: {
  17456. method: "GET",
  17457. params: {
  17458. org: {
  17459. required: true,
  17460. type: "string"
  17461. },
  17462. username: {
  17463. required: true,
  17464. type: "string"
  17465. }
  17466. },
  17467. url: "/orgs/:org/blocks/:username"
  17468. },
  17469. checkMembership: {
  17470. method: "GET",
  17471. params: {
  17472. org: {
  17473. required: true,
  17474. type: "string"
  17475. },
  17476. username: {
  17477. required: true,
  17478. type: "string"
  17479. }
  17480. },
  17481. url: "/orgs/:org/members/:username"
  17482. },
  17483. checkPublicMembership: {
  17484. method: "GET",
  17485. params: {
  17486. org: {
  17487. required: true,
  17488. type: "string"
  17489. },
  17490. username: {
  17491. required: true,
  17492. type: "string"
  17493. }
  17494. },
  17495. url: "/orgs/:org/public_members/:username"
  17496. },
  17497. concealMembership: {
  17498. method: "DELETE",
  17499. params: {
  17500. org: {
  17501. required: true,
  17502. type: "string"
  17503. },
  17504. username: {
  17505. required: true,
  17506. type: "string"
  17507. }
  17508. },
  17509. url: "/orgs/:org/public_members/:username"
  17510. },
  17511. convertMemberToOutsideCollaborator: {
  17512. method: "PUT",
  17513. params: {
  17514. org: {
  17515. required: true,
  17516. type: "string"
  17517. },
  17518. username: {
  17519. required: true,
  17520. type: "string"
  17521. }
  17522. },
  17523. url: "/orgs/:org/outside_collaborators/:username"
  17524. },
  17525. createHook: {
  17526. method: "POST",
  17527. params: {
  17528. active: {
  17529. type: "boolean"
  17530. },
  17531. config: {
  17532. required: true,
  17533. type: "object"
  17534. },
  17535. "config.content_type": {
  17536. type: "string"
  17537. },
  17538. "config.insecure_ssl": {
  17539. type: "string"
  17540. },
  17541. "config.secret": {
  17542. type: "string"
  17543. },
  17544. "config.url": {
  17545. required: true,
  17546. type: "string"
  17547. },
  17548. events: {
  17549. type: "string[]"
  17550. },
  17551. name: {
  17552. required: true,
  17553. type: "string"
  17554. },
  17555. org: {
  17556. required: true,
  17557. type: "string"
  17558. }
  17559. },
  17560. url: "/orgs/:org/hooks"
  17561. },
  17562. createInvitation: {
  17563. method: "POST",
  17564. params: {
  17565. email: {
  17566. type: "string"
  17567. },
  17568. invitee_id: {
  17569. type: "integer"
  17570. },
  17571. org: {
  17572. required: true,
  17573. type: "string"
  17574. },
  17575. role: {
  17576. enum: ["admin", "direct_member", "billing_manager"],
  17577. type: "string"
  17578. },
  17579. team_ids: {
  17580. type: "integer[]"
  17581. }
  17582. },
  17583. url: "/orgs/:org/invitations"
  17584. },
  17585. deleteHook: {
  17586. method: "DELETE",
  17587. params: {
  17588. hook_id: {
  17589. required: true,
  17590. type: "integer"
  17591. },
  17592. org: {
  17593. required: true,
  17594. type: "string"
  17595. }
  17596. },
  17597. url: "/orgs/:org/hooks/:hook_id"
  17598. },
  17599. get: {
  17600. method: "GET",
  17601. params: {
  17602. org: {
  17603. required: true,
  17604. type: "string"
  17605. }
  17606. },
  17607. url: "/orgs/:org"
  17608. },
  17609. getHook: {
  17610. method: "GET",
  17611. params: {
  17612. hook_id: {
  17613. required: true,
  17614. type: "integer"
  17615. },
  17616. org: {
  17617. required: true,
  17618. type: "string"
  17619. }
  17620. },
  17621. url: "/orgs/:org/hooks/:hook_id"
  17622. },
  17623. getMembership: {
  17624. method: "GET",
  17625. params: {
  17626. org: {
  17627. required: true,
  17628. type: "string"
  17629. },
  17630. username: {
  17631. required: true,
  17632. type: "string"
  17633. }
  17634. },
  17635. url: "/orgs/:org/memberships/:username"
  17636. },
  17637. getMembershipForAuthenticatedUser: {
  17638. method: "GET",
  17639. params: {
  17640. org: {
  17641. required: true,
  17642. type: "string"
  17643. }
  17644. },
  17645. url: "/user/memberships/orgs/:org"
  17646. },
  17647. list: {
  17648. method: "GET",
  17649. params: {
  17650. page: {
  17651. type: "integer"
  17652. },
  17653. per_page: {
  17654. type: "integer"
  17655. },
  17656. since: {
  17657. type: "integer"
  17658. }
  17659. },
  17660. url: "/organizations"
  17661. },
  17662. listBlockedUsers: {
  17663. method: "GET",
  17664. params: {
  17665. org: {
  17666. required: true,
  17667. type: "string"
  17668. }
  17669. },
  17670. url: "/orgs/:org/blocks"
  17671. },
  17672. listForAuthenticatedUser: {
  17673. method: "GET",
  17674. params: {
  17675. page: {
  17676. type: "integer"
  17677. },
  17678. per_page: {
  17679. type: "integer"
  17680. }
  17681. },
  17682. url: "/user/orgs"
  17683. },
  17684. listForUser: {
  17685. method: "GET",
  17686. params: {
  17687. page: {
  17688. type: "integer"
  17689. },
  17690. per_page: {
  17691. type: "integer"
  17692. },
  17693. username: {
  17694. required: true,
  17695. type: "string"
  17696. }
  17697. },
  17698. url: "/users/:username/orgs"
  17699. },
  17700. listHooks: {
  17701. method: "GET",
  17702. params: {
  17703. org: {
  17704. required: true,
  17705. type: "string"
  17706. },
  17707. page: {
  17708. type: "integer"
  17709. },
  17710. per_page: {
  17711. type: "integer"
  17712. }
  17713. },
  17714. url: "/orgs/:org/hooks"
  17715. },
  17716. listInstallations: {
  17717. headers: {
  17718. accept: "application/vnd.github.machine-man-preview+json"
  17719. },
  17720. method: "GET",
  17721. params: {
  17722. org: {
  17723. required: true,
  17724. type: "string"
  17725. },
  17726. page: {
  17727. type: "integer"
  17728. },
  17729. per_page: {
  17730. type: "integer"
  17731. }
  17732. },
  17733. url: "/orgs/:org/installations"
  17734. },
  17735. listInvitationTeams: {
  17736. method: "GET",
  17737. params: {
  17738. invitation_id: {
  17739. required: true,
  17740. type: "integer"
  17741. },
  17742. org: {
  17743. required: true,
  17744. type: "string"
  17745. },
  17746. page: {
  17747. type: "integer"
  17748. },
  17749. per_page: {
  17750. type: "integer"
  17751. }
  17752. },
  17753. url: "/orgs/:org/invitations/:invitation_id/teams"
  17754. },
  17755. listMembers: {
  17756. method: "GET",
  17757. params: {
  17758. filter: {
  17759. enum: ["2fa_disabled", "all"],
  17760. type: "string"
  17761. },
  17762. org: {
  17763. required: true,
  17764. type: "string"
  17765. },
  17766. page: {
  17767. type: "integer"
  17768. },
  17769. per_page: {
  17770. type: "integer"
  17771. },
  17772. role: {
  17773. enum: ["all", "admin", "member"],
  17774. type: "string"
  17775. }
  17776. },
  17777. url: "/orgs/:org/members"
  17778. },
  17779. listMemberships: {
  17780. method: "GET",
  17781. params: {
  17782. page: {
  17783. type: "integer"
  17784. },
  17785. per_page: {
  17786. type: "integer"
  17787. },
  17788. state: {
  17789. enum: ["active", "pending"],
  17790. type: "string"
  17791. }
  17792. },
  17793. url: "/user/memberships/orgs"
  17794. },
  17795. listOutsideCollaborators: {
  17796. method: "GET",
  17797. params: {
  17798. filter: {
  17799. enum: ["2fa_disabled", "all"],
  17800. type: "string"
  17801. },
  17802. org: {
  17803. required: true,
  17804. type: "string"
  17805. },
  17806. page: {
  17807. type: "integer"
  17808. },
  17809. per_page: {
  17810. type: "integer"
  17811. }
  17812. },
  17813. url: "/orgs/:org/outside_collaborators"
  17814. },
  17815. listPendingInvitations: {
  17816. method: "GET",
  17817. params: {
  17818. org: {
  17819. required: true,
  17820. type: "string"
  17821. },
  17822. page: {
  17823. type: "integer"
  17824. },
  17825. per_page: {
  17826. type: "integer"
  17827. }
  17828. },
  17829. url: "/orgs/:org/invitations"
  17830. },
  17831. listPublicMembers: {
  17832. method: "GET",
  17833. params: {
  17834. org: {
  17835. required: true,
  17836. type: "string"
  17837. },
  17838. page: {
  17839. type: "integer"
  17840. },
  17841. per_page: {
  17842. type: "integer"
  17843. }
  17844. },
  17845. url: "/orgs/:org/public_members"
  17846. },
  17847. pingHook: {
  17848. method: "POST",
  17849. params: {
  17850. hook_id: {
  17851. required: true,
  17852. type: "integer"
  17853. },
  17854. org: {
  17855. required: true,
  17856. type: "string"
  17857. }
  17858. },
  17859. url: "/orgs/:org/hooks/:hook_id/pings"
  17860. },
  17861. publicizeMembership: {
  17862. method: "PUT",
  17863. params: {
  17864. org: {
  17865. required: true,
  17866. type: "string"
  17867. },
  17868. username: {
  17869. required: true,
  17870. type: "string"
  17871. }
  17872. },
  17873. url: "/orgs/:org/public_members/:username"
  17874. },
  17875. removeMember: {
  17876. method: "DELETE",
  17877. params: {
  17878. org: {
  17879. required: true,
  17880. type: "string"
  17881. },
  17882. username: {
  17883. required: true,
  17884. type: "string"
  17885. }
  17886. },
  17887. url: "/orgs/:org/members/:username"
  17888. },
  17889. removeMembership: {
  17890. method: "DELETE",
  17891. params: {
  17892. org: {
  17893. required: true,
  17894. type: "string"
  17895. },
  17896. username: {
  17897. required: true,
  17898. type: "string"
  17899. }
  17900. },
  17901. url: "/orgs/:org/memberships/:username"
  17902. },
  17903. removeOutsideCollaborator: {
  17904. method: "DELETE",
  17905. params: {
  17906. org: {
  17907. required: true,
  17908. type: "string"
  17909. },
  17910. username: {
  17911. required: true,
  17912. type: "string"
  17913. }
  17914. },
  17915. url: "/orgs/:org/outside_collaborators/:username"
  17916. },
  17917. unblockUser: {
  17918. method: "DELETE",
  17919. params: {
  17920. org: {
  17921. required: true,
  17922. type: "string"
  17923. },
  17924. username: {
  17925. required: true,
  17926. type: "string"
  17927. }
  17928. },
  17929. url: "/orgs/:org/blocks/:username"
  17930. },
  17931. update: {
  17932. method: "PATCH",
  17933. params: {
  17934. billing_email: {
  17935. type: "string"
  17936. },
  17937. company: {
  17938. type: "string"
  17939. },
  17940. default_repository_permission: {
  17941. enum: ["read", "write", "admin", "none"],
  17942. type: "string"
  17943. },
  17944. description: {
  17945. type: "string"
  17946. },
  17947. email: {
  17948. type: "string"
  17949. },
  17950. has_organization_projects: {
  17951. type: "boolean"
  17952. },
  17953. has_repository_projects: {
  17954. type: "boolean"
  17955. },
  17956. location: {
  17957. type: "string"
  17958. },
  17959. members_allowed_repository_creation_type: {
  17960. enum: ["all", "private", "none"],
  17961. type: "string"
  17962. },
  17963. members_can_create_internal_repositories: {
  17964. type: "boolean"
  17965. },
  17966. members_can_create_private_repositories: {
  17967. type: "boolean"
  17968. },
  17969. members_can_create_public_repositories: {
  17970. type: "boolean"
  17971. },
  17972. members_can_create_repositories: {
  17973. type: "boolean"
  17974. },
  17975. name: {
  17976. type: "string"
  17977. },
  17978. org: {
  17979. required: true,
  17980. type: "string"
  17981. }
  17982. },
  17983. url: "/orgs/:org"
  17984. },
  17985. updateHook: {
  17986. method: "PATCH",
  17987. params: {
  17988. active: {
  17989. type: "boolean"
  17990. },
  17991. config: {
  17992. type: "object"
  17993. },
  17994. "config.content_type": {
  17995. type: "string"
  17996. },
  17997. "config.insecure_ssl": {
  17998. type: "string"
  17999. },
  18000. "config.secret": {
  18001. type: "string"
  18002. },
  18003. "config.url": {
  18004. required: true,
  18005. type: "string"
  18006. },
  18007. events: {
  18008. type: "string[]"
  18009. },
  18010. hook_id: {
  18011. required: true,
  18012. type: "integer"
  18013. },
  18014. org: {
  18015. required: true,
  18016. type: "string"
  18017. }
  18018. },
  18019. url: "/orgs/:org/hooks/:hook_id"
  18020. },
  18021. updateMembership: {
  18022. method: "PATCH",
  18023. params: {
  18024. org: {
  18025. required: true,
  18026. type: "string"
  18027. },
  18028. state: {
  18029. enum: ["active"],
  18030. required: true,
  18031. type: "string"
  18032. }
  18033. },
  18034. url: "/user/memberships/orgs/:org"
  18035. }
  18036. },
  18037. projects: {
  18038. addCollaborator: {
  18039. headers: {
  18040. accept: "application/vnd.github.inertia-preview+json"
  18041. },
  18042. method: "PUT",
  18043. params: {
  18044. permission: {
  18045. enum: ["read", "write", "admin"],
  18046. type: "string"
  18047. },
  18048. project_id: {
  18049. required: true,
  18050. type: "integer"
  18051. },
  18052. username: {
  18053. required: true,
  18054. type: "string"
  18055. }
  18056. },
  18057. url: "/projects/:project_id/collaborators/:username"
  18058. },
  18059. createCard: {
  18060. headers: {
  18061. accept: "application/vnd.github.inertia-preview+json"
  18062. },
  18063. method: "POST",
  18064. params: {
  18065. column_id: {
  18066. required: true,
  18067. type: "integer"
  18068. },
  18069. content_id: {
  18070. type: "integer"
  18071. },
  18072. content_type: {
  18073. type: "string"
  18074. },
  18075. note: {
  18076. type: "string"
  18077. }
  18078. },
  18079. url: "/projects/columns/:column_id/cards"
  18080. },
  18081. createColumn: {
  18082. headers: {
  18083. accept: "application/vnd.github.inertia-preview+json"
  18084. },
  18085. method: "POST",
  18086. params: {
  18087. name: {
  18088. required: true,
  18089. type: "string"
  18090. },
  18091. project_id: {
  18092. required: true,
  18093. type: "integer"
  18094. }
  18095. },
  18096. url: "/projects/:project_id/columns"
  18097. },
  18098. createForAuthenticatedUser: {
  18099. headers: {
  18100. accept: "application/vnd.github.inertia-preview+json"
  18101. },
  18102. method: "POST",
  18103. params: {
  18104. body: {
  18105. type: "string"
  18106. },
  18107. name: {
  18108. required: true,
  18109. type: "string"
  18110. }
  18111. },
  18112. url: "/user/projects"
  18113. },
  18114. createForOrg: {
  18115. headers: {
  18116. accept: "application/vnd.github.inertia-preview+json"
  18117. },
  18118. method: "POST",
  18119. params: {
  18120. body: {
  18121. type: "string"
  18122. },
  18123. name: {
  18124. required: true,
  18125. type: "string"
  18126. },
  18127. org: {
  18128. required: true,
  18129. type: "string"
  18130. }
  18131. },
  18132. url: "/orgs/:org/projects"
  18133. },
  18134. createForRepo: {
  18135. headers: {
  18136. accept: "application/vnd.github.inertia-preview+json"
  18137. },
  18138. method: "POST",
  18139. params: {
  18140. body: {
  18141. type: "string"
  18142. },
  18143. name: {
  18144. required: true,
  18145. type: "string"
  18146. },
  18147. owner: {
  18148. required: true,
  18149. type: "string"
  18150. },
  18151. repo: {
  18152. required: true,
  18153. type: "string"
  18154. }
  18155. },
  18156. url: "/repos/:owner/:repo/projects"
  18157. },
  18158. delete: {
  18159. headers: {
  18160. accept: "application/vnd.github.inertia-preview+json"
  18161. },
  18162. method: "DELETE",
  18163. params: {
  18164. project_id: {
  18165. required: true,
  18166. type: "integer"
  18167. }
  18168. },
  18169. url: "/projects/:project_id"
  18170. },
  18171. deleteCard: {
  18172. headers: {
  18173. accept: "application/vnd.github.inertia-preview+json"
  18174. },
  18175. method: "DELETE",
  18176. params: {
  18177. card_id: {
  18178. required: true,
  18179. type: "integer"
  18180. }
  18181. },
  18182. url: "/projects/columns/cards/:card_id"
  18183. },
  18184. deleteColumn: {
  18185. headers: {
  18186. accept: "application/vnd.github.inertia-preview+json"
  18187. },
  18188. method: "DELETE",
  18189. params: {
  18190. column_id: {
  18191. required: true,
  18192. type: "integer"
  18193. }
  18194. },
  18195. url: "/projects/columns/:column_id"
  18196. },
  18197. get: {
  18198. headers: {
  18199. accept: "application/vnd.github.inertia-preview+json"
  18200. },
  18201. method: "GET",
  18202. params: {
  18203. project_id: {
  18204. required: true,
  18205. type: "integer"
  18206. }
  18207. },
  18208. url: "/projects/:project_id"
  18209. },
  18210. getCard: {
  18211. headers: {
  18212. accept: "application/vnd.github.inertia-preview+json"
  18213. },
  18214. method: "GET",
  18215. params: {
  18216. card_id: {
  18217. required: true,
  18218. type: "integer"
  18219. }
  18220. },
  18221. url: "/projects/columns/cards/:card_id"
  18222. },
  18223. getColumn: {
  18224. headers: {
  18225. accept: "application/vnd.github.inertia-preview+json"
  18226. },
  18227. method: "GET",
  18228. params: {
  18229. column_id: {
  18230. required: true,
  18231. type: "integer"
  18232. }
  18233. },
  18234. url: "/projects/columns/:column_id"
  18235. },
  18236. listCards: {
  18237. headers: {
  18238. accept: "application/vnd.github.inertia-preview+json"
  18239. },
  18240. method: "GET",
  18241. params: {
  18242. archived_state: {
  18243. enum: ["all", "archived", "not_archived"],
  18244. type: "string"
  18245. },
  18246. column_id: {
  18247. required: true,
  18248. type: "integer"
  18249. },
  18250. page: {
  18251. type: "integer"
  18252. },
  18253. per_page: {
  18254. type: "integer"
  18255. }
  18256. },
  18257. url: "/projects/columns/:column_id/cards"
  18258. },
  18259. listCollaborators: {
  18260. headers: {
  18261. accept: "application/vnd.github.inertia-preview+json"
  18262. },
  18263. method: "GET",
  18264. params: {
  18265. affiliation: {
  18266. enum: ["outside", "direct", "all"],
  18267. type: "string"
  18268. },
  18269. page: {
  18270. type: "integer"
  18271. },
  18272. per_page: {
  18273. type: "integer"
  18274. },
  18275. project_id: {
  18276. required: true,
  18277. type: "integer"
  18278. }
  18279. },
  18280. url: "/projects/:project_id/collaborators"
  18281. },
  18282. listColumns: {
  18283. headers: {
  18284. accept: "application/vnd.github.inertia-preview+json"
  18285. },
  18286. method: "GET",
  18287. params: {
  18288. page: {
  18289. type: "integer"
  18290. },
  18291. per_page: {
  18292. type: "integer"
  18293. },
  18294. project_id: {
  18295. required: true,
  18296. type: "integer"
  18297. }
  18298. },
  18299. url: "/projects/:project_id/columns"
  18300. },
  18301. listForOrg: {
  18302. headers: {
  18303. accept: "application/vnd.github.inertia-preview+json"
  18304. },
  18305. method: "GET",
  18306. params: {
  18307. org: {
  18308. required: true,
  18309. type: "string"
  18310. },
  18311. page: {
  18312. type: "integer"
  18313. },
  18314. per_page: {
  18315. type: "integer"
  18316. },
  18317. state: {
  18318. enum: ["open", "closed", "all"],
  18319. type: "string"
  18320. }
  18321. },
  18322. url: "/orgs/:org/projects"
  18323. },
  18324. listForRepo: {
  18325. headers: {
  18326. accept: "application/vnd.github.inertia-preview+json"
  18327. },
  18328. method: "GET",
  18329. params: {
  18330. owner: {
  18331. required: true,
  18332. type: "string"
  18333. },
  18334. page: {
  18335. type: "integer"
  18336. },
  18337. per_page: {
  18338. type: "integer"
  18339. },
  18340. repo: {
  18341. required: true,
  18342. type: "string"
  18343. },
  18344. state: {
  18345. enum: ["open", "closed", "all"],
  18346. type: "string"
  18347. }
  18348. },
  18349. url: "/repos/:owner/:repo/projects"
  18350. },
  18351. listForUser: {
  18352. headers: {
  18353. accept: "application/vnd.github.inertia-preview+json"
  18354. },
  18355. method: "GET",
  18356. params: {
  18357. page: {
  18358. type: "integer"
  18359. },
  18360. per_page: {
  18361. type: "integer"
  18362. },
  18363. state: {
  18364. enum: ["open", "closed", "all"],
  18365. type: "string"
  18366. },
  18367. username: {
  18368. required: true,
  18369. type: "string"
  18370. }
  18371. },
  18372. url: "/users/:username/projects"
  18373. },
  18374. moveCard: {
  18375. headers: {
  18376. accept: "application/vnd.github.inertia-preview+json"
  18377. },
  18378. method: "POST",
  18379. params: {
  18380. card_id: {
  18381. required: true,
  18382. type: "integer"
  18383. },
  18384. column_id: {
  18385. type: "integer"
  18386. },
  18387. position: {
  18388. required: true,
  18389. type: "string",
  18390. validation: "^(top|bottom|after:\\d+)$"
  18391. }
  18392. },
  18393. url: "/projects/columns/cards/:card_id/moves"
  18394. },
  18395. moveColumn: {
  18396. headers: {
  18397. accept: "application/vnd.github.inertia-preview+json"
  18398. },
  18399. method: "POST",
  18400. params: {
  18401. column_id: {
  18402. required: true,
  18403. type: "integer"
  18404. },
  18405. position: {
  18406. required: true,
  18407. type: "string",
  18408. validation: "^(first|last|after:\\d+)$"
  18409. }
  18410. },
  18411. url: "/projects/columns/:column_id/moves"
  18412. },
  18413. removeCollaborator: {
  18414. headers: {
  18415. accept: "application/vnd.github.inertia-preview+json"
  18416. },
  18417. method: "DELETE",
  18418. params: {
  18419. project_id: {
  18420. required: true,
  18421. type: "integer"
  18422. },
  18423. username: {
  18424. required: true,
  18425. type: "string"
  18426. }
  18427. },
  18428. url: "/projects/:project_id/collaborators/:username"
  18429. },
  18430. reviewUserPermissionLevel: {
  18431. headers: {
  18432. accept: "application/vnd.github.inertia-preview+json"
  18433. },
  18434. method: "GET",
  18435. params: {
  18436. project_id: {
  18437. required: true,
  18438. type: "integer"
  18439. },
  18440. username: {
  18441. required: true,
  18442. type: "string"
  18443. }
  18444. },
  18445. url: "/projects/:project_id/collaborators/:username/permission"
  18446. },
  18447. update: {
  18448. headers: {
  18449. accept: "application/vnd.github.inertia-preview+json"
  18450. },
  18451. method: "PATCH",
  18452. params: {
  18453. body: {
  18454. type: "string"
  18455. },
  18456. name: {
  18457. type: "string"
  18458. },
  18459. organization_permission: {
  18460. type: "string"
  18461. },
  18462. private: {
  18463. type: "boolean"
  18464. },
  18465. project_id: {
  18466. required: true,
  18467. type: "integer"
  18468. },
  18469. state: {
  18470. enum: ["open", "closed"],
  18471. type: "string"
  18472. }
  18473. },
  18474. url: "/projects/:project_id"
  18475. },
  18476. updateCard: {
  18477. headers: {
  18478. accept: "application/vnd.github.inertia-preview+json"
  18479. },
  18480. method: "PATCH",
  18481. params: {
  18482. archived: {
  18483. type: "boolean"
  18484. },
  18485. card_id: {
  18486. required: true,
  18487. type: "integer"
  18488. },
  18489. note: {
  18490. type: "string"
  18491. }
  18492. },
  18493. url: "/projects/columns/cards/:card_id"
  18494. },
  18495. updateColumn: {
  18496. headers: {
  18497. accept: "application/vnd.github.inertia-preview+json"
  18498. },
  18499. method: "PATCH",
  18500. params: {
  18501. column_id: {
  18502. required: true,
  18503. type: "integer"
  18504. },
  18505. name: {
  18506. required: true,
  18507. type: "string"
  18508. }
  18509. },
  18510. url: "/projects/columns/:column_id"
  18511. }
  18512. },
  18513. pulls: {
  18514. checkIfMerged: {
  18515. method: "GET",
  18516. params: {
  18517. number: {
  18518. alias: "pull_number",
  18519. deprecated: true,
  18520. type: "integer"
  18521. },
  18522. owner: {
  18523. required: true,
  18524. type: "string"
  18525. },
  18526. pull_number: {
  18527. required: true,
  18528. type: "integer"
  18529. },
  18530. repo: {
  18531. required: true,
  18532. type: "string"
  18533. }
  18534. },
  18535. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18536. },
  18537. create: {
  18538. method: "POST",
  18539. params: {
  18540. base: {
  18541. required: true,
  18542. type: "string"
  18543. },
  18544. body: {
  18545. type: "string"
  18546. },
  18547. draft: {
  18548. type: "boolean"
  18549. },
  18550. head: {
  18551. required: true,
  18552. type: "string"
  18553. },
  18554. maintainer_can_modify: {
  18555. type: "boolean"
  18556. },
  18557. owner: {
  18558. required: true,
  18559. type: "string"
  18560. },
  18561. repo: {
  18562. required: true,
  18563. type: "string"
  18564. },
  18565. title: {
  18566. required: true,
  18567. type: "string"
  18568. }
  18569. },
  18570. url: "/repos/:owner/:repo/pulls"
  18571. },
  18572. createComment: {
  18573. method: "POST",
  18574. params: {
  18575. body: {
  18576. required: true,
  18577. type: "string"
  18578. },
  18579. commit_id: {
  18580. required: true,
  18581. type: "string"
  18582. },
  18583. in_reply_to: {
  18584. deprecated: true,
  18585. 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.",
  18586. type: "integer"
  18587. },
  18588. line: {
  18589. type: "integer"
  18590. },
  18591. number: {
  18592. alias: "pull_number",
  18593. deprecated: true,
  18594. type: "integer"
  18595. },
  18596. owner: {
  18597. required: true,
  18598. type: "string"
  18599. },
  18600. path: {
  18601. required: true,
  18602. type: "string"
  18603. },
  18604. position: {
  18605. type: "integer"
  18606. },
  18607. pull_number: {
  18608. required: true,
  18609. type: "integer"
  18610. },
  18611. repo: {
  18612. required: true,
  18613. type: "string"
  18614. },
  18615. side: {
  18616. enum: ["LEFT", "RIGHT"],
  18617. type: "string"
  18618. },
  18619. start_line: {
  18620. type: "integer"
  18621. },
  18622. start_side: {
  18623. enum: ["LEFT", "RIGHT", "side"],
  18624. type: "string"
  18625. }
  18626. },
  18627. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18628. },
  18629. createCommentReply: {
  18630. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18631. method: "POST",
  18632. params: {
  18633. body: {
  18634. required: true,
  18635. type: "string"
  18636. },
  18637. commit_id: {
  18638. required: true,
  18639. type: "string"
  18640. },
  18641. in_reply_to: {
  18642. deprecated: true,
  18643. 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.",
  18644. type: "integer"
  18645. },
  18646. line: {
  18647. type: "integer"
  18648. },
  18649. number: {
  18650. alias: "pull_number",
  18651. deprecated: true,
  18652. type: "integer"
  18653. },
  18654. owner: {
  18655. required: true,
  18656. type: "string"
  18657. },
  18658. path: {
  18659. required: true,
  18660. type: "string"
  18661. },
  18662. position: {
  18663. type: "integer"
  18664. },
  18665. pull_number: {
  18666. required: true,
  18667. type: "integer"
  18668. },
  18669. repo: {
  18670. required: true,
  18671. type: "string"
  18672. },
  18673. side: {
  18674. enum: ["LEFT", "RIGHT"],
  18675. type: "string"
  18676. },
  18677. start_line: {
  18678. type: "integer"
  18679. },
  18680. start_side: {
  18681. enum: ["LEFT", "RIGHT", "side"],
  18682. type: "string"
  18683. }
  18684. },
  18685. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18686. },
  18687. createFromIssue: {
  18688. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18689. method: "POST",
  18690. params: {
  18691. base: {
  18692. required: true,
  18693. type: "string"
  18694. },
  18695. draft: {
  18696. type: "boolean"
  18697. },
  18698. head: {
  18699. required: true,
  18700. type: "string"
  18701. },
  18702. issue: {
  18703. required: true,
  18704. type: "integer"
  18705. },
  18706. maintainer_can_modify: {
  18707. type: "boolean"
  18708. },
  18709. owner: {
  18710. required: true,
  18711. type: "string"
  18712. },
  18713. repo: {
  18714. required: true,
  18715. type: "string"
  18716. }
  18717. },
  18718. url: "/repos/:owner/:repo/pulls"
  18719. },
  18720. createReview: {
  18721. method: "POST",
  18722. params: {
  18723. body: {
  18724. type: "string"
  18725. },
  18726. comments: {
  18727. type: "object[]"
  18728. },
  18729. "comments[].body": {
  18730. required: true,
  18731. type: "string"
  18732. },
  18733. "comments[].path": {
  18734. required: true,
  18735. type: "string"
  18736. },
  18737. "comments[].position": {
  18738. required: true,
  18739. type: "integer"
  18740. },
  18741. commit_id: {
  18742. type: "string"
  18743. },
  18744. event: {
  18745. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  18746. type: "string"
  18747. },
  18748. number: {
  18749. alias: "pull_number",
  18750. deprecated: true,
  18751. type: "integer"
  18752. },
  18753. owner: {
  18754. required: true,
  18755. type: "string"
  18756. },
  18757. pull_number: {
  18758. required: true,
  18759. type: "integer"
  18760. },
  18761. repo: {
  18762. required: true,
  18763. type: "string"
  18764. }
  18765. },
  18766. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  18767. },
  18768. createReviewCommentReply: {
  18769. method: "POST",
  18770. params: {
  18771. body: {
  18772. required: true,
  18773. type: "string"
  18774. },
  18775. comment_id: {
  18776. required: true,
  18777. type: "integer"
  18778. },
  18779. owner: {
  18780. required: true,
  18781. type: "string"
  18782. },
  18783. pull_number: {
  18784. required: true,
  18785. type: "integer"
  18786. },
  18787. repo: {
  18788. required: true,
  18789. type: "string"
  18790. }
  18791. },
  18792. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  18793. },
  18794. createReviewRequest: {
  18795. method: "POST",
  18796. params: {
  18797. number: {
  18798. alias: "pull_number",
  18799. deprecated: true,
  18800. type: "integer"
  18801. },
  18802. owner: {
  18803. required: true,
  18804. type: "string"
  18805. },
  18806. pull_number: {
  18807. required: true,
  18808. type: "integer"
  18809. },
  18810. repo: {
  18811. required: true,
  18812. type: "string"
  18813. },
  18814. reviewers: {
  18815. type: "string[]"
  18816. },
  18817. team_reviewers: {
  18818. type: "string[]"
  18819. }
  18820. },
  18821. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18822. },
  18823. deleteComment: {
  18824. method: "DELETE",
  18825. params: {
  18826. comment_id: {
  18827. required: true,
  18828. type: "integer"
  18829. },
  18830. owner: {
  18831. required: true,
  18832. type: "string"
  18833. },
  18834. repo: {
  18835. required: true,
  18836. type: "string"
  18837. }
  18838. },
  18839. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18840. },
  18841. deletePendingReview: {
  18842. method: "DELETE",
  18843. params: {
  18844. number: {
  18845. alias: "pull_number",
  18846. deprecated: true,
  18847. type: "integer"
  18848. },
  18849. owner: {
  18850. required: true,
  18851. type: "string"
  18852. },
  18853. pull_number: {
  18854. required: true,
  18855. type: "integer"
  18856. },
  18857. repo: {
  18858. required: true,
  18859. type: "string"
  18860. },
  18861. review_id: {
  18862. required: true,
  18863. type: "integer"
  18864. }
  18865. },
  18866. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  18867. },
  18868. deleteReviewRequest: {
  18869. method: "DELETE",
  18870. params: {
  18871. number: {
  18872. alias: "pull_number",
  18873. deprecated: true,
  18874. type: "integer"
  18875. },
  18876. owner: {
  18877. required: true,
  18878. type: "string"
  18879. },
  18880. pull_number: {
  18881. required: true,
  18882. type: "integer"
  18883. },
  18884. repo: {
  18885. required: true,
  18886. type: "string"
  18887. },
  18888. reviewers: {
  18889. type: "string[]"
  18890. },
  18891. team_reviewers: {
  18892. type: "string[]"
  18893. }
  18894. },
  18895. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  18896. },
  18897. dismissReview: {
  18898. method: "PUT",
  18899. params: {
  18900. message: {
  18901. required: true,
  18902. type: "string"
  18903. },
  18904. number: {
  18905. alias: "pull_number",
  18906. deprecated: true,
  18907. type: "integer"
  18908. },
  18909. owner: {
  18910. required: true,
  18911. type: "string"
  18912. },
  18913. pull_number: {
  18914. required: true,
  18915. type: "integer"
  18916. },
  18917. repo: {
  18918. required: true,
  18919. type: "string"
  18920. },
  18921. review_id: {
  18922. required: true,
  18923. type: "integer"
  18924. }
  18925. },
  18926. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  18927. },
  18928. get: {
  18929. method: "GET",
  18930. params: {
  18931. number: {
  18932. alias: "pull_number",
  18933. deprecated: true,
  18934. type: "integer"
  18935. },
  18936. owner: {
  18937. required: true,
  18938. type: "string"
  18939. },
  18940. pull_number: {
  18941. required: true,
  18942. type: "integer"
  18943. },
  18944. repo: {
  18945. required: true,
  18946. type: "string"
  18947. }
  18948. },
  18949. url: "/repos/:owner/:repo/pulls/:pull_number"
  18950. },
  18951. getComment: {
  18952. method: "GET",
  18953. params: {
  18954. comment_id: {
  18955. required: true,
  18956. type: "integer"
  18957. },
  18958. owner: {
  18959. required: true,
  18960. type: "string"
  18961. },
  18962. repo: {
  18963. required: true,
  18964. type: "string"
  18965. }
  18966. },
  18967. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  18968. },
  18969. getCommentsForReview: {
  18970. method: "GET",
  18971. params: {
  18972. number: {
  18973. alias: "pull_number",
  18974. deprecated: true,
  18975. type: "integer"
  18976. },
  18977. owner: {
  18978. required: true,
  18979. type: "string"
  18980. },
  18981. page: {
  18982. type: "integer"
  18983. },
  18984. per_page: {
  18985. type: "integer"
  18986. },
  18987. pull_number: {
  18988. required: true,
  18989. type: "integer"
  18990. },
  18991. repo: {
  18992. required: true,
  18993. type: "string"
  18994. },
  18995. review_id: {
  18996. required: true,
  18997. type: "integer"
  18998. }
  18999. },
  19000. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  19001. },
  19002. getReview: {
  19003. method: "GET",
  19004. params: {
  19005. number: {
  19006. alias: "pull_number",
  19007. deprecated: true,
  19008. type: "integer"
  19009. },
  19010. owner: {
  19011. required: true,
  19012. type: "string"
  19013. },
  19014. pull_number: {
  19015. required: true,
  19016. type: "integer"
  19017. },
  19018. repo: {
  19019. required: true,
  19020. type: "string"
  19021. },
  19022. review_id: {
  19023. required: true,
  19024. type: "integer"
  19025. }
  19026. },
  19027. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19028. },
  19029. list: {
  19030. method: "GET",
  19031. params: {
  19032. base: {
  19033. type: "string"
  19034. },
  19035. direction: {
  19036. enum: ["asc", "desc"],
  19037. type: "string"
  19038. },
  19039. head: {
  19040. type: "string"
  19041. },
  19042. owner: {
  19043. required: true,
  19044. type: "string"
  19045. },
  19046. page: {
  19047. type: "integer"
  19048. },
  19049. per_page: {
  19050. type: "integer"
  19051. },
  19052. repo: {
  19053. required: true,
  19054. type: "string"
  19055. },
  19056. sort: {
  19057. enum: ["created", "updated", "popularity", "long-running"],
  19058. type: "string"
  19059. },
  19060. state: {
  19061. enum: ["open", "closed", "all"],
  19062. type: "string"
  19063. }
  19064. },
  19065. url: "/repos/:owner/:repo/pulls"
  19066. },
  19067. listComments: {
  19068. method: "GET",
  19069. params: {
  19070. direction: {
  19071. enum: ["asc", "desc"],
  19072. type: "string"
  19073. },
  19074. number: {
  19075. alias: "pull_number",
  19076. deprecated: true,
  19077. type: "integer"
  19078. },
  19079. owner: {
  19080. required: true,
  19081. type: "string"
  19082. },
  19083. page: {
  19084. type: "integer"
  19085. },
  19086. per_page: {
  19087. type: "integer"
  19088. },
  19089. pull_number: {
  19090. required: true,
  19091. type: "integer"
  19092. },
  19093. repo: {
  19094. required: true,
  19095. type: "string"
  19096. },
  19097. since: {
  19098. type: "string"
  19099. },
  19100. sort: {
  19101. enum: ["created", "updated"],
  19102. type: "string"
  19103. }
  19104. },
  19105. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19106. },
  19107. listCommentsForRepo: {
  19108. method: "GET",
  19109. params: {
  19110. direction: {
  19111. enum: ["asc", "desc"],
  19112. type: "string"
  19113. },
  19114. owner: {
  19115. required: true,
  19116. type: "string"
  19117. },
  19118. page: {
  19119. type: "integer"
  19120. },
  19121. per_page: {
  19122. type: "integer"
  19123. },
  19124. repo: {
  19125. required: true,
  19126. type: "string"
  19127. },
  19128. since: {
  19129. type: "string"
  19130. },
  19131. sort: {
  19132. enum: ["created", "updated"],
  19133. type: "string"
  19134. }
  19135. },
  19136. url: "/repos/:owner/:repo/pulls/comments"
  19137. },
  19138. listCommits: {
  19139. method: "GET",
  19140. params: {
  19141. number: {
  19142. alias: "pull_number",
  19143. deprecated: true,
  19144. type: "integer"
  19145. },
  19146. owner: {
  19147. required: true,
  19148. type: "string"
  19149. },
  19150. page: {
  19151. type: "integer"
  19152. },
  19153. per_page: {
  19154. type: "integer"
  19155. },
  19156. pull_number: {
  19157. required: true,
  19158. type: "integer"
  19159. },
  19160. repo: {
  19161. required: true,
  19162. type: "string"
  19163. }
  19164. },
  19165. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19166. },
  19167. listFiles: {
  19168. method: "GET",
  19169. params: {
  19170. number: {
  19171. alias: "pull_number",
  19172. deprecated: true,
  19173. type: "integer"
  19174. },
  19175. owner: {
  19176. required: true,
  19177. type: "string"
  19178. },
  19179. page: {
  19180. type: "integer"
  19181. },
  19182. per_page: {
  19183. type: "integer"
  19184. },
  19185. pull_number: {
  19186. required: true,
  19187. type: "integer"
  19188. },
  19189. repo: {
  19190. required: true,
  19191. type: "string"
  19192. }
  19193. },
  19194. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19195. },
  19196. listReviewRequests: {
  19197. method: "GET",
  19198. params: {
  19199. number: {
  19200. alias: "pull_number",
  19201. deprecated: true,
  19202. type: "integer"
  19203. },
  19204. owner: {
  19205. required: true,
  19206. type: "string"
  19207. },
  19208. page: {
  19209. type: "integer"
  19210. },
  19211. per_page: {
  19212. type: "integer"
  19213. },
  19214. pull_number: {
  19215. required: true,
  19216. type: "integer"
  19217. },
  19218. repo: {
  19219. required: true,
  19220. type: "string"
  19221. }
  19222. },
  19223. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19224. },
  19225. listReviews: {
  19226. method: "GET",
  19227. params: {
  19228. number: {
  19229. alias: "pull_number",
  19230. deprecated: true,
  19231. type: "integer"
  19232. },
  19233. owner: {
  19234. required: true,
  19235. type: "string"
  19236. },
  19237. page: {
  19238. type: "integer"
  19239. },
  19240. per_page: {
  19241. type: "integer"
  19242. },
  19243. pull_number: {
  19244. required: true,
  19245. type: "integer"
  19246. },
  19247. repo: {
  19248. required: true,
  19249. type: "string"
  19250. }
  19251. },
  19252. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19253. },
  19254. merge: {
  19255. method: "PUT",
  19256. params: {
  19257. commit_message: {
  19258. type: "string"
  19259. },
  19260. commit_title: {
  19261. type: "string"
  19262. },
  19263. merge_method: {
  19264. enum: ["merge", "squash", "rebase"],
  19265. type: "string"
  19266. },
  19267. number: {
  19268. alias: "pull_number",
  19269. deprecated: true,
  19270. type: "integer"
  19271. },
  19272. owner: {
  19273. required: true,
  19274. type: "string"
  19275. },
  19276. pull_number: {
  19277. required: true,
  19278. type: "integer"
  19279. },
  19280. repo: {
  19281. required: true,
  19282. type: "string"
  19283. },
  19284. sha: {
  19285. type: "string"
  19286. }
  19287. },
  19288. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19289. },
  19290. submitReview: {
  19291. method: "POST",
  19292. params: {
  19293. body: {
  19294. type: "string"
  19295. },
  19296. event: {
  19297. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19298. required: true,
  19299. type: "string"
  19300. },
  19301. number: {
  19302. alias: "pull_number",
  19303. deprecated: true,
  19304. type: "integer"
  19305. },
  19306. owner: {
  19307. required: true,
  19308. type: "string"
  19309. },
  19310. pull_number: {
  19311. required: true,
  19312. type: "integer"
  19313. },
  19314. repo: {
  19315. required: true,
  19316. type: "string"
  19317. },
  19318. review_id: {
  19319. required: true,
  19320. type: "integer"
  19321. }
  19322. },
  19323. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19324. },
  19325. update: {
  19326. method: "PATCH",
  19327. params: {
  19328. base: {
  19329. type: "string"
  19330. },
  19331. body: {
  19332. type: "string"
  19333. },
  19334. maintainer_can_modify: {
  19335. type: "boolean"
  19336. },
  19337. number: {
  19338. alias: "pull_number",
  19339. deprecated: true,
  19340. type: "integer"
  19341. },
  19342. owner: {
  19343. required: true,
  19344. type: "string"
  19345. },
  19346. pull_number: {
  19347. required: true,
  19348. type: "integer"
  19349. },
  19350. repo: {
  19351. required: true,
  19352. type: "string"
  19353. },
  19354. state: {
  19355. enum: ["open", "closed"],
  19356. type: "string"
  19357. },
  19358. title: {
  19359. type: "string"
  19360. }
  19361. },
  19362. url: "/repos/:owner/:repo/pulls/:pull_number"
  19363. },
  19364. updateBranch: {
  19365. headers: {
  19366. accept: "application/vnd.github.lydian-preview+json"
  19367. },
  19368. method: "PUT",
  19369. params: {
  19370. expected_head_sha: {
  19371. type: "string"
  19372. },
  19373. owner: {
  19374. required: true,
  19375. type: "string"
  19376. },
  19377. pull_number: {
  19378. required: true,
  19379. type: "integer"
  19380. },
  19381. repo: {
  19382. required: true,
  19383. type: "string"
  19384. }
  19385. },
  19386. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19387. },
  19388. updateComment: {
  19389. method: "PATCH",
  19390. params: {
  19391. body: {
  19392. required: true,
  19393. type: "string"
  19394. },
  19395. comment_id: {
  19396. required: true,
  19397. type: "integer"
  19398. },
  19399. owner: {
  19400. required: true,
  19401. type: "string"
  19402. },
  19403. repo: {
  19404. required: true,
  19405. type: "string"
  19406. }
  19407. },
  19408. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19409. },
  19410. updateReview: {
  19411. method: "PUT",
  19412. params: {
  19413. body: {
  19414. required: true,
  19415. type: "string"
  19416. },
  19417. number: {
  19418. alias: "pull_number",
  19419. deprecated: true,
  19420. type: "integer"
  19421. },
  19422. owner: {
  19423. required: true,
  19424. type: "string"
  19425. },
  19426. pull_number: {
  19427. required: true,
  19428. type: "integer"
  19429. },
  19430. repo: {
  19431. required: true,
  19432. type: "string"
  19433. },
  19434. review_id: {
  19435. required: true,
  19436. type: "integer"
  19437. }
  19438. },
  19439. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19440. }
  19441. },
  19442. rateLimit: {
  19443. get: {
  19444. method: "GET",
  19445. params: {},
  19446. url: "/rate_limit"
  19447. }
  19448. },
  19449. reactions: {
  19450. createForCommitComment: {
  19451. headers: {
  19452. accept: "application/vnd.github.squirrel-girl-preview+json"
  19453. },
  19454. method: "POST",
  19455. params: {
  19456. comment_id: {
  19457. required: true,
  19458. type: "integer"
  19459. },
  19460. content: {
  19461. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19462. required: true,
  19463. type: "string"
  19464. },
  19465. owner: {
  19466. required: true,
  19467. type: "string"
  19468. },
  19469. repo: {
  19470. required: true,
  19471. type: "string"
  19472. }
  19473. },
  19474. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19475. },
  19476. createForIssue: {
  19477. headers: {
  19478. accept: "application/vnd.github.squirrel-girl-preview+json"
  19479. },
  19480. method: "POST",
  19481. params: {
  19482. content: {
  19483. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19484. required: true,
  19485. type: "string"
  19486. },
  19487. issue_number: {
  19488. required: true,
  19489. type: "integer"
  19490. },
  19491. number: {
  19492. alias: "issue_number",
  19493. deprecated: true,
  19494. type: "integer"
  19495. },
  19496. owner: {
  19497. required: true,
  19498. type: "string"
  19499. },
  19500. repo: {
  19501. required: true,
  19502. type: "string"
  19503. }
  19504. },
  19505. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19506. },
  19507. createForIssueComment: {
  19508. headers: {
  19509. accept: "application/vnd.github.squirrel-girl-preview+json"
  19510. },
  19511. method: "POST",
  19512. params: {
  19513. comment_id: {
  19514. required: true,
  19515. type: "integer"
  19516. },
  19517. content: {
  19518. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19519. required: true,
  19520. type: "string"
  19521. },
  19522. owner: {
  19523. required: true,
  19524. type: "string"
  19525. },
  19526. repo: {
  19527. required: true,
  19528. type: "string"
  19529. }
  19530. },
  19531. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19532. },
  19533. createForPullRequestReviewComment: {
  19534. headers: {
  19535. accept: "application/vnd.github.squirrel-girl-preview+json"
  19536. },
  19537. method: "POST",
  19538. params: {
  19539. comment_id: {
  19540. required: true,
  19541. type: "integer"
  19542. },
  19543. content: {
  19544. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19545. required: true,
  19546. type: "string"
  19547. },
  19548. owner: {
  19549. required: true,
  19550. type: "string"
  19551. },
  19552. repo: {
  19553. required: true,
  19554. type: "string"
  19555. }
  19556. },
  19557. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19558. },
  19559. createForTeamDiscussion: {
  19560. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19561. headers: {
  19562. accept: "application/vnd.github.squirrel-girl-preview+json"
  19563. },
  19564. method: "POST",
  19565. params: {
  19566. content: {
  19567. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19568. required: true,
  19569. type: "string"
  19570. },
  19571. discussion_number: {
  19572. required: true,
  19573. type: "integer"
  19574. },
  19575. team_id: {
  19576. required: true,
  19577. type: "integer"
  19578. }
  19579. },
  19580. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19581. },
  19582. createForTeamDiscussionComment: {
  19583. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19584. headers: {
  19585. accept: "application/vnd.github.squirrel-girl-preview+json"
  19586. },
  19587. method: "POST",
  19588. params: {
  19589. comment_number: {
  19590. required: true,
  19591. type: "integer"
  19592. },
  19593. content: {
  19594. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19595. required: true,
  19596. type: "string"
  19597. },
  19598. discussion_number: {
  19599. required: true,
  19600. type: "integer"
  19601. },
  19602. team_id: {
  19603. required: true,
  19604. type: "integer"
  19605. }
  19606. },
  19607. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19608. },
  19609. createForTeamDiscussionCommentInOrg: {
  19610. headers: {
  19611. accept: "application/vnd.github.squirrel-girl-preview+json"
  19612. },
  19613. method: "POST",
  19614. params: {
  19615. comment_number: {
  19616. required: true,
  19617. type: "integer"
  19618. },
  19619. content: {
  19620. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19621. required: true,
  19622. type: "string"
  19623. },
  19624. discussion_number: {
  19625. required: true,
  19626. type: "integer"
  19627. },
  19628. org: {
  19629. required: true,
  19630. type: "string"
  19631. },
  19632. team_slug: {
  19633. required: true,
  19634. type: "string"
  19635. }
  19636. },
  19637. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19638. },
  19639. createForTeamDiscussionCommentLegacy: {
  19640. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19641. headers: {
  19642. accept: "application/vnd.github.squirrel-girl-preview+json"
  19643. },
  19644. method: "POST",
  19645. params: {
  19646. comment_number: {
  19647. required: true,
  19648. type: "integer"
  19649. },
  19650. content: {
  19651. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19652. required: true,
  19653. type: "string"
  19654. },
  19655. discussion_number: {
  19656. required: true,
  19657. type: "integer"
  19658. },
  19659. team_id: {
  19660. required: true,
  19661. type: "integer"
  19662. }
  19663. },
  19664. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19665. },
  19666. createForTeamDiscussionInOrg: {
  19667. headers: {
  19668. accept: "application/vnd.github.squirrel-girl-preview+json"
  19669. },
  19670. method: "POST",
  19671. params: {
  19672. content: {
  19673. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19674. required: true,
  19675. type: "string"
  19676. },
  19677. discussion_number: {
  19678. required: true,
  19679. type: "integer"
  19680. },
  19681. org: {
  19682. required: true,
  19683. type: "string"
  19684. },
  19685. team_slug: {
  19686. required: true,
  19687. type: "string"
  19688. }
  19689. },
  19690. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19691. },
  19692. createForTeamDiscussionLegacy: {
  19693. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  19694. headers: {
  19695. accept: "application/vnd.github.squirrel-girl-preview+json"
  19696. },
  19697. method: "POST",
  19698. params: {
  19699. content: {
  19700. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19701. required: true,
  19702. type: "string"
  19703. },
  19704. discussion_number: {
  19705. required: true,
  19706. type: "integer"
  19707. },
  19708. team_id: {
  19709. required: true,
  19710. type: "integer"
  19711. }
  19712. },
  19713. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19714. },
  19715. delete: {
  19716. headers: {
  19717. accept: "application/vnd.github.squirrel-girl-preview+json"
  19718. },
  19719. method: "DELETE",
  19720. params: {
  19721. reaction_id: {
  19722. required: true,
  19723. type: "integer"
  19724. }
  19725. },
  19726. url: "/reactions/:reaction_id"
  19727. },
  19728. listForCommitComment: {
  19729. headers: {
  19730. accept: "application/vnd.github.squirrel-girl-preview+json"
  19731. },
  19732. method: "GET",
  19733. params: {
  19734. comment_id: {
  19735. required: true,
  19736. type: "integer"
  19737. },
  19738. content: {
  19739. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19740. type: "string"
  19741. },
  19742. owner: {
  19743. required: true,
  19744. type: "string"
  19745. },
  19746. page: {
  19747. type: "integer"
  19748. },
  19749. per_page: {
  19750. type: "integer"
  19751. },
  19752. repo: {
  19753. required: true,
  19754. type: "string"
  19755. }
  19756. },
  19757. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19758. },
  19759. listForIssue: {
  19760. headers: {
  19761. accept: "application/vnd.github.squirrel-girl-preview+json"
  19762. },
  19763. method: "GET",
  19764. params: {
  19765. content: {
  19766. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19767. type: "string"
  19768. },
  19769. issue_number: {
  19770. required: true,
  19771. type: "integer"
  19772. },
  19773. number: {
  19774. alias: "issue_number",
  19775. deprecated: true,
  19776. type: "integer"
  19777. },
  19778. owner: {
  19779. required: true,
  19780. type: "string"
  19781. },
  19782. page: {
  19783. type: "integer"
  19784. },
  19785. per_page: {
  19786. type: "integer"
  19787. },
  19788. repo: {
  19789. required: true,
  19790. type: "string"
  19791. }
  19792. },
  19793. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19794. },
  19795. listForIssueComment: {
  19796. headers: {
  19797. accept: "application/vnd.github.squirrel-girl-preview+json"
  19798. },
  19799. method: "GET",
  19800. params: {
  19801. comment_id: {
  19802. required: true,
  19803. type: "integer"
  19804. },
  19805. content: {
  19806. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19807. type: "string"
  19808. },
  19809. owner: {
  19810. required: true,
  19811. type: "string"
  19812. },
  19813. page: {
  19814. type: "integer"
  19815. },
  19816. per_page: {
  19817. type: "integer"
  19818. },
  19819. repo: {
  19820. required: true,
  19821. type: "string"
  19822. }
  19823. },
  19824. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19825. },
  19826. listForPullRequestReviewComment: {
  19827. headers: {
  19828. accept: "application/vnd.github.squirrel-girl-preview+json"
  19829. },
  19830. method: "GET",
  19831. params: {
  19832. comment_id: {
  19833. required: true,
  19834. type: "integer"
  19835. },
  19836. content: {
  19837. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19838. type: "string"
  19839. },
  19840. owner: {
  19841. required: true,
  19842. type: "string"
  19843. },
  19844. page: {
  19845. type: "integer"
  19846. },
  19847. per_page: {
  19848. type: "integer"
  19849. },
  19850. repo: {
  19851. required: true,
  19852. type: "string"
  19853. }
  19854. },
  19855. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19856. },
  19857. listForTeamDiscussion: {
  19858. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  19859. headers: {
  19860. accept: "application/vnd.github.squirrel-girl-preview+json"
  19861. },
  19862. method: "GET",
  19863. params: {
  19864. content: {
  19865. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19866. type: "string"
  19867. },
  19868. discussion_number: {
  19869. required: true,
  19870. type: "integer"
  19871. },
  19872. page: {
  19873. type: "integer"
  19874. },
  19875. per_page: {
  19876. type: "integer"
  19877. },
  19878. team_id: {
  19879. required: true,
  19880. type: "integer"
  19881. }
  19882. },
  19883. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19884. },
  19885. listForTeamDiscussionComment: {
  19886. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  19887. headers: {
  19888. accept: "application/vnd.github.squirrel-girl-preview+json"
  19889. },
  19890. method: "GET",
  19891. params: {
  19892. comment_number: {
  19893. required: true,
  19894. type: "integer"
  19895. },
  19896. content: {
  19897. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19898. type: "string"
  19899. },
  19900. discussion_number: {
  19901. required: true,
  19902. type: "integer"
  19903. },
  19904. page: {
  19905. type: "integer"
  19906. },
  19907. per_page: {
  19908. type: "integer"
  19909. },
  19910. team_id: {
  19911. required: true,
  19912. type: "integer"
  19913. }
  19914. },
  19915. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19916. },
  19917. listForTeamDiscussionCommentInOrg: {
  19918. headers: {
  19919. accept: "application/vnd.github.squirrel-girl-preview+json"
  19920. },
  19921. method: "GET",
  19922. params: {
  19923. comment_number: {
  19924. required: true,
  19925. type: "integer"
  19926. },
  19927. content: {
  19928. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19929. type: "string"
  19930. },
  19931. discussion_number: {
  19932. required: true,
  19933. type: "integer"
  19934. },
  19935. org: {
  19936. required: true,
  19937. type: "string"
  19938. },
  19939. page: {
  19940. type: "integer"
  19941. },
  19942. per_page: {
  19943. type: "integer"
  19944. },
  19945. team_slug: {
  19946. required: true,
  19947. type: "string"
  19948. }
  19949. },
  19950. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19951. },
  19952. listForTeamDiscussionCommentLegacy: {
  19953. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  19954. headers: {
  19955. accept: "application/vnd.github.squirrel-girl-preview+json"
  19956. },
  19957. method: "GET",
  19958. params: {
  19959. comment_number: {
  19960. required: true,
  19961. type: "integer"
  19962. },
  19963. content: {
  19964. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19965. type: "string"
  19966. },
  19967. discussion_number: {
  19968. required: true,
  19969. type: "integer"
  19970. },
  19971. page: {
  19972. type: "integer"
  19973. },
  19974. per_page: {
  19975. type: "integer"
  19976. },
  19977. team_id: {
  19978. required: true,
  19979. type: "integer"
  19980. }
  19981. },
  19982. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19983. },
  19984. listForTeamDiscussionInOrg: {
  19985. headers: {
  19986. accept: "application/vnd.github.squirrel-girl-preview+json"
  19987. },
  19988. method: "GET",
  19989. params: {
  19990. content: {
  19991. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19992. type: "string"
  19993. },
  19994. discussion_number: {
  19995. required: true,
  19996. type: "integer"
  19997. },
  19998. org: {
  19999. required: true,
  20000. type: "string"
  20001. },
  20002. page: {
  20003. type: "integer"
  20004. },
  20005. per_page: {
  20006. type: "integer"
  20007. },
  20008. team_slug: {
  20009. required: true,
  20010. type: "string"
  20011. }
  20012. },
  20013. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  20014. },
  20015. listForTeamDiscussionLegacy: {
  20016. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  20017. headers: {
  20018. accept: "application/vnd.github.squirrel-girl-preview+json"
  20019. },
  20020. method: "GET",
  20021. params: {
  20022. content: {
  20023. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20024. type: "string"
  20025. },
  20026. discussion_number: {
  20027. required: true,
  20028. type: "integer"
  20029. },
  20030. page: {
  20031. type: "integer"
  20032. },
  20033. per_page: {
  20034. type: "integer"
  20035. },
  20036. team_id: {
  20037. required: true,
  20038. type: "integer"
  20039. }
  20040. },
  20041. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20042. }
  20043. },
  20044. repos: {
  20045. acceptInvitation: {
  20046. method: "PATCH",
  20047. params: {
  20048. invitation_id: {
  20049. required: true,
  20050. type: "integer"
  20051. }
  20052. },
  20053. url: "/user/repository_invitations/:invitation_id"
  20054. },
  20055. addCollaborator: {
  20056. method: "PUT",
  20057. params: {
  20058. owner: {
  20059. required: true,
  20060. type: "string"
  20061. },
  20062. permission: {
  20063. enum: ["pull", "push", "admin"],
  20064. type: "string"
  20065. },
  20066. repo: {
  20067. required: true,
  20068. type: "string"
  20069. },
  20070. username: {
  20071. required: true,
  20072. type: "string"
  20073. }
  20074. },
  20075. url: "/repos/:owner/:repo/collaborators/:username"
  20076. },
  20077. addDeployKey: {
  20078. method: "POST",
  20079. params: {
  20080. key: {
  20081. required: true,
  20082. type: "string"
  20083. },
  20084. owner: {
  20085. required: true,
  20086. type: "string"
  20087. },
  20088. read_only: {
  20089. type: "boolean"
  20090. },
  20091. repo: {
  20092. required: true,
  20093. type: "string"
  20094. },
  20095. title: {
  20096. type: "string"
  20097. }
  20098. },
  20099. url: "/repos/:owner/:repo/keys"
  20100. },
  20101. addProtectedBranchAdminEnforcement: {
  20102. method: "POST",
  20103. params: {
  20104. branch: {
  20105. required: true,
  20106. type: "string"
  20107. },
  20108. owner: {
  20109. required: true,
  20110. type: "string"
  20111. },
  20112. repo: {
  20113. required: true,
  20114. type: "string"
  20115. }
  20116. },
  20117. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20118. },
  20119. addProtectedBranchAppRestrictions: {
  20120. method: "POST",
  20121. params: {
  20122. apps: {
  20123. mapTo: "data",
  20124. required: true,
  20125. type: "string[]"
  20126. },
  20127. branch: {
  20128. required: true,
  20129. type: "string"
  20130. },
  20131. owner: {
  20132. required: true,
  20133. type: "string"
  20134. },
  20135. repo: {
  20136. required: true,
  20137. type: "string"
  20138. }
  20139. },
  20140. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20141. },
  20142. addProtectedBranchRequiredSignatures: {
  20143. headers: {
  20144. accept: "application/vnd.github.zzzax-preview+json"
  20145. },
  20146. method: "POST",
  20147. params: {
  20148. branch: {
  20149. required: true,
  20150. type: "string"
  20151. },
  20152. owner: {
  20153. required: true,
  20154. type: "string"
  20155. },
  20156. repo: {
  20157. required: true,
  20158. type: "string"
  20159. }
  20160. },
  20161. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20162. },
  20163. addProtectedBranchRequiredStatusChecksContexts: {
  20164. method: "POST",
  20165. params: {
  20166. branch: {
  20167. required: true,
  20168. type: "string"
  20169. },
  20170. contexts: {
  20171. mapTo: "data",
  20172. required: true,
  20173. type: "string[]"
  20174. },
  20175. owner: {
  20176. required: true,
  20177. type: "string"
  20178. },
  20179. repo: {
  20180. required: true,
  20181. type: "string"
  20182. }
  20183. },
  20184. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20185. },
  20186. addProtectedBranchTeamRestrictions: {
  20187. method: "POST",
  20188. params: {
  20189. branch: {
  20190. required: true,
  20191. type: "string"
  20192. },
  20193. owner: {
  20194. required: true,
  20195. type: "string"
  20196. },
  20197. repo: {
  20198. required: true,
  20199. type: "string"
  20200. },
  20201. teams: {
  20202. mapTo: "data",
  20203. required: true,
  20204. type: "string[]"
  20205. }
  20206. },
  20207. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20208. },
  20209. addProtectedBranchUserRestrictions: {
  20210. method: "POST",
  20211. params: {
  20212. branch: {
  20213. required: true,
  20214. type: "string"
  20215. },
  20216. owner: {
  20217. required: true,
  20218. type: "string"
  20219. },
  20220. repo: {
  20221. required: true,
  20222. type: "string"
  20223. },
  20224. users: {
  20225. mapTo: "data",
  20226. required: true,
  20227. type: "string[]"
  20228. }
  20229. },
  20230. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20231. },
  20232. checkCollaborator: {
  20233. method: "GET",
  20234. params: {
  20235. owner: {
  20236. required: true,
  20237. type: "string"
  20238. },
  20239. repo: {
  20240. required: true,
  20241. type: "string"
  20242. },
  20243. username: {
  20244. required: true,
  20245. type: "string"
  20246. }
  20247. },
  20248. url: "/repos/:owner/:repo/collaborators/:username"
  20249. },
  20250. checkVulnerabilityAlerts: {
  20251. headers: {
  20252. accept: "application/vnd.github.dorian-preview+json"
  20253. },
  20254. method: "GET",
  20255. params: {
  20256. owner: {
  20257. required: true,
  20258. type: "string"
  20259. },
  20260. repo: {
  20261. required: true,
  20262. type: "string"
  20263. }
  20264. },
  20265. url: "/repos/:owner/:repo/vulnerability-alerts"
  20266. },
  20267. compareCommits: {
  20268. method: "GET",
  20269. params: {
  20270. base: {
  20271. required: true,
  20272. type: "string"
  20273. },
  20274. head: {
  20275. required: true,
  20276. type: "string"
  20277. },
  20278. owner: {
  20279. required: true,
  20280. type: "string"
  20281. },
  20282. repo: {
  20283. required: true,
  20284. type: "string"
  20285. }
  20286. },
  20287. url: "/repos/:owner/:repo/compare/:base...:head"
  20288. },
  20289. createCommitComment: {
  20290. method: "POST",
  20291. params: {
  20292. body: {
  20293. required: true,
  20294. type: "string"
  20295. },
  20296. commit_sha: {
  20297. required: true,
  20298. type: "string"
  20299. },
  20300. line: {
  20301. type: "integer"
  20302. },
  20303. owner: {
  20304. required: true,
  20305. type: "string"
  20306. },
  20307. path: {
  20308. type: "string"
  20309. },
  20310. position: {
  20311. type: "integer"
  20312. },
  20313. repo: {
  20314. required: true,
  20315. type: "string"
  20316. },
  20317. sha: {
  20318. alias: "commit_sha",
  20319. deprecated: true,
  20320. type: "string"
  20321. }
  20322. },
  20323. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20324. },
  20325. createDeployment: {
  20326. method: "POST",
  20327. params: {
  20328. auto_merge: {
  20329. type: "boolean"
  20330. },
  20331. description: {
  20332. type: "string"
  20333. },
  20334. environment: {
  20335. type: "string"
  20336. },
  20337. owner: {
  20338. required: true,
  20339. type: "string"
  20340. },
  20341. payload: {
  20342. type: "string"
  20343. },
  20344. production_environment: {
  20345. type: "boolean"
  20346. },
  20347. ref: {
  20348. required: true,
  20349. type: "string"
  20350. },
  20351. repo: {
  20352. required: true,
  20353. type: "string"
  20354. },
  20355. required_contexts: {
  20356. type: "string[]"
  20357. },
  20358. task: {
  20359. type: "string"
  20360. },
  20361. transient_environment: {
  20362. type: "boolean"
  20363. }
  20364. },
  20365. url: "/repos/:owner/:repo/deployments"
  20366. },
  20367. createDeploymentStatus: {
  20368. method: "POST",
  20369. params: {
  20370. auto_inactive: {
  20371. type: "boolean"
  20372. },
  20373. deployment_id: {
  20374. required: true,
  20375. type: "integer"
  20376. },
  20377. description: {
  20378. type: "string"
  20379. },
  20380. environment: {
  20381. enum: ["production", "staging", "qa"],
  20382. type: "string"
  20383. },
  20384. environment_url: {
  20385. type: "string"
  20386. },
  20387. log_url: {
  20388. type: "string"
  20389. },
  20390. owner: {
  20391. required: true,
  20392. type: "string"
  20393. },
  20394. repo: {
  20395. required: true,
  20396. type: "string"
  20397. },
  20398. state: {
  20399. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20400. required: true,
  20401. type: "string"
  20402. },
  20403. target_url: {
  20404. type: "string"
  20405. }
  20406. },
  20407. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20408. },
  20409. createDispatchEvent: {
  20410. method: "POST",
  20411. params: {
  20412. client_payload: {
  20413. type: "object"
  20414. },
  20415. event_type: {
  20416. type: "string"
  20417. },
  20418. owner: {
  20419. required: true,
  20420. type: "string"
  20421. },
  20422. repo: {
  20423. required: true,
  20424. type: "string"
  20425. }
  20426. },
  20427. url: "/repos/:owner/:repo/dispatches"
  20428. },
  20429. createFile: {
  20430. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20431. method: "PUT",
  20432. params: {
  20433. author: {
  20434. type: "object"
  20435. },
  20436. "author.email": {
  20437. required: true,
  20438. type: "string"
  20439. },
  20440. "author.name": {
  20441. required: true,
  20442. type: "string"
  20443. },
  20444. branch: {
  20445. type: "string"
  20446. },
  20447. committer: {
  20448. type: "object"
  20449. },
  20450. "committer.email": {
  20451. required: true,
  20452. type: "string"
  20453. },
  20454. "committer.name": {
  20455. required: true,
  20456. type: "string"
  20457. },
  20458. content: {
  20459. required: true,
  20460. type: "string"
  20461. },
  20462. message: {
  20463. required: true,
  20464. type: "string"
  20465. },
  20466. owner: {
  20467. required: true,
  20468. type: "string"
  20469. },
  20470. path: {
  20471. required: true,
  20472. type: "string"
  20473. },
  20474. repo: {
  20475. required: true,
  20476. type: "string"
  20477. },
  20478. sha: {
  20479. type: "string"
  20480. }
  20481. },
  20482. url: "/repos/:owner/:repo/contents/:path"
  20483. },
  20484. createForAuthenticatedUser: {
  20485. method: "POST",
  20486. params: {
  20487. allow_merge_commit: {
  20488. type: "boolean"
  20489. },
  20490. allow_rebase_merge: {
  20491. type: "boolean"
  20492. },
  20493. allow_squash_merge: {
  20494. type: "boolean"
  20495. },
  20496. auto_init: {
  20497. type: "boolean"
  20498. },
  20499. delete_branch_on_merge: {
  20500. type: "boolean"
  20501. },
  20502. description: {
  20503. type: "string"
  20504. },
  20505. gitignore_template: {
  20506. type: "string"
  20507. },
  20508. has_issues: {
  20509. type: "boolean"
  20510. },
  20511. has_projects: {
  20512. type: "boolean"
  20513. },
  20514. has_wiki: {
  20515. type: "boolean"
  20516. },
  20517. homepage: {
  20518. type: "string"
  20519. },
  20520. is_template: {
  20521. type: "boolean"
  20522. },
  20523. license_template: {
  20524. type: "string"
  20525. },
  20526. name: {
  20527. required: true,
  20528. type: "string"
  20529. },
  20530. private: {
  20531. type: "boolean"
  20532. },
  20533. team_id: {
  20534. type: "integer"
  20535. },
  20536. visibility: {
  20537. enum: ["public", "private", "visibility", "internal"],
  20538. type: "string"
  20539. }
  20540. },
  20541. url: "/user/repos"
  20542. },
  20543. createFork: {
  20544. method: "POST",
  20545. params: {
  20546. organization: {
  20547. type: "string"
  20548. },
  20549. owner: {
  20550. required: true,
  20551. type: "string"
  20552. },
  20553. repo: {
  20554. required: true,
  20555. type: "string"
  20556. }
  20557. },
  20558. url: "/repos/:owner/:repo/forks"
  20559. },
  20560. createHook: {
  20561. method: "POST",
  20562. params: {
  20563. active: {
  20564. type: "boolean"
  20565. },
  20566. config: {
  20567. required: true,
  20568. type: "object"
  20569. },
  20570. "config.content_type": {
  20571. type: "string"
  20572. },
  20573. "config.insecure_ssl": {
  20574. type: "string"
  20575. },
  20576. "config.secret": {
  20577. type: "string"
  20578. },
  20579. "config.url": {
  20580. required: true,
  20581. type: "string"
  20582. },
  20583. events: {
  20584. type: "string[]"
  20585. },
  20586. name: {
  20587. type: "string"
  20588. },
  20589. owner: {
  20590. required: true,
  20591. type: "string"
  20592. },
  20593. repo: {
  20594. required: true,
  20595. type: "string"
  20596. }
  20597. },
  20598. url: "/repos/:owner/:repo/hooks"
  20599. },
  20600. createInOrg: {
  20601. method: "POST",
  20602. params: {
  20603. allow_merge_commit: {
  20604. type: "boolean"
  20605. },
  20606. allow_rebase_merge: {
  20607. type: "boolean"
  20608. },
  20609. allow_squash_merge: {
  20610. type: "boolean"
  20611. },
  20612. auto_init: {
  20613. type: "boolean"
  20614. },
  20615. delete_branch_on_merge: {
  20616. type: "boolean"
  20617. },
  20618. description: {
  20619. type: "string"
  20620. },
  20621. gitignore_template: {
  20622. type: "string"
  20623. },
  20624. has_issues: {
  20625. type: "boolean"
  20626. },
  20627. has_projects: {
  20628. type: "boolean"
  20629. },
  20630. has_wiki: {
  20631. type: "boolean"
  20632. },
  20633. homepage: {
  20634. type: "string"
  20635. },
  20636. is_template: {
  20637. type: "boolean"
  20638. },
  20639. license_template: {
  20640. type: "string"
  20641. },
  20642. name: {
  20643. required: true,
  20644. type: "string"
  20645. },
  20646. org: {
  20647. required: true,
  20648. type: "string"
  20649. },
  20650. private: {
  20651. type: "boolean"
  20652. },
  20653. team_id: {
  20654. type: "integer"
  20655. },
  20656. visibility: {
  20657. enum: ["public", "private", "visibility", "internal"],
  20658. type: "string"
  20659. }
  20660. },
  20661. url: "/orgs/:org/repos"
  20662. },
  20663. createOrUpdateFile: {
  20664. method: "PUT",
  20665. params: {
  20666. author: {
  20667. type: "object"
  20668. },
  20669. "author.email": {
  20670. required: true,
  20671. type: "string"
  20672. },
  20673. "author.name": {
  20674. required: true,
  20675. type: "string"
  20676. },
  20677. branch: {
  20678. type: "string"
  20679. },
  20680. committer: {
  20681. type: "object"
  20682. },
  20683. "committer.email": {
  20684. required: true,
  20685. type: "string"
  20686. },
  20687. "committer.name": {
  20688. required: true,
  20689. type: "string"
  20690. },
  20691. content: {
  20692. required: true,
  20693. type: "string"
  20694. },
  20695. message: {
  20696. required: true,
  20697. type: "string"
  20698. },
  20699. owner: {
  20700. required: true,
  20701. type: "string"
  20702. },
  20703. path: {
  20704. required: true,
  20705. type: "string"
  20706. },
  20707. repo: {
  20708. required: true,
  20709. type: "string"
  20710. },
  20711. sha: {
  20712. type: "string"
  20713. }
  20714. },
  20715. url: "/repos/:owner/:repo/contents/:path"
  20716. },
  20717. createRelease: {
  20718. method: "POST",
  20719. params: {
  20720. body: {
  20721. type: "string"
  20722. },
  20723. draft: {
  20724. type: "boolean"
  20725. },
  20726. name: {
  20727. type: "string"
  20728. },
  20729. owner: {
  20730. required: true,
  20731. type: "string"
  20732. },
  20733. prerelease: {
  20734. type: "boolean"
  20735. },
  20736. repo: {
  20737. required: true,
  20738. type: "string"
  20739. },
  20740. tag_name: {
  20741. required: true,
  20742. type: "string"
  20743. },
  20744. target_commitish: {
  20745. type: "string"
  20746. }
  20747. },
  20748. url: "/repos/:owner/:repo/releases"
  20749. },
  20750. createStatus: {
  20751. method: "POST",
  20752. params: {
  20753. context: {
  20754. type: "string"
  20755. },
  20756. description: {
  20757. type: "string"
  20758. },
  20759. owner: {
  20760. required: true,
  20761. type: "string"
  20762. },
  20763. repo: {
  20764. required: true,
  20765. type: "string"
  20766. },
  20767. sha: {
  20768. required: true,
  20769. type: "string"
  20770. },
  20771. state: {
  20772. enum: ["error", "failure", "pending", "success"],
  20773. required: true,
  20774. type: "string"
  20775. },
  20776. target_url: {
  20777. type: "string"
  20778. }
  20779. },
  20780. url: "/repos/:owner/:repo/statuses/:sha"
  20781. },
  20782. createUsingTemplate: {
  20783. headers: {
  20784. accept: "application/vnd.github.baptiste-preview+json"
  20785. },
  20786. method: "POST",
  20787. params: {
  20788. description: {
  20789. type: "string"
  20790. },
  20791. name: {
  20792. required: true,
  20793. type: "string"
  20794. },
  20795. owner: {
  20796. type: "string"
  20797. },
  20798. private: {
  20799. type: "boolean"
  20800. },
  20801. template_owner: {
  20802. required: true,
  20803. type: "string"
  20804. },
  20805. template_repo: {
  20806. required: true,
  20807. type: "string"
  20808. }
  20809. },
  20810. url: "/repos/:template_owner/:template_repo/generate"
  20811. },
  20812. declineInvitation: {
  20813. method: "DELETE",
  20814. params: {
  20815. invitation_id: {
  20816. required: true,
  20817. type: "integer"
  20818. }
  20819. },
  20820. url: "/user/repository_invitations/:invitation_id"
  20821. },
  20822. delete: {
  20823. method: "DELETE",
  20824. params: {
  20825. owner: {
  20826. required: true,
  20827. type: "string"
  20828. },
  20829. repo: {
  20830. required: true,
  20831. type: "string"
  20832. }
  20833. },
  20834. url: "/repos/:owner/:repo"
  20835. },
  20836. deleteCommitComment: {
  20837. method: "DELETE",
  20838. params: {
  20839. comment_id: {
  20840. required: true,
  20841. type: "integer"
  20842. },
  20843. owner: {
  20844. required: true,
  20845. type: "string"
  20846. },
  20847. repo: {
  20848. required: true,
  20849. type: "string"
  20850. }
  20851. },
  20852. url: "/repos/:owner/:repo/comments/:comment_id"
  20853. },
  20854. deleteDownload: {
  20855. method: "DELETE",
  20856. params: {
  20857. download_id: {
  20858. required: true,
  20859. type: "integer"
  20860. },
  20861. owner: {
  20862. required: true,
  20863. type: "string"
  20864. },
  20865. repo: {
  20866. required: true,
  20867. type: "string"
  20868. }
  20869. },
  20870. url: "/repos/:owner/:repo/downloads/:download_id"
  20871. },
  20872. deleteFile: {
  20873. method: "DELETE",
  20874. params: {
  20875. author: {
  20876. type: "object"
  20877. },
  20878. "author.email": {
  20879. type: "string"
  20880. },
  20881. "author.name": {
  20882. type: "string"
  20883. },
  20884. branch: {
  20885. type: "string"
  20886. },
  20887. committer: {
  20888. type: "object"
  20889. },
  20890. "committer.email": {
  20891. type: "string"
  20892. },
  20893. "committer.name": {
  20894. type: "string"
  20895. },
  20896. message: {
  20897. required: true,
  20898. type: "string"
  20899. },
  20900. owner: {
  20901. required: true,
  20902. type: "string"
  20903. },
  20904. path: {
  20905. required: true,
  20906. type: "string"
  20907. },
  20908. repo: {
  20909. required: true,
  20910. type: "string"
  20911. },
  20912. sha: {
  20913. required: true,
  20914. type: "string"
  20915. }
  20916. },
  20917. url: "/repos/:owner/:repo/contents/:path"
  20918. },
  20919. deleteHook: {
  20920. method: "DELETE",
  20921. params: {
  20922. hook_id: {
  20923. required: true,
  20924. type: "integer"
  20925. },
  20926. owner: {
  20927. required: true,
  20928. type: "string"
  20929. },
  20930. repo: {
  20931. required: true,
  20932. type: "string"
  20933. }
  20934. },
  20935. url: "/repos/:owner/:repo/hooks/:hook_id"
  20936. },
  20937. deleteInvitation: {
  20938. method: "DELETE",
  20939. params: {
  20940. invitation_id: {
  20941. required: true,
  20942. type: "integer"
  20943. },
  20944. owner: {
  20945. required: true,
  20946. type: "string"
  20947. },
  20948. repo: {
  20949. required: true,
  20950. type: "string"
  20951. }
  20952. },
  20953. url: "/repos/:owner/:repo/invitations/:invitation_id"
  20954. },
  20955. deleteRelease: {
  20956. method: "DELETE",
  20957. params: {
  20958. owner: {
  20959. required: true,
  20960. type: "string"
  20961. },
  20962. release_id: {
  20963. required: true,
  20964. type: "integer"
  20965. },
  20966. repo: {
  20967. required: true,
  20968. type: "string"
  20969. }
  20970. },
  20971. url: "/repos/:owner/:repo/releases/:release_id"
  20972. },
  20973. deleteReleaseAsset: {
  20974. method: "DELETE",
  20975. params: {
  20976. asset_id: {
  20977. required: true,
  20978. type: "integer"
  20979. },
  20980. owner: {
  20981. required: true,
  20982. type: "string"
  20983. },
  20984. repo: {
  20985. required: true,
  20986. type: "string"
  20987. }
  20988. },
  20989. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  20990. },
  20991. disableAutomatedSecurityFixes: {
  20992. headers: {
  20993. accept: "application/vnd.github.london-preview+json"
  20994. },
  20995. method: "DELETE",
  20996. params: {
  20997. owner: {
  20998. required: true,
  20999. type: "string"
  21000. },
  21001. repo: {
  21002. required: true,
  21003. type: "string"
  21004. }
  21005. },
  21006. url: "/repos/:owner/:repo/automated-security-fixes"
  21007. },
  21008. disablePagesSite: {
  21009. headers: {
  21010. accept: "application/vnd.github.switcheroo-preview+json"
  21011. },
  21012. method: "DELETE",
  21013. params: {
  21014. owner: {
  21015. required: true,
  21016. type: "string"
  21017. },
  21018. repo: {
  21019. required: true,
  21020. type: "string"
  21021. }
  21022. },
  21023. url: "/repos/:owner/:repo/pages"
  21024. },
  21025. disableVulnerabilityAlerts: {
  21026. headers: {
  21027. accept: "application/vnd.github.dorian-preview+json"
  21028. },
  21029. method: "DELETE",
  21030. params: {
  21031. owner: {
  21032. required: true,
  21033. type: "string"
  21034. },
  21035. repo: {
  21036. required: true,
  21037. type: "string"
  21038. }
  21039. },
  21040. url: "/repos/:owner/:repo/vulnerability-alerts"
  21041. },
  21042. enableAutomatedSecurityFixes: {
  21043. headers: {
  21044. accept: "application/vnd.github.london-preview+json"
  21045. },
  21046. method: "PUT",
  21047. params: {
  21048. owner: {
  21049. required: true,
  21050. type: "string"
  21051. },
  21052. repo: {
  21053. required: true,
  21054. type: "string"
  21055. }
  21056. },
  21057. url: "/repos/:owner/:repo/automated-security-fixes"
  21058. },
  21059. enablePagesSite: {
  21060. headers: {
  21061. accept: "application/vnd.github.switcheroo-preview+json"
  21062. },
  21063. method: "POST",
  21064. params: {
  21065. owner: {
  21066. required: true,
  21067. type: "string"
  21068. },
  21069. repo: {
  21070. required: true,
  21071. type: "string"
  21072. },
  21073. source: {
  21074. type: "object"
  21075. },
  21076. "source.branch": {
  21077. enum: ["master", "gh-pages"],
  21078. type: "string"
  21079. },
  21080. "source.path": {
  21081. type: "string"
  21082. }
  21083. },
  21084. url: "/repos/:owner/:repo/pages"
  21085. },
  21086. enableVulnerabilityAlerts: {
  21087. headers: {
  21088. accept: "application/vnd.github.dorian-preview+json"
  21089. },
  21090. method: "PUT",
  21091. params: {
  21092. owner: {
  21093. required: true,
  21094. type: "string"
  21095. },
  21096. repo: {
  21097. required: true,
  21098. type: "string"
  21099. }
  21100. },
  21101. url: "/repos/:owner/:repo/vulnerability-alerts"
  21102. },
  21103. get: {
  21104. method: "GET",
  21105. params: {
  21106. owner: {
  21107. required: true,
  21108. type: "string"
  21109. },
  21110. repo: {
  21111. required: true,
  21112. type: "string"
  21113. }
  21114. },
  21115. url: "/repos/:owner/:repo"
  21116. },
  21117. getAppsWithAccessToProtectedBranch: {
  21118. method: "GET",
  21119. params: {
  21120. branch: {
  21121. required: true,
  21122. type: "string"
  21123. },
  21124. owner: {
  21125. required: true,
  21126. type: "string"
  21127. },
  21128. repo: {
  21129. required: true,
  21130. type: "string"
  21131. }
  21132. },
  21133. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21134. },
  21135. getArchiveLink: {
  21136. method: "GET",
  21137. params: {
  21138. archive_format: {
  21139. required: true,
  21140. type: "string"
  21141. },
  21142. owner: {
  21143. required: true,
  21144. type: "string"
  21145. },
  21146. ref: {
  21147. required: true,
  21148. type: "string"
  21149. },
  21150. repo: {
  21151. required: true,
  21152. type: "string"
  21153. }
  21154. },
  21155. url: "/repos/:owner/:repo/:archive_format/:ref"
  21156. },
  21157. getBranch: {
  21158. method: "GET",
  21159. params: {
  21160. branch: {
  21161. required: true,
  21162. type: "string"
  21163. },
  21164. owner: {
  21165. required: true,
  21166. type: "string"
  21167. },
  21168. repo: {
  21169. required: true,
  21170. type: "string"
  21171. }
  21172. },
  21173. url: "/repos/:owner/:repo/branches/:branch"
  21174. },
  21175. getBranchProtection: {
  21176. method: "GET",
  21177. params: {
  21178. branch: {
  21179. required: true,
  21180. type: "string"
  21181. },
  21182. owner: {
  21183. required: true,
  21184. type: "string"
  21185. },
  21186. repo: {
  21187. required: true,
  21188. type: "string"
  21189. }
  21190. },
  21191. url: "/repos/:owner/:repo/branches/:branch/protection"
  21192. },
  21193. getClones: {
  21194. method: "GET",
  21195. params: {
  21196. owner: {
  21197. required: true,
  21198. type: "string"
  21199. },
  21200. per: {
  21201. enum: ["day", "week"],
  21202. type: "string"
  21203. },
  21204. repo: {
  21205. required: true,
  21206. type: "string"
  21207. }
  21208. },
  21209. url: "/repos/:owner/:repo/traffic/clones"
  21210. },
  21211. getCodeFrequencyStats: {
  21212. method: "GET",
  21213. params: {
  21214. owner: {
  21215. required: true,
  21216. type: "string"
  21217. },
  21218. repo: {
  21219. required: true,
  21220. type: "string"
  21221. }
  21222. },
  21223. url: "/repos/:owner/:repo/stats/code_frequency"
  21224. },
  21225. getCollaboratorPermissionLevel: {
  21226. method: "GET",
  21227. params: {
  21228. owner: {
  21229. required: true,
  21230. type: "string"
  21231. },
  21232. repo: {
  21233. required: true,
  21234. type: "string"
  21235. },
  21236. username: {
  21237. required: true,
  21238. type: "string"
  21239. }
  21240. },
  21241. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21242. },
  21243. getCombinedStatusForRef: {
  21244. method: "GET",
  21245. params: {
  21246. owner: {
  21247. required: true,
  21248. type: "string"
  21249. },
  21250. ref: {
  21251. required: true,
  21252. type: "string"
  21253. },
  21254. repo: {
  21255. required: true,
  21256. type: "string"
  21257. }
  21258. },
  21259. url: "/repos/:owner/:repo/commits/:ref/status"
  21260. },
  21261. getCommit: {
  21262. method: "GET",
  21263. params: {
  21264. commit_sha: {
  21265. alias: "ref",
  21266. deprecated: true,
  21267. type: "string"
  21268. },
  21269. owner: {
  21270. required: true,
  21271. type: "string"
  21272. },
  21273. ref: {
  21274. required: true,
  21275. type: "string"
  21276. },
  21277. repo: {
  21278. required: true,
  21279. type: "string"
  21280. },
  21281. sha: {
  21282. alias: "ref",
  21283. deprecated: true,
  21284. type: "string"
  21285. }
  21286. },
  21287. url: "/repos/:owner/:repo/commits/:ref"
  21288. },
  21289. getCommitActivityStats: {
  21290. method: "GET",
  21291. params: {
  21292. owner: {
  21293. required: true,
  21294. type: "string"
  21295. },
  21296. repo: {
  21297. required: true,
  21298. type: "string"
  21299. }
  21300. },
  21301. url: "/repos/:owner/:repo/stats/commit_activity"
  21302. },
  21303. getCommitComment: {
  21304. method: "GET",
  21305. params: {
  21306. comment_id: {
  21307. required: true,
  21308. type: "integer"
  21309. },
  21310. owner: {
  21311. required: true,
  21312. type: "string"
  21313. },
  21314. repo: {
  21315. required: true,
  21316. type: "string"
  21317. }
  21318. },
  21319. url: "/repos/:owner/:repo/comments/:comment_id"
  21320. },
  21321. getCommitRefSha: {
  21322. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21323. headers: {
  21324. accept: "application/vnd.github.v3.sha"
  21325. },
  21326. method: "GET",
  21327. params: {
  21328. owner: {
  21329. required: true,
  21330. type: "string"
  21331. },
  21332. ref: {
  21333. required: true,
  21334. type: "string"
  21335. },
  21336. repo: {
  21337. required: true,
  21338. type: "string"
  21339. }
  21340. },
  21341. url: "/repos/:owner/:repo/commits/:ref"
  21342. },
  21343. getContents: {
  21344. method: "GET",
  21345. params: {
  21346. owner: {
  21347. required: true,
  21348. type: "string"
  21349. },
  21350. path: {
  21351. required: true,
  21352. type: "string"
  21353. },
  21354. ref: {
  21355. type: "string"
  21356. },
  21357. repo: {
  21358. required: true,
  21359. type: "string"
  21360. }
  21361. },
  21362. url: "/repos/:owner/:repo/contents/:path"
  21363. },
  21364. getContributorsStats: {
  21365. method: "GET",
  21366. params: {
  21367. owner: {
  21368. required: true,
  21369. type: "string"
  21370. },
  21371. repo: {
  21372. required: true,
  21373. type: "string"
  21374. }
  21375. },
  21376. url: "/repos/:owner/:repo/stats/contributors"
  21377. },
  21378. getDeployKey: {
  21379. method: "GET",
  21380. params: {
  21381. key_id: {
  21382. required: true,
  21383. type: "integer"
  21384. },
  21385. owner: {
  21386. required: true,
  21387. type: "string"
  21388. },
  21389. repo: {
  21390. required: true,
  21391. type: "string"
  21392. }
  21393. },
  21394. url: "/repos/:owner/:repo/keys/:key_id"
  21395. },
  21396. getDeployment: {
  21397. method: "GET",
  21398. params: {
  21399. deployment_id: {
  21400. required: true,
  21401. type: "integer"
  21402. },
  21403. owner: {
  21404. required: true,
  21405. type: "string"
  21406. },
  21407. repo: {
  21408. required: true,
  21409. type: "string"
  21410. }
  21411. },
  21412. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21413. },
  21414. getDeploymentStatus: {
  21415. method: "GET",
  21416. params: {
  21417. deployment_id: {
  21418. required: true,
  21419. type: "integer"
  21420. },
  21421. owner: {
  21422. required: true,
  21423. type: "string"
  21424. },
  21425. repo: {
  21426. required: true,
  21427. type: "string"
  21428. },
  21429. status_id: {
  21430. required: true,
  21431. type: "integer"
  21432. }
  21433. },
  21434. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21435. },
  21436. getDownload: {
  21437. method: "GET",
  21438. params: {
  21439. download_id: {
  21440. required: true,
  21441. type: "integer"
  21442. },
  21443. owner: {
  21444. required: true,
  21445. type: "string"
  21446. },
  21447. repo: {
  21448. required: true,
  21449. type: "string"
  21450. }
  21451. },
  21452. url: "/repos/:owner/:repo/downloads/:download_id"
  21453. },
  21454. getHook: {
  21455. method: "GET",
  21456. params: {
  21457. hook_id: {
  21458. required: true,
  21459. type: "integer"
  21460. },
  21461. owner: {
  21462. required: true,
  21463. type: "string"
  21464. },
  21465. repo: {
  21466. required: true,
  21467. type: "string"
  21468. }
  21469. },
  21470. url: "/repos/:owner/:repo/hooks/:hook_id"
  21471. },
  21472. getLatestPagesBuild: {
  21473. method: "GET",
  21474. params: {
  21475. owner: {
  21476. required: true,
  21477. type: "string"
  21478. },
  21479. repo: {
  21480. required: true,
  21481. type: "string"
  21482. }
  21483. },
  21484. url: "/repos/:owner/:repo/pages/builds/latest"
  21485. },
  21486. getLatestRelease: {
  21487. method: "GET",
  21488. params: {
  21489. owner: {
  21490. required: true,
  21491. type: "string"
  21492. },
  21493. repo: {
  21494. required: true,
  21495. type: "string"
  21496. }
  21497. },
  21498. url: "/repos/:owner/:repo/releases/latest"
  21499. },
  21500. getPages: {
  21501. method: "GET",
  21502. params: {
  21503. owner: {
  21504. required: true,
  21505. type: "string"
  21506. },
  21507. repo: {
  21508. required: true,
  21509. type: "string"
  21510. }
  21511. },
  21512. url: "/repos/:owner/:repo/pages"
  21513. },
  21514. getPagesBuild: {
  21515. method: "GET",
  21516. params: {
  21517. build_id: {
  21518. required: true,
  21519. type: "integer"
  21520. },
  21521. owner: {
  21522. required: true,
  21523. type: "string"
  21524. },
  21525. repo: {
  21526. required: true,
  21527. type: "string"
  21528. }
  21529. },
  21530. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21531. },
  21532. getParticipationStats: {
  21533. method: "GET",
  21534. params: {
  21535. owner: {
  21536. required: true,
  21537. type: "string"
  21538. },
  21539. repo: {
  21540. required: true,
  21541. type: "string"
  21542. }
  21543. },
  21544. url: "/repos/:owner/:repo/stats/participation"
  21545. },
  21546. getProtectedBranchAdminEnforcement: {
  21547. method: "GET",
  21548. params: {
  21549. branch: {
  21550. required: true,
  21551. type: "string"
  21552. },
  21553. owner: {
  21554. required: true,
  21555. type: "string"
  21556. },
  21557. repo: {
  21558. required: true,
  21559. type: "string"
  21560. }
  21561. },
  21562. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21563. },
  21564. getProtectedBranchPullRequestReviewEnforcement: {
  21565. method: "GET",
  21566. params: {
  21567. branch: {
  21568. required: true,
  21569. type: "string"
  21570. },
  21571. owner: {
  21572. required: true,
  21573. type: "string"
  21574. },
  21575. repo: {
  21576. required: true,
  21577. type: "string"
  21578. }
  21579. },
  21580. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21581. },
  21582. getProtectedBranchRequiredSignatures: {
  21583. headers: {
  21584. accept: "application/vnd.github.zzzax-preview+json"
  21585. },
  21586. method: "GET",
  21587. params: {
  21588. branch: {
  21589. required: true,
  21590. type: "string"
  21591. },
  21592. owner: {
  21593. required: true,
  21594. type: "string"
  21595. },
  21596. repo: {
  21597. required: true,
  21598. type: "string"
  21599. }
  21600. },
  21601. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21602. },
  21603. getProtectedBranchRequiredStatusChecks: {
  21604. method: "GET",
  21605. params: {
  21606. branch: {
  21607. required: true,
  21608. type: "string"
  21609. },
  21610. owner: {
  21611. required: true,
  21612. type: "string"
  21613. },
  21614. repo: {
  21615. required: true,
  21616. type: "string"
  21617. }
  21618. },
  21619. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21620. },
  21621. getProtectedBranchRestrictions: {
  21622. method: "GET",
  21623. params: {
  21624. branch: {
  21625. required: true,
  21626. type: "string"
  21627. },
  21628. owner: {
  21629. required: true,
  21630. type: "string"
  21631. },
  21632. repo: {
  21633. required: true,
  21634. type: "string"
  21635. }
  21636. },
  21637. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21638. },
  21639. getPunchCardStats: {
  21640. method: "GET",
  21641. params: {
  21642. owner: {
  21643. required: true,
  21644. type: "string"
  21645. },
  21646. repo: {
  21647. required: true,
  21648. type: "string"
  21649. }
  21650. },
  21651. url: "/repos/:owner/:repo/stats/punch_card"
  21652. },
  21653. getReadme: {
  21654. method: "GET",
  21655. params: {
  21656. owner: {
  21657. required: true,
  21658. type: "string"
  21659. },
  21660. ref: {
  21661. type: "string"
  21662. },
  21663. repo: {
  21664. required: true,
  21665. type: "string"
  21666. }
  21667. },
  21668. url: "/repos/:owner/:repo/readme"
  21669. },
  21670. getRelease: {
  21671. method: "GET",
  21672. params: {
  21673. owner: {
  21674. required: true,
  21675. type: "string"
  21676. },
  21677. release_id: {
  21678. required: true,
  21679. type: "integer"
  21680. },
  21681. repo: {
  21682. required: true,
  21683. type: "string"
  21684. }
  21685. },
  21686. url: "/repos/:owner/:repo/releases/:release_id"
  21687. },
  21688. getReleaseAsset: {
  21689. method: "GET",
  21690. params: {
  21691. asset_id: {
  21692. required: true,
  21693. type: "integer"
  21694. },
  21695. owner: {
  21696. required: true,
  21697. type: "string"
  21698. },
  21699. repo: {
  21700. required: true,
  21701. type: "string"
  21702. }
  21703. },
  21704. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21705. },
  21706. getReleaseByTag: {
  21707. method: "GET",
  21708. params: {
  21709. owner: {
  21710. required: true,
  21711. type: "string"
  21712. },
  21713. repo: {
  21714. required: true,
  21715. type: "string"
  21716. },
  21717. tag: {
  21718. required: true,
  21719. type: "string"
  21720. }
  21721. },
  21722. url: "/repos/:owner/:repo/releases/tags/:tag"
  21723. },
  21724. getTeamsWithAccessToProtectedBranch: {
  21725. method: "GET",
  21726. params: {
  21727. branch: {
  21728. required: true,
  21729. type: "string"
  21730. },
  21731. owner: {
  21732. required: true,
  21733. type: "string"
  21734. },
  21735. repo: {
  21736. required: true,
  21737. type: "string"
  21738. }
  21739. },
  21740. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  21741. },
  21742. getTopPaths: {
  21743. method: "GET",
  21744. params: {
  21745. owner: {
  21746. required: true,
  21747. type: "string"
  21748. },
  21749. repo: {
  21750. required: true,
  21751. type: "string"
  21752. }
  21753. },
  21754. url: "/repos/:owner/:repo/traffic/popular/paths"
  21755. },
  21756. getTopReferrers: {
  21757. method: "GET",
  21758. params: {
  21759. owner: {
  21760. required: true,
  21761. type: "string"
  21762. },
  21763. repo: {
  21764. required: true,
  21765. type: "string"
  21766. }
  21767. },
  21768. url: "/repos/:owner/:repo/traffic/popular/referrers"
  21769. },
  21770. getUsersWithAccessToProtectedBranch: {
  21771. method: "GET",
  21772. params: {
  21773. branch: {
  21774. required: true,
  21775. type: "string"
  21776. },
  21777. owner: {
  21778. required: true,
  21779. type: "string"
  21780. },
  21781. repo: {
  21782. required: true,
  21783. type: "string"
  21784. }
  21785. },
  21786. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  21787. },
  21788. getViews: {
  21789. method: "GET",
  21790. params: {
  21791. owner: {
  21792. required: true,
  21793. type: "string"
  21794. },
  21795. per: {
  21796. enum: ["day", "week"],
  21797. type: "string"
  21798. },
  21799. repo: {
  21800. required: true,
  21801. type: "string"
  21802. }
  21803. },
  21804. url: "/repos/:owner/:repo/traffic/views"
  21805. },
  21806. list: {
  21807. method: "GET",
  21808. params: {
  21809. affiliation: {
  21810. type: "string"
  21811. },
  21812. direction: {
  21813. enum: ["asc", "desc"],
  21814. type: "string"
  21815. },
  21816. page: {
  21817. type: "integer"
  21818. },
  21819. per_page: {
  21820. type: "integer"
  21821. },
  21822. sort: {
  21823. enum: ["created", "updated", "pushed", "full_name"],
  21824. type: "string"
  21825. },
  21826. type: {
  21827. enum: ["all", "owner", "public", "private", "member"],
  21828. type: "string"
  21829. },
  21830. visibility: {
  21831. enum: ["all", "public", "private"],
  21832. type: "string"
  21833. }
  21834. },
  21835. url: "/user/repos"
  21836. },
  21837. listAppsWithAccessToProtectedBranch: {
  21838. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  21839. method: "GET",
  21840. params: {
  21841. branch: {
  21842. required: true,
  21843. type: "string"
  21844. },
  21845. owner: {
  21846. required: true,
  21847. type: "string"
  21848. },
  21849. repo: {
  21850. required: true,
  21851. type: "string"
  21852. }
  21853. },
  21854. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21855. },
  21856. listAssetsForRelease: {
  21857. method: "GET",
  21858. params: {
  21859. owner: {
  21860. required: true,
  21861. type: "string"
  21862. },
  21863. page: {
  21864. type: "integer"
  21865. },
  21866. per_page: {
  21867. type: "integer"
  21868. },
  21869. release_id: {
  21870. required: true,
  21871. type: "integer"
  21872. },
  21873. repo: {
  21874. required: true,
  21875. type: "string"
  21876. }
  21877. },
  21878. url: "/repos/:owner/:repo/releases/:release_id/assets"
  21879. },
  21880. listBranches: {
  21881. method: "GET",
  21882. params: {
  21883. owner: {
  21884. required: true,
  21885. type: "string"
  21886. },
  21887. page: {
  21888. type: "integer"
  21889. },
  21890. per_page: {
  21891. type: "integer"
  21892. },
  21893. protected: {
  21894. type: "boolean"
  21895. },
  21896. repo: {
  21897. required: true,
  21898. type: "string"
  21899. }
  21900. },
  21901. url: "/repos/:owner/:repo/branches"
  21902. },
  21903. listBranchesForHeadCommit: {
  21904. headers: {
  21905. accept: "application/vnd.github.groot-preview+json"
  21906. },
  21907. method: "GET",
  21908. params: {
  21909. commit_sha: {
  21910. required: true,
  21911. type: "string"
  21912. },
  21913. owner: {
  21914. required: true,
  21915. type: "string"
  21916. },
  21917. repo: {
  21918. required: true,
  21919. type: "string"
  21920. }
  21921. },
  21922. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  21923. },
  21924. listCollaborators: {
  21925. method: "GET",
  21926. params: {
  21927. affiliation: {
  21928. enum: ["outside", "direct", "all"],
  21929. type: "string"
  21930. },
  21931. owner: {
  21932. required: true,
  21933. type: "string"
  21934. },
  21935. page: {
  21936. type: "integer"
  21937. },
  21938. per_page: {
  21939. type: "integer"
  21940. },
  21941. repo: {
  21942. required: true,
  21943. type: "string"
  21944. }
  21945. },
  21946. url: "/repos/:owner/:repo/collaborators"
  21947. },
  21948. listCommentsForCommit: {
  21949. method: "GET",
  21950. params: {
  21951. commit_sha: {
  21952. required: true,
  21953. type: "string"
  21954. },
  21955. owner: {
  21956. required: true,
  21957. type: "string"
  21958. },
  21959. page: {
  21960. type: "integer"
  21961. },
  21962. per_page: {
  21963. type: "integer"
  21964. },
  21965. ref: {
  21966. alias: "commit_sha",
  21967. deprecated: true,
  21968. type: "string"
  21969. },
  21970. repo: {
  21971. required: true,
  21972. type: "string"
  21973. }
  21974. },
  21975. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  21976. },
  21977. listCommitComments: {
  21978. method: "GET",
  21979. params: {
  21980. owner: {
  21981. required: true,
  21982. type: "string"
  21983. },
  21984. page: {
  21985. type: "integer"
  21986. },
  21987. per_page: {
  21988. type: "integer"
  21989. },
  21990. repo: {
  21991. required: true,
  21992. type: "string"
  21993. }
  21994. },
  21995. url: "/repos/:owner/:repo/comments"
  21996. },
  21997. listCommits: {
  21998. method: "GET",
  21999. params: {
  22000. author: {
  22001. type: "string"
  22002. },
  22003. owner: {
  22004. required: true,
  22005. type: "string"
  22006. },
  22007. page: {
  22008. type: "integer"
  22009. },
  22010. path: {
  22011. type: "string"
  22012. },
  22013. per_page: {
  22014. type: "integer"
  22015. },
  22016. repo: {
  22017. required: true,
  22018. type: "string"
  22019. },
  22020. sha: {
  22021. type: "string"
  22022. },
  22023. since: {
  22024. type: "string"
  22025. },
  22026. until: {
  22027. type: "string"
  22028. }
  22029. },
  22030. url: "/repos/:owner/:repo/commits"
  22031. },
  22032. listContributors: {
  22033. method: "GET",
  22034. params: {
  22035. anon: {
  22036. type: "string"
  22037. },
  22038. owner: {
  22039. required: true,
  22040. type: "string"
  22041. },
  22042. page: {
  22043. type: "integer"
  22044. },
  22045. per_page: {
  22046. type: "integer"
  22047. },
  22048. repo: {
  22049. required: true,
  22050. type: "string"
  22051. }
  22052. },
  22053. url: "/repos/:owner/:repo/contributors"
  22054. },
  22055. listDeployKeys: {
  22056. method: "GET",
  22057. params: {
  22058. owner: {
  22059. required: true,
  22060. type: "string"
  22061. },
  22062. page: {
  22063. type: "integer"
  22064. },
  22065. per_page: {
  22066. type: "integer"
  22067. },
  22068. repo: {
  22069. required: true,
  22070. type: "string"
  22071. }
  22072. },
  22073. url: "/repos/:owner/:repo/keys"
  22074. },
  22075. listDeploymentStatuses: {
  22076. method: "GET",
  22077. params: {
  22078. deployment_id: {
  22079. required: true,
  22080. type: "integer"
  22081. },
  22082. owner: {
  22083. required: true,
  22084. type: "string"
  22085. },
  22086. page: {
  22087. type: "integer"
  22088. },
  22089. per_page: {
  22090. type: "integer"
  22091. },
  22092. repo: {
  22093. required: true,
  22094. type: "string"
  22095. }
  22096. },
  22097. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22098. },
  22099. listDeployments: {
  22100. method: "GET",
  22101. params: {
  22102. environment: {
  22103. type: "string"
  22104. },
  22105. owner: {
  22106. required: true,
  22107. type: "string"
  22108. },
  22109. page: {
  22110. type: "integer"
  22111. },
  22112. per_page: {
  22113. type: "integer"
  22114. },
  22115. ref: {
  22116. type: "string"
  22117. },
  22118. repo: {
  22119. required: true,
  22120. type: "string"
  22121. },
  22122. sha: {
  22123. type: "string"
  22124. },
  22125. task: {
  22126. type: "string"
  22127. }
  22128. },
  22129. url: "/repos/:owner/:repo/deployments"
  22130. },
  22131. listDownloads: {
  22132. method: "GET",
  22133. params: {
  22134. owner: {
  22135. required: true,
  22136. type: "string"
  22137. },
  22138. page: {
  22139. type: "integer"
  22140. },
  22141. per_page: {
  22142. type: "integer"
  22143. },
  22144. repo: {
  22145. required: true,
  22146. type: "string"
  22147. }
  22148. },
  22149. url: "/repos/:owner/:repo/downloads"
  22150. },
  22151. listForOrg: {
  22152. method: "GET",
  22153. params: {
  22154. direction: {
  22155. enum: ["asc", "desc"],
  22156. type: "string"
  22157. },
  22158. org: {
  22159. required: true,
  22160. type: "string"
  22161. },
  22162. page: {
  22163. type: "integer"
  22164. },
  22165. per_page: {
  22166. type: "integer"
  22167. },
  22168. sort: {
  22169. enum: ["created", "updated", "pushed", "full_name"],
  22170. type: "string"
  22171. },
  22172. type: {
  22173. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22174. type: "string"
  22175. }
  22176. },
  22177. url: "/orgs/:org/repos"
  22178. },
  22179. listForUser: {
  22180. method: "GET",
  22181. params: {
  22182. direction: {
  22183. enum: ["asc", "desc"],
  22184. type: "string"
  22185. },
  22186. page: {
  22187. type: "integer"
  22188. },
  22189. per_page: {
  22190. type: "integer"
  22191. },
  22192. sort: {
  22193. enum: ["created", "updated", "pushed", "full_name"],
  22194. type: "string"
  22195. },
  22196. type: {
  22197. enum: ["all", "owner", "member"],
  22198. type: "string"
  22199. },
  22200. username: {
  22201. required: true,
  22202. type: "string"
  22203. }
  22204. },
  22205. url: "/users/:username/repos"
  22206. },
  22207. listForks: {
  22208. method: "GET",
  22209. params: {
  22210. owner: {
  22211. required: true,
  22212. type: "string"
  22213. },
  22214. page: {
  22215. type: "integer"
  22216. },
  22217. per_page: {
  22218. type: "integer"
  22219. },
  22220. repo: {
  22221. required: true,
  22222. type: "string"
  22223. },
  22224. sort: {
  22225. enum: ["newest", "oldest", "stargazers"],
  22226. type: "string"
  22227. }
  22228. },
  22229. url: "/repos/:owner/:repo/forks"
  22230. },
  22231. listHooks: {
  22232. method: "GET",
  22233. params: {
  22234. owner: {
  22235. required: true,
  22236. type: "string"
  22237. },
  22238. page: {
  22239. type: "integer"
  22240. },
  22241. per_page: {
  22242. type: "integer"
  22243. },
  22244. repo: {
  22245. required: true,
  22246. type: "string"
  22247. }
  22248. },
  22249. url: "/repos/:owner/:repo/hooks"
  22250. },
  22251. listInvitations: {
  22252. method: "GET",
  22253. params: {
  22254. owner: {
  22255. required: true,
  22256. type: "string"
  22257. },
  22258. page: {
  22259. type: "integer"
  22260. },
  22261. per_page: {
  22262. type: "integer"
  22263. },
  22264. repo: {
  22265. required: true,
  22266. type: "string"
  22267. }
  22268. },
  22269. url: "/repos/:owner/:repo/invitations"
  22270. },
  22271. listInvitationsForAuthenticatedUser: {
  22272. method: "GET",
  22273. params: {
  22274. page: {
  22275. type: "integer"
  22276. },
  22277. per_page: {
  22278. type: "integer"
  22279. }
  22280. },
  22281. url: "/user/repository_invitations"
  22282. },
  22283. listLanguages: {
  22284. method: "GET",
  22285. params: {
  22286. owner: {
  22287. required: true,
  22288. type: "string"
  22289. },
  22290. repo: {
  22291. required: true,
  22292. type: "string"
  22293. }
  22294. },
  22295. url: "/repos/:owner/:repo/languages"
  22296. },
  22297. listPagesBuilds: {
  22298. method: "GET",
  22299. params: {
  22300. owner: {
  22301. required: true,
  22302. type: "string"
  22303. },
  22304. page: {
  22305. type: "integer"
  22306. },
  22307. per_page: {
  22308. type: "integer"
  22309. },
  22310. repo: {
  22311. required: true,
  22312. type: "string"
  22313. }
  22314. },
  22315. url: "/repos/:owner/:repo/pages/builds"
  22316. },
  22317. listProtectedBranchRequiredStatusChecksContexts: {
  22318. method: "GET",
  22319. params: {
  22320. branch: {
  22321. required: true,
  22322. type: "string"
  22323. },
  22324. owner: {
  22325. required: true,
  22326. type: "string"
  22327. },
  22328. repo: {
  22329. required: true,
  22330. type: "string"
  22331. }
  22332. },
  22333. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22334. },
  22335. listProtectedBranchTeamRestrictions: {
  22336. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22337. method: "GET",
  22338. params: {
  22339. branch: {
  22340. required: true,
  22341. type: "string"
  22342. },
  22343. owner: {
  22344. required: true,
  22345. type: "string"
  22346. },
  22347. repo: {
  22348. required: true,
  22349. type: "string"
  22350. }
  22351. },
  22352. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22353. },
  22354. listProtectedBranchUserRestrictions: {
  22355. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22356. method: "GET",
  22357. params: {
  22358. branch: {
  22359. required: true,
  22360. type: "string"
  22361. },
  22362. owner: {
  22363. required: true,
  22364. type: "string"
  22365. },
  22366. repo: {
  22367. required: true,
  22368. type: "string"
  22369. }
  22370. },
  22371. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22372. },
  22373. listPublic: {
  22374. method: "GET",
  22375. params: {
  22376. page: {
  22377. type: "integer"
  22378. },
  22379. per_page: {
  22380. type: "integer"
  22381. },
  22382. since: {
  22383. type: "integer"
  22384. }
  22385. },
  22386. url: "/repositories"
  22387. },
  22388. listPullRequestsAssociatedWithCommit: {
  22389. headers: {
  22390. accept: "application/vnd.github.groot-preview+json"
  22391. },
  22392. method: "GET",
  22393. params: {
  22394. commit_sha: {
  22395. required: true,
  22396. type: "string"
  22397. },
  22398. owner: {
  22399. required: true,
  22400. type: "string"
  22401. },
  22402. page: {
  22403. type: "integer"
  22404. },
  22405. per_page: {
  22406. type: "integer"
  22407. },
  22408. repo: {
  22409. required: true,
  22410. type: "string"
  22411. }
  22412. },
  22413. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22414. },
  22415. listReleases: {
  22416. method: "GET",
  22417. params: {
  22418. owner: {
  22419. required: true,
  22420. type: "string"
  22421. },
  22422. page: {
  22423. type: "integer"
  22424. },
  22425. per_page: {
  22426. type: "integer"
  22427. },
  22428. repo: {
  22429. required: true,
  22430. type: "string"
  22431. }
  22432. },
  22433. url: "/repos/:owner/:repo/releases"
  22434. },
  22435. listStatusesForRef: {
  22436. method: "GET",
  22437. params: {
  22438. owner: {
  22439. required: true,
  22440. type: "string"
  22441. },
  22442. page: {
  22443. type: "integer"
  22444. },
  22445. per_page: {
  22446. type: "integer"
  22447. },
  22448. ref: {
  22449. required: true,
  22450. type: "string"
  22451. },
  22452. repo: {
  22453. required: true,
  22454. type: "string"
  22455. }
  22456. },
  22457. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22458. },
  22459. listTags: {
  22460. method: "GET",
  22461. params: {
  22462. owner: {
  22463. required: true,
  22464. type: "string"
  22465. },
  22466. page: {
  22467. type: "integer"
  22468. },
  22469. per_page: {
  22470. type: "integer"
  22471. },
  22472. repo: {
  22473. required: true,
  22474. type: "string"
  22475. }
  22476. },
  22477. url: "/repos/:owner/:repo/tags"
  22478. },
  22479. listTeams: {
  22480. method: "GET",
  22481. params: {
  22482. owner: {
  22483. required: true,
  22484. type: "string"
  22485. },
  22486. page: {
  22487. type: "integer"
  22488. },
  22489. per_page: {
  22490. type: "integer"
  22491. },
  22492. repo: {
  22493. required: true,
  22494. type: "string"
  22495. }
  22496. },
  22497. url: "/repos/:owner/:repo/teams"
  22498. },
  22499. listTeamsWithAccessToProtectedBranch: {
  22500. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22501. method: "GET",
  22502. params: {
  22503. branch: {
  22504. required: true,
  22505. type: "string"
  22506. },
  22507. owner: {
  22508. required: true,
  22509. type: "string"
  22510. },
  22511. repo: {
  22512. required: true,
  22513. type: "string"
  22514. }
  22515. },
  22516. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22517. },
  22518. listTopics: {
  22519. headers: {
  22520. accept: "application/vnd.github.mercy-preview+json"
  22521. },
  22522. method: "GET",
  22523. params: {
  22524. owner: {
  22525. required: true,
  22526. type: "string"
  22527. },
  22528. repo: {
  22529. required: true,
  22530. type: "string"
  22531. }
  22532. },
  22533. url: "/repos/:owner/:repo/topics"
  22534. },
  22535. listUsersWithAccessToProtectedBranch: {
  22536. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22537. method: "GET",
  22538. params: {
  22539. branch: {
  22540. required: true,
  22541. type: "string"
  22542. },
  22543. owner: {
  22544. required: true,
  22545. type: "string"
  22546. },
  22547. repo: {
  22548. required: true,
  22549. type: "string"
  22550. }
  22551. },
  22552. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22553. },
  22554. merge: {
  22555. method: "POST",
  22556. params: {
  22557. base: {
  22558. required: true,
  22559. type: "string"
  22560. },
  22561. commit_message: {
  22562. type: "string"
  22563. },
  22564. head: {
  22565. required: true,
  22566. type: "string"
  22567. },
  22568. owner: {
  22569. required: true,
  22570. type: "string"
  22571. },
  22572. repo: {
  22573. required: true,
  22574. type: "string"
  22575. }
  22576. },
  22577. url: "/repos/:owner/:repo/merges"
  22578. },
  22579. pingHook: {
  22580. method: "POST",
  22581. params: {
  22582. hook_id: {
  22583. required: true,
  22584. type: "integer"
  22585. },
  22586. owner: {
  22587. required: true,
  22588. type: "string"
  22589. },
  22590. repo: {
  22591. required: true,
  22592. type: "string"
  22593. }
  22594. },
  22595. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22596. },
  22597. removeBranchProtection: {
  22598. method: "DELETE",
  22599. params: {
  22600. branch: {
  22601. required: true,
  22602. type: "string"
  22603. },
  22604. owner: {
  22605. required: true,
  22606. type: "string"
  22607. },
  22608. repo: {
  22609. required: true,
  22610. type: "string"
  22611. }
  22612. },
  22613. url: "/repos/:owner/:repo/branches/:branch/protection"
  22614. },
  22615. removeCollaborator: {
  22616. method: "DELETE",
  22617. params: {
  22618. owner: {
  22619. required: true,
  22620. type: "string"
  22621. },
  22622. repo: {
  22623. required: true,
  22624. type: "string"
  22625. },
  22626. username: {
  22627. required: true,
  22628. type: "string"
  22629. }
  22630. },
  22631. url: "/repos/:owner/:repo/collaborators/:username"
  22632. },
  22633. removeDeployKey: {
  22634. method: "DELETE",
  22635. params: {
  22636. key_id: {
  22637. required: true,
  22638. type: "integer"
  22639. },
  22640. owner: {
  22641. required: true,
  22642. type: "string"
  22643. },
  22644. repo: {
  22645. required: true,
  22646. type: "string"
  22647. }
  22648. },
  22649. url: "/repos/:owner/:repo/keys/:key_id"
  22650. },
  22651. removeProtectedBranchAdminEnforcement: {
  22652. method: "DELETE",
  22653. params: {
  22654. branch: {
  22655. required: true,
  22656. type: "string"
  22657. },
  22658. owner: {
  22659. required: true,
  22660. type: "string"
  22661. },
  22662. repo: {
  22663. required: true,
  22664. type: "string"
  22665. }
  22666. },
  22667. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22668. },
  22669. removeProtectedBranchAppRestrictions: {
  22670. method: "DELETE",
  22671. params: {
  22672. apps: {
  22673. mapTo: "data",
  22674. required: true,
  22675. type: "string[]"
  22676. },
  22677. branch: {
  22678. required: true,
  22679. type: "string"
  22680. },
  22681. owner: {
  22682. required: true,
  22683. type: "string"
  22684. },
  22685. repo: {
  22686. required: true,
  22687. type: "string"
  22688. }
  22689. },
  22690. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22691. },
  22692. removeProtectedBranchPullRequestReviewEnforcement: {
  22693. method: "DELETE",
  22694. params: {
  22695. branch: {
  22696. required: true,
  22697. type: "string"
  22698. },
  22699. owner: {
  22700. required: true,
  22701. type: "string"
  22702. },
  22703. repo: {
  22704. required: true,
  22705. type: "string"
  22706. }
  22707. },
  22708. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  22709. },
  22710. removeProtectedBranchRequiredSignatures: {
  22711. headers: {
  22712. accept: "application/vnd.github.zzzax-preview+json"
  22713. },
  22714. method: "DELETE",
  22715. params: {
  22716. branch: {
  22717. required: true,
  22718. type: "string"
  22719. },
  22720. owner: {
  22721. required: true,
  22722. type: "string"
  22723. },
  22724. repo: {
  22725. required: true,
  22726. type: "string"
  22727. }
  22728. },
  22729. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  22730. },
  22731. removeProtectedBranchRequiredStatusChecks: {
  22732. method: "DELETE",
  22733. params: {
  22734. branch: {
  22735. required: true,
  22736. type: "string"
  22737. },
  22738. owner: {
  22739. required: true,
  22740. type: "string"
  22741. },
  22742. repo: {
  22743. required: true,
  22744. type: "string"
  22745. }
  22746. },
  22747. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  22748. },
  22749. removeProtectedBranchRequiredStatusChecksContexts: {
  22750. method: "DELETE",
  22751. params: {
  22752. branch: {
  22753. required: true,
  22754. type: "string"
  22755. },
  22756. contexts: {
  22757. mapTo: "data",
  22758. required: true,
  22759. type: "string[]"
  22760. },
  22761. owner: {
  22762. required: true,
  22763. type: "string"
  22764. },
  22765. repo: {
  22766. required: true,
  22767. type: "string"
  22768. }
  22769. },
  22770. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22771. },
  22772. removeProtectedBranchRestrictions: {
  22773. method: "DELETE",
  22774. params: {
  22775. branch: {
  22776. required: true,
  22777. type: "string"
  22778. },
  22779. owner: {
  22780. required: true,
  22781. type: "string"
  22782. },
  22783. repo: {
  22784. required: true,
  22785. type: "string"
  22786. }
  22787. },
  22788. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  22789. },
  22790. removeProtectedBranchTeamRestrictions: {
  22791. method: "DELETE",
  22792. params: {
  22793. branch: {
  22794. required: true,
  22795. type: "string"
  22796. },
  22797. owner: {
  22798. required: true,
  22799. type: "string"
  22800. },
  22801. repo: {
  22802. required: true,
  22803. type: "string"
  22804. },
  22805. teams: {
  22806. mapTo: "data",
  22807. required: true,
  22808. type: "string[]"
  22809. }
  22810. },
  22811. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22812. },
  22813. removeProtectedBranchUserRestrictions: {
  22814. method: "DELETE",
  22815. params: {
  22816. branch: {
  22817. required: true,
  22818. type: "string"
  22819. },
  22820. owner: {
  22821. required: true,
  22822. type: "string"
  22823. },
  22824. repo: {
  22825. required: true,
  22826. type: "string"
  22827. },
  22828. users: {
  22829. mapTo: "data",
  22830. required: true,
  22831. type: "string[]"
  22832. }
  22833. },
  22834. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22835. },
  22836. replaceProtectedBranchAppRestrictions: {
  22837. method: "PUT",
  22838. params: {
  22839. apps: {
  22840. mapTo: "data",
  22841. required: true,
  22842. type: "string[]"
  22843. },
  22844. branch: {
  22845. required: true,
  22846. type: "string"
  22847. },
  22848. owner: {
  22849. required: true,
  22850. type: "string"
  22851. },
  22852. repo: {
  22853. required: true,
  22854. type: "string"
  22855. }
  22856. },
  22857. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22858. },
  22859. replaceProtectedBranchRequiredStatusChecksContexts: {
  22860. method: "PUT",
  22861. params: {
  22862. branch: {
  22863. required: true,
  22864. type: "string"
  22865. },
  22866. contexts: {
  22867. mapTo: "data",
  22868. required: true,
  22869. type: "string[]"
  22870. },
  22871. owner: {
  22872. required: true,
  22873. type: "string"
  22874. },
  22875. repo: {
  22876. required: true,
  22877. type: "string"
  22878. }
  22879. },
  22880. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22881. },
  22882. replaceProtectedBranchTeamRestrictions: {
  22883. method: "PUT",
  22884. params: {
  22885. branch: {
  22886. required: true,
  22887. type: "string"
  22888. },
  22889. owner: {
  22890. required: true,
  22891. type: "string"
  22892. },
  22893. repo: {
  22894. required: true,
  22895. type: "string"
  22896. },
  22897. teams: {
  22898. mapTo: "data",
  22899. required: true,
  22900. type: "string[]"
  22901. }
  22902. },
  22903. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22904. },
  22905. replaceProtectedBranchUserRestrictions: {
  22906. method: "PUT",
  22907. params: {
  22908. branch: {
  22909. required: true,
  22910. type: "string"
  22911. },
  22912. owner: {
  22913. required: true,
  22914. type: "string"
  22915. },
  22916. repo: {
  22917. required: true,
  22918. type: "string"
  22919. },
  22920. users: {
  22921. mapTo: "data",
  22922. required: true,
  22923. type: "string[]"
  22924. }
  22925. },
  22926. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22927. },
  22928. replaceTopics: {
  22929. headers: {
  22930. accept: "application/vnd.github.mercy-preview+json"
  22931. },
  22932. method: "PUT",
  22933. params: {
  22934. names: {
  22935. required: true,
  22936. type: "string[]"
  22937. },
  22938. owner: {
  22939. required: true,
  22940. type: "string"
  22941. },
  22942. repo: {
  22943. required: true,
  22944. type: "string"
  22945. }
  22946. },
  22947. url: "/repos/:owner/:repo/topics"
  22948. },
  22949. requestPageBuild: {
  22950. method: "POST",
  22951. params: {
  22952. owner: {
  22953. required: true,
  22954. type: "string"
  22955. },
  22956. repo: {
  22957. required: true,
  22958. type: "string"
  22959. }
  22960. },
  22961. url: "/repos/:owner/:repo/pages/builds"
  22962. },
  22963. retrieveCommunityProfileMetrics: {
  22964. method: "GET",
  22965. params: {
  22966. owner: {
  22967. required: true,
  22968. type: "string"
  22969. },
  22970. repo: {
  22971. required: true,
  22972. type: "string"
  22973. }
  22974. },
  22975. url: "/repos/:owner/:repo/community/profile"
  22976. },
  22977. testPushHook: {
  22978. method: "POST",
  22979. params: {
  22980. hook_id: {
  22981. required: true,
  22982. type: "integer"
  22983. },
  22984. owner: {
  22985. required: true,
  22986. type: "string"
  22987. },
  22988. repo: {
  22989. required: true,
  22990. type: "string"
  22991. }
  22992. },
  22993. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  22994. },
  22995. transfer: {
  22996. method: "POST",
  22997. params: {
  22998. new_owner: {
  22999. type: "string"
  23000. },
  23001. owner: {
  23002. required: true,
  23003. type: "string"
  23004. },
  23005. repo: {
  23006. required: true,
  23007. type: "string"
  23008. },
  23009. team_ids: {
  23010. type: "integer[]"
  23011. }
  23012. },
  23013. url: "/repos/:owner/:repo/transfer"
  23014. },
  23015. update: {
  23016. method: "PATCH",
  23017. params: {
  23018. allow_merge_commit: {
  23019. type: "boolean"
  23020. },
  23021. allow_rebase_merge: {
  23022. type: "boolean"
  23023. },
  23024. allow_squash_merge: {
  23025. type: "boolean"
  23026. },
  23027. archived: {
  23028. type: "boolean"
  23029. },
  23030. default_branch: {
  23031. type: "string"
  23032. },
  23033. delete_branch_on_merge: {
  23034. type: "boolean"
  23035. },
  23036. description: {
  23037. type: "string"
  23038. },
  23039. has_issues: {
  23040. type: "boolean"
  23041. },
  23042. has_projects: {
  23043. type: "boolean"
  23044. },
  23045. has_wiki: {
  23046. type: "boolean"
  23047. },
  23048. homepage: {
  23049. type: "string"
  23050. },
  23051. is_template: {
  23052. type: "boolean"
  23053. },
  23054. name: {
  23055. type: "string"
  23056. },
  23057. owner: {
  23058. required: true,
  23059. type: "string"
  23060. },
  23061. private: {
  23062. type: "boolean"
  23063. },
  23064. repo: {
  23065. required: true,
  23066. type: "string"
  23067. },
  23068. visibility: {
  23069. enum: ["public", "private", "visibility", "internal"],
  23070. type: "string"
  23071. }
  23072. },
  23073. url: "/repos/:owner/:repo"
  23074. },
  23075. updateBranchProtection: {
  23076. method: "PUT",
  23077. params: {
  23078. allow_deletions: {
  23079. type: "boolean"
  23080. },
  23081. allow_force_pushes: {
  23082. allowNull: true,
  23083. type: "boolean"
  23084. },
  23085. branch: {
  23086. required: true,
  23087. type: "string"
  23088. },
  23089. enforce_admins: {
  23090. allowNull: true,
  23091. required: true,
  23092. type: "boolean"
  23093. },
  23094. owner: {
  23095. required: true,
  23096. type: "string"
  23097. },
  23098. repo: {
  23099. required: true,
  23100. type: "string"
  23101. },
  23102. required_linear_history: {
  23103. type: "boolean"
  23104. },
  23105. required_pull_request_reviews: {
  23106. allowNull: true,
  23107. required: true,
  23108. type: "object"
  23109. },
  23110. "required_pull_request_reviews.dismiss_stale_reviews": {
  23111. type: "boolean"
  23112. },
  23113. "required_pull_request_reviews.dismissal_restrictions": {
  23114. type: "object"
  23115. },
  23116. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23117. type: "string[]"
  23118. },
  23119. "required_pull_request_reviews.dismissal_restrictions.users": {
  23120. type: "string[]"
  23121. },
  23122. "required_pull_request_reviews.require_code_owner_reviews": {
  23123. type: "boolean"
  23124. },
  23125. "required_pull_request_reviews.required_approving_review_count": {
  23126. type: "integer"
  23127. },
  23128. required_status_checks: {
  23129. allowNull: true,
  23130. required: true,
  23131. type: "object"
  23132. },
  23133. "required_status_checks.contexts": {
  23134. required: true,
  23135. type: "string[]"
  23136. },
  23137. "required_status_checks.strict": {
  23138. required: true,
  23139. type: "boolean"
  23140. },
  23141. restrictions: {
  23142. allowNull: true,
  23143. required: true,
  23144. type: "object"
  23145. },
  23146. "restrictions.apps": {
  23147. type: "string[]"
  23148. },
  23149. "restrictions.teams": {
  23150. required: true,
  23151. type: "string[]"
  23152. },
  23153. "restrictions.users": {
  23154. required: true,
  23155. type: "string[]"
  23156. }
  23157. },
  23158. url: "/repos/:owner/:repo/branches/:branch/protection"
  23159. },
  23160. updateCommitComment: {
  23161. method: "PATCH",
  23162. params: {
  23163. body: {
  23164. required: true,
  23165. type: "string"
  23166. },
  23167. comment_id: {
  23168. required: true,
  23169. type: "integer"
  23170. },
  23171. owner: {
  23172. required: true,
  23173. type: "string"
  23174. },
  23175. repo: {
  23176. required: true,
  23177. type: "string"
  23178. }
  23179. },
  23180. url: "/repos/:owner/:repo/comments/:comment_id"
  23181. },
  23182. updateFile: {
  23183. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23184. method: "PUT",
  23185. params: {
  23186. author: {
  23187. type: "object"
  23188. },
  23189. "author.email": {
  23190. required: true,
  23191. type: "string"
  23192. },
  23193. "author.name": {
  23194. required: true,
  23195. type: "string"
  23196. },
  23197. branch: {
  23198. type: "string"
  23199. },
  23200. committer: {
  23201. type: "object"
  23202. },
  23203. "committer.email": {
  23204. required: true,
  23205. type: "string"
  23206. },
  23207. "committer.name": {
  23208. required: true,
  23209. type: "string"
  23210. },
  23211. content: {
  23212. required: true,
  23213. type: "string"
  23214. },
  23215. message: {
  23216. required: true,
  23217. type: "string"
  23218. },
  23219. owner: {
  23220. required: true,
  23221. type: "string"
  23222. },
  23223. path: {
  23224. required: true,
  23225. type: "string"
  23226. },
  23227. repo: {
  23228. required: true,
  23229. type: "string"
  23230. },
  23231. sha: {
  23232. type: "string"
  23233. }
  23234. },
  23235. url: "/repos/:owner/:repo/contents/:path"
  23236. },
  23237. updateHook: {
  23238. method: "PATCH",
  23239. params: {
  23240. active: {
  23241. type: "boolean"
  23242. },
  23243. add_events: {
  23244. type: "string[]"
  23245. },
  23246. config: {
  23247. type: "object"
  23248. },
  23249. "config.content_type": {
  23250. type: "string"
  23251. },
  23252. "config.insecure_ssl": {
  23253. type: "string"
  23254. },
  23255. "config.secret": {
  23256. type: "string"
  23257. },
  23258. "config.url": {
  23259. required: true,
  23260. type: "string"
  23261. },
  23262. events: {
  23263. type: "string[]"
  23264. },
  23265. hook_id: {
  23266. required: true,
  23267. type: "integer"
  23268. },
  23269. owner: {
  23270. required: true,
  23271. type: "string"
  23272. },
  23273. remove_events: {
  23274. type: "string[]"
  23275. },
  23276. repo: {
  23277. required: true,
  23278. type: "string"
  23279. }
  23280. },
  23281. url: "/repos/:owner/:repo/hooks/:hook_id"
  23282. },
  23283. updateInformationAboutPagesSite: {
  23284. method: "PUT",
  23285. params: {
  23286. cname: {
  23287. type: "string"
  23288. },
  23289. owner: {
  23290. required: true,
  23291. type: "string"
  23292. },
  23293. repo: {
  23294. required: true,
  23295. type: "string"
  23296. },
  23297. source: {
  23298. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23299. type: "string"
  23300. }
  23301. },
  23302. url: "/repos/:owner/:repo/pages"
  23303. },
  23304. updateInvitation: {
  23305. method: "PATCH",
  23306. params: {
  23307. invitation_id: {
  23308. required: true,
  23309. type: "integer"
  23310. },
  23311. owner: {
  23312. required: true,
  23313. type: "string"
  23314. },
  23315. permissions: {
  23316. enum: ["read", "write", "admin"],
  23317. type: "string"
  23318. },
  23319. repo: {
  23320. required: true,
  23321. type: "string"
  23322. }
  23323. },
  23324. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23325. },
  23326. updateProtectedBranchPullRequestReviewEnforcement: {
  23327. method: "PATCH",
  23328. params: {
  23329. branch: {
  23330. required: true,
  23331. type: "string"
  23332. },
  23333. dismiss_stale_reviews: {
  23334. type: "boolean"
  23335. },
  23336. dismissal_restrictions: {
  23337. type: "object"
  23338. },
  23339. "dismissal_restrictions.teams": {
  23340. type: "string[]"
  23341. },
  23342. "dismissal_restrictions.users": {
  23343. type: "string[]"
  23344. },
  23345. owner: {
  23346. required: true,
  23347. type: "string"
  23348. },
  23349. repo: {
  23350. required: true,
  23351. type: "string"
  23352. },
  23353. require_code_owner_reviews: {
  23354. type: "boolean"
  23355. },
  23356. required_approving_review_count: {
  23357. type: "integer"
  23358. }
  23359. },
  23360. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23361. },
  23362. updateProtectedBranchRequiredStatusChecks: {
  23363. method: "PATCH",
  23364. params: {
  23365. branch: {
  23366. required: true,
  23367. type: "string"
  23368. },
  23369. contexts: {
  23370. type: "string[]"
  23371. },
  23372. owner: {
  23373. required: true,
  23374. type: "string"
  23375. },
  23376. repo: {
  23377. required: true,
  23378. type: "string"
  23379. },
  23380. strict: {
  23381. type: "boolean"
  23382. }
  23383. },
  23384. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23385. },
  23386. updateRelease: {
  23387. method: "PATCH",
  23388. params: {
  23389. body: {
  23390. type: "string"
  23391. },
  23392. draft: {
  23393. type: "boolean"
  23394. },
  23395. name: {
  23396. type: "string"
  23397. },
  23398. owner: {
  23399. required: true,
  23400. type: "string"
  23401. },
  23402. prerelease: {
  23403. type: "boolean"
  23404. },
  23405. release_id: {
  23406. required: true,
  23407. type: "integer"
  23408. },
  23409. repo: {
  23410. required: true,
  23411. type: "string"
  23412. },
  23413. tag_name: {
  23414. type: "string"
  23415. },
  23416. target_commitish: {
  23417. type: "string"
  23418. }
  23419. },
  23420. url: "/repos/:owner/:repo/releases/:release_id"
  23421. },
  23422. updateReleaseAsset: {
  23423. method: "PATCH",
  23424. params: {
  23425. asset_id: {
  23426. required: true,
  23427. type: "integer"
  23428. },
  23429. label: {
  23430. type: "string"
  23431. },
  23432. name: {
  23433. type: "string"
  23434. },
  23435. owner: {
  23436. required: true,
  23437. type: "string"
  23438. },
  23439. repo: {
  23440. required: true,
  23441. type: "string"
  23442. }
  23443. },
  23444. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23445. },
  23446. uploadReleaseAsset: {
  23447. method: "POST",
  23448. params: {
  23449. data: {
  23450. mapTo: "data",
  23451. required: true,
  23452. type: "string | object"
  23453. },
  23454. file: {
  23455. alias: "data",
  23456. deprecated: true,
  23457. type: "string | object"
  23458. },
  23459. headers: {
  23460. required: true,
  23461. type: "object"
  23462. },
  23463. "headers.content-length": {
  23464. required: true,
  23465. type: "integer"
  23466. },
  23467. "headers.content-type": {
  23468. required: true,
  23469. type: "string"
  23470. },
  23471. label: {
  23472. type: "string"
  23473. },
  23474. name: {
  23475. required: true,
  23476. type: "string"
  23477. },
  23478. url: {
  23479. required: true,
  23480. type: "string"
  23481. }
  23482. },
  23483. url: ":url"
  23484. }
  23485. },
  23486. search: {
  23487. code: {
  23488. method: "GET",
  23489. params: {
  23490. order: {
  23491. enum: ["desc", "asc"],
  23492. type: "string"
  23493. },
  23494. page: {
  23495. type: "integer"
  23496. },
  23497. per_page: {
  23498. type: "integer"
  23499. },
  23500. q: {
  23501. required: true,
  23502. type: "string"
  23503. },
  23504. sort: {
  23505. enum: ["indexed"],
  23506. type: "string"
  23507. }
  23508. },
  23509. url: "/search/code"
  23510. },
  23511. commits: {
  23512. headers: {
  23513. accept: "application/vnd.github.cloak-preview+json"
  23514. },
  23515. method: "GET",
  23516. params: {
  23517. order: {
  23518. enum: ["desc", "asc"],
  23519. type: "string"
  23520. },
  23521. page: {
  23522. type: "integer"
  23523. },
  23524. per_page: {
  23525. type: "integer"
  23526. },
  23527. q: {
  23528. required: true,
  23529. type: "string"
  23530. },
  23531. sort: {
  23532. enum: ["author-date", "committer-date"],
  23533. type: "string"
  23534. }
  23535. },
  23536. url: "/search/commits"
  23537. },
  23538. issues: {
  23539. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23540. method: "GET",
  23541. params: {
  23542. order: {
  23543. enum: ["desc", "asc"],
  23544. type: "string"
  23545. },
  23546. page: {
  23547. type: "integer"
  23548. },
  23549. per_page: {
  23550. type: "integer"
  23551. },
  23552. q: {
  23553. required: true,
  23554. type: "string"
  23555. },
  23556. sort: {
  23557. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23558. type: "string"
  23559. }
  23560. },
  23561. url: "/search/issues"
  23562. },
  23563. issuesAndPullRequests: {
  23564. method: "GET",
  23565. params: {
  23566. order: {
  23567. enum: ["desc", "asc"],
  23568. type: "string"
  23569. },
  23570. page: {
  23571. type: "integer"
  23572. },
  23573. per_page: {
  23574. type: "integer"
  23575. },
  23576. q: {
  23577. required: true,
  23578. type: "string"
  23579. },
  23580. sort: {
  23581. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23582. type: "string"
  23583. }
  23584. },
  23585. url: "/search/issues"
  23586. },
  23587. labels: {
  23588. method: "GET",
  23589. params: {
  23590. order: {
  23591. enum: ["desc", "asc"],
  23592. type: "string"
  23593. },
  23594. q: {
  23595. required: true,
  23596. type: "string"
  23597. },
  23598. repository_id: {
  23599. required: true,
  23600. type: "integer"
  23601. },
  23602. sort: {
  23603. enum: ["created", "updated"],
  23604. type: "string"
  23605. }
  23606. },
  23607. url: "/search/labels"
  23608. },
  23609. repos: {
  23610. method: "GET",
  23611. params: {
  23612. order: {
  23613. enum: ["desc", "asc"],
  23614. type: "string"
  23615. },
  23616. page: {
  23617. type: "integer"
  23618. },
  23619. per_page: {
  23620. type: "integer"
  23621. },
  23622. q: {
  23623. required: true,
  23624. type: "string"
  23625. },
  23626. sort: {
  23627. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23628. type: "string"
  23629. }
  23630. },
  23631. url: "/search/repositories"
  23632. },
  23633. topics: {
  23634. method: "GET",
  23635. params: {
  23636. q: {
  23637. required: true,
  23638. type: "string"
  23639. }
  23640. },
  23641. url: "/search/topics"
  23642. },
  23643. users: {
  23644. method: "GET",
  23645. params: {
  23646. order: {
  23647. enum: ["desc", "asc"],
  23648. type: "string"
  23649. },
  23650. page: {
  23651. type: "integer"
  23652. },
  23653. per_page: {
  23654. type: "integer"
  23655. },
  23656. q: {
  23657. required: true,
  23658. type: "string"
  23659. },
  23660. sort: {
  23661. enum: ["followers", "repositories", "joined"],
  23662. type: "string"
  23663. }
  23664. },
  23665. url: "/search/users"
  23666. }
  23667. },
  23668. teams: {
  23669. addMember: {
  23670. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23671. method: "PUT",
  23672. params: {
  23673. team_id: {
  23674. required: true,
  23675. type: "integer"
  23676. },
  23677. username: {
  23678. required: true,
  23679. type: "string"
  23680. }
  23681. },
  23682. url: "/teams/:team_id/members/:username"
  23683. },
  23684. addMemberLegacy: {
  23685. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23686. method: "PUT",
  23687. params: {
  23688. team_id: {
  23689. required: true,
  23690. type: "integer"
  23691. },
  23692. username: {
  23693. required: true,
  23694. type: "string"
  23695. }
  23696. },
  23697. url: "/teams/:team_id/members/:username"
  23698. },
  23699. addOrUpdateMembership: {
  23700. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  23701. method: "PUT",
  23702. params: {
  23703. role: {
  23704. enum: ["member", "maintainer"],
  23705. type: "string"
  23706. },
  23707. team_id: {
  23708. required: true,
  23709. type: "integer"
  23710. },
  23711. username: {
  23712. required: true,
  23713. type: "string"
  23714. }
  23715. },
  23716. url: "/teams/:team_id/memberships/:username"
  23717. },
  23718. addOrUpdateMembershipInOrg: {
  23719. method: "PUT",
  23720. params: {
  23721. org: {
  23722. required: true,
  23723. type: "string"
  23724. },
  23725. role: {
  23726. enum: ["member", "maintainer"],
  23727. type: "string"
  23728. },
  23729. team_slug: {
  23730. required: true,
  23731. type: "string"
  23732. },
  23733. username: {
  23734. required: true,
  23735. type: "string"
  23736. }
  23737. },
  23738. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  23739. },
  23740. addOrUpdateMembershipLegacy: {
  23741. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  23742. method: "PUT",
  23743. params: {
  23744. role: {
  23745. enum: ["member", "maintainer"],
  23746. type: "string"
  23747. },
  23748. team_id: {
  23749. required: true,
  23750. type: "integer"
  23751. },
  23752. username: {
  23753. required: true,
  23754. type: "string"
  23755. }
  23756. },
  23757. url: "/teams/:team_id/memberships/:username"
  23758. },
  23759. addOrUpdateProject: {
  23760. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  23761. headers: {
  23762. accept: "application/vnd.github.inertia-preview+json"
  23763. },
  23764. method: "PUT",
  23765. params: {
  23766. permission: {
  23767. enum: ["read", "write", "admin"],
  23768. type: "string"
  23769. },
  23770. project_id: {
  23771. required: true,
  23772. type: "integer"
  23773. },
  23774. team_id: {
  23775. required: true,
  23776. type: "integer"
  23777. }
  23778. },
  23779. url: "/teams/:team_id/projects/:project_id"
  23780. },
  23781. addOrUpdateProjectInOrg: {
  23782. headers: {
  23783. accept: "application/vnd.github.inertia-preview+json"
  23784. },
  23785. method: "PUT",
  23786. params: {
  23787. org: {
  23788. required: true,
  23789. type: "string"
  23790. },
  23791. permission: {
  23792. enum: ["read", "write", "admin"],
  23793. type: "string"
  23794. },
  23795. project_id: {
  23796. required: true,
  23797. type: "integer"
  23798. },
  23799. team_slug: {
  23800. required: true,
  23801. type: "string"
  23802. }
  23803. },
  23804. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  23805. },
  23806. addOrUpdateProjectLegacy: {
  23807. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  23808. headers: {
  23809. accept: "application/vnd.github.inertia-preview+json"
  23810. },
  23811. method: "PUT",
  23812. params: {
  23813. permission: {
  23814. enum: ["read", "write", "admin"],
  23815. type: "string"
  23816. },
  23817. project_id: {
  23818. required: true,
  23819. type: "integer"
  23820. },
  23821. team_id: {
  23822. required: true,
  23823. type: "integer"
  23824. }
  23825. },
  23826. url: "/teams/:team_id/projects/:project_id"
  23827. },
  23828. addOrUpdateRepo: {
  23829. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  23830. method: "PUT",
  23831. params: {
  23832. owner: {
  23833. required: true,
  23834. type: "string"
  23835. },
  23836. permission: {
  23837. enum: ["pull", "push", "admin"],
  23838. type: "string"
  23839. },
  23840. repo: {
  23841. required: true,
  23842. type: "string"
  23843. },
  23844. team_id: {
  23845. required: true,
  23846. type: "integer"
  23847. }
  23848. },
  23849. url: "/teams/:team_id/repos/:owner/:repo"
  23850. },
  23851. addOrUpdateRepoInOrg: {
  23852. method: "PUT",
  23853. params: {
  23854. org: {
  23855. required: true,
  23856. type: "string"
  23857. },
  23858. owner: {
  23859. required: true,
  23860. type: "string"
  23861. },
  23862. permission: {
  23863. enum: ["pull", "push", "admin"],
  23864. type: "string"
  23865. },
  23866. repo: {
  23867. required: true,
  23868. type: "string"
  23869. },
  23870. team_slug: {
  23871. required: true,
  23872. type: "string"
  23873. }
  23874. },
  23875. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23876. },
  23877. addOrUpdateRepoLegacy: {
  23878. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  23879. method: "PUT",
  23880. params: {
  23881. owner: {
  23882. required: true,
  23883. type: "string"
  23884. },
  23885. permission: {
  23886. enum: ["pull", "push", "admin"],
  23887. type: "string"
  23888. },
  23889. repo: {
  23890. required: true,
  23891. type: "string"
  23892. },
  23893. team_id: {
  23894. required: true,
  23895. type: "integer"
  23896. }
  23897. },
  23898. url: "/teams/:team_id/repos/:owner/:repo"
  23899. },
  23900. checkManagesRepo: {
  23901. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  23902. method: "GET",
  23903. params: {
  23904. owner: {
  23905. required: true,
  23906. type: "string"
  23907. },
  23908. repo: {
  23909. required: true,
  23910. type: "string"
  23911. },
  23912. team_id: {
  23913. required: true,
  23914. type: "integer"
  23915. }
  23916. },
  23917. url: "/teams/:team_id/repos/:owner/:repo"
  23918. },
  23919. checkManagesRepoInOrg: {
  23920. method: "GET",
  23921. params: {
  23922. org: {
  23923. required: true,
  23924. type: "string"
  23925. },
  23926. owner: {
  23927. required: true,
  23928. type: "string"
  23929. },
  23930. repo: {
  23931. required: true,
  23932. type: "string"
  23933. },
  23934. team_slug: {
  23935. required: true,
  23936. type: "string"
  23937. }
  23938. },
  23939. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  23940. },
  23941. checkManagesRepoLegacy: {
  23942. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  23943. method: "GET",
  23944. params: {
  23945. owner: {
  23946. required: true,
  23947. type: "string"
  23948. },
  23949. repo: {
  23950. required: true,
  23951. type: "string"
  23952. },
  23953. team_id: {
  23954. required: true,
  23955. type: "integer"
  23956. }
  23957. },
  23958. url: "/teams/:team_id/repos/:owner/:repo"
  23959. },
  23960. create: {
  23961. method: "POST",
  23962. params: {
  23963. description: {
  23964. type: "string"
  23965. },
  23966. maintainers: {
  23967. type: "string[]"
  23968. },
  23969. name: {
  23970. required: true,
  23971. type: "string"
  23972. },
  23973. org: {
  23974. required: true,
  23975. type: "string"
  23976. },
  23977. parent_team_id: {
  23978. type: "integer"
  23979. },
  23980. permission: {
  23981. enum: ["pull", "push", "admin"],
  23982. type: "string"
  23983. },
  23984. privacy: {
  23985. enum: ["secret", "closed"],
  23986. type: "string"
  23987. },
  23988. repo_names: {
  23989. type: "string[]"
  23990. }
  23991. },
  23992. url: "/orgs/:org/teams"
  23993. },
  23994. createDiscussion: {
  23995. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  23996. method: "POST",
  23997. params: {
  23998. body: {
  23999. required: true,
  24000. type: "string"
  24001. },
  24002. private: {
  24003. type: "boolean"
  24004. },
  24005. team_id: {
  24006. required: true,
  24007. type: "integer"
  24008. },
  24009. title: {
  24010. required: true,
  24011. type: "string"
  24012. }
  24013. },
  24014. url: "/teams/:team_id/discussions"
  24015. },
  24016. createDiscussionComment: {
  24017. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  24018. method: "POST",
  24019. params: {
  24020. body: {
  24021. required: true,
  24022. type: "string"
  24023. },
  24024. discussion_number: {
  24025. required: true,
  24026. type: "integer"
  24027. },
  24028. team_id: {
  24029. required: true,
  24030. type: "integer"
  24031. }
  24032. },
  24033. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24034. },
  24035. createDiscussionCommentInOrg: {
  24036. method: "POST",
  24037. params: {
  24038. body: {
  24039. required: true,
  24040. type: "string"
  24041. },
  24042. discussion_number: {
  24043. required: true,
  24044. type: "integer"
  24045. },
  24046. org: {
  24047. required: true,
  24048. type: "string"
  24049. },
  24050. team_slug: {
  24051. required: true,
  24052. type: "string"
  24053. }
  24054. },
  24055. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24056. },
  24057. createDiscussionCommentLegacy: {
  24058. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24059. method: "POST",
  24060. params: {
  24061. body: {
  24062. required: true,
  24063. type: "string"
  24064. },
  24065. discussion_number: {
  24066. required: true,
  24067. type: "integer"
  24068. },
  24069. team_id: {
  24070. required: true,
  24071. type: "integer"
  24072. }
  24073. },
  24074. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24075. },
  24076. createDiscussionInOrg: {
  24077. method: "POST",
  24078. params: {
  24079. body: {
  24080. required: true,
  24081. type: "string"
  24082. },
  24083. org: {
  24084. required: true,
  24085. type: "string"
  24086. },
  24087. private: {
  24088. type: "boolean"
  24089. },
  24090. team_slug: {
  24091. required: true,
  24092. type: "string"
  24093. },
  24094. title: {
  24095. required: true,
  24096. type: "string"
  24097. }
  24098. },
  24099. url: "/orgs/:org/teams/:team_slug/discussions"
  24100. },
  24101. createDiscussionLegacy: {
  24102. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24103. method: "POST",
  24104. params: {
  24105. body: {
  24106. required: true,
  24107. type: "string"
  24108. },
  24109. private: {
  24110. type: "boolean"
  24111. },
  24112. team_id: {
  24113. required: true,
  24114. type: "integer"
  24115. },
  24116. title: {
  24117. required: true,
  24118. type: "string"
  24119. }
  24120. },
  24121. url: "/teams/:team_id/discussions"
  24122. },
  24123. delete: {
  24124. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24125. method: "DELETE",
  24126. params: {
  24127. team_id: {
  24128. required: true,
  24129. type: "integer"
  24130. }
  24131. },
  24132. url: "/teams/:team_id"
  24133. },
  24134. deleteDiscussion: {
  24135. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24136. method: "DELETE",
  24137. params: {
  24138. discussion_number: {
  24139. required: true,
  24140. type: "integer"
  24141. },
  24142. team_id: {
  24143. required: true,
  24144. type: "integer"
  24145. }
  24146. },
  24147. url: "/teams/:team_id/discussions/:discussion_number"
  24148. },
  24149. deleteDiscussionComment: {
  24150. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24151. method: "DELETE",
  24152. params: {
  24153. comment_number: {
  24154. required: true,
  24155. type: "integer"
  24156. },
  24157. discussion_number: {
  24158. required: true,
  24159. type: "integer"
  24160. },
  24161. team_id: {
  24162. required: true,
  24163. type: "integer"
  24164. }
  24165. },
  24166. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24167. },
  24168. deleteDiscussionCommentInOrg: {
  24169. method: "DELETE",
  24170. params: {
  24171. comment_number: {
  24172. required: true,
  24173. type: "integer"
  24174. },
  24175. discussion_number: {
  24176. required: true,
  24177. type: "integer"
  24178. },
  24179. org: {
  24180. required: true,
  24181. type: "string"
  24182. },
  24183. team_slug: {
  24184. required: true,
  24185. type: "string"
  24186. }
  24187. },
  24188. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24189. },
  24190. deleteDiscussionCommentLegacy: {
  24191. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24192. method: "DELETE",
  24193. params: {
  24194. comment_number: {
  24195. required: true,
  24196. type: "integer"
  24197. },
  24198. discussion_number: {
  24199. required: true,
  24200. type: "integer"
  24201. },
  24202. team_id: {
  24203. required: true,
  24204. type: "integer"
  24205. }
  24206. },
  24207. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24208. },
  24209. deleteDiscussionInOrg: {
  24210. method: "DELETE",
  24211. params: {
  24212. discussion_number: {
  24213. required: true,
  24214. type: "integer"
  24215. },
  24216. org: {
  24217. required: true,
  24218. type: "string"
  24219. },
  24220. team_slug: {
  24221. required: true,
  24222. type: "string"
  24223. }
  24224. },
  24225. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24226. },
  24227. deleteDiscussionLegacy: {
  24228. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24229. method: "DELETE",
  24230. params: {
  24231. discussion_number: {
  24232. required: true,
  24233. type: "integer"
  24234. },
  24235. team_id: {
  24236. required: true,
  24237. type: "integer"
  24238. }
  24239. },
  24240. url: "/teams/:team_id/discussions/:discussion_number"
  24241. },
  24242. deleteInOrg: {
  24243. method: "DELETE",
  24244. params: {
  24245. org: {
  24246. required: true,
  24247. type: "string"
  24248. },
  24249. team_slug: {
  24250. required: true,
  24251. type: "string"
  24252. }
  24253. },
  24254. url: "/orgs/:org/teams/:team_slug"
  24255. },
  24256. deleteLegacy: {
  24257. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24258. method: "DELETE",
  24259. params: {
  24260. team_id: {
  24261. required: true,
  24262. type: "integer"
  24263. }
  24264. },
  24265. url: "/teams/:team_id"
  24266. },
  24267. get: {
  24268. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24269. method: "GET",
  24270. params: {
  24271. team_id: {
  24272. required: true,
  24273. type: "integer"
  24274. }
  24275. },
  24276. url: "/teams/:team_id"
  24277. },
  24278. getByName: {
  24279. method: "GET",
  24280. params: {
  24281. org: {
  24282. required: true,
  24283. type: "string"
  24284. },
  24285. team_slug: {
  24286. required: true,
  24287. type: "string"
  24288. }
  24289. },
  24290. url: "/orgs/:org/teams/:team_slug"
  24291. },
  24292. getDiscussion: {
  24293. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24294. method: "GET",
  24295. params: {
  24296. discussion_number: {
  24297. required: true,
  24298. type: "integer"
  24299. },
  24300. team_id: {
  24301. required: true,
  24302. type: "integer"
  24303. }
  24304. },
  24305. url: "/teams/:team_id/discussions/:discussion_number"
  24306. },
  24307. getDiscussionComment: {
  24308. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24309. method: "GET",
  24310. params: {
  24311. comment_number: {
  24312. required: true,
  24313. type: "integer"
  24314. },
  24315. discussion_number: {
  24316. required: true,
  24317. type: "integer"
  24318. },
  24319. team_id: {
  24320. required: true,
  24321. type: "integer"
  24322. }
  24323. },
  24324. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24325. },
  24326. getDiscussionCommentInOrg: {
  24327. method: "GET",
  24328. params: {
  24329. comment_number: {
  24330. required: true,
  24331. type: "integer"
  24332. },
  24333. discussion_number: {
  24334. required: true,
  24335. type: "integer"
  24336. },
  24337. org: {
  24338. required: true,
  24339. type: "string"
  24340. },
  24341. team_slug: {
  24342. required: true,
  24343. type: "string"
  24344. }
  24345. },
  24346. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24347. },
  24348. getDiscussionCommentLegacy: {
  24349. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24350. method: "GET",
  24351. params: {
  24352. comment_number: {
  24353. required: true,
  24354. type: "integer"
  24355. },
  24356. discussion_number: {
  24357. required: true,
  24358. type: "integer"
  24359. },
  24360. team_id: {
  24361. required: true,
  24362. type: "integer"
  24363. }
  24364. },
  24365. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24366. },
  24367. getDiscussionInOrg: {
  24368. method: "GET",
  24369. params: {
  24370. discussion_number: {
  24371. required: true,
  24372. type: "integer"
  24373. },
  24374. org: {
  24375. required: true,
  24376. type: "string"
  24377. },
  24378. team_slug: {
  24379. required: true,
  24380. type: "string"
  24381. }
  24382. },
  24383. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24384. },
  24385. getDiscussionLegacy: {
  24386. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24387. method: "GET",
  24388. params: {
  24389. discussion_number: {
  24390. required: true,
  24391. type: "integer"
  24392. },
  24393. team_id: {
  24394. required: true,
  24395. type: "integer"
  24396. }
  24397. },
  24398. url: "/teams/:team_id/discussions/:discussion_number"
  24399. },
  24400. getLegacy: {
  24401. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24402. method: "GET",
  24403. params: {
  24404. team_id: {
  24405. required: true,
  24406. type: "integer"
  24407. }
  24408. },
  24409. url: "/teams/:team_id"
  24410. },
  24411. getMember: {
  24412. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24413. method: "GET",
  24414. params: {
  24415. team_id: {
  24416. required: true,
  24417. type: "integer"
  24418. },
  24419. username: {
  24420. required: true,
  24421. type: "string"
  24422. }
  24423. },
  24424. url: "/teams/:team_id/members/:username"
  24425. },
  24426. getMemberLegacy: {
  24427. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24428. method: "GET",
  24429. params: {
  24430. team_id: {
  24431. required: true,
  24432. type: "integer"
  24433. },
  24434. username: {
  24435. required: true,
  24436. type: "string"
  24437. }
  24438. },
  24439. url: "/teams/:team_id/members/:username"
  24440. },
  24441. getMembership: {
  24442. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24443. method: "GET",
  24444. params: {
  24445. team_id: {
  24446. required: true,
  24447. type: "integer"
  24448. },
  24449. username: {
  24450. required: true,
  24451. type: "string"
  24452. }
  24453. },
  24454. url: "/teams/:team_id/memberships/:username"
  24455. },
  24456. getMembershipInOrg: {
  24457. method: "GET",
  24458. params: {
  24459. org: {
  24460. required: true,
  24461. type: "string"
  24462. },
  24463. team_slug: {
  24464. required: true,
  24465. type: "string"
  24466. },
  24467. username: {
  24468. required: true,
  24469. type: "string"
  24470. }
  24471. },
  24472. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24473. },
  24474. getMembershipLegacy: {
  24475. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24476. method: "GET",
  24477. params: {
  24478. team_id: {
  24479. required: true,
  24480. type: "integer"
  24481. },
  24482. username: {
  24483. required: true,
  24484. type: "string"
  24485. }
  24486. },
  24487. url: "/teams/:team_id/memberships/:username"
  24488. },
  24489. list: {
  24490. method: "GET",
  24491. params: {
  24492. org: {
  24493. required: true,
  24494. type: "string"
  24495. },
  24496. page: {
  24497. type: "integer"
  24498. },
  24499. per_page: {
  24500. type: "integer"
  24501. }
  24502. },
  24503. url: "/orgs/:org/teams"
  24504. },
  24505. listChild: {
  24506. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24507. method: "GET",
  24508. params: {
  24509. page: {
  24510. type: "integer"
  24511. },
  24512. per_page: {
  24513. type: "integer"
  24514. },
  24515. team_id: {
  24516. required: true,
  24517. type: "integer"
  24518. }
  24519. },
  24520. url: "/teams/:team_id/teams"
  24521. },
  24522. listChildInOrg: {
  24523. method: "GET",
  24524. params: {
  24525. org: {
  24526. required: true,
  24527. type: "string"
  24528. },
  24529. page: {
  24530. type: "integer"
  24531. },
  24532. per_page: {
  24533. type: "integer"
  24534. },
  24535. team_slug: {
  24536. required: true,
  24537. type: "string"
  24538. }
  24539. },
  24540. url: "/orgs/:org/teams/:team_slug/teams"
  24541. },
  24542. listChildLegacy: {
  24543. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24544. method: "GET",
  24545. params: {
  24546. page: {
  24547. type: "integer"
  24548. },
  24549. per_page: {
  24550. type: "integer"
  24551. },
  24552. team_id: {
  24553. required: true,
  24554. type: "integer"
  24555. }
  24556. },
  24557. url: "/teams/:team_id/teams"
  24558. },
  24559. listDiscussionComments: {
  24560. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24561. method: "GET",
  24562. params: {
  24563. direction: {
  24564. enum: ["asc", "desc"],
  24565. type: "string"
  24566. },
  24567. discussion_number: {
  24568. required: true,
  24569. type: "integer"
  24570. },
  24571. page: {
  24572. type: "integer"
  24573. },
  24574. per_page: {
  24575. type: "integer"
  24576. },
  24577. team_id: {
  24578. required: true,
  24579. type: "integer"
  24580. }
  24581. },
  24582. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24583. },
  24584. listDiscussionCommentsInOrg: {
  24585. method: "GET",
  24586. params: {
  24587. direction: {
  24588. enum: ["asc", "desc"],
  24589. type: "string"
  24590. },
  24591. discussion_number: {
  24592. required: true,
  24593. type: "integer"
  24594. },
  24595. org: {
  24596. required: true,
  24597. type: "string"
  24598. },
  24599. page: {
  24600. type: "integer"
  24601. },
  24602. per_page: {
  24603. type: "integer"
  24604. },
  24605. team_slug: {
  24606. required: true,
  24607. type: "string"
  24608. }
  24609. },
  24610. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24611. },
  24612. listDiscussionCommentsLegacy: {
  24613. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24614. method: "GET",
  24615. params: {
  24616. direction: {
  24617. enum: ["asc", "desc"],
  24618. type: "string"
  24619. },
  24620. discussion_number: {
  24621. required: true,
  24622. type: "integer"
  24623. },
  24624. page: {
  24625. type: "integer"
  24626. },
  24627. per_page: {
  24628. type: "integer"
  24629. },
  24630. team_id: {
  24631. required: true,
  24632. type: "integer"
  24633. }
  24634. },
  24635. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24636. },
  24637. listDiscussions: {
  24638. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24639. method: "GET",
  24640. params: {
  24641. direction: {
  24642. enum: ["asc", "desc"],
  24643. type: "string"
  24644. },
  24645. page: {
  24646. type: "integer"
  24647. },
  24648. per_page: {
  24649. type: "integer"
  24650. },
  24651. team_id: {
  24652. required: true,
  24653. type: "integer"
  24654. }
  24655. },
  24656. url: "/teams/:team_id/discussions"
  24657. },
  24658. listDiscussionsInOrg: {
  24659. method: "GET",
  24660. params: {
  24661. direction: {
  24662. enum: ["asc", "desc"],
  24663. type: "string"
  24664. },
  24665. org: {
  24666. required: true,
  24667. type: "string"
  24668. },
  24669. page: {
  24670. type: "integer"
  24671. },
  24672. per_page: {
  24673. type: "integer"
  24674. },
  24675. team_slug: {
  24676. required: true,
  24677. type: "string"
  24678. }
  24679. },
  24680. url: "/orgs/:org/teams/:team_slug/discussions"
  24681. },
  24682. listDiscussionsLegacy: {
  24683. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24684. method: "GET",
  24685. params: {
  24686. direction: {
  24687. enum: ["asc", "desc"],
  24688. type: "string"
  24689. },
  24690. page: {
  24691. type: "integer"
  24692. },
  24693. per_page: {
  24694. type: "integer"
  24695. },
  24696. team_id: {
  24697. required: true,
  24698. type: "integer"
  24699. }
  24700. },
  24701. url: "/teams/:team_id/discussions"
  24702. },
  24703. listForAuthenticatedUser: {
  24704. method: "GET",
  24705. params: {
  24706. page: {
  24707. type: "integer"
  24708. },
  24709. per_page: {
  24710. type: "integer"
  24711. }
  24712. },
  24713. url: "/user/teams"
  24714. },
  24715. listMembers: {
  24716. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  24717. method: "GET",
  24718. params: {
  24719. page: {
  24720. type: "integer"
  24721. },
  24722. per_page: {
  24723. type: "integer"
  24724. },
  24725. role: {
  24726. enum: ["member", "maintainer", "all"],
  24727. type: "string"
  24728. },
  24729. team_id: {
  24730. required: true,
  24731. type: "integer"
  24732. }
  24733. },
  24734. url: "/teams/:team_id/members"
  24735. },
  24736. listMembersInOrg: {
  24737. method: "GET",
  24738. params: {
  24739. org: {
  24740. required: true,
  24741. type: "string"
  24742. },
  24743. page: {
  24744. type: "integer"
  24745. },
  24746. per_page: {
  24747. type: "integer"
  24748. },
  24749. role: {
  24750. enum: ["member", "maintainer", "all"],
  24751. type: "string"
  24752. },
  24753. team_slug: {
  24754. required: true,
  24755. type: "string"
  24756. }
  24757. },
  24758. url: "/orgs/:org/teams/:team_slug/members"
  24759. },
  24760. listMembersLegacy: {
  24761. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  24762. method: "GET",
  24763. params: {
  24764. page: {
  24765. type: "integer"
  24766. },
  24767. per_page: {
  24768. type: "integer"
  24769. },
  24770. role: {
  24771. enum: ["member", "maintainer", "all"],
  24772. type: "string"
  24773. },
  24774. team_id: {
  24775. required: true,
  24776. type: "integer"
  24777. }
  24778. },
  24779. url: "/teams/:team_id/members"
  24780. },
  24781. listPendingInvitations: {
  24782. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  24783. method: "GET",
  24784. params: {
  24785. page: {
  24786. type: "integer"
  24787. },
  24788. per_page: {
  24789. type: "integer"
  24790. },
  24791. team_id: {
  24792. required: true,
  24793. type: "integer"
  24794. }
  24795. },
  24796. url: "/teams/:team_id/invitations"
  24797. },
  24798. listPendingInvitationsInOrg: {
  24799. method: "GET",
  24800. params: {
  24801. org: {
  24802. required: true,
  24803. type: "string"
  24804. },
  24805. page: {
  24806. type: "integer"
  24807. },
  24808. per_page: {
  24809. type: "integer"
  24810. },
  24811. team_slug: {
  24812. required: true,
  24813. type: "string"
  24814. }
  24815. },
  24816. url: "/orgs/:org/teams/:team_slug/invitations"
  24817. },
  24818. listPendingInvitationsLegacy: {
  24819. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  24820. method: "GET",
  24821. params: {
  24822. page: {
  24823. type: "integer"
  24824. },
  24825. per_page: {
  24826. type: "integer"
  24827. },
  24828. team_id: {
  24829. required: true,
  24830. type: "integer"
  24831. }
  24832. },
  24833. url: "/teams/:team_id/invitations"
  24834. },
  24835. listProjects: {
  24836. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  24837. headers: {
  24838. accept: "application/vnd.github.inertia-preview+json"
  24839. },
  24840. method: "GET",
  24841. params: {
  24842. page: {
  24843. type: "integer"
  24844. },
  24845. per_page: {
  24846. type: "integer"
  24847. },
  24848. team_id: {
  24849. required: true,
  24850. type: "integer"
  24851. }
  24852. },
  24853. url: "/teams/:team_id/projects"
  24854. },
  24855. listProjectsInOrg: {
  24856. headers: {
  24857. accept: "application/vnd.github.inertia-preview+json"
  24858. },
  24859. method: "GET",
  24860. params: {
  24861. org: {
  24862. required: true,
  24863. type: "string"
  24864. },
  24865. page: {
  24866. type: "integer"
  24867. },
  24868. per_page: {
  24869. type: "integer"
  24870. },
  24871. team_slug: {
  24872. required: true,
  24873. type: "string"
  24874. }
  24875. },
  24876. url: "/orgs/:org/teams/:team_slug/projects"
  24877. },
  24878. listProjectsLegacy: {
  24879. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  24880. headers: {
  24881. accept: "application/vnd.github.inertia-preview+json"
  24882. },
  24883. method: "GET",
  24884. params: {
  24885. page: {
  24886. type: "integer"
  24887. },
  24888. per_page: {
  24889. type: "integer"
  24890. },
  24891. team_id: {
  24892. required: true,
  24893. type: "integer"
  24894. }
  24895. },
  24896. url: "/teams/:team_id/projects"
  24897. },
  24898. listRepos: {
  24899. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  24900. method: "GET",
  24901. params: {
  24902. page: {
  24903. type: "integer"
  24904. },
  24905. per_page: {
  24906. type: "integer"
  24907. },
  24908. team_id: {
  24909. required: true,
  24910. type: "integer"
  24911. }
  24912. },
  24913. url: "/teams/:team_id/repos"
  24914. },
  24915. listReposInOrg: {
  24916. method: "GET",
  24917. params: {
  24918. org: {
  24919. required: true,
  24920. type: "string"
  24921. },
  24922. page: {
  24923. type: "integer"
  24924. },
  24925. per_page: {
  24926. type: "integer"
  24927. },
  24928. team_slug: {
  24929. required: true,
  24930. type: "string"
  24931. }
  24932. },
  24933. url: "/orgs/:org/teams/:team_slug/repos"
  24934. },
  24935. listReposLegacy: {
  24936. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  24937. method: "GET",
  24938. params: {
  24939. page: {
  24940. type: "integer"
  24941. },
  24942. per_page: {
  24943. type: "integer"
  24944. },
  24945. team_id: {
  24946. required: true,
  24947. type: "integer"
  24948. }
  24949. },
  24950. url: "/teams/:team_id/repos"
  24951. },
  24952. removeMember: {
  24953. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  24954. method: "DELETE",
  24955. params: {
  24956. team_id: {
  24957. required: true,
  24958. type: "integer"
  24959. },
  24960. username: {
  24961. required: true,
  24962. type: "string"
  24963. }
  24964. },
  24965. url: "/teams/:team_id/members/:username"
  24966. },
  24967. removeMemberLegacy: {
  24968. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  24969. method: "DELETE",
  24970. params: {
  24971. team_id: {
  24972. required: true,
  24973. type: "integer"
  24974. },
  24975. username: {
  24976. required: true,
  24977. type: "string"
  24978. }
  24979. },
  24980. url: "/teams/:team_id/members/:username"
  24981. },
  24982. removeMembership: {
  24983. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  24984. method: "DELETE",
  24985. params: {
  24986. team_id: {
  24987. required: true,
  24988. type: "integer"
  24989. },
  24990. username: {
  24991. required: true,
  24992. type: "string"
  24993. }
  24994. },
  24995. url: "/teams/:team_id/memberships/:username"
  24996. },
  24997. removeMembershipInOrg: {
  24998. method: "DELETE",
  24999. params: {
  25000. org: {
  25001. required: true,
  25002. type: "string"
  25003. },
  25004. team_slug: {
  25005. required: true,
  25006. type: "string"
  25007. },
  25008. username: {
  25009. required: true,
  25010. type: "string"
  25011. }
  25012. },
  25013. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  25014. },
  25015. removeMembershipLegacy: {
  25016. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  25017. method: "DELETE",
  25018. params: {
  25019. team_id: {
  25020. required: true,
  25021. type: "integer"
  25022. },
  25023. username: {
  25024. required: true,
  25025. type: "string"
  25026. }
  25027. },
  25028. url: "/teams/:team_id/memberships/:username"
  25029. },
  25030. removeProject: {
  25031. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  25032. method: "DELETE",
  25033. params: {
  25034. project_id: {
  25035. required: true,
  25036. type: "integer"
  25037. },
  25038. team_id: {
  25039. required: true,
  25040. type: "integer"
  25041. }
  25042. },
  25043. url: "/teams/:team_id/projects/:project_id"
  25044. },
  25045. removeProjectInOrg: {
  25046. method: "DELETE",
  25047. params: {
  25048. org: {
  25049. required: true,
  25050. type: "string"
  25051. },
  25052. project_id: {
  25053. required: true,
  25054. type: "integer"
  25055. },
  25056. team_slug: {
  25057. required: true,
  25058. type: "string"
  25059. }
  25060. },
  25061. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25062. },
  25063. removeProjectLegacy: {
  25064. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25065. method: "DELETE",
  25066. params: {
  25067. project_id: {
  25068. required: true,
  25069. type: "integer"
  25070. },
  25071. team_id: {
  25072. required: true,
  25073. type: "integer"
  25074. }
  25075. },
  25076. url: "/teams/:team_id/projects/:project_id"
  25077. },
  25078. removeRepo: {
  25079. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25080. method: "DELETE",
  25081. params: {
  25082. owner: {
  25083. required: true,
  25084. type: "string"
  25085. },
  25086. repo: {
  25087. required: true,
  25088. type: "string"
  25089. },
  25090. team_id: {
  25091. required: true,
  25092. type: "integer"
  25093. }
  25094. },
  25095. url: "/teams/:team_id/repos/:owner/:repo"
  25096. },
  25097. removeRepoInOrg: {
  25098. method: "DELETE",
  25099. params: {
  25100. org: {
  25101. required: true,
  25102. type: "string"
  25103. },
  25104. owner: {
  25105. required: true,
  25106. type: "string"
  25107. },
  25108. repo: {
  25109. required: true,
  25110. type: "string"
  25111. },
  25112. team_slug: {
  25113. required: true,
  25114. type: "string"
  25115. }
  25116. },
  25117. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25118. },
  25119. removeRepoLegacy: {
  25120. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25121. method: "DELETE",
  25122. params: {
  25123. owner: {
  25124. required: true,
  25125. type: "string"
  25126. },
  25127. repo: {
  25128. required: true,
  25129. type: "string"
  25130. },
  25131. team_id: {
  25132. required: true,
  25133. type: "integer"
  25134. }
  25135. },
  25136. url: "/teams/:team_id/repos/:owner/:repo"
  25137. },
  25138. reviewProject: {
  25139. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25140. headers: {
  25141. accept: "application/vnd.github.inertia-preview+json"
  25142. },
  25143. method: "GET",
  25144. params: {
  25145. project_id: {
  25146. required: true,
  25147. type: "integer"
  25148. },
  25149. team_id: {
  25150. required: true,
  25151. type: "integer"
  25152. }
  25153. },
  25154. url: "/teams/:team_id/projects/:project_id"
  25155. },
  25156. reviewProjectInOrg: {
  25157. headers: {
  25158. accept: "application/vnd.github.inertia-preview+json"
  25159. },
  25160. method: "GET",
  25161. params: {
  25162. org: {
  25163. required: true,
  25164. type: "string"
  25165. },
  25166. project_id: {
  25167. required: true,
  25168. type: "integer"
  25169. },
  25170. team_slug: {
  25171. required: true,
  25172. type: "string"
  25173. }
  25174. },
  25175. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25176. },
  25177. reviewProjectLegacy: {
  25178. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25179. headers: {
  25180. accept: "application/vnd.github.inertia-preview+json"
  25181. },
  25182. method: "GET",
  25183. params: {
  25184. project_id: {
  25185. required: true,
  25186. type: "integer"
  25187. },
  25188. team_id: {
  25189. required: true,
  25190. type: "integer"
  25191. }
  25192. },
  25193. url: "/teams/:team_id/projects/:project_id"
  25194. },
  25195. update: {
  25196. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25197. method: "PATCH",
  25198. params: {
  25199. description: {
  25200. type: "string"
  25201. },
  25202. name: {
  25203. required: true,
  25204. type: "string"
  25205. },
  25206. parent_team_id: {
  25207. type: "integer"
  25208. },
  25209. permission: {
  25210. enum: ["pull", "push", "admin"],
  25211. type: "string"
  25212. },
  25213. privacy: {
  25214. enum: ["secret", "closed"],
  25215. type: "string"
  25216. },
  25217. team_id: {
  25218. required: true,
  25219. type: "integer"
  25220. }
  25221. },
  25222. url: "/teams/:team_id"
  25223. },
  25224. updateDiscussion: {
  25225. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25226. method: "PATCH",
  25227. params: {
  25228. body: {
  25229. type: "string"
  25230. },
  25231. discussion_number: {
  25232. required: true,
  25233. type: "integer"
  25234. },
  25235. team_id: {
  25236. required: true,
  25237. type: "integer"
  25238. },
  25239. title: {
  25240. type: "string"
  25241. }
  25242. },
  25243. url: "/teams/:team_id/discussions/:discussion_number"
  25244. },
  25245. updateDiscussionComment: {
  25246. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25247. method: "PATCH",
  25248. params: {
  25249. body: {
  25250. required: true,
  25251. type: "string"
  25252. },
  25253. comment_number: {
  25254. required: true,
  25255. type: "integer"
  25256. },
  25257. discussion_number: {
  25258. required: true,
  25259. type: "integer"
  25260. },
  25261. team_id: {
  25262. required: true,
  25263. type: "integer"
  25264. }
  25265. },
  25266. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25267. },
  25268. updateDiscussionCommentInOrg: {
  25269. method: "PATCH",
  25270. params: {
  25271. body: {
  25272. required: true,
  25273. type: "string"
  25274. },
  25275. comment_number: {
  25276. required: true,
  25277. type: "integer"
  25278. },
  25279. discussion_number: {
  25280. required: true,
  25281. type: "integer"
  25282. },
  25283. org: {
  25284. required: true,
  25285. type: "string"
  25286. },
  25287. team_slug: {
  25288. required: true,
  25289. type: "string"
  25290. }
  25291. },
  25292. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25293. },
  25294. updateDiscussionCommentLegacy: {
  25295. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25296. method: "PATCH",
  25297. params: {
  25298. body: {
  25299. required: true,
  25300. type: "string"
  25301. },
  25302. comment_number: {
  25303. required: true,
  25304. type: "integer"
  25305. },
  25306. discussion_number: {
  25307. required: true,
  25308. type: "integer"
  25309. },
  25310. team_id: {
  25311. required: true,
  25312. type: "integer"
  25313. }
  25314. },
  25315. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25316. },
  25317. updateDiscussionInOrg: {
  25318. method: "PATCH",
  25319. params: {
  25320. body: {
  25321. type: "string"
  25322. },
  25323. discussion_number: {
  25324. required: true,
  25325. type: "integer"
  25326. },
  25327. org: {
  25328. required: true,
  25329. type: "string"
  25330. },
  25331. team_slug: {
  25332. required: true,
  25333. type: "string"
  25334. },
  25335. title: {
  25336. type: "string"
  25337. }
  25338. },
  25339. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25340. },
  25341. updateDiscussionLegacy: {
  25342. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25343. method: "PATCH",
  25344. params: {
  25345. body: {
  25346. type: "string"
  25347. },
  25348. discussion_number: {
  25349. required: true,
  25350. type: "integer"
  25351. },
  25352. team_id: {
  25353. required: true,
  25354. type: "integer"
  25355. },
  25356. title: {
  25357. type: "string"
  25358. }
  25359. },
  25360. url: "/teams/:team_id/discussions/:discussion_number"
  25361. },
  25362. updateInOrg: {
  25363. method: "PATCH",
  25364. params: {
  25365. description: {
  25366. type: "string"
  25367. },
  25368. name: {
  25369. required: true,
  25370. type: "string"
  25371. },
  25372. org: {
  25373. required: true,
  25374. type: "string"
  25375. },
  25376. parent_team_id: {
  25377. type: "integer"
  25378. },
  25379. permission: {
  25380. enum: ["pull", "push", "admin"],
  25381. type: "string"
  25382. },
  25383. privacy: {
  25384. enum: ["secret", "closed"],
  25385. type: "string"
  25386. },
  25387. team_slug: {
  25388. required: true,
  25389. type: "string"
  25390. }
  25391. },
  25392. url: "/orgs/:org/teams/:team_slug"
  25393. },
  25394. updateLegacy: {
  25395. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25396. method: "PATCH",
  25397. params: {
  25398. description: {
  25399. type: "string"
  25400. },
  25401. name: {
  25402. required: true,
  25403. type: "string"
  25404. },
  25405. parent_team_id: {
  25406. type: "integer"
  25407. },
  25408. permission: {
  25409. enum: ["pull", "push", "admin"],
  25410. type: "string"
  25411. },
  25412. privacy: {
  25413. enum: ["secret", "closed"],
  25414. type: "string"
  25415. },
  25416. team_id: {
  25417. required: true,
  25418. type: "integer"
  25419. }
  25420. },
  25421. url: "/teams/:team_id"
  25422. }
  25423. },
  25424. users: {
  25425. addEmails: {
  25426. method: "POST",
  25427. params: {
  25428. emails: {
  25429. required: true,
  25430. type: "string[]"
  25431. }
  25432. },
  25433. url: "/user/emails"
  25434. },
  25435. block: {
  25436. method: "PUT",
  25437. params: {
  25438. username: {
  25439. required: true,
  25440. type: "string"
  25441. }
  25442. },
  25443. url: "/user/blocks/:username"
  25444. },
  25445. checkBlocked: {
  25446. method: "GET",
  25447. params: {
  25448. username: {
  25449. required: true,
  25450. type: "string"
  25451. }
  25452. },
  25453. url: "/user/blocks/:username"
  25454. },
  25455. checkFollowing: {
  25456. method: "GET",
  25457. params: {
  25458. username: {
  25459. required: true,
  25460. type: "string"
  25461. }
  25462. },
  25463. url: "/user/following/:username"
  25464. },
  25465. checkFollowingForUser: {
  25466. method: "GET",
  25467. params: {
  25468. target_user: {
  25469. required: true,
  25470. type: "string"
  25471. },
  25472. username: {
  25473. required: true,
  25474. type: "string"
  25475. }
  25476. },
  25477. url: "/users/:username/following/:target_user"
  25478. },
  25479. createGpgKey: {
  25480. method: "POST",
  25481. params: {
  25482. armored_public_key: {
  25483. type: "string"
  25484. }
  25485. },
  25486. url: "/user/gpg_keys"
  25487. },
  25488. createPublicKey: {
  25489. method: "POST",
  25490. params: {
  25491. key: {
  25492. type: "string"
  25493. },
  25494. title: {
  25495. type: "string"
  25496. }
  25497. },
  25498. url: "/user/keys"
  25499. },
  25500. deleteEmails: {
  25501. method: "DELETE",
  25502. params: {
  25503. emails: {
  25504. required: true,
  25505. type: "string[]"
  25506. }
  25507. },
  25508. url: "/user/emails"
  25509. },
  25510. deleteGpgKey: {
  25511. method: "DELETE",
  25512. params: {
  25513. gpg_key_id: {
  25514. required: true,
  25515. type: "integer"
  25516. }
  25517. },
  25518. url: "/user/gpg_keys/:gpg_key_id"
  25519. },
  25520. deletePublicKey: {
  25521. method: "DELETE",
  25522. params: {
  25523. key_id: {
  25524. required: true,
  25525. type: "integer"
  25526. }
  25527. },
  25528. url: "/user/keys/:key_id"
  25529. },
  25530. follow: {
  25531. method: "PUT",
  25532. params: {
  25533. username: {
  25534. required: true,
  25535. type: "string"
  25536. }
  25537. },
  25538. url: "/user/following/:username"
  25539. },
  25540. getAuthenticated: {
  25541. method: "GET",
  25542. params: {},
  25543. url: "/user"
  25544. },
  25545. getByUsername: {
  25546. method: "GET",
  25547. params: {
  25548. username: {
  25549. required: true,
  25550. type: "string"
  25551. }
  25552. },
  25553. url: "/users/:username"
  25554. },
  25555. getContextForUser: {
  25556. method: "GET",
  25557. params: {
  25558. subject_id: {
  25559. type: "string"
  25560. },
  25561. subject_type: {
  25562. enum: ["organization", "repository", "issue", "pull_request"],
  25563. type: "string"
  25564. },
  25565. username: {
  25566. required: true,
  25567. type: "string"
  25568. }
  25569. },
  25570. url: "/users/:username/hovercard"
  25571. },
  25572. getGpgKey: {
  25573. method: "GET",
  25574. params: {
  25575. gpg_key_id: {
  25576. required: true,
  25577. type: "integer"
  25578. }
  25579. },
  25580. url: "/user/gpg_keys/:gpg_key_id"
  25581. },
  25582. getPublicKey: {
  25583. method: "GET",
  25584. params: {
  25585. key_id: {
  25586. required: true,
  25587. type: "integer"
  25588. }
  25589. },
  25590. url: "/user/keys/:key_id"
  25591. },
  25592. list: {
  25593. method: "GET",
  25594. params: {
  25595. page: {
  25596. type: "integer"
  25597. },
  25598. per_page: {
  25599. type: "integer"
  25600. },
  25601. since: {
  25602. type: "string"
  25603. }
  25604. },
  25605. url: "/users"
  25606. },
  25607. listBlocked: {
  25608. method: "GET",
  25609. params: {},
  25610. url: "/user/blocks"
  25611. },
  25612. listEmails: {
  25613. method: "GET",
  25614. params: {
  25615. page: {
  25616. type: "integer"
  25617. },
  25618. per_page: {
  25619. type: "integer"
  25620. }
  25621. },
  25622. url: "/user/emails"
  25623. },
  25624. listFollowersForAuthenticatedUser: {
  25625. method: "GET",
  25626. params: {
  25627. page: {
  25628. type: "integer"
  25629. },
  25630. per_page: {
  25631. type: "integer"
  25632. }
  25633. },
  25634. url: "/user/followers"
  25635. },
  25636. listFollowersForUser: {
  25637. method: "GET",
  25638. params: {
  25639. page: {
  25640. type: "integer"
  25641. },
  25642. per_page: {
  25643. type: "integer"
  25644. },
  25645. username: {
  25646. required: true,
  25647. type: "string"
  25648. }
  25649. },
  25650. url: "/users/:username/followers"
  25651. },
  25652. listFollowingForAuthenticatedUser: {
  25653. method: "GET",
  25654. params: {
  25655. page: {
  25656. type: "integer"
  25657. },
  25658. per_page: {
  25659. type: "integer"
  25660. }
  25661. },
  25662. url: "/user/following"
  25663. },
  25664. listFollowingForUser: {
  25665. method: "GET",
  25666. params: {
  25667. page: {
  25668. type: "integer"
  25669. },
  25670. per_page: {
  25671. type: "integer"
  25672. },
  25673. username: {
  25674. required: true,
  25675. type: "string"
  25676. }
  25677. },
  25678. url: "/users/:username/following"
  25679. },
  25680. listGpgKeys: {
  25681. method: "GET",
  25682. params: {
  25683. page: {
  25684. type: "integer"
  25685. },
  25686. per_page: {
  25687. type: "integer"
  25688. }
  25689. },
  25690. url: "/user/gpg_keys"
  25691. },
  25692. listGpgKeysForUser: {
  25693. method: "GET",
  25694. params: {
  25695. page: {
  25696. type: "integer"
  25697. },
  25698. per_page: {
  25699. type: "integer"
  25700. },
  25701. username: {
  25702. required: true,
  25703. type: "string"
  25704. }
  25705. },
  25706. url: "/users/:username/gpg_keys"
  25707. },
  25708. listPublicEmails: {
  25709. method: "GET",
  25710. params: {
  25711. page: {
  25712. type: "integer"
  25713. },
  25714. per_page: {
  25715. type: "integer"
  25716. }
  25717. },
  25718. url: "/user/public_emails"
  25719. },
  25720. listPublicKeys: {
  25721. method: "GET",
  25722. params: {
  25723. page: {
  25724. type: "integer"
  25725. },
  25726. per_page: {
  25727. type: "integer"
  25728. }
  25729. },
  25730. url: "/user/keys"
  25731. },
  25732. listPublicKeysForUser: {
  25733. method: "GET",
  25734. params: {
  25735. page: {
  25736. type: "integer"
  25737. },
  25738. per_page: {
  25739. type: "integer"
  25740. },
  25741. username: {
  25742. required: true,
  25743. type: "string"
  25744. }
  25745. },
  25746. url: "/users/:username/keys"
  25747. },
  25748. togglePrimaryEmailVisibility: {
  25749. method: "PATCH",
  25750. params: {
  25751. email: {
  25752. required: true,
  25753. type: "string"
  25754. },
  25755. visibility: {
  25756. required: true,
  25757. type: "string"
  25758. }
  25759. },
  25760. url: "/user/email/visibility"
  25761. },
  25762. unblock: {
  25763. method: "DELETE",
  25764. params: {
  25765. username: {
  25766. required: true,
  25767. type: "string"
  25768. }
  25769. },
  25770. url: "/user/blocks/:username"
  25771. },
  25772. unfollow: {
  25773. method: "DELETE",
  25774. params: {
  25775. username: {
  25776. required: true,
  25777. type: "string"
  25778. }
  25779. },
  25780. url: "/user/following/:username"
  25781. },
  25782. updateAuthenticated: {
  25783. method: "PATCH",
  25784. params: {
  25785. bio: {
  25786. type: "string"
  25787. },
  25788. blog: {
  25789. type: "string"
  25790. },
  25791. company: {
  25792. type: "string"
  25793. },
  25794. email: {
  25795. type: "string"
  25796. },
  25797. hireable: {
  25798. type: "boolean"
  25799. },
  25800. location: {
  25801. type: "string"
  25802. },
  25803. name: {
  25804. type: "string"
  25805. }
  25806. },
  25807. url: "/user"
  25808. }
  25809. }
  25810. };
  25811. const VERSION = "2.4.0";
  25812. function registerEndpoints(octokit, routes) {
  25813. Object.keys(routes).forEach(namespaceName => {
  25814. if (!octokit[namespaceName]) {
  25815. octokit[namespaceName] = {};
  25816. }
  25817. Object.keys(routes[namespaceName]).forEach(apiName => {
  25818. const apiOptions = routes[namespaceName][apiName];
  25819. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  25820. if (typeof apiOptions[key] !== "undefined") {
  25821. map[key] = apiOptions[key];
  25822. }
  25823. return map;
  25824. }, {});
  25825. endpointDefaults.request = {
  25826. validate: apiOptions.params
  25827. };
  25828. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  25829. // Not the most elegant solution, but we don’t want to move deprecation
  25830. // logic into octokit/endpoint.js as it’s out of scope
  25831. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  25832. if (hasDeprecatedParam) {
  25833. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  25834. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  25835. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  25836. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  25837. }
  25838. if (apiOptions.deprecated) {
  25839. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  25840. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  25841. octokit[namespaceName][apiName] = request;
  25842. return request.apply(null, arguments);
  25843. }, request);
  25844. return;
  25845. }
  25846. octokit[namespaceName][apiName] = request;
  25847. });
  25848. });
  25849. }
  25850. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  25851. const patchedMethod = options => {
  25852. options = Object.assign({}, options);
  25853. Object.keys(options).forEach(key => {
  25854. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  25855. const aliasKey = apiOptions.params[key].alias;
  25856. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  25857. if (!(aliasKey in options)) {
  25858. options[aliasKey] = options[key];
  25859. }
  25860. delete options[key];
  25861. }
  25862. });
  25863. return method(options);
  25864. };
  25865. Object.keys(method).forEach(key => {
  25866. patchedMethod[key] = method[key];
  25867. });
  25868. return patchedMethod;
  25869. }
  25870. /**
  25871. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  25872. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  25873. * done, we will remove the registerEndpoints methods and return the methods
  25874. * directly as with the other plugins. At that point we will also remove the
  25875. * legacy workarounds and deprecations.
  25876. *
  25877. * See the plan at
  25878. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  25879. */
  25880. function restEndpointMethods(octokit) {
  25881. // @ts-ignore
  25882. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  25883. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  25884. // See https://github.com/octokit/rest.js/pull/1134
  25885. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  25886. Object.defineProperty(octokit, deprecatedScope, {
  25887. get() {
  25888. octokit.log.warn( // @ts-ignore
  25889. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  25890. return octokit[scope];
  25891. }
  25892. });
  25893. });
  25894. return {};
  25895. }
  25896. restEndpointMethods.VERSION = VERSION;
  25897. exports.restEndpointMethods = restEndpointMethods;
  25898. //# sourceMappingURL=index.js.map
  25899. /***/ }),
  25900. /***/ 850:
  25901. /***/ (function(module, __unusedexports, __webpack_require__) {
  25902. module.exports = paginationMethodsPlugin
  25903. function paginationMethodsPlugin (octokit) {
  25904. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  25905. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  25906. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  25907. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  25908. octokit.hasFirstPage = __webpack_require__(536)
  25909. octokit.hasLastPage = __webpack_require__(336)
  25910. octokit.hasNextPage = __webpack_require__(929)
  25911. octokit.hasPreviousPage = __webpack_require__(558)
  25912. }
  25913. /***/ }),
  25914. /***/ 854:
  25915. /***/ (function(module) {
  25916. /**
  25917. * lodash (Custom Build) <https://lodash.com/>
  25918. * Build: `lodash modularize exports="npm" -o ./`
  25919. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  25920. * Released under MIT license <https://lodash.com/license>
  25921. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  25922. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  25923. */
  25924. /** Used as the `TypeError` message for "Functions" methods. */
  25925. var FUNC_ERROR_TEXT = 'Expected a function';
  25926. /** Used to stand-in for `undefined` hash values. */
  25927. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  25928. /** Used as references for various `Number` constants. */
  25929. var INFINITY = 1 / 0;
  25930. /** `Object#toString` result references. */
  25931. var funcTag = '[object Function]',
  25932. genTag = '[object GeneratorFunction]',
  25933. symbolTag = '[object Symbol]';
  25934. /** Used to match property names within property paths. */
  25935. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  25936. reIsPlainProp = /^\w*$/,
  25937. reLeadingDot = /^\./,
  25938. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  25939. /**
  25940. * Used to match `RegExp`
  25941. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  25942. */
  25943. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  25944. /** Used to match backslashes in property paths. */
  25945. var reEscapeChar = /\\(\\)?/g;
  25946. /** Used to detect host constructors (Safari). */
  25947. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  25948. /** Detect free variable `global` from Node.js. */
  25949. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  25950. /** Detect free variable `self`. */
  25951. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  25952. /** Used as a reference to the global object. */
  25953. var root = freeGlobal || freeSelf || Function('return this')();
  25954. /**
  25955. * Gets the value at `key` of `object`.
  25956. *
  25957. * @private
  25958. * @param {Object} [object] The object to query.
  25959. * @param {string} key The key of the property to get.
  25960. * @returns {*} Returns the property value.
  25961. */
  25962. function getValue(object, key) {
  25963. return object == null ? undefined : object[key];
  25964. }
  25965. /**
  25966. * Checks if `value` is a host object in IE < 9.
  25967. *
  25968. * @private
  25969. * @param {*} value The value to check.
  25970. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  25971. */
  25972. function isHostObject(value) {
  25973. // Many host objects are `Object` objects that can coerce to strings
  25974. // despite having improperly defined `toString` methods.
  25975. var result = false;
  25976. if (value != null && typeof value.toString != 'function') {
  25977. try {
  25978. result = !!(value + '');
  25979. } catch (e) {}
  25980. }
  25981. return result;
  25982. }
  25983. /** Used for built-in method references. */
  25984. var arrayProto = Array.prototype,
  25985. funcProto = Function.prototype,
  25986. objectProto = Object.prototype;
  25987. /** Used to detect overreaching core-js shims. */
  25988. var coreJsData = root['__core-js_shared__'];
  25989. /** Used to detect methods masquerading as native. */
  25990. var maskSrcKey = (function() {
  25991. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25992. return uid ? ('Symbol(src)_1.' + uid) : '';
  25993. }());
  25994. /** Used to resolve the decompiled source of functions. */
  25995. var funcToString = funcProto.toString;
  25996. /** Used to check objects for own properties. */
  25997. var hasOwnProperty = objectProto.hasOwnProperty;
  25998. /**
  25999. * Used to resolve the
  26000. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  26001. * of values.
  26002. */
  26003. var objectToString = objectProto.toString;
  26004. /** Used to detect if a method is native. */
  26005. var reIsNative = RegExp('^' +
  26006. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  26007. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  26008. );
  26009. /** Built-in value references. */
  26010. var Symbol = root.Symbol,
  26011. splice = arrayProto.splice;
  26012. /* Built-in method references that are verified to be native. */
  26013. var Map = getNative(root, 'Map'),
  26014. nativeCreate = getNative(Object, 'create');
  26015. /** Used to convert symbols to primitives and strings. */
  26016. var symbolProto = Symbol ? Symbol.prototype : undefined,
  26017. symbolToString = symbolProto ? symbolProto.toString : undefined;
  26018. /**
  26019. * Creates a hash object.
  26020. *
  26021. * @private
  26022. * @constructor
  26023. * @param {Array} [entries] The key-value pairs to cache.
  26024. */
  26025. function Hash(entries) {
  26026. var index = -1,
  26027. length = entries ? entries.length : 0;
  26028. this.clear();
  26029. while (++index < length) {
  26030. var entry = entries[index];
  26031. this.set(entry[0], entry[1]);
  26032. }
  26033. }
  26034. /**
  26035. * Removes all key-value entries from the hash.
  26036. *
  26037. * @private
  26038. * @name clear
  26039. * @memberOf Hash
  26040. */
  26041. function hashClear() {
  26042. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  26043. }
  26044. /**
  26045. * Removes `key` and its value from the hash.
  26046. *
  26047. * @private
  26048. * @name delete
  26049. * @memberOf Hash
  26050. * @param {Object} hash The hash to modify.
  26051. * @param {string} key The key of the value to remove.
  26052. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26053. */
  26054. function hashDelete(key) {
  26055. return this.has(key) && delete this.__data__[key];
  26056. }
  26057. /**
  26058. * Gets the hash value for `key`.
  26059. *
  26060. * @private
  26061. * @name get
  26062. * @memberOf Hash
  26063. * @param {string} key The key of the value to get.
  26064. * @returns {*} Returns the entry value.
  26065. */
  26066. function hashGet(key) {
  26067. var data = this.__data__;
  26068. if (nativeCreate) {
  26069. var result = data[key];
  26070. return result === HASH_UNDEFINED ? undefined : result;
  26071. }
  26072. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26073. }
  26074. /**
  26075. * Checks if a hash value for `key` exists.
  26076. *
  26077. * @private
  26078. * @name has
  26079. * @memberOf Hash
  26080. * @param {string} key The key of the entry to check.
  26081. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26082. */
  26083. function hashHas(key) {
  26084. var data = this.__data__;
  26085. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26086. }
  26087. /**
  26088. * Sets the hash `key` to `value`.
  26089. *
  26090. * @private
  26091. * @name set
  26092. * @memberOf Hash
  26093. * @param {string} key The key of the value to set.
  26094. * @param {*} value The value to set.
  26095. * @returns {Object} Returns the hash instance.
  26096. */
  26097. function hashSet(key, value) {
  26098. var data = this.__data__;
  26099. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26100. return this;
  26101. }
  26102. // Add methods to `Hash`.
  26103. Hash.prototype.clear = hashClear;
  26104. Hash.prototype['delete'] = hashDelete;
  26105. Hash.prototype.get = hashGet;
  26106. Hash.prototype.has = hashHas;
  26107. Hash.prototype.set = hashSet;
  26108. /**
  26109. * Creates an list cache object.
  26110. *
  26111. * @private
  26112. * @constructor
  26113. * @param {Array} [entries] The key-value pairs to cache.
  26114. */
  26115. function ListCache(entries) {
  26116. var index = -1,
  26117. length = entries ? entries.length : 0;
  26118. this.clear();
  26119. while (++index < length) {
  26120. var entry = entries[index];
  26121. this.set(entry[0], entry[1]);
  26122. }
  26123. }
  26124. /**
  26125. * Removes all key-value entries from the list cache.
  26126. *
  26127. * @private
  26128. * @name clear
  26129. * @memberOf ListCache
  26130. */
  26131. function listCacheClear() {
  26132. this.__data__ = [];
  26133. }
  26134. /**
  26135. * Removes `key` and its value from the list cache.
  26136. *
  26137. * @private
  26138. * @name delete
  26139. * @memberOf ListCache
  26140. * @param {string} key The key of the value to remove.
  26141. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26142. */
  26143. function listCacheDelete(key) {
  26144. var data = this.__data__,
  26145. index = assocIndexOf(data, key);
  26146. if (index < 0) {
  26147. return false;
  26148. }
  26149. var lastIndex = data.length - 1;
  26150. if (index == lastIndex) {
  26151. data.pop();
  26152. } else {
  26153. splice.call(data, index, 1);
  26154. }
  26155. return true;
  26156. }
  26157. /**
  26158. * Gets the list cache value for `key`.
  26159. *
  26160. * @private
  26161. * @name get
  26162. * @memberOf ListCache
  26163. * @param {string} key The key of the value to get.
  26164. * @returns {*} Returns the entry value.
  26165. */
  26166. function listCacheGet(key) {
  26167. var data = this.__data__,
  26168. index = assocIndexOf(data, key);
  26169. return index < 0 ? undefined : data[index][1];
  26170. }
  26171. /**
  26172. * Checks if a list cache value for `key` exists.
  26173. *
  26174. * @private
  26175. * @name has
  26176. * @memberOf ListCache
  26177. * @param {string} key The key of the entry to check.
  26178. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26179. */
  26180. function listCacheHas(key) {
  26181. return assocIndexOf(this.__data__, key) > -1;
  26182. }
  26183. /**
  26184. * Sets the list cache `key` to `value`.
  26185. *
  26186. * @private
  26187. * @name set
  26188. * @memberOf ListCache
  26189. * @param {string} key The key of the value to set.
  26190. * @param {*} value The value to set.
  26191. * @returns {Object} Returns the list cache instance.
  26192. */
  26193. function listCacheSet(key, value) {
  26194. var data = this.__data__,
  26195. index = assocIndexOf(data, key);
  26196. if (index < 0) {
  26197. data.push([key, value]);
  26198. } else {
  26199. data[index][1] = value;
  26200. }
  26201. return this;
  26202. }
  26203. // Add methods to `ListCache`.
  26204. ListCache.prototype.clear = listCacheClear;
  26205. ListCache.prototype['delete'] = listCacheDelete;
  26206. ListCache.prototype.get = listCacheGet;
  26207. ListCache.prototype.has = listCacheHas;
  26208. ListCache.prototype.set = listCacheSet;
  26209. /**
  26210. * Creates a map cache object to store key-value pairs.
  26211. *
  26212. * @private
  26213. * @constructor
  26214. * @param {Array} [entries] The key-value pairs to cache.
  26215. */
  26216. function MapCache(entries) {
  26217. var index = -1,
  26218. length = entries ? entries.length : 0;
  26219. this.clear();
  26220. while (++index < length) {
  26221. var entry = entries[index];
  26222. this.set(entry[0], entry[1]);
  26223. }
  26224. }
  26225. /**
  26226. * Removes all key-value entries from the map.
  26227. *
  26228. * @private
  26229. * @name clear
  26230. * @memberOf MapCache
  26231. */
  26232. function mapCacheClear() {
  26233. this.__data__ = {
  26234. 'hash': new Hash,
  26235. 'map': new (Map || ListCache),
  26236. 'string': new Hash
  26237. };
  26238. }
  26239. /**
  26240. * Removes `key` and its value from the map.
  26241. *
  26242. * @private
  26243. * @name delete
  26244. * @memberOf MapCache
  26245. * @param {string} key The key of the value to remove.
  26246. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26247. */
  26248. function mapCacheDelete(key) {
  26249. return getMapData(this, key)['delete'](key);
  26250. }
  26251. /**
  26252. * Gets the map value for `key`.
  26253. *
  26254. * @private
  26255. * @name get
  26256. * @memberOf MapCache
  26257. * @param {string} key The key of the value to get.
  26258. * @returns {*} Returns the entry value.
  26259. */
  26260. function mapCacheGet(key) {
  26261. return getMapData(this, key).get(key);
  26262. }
  26263. /**
  26264. * Checks if a map value for `key` exists.
  26265. *
  26266. * @private
  26267. * @name has
  26268. * @memberOf MapCache
  26269. * @param {string} key The key of the entry to check.
  26270. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26271. */
  26272. function mapCacheHas(key) {
  26273. return getMapData(this, key).has(key);
  26274. }
  26275. /**
  26276. * Sets the map `key` to `value`.
  26277. *
  26278. * @private
  26279. * @name set
  26280. * @memberOf MapCache
  26281. * @param {string} key The key of the value to set.
  26282. * @param {*} value The value to set.
  26283. * @returns {Object} Returns the map cache instance.
  26284. */
  26285. function mapCacheSet(key, value) {
  26286. getMapData(this, key).set(key, value);
  26287. return this;
  26288. }
  26289. // Add methods to `MapCache`.
  26290. MapCache.prototype.clear = mapCacheClear;
  26291. MapCache.prototype['delete'] = mapCacheDelete;
  26292. MapCache.prototype.get = mapCacheGet;
  26293. MapCache.prototype.has = mapCacheHas;
  26294. MapCache.prototype.set = mapCacheSet;
  26295. /**
  26296. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26297. *
  26298. * @private
  26299. * @param {Array} array The array to inspect.
  26300. * @param {*} key The key to search for.
  26301. * @returns {number} Returns the index of the matched value, else `-1`.
  26302. */
  26303. function assocIndexOf(array, key) {
  26304. var length = array.length;
  26305. while (length--) {
  26306. if (eq(array[length][0], key)) {
  26307. return length;
  26308. }
  26309. }
  26310. return -1;
  26311. }
  26312. /**
  26313. * The base implementation of `_.get` without support for default values.
  26314. *
  26315. * @private
  26316. * @param {Object} object The object to query.
  26317. * @param {Array|string} path The path of the property to get.
  26318. * @returns {*} Returns the resolved value.
  26319. */
  26320. function baseGet(object, path) {
  26321. path = isKey(path, object) ? [path] : castPath(path);
  26322. var index = 0,
  26323. length = path.length;
  26324. while (object != null && index < length) {
  26325. object = object[toKey(path[index++])];
  26326. }
  26327. return (index && index == length) ? object : undefined;
  26328. }
  26329. /**
  26330. * The base implementation of `_.isNative` without bad shim checks.
  26331. *
  26332. * @private
  26333. * @param {*} value The value to check.
  26334. * @returns {boolean} Returns `true` if `value` is a native function,
  26335. * else `false`.
  26336. */
  26337. function baseIsNative(value) {
  26338. if (!isObject(value) || isMasked(value)) {
  26339. return false;
  26340. }
  26341. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26342. return pattern.test(toSource(value));
  26343. }
  26344. /**
  26345. * The base implementation of `_.toString` which doesn't convert nullish
  26346. * values to empty strings.
  26347. *
  26348. * @private
  26349. * @param {*} value The value to process.
  26350. * @returns {string} Returns the string.
  26351. */
  26352. function baseToString(value) {
  26353. // Exit early for strings to avoid a performance hit in some environments.
  26354. if (typeof value == 'string') {
  26355. return value;
  26356. }
  26357. if (isSymbol(value)) {
  26358. return symbolToString ? symbolToString.call(value) : '';
  26359. }
  26360. var result = (value + '');
  26361. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26362. }
  26363. /**
  26364. * Casts `value` to a path array if it's not one.
  26365. *
  26366. * @private
  26367. * @param {*} value The value to inspect.
  26368. * @returns {Array} Returns the cast property path array.
  26369. */
  26370. function castPath(value) {
  26371. return isArray(value) ? value : stringToPath(value);
  26372. }
  26373. /**
  26374. * Gets the data for `map`.
  26375. *
  26376. * @private
  26377. * @param {Object} map The map to query.
  26378. * @param {string} key The reference key.
  26379. * @returns {*} Returns the map data.
  26380. */
  26381. function getMapData(map, key) {
  26382. var data = map.__data__;
  26383. return isKeyable(key)
  26384. ? data[typeof key == 'string' ? 'string' : 'hash']
  26385. : data.map;
  26386. }
  26387. /**
  26388. * Gets the native function at `key` of `object`.
  26389. *
  26390. * @private
  26391. * @param {Object} object The object to query.
  26392. * @param {string} key The key of the method to get.
  26393. * @returns {*} Returns the function if it's native, else `undefined`.
  26394. */
  26395. function getNative(object, key) {
  26396. var value = getValue(object, key);
  26397. return baseIsNative(value) ? value : undefined;
  26398. }
  26399. /**
  26400. * Checks if `value` is a property name and not a property path.
  26401. *
  26402. * @private
  26403. * @param {*} value The value to check.
  26404. * @param {Object} [object] The object to query keys on.
  26405. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26406. */
  26407. function isKey(value, object) {
  26408. if (isArray(value)) {
  26409. return false;
  26410. }
  26411. var type = typeof value;
  26412. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26413. value == null || isSymbol(value)) {
  26414. return true;
  26415. }
  26416. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26417. (object != null && value in Object(object));
  26418. }
  26419. /**
  26420. * Checks if `value` is suitable for use as unique object key.
  26421. *
  26422. * @private
  26423. * @param {*} value The value to check.
  26424. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26425. */
  26426. function isKeyable(value) {
  26427. var type = typeof value;
  26428. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26429. ? (value !== '__proto__')
  26430. : (value === null);
  26431. }
  26432. /**
  26433. * Checks if `func` has its source masked.
  26434. *
  26435. * @private
  26436. * @param {Function} func The function to check.
  26437. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26438. */
  26439. function isMasked(func) {
  26440. return !!maskSrcKey && (maskSrcKey in func);
  26441. }
  26442. /**
  26443. * Converts `string` to a property path array.
  26444. *
  26445. * @private
  26446. * @param {string} string The string to convert.
  26447. * @returns {Array} Returns the property path array.
  26448. */
  26449. var stringToPath = memoize(function(string) {
  26450. string = toString(string);
  26451. var result = [];
  26452. if (reLeadingDot.test(string)) {
  26453. result.push('');
  26454. }
  26455. string.replace(rePropName, function(match, number, quote, string) {
  26456. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26457. });
  26458. return result;
  26459. });
  26460. /**
  26461. * Converts `value` to a string key if it's not a string or symbol.
  26462. *
  26463. * @private
  26464. * @param {*} value The value to inspect.
  26465. * @returns {string|symbol} Returns the key.
  26466. */
  26467. function toKey(value) {
  26468. if (typeof value == 'string' || isSymbol(value)) {
  26469. return value;
  26470. }
  26471. var result = (value + '');
  26472. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26473. }
  26474. /**
  26475. * Converts `func` to its source code.
  26476. *
  26477. * @private
  26478. * @param {Function} func The function to process.
  26479. * @returns {string} Returns the source code.
  26480. */
  26481. function toSource(func) {
  26482. if (func != null) {
  26483. try {
  26484. return funcToString.call(func);
  26485. } catch (e) {}
  26486. try {
  26487. return (func + '');
  26488. } catch (e) {}
  26489. }
  26490. return '';
  26491. }
  26492. /**
  26493. * Creates a function that memoizes the result of `func`. If `resolver` is
  26494. * provided, it determines the cache key for storing the result based on the
  26495. * arguments provided to the memoized function. By default, the first argument
  26496. * provided to the memoized function is used as the map cache key. The `func`
  26497. * is invoked with the `this` binding of the memoized function.
  26498. *
  26499. * **Note:** The cache is exposed as the `cache` property on the memoized
  26500. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26501. * constructor with one whose instances implement the
  26502. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26503. * method interface of `delete`, `get`, `has`, and `set`.
  26504. *
  26505. * @static
  26506. * @memberOf _
  26507. * @since 0.1.0
  26508. * @category Function
  26509. * @param {Function} func The function to have its output memoized.
  26510. * @param {Function} [resolver] The function to resolve the cache key.
  26511. * @returns {Function} Returns the new memoized function.
  26512. * @example
  26513. *
  26514. * var object = { 'a': 1, 'b': 2 };
  26515. * var other = { 'c': 3, 'd': 4 };
  26516. *
  26517. * var values = _.memoize(_.values);
  26518. * values(object);
  26519. * // => [1, 2]
  26520. *
  26521. * values(other);
  26522. * // => [3, 4]
  26523. *
  26524. * object.a = 2;
  26525. * values(object);
  26526. * // => [1, 2]
  26527. *
  26528. * // Modify the result cache.
  26529. * values.cache.set(object, ['a', 'b']);
  26530. * values(object);
  26531. * // => ['a', 'b']
  26532. *
  26533. * // Replace `_.memoize.Cache`.
  26534. * _.memoize.Cache = WeakMap;
  26535. */
  26536. function memoize(func, resolver) {
  26537. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26538. throw new TypeError(FUNC_ERROR_TEXT);
  26539. }
  26540. var memoized = function() {
  26541. var args = arguments,
  26542. key = resolver ? resolver.apply(this, args) : args[0],
  26543. cache = memoized.cache;
  26544. if (cache.has(key)) {
  26545. return cache.get(key);
  26546. }
  26547. var result = func.apply(this, args);
  26548. memoized.cache = cache.set(key, result);
  26549. return result;
  26550. };
  26551. memoized.cache = new (memoize.Cache || MapCache);
  26552. return memoized;
  26553. }
  26554. // Assign cache to `_.memoize`.
  26555. memoize.Cache = MapCache;
  26556. /**
  26557. * Performs a
  26558. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26559. * comparison between two values to determine if they are equivalent.
  26560. *
  26561. * @static
  26562. * @memberOf _
  26563. * @since 4.0.0
  26564. * @category Lang
  26565. * @param {*} value The value to compare.
  26566. * @param {*} other The other value to compare.
  26567. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26568. * @example
  26569. *
  26570. * var object = { 'a': 1 };
  26571. * var other = { 'a': 1 };
  26572. *
  26573. * _.eq(object, object);
  26574. * // => true
  26575. *
  26576. * _.eq(object, other);
  26577. * // => false
  26578. *
  26579. * _.eq('a', 'a');
  26580. * // => true
  26581. *
  26582. * _.eq('a', Object('a'));
  26583. * // => false
  26584. *
  26585. * _.eq(NaN, NaN);
  26586. * // => true
  26587. */
  26588. function eq(value, other) {
  26589. return value === other || (value !== value && other !== other);
  26590. }
  26591. /**
  26592. * Checks if `value` is classified as an `Array` object.
  26593. *
  26594. * @static
  26595. * @memberOf _
  26596. * @since 0.1.0
  26597. * @category Lang
  26598. * @param {*} value The value to check.
  26599. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26600. * @example
  26601. *
  26602. * _.isArray([1, 2, 3]);
  26603. * // => true
  26604. *
  26605. * _.isArray(document.body.children);
  26606. * // => false
  26607. *
  26608. * _.isArray('abc');
  26609. * // => false
  26610. *
  26611. * _.isArray(_.noop);
  26612. * // => false
  26613. */
  26614. var isArray = Array.isArray;
  26615. /**
  26616. * Checks if `value` is classified as a `Function` object.
  26617. *
  26618. * @static
  26619. * @memberOf _
  26620. * @since 0.1.0
  26621. * @category Lang
  26622. * @param {*} value The value to check.
  26623. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26624. * @example
  26625. *
  26626. * _.isFunction(_);
  26627. * // => true
  26628. *
  26629. * _.isFunction(/abc/);
  26630. * // => false
  26631. */
  26632. function isFunction(value) {
  26633. // The use of `Object#toString` avoids issues with the `typeof` operator
  26634. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26635. var tag = isObject(value) ? objectToString.call(value) : '';
  26636. return tag == funcTag || tag == genTag;
  26637. }
  26638. /**
  26639. * Checks if `value` is the
  26640. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26641. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26642. *
  26643. * @static
  26644. * @memberOf _
  26645. * @since 0.1.0
  26646. * @category Lang
  26647. * @param {*} value The value to check.
  26648. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26649. * @example
  26650. *
  26651. * _.isObject({});
  26652. * // => true
  26653. *
  26654. * _.isObject([1, 2, 3]);
  26655. * // => true
  26656. *
  26657. * _.isObject(_.noop);
  26658. * // => true
  26659. *
  26660. * _.isObject(null);
  26661. * // => false
  26662. */
  26663. function isObject(value) {
  26664. var type = typeof value;
  26665. return !!value && (type == 'object' || type == 'function');
  26666. }
  26667. /**
  26668. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26669. * and has a `typeof` result of "object".
  26670. *
  26671. * @static
  26672. * @memberOf _
  26673. * @since 4.0.0
  26674. * @category Lang
  26675. * @param {*} value The value to check.
  26676. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26677. * @example
  26678. *
  26679. * _.isObjectLike({});
  26680. * // => true
  26681. *
  26682. * _.isObjectLike([1, 2, 3]);
  26683. * // => true
  26684. *
  26685. * _.isObjectLike(_.noop);
  26686. * // => false
  26687. *
  26688. * _.isObjectLike(null);
  26689. * // => false
  26690. */
  26691. function isObjectLike(value) {
  26692. return !!value && typeof value == 'object';
  26693. }
  26694. /**
  26695. * Checks if `value` is classified as a `Symbol` primitive or object.
  26696. *
  26697. * @static
  26698. * @memberOf _
  26699. * @since 4.0.0
  26700. * @category Lang
  26701. * @param {*} value The value to check.
  26702. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  26703. * @example
  26704. *
  26705. * _.isSymbol(Symbol.iterator);
  26706. * // => true
  26707. *
  26708. * _.isSymbol('abc');
  26709. * // => false
  26710. */
  26711. function isSymbol(value) {
  26712. return typeof value == 'symbol' ||
  26713. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  26714. }
  26715. /**
  26716. * Converts `value` to a string. An empty string is returned for `null`
  26717. * and `undefined` values. The sign of `-0` is preserved.
  26718. *
  26719. * @static
  26720. * @memberOf _
  26721. * @since 4.0.0
  26722. * @category Lang
  26723. * @param {*} value The value to process.
  26724. * @returns {string} Returns the string.
  26725. * @example
  26726. *
  26727. * _.toString(null);
  26728. * // => ''
  26729. *
  26730. * _.toString(-0);
  26731. * // => '-0'
  26732. *
  26733. * _.toString([1, 2, 3]);
  26734. * // => '1,2,3'
  26735. */
  26736. function toString(value) {
  26737. return value == null ? '' : baseToString(value);
  26738. }
  26739. /**
  26740. * Gets the value at `path` of `object`. If the resolved value is
  26741. * `undefined`, the `defaultValue` is returned in its place.
  26742. *
  26743. * @static
  26744. * @memberOf _
  26745. * @since 3.7.0
  26746. * @category Object
  26747. * @param {Object} object The object to query.
  26748. * @param {Array|string} path The path of the property to get.
  26749. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  26750. * @returns {*} Returns the resolved value.
  26751. * @example
  26752. *
  26753. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  26754. *
  26755. * _.get(object, 'a[0].b.c');
  26756. * // => 3
  26757. *
  26758. * _.get(object, ['a', '0', 'b', 'c']);
  26759. * // => 3
  26760. *
  26761. * _.get(object, 'a.b.c', 'default');
  26762. * // => 'default'
  26763. */
  26764. function get(object, path, defaultValue) {
  26765. var result = object == null ? undefined : baseGet(object, path);
  26766. return result === undefined ? defaultValue : result;
  26767. }
  26768. module.exports = get;
  26769. /***/ }),
  26770. /***/ 855:
  26771. /***/ (function(module, __unusedexports, __webpack_require__) {
  26772. module.exports = registerPlugin;
  26773. const factory = __webpack_require__(47);
  26774. function registerPlugin(plugins, pluginFunction) {
  26775. return factory(
  26776. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  26777. );
  26778. }
  26779. /***/ }),
  26780. /***/ 856:
  26781. /***/ (function(module, __unusedexports, __webpack_require__) {
  26782. module.exports = __webpack_require__(141);
  26783. /***/ }),
  26784. /***/ 863:
  26785. /***/ (function(module, __unusedexports, __webpack_require__) {
  26786. module.exports = authenticationBeforeRequest;
  26787. const btoa = __webpack_require__(675);
  26788. const withAuthorizationPrefix = __webpack_require__(143);
  26789. function authenticationBeforeRequest(state, options) {
  26790. if (typeof state.auth === "string") {
  26791. options.headers.authorization = withAuthorizationPrefix(state.auth);
  26792. return;
  26793. }
  26794. if (state.auth.username) {
  26795. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  26796. options.headers.authorization = `Basic ${hash}`;
  26797. if (state.otp) {
  26798. options.headers["x-github-otp"] = state.otp;
  26799. }
  26800. return;
  26801. }
  26802. if (state.auth.clientId) {
  26803. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  26804. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  26805. // URL though: `/applications/:client_id/tokens/:access_token`.
  26806. //
  26807. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  26808. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  26809. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  26810. //
  26811. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  26812. // as well as "/applications/123/tokens/token456"
  26813. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  26814. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  26815. options.headers.authorization = `Basic ${hash}`;
  26816. return;
  26817. }
  26818. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  26819. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  26820. return;
  26821. }
  26822. return Promise.resolve()
  26823. .then(() => {
  26824. return state.auth();
  26825. })
  26826. .then(authorization => {
  26827. options.headers.authorization = withAuthorizationPrefix(authorization);
  26828. });
  26829. }
  26830. /***/ }),
  26831. /***/ 866:
  26832. /***/ (function(module, __unusedexports, __webpack_require__) {
  26833. "use strict";
  26834. var shebangRegex = __webpack_require__(816);
  26835. module.exports = function (str) {
  26836. var match = str.match(shebangRegex);
  26837. if (!match) {
  26838. return null;
  26839. }
  26840. var arr = match[0].replace(/#! ?/, '').split(' ');
  26841. var bin = arr[0].split('/').pop();
  26842. var arg = arr[1];
  26843. return (bin === 'env' ?
  26844. arg :
  26845. bin + (arg ? ' ' + arg : '')
  26846. );
  26847. };
  26848. /***/ }),
  26849. /***/ 874:
  26850. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  26851. "use strict";
  26852. // Copyright (c) Microsoft. All rights reserved.
  26853. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  26854. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  26855. return new (P || (P = Promise))(function (resolve, reject) {
  26856. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  26857. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  26858. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  26859. step((generator = generator.apply(thisArg, _arguments || [])).next());
  26860. });
  26861. };
  26862. Object.defineProperty(exports, "__esModule", { value: true });
  26863. const url = __webpack_require__(835);
  26864. const http = __webpack_require__(605);
  26865. const https = __webpack_require__(34);
  26866. let fs;
  26867. let tunnel;
  26868. var HttpCodes;
  26869. (function (HttpCodes) {
  26870. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  26871. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  26872. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  26873. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  26874. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  26875. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  26876. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  26877. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  26878. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  26879. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  26880. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  26881. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  26882. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  26883. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  26884. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  26885. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  26886. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  26887. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  26888. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  26889. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  26890. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  26891. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  26892. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  26893. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  26894. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  26895. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  26896. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  26897. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  26898. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  26899. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  26900. const ExponentialBackoffCeiling = 10;
  26901. const ExponentialBackoffTimeSlice = 5;
  26902. class HttpClientResponse {
  26903. constructor(message) {
  26904. this.message = message;
  26905. }
  26906. readBody() {
  26907. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  26908. let output = '';
  26909. this.message.on('data', (chunk) => {
  26910. output += chunk;
  26911. });
  26912. this.message.on('end', () => {
  26913. resolve(output);
  26914. });
  26915. }));
  26916. }
  26917. }
  26918. exports.HttpClientResponse = HttpClientResponse;
  26919. function isHttps(requestUrl) {
  26920. let parsedUrl = url.parse(requestUrl);
  26921. return parsedUrl.protocol === 'https:';
  26922. }
  26923. exports.isHttps = isHttps;
  26924. var EnvironmentVariables;
  26925. (function (EnvironmentVariables) {
  26926. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  26927. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  26928. })(EnvironmentVariables || (EnvironmentVariables = {}));
  26929. class HttpClient {
  26930. constructor(userAgent, handlers, requestOptions) {
  26931. this._ignoreSslError = false;
  26932. this._allowRedirects = true;
  26933. this._maxRedirects = 50;
  26934. this._allowRetries = false;
  26935. this._maxRetries = 1;
  26936. this._keepAlive = false;
  26937. this._disposed = false;
  26938. this.userAgent = userAgent;
  26939. this.handlers = handlers || [];
  26940. this.requestOptions = requestOptions;
  26941. if (requestOptions) {
  26942. if (requestOptions.ignoreSslError != null) {
  26943. this._ignoreSslError = requestOptions.ignoreSslError;
  26944. }
  26945. this._socketTimeout = requestOptions.socketTimeout;
  26946. this._httpProxy = requestOptions.proxy;
  26947. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  26948. this._httpProxyBypassHosts = [];
  26949. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  26950. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  26951. });
  26952. }
  26953. this._certConfig = requestOptions.cert;
  26954. if (this._certConfig) {
  26955. // If using cert, need fs
  26956. fs = __webpack_require__(747);
  26957. // cache the cert content into memory, so we don't have to read it from disk every time
  26958. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  26959. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  26960. }
  26961. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  26962. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  26963. }
  26964. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  26965. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  26966. }
  26967. }
  26968. if (requestOptions.allowRedirects != null) {
  26969. this._allowRedirects = requestOptions.allowRedirects;
  26970. }
  26971. if (requestOptions.maxRedirects != null) {
  26972. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  26973. }
  26974. if (requestOptions.keepAlive != null) {
  26975. this._keepAlive = requestOptions.keepAlive;
  26976. }
  26977. if (requestOptions.allowRetries != null) {
  26978. this._allowRetries = requestOptions.allowRetries;
  26979. }
  26980. if (requestOptions.maxRetries != null) {
  26981. this._maxRetries = requestOptions.maxRetries;
  26982. }
  26983. }
  26984. }
  26985. options(requestUrl, additionalHeaders) {
  26986. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  26987. }
  26988. get(requestUrl, additionalHeaders) {
  26989. return this.request('GET', requestUrl, null, additionalHeaders || {});
  26990. }
  26991. del(requestUrl, additionalHeaders) {
  26992. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  26993. }
  26994. post(requestUrl, data, additionalHeaders) {
  26995. return this.request('POST', requestUrl, data, additionalHeaders || {});
  26996. }
  26997. patch(requestUrl, data, additionalHeaders) {
  26998. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  26999. }
  27000. put(requestUrl, data, additionalHeaders) {
  27001. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  27002. }
  27003. head(requestUrl, additionalHeaders) {
  27004. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  27005. }
  27006. sendStream(verb, requestUrl, stream, additionalHeaders) {
  27007. return this.request(verb, requestUrl, stream, additionalHeaders);
  27008. }
  27009. /**
  27010. * Makes a raw http request.
  27011. * All other methods such as get, post, patch, and request ultimately call this.
  27012. * Prefer get, del, post and patch
  27013. */
  27014. request(verb, requestUrl, data, headers) {
  27015. return __awaiter(this, void 0, void 0, function* () {
  27016. if (this._disposed) {
  27017. throw new Error("Client has already been disposed.");
  27018. }
  27019. let info = this._prepareRequest(verb, requestUrl, headers);
  27020. // Only perform retries on reads since writes may not be idempotent.
  27021. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  27022. let numTries = 0;
  27023. let response;
  27024. while (numTries < maxTries) {
  27025. response = yield this.requestRaw(info, data);
  27026. // Check if it's an authentication challenge
  27027. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  27028. let authenticationHandler;
  27029. for (let i = 0; i < this.handlers.length; i++) {
  27030. if (this.handlers[i].canHandleAuthentication(response)) {
  27031. authenticationHandler = this.handlers[i];
  27032. break;
  27033. }
  27034. }
  27035. if (authenticationHandler) {
  27036. return authenticationHandler.handleAuthentication(this, info, data);
  27037. }
  27038. else {
  27039. // We have received an unauthorized response but have no handlers to handle it.
  27040. // Let the response return to the caller.
  27041. return response;
  27042. }
  27043. }
  27044. let redirectsRemaining = this._maxRedirects;
  27045. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  27046. && this._allowRedirects
  27047. && redirectsRemaining > 0) {
  27048. const redirectUrl = response.message.headers["location"];
  27049. if (!redirectUrl) {
  27050. // if there's no location to redirect to, we won't
  27051. break;
  27052. }
  27053. // we need to finish reading the response before reassigning response
  27054. // which will leak the open socket.
  27055. yield response.readBody();
  27056. // let's make the request with the new redirectUrl
  27057. info = this._prepareRequest(verb, redirectUrl, headers);
  27058. response = yield this.requestRaw(info, data);
  27059. redirectsRemaining--;
  27060. }
  27061. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27062. // If not a retry code, return immediately instead of retrying
  27063. return response;
  27064. }
  27065. numTries += 1;
  27066. if (numTries < maxTries) {
  27067. yield response.readBody();
  27068. yield this._performExponentialBackoff(numTries);
  27069. }
  27070. }
  27071. return response;
  27072. });
  27073. }
  27074. /**
  27075. * Needs to be called if keepAlive is set to true in request options.
  27076. */
  27077. dispose() {
  27078. if (this._agent) {
  27079. this._agent.destroy();
  27080. }
  27081. this._disposed = true;
  27082. }
  27083. /**
  27084. * Raw request.
  27085. * @param info
  27086. * @param data
  27087. */
  27088. requestRaw(info, data) {
  27089. return new Promise((resolve, reject) => {
  27090. let callbackForResult = function (err, res) {
  27091. if (err) {
  27092. reject(err);
  27093. }
  27094. resolve(res);
  27095. };
  27096. this.requestRawWithCallback(info, data, callbackForResult);
  27097. });
  27098. }
  27099. /**
  27100. * Raw request with callback.
  27101. * @param info
  27102. * @param data
  27103. * @param onResult
  27104. */
  27105. requestRawWithCallback(info, data, onResult) {
  27106. let socket;
  27107. let isDataString = typeof (data) === 'string';
  27108. if (typeof (data) === 'string') {
  27109. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27110. }
  27111. let callbackCalled = false;
  27112. let handleResult = (err, res) => {
  27113. if (!callbackCalled) {
  27114. callbackCalled = true;
  27115. onResult(err, res);
  27116. }
  27117. };
  27118. let req = info.httpModule.request(info.options, (msg) => {
  27119. let res = new HttpClientResponse(msg);
  27120. handleResult(null, res);
  27121. });
  27122. req.on('socket', (sock) => {
  27123. socket = sock;
  27124. });
  27125. // If we ever get disconnected, we want the socket to timeout eventually
  27126. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27127. if (socket) {
  27128. socket.end();
  27129. }
  27130. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27131. });
  27132. req.on('error', function (err) {
  27133. // err has statusCode property
  27134. // res should have headers
  27135. handleResult(err, null);
  27136. });
  27137. if (data && typeof (data) === 'string') {
  27138. req.write(data, 'utf8');
  27139. }
  27140. if (data && typeof (data) !== 'string') {
  27141. data.on('close', function () {
  27142. req.end();
  27143. });
  27144. data.pipe(req);
  27145. }
  27146. else {
  27147. req.end();
  27148. }
  27149. }
  27150. _prepareRequest(method, requestUrl, headers) {
  27151. const info = {};
  27152. info.parsedUrl = url.parse(requestUrl);
  27153. const usingSsl = info.parsedUrl.protocol === 'https:';
  27154. info.httpModule = usingSsl ? https : http;
  27155. const defaultPort = usingSsl ? 443 : 80;
  27156. info.options = {};
  27157. info.options.host = info.parsedUrl.hostname;
  27158. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27159. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27160. info.options.method = method;
  27161. info.options.headers = this._mergeHeaders(headers);
  27162. info.options.headers["user-agent"] = this.userAgent;
  27163. info.options.agent = this._getAgent(requestUrl);
  27164. // gives handlers an opportunity to participate
  27165. if (this.handlers && !this._isPresigned(requestUrl)) {
  27166. this.handlers.forEach((handler) => {
  27167. handler.prepareRequest(info.options);
  27168. });
  27169. }
  27170. return info;
  27171. }
  27172. _isPresigned(requestUrl) {
  27173. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27174. const patterns = this.requestOptions.presignedUrlPatterns;
  27175. for (let i = 0; i < patterns.length; i++) {
  27176. if (requestUrl.match(patterns[i])) {
  27177. return true;
  27178. }
  27179. }
  27180. }
  27181. return false;
  27182. }
  27183. _mergeHeaders(headers) {
  27184. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27185. if (this.requestOptions && this.requestOptions.headers) {
  27186. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27187. }
  27188. return lowercaseKeys(headers || {});
  27189. }
  27190. _getAgent(requestUrl) {
  27191. let agent;
  27192. let proxy = this._getProxy(requestUrl);
  27193. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27194. if (this._keepAlive && useProxy) {
  27195. agent = this._proxyAgent;
  27196. }
  27197. if (this._keepAlive && !useProxy) {
  27198. agent = this._agent;
  27199. }
  27200. // if agent is already assigned use that agent.
  27201. if (!!agent) {
  27202. return agent;
  27203. }
  27204. let parsedUrl = url.parse(requestUrl);
  27205. const usingSsl = parsedUrl.protocol === 'https:';
  27206. let maxSockets = 100;
  27207. if (!!this.requestOptions) {
  27208. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27209. }
  27210. if (useProxy) {
  27211. // If using proxy, need tunnel
  27212. if (!tunnel) {
  27213. tunnel = __webpack_require__(856);
  27214. }
  27215. const agentOptions = {
  27216. maxSockets: maxSockets,
  27217. keepAlive: this._keepAlive,
  27218. proxy: {
  27219. proxyAuth: proxy.proxyAuth,
  27220. host: proxy.proxyUrl.hostname,
  27221. port: proxy.proxyUrl.port
  27222. },
  27223. };
  27224. let tunnelAgent;
  27225. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27226. if (usingSsl) {
  27227. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27228. }
  27229. else {
  27230. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27231. }
  27232. agent = tunnelAgent(agentOptions);
  27233. this._proxyAgent = agent;
  27234. }
  27235. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27236. if (this._keepAlive && !agent) {
  27237. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27238. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27239. this._agent = agent;
  27240. }
  27241. // if not using private agent and tunnel agent isn't setup then use global agent
  27242. if (!agent) {
  27243. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27244. }
  27245. if (usingSsl && this._ignoreSslError) {
  27246. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27247. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27248. // we have to cast it to any and change it directly
  27249. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27250. }
  27251. if (usingSsl && this._certConfig) {
  27252. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27253. }
  27254. return agent;
  27255. }
  27256. _getProxy(requestUrl) {
  27257. const parsedUrl = url.parse(requestUrl);
  27258. let usingSsl = parsedUrl.protocol === 'https:';
  27259. let proxyConfig = this._httpProxy;
  27260. // fallback to http_proxy and https_proxy env
  27261. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27262. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27263. if (!proxyConfig) {
  27264. if (https_proxy && usingSsl) {
  27265. proxyConfig = {
  27266. proxyUrl: https_proxy
  27267. };
  27268. }
  27269. else if (http_proxy) {
  27270. proxyConfig = {
  27271. proxyUrl: http_proxy
  27272. };
  27273. }
  27274. }
  27275. let proxyUrl;
  27276. let proxyAuth;
  27277. if (proxyConfig) {
  27278. if (proxyConfig.proxyUrl.length > 0) {
  27279. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27280. }
  27281. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27282. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27283. }
  27284. }
  27285. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27286. }
  27287. _isBypassProxy(requestUrl) {
  27288. if (!this._httpProxyBypassHosts) {
  27289. return false;
  27290. }
  27291. let bypass = false;
  27292. this._httpProxyBypassHosts.forEach(bypassHost => {
  27293. if (bypassHost.test(requestUrl)) {
  27294. bypass = true;
  27295. }
  27296. });
  27297. return bypass;
  27298. }
  27299. _performExponentialBackoff(retryNumber) {
  27300. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27301. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27302. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27303. }
  27304. }
  27305. exports.HttpClient = HttpClient;
  27306. /***/ }),
  27307. /***/ 881:
  27308. /***/ (function(module) {
  27309. "use strict";
  27310. const isWin = process.platform === 'win32';
  27311. function notFoundError(original, syscall) {
  27312. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27313. code: 'ENOENT',
  27314. errno: 'ENOENT',
  27315. syscall: `${syscall} ${original.command}`,
  27316. path: original.command,
  27317. spawnargs: original.args,
  27318. });
  27319. }
  27320. function hookChildProcess(cp, parsed) {
  27321. if (!isWin) {
  27322. return;
  27323. }
  27324. const originalEmit = cp.emit;
  27325. cp.emit = function (name, arg1) {
  27326. // If emitting "exit" event and exit code is 1, we need to check if
  27327. // the command exists and emit an "error" instead
  27328. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27329. if (name === 'exit') {
  27330. const err = verifyENOENT(arg1, parsed, 'spawn');
  27331. if (err) {
  27332. return originalEmit.call(cp, 'error', err);
  27333. }
  27334. }
  27335. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27336. };
  27337. }
  27338. function verifyENOENT(status, parsed) {
  27339. if (isWin && status === 1 && !parsed.file) {
  27340. return notFoundError(parsed.original, 'spawn');
  27341. }
  27342. return null;
  27343. }
  27344. function verifyENOENTSync(status, parsed) {
  27345. if (isWin && status === 1 && !parsed.file) {
  27346. return notFoundError(parsed.original, 'spawnSync');
  27347. }
  27348. return null;
  27349. }
  27350. module.exports = {
  27351. hookChildProcess,
  27352. verifyENOENT,
  27353. verifyENOENTSync,
  27354. notFoundError,
  27355. };
  27356. /***/ }),
  27357. /***/ 883:
  27358. /***/ (function(module) {
  27359. /**
  27360. * lodash (Custom Build) <https://lodash.com/>
  27361. * Build: `lodash modularize exports="npm" -o ./`
  27362. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27363. * Released under MIT license <https://lodash.com/license>
  27364. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27365. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27366. */
  27367. /** Used as the `TypeError` message for "Functions" methods. */
  27368. var FUNC_ERROR_TEXT = 'Expected a function';
  27369. /** Used to stand-in for `undefined` hash values. */
  27370. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27371. /** Used as references for various `Number` constants. */
  27372. var INFINITY = 1 / 0,
  27373. MAX_SAFE_INTEGER = 9007199254740991;
  27374. /** `Object#toString` result references. */
  27375. var funcTag = '[object Function]',
  27376. genTag = '[object GeneratorFunction]',
  27377. symbolTag = '[object Symbol]';
  27378. /** Used to match property names within property paths. */
  27379. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27380. reIsPlainProp = /^\w*$/,
  27381. reLeadingDot = /^\./,
  27382. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27383. /**
  27384. * Used to match `RegExp`
  27385. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27386. */
  27387. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27388. /** Used to match backslashes in property paths. */
  27389. var reEscapeChar = /\\(\\)?/g;
  27390. /** Used to detect host constructors (Safari). */
  27391. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27392. /** Used to detect unsigned integer values. */
  27393. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27394. /** Detect free variable `global` from Node.js. */
  27395. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27396. /** Detect free variable `self`. */
  27397. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27398. /** Used as a reference to the global object. */
  27399. var root = freeGlobal || freeSelf || Function('return this')();
  27400. /**
  27401. * Gets the value at `key` of `object`.
  27402. *
  27403. * @private
  27404. * @param {Object} [object] The object to query.
  27405. * @param {string} key The key of the property to get.
  27406. * @returns {*} Returns the property value.
  27407. */
  27408. function getValue(object, key) {
  27409. return object == null ? undefined : object[key];
  27410. }
  27411. /**
  27412. * Checks if `value` is a host object in IE < 9.
  27413. *
  27414. * @private
  27415. * @param {*} value The value to check.
  27416. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27417. */
  27418. function isHostObject(value) {
  27419. // Many host objects are `Object` objects that can coerce to strings
  27420. // despite having improperly defined `toString` methods.
  27421. var result = false;
  27422. if (value != null && typeof value.toString != 'function') {
  27423. try {
  27424. result = !!(value + '');
  27425. } catch (e) {}
  27426. }
  27427. return result;
  27428. }
  27429. /** Used for built-in method references. */
  27430. var arrayProto = Array.prototype,
  27431. funcProto = Function.prototype,
  27432. objectProto = Object.prototype;
  27433. /** Used to detect overreaching core-js shims. */
  27434. var coreJsData = root['__core-js_shared__'];
  27435. /** Used to detect methods masquerading as native. */
  27436. var maskSrcKey = (function() {
  27437. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27438. return uid ? ('Symbol(src)_1.' + uid) : '';
  27439. }());
  27440. /** Used to resolve the decompiled source of functions. */
  27441. var funcToString = funcProto.toString;
  27442. /** Used to check objects for own properties. */
  27443. var hasOwnProperty = objectProto.hasOwnProperty;
  27444. /**
  27445. * Used to resolve the
  27446. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27447. * of values.
  27448. */
  27449. var objectToString = objectProto.toString;
  27450. /** Used to detect if a method is native. */
  27451. var reIsNative = RegExp('^' +
  27452. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27453. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27454. );
  27455. /** Built-in value references. */
  27456. var Symbol = root.Symbol,
  27457. splice = arrayProto.splice;
  27458. /* Built-in method references that are verified to be native. */
  27459. var Map = getNative(root, 'Map'),
  27460. nativeCreate = getNative(Object, 'create');
  27461. /** Used to convert symbols to primitives and strings. */
  27462. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27463. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27464. /**
  27465. * Creates a hash object.
  27466. *
  27467. * @private
  27468. * @constructor
  27469. * @param {Array} [entries] The key-value pairs to cache.
  27470. */
  27471. function Hash(entries) {
  27472. var index = -1,
  27473. length = entries ? entries.length : 0;
  27474. this.clear();
  27475. while (++index < length) {
  27476. var entry = entries[index];
  27477. this.set(entry[0], entry[1]);
  27478. }
  27479. }
  27480. /**
  27481. * Removes all key-value entries from the hash.
  27482. *
  27483. * @private
  27484. * @name clear
  27485. * @memberOf Hash
  27486. */
  27487. function hashClear() {
  27488. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27489. }
  27490. /**
  27491. * Removes `key` and its value from the hash.
  27492. *
  27493. * @private
  27494. * @name delete
  27495. * @memberOf Hash
  27496. * @param {Object} hash The hash to modify.
  27497. * @param {string} key The key of the value to remove.
  27498. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27499. */
  27500. function hashDelete(key) {
  27501. return this.has(key) && delete this.__data__[key];
  27502. }
  27503. /**
  27504. * Gets the hash value for `key`.
  27505. *
  27506. * @private
  27507. * @name get
  27508. * @memberOf Hash
  27509. * @param {string} key The key of the value to get.
  27510. * @returns {*} Returns the entry value.
  27511. */
  27512. function hashGet(key) {
  27513. var data = this.__data__;
  27514. if (nativeCreate) {
  27515. var result = data[key];
  27516. return result === HASH_UNDEFINED ? undefined : result;
  27517. }
  27518. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27519. }
  27520. /**
  27521. * Checks if a hash value for `key` exists.
  27522. *
  27523. * @private
  27524. * @name has
  27525. * @memberOf Hash
  27526. * @param {string} key The key of the entry to check.
  27527. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27528. */
  27529. function hashHas(key) {
  27530. var data = this.__data__;
  27531. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27532. }
  27533. /**
  27534. * Sets the hash `key` to `value`.
  27535. *
  27536. * @private
  27537. * @name set
  27538. * @memberOf Hash
  27539. * @param {string} key The key of the value to set.
  27540. * @param {*} value The value to set.
  27541. * @returns {Object} Returns the hash instance.
  27542. */
  27543. function hashSet(key, value) {
  27544. var data = this.__data__;
  27545. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27546. return this;
  27547. }
  27548. // Add methods to `Hash`.
  27549. Hash.prototype.clear = hashClear;
  27550. Hash.prototype['delete'] = hashDelete;
  27551. Hash.prototype.get = hashGet;
  27552. Hash.prototype.has = hashHas;
  27553. Hash.prototype.set = hashSet;
  27554. /**
  27555. * Creates an list cache object.
  27556. *
  27557. * @private
  27558. * @constructor
  27559. * @param {Array} [entries] The key-value pairs to cache.
  27560. */
  27561. function ListCache(entries) {
  27562. var index = -1,
  27563. length = entries ? entries.length : 0;
  27564. this.clear();
  27565. while (++index < length) {
  27566. var entry = entries[index];
  27567. this.set(entry[0], entry[1]);
  27568. }
  27569. }
  27570. /**
  27571. * Removes all key-value entries from the list cache.
  27572. *
  27573. * @private
  27574. * @name clear
  27575. * @memberOf ListCache
  27576. */
  27577. function listCacheClear() {
  27578. this.__data__ = [];
  27579. }
  27580. /**
  27581. * Removes `key` and its value from the list cache.
  27582. *
  27583. * @private
  27584. * @name delete
  27585. * @memberOf ListCache
  27586. * @param {string} key The key of the value to remove.
  27587. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27588. */
  27589. function listCacheDelete(key) {
  27590. var data = this.__data__,
  27591. index = assocIndexOf(data, key);
  27592. if (index < 0) {
  27593. return false;
  27594. }
  27595. var lastIndex = data.length - 1;
  27596. if (index == lastIndex) {
  27597. data.pop();
  27598. } else {
  27599. splice.call(data, index, 1);
  27600. }
  27601. return true;
  27602. }
  27603. /**
  27604. * Gets the list cache value for `key`.
  27605. *
  27606. * @private
  27607. * @name get
  27608. * @memberOf ListCache
  27609. * @param {string} key The key of the value to get.
  27610. * @returns {*} Returns the entry value.
  27611. */
  27612. function listCacheGet(key) {
  27613. var data = this.__data__,
  27614. index = assocIndexOf(data, key);
  27615. return index < 0 ? undefined : data[index][1];
  27616. }
  27617. /**
  27618. * Checks if a list cache value for `key` exists.
  27619. *
  27620. * @private
  27621. * @name has
  27622. * @memberOf ListCache
  27623. * @param {string} key The key of the entry to check.
  27624. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27625. */
  27626. function listCacheHas(key) {
  27627. return assocIndexOf(this.__data__, key) > -1;
  27628. }
  27629. /**
  27630. * Sets the list cache `key` to `value`.
  27631. *
  27632. * @private
  27633. * @name set
  27634. * @memberOf ListCache
  27635. * @param {string} key The key of the value to set.
  27636. * @param {*} value The value to set.
  27637. * @returns {Object} Returns the list cache instance.
  27638. */
  27639. function listCacheSet(key, value) {
  27640. var data = this.__data__,
  27641. index = assocIndexOf(data, key);
  27642. if (index < 0) {
  27643. data.push([key, value]);
  27644. } else {
  27645. data[index][1] = value;
  27646. }
  27647. return this;
  27648. }
  27649. // Add methods to `ListCache`.
  27650. ListCache.prototype.clear = listCacheClear;
  27651. ListCache.prototype['delete'] = listCacheDelete;
  27652. ListCache.prototype.get = listCacheGet;
  27653. ListCache.prototype.has = listCacheHas;
  27654. ListCache.prototype.set = listCacheSet;
  27655. /**
  27656. * Creates a map cache object to store key-value pairs.
  27657. *
  27658. * @private
  27659. * @constructor
  27660. * @param {Array} [entries] The key-value pairs to cache.
  27661. */
  27662. function MapCache(entries) {
  27663. var index = -1,
  27664. length = entries ? entries.length : 0;
  27665. this.clear();
  27666. while (++index < length) {
  27667. var entry = entries[index];
  27668. this.set(entry[0], entry[1]);
  27669. }
  27670. }
  27671. /**
  27672. * Removes all key-value entries from the map.
  27673. *
  27674. * @private
  27675. * @name clear
  27676. * @memberOf MapCache
  27677. */
  27678. function mapCacheClear() {
  27679. this.__data__ = {
  27680. 'hash': new Hash,
  27681. 'map': new (Map || ListCache),
  27682. 'string': new Hash
  27683. };
  27684. }
  27685. /**
  27686. * Removes `key` and its value from the map.
  27687. *
  27688. * @private
  27689. * @name delete
  27690. * @memberOf MapCache
  27691. * @param {string} key The key of the value to remove.
  27692. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27693. */
  27694. function mapCacheDelete(key) {
  27695. return getMapData(this, key)['delete'](key);
  27696. }
  27697. /**
  27698. * Gets the map value for `key`.
  27699. *
  27700. * @private
  27701. * @name get
  27702. * @memberOf MapCache
  27703. * @param {string} key The key of the value to get.
  27704. * @returns {*} Returns the entry value.
  27705. */
  27706. function mapCacheGet(key) {
  27707. return getMapData(this, key).get(key);
  27708. }
  27709. /**
  27710. * Checks if a map value for `key` exists.
  27711. *
  27712. * @private
  27713. * @name has
  27714. * @memberOf MapCache
  27715. * @param {string} key The key of the entry to check.
  27716. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27717. */
  27718. function mapCacheHas(key) {
  27719. return getMapData(this, key).has(key);
  27720. }
  27721. /**
  27722. * Sets the map `key` to `value`.
  27723. *
  27724. * @private
  27725. * @name set
  27726. * @memberOf MapCache
  27727. * @param {string} key The key of the value to set.
  27728. * @param {*} value The value to set.
  27729. * @returns {Object} Returns the map cache instance.
  27730. */
  27731. function mapCacheSet(key, value) {
  27732. getMapData(this, key).set(key, value);
  27733. return this;
  27734. }
  27735. // Add methods to `MapCache`.
  27736. MapCache.prototype.clear = mapCacheClear;
  27737. MapCache.prototype['delete'] = mapCacheDelete;
  27738. MapCache.prototype.get = mapCacheGet;
  27739. MapCache.prototype.has = mapCacheHas;
  27740. MapCache.prototype.set = mapCacheSet;
  27741. /**
  27742. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  27743. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  27744. * for equality comparisons.
  27745. *
  27746. * @private
  27747. * @param {Object} object The object to modify.
  27748. * @param {string} key The key of the property to assign.
  27749. * @param {*} value The value to assign.
  27750. */
  27751. function assignValue(object, key, value) {
  27752. var objValue = object[key];
  27753. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  27754. (value === undefined && !(key in object))) {
  27755. object[key] = value;
  27756. }
  27757. }
  27758. /**
  27759. * Gets the index at which the `key` is found in `array` of key-value pairs.
  27760. *
  27761. * @private
  27762. * @param {Array} array The array to inspect.
  27763. * @param {*} key The key to search for.
  27764. * @returns {number} Returns the index of the matched value, else `-1`.
  27765. */
  27766. function assocIndexOf(array, key) {
  27767. var length = array.length;
  27768. while (length--) {
  27769. if (eq(array[length][0], key)) {
  27770. return length;
  27771. }
  27772. }
  27773. return -1;
  27774. }
  27775. /**
  27776. * The base implementation of `_.isNative` without bad shim checks.
  27777. *
  27778. * @private
  27779. * @param {*} value The value to check.
  27780. * @returns {boolean} Returns `true` if `value` is a native function,
  27781. * else `false`.
  27782. */
  27783. function baseIsNative(value) {
  27784. if (!isObject(value) || isMasked(value)) {
  27785. return false;
  27786. }
  27787. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  27788. return pattern.test(toSource(value));
  27789. }
  27790. /**
  27791. * The base implementation of `_.set`.
  27792. *
  27793. * @private
  27794. * @param {Object} object The object to modify.
  27795. * @param {Array|string} path The path of the property to set.
  27796. * @param {*} value The value to set.
  27797. * @param {Function} [customizer] The function to customize path creation.
  27798. * @returns {Object} Returns `object`.
  27799. */
  27800. function baseSet(object, path, value, customizer) {
  27801. if (!isObject(object)) {
  27802. return object;
  27803. }
  27804. path = isKey(path, object) ? [path] : castPath(path);
  27805. var index = -1,
  27806. length = path.length,
  27807. lastIndex = length - 1,
  27808. nested = object;
  27809. while (nested != null && ++index < length) {
  27810. var key = toKey(path[index]),
  27811. newValue = value;
  27812. if (index != lastIndex) {
  27813. var objValue = nested[key];
  27814. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27815. if (newValue === undefined) {
  27816. newValue = isObject(objValue)
  27817. ? objValue
  27818. : (isIndex(path[index + 1]) ? [] : {});
  27819. }
  27820. }
  27821. assignValue(nested, key, newValue);
  27822. nested = nested[key];
  27823. }
  27824. return object;
  27825. }
  27826. /**
  27827. * The base implementation of `_.toString` which doesn't convert nullish
  27828. * values to empty strings.
  27829. *
  27830. * @private
  27831. * @param {*} value The value to process.
  27832. * @returns {string} Returns the string.
  27833. */
  27834. function baseToString(value) {
  27835. // Exit early for strings to avoid a performance hit in some environments.
  27836. if (typeof value == 'string') {
  27837. return value;
  27838. }
  27839. if (isSymbol(value)) {
  27840. return symbolToString ? symbolToString.call(value) : '';
  27841. }
  27842. var result = (value + '');
  27843. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27844. }
  27845. /**
  27846. * Casts `value` to a path array if it's not one.
  27847. *
  27848. * @private
  27849. * @param {*} value The value to inspect.
  27850. * @returns {Array} Returns the cast property path array.
  27851. */
  27852. function castPath(value) {
  27853. return isArray(value) ? value : stringToPath(value);
  27854. }
  27855. /**
  27856. * Gets the data for `map`.
  27857. *
  27858. * @private
  27859. * @param {Object} map The map to query.
  27860. * @param {string} key The reference key.
  27861. * @returns {*} Returns the map data.
  27862. */
  27863. function getMapData(map, key) {
  27864. var data = map.__data__;
  27865. return isKeyable(key)
  27866. ? data[typeof key == 'string' ? 'string' : 'hash']
  27867. : data.map;
  27868. }
  27869. /**
  27870. * Gets the native function at `key` of `object`.
  27871. *
  27872. * @private
  27873. * @param {Object} object The object to query.
  27874. * @param {string} key The key of the method to get.
  27875. * @returns {*} Returns the function if it's native, else `undefined`.
  27876. */
  27877. function getNative(object, key) {
  27878. var value = getValue(object, key);
  27879. return baseIsNative(value) ? value : undefined;
  27880. }
  27881. /**
  27882. * Checks if `value` is a valid array-like index.
  27883. *
  27884. * @private
  27885. * @param {*} value The value to check.
  27886. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  27887. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  27888. */
  27889. function isIndex(value, length) {
  27890. length = length == null ? MAX_SAFE_INTEGER : length;
  27891. return !!length &&
  27892. (typeof value == 'number' || reIsUint.test(value)) &&
  27893. (value > -1 && value % 1 == 0 && value < length);
  27894. }
  27895. /**
  27896. * Checks if `value` is a property name and not a property path.
  27897. *
  27898. * @private
  27899. * @param {*} value The value to check.
  27900. * @param {Object} [object] The object to query keys on.
  27901. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  27902. */
  27903. function isKey(value, object) {
  27904. if (isArray(value)) {
  27905. return false;
  27906. }
  27907. var type = typeof value;
  27908. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  27909. value == null || isSymbol(value)) {
  27910. return true;
  27911. }
  27912. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  27913. (object != null && value in Object(object));
  27914. }
  27915. /**
  27916. * Checks if `value` is suitable for use as unique object key.
  27917. *
  27918. * @private
  27919. * @param {*} value The value to check.
  27920. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  27921. */
  27922. function isKeyable(value) {
  27923. var type = typeof value;
  27924. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  27925. ? (value !== '__proto__')
  27926. : (value === null);
  27927. }
  27928. /**
  27929. * Checks if `func` has its source masked.
  27930. *
  27931. * @private
  27932. * @param {Function} func The function to check.
  27933. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  27934. */
  27935. function isMasked(func) {
  27936. return !!maskSrcKey && (maskSrcKey in func);
  27937. }
  27938. /**
  27939. * Converts `string` to a property path array.
  27940. *
  27941. * @private
  27942. * @param {string} string The string to convert.
  27943. * @returns {Array} Returns the property path array.
  27944. */
  27945. var stringToPath = memoize(function(string) {
  27946. string = toString(string);
  27947. var result = [];
  27948. if (reLeadingDot.test(string)) {
  27949. result.push('');
  27950. }
  27951. string.replace(rePropName, function(match, number, quote, string) {
  27952. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  27953. });
  27954. return result;
  27955. });
  27956. /**
  27957. * Converts `value` to a string key if it's not a string or symbol.
  27958. *
  27959. * @private
  27960. * @param {*} value The value to inspect.
  27961. * @returns {string|symbol} Returns the key.
  27962. */
  27963. function toKey(value) {
  27964. if (typeof value == 'string' || isSymbol(value)) {
  27965. return value;
  27966. }
  27967. var result = (value + '');
  27968. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27969. }
  27970. /**
  27971. * Converts `func` to its source code.
  27972. *
  27973. * @private
  27974. * @param {Function} func The function to process.
  27975. * @returns {string} Returns the source code.
  27976. */
  27977. function toSource(func) {
  27978. if (func != null) {
  27979. try {
  27980. return funcToString.call(func);
  27981. } catch (e) {}
  27982. try {
  27983. return (func + '');
  27984. } catch (e) {}
  27985. }
  27986. return '';
  27987. }
  27988. /**
  27989. * Creates a function that memoizes the result of `func`. If `resolver` is
  27990. * provided, it determines the cache key for storing the result based on the
  27991. * arguments provided to the memoized function. By default, the first argument
  27992. * provided to the memoized function is used as the map cache key. The `func`
  27993. * is invoked with the `this` binding of the memoized function.
  27994. *
  27995. * **Note:** The cache is exposed as the `cache` property on the memoized
  27996. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  27997. * constructor with one whose instances implement the
  27998. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  27999. * method interface of `delete`, `get`, `has`, and `set`.
  28000. *
  28001. * @static
  28002. * @memberOf _
  28003. * @since 0.1.0
  28004. * @category Function
  28005. * @param {Function} func The function to have its output memoized.
  28006. * @param {Function} [resolver] The function to resolve the cache key.
  28007. * @returns {Function} Returns the new memoized function.
  28008. * @example
  28009. *
  28010. * var object = { 'a': 1, 'b': 2 };
  28011. * var other = { 'c': 3, 'd': 4 };
  28012. *
  28013. * var values = _.memoize(_.values);
  28014. * values(object);
  28015. * // => [1, 2]
  28016. *
  28017. * values(other);
  28018. * // => [3, 4]
  28019. *
  28020. * object.a = 2;
  28021. * values(object);
  28022. * // => [1, 2]
  28023. *
  28024. * // Modify the result cache.
  28025. * values.cache.set(object, ['a', 'b']);
  28026. * values(object);
  28027. * // => ['a', 'b']
  28028. *
  28029. * // Replace `_.memoize.Cache`.
  28030. * _.memoize.Cache = WeakMap;
  28031. */
  28032. function memoize(func, resolver) {
  28033. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28034. throw new TypeError(FUNC_ERROR_TEXT);
  28035. }
  28036. var memoized = function() {
  28037. var args = arguments,
  28038. key = resolver ? resolver.apply(this, args) : args[0],
  28039. cache = memoized.cache;
  28040. if (cache.has(key)) {
  28041. return cache.get(key);
  28042. }
  28043. var result = func.apply(this, args);
  28044. memoized.cache = cache.set(key, result);
  28045. return result;
  28046. };
  28047. memoized.cache = new (memoize.Cache || MapCache);
  28048. return memoized;
  28049. }
  28050. // Assign cache to `_.memoize`.
  28051. memoize.Cache = MapCache;
  28052. /**
  28053. * Performs a
  28054. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28055. * comparison between two values to determine if they are equivalent.
  28056. *
  28057. * @static
  28058. * @memberOf _
  28059. * @since 4.0.0
  28060. * @category Lang
  28061. * @param {*} value The value to compare.
  28062. * @param {*} other The other value to compare.
  28063. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28064. * @example
  28065. *
  28066. * var object = { 'a': 1 };
  28067. * var other = { 'a': 1 };
  28068. *
  28069. * _.eq(object, object);
  28070. * // => true
  28071. *
  28072. * _.eq(object, other);
  28073. * // => false
  28074. *
  28075. * _.eq('a', 'a');
  28076. * // => true
  28077. *
  28078. * _.eq('a', Object('a'));
  28079. * // => false
  28080. *
  28081. * _.eq(NaN, NaN);
  28082. * // => true
  28083. */
  28084. function eq(value, other) {
  28085. return value === other || (value !== value && other !== other);
  28086. }
  28087. /**
  28088. * Checks if `value` is classified as an `Array` object.
  28089. *
  28090. * @static
  28091. * @memberOf _
  28092. * @since 0.1.0
  28093. * @category Lang
  28094. * @param {*} value The value to check.
  28095. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28096. * @example
  28097. *
  28098. * _.isArray([1, 2, 3]);
  28099. * // => true
  28100. *
  28101. * _.isArray(document.body.children);
  28102. * // => false
  28103. *
  28104. * _.isArray('abc');
  28105. * // => false
  28106. *
  28107. * _.isArray(_.noop);
  28108. * // => false
  28109. */
  28110. var isArray = Array.isArray;
  28111. /**
  28112. * Checks if `value` is classified as a `Function` object.
  28113. *
  28114. * @static
  28115. * @memberOf _
  28116. * @since 0.1.0
  28117. * @category Lang
  28118. * @param {*} value The value to check.
  28119. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28120. * @example
  28121. *
  28122. * _.isFunction(_);
  28123. * // => true
  28124. *
  28125. * _.isFunction(/abc/);
  28126. * // => false
  28127. */
  28128. function isFunction(value) {
  28129. // The use of `Object#toString` avoids issues with the `typeof` operator
  28130. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28131. var tag = isObject(value) ? objectToString.call(value) : '';
  28132. return tag == funcTag || tag == genTag;
  28133. }
  28134. /**
  28135. * Checks if `value` is the
  28136. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28137. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28138. *
  28139. * @static
  28140. * @memberOf _
  28141. * @since 0.1.0
  28142. * @category Lang
  28143. * @param {*} value The value to check.
  28144. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28145. * @example
  28146. *
  28147. * _.isObject({});
  28148. * // => true
  28149. *
  28150. * _.isObject([1, 2, 3]);
  28151. * // => true
  28152. *
  28153. * _.isObject(_.noop);
  28154. * // => true
  28155. *
  28156. * _.isObject(null);
  28157. * // => false
  28158. */
  28159. function isObject(value) {
  28160. var type = typeof value;
  28161. return !!value && (type == 'object' || type == 'function');
  28162. }
  28163. /**
  28164. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28165. * and has a `typeof` result of "object".
  28166. *
  28167. * @static
  28168. * @memberOf _
  28169. * @since 4.0.0
  28170. * @category Lang
  28171. * @param {*} value The value to check.
  28172. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28173. * @example
  28174. *
  28175. * _.isObjectLike({});
  28176. * // => true
  28177. *
  28178. * _.isObjectLike([1, 2, 3]);
  28179. * // => true
  28180. *
  28181. * _.isObjectLike(_.noop);
  28182. * // => false
  28183. *
  28184. * _.isObjectLike(null);
  28185. * // => false
  28186. */
  28187. function isObjectLike(value) {
  28188. return !!value && typeof value == 'object';
  28189. }
  28190. /**
  28191. * Checks if `value` is classified as a `Symbol` primitive or object.
  28192. *
  28193. * @static
  28194. * @memberOf _
  28195. * @since 4.0.0
  28196. * @category Lang
  28197. * @param {*} value The value to check.
  28198. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28199. * @example
  28200. *
  28201. * _.isSymbol(Symbol.iterator);
  28202. * // => true
  28203. *
  28204. * _.isSymbol('abc');
  28205. * // => false
  28206. */
  28207. function isSymbol(value) {
  28208. return typeof value == 'symbol' ||
  28209. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28210. }
  28211. /**
  28212. * Converts `value` to a string. An empty string is returned for `null`
  28213. * and `undefined` values. The sign of `-0` is preserved.
  28214. *
  28215. * @static
  28216. * @memberOf _
  28217. * @since 4.0.0
  28218. * @category Lang
  28219. * @param {*} value The value to process.
  28220. * @returns {string} Returns the string.
  28221. * @example
  28222. *
  28223. * _.toString(null);
  28224. * // => ''
  28225. *
  28226. * _.toString(-0);
  28227. * // => '-0'
  28228. *
  28229. * _.toString([1, 2, 3]);
  28230. * // => '1,2,3'
  28231. */
  28232. function toString(value) {
  28233. return value == null ? '' : baseToString(value);
  28234. }
  28235. /**
  28236. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28237. * it's created. Arrays are created for missing index properties while objects
  28238. * are created for all other missing properties. Use `_.setWith` to customize
  28239. * `path` creation.
  28240. *
  28241. * **Note:** This method mutates `object`.
  28242. *
  28243. * @static
  28244. * @memberOf _
  28245. * @since 3.7.0
  28246. * @category Object
  28247. * @param {Object} object The object to modify.
  28248. * @param {Array|string} path The path of the property to set.
  28249. * @param {*} value The value to set.
  28250. * @returns {Object} Returns `object`.
  28251. * @example
  28252. *
  28253. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28254. *
  28255. * _.set(object, 'a[0].b.c', 4);
  28256. * console.log(object.a[0].b.c);
  28257. * // => 4
  28258. *
  28259. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28260. * console.log(object.x[0].y.z);
  28261. * // => 5
  28262. */
  28263. function set(object, path, value) {
  28264. return object == null ? object : baseSet(object, path, value);
  28265. }
  28266. module.exports = set;
  28267. /***/ }),
  28268. /***/ 898:
  28269. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28270. "use strict";
  28271. Object.defineProperty(exports, '__esModule', { value: true });
  28272. var request = __webpack_require__(753);
  28273. var universalUserAgent = __webpack_require__(796);
  28274. const VERSION = "4.3.1";
  28275. class GraphqlError extends Error {
  28276. constructor(request, response) {
  28277. const message = response.data.errors[0].message;
  28278. super(message);
  28279. Object.assign(this, response.data);
  28280. this.name = "GraphqlError";
  28281. this.request = request; // Maintains proper stack trace (only available on V8)
  28282. /* istanbul ignore next */
  28283. if (Error.captureStackTrace) {
  28284. Error.captureStackTrace(this, this.constructor);
  28285. }
  28286. }
  28287. }
  28288. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28289. function graphql(request, query, options) {
  28290. options = typeof query === "string" ? options = Object.assign({
  28291. query
  28292. }, options) : options = query;
  28293. const requestOptions = Object.keys(options).reduce((result, key) => {
  28294. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28295. result[key] = options[key];
  28296. return result;
  28297. }
  28298. if (!result.variables) {
  28299. result.variables = {};
  28300. }
  28301. result.variables[key] = options[key];
  28302. return result;
  28303. }, {});
  28304. return request(requestOptions).then(response => {
  28305. if (response.data.errors) {
  28306. throw new GraphqlError(requestOptions, {
  28307. data: response.data
  28308. });
  28309. }
  28310. return response.data.data;
  28311. });
  28312. }
  28313. function withDefaults(request$1, newDefaults) {
  28314. const newRequest = request$1.defaults(newDefaults);
  28315. const newApi = (query, options) => {
  28316. return graphql(newRequest, query, options);
  28317. };
  28318. return Object.assign(newApi, {
  28319. defaults: withDefaults.bind(null, newRequest),
  28320. endpoint: request.request.endpoint
  28321. });
  28322. }
  28323. const graphql$1 = withDefaults(request.request, {
  28324. headers: {
  28325. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28326. },
  28327. method: "POST",
  28328. url: "/graphql"
  28329. });
  28330. function withCustomRequest(customRequest) {
  28331. return withDefaults(customRequest, {
  28332. method: "POST",
  28333. url: "/graphql"
  28334. });
  28335. }
  28336. exports.graphql = graphql$1;
  28337. exports.withCustomRequest = withCustomRequest;
  28338. //# sourceMappingURL=index.js.map
  28339. /***/ }),
  28340. /***/ 916:
  28341. /***/ (function(__unusedmodule, exports) {
  28342. "use strict";
  28343. Object.defineProperty(exports, '__esModule', { value: true });
  28344. const VERSION = "1.0.0";
  28345. /**
  28346. * @param octokit Octokit instance
  28347. * @param options Options passed to Octokit constructor
  28348. */
  28349. function requestLog(octokit) {
  28350. octokit.hook.wrap("request", (request, options) => {
  28351. octokit.log.debug("request", options);
  28352. const start = Date.now();
  28353. const requestOptions = octokit.request.endpoint.parse(options);
  28354. const path = requestOptions.url.replace(options.baseUrl, "");
  28355. return request(options).then(response => {
  28356. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28357. return response;
  28358. }).catch(error => {
  28359. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28360. throw error;
  28361. });
  28362. });
  28363. }
  28364. requestLog.VERSION = VERSION;
  28365. exports.requestLog = requestLog;
  28366. //# sourceMappingURL=index.js.map
  28367. /***/ }),
  28368. /***/ 929:
  28369. /***/ (function(module, __unusedexports, __webpack_require__) {
  28370. module.exports = hasNextPage
  28371. const deprecate = __webpack_require__(370)
  28372. const getPageLinks = __webpack_require__(577)
  28373. function hasNextPage (link) {
  28374. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28375. return getPageLinks(link).next
  28376. }
  28377. /***/ }),
  28378. /***/ 948:
  28379. /***/ (function(module) {
  28380. "use strict";
  28381. /**
  28382. * Tries to execute a function and discards any error that occurs.
  28383. * @param {Function} fn - Function that might or might not throw an error.
  28384. * @returns {?*} Return-value of the function when no error occurred.
  28385. */
  28386. module.exports = function(fn) {
  28387. try { return fn() } catch (e) {}
  28388. }
  28389. /***/ }),
  28390. /***/ 950:
  28391. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28392. "use strict";
  28393. Object.defineProperty(exports, "__esModule", { value: true });
  28394. const url = __webpack_require__(835);
  28395. function getProxyUrl(reqUrl) {
  28396. let usingSsl = reqUrl.protocol === 'https:';
  28397. let proxyUrl;
  28398. if (checkBypass(reqUrl)) {
  28399. return proxyUrl;
  28400. }
  28401. let proxyVar;
  28402. if (usingSsl) {
  28403. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28404. }
  28405. else {
  28406. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28407. }
  28408. if (proxyVar) {
  28409. proxyUrl = url.parse(proxyVar);
  28410. }
  28411. return proxyUrl;
  28412. }
  28413. exports.getProxyUrl = getProxyUrl;
  28414. function checkBypass(reqUrl) {
  28415. if (!reqUrl.hostname) {
  28416. return false;
  28417. }
  28418. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28419. if (!noProxy) {
  28420. return false;
  28421. }
  28422. // Determine the request port
  28423. let reqPort;
  28424. if (reqUrl.port) {
  28425. reqPort = Number(reqUrl.port);
  28426. }
  28427. else if (reqUrl.protocol === 'http:') {
  28428. reqPort = 80;
  28429. }
  28430. else if (reqUrl.protocol === 'https:') {
  28431. reqPort = 443;
  28432. }
  28433. // Format the request hostname and hostname with port
  28434. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28435. if (typeof reqPort === 'number') {
  28436. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28437. }
  28438. // Compare request host against noproxy
  28439. for (let upperNoProxyItem of noProxy
  28440. .split(',')
  28441. .map(x => x.trim().toUpperCase())
  28442. .filter(x => x)) {
  28443. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28444. return true;
  28445. }
  28446. }
  28447. return false;
  28448. }
  28449. exports.checkBypass = checkBypass;
  28450. /***/ }),
  28451. /***/ 954:
  28452. /***/ (function(module) {
  28453. module.exports = validateAuth;
  28454. function validateAuth(auth) {
  28455. if (typeof auth === "string") {
  28456. return;
  28457. }
  28458. if (typeof auth === "function") {
  28459. return;
  28460. }
  28461. if (auth.username && auth.password) {
  28462. return;
  28463. }
  28464. if (auth.clientId && auth.clientSecret) {
  28465. return;
  28466. }
  28467. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28468. }
  28469. /***/ }),
  28470. /***/ 955:
  28471. /***/ (function(module, __unusedexports, __webpack_require__) {
  28472. "use strict";
  28473. const path = __webpack_require__(622);
  28474. const childProcess = __webpack_require__(129);
  28475. const crossSpawn = __webpack_require__(20);
  28476. const stripEof = __webpack_require__(768);
  28477. const npmRunPath = __webpack_require__(621);
  28478. const isStream = __webpack_require__(323);
  28479. const _getStream = __webpack_require__(145);
  28480. const pFinally = __webpack_require__(697);
  28481. const onExit = __webpack_require__(260);
  28482. const errname = __webpack_require__(427);
  28483. const stdio = __webpack_require__(168);
  28484. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28485. function handleArgs(cmd, args, opts) {
  28486. let parsed;
  28487. opts = Object.assign({
  28488. extendEnv: true,
  28489. env: {}
  28490. }, opts);
  28491. if (opts.extendEnv) {
  28492. opts.env = Object.assign({}, process.env, opts.env);
  28493. }
  28494. if (opts.__winShell === true) {
  28495. delete opts.__winShell;
  28496. parsed = {
  28497. command: cmd,
  28498. args,
  28499. options: opts,
  28500. file: cmd,
  28501. original: {
  28502. cmd,
  28503. args
  28504. }
  28505. };
  28506. } else {
  28507. parsed = crossSpawn._parse(cmd, args, opts);
  28508. }
  28509. opts = Object.assign({
  28510. maxBuffer: TEN_MEGABYTES,
  28511. buffer: true,
  28512. stripEof: true,
  28513. preferLocal: true,
  28514. localDir: parsed.options.cwd || process.cwd(),
  28515. encoding: 'utf8',
  28516. reject: true,
  28517. cleanup: true
  28518. }, parsed.options);
  28519. opts.stdio = stdio(opts);
  28520. if (opts.preferLocal) {
  28521. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28522. }
  28523. if (opts.detached) {
  28524. // #115
  28525. opts.cleanup = false;
  28526. }
  28527. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28528. // #116
  28529. parsed.args.unshift('/q');
  28530. }
  28531. return {
  28532. cmd: parsed.command,
  28533. args: parsed.args,
  28534. opts,
  28535. parsed
  28536. };
  28537. }
  28538. function handleInput(spawned, input) {
  28539. if (input === null || input === undefined) {
  28540. return;
  28541. }
  28542. if (isStream(input)) {
  28543. input.pipe(spawned.stdin);
  28544. } else {
  28545. spawned.stdin.end(input);
  28546. }
  28547. }
  28548. function handleOutput(opts, val) {
  28549. if (val && opts.stripEof) {
  28550. val = stripEof(val);
  28551. }
  28552. return val;
  28553. }
  28554. function handleShell(fn, cmd, opts) {
  28555. let file = '/bin/sh';
  28556. let args = ['-c', cmd];
  28557. opts = Object.assign({}, opts);
  28558. if (process.platform === 'win32') {
  28559. opts.__winShell = true;
  28560. file = process.env.comspec || 'cmd.exe';
  28561. args = ['/s', '/c', `"${cmd}"`];
  28562. opts.windowsVerbatimArguments = true;
  28563. }
  28564. if (opts.shell) {
  28565. file = opts.shell;
  28566. delete opts.shell;
  28567. }
  28568. return fn(file, args, opts);
  28569. }
  28570. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28571. if (!process[stream]) {
  28572. return null;
  28573. }
  28574. let ret;
  28575. if (!buffer) {
  28576. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28577. ret = new Promise((resolve, reject) => {
  28578. process[stream]
  28579. .once('end', resolve)
  28580. .once('error', reject);
  28581. });
  28582. } else if (encoding) {
  28583. ret = _getStream(process[stream], {
  28584. encoding,
  28585. maxBuffer
  28586. });
  28587. } else {
  28588. ret = _getStream.buffer(process[stream], {maxBuffer});
  28589. }
  28590. return ret.catch(err => {
  28591. err.stream = stream;
  28592. err.message = `${stream} ${err.message}`;
  28593. throw err;
  28594. });
  28595. }
  28596. function makeError(result, options) {
  28597. const {stdout, stderr} = result;
  28598. let err = result.error;
  28599. const {code, signal} = result;
  28600. const {parsed, joinedCmd} = options;
  28601. const timedOut = options.timedOut || false;
  28602. if (!err) {
  28603. let output = '';
  28604. if (Array.isArray(parsed.opts.stdio)) {
  28605. if (parsed.opts.stdio[2] !== 'inherit') {
  28606. output += output.length > 0 ? stderr : `\n${stderr}`;
  28607. }
  28608. if (parsed.opts.stdio[1] !== 'inherit') {
  28609. output += `\n${stdout}`;
  28610. }
  28611. } else if (parsed.opts.stdio !== 'inherit') {
  28612. output = `\n${stderr}${stdout}`;
  28613. }
  28614. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28615. err.code = code < 0 ? errname(code) : code;
  28616. }
  28617. err.stdout = stdout;
  28618. err.stderr = stderr;
  28619. err.failed = true;
  28620. err.signal = signal || null;
  28621. err.cmd = joinedCmd;
  28622. err.timedOut = timedOut;
  28623. return err;
  28624. }
  28625. function joinCmd(cmd, args) {
  28626. let joinedCmd = cmd;
  28627. if (Array.isArray(args) && args.length > 0) {
  28628. joinedCmd += ' ' + args.join(' ');
  28629. }
  28630. return joinedCmd;
  28631. }
  28632. module.exports = (cmd, args, opts) => {
  28633. const parsed = handleArgs(cmd, args, opts);
  28634. const {encoding, buffer, maxBuffer} = parsed.opts;
  28635. const joinedCmd = joinCmd(cmd, args);
  28636. let spawned;
  28637. try {
  28638. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28639. } catch (err) {
  28640. return Promise.reject(err);
  28641. }
  28642. let removeExitHandler;
  28643. if (parsed.opts.cleanup) {
  28644. removeExitHandler = onExit(() => {
  28645. spawned.kill();
  28646. });
  28647. }
  28648. let timeoutId = null;
  28649. let timedOut = false;
  28650. const cleanup = () => {
  28651. if (timeoutId) {
  28652. clearTimeout(timeoutId);
  28653. timeoutId = null;
  28654. }
  28655. if (removeExitHandler) {
  28656. removeExitHandler();
  28657. }
  28658. };
  28659. if (parsed.opts.timeout > 0) {
  28660. timeoutId = setTimeout(() => {
  28661. timeoutId = null;
  28662. timedOut = true;
  28663. spawned.kill(parsed.opts.killSignal);
  28664. }, parsed.opts.timeout);
  28665. }
  28666. const processDone = new Promise(resolve => {
  28667. spawned.on('exit', (code, signal) => {
  28668. cleanup();
  28669. resolve({code, signal});
  28670. });
  28671. spawned.on('error', err => {
  28672. cleanup();
  28673. resolve({error: err});
  28674. });
  28675. if (spawned.stdin) {
  28676. spawned.stdin.on('error', err => {
  28677. cleanup();
  28678. resolve({error: err});
  28679. });
  28680. }
  28681. });
  28682. function destroy() {
  28683. if (spawned.stdout) {
  28684. spawned.stdout.destroy();
  28685. }
  28686. if (spawned.stderr) {
  28687. spawned.stderr.destroy();
  28688. }
  28689. }
  28690. const handlePromise = () => pFinally(Promise.all([
  28691. processDone,
  28692. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  28693. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  28694. ]).then(arr => {
  28695. const result = arr[0];
  28696. result.stdout = arr[1];
  28697. result.stderr = arr[2];
  28698. if (result.error || result.code !== 0 || result.signal !== null) {
  28699. const err = makeError(result, {
  28700. joinedCmd,
  28701. parsed,
  28702. timedOut
  28703. });
  28704. // TODO: missing some timeout logic for killed
  28705. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  28706. // err.killed = spawned.killed || killed;
  28707. err.killed = err.killed || spawned.killed;
  28708. if (!parsed.opts.reject) {
  28709. return err;
  28710. }
  28711. throw err;
  28712. }
  28713. return {
  28714. stdout: handleOutput(parsed.opts, result.stdout),
  28715. stderr: handleOutput(parsed.opts, result.stderr),
  28716. code: 0,
  28717. failed: false,
  28718. killed: false,
  28719. signal: null,
  28720. cmd: joinedCmd,
  28721. timedOut: false
  28722. };
  28723. }), destroy);
  28724. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  28725. handleInput(spawned, parsed.opts.input);
  28726. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  28727. spawned.catch = onrejected => handlePromise().catch(onrejected);
  28728. return spawned;
  28729. };
  28730. // TODO: set `stderr: 'ignore'` when that option is implemented
  28731. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  28732. // TODO: set `stdout: 'ignore'` when that option is implemented
  28733. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  28734. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  28735. module.exports.sync = (cmd, args, opts) => {
  28736. const parsed = handleArgs(cmd, args, opts);
  28737. const joinedCmd = joinCmd(cmd, args);
  28738. if (isStream(parsed.opts.input)) {
  28739. throw new TypeError('The `input` option cannot be a stream in sync mode');
  28740. }
  28741. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  28742. result.code = result.status;
  28743. if (result.error || result.status !== 0 || result.signal !== null) {
  28744. const err = makeError(result, {
  28745. joinedCmd,
  28746. parsed
  28747. });
  28748. if (!parsed.opts.reject) {
  28749. return err;
  28750. }
  28751. throw err;
  28752. }
  28753. return {
  28754. stdout: handleOutput(parsed.opts, result.stdout),
  28755. stderr: handleOutput(parsed.opts, result.stderr),
  28756. code: 0,
  28757. failed: false,
  28758. signal: null,
  28759. cmd: joinedCmd,
  28760. timedOut: false
  28761. };
  28762. };
  28763. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  28764. /***/ }),
  28765. /***/ 966:
  28766. /***/ (function(module, __unusedexports, __webpack_require__) {
  28767. "use strict";
  28768. const {PassThrough} = __webpack_require__(413);
  28769. module.exports = options => {
  28770. options = Object.assign({}, options);
  28771. const {array} = options;
  28772. let {encoding} = options;
  28773. const buffer = encoding === 'buffer';
  28774. let objectMode = false;
  28775. if (array) {
  28776. objectMode = !(encoding || buffer);
  28777. } else {
  28778. encoding = encoding || 'utf8';
  28779. }
  28780. if (buffer) {
  28781. encoding = null;
  28782. }
  28783. let len = 0;
  28784. const ret = [];
  28785. const stream = new PassThrough({objectMode});
  28786. if (encoding) {
  28787. stream.setEncoding(encoding);
  28788. }
  28789. stream.on('data', chunk => {
  28790. ret.push(chunk);
  28791. if (objectMode) {
  28792. len = ret.length;
  28793. } else {
  28794. len += chunk.length;
  28795. }
  28796. });
  28797. stream.getBufferedValue = () => {
  28798. if (array) {
  28799. return ret;
  28800. }
  28801. return buffer ? Buffer.concat(ret, len) : ret.join('');
  28802. };
  28803. stream.getBufferedLength = () => len;
  28804. return stream;
  28805. };
  28806. /***/ }),
  28807. /***/ 969:
  28808. /***/ (function(module, __unusedexports, __webpack_require__) {
  28809. var wrappy = __webpack_require__(11)
  28810. module.exports = wrappy(once)
  28811. module.exports.strict = wrappy(onceStrict)
  28812. once.proto = once(function () {
  28813. Object.defineProperty(Function.prototype, 'once', {
  28814. value: function () {
  28815. return once(this)
  28816. },
  28817. configurable: true
  28818. })
  28819. Object.defineProperty(Function.prototype, 'onceStrict', {
  28820. value: function () {
  28821. return onceStrict(this)
  28822. },
  28823. configurable: true
  28824. })
  28825. })
  28826. function once (fn) {
  28827. var f = function () {
  28828. if (f.called) return f.value
  28829. f.called = true
  28830. return f.value = fn.apply(this, arguments)
  28831. }
  28832. f.called = false
  28833. return f
  28834. }
  28835. function onceStrict (fn) {
  28836. var f = function () {
  28837. if (f.called)
  28838. throw new Error(f.onceError)
  28839. f.called = true
  28840. return f.value = fn.apply(this, arguments)
  28841. }
  28842. var name = fn.name || 'Function wrapped with `once`'
  28843. f.onceError = name + " shouldn't be called more than once"
  28844. f.called = false
  28845. return f
  28846. }
  28847. /***/ }),
  28848. /***/ 986:
  28849. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28850. "use strict";
  28851. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  28852. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  28853. return new (P || (P = Promise))(function (resolve, reject) {
  28854. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  28855. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  28856. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  28857. step((generator = generator.apply(thisArg, _arguments || [])).next());
  28858. });
  28859. };
  28860. Object.defineProperty(exports, "__esModule", { value: true });
  28861. const tr = __webpack_require__(9);
  28862. /**
  28863. * Exec a command.
  28864. * Output will be streamed to the live console.
  28865. * Returns promise with return code
  28866. *
  28867. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  28868. * @param args optional arguments for tool. Escaping is handled by the lib.
  28869. * @param options optional exec options. See ExecOptions
  28870. * @returns Promise<number> exit code
  28871. */
  28872. function exec(commandLine, args, options) {
  28873. return __awaiter(this, void 0, void 0, function* () {
  28874. const commandArgs = tr.argStringToArray(commandLine);
  28875. if (commandArgs.length === 0) {
  28876. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  28877. }
  28878. // Path to tool to execute should be first arg
  28879. const toolPath = commandArgs[0];
  28880. args = commandArgs.slice(1).concat(args || []);
  28881. const runner = new tr.ToolRunner(toolPath, args, options);
  28882. return runner.exec();
  28883. });
  28884. }
  28885. exports.exec = exec;
  28886. //# sourceMappingURL=exec.js.map
  28887. /***/ }),
  28888. /***/ 991:
  28889. /***/ (function(module, __unusedexports, __webpack_require__) {
  28890. module.exports = authenticationRequestError;
  28891. const { RequestError } = __webpack_require__(497);
  28892. function authenticationRequestError(state, error, options) {
  28893. if (!error.headers) throw error;
  28894. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  28895. // handle "2FA required" error only
  28896. if (error.status !== 401 || !otpRequired) {
  28897. throw error;
  28898. }
  28899. if (
  28900. error.status === 401 &&
  28901. otpRequired &&
  28902. error.request &&
  28903. error.request.headers["x-github-otp"]
  28904. ) {
  28905. if (state.otp) {
  28906. delete state.otp; // no longer valid, request again
  28907. } else {
  28908. throw new RequestError(
  28909. "Invalid one-time password for two-factor authentication",
  28910. 401,
  28911. {
  28912. headers: error.headers,
  28913. request: options
  28914. }
  28915. );
  28916. }
  28917. }
  28918. if (typeof state.auth.on2fa !== "function") {
  28919. throw new RequestError(
  28920. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  28921. 401,
  28922. {
  28923. headers: error.headers,
  28924. request: options
  28925. }
  28926. );
  28927. }
  28928. return Promise.resolve()
  28929. .then(() => {
  28930. return state.auth.on2fa();
  28931. })
  28932. .then(oneTimePassword => {
  28933. const newOptions = Object.assign(options, {
  28934. headers: Object.assign(options.headers, {
  28935. "x-github-otp": oneTimePassword
  28936. })
  28937. });
  28938. return state.octokit.request(newOptions).then(response => {
  28939. // If OTP still valid, then persist it for following requests
  28940. state.otp = oneTimePassword;
  28941. return response;
  28942. });
  28943. });
  28944. }
  28945. /***/ })
  28946. /******/ });