index.js 824 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610
  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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  1248. if (k2 === undefined) k2 = k;
  1249. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  1250. }) : (function(o, m, k, k2) {
  1251. if (k2 === undefined) k2 = k;
  1252. o[k2] = m[k];
  1253. }));
  1254. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  1255. Object.defineProperty(o, "default", { enumerable: true, value: v });
  1256. }) : function(o, v) {
  1257. o["default"] = v;
  1258. });
  1259. var __importStar = (this && this.__importStar) || function (mod) {
  1260. if (mod && mod.__esModule) return mod;
  1261. var result = {};
  1262. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  1263. __setModuleDefault(result, mod);
  1264. return result;
  1265. };
  1266. Object.defineProperty(exports, "__esModule", { value: true });
  1267. exports.getServerUrl = exports.getFetchUrl = void 0;
  1268. const assert = __importStar(__webpack_require__(357));
  1269. const url_1 = __webpack_require__(835);
  1270. function getFetchUrl(settings) {
  1271. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1272. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1273. const serviceUrl = getServerUrl();
  1274. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1275. const encodedName = encodeURIComponent(settings.repositoryName);
  1276. if (settings.sshKey) {
  1277. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1278. }
  1279. // "origin" is SCHEME://HOSTNAME[:PORT]
  1280. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1281. }
  1282. exports.getFetchUrl = getFetchUrl;
  1283. function getServerUrl() {
  1284. // todo: remove GITHUB_URL after support for GHES Alpha is no longer needed
  1285. return new url_1.URL(process.env['GITHUB_SERVER_URL'] ||
  1286. process.env['GITHUB_URL'] ||
  1287. 'https://github.com');
  1288. }
  1289. exports.getServerUrl = getServerUrl;
  1290. /***/ }),
  1291. /***/ 82:
  1292. /***/ (function(__unusedmodule, exports) {
  1293. "use strict";
  1294. // We use any as a valid input type
  1295. /* eslint-disable @typescript-eslint/no-explicit-any */
  1296. Object.defineProperty(exports, "__esModule", { value: true });
  1297. /**
  1298. * Sanitizes an input into a string so it can be passed into issueCommand safely
  1299. * @param input input to sanitize into a string
  1300. */
  1301. function toCommandValue(input) {
  1302. if (input === null || input === undefined) {
  1303. return '';
  1304. }
  1305. else if (typeof input === 'string' || input instanceof String) {
  1306. return input;
  1307. }
  1308. return JSON.stringify(input);
  1309. }
  1310. exports.toCommandValue = toCommandValue;
  1311. //# sourceMappingURL=utils.js.map
  1312. /***/ }),
  1313. /***/ 87:
  1314. /***/ (function(module) {
  1315. module.exports = require("os");
  1316. /***/ }),
  1317. /***/ 102:
  1318. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1319. "use strict";
  1320. // For internal use, subject to change.
  1321. var __importStar = (this && this.__importStar) || function (mod) {
  1322. if (mod && mod.__esModule) return mod;
  1323. var result = {};
  1324. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1325. result["default"] = mod;
  1326. return result;
  1327. };
  1328. Object.defineProperty(exports, "__esModule", { value: true });
  1329. // We use any as a valid input type
  1330. /* eslint-disable @typescript-eslint/no-explicit-any */
  1331. const fs = __importStar(__webpack_require__(747));
  1332. const os = __importStar(__webpack_require__(87));
  1333. const utils_1 = __webpack_require__(82);
  1334. function issueCommand(command, message) {
  1335. const filePath = process.env[`GITHUB_${command}`];
  1336. if (!filePath) {
  1337. throw new Error(`Unable to find environment variable for file command ${command}`);
  1338. }
  1339. if (!fs.existsSync(filePath)) {
  1340. throw new Error(`Missing file at path: ${filePath}`);
  1341. }
  1342. fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
  1343. encoding: 'utf8'
  1344. });
  1345. }
  1346. exports.issueCommand = issueCommand;
  1347. //# sourceMappingURL=file-command.js.map
  1348. /***/ }),
  1349. /***/ 118:
  1350. /***/ (function(module, __unusedexports, __webpack_require__) {
  1351. "use strict";
  1352. const os = __webpack_require__(87);
  1353. const nameMap = new Map([
  1354. [19, 'Catalina'],
  1355. [18, 'Mojave'],
  1356. [17, 'High Sierra'],
  1357. [16, 'Sierra'],
  1358. [15, 'El Capitan'],
  1359. [14, 'Yosemite'],
  1360. [13, 'Mavericks'],
  1361. [12, 'Mountain Lion'],
  1362. [11, 'Lion'],
  1363. [10, 'Snow Leopard'],
  1364. [9, 'Leopard'],
  1365. [8, 'Tiger'],
  1366. [7, 'Panther'],
  1367. [6, 'Jaguar'],
  1368. [5, 'Puma']
  1369. ]);
  1370. const macosRelease = release => {
  1371. release = Number((release || os.release()).split('.')[0]);
  1372. return {
  1373. name: nameMap.get(release),
  1374. version: '10.' + (release - 4)
  1375. };
  1376. };
  1377. module.exports = macosRelease;
  1378. // TODO: remove this in the next major version
  1379. module.exports.default = macosRelease;
  1380. /***/ }),
  1381. /***/ 126:
  1382. /***/ (function(module) {
  1383. /**
  1384. * lodash (Custom Build) <https://lodash.com/>
  1385. * Build: `lodash modularize exports="npm" -o ./`
  1386. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1387. * Released under MIT license <https://lodash.com/license>
  1388. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1389. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1390. */
  1391. /** Used as the size to enable large array optimizations. */
  1392. var LARGE_ARRAY_SIZE = 200;
  1393. /** Used to stand-in for `undefined` hash values. */
  1394. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1395. /** Used as references for various `Number` constants. */
  1396. var INFINITY = 1 / 0;
  1397. /** `Object#toString` result references. */
  1398. var funcTag = '[object Function]',
  1399. genTag = '[object GeneratorFunction]';
  1400. /**
  1401. * Used to match `RegExp`
  1402. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1403. */
  1404. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1405. /** Used to detect host constructors (Safari). */
  1406. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1407. /** Detect free variable `global` from Node.js. */
  1408. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1409. /** Detect free variable `self`. */
  1410. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1411. /** Used as a reference to the global object. */
  1412. var root = freeGlobal || freeSelf || Function('return this')();
  1413. /**
  1414. * A specialized version of `_.includes` for arrays without support for
  1415. * specifying an index to search from.
  1416. *
  1417. * @private
  1418. * @param {Array} [array] The array to inspect.
  1419. * @param {*} target The value to search for.
  1420. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1421. */
  1422. function arrayIncludes(array, value) {
  1423. var length = array ? array.length : 0;
  1424. return !!length && baseIndexOf(array, value, 0) > -1;
  1425. }
  1426. /**
  1427. * This function is like `arrayIncludes` except that it accepts a comparator.
  1428. *
  1429. * @private
  1430. * @param {Array} [array] The array to inspect.
  1431. * @param {*} target The value to search for.
  1432. * @param {Function} comparator The comparator invoked per element.
  1433. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1434. */
  1435. function arrayIncludesWith(array, value, comparator) {
  1436. var index = -1,
  1437. length = array ? array.length : 0;
  1438. while (++index < length) {
  1439. if (comparator(value, array[index])) {
  1440. return true;
  1441. }
  1442. }
  1443. return false;
  1444. }
  1445. /**
  1446. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1447. * support for iteratee shorthands.
  1448. *
  1449. * @private
  1450. * @param {Array} array The array to inspect.
  1451. * @param {Function} predicate The function invoked per iteration.
  1452. * @param {number} fromIndex The index to search from.
  1453. * @param {boolean} [fromRight] Specify iterating from right to left.
  1454. * @returns {number} Returns the index of the matched value, else `-1`.
  1455. */
  1456. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1457. var length = array.length,
  1458. index = fromIndex + (fromRight ? 1 : -1);
  1459. while ((fromRight ? index-- : ++index < length)) {
  1460. if (predicate(array[index], index, array)) {
  1461. return index;
  1462. }
  1463. }
  1464. return -1;
  1465. }
  1466. /**
  1467. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1468. *
  1469. * @private
  1470. * @param {Array} array The array to inspect.
  1471. * @param {*} value The value to search for.
  1472. * @param {number} fromIndex The index to search from.
  1473. * @returns {number} Returns the index of the matched value, else `-1`.
  1474. */
  1475. function baseIndexOf(array, value, fromIndex) {
  1476. if (value !== value) {
  1477. return baseFindIndex(array, baseIsNaN, fromIndex);
  1478. }
  1479. var index = fromIndex - 1,
  1480. length = array.length;
  1481. while (++index < length) {
  1482. if (array[index] === value) {
  1483. return index;
  1484. }
  1485. }
  1486. return -1;
  1487. }
  1488. /**
  1489. * The base implementation of `_.isNaN` without support for number objects.
  1490. *
  1491. * @private
  1492. * @param {*} value The value to check.
  1493. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1494. */
  1495. function baseIsNaN(value) {
  1496. return value !== value;
  1497. }
  1498. /**
  1499. * Checks if a cache value for `key` exists.
  1500. *
  1501. * @private
  1502. * @param {Object} cache The cache to query.
  1503. * @param {string} key The key of the entry to check.
  1504. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1505. */
  1506. function cacheHas(cache, key) {
  1507. return cache.has(key);
  1508. }
  1509. /**
  1510. * Gets the value at `key` of `object`.
  1511. *
  1512. * @private
  1513. * @param {Object} [object] The object to query.
  1514. * @param {string} key The key of the property to get.
  1515. * @returns {*} Returns the property value.
  1516. */
  1517. function getValue(object, key) {
  1518. return object == null ? undefined : object[key];
  1519. }
  1520. /**
  1521. * Checks if `value` is a host object in IE < 9.
  1522. *
  1523. * @private
  1524. * @param {*} value The value to check.
  1525. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1526. */
  1527. function isHostObject(value) {
  1528. // Many host objects are `Object` objects that can coerce to strings
  1529. // despite having improperly defined `toString` methods.
  1530. var result = false;
  1531. if (value != null && typeof value.toString != 'function') {
  1532. try {
  1533. result = !!(value + '');
  1534. } catch (e) {}
  1535. }
  1536. return result;
  1537. }
  1538. /**
  1539. * Converts `set` to an array of its values.
  1540. *
  1541. * @private
  1542. * @param {Object} set The set to convert.
  1543. * @returns {Array} Returns the values.
  1544. */
  1545. function setToArray(set) {
  1546. var index = -1,
  1547. result = Array(set.size);
  1548. set.forEach(function(value) {
  1549. result[++index] = value;
  1550. });
  1551. return result;
  1552. }
  1553. /** Used for built-in method references. */
  1554. var arrayProto = Array.prototype,
  1555. funcProto = Function.prototype,
  1556. objectProto = Object.prototype;
  1557. /** Used to detect overreaching core-js shims. */
  1558. var coreJsData = root['__core-js_shared__'];
  1559. /** Used to detect methods masquerading as native. */
  1560. var maskSrcKey = (function() {
  1561. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1562. return uid ? ('Symbol(src)_1.' + uid) : '';
  1563. }());
  1564. /** Used to resolve the decompiled source of functions. */
  1565. var funcToString = funcProto.toString;
  1566. /** Used to check objects for own properties. */
  1567. var hasOwnProperty = objectProto.hasOwnProperty;
  1568. /**
  1569. * Used to resolve the
  1570. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1571. * of values.
  1572. */
  1573. var objectToString = objectProto.toString;
  1574. /** Used to detect if a method is native. */
  1575. var reIsNative = RegExp('^' +
  1576. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1577. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1578. );
  1579. /** Built-in value references. */
  1580. var splice = arrayProto.splice;
  1581. /* Built-in method references that are verified to be native. */
  1582. var Map = getNative(root, 'Map'),
  1583. Set = getNative(root, 'Set'),
  1584. nativeCreate = getNative(Object, 'create');
  1585. /**
  1586. * Creates a hash object.
  1587. *
  1588. * @private
  1589. * @constructor
  1590. * @param {Array} [entries] The key-value pairs to cache.
  1591. */
  1592. function Hash(entries) {
  1593. var index = -1,
  1594. length = entries ? entries.length : 0;
  1595. this.clear();
  1596. while (++index < length) {
  1597. var entry = entries[index];
  1598. this.set(entry[0], entry[1]);
  1599. }
  1600. }
  1601. /**
  1602. * Removes all key-value entries from the hash.
  1603. *
  1604. * @private
  1605. * @name clear
  1606. * @memberOf Hash
  1607. */
  1608. function hashClear() {
  1609. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1610. }
  1611. /**
  1612. * Removes `key` and its value from the hash.
  1613. *
  1614. * @private
  1615. * @name delete
  1616. * @memberOf Hash
  1617. * @param {Object} hash The hash to modify.
  1618. * @param {string} key The key of the value to remove.
  1619. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1620. */
  1621. function hashDelete(key) {
  1622. return this.has(key) && delete this.__data__[key];
  1623. }
  1624. /**
  1625. * Gets the hash value for `key`.
  1626. *
  1627. * @private
  1628. * @name get
  1629. * @memberOf Hash
  1630. * @param {string} key The key of the value to get.
  1631. * @returns {*} Returns the entry value.
  1632. */
  1633. function hashGet(key) {
  1634. var data = this.__data__;
  1635. if (nativeCreate) {
  1636. var result = data[key];
  1637. return result === HASH_UNDEFINED ? undefined : result;
  1638. }
  1639. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1640. }
  1641. /**
  1642. * Checks if a hash value for `key` exists.
  1643. *
  1644. * @private
  1645. * @name has
  1646. * @memberOf Hash
  1647. * @param {string} key The key of the entry to check.
  1648. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1649. */
  1650. function hashHas(key) {
  1651. var data = this.__data__;
  1652. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1653. }
  1654. /**
  1655. * Sets the hash `key` to `value`.
  1656. *
  1657. * @private
  1658. * @name set
  1659. * @memberOf Hash
  1660. * @param {string} key The key of the value to set.
  1661. * @param {*} value The value to set.
  1662. * @returns {Object} Returns the hash instance.
  1663. */
  1664. function hashSet(key, value) {
  1665. var data = this.__data__;
  1666. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1667. return this;
  1668. }
  1669. // Add methods to `Hash`.
  1670. Hash.prototype.clear = hashClear;
  1671. Hash.prototype['delete'] = hashDelete;
  1672. Hash.prototype.get = hashGet;
  1673. Hash.prototype.has = hashHas;
  1674. Hash.prototype.set = hashSet;
  1675. /**
  1676. * Creates an list cache object.
  1677. *
  1678. * @private
  1679. * @constructor
  1680. * @param {Array} [entries] The key-value pairs to cache.
  1681. */
  1682. function ListCache(entries) {
  1683. var index = -1,
  1684. length = entries ? entries.length : 0;
  1685. this.clear();
  1686. while (++index < length) {
  1687. var entry = entries[index];
  1688. this.set(entry[0], entry[1]);
  1689. }
  1690. }
  1691. /**
  1692. * Removes all key-value entries from the list cache.
  1693. *
  1694. * @private
  1695. * @name clear
  1696. * @memberOf ListCache
  1697. */
  1698. function listCacheClear() {
  1699. this.__data__ = [];
  1700. }
  1701. /**
  1702. * Removes `key` and its value from the list cache.
  1703. *
  1704. * @private
  1705. * @name delete
  1706. * @memberOf ListCache
  1707. * @param {string} key The key of the value to remove.
  1708. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1709. */
  1710. function listCacheDelete(key) {
  1711. var data = this.__data__,
  1712. index = assocIndexOf(data, key);
  1713. if (index < 0) {
  1714. return false;
  1715. }
  1716. var lastIndex = data.length - 1;
  1717. if (index == lastIndex) {
  1718. data.pop();
  1719. } else {
  1720. splice.call(data, index, 1);
  1721. }
  1722. return true;
  1723. }
  1724. /**
  1725. * Gets the list cache value for `key`.
  1726. *
  1727. * @private
  1728. * @name get
  1729. * @memberOf ListCache
  1730. * @param {string} key The key of the value to get.
  1731. * @returns {*} Returns the entry value.
  1732. */
  1733. function listCacheGet(key) {
  1734. var data = this.__data__,
  1735. index = assocIndexOf(data, key);
  1736. return index < 0 ? undefined : data[index][1];
  1737. }
  1738. /**
  1739. * Checks if a list cache value for `key` exists.
  1740. *
  1741. * @private
  1742. * @name has
  1743. * @memberOf ListCache
  1744. * @param {string} key The key of the entry to check.
  1745. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1746. */
  1747. function listCacheHas(key) {
  1748. return assocIndexOf(this.__data__, key) > -1;
  1749. }
  1750. /**
  1751. * Sets the list cache `key` to `value`.
  1752. *
  1753. * @private
  1754. * @name set
  1755. * @memberOf ListCache
  1756. * @param {string} key The key of the value to set.
  1757. * @param {*} value The value to set.
  1758. * @returns {Object} Returns the list cache instance.
  1759. */
  1760. function listCacheSet(key, value) {
  1761. var data = this.__data__,
  1762. index = assocIndexOf(data, key);
  1763. if (index < 0) {
  1764. data.push([key, value]);
  1765. } else {
  1766. data[index][1] = value;
  1767. }
  1768. return this;
  1769. }
  1770. // Add methods to `ListCache`.
  1771. ListCache.prototype.clear = listCacheClear;
  1772. ListCache.prototype['delete'] = listCacheDelete;
  1773. ListCache.prototype.get = listCacheGet;
  1774. ListCache.prototype.has = listCacheHas;
  1775. ListCache.prototype.set = listCacheSet;
  1776. /**
  1777. * Creates a map cache object to store key-value pairs.
  1778. *
  1779. * @private
  1780. * @constructor
  1781. * @param {Array} [entries] The key-value pairs to cache.
  1782. */
  1783. function MapCache(entries) {
  1784. var index = -1,
  1785. length = entries ? entries.length : 0;
  1786. this.clear();
  1787. while (++index < length) {
  1788. var entry = entries[index];
  1789. this.set(entry[0], entry[1]);
  1790. }
  1791. }
  1792. /**
  1793. * Removes all key-value entries from the map.
  1794. *
  1795. * @private
  1796. * @name clear
  1797. * @memberOf MapCache
  1798. */
  1799. function mapCacheClear() {
  1800. this.__data__ = {
  1801. 'hash': new Hash,
  1802. 'map': new (Map || ListCache),
  1803. 'string': new Hash
  1804. };
  1805. }
  1806. /**
  1807. * Removes `key` and its value from the map.
  1808. *
  1809. * @private
  1810. * @name delete
  1811. * @memberOf MapCache
  1812. * @param {string} key The key of the value to remove.
  1813. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1814. */
  1815. function mapCacheDelete(key) {
  1816. return getMapData(this, key)['delete'](key);
  1817. }
  1818. /**
  1819. * Gets the map value for `key`.
  1820. *
  1821. * @private
  1822. * @name get
  1823. * @memberOf MapCache
  1824. * @param {string} key The key of the value to get.
  1825. * @returns {*} Returns the entry value.
  1826. */
  1827. function mapCacheGet(key) {
  1828. return getMapData(this, key).get(key);
  1829. }
  1830. /**
  1831. * Checks if a map value for `key` exists.
  1832. *
  1833. * @private
  1834. * @name has
  1835. * @memberOf MapCache
  1836. * @param {string} key The key of the entry to check.
  1837. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1838. */
  1839. function mapCacheHas(key) {
  1840. return getMapData(this, key).has(key);
  1841. }
  1842. /**
  1843. * Sets the map `key` to `value`.
  1844. *
  1845. * @private
  1846. * @name set
  1847. * @memberOf MapCache
  1848. * @param {string} key The key of the value to set.
  1849. * @param {*} value The value to set.
  1850. * @returns {Object} Returns the map cache instance.
  1851. */
  1852. function mapCacheSet(key, value) {
  1853. getMapData(this, key).set(key, value);
  1854. return this;
  1855. }
  1856. // Add methods to `MapCache`.
  1857. MapCache.prototype.clear = mapCacheClear;
  1858. MapCache.prototype['delete'] = mapCacheDelete;
  1859. MapCache.prototype.get = mapCacheGet;
  1860. MapCache.prototype.has = mapCacheHas;
  1861. MapCache.prototype.set = mapCacheSet;
  1862. /**
  1863. *
  1864. * Creates an array cache object to store unique values.
  1865. *
  1866. * @private
  1867. * @constructor
  1868. * @param {Array} [values] The values to cache.
  1869. */
  1870. function SetCache(values) {
  1871. var index = -1,
  1872. length = values ? values.length : 0;
  1873. this.__data__ = new MapCache;
  1874. while (++index < length) {
  1875. this.add(values[index]);
  1876. }
  1877. }
  1878. /**
  1879. * Adds `value` to the array cache.
  1880. *
  1881. * @private
  1882. * @name add
  1883. * @memberOf SetCache
  1884. * @alias push
  1885. * @param {*} value The value to cache.
  1886. * @returns {Object} Returns the cache instance.
  1887. */
  1888. function setCacheAdd(value) {
  1889. this.__data__.set(value, HASH_UNDEFINED);
  1890. return this;
  1891. }
  1892. /**
  1893. * Checks if `value` is in the array cache.
  1894. *
  1895. * @private
  1896. * @name has
  1897. * @memberOf SetCache
  1898. * @param {*} value The value to search for.
  1899. * @returns {number} Returns `true` if `value` is found, else `false`.
  1900. */
  1901. function setCacheHas(value) {
  1902. return this.__data__.has(value);
  1903. }
  1904. // Add methods to `SetCache`.
  1905. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1906. SetCache.prototype.has = setCacheHas;
  1907. /**
  1908. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1909. *
  1910. * @private
  1911. * @param {Array} array The array to inspect.
  1912. * @param {*} key The key to search for.
  1913. * @returns {number} Returns the index of the matched value, else `-1`.
  1914. */
  1915. function assocIndexOf(array, key) {
  1916. var length = array.length;
  1917. while (length--) {
  1918. if (eq(array[length][0], key)) {
  1919. return length;
  1920. }
  1921. }
  1922. return -1;
  1923. }
  1924. /**
  1925. * The base implementation of `_.isNative` without bad shim checks.
  1926. *
  1927. * @private
  1928. * @param {*} value The value to check.
  1929. * @returns {boolean} Returns `true` if `value` is a native function,
  1930. * else `false`.
  1931. */
  1932. function baseIsNative(value) {
  1933. if (!isObject(value) || isMasked(value)) {
  1934. return false;
  1935. }
  1936. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1937. return pattern.test(toSource(value));
  1938. }
  1939. /**
  1940. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1941. *
  1942. * @private
  1943. * @param {Array} array The array to inspect.
  1944. * @param {Function} [iteratee] The iteratee invoked per element.
  1945. * @param {Function} [comparator] The comparator invoked per element.
  1946. * @returns {Array} Returns the new duplicate free array.
  1947. */
  1948. function baseUniq(array, iteratee, comparator) {
  1949. var index = -1,
  1950. includes = arrayIncludes,
  1951. length = array.length,
  1952. isCommon = true,
  1953. result = [],
  1954. seen = result;
  1955. if (comparator) {
  1956. isCommon = false;
  1957. includes = arrayIncludesWith;
  1958. }
  1959. else if (length >= LARGE_ARRAY_SIZE) {
  1960. var set = iteratee ? null : createSet(array);
  1961. if (set) {
  1962. return setToArray(set);
  1963. }
  1964. isCommon = false;
  1965. includes = cacheHas;
  1966. seen = new SetCache;
  1967. }
  1968. else {
  1969. seen = iteratee ? [] : result;
  1970. }
  1971. outer:
  1972. while (++index < length) {
  1973. var value = array[index],
  1974. computed = iteratee ? iteratee(value) : value;
  1975. value = (comparator || value !== 0) ? value : 0;
  1976. if (isCommon && computed === computed) {
  1977. var seenIndex = seen.length;
  1978. while (seenIndex--) {
  1979. if (seen[seenIndex] === computed) {
  1980. continue outer;
  1981. }
  1982. }
  1983. if (iteratee) {
  1984. seen.push(computed);
  1985. }
  1986. result.push(value);
  1987. }
  1988. else if (!includes(seen, computed, comparator)) {
  1989. if (seen !== result) {
  1990. seen.push(computed);
  1991. }
  1992. result.push(value);
  1993. }
  1994. }
  1995. return result;
  1996. }
  1997. /**
  1998. * Creates a set object of `values`.
  1999. *
  2000. * @private
  2001. * @param {Array} values The values to add to the set.
  2002. * @returns {Object} Returns the new set.
  2003. */
  2004. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  2005. return new Set(values);
  2006. };
  2007. /**
  2008. * Gets the data for `map`.
  2009. *
  2010. * @private
  2011. * @param {Object} map The map to query.
  2012. * @param {string} key The reference key.
  2013. * @returns {*} Returns the map data.
  2014. */
  2015. function getMapData(map, key) {
  2016. var data = map.__data__;
  2017. return isKeyable(key)
  2018. ? data[typeof key == 'string' ? 'string' : 'hash']
  2019. : data.map;
  2020. }
  2021. /**
  2022. * Gets the native function at `key` of `object`.
  2023. *
  2024. * @private
  2025. * @param {Object} object The object to query.
  2026. * @param {string} key The key of the method to get.
  2027. * @returns {*} Returns the function if it's native, else `undefined`.
  2028. */
  2029. function getNative(object, key) {
  2030. var value = getValue(object, key);
  2031. return baseIsNative(value) ? value : undefined;
  2032. }
  2033. /**
  2034. * Checks if `value` is suitable for use as unique object key.
  2035. *
  2036. * @private
  2037. * @param {*} value The value to check.
  2038. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2039. */
  2040. function isKeyable(value) {
  2041. var type = typeof value;
  2042. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  2043. ? (value !== '__proto__')
  2044. : (value === null);
  2045. }
  2046. /**
  2047. * Checks if `func` has its source masked.
  2048. *
  2049. * @private
  2050. * @param {Function} func The function to check.
  2051. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  2052. */
  2053. function isMasked(func) {
  2054. return !!maskSrcKey && (maskSrcKey in func);
  2055. }
  2056. /**
  2057. * Converts `func` to its source code.
  2058. *
  2059. * @private
  2060. * @param {Function} func The function to process.
  2061. * @returns {string} Returns the source code.
  2062. */
  2063. function toSource(func) {
  2064. if (func != null) {
  2065. try {
  2066. return funcToString.call(func);
  2067. } catch (e) {}
  2068. try {
  2069. return (func + '');
  2070. } catch (e) {}
  2071. }
  2072. return '';
  2073. }
  2074. /**
  2075. * Creates a duplicate-free version of an array, using
  2076. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2077. * for equality comparisons, in which only the first occurrence of each
  2078. * element is kept.
  2079. *
  2080. * @static
  2081. * @memberOf _
  2082. * @since 0.1.0
  2083. * @category Array
  2084. * @param {Array} array The array to inspect.
  2085. * @returns {Array} Returns the new duplicate free array.
  2086. * @example
  2087. *
  2088. * _.uniq([2, 1, 2]);
  2089. * // => [2, 1]
  2090. */
  2091. function uniq(array) {
  2092. return (array && array.length)
  2093. ? baseUniq(array)
  2094. : [];
  2095. }
  2096. /**
  2097. * Performs a
  2098. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2099. * comparison between two values to determine if they are equivalent.
  2100. *
  2101. * @static
  2102. * @memberOf _
  2103. * @since 4.0.0
  2104. * @category Lang
  2105. * @param {*} value The value to compare.
  2106. * @param {*} other The other value to compare.
  2107. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2108. * @example
  2109. *
  2110. * var object = { 'a': 1 };
  2111. * var other = { 'a': 1 };
  2112. *
  2113. * _.eq(object, object);
  2114. * // => true
  2115. *
  2116. * _.eq(object, other);
  2117. * // => false
  2118. *
  2119. * _.eq('a', 'a');
  2120. * // => true
  2121. *
  2122. * _.eq('a', Object('a'));
  2123. * // => false
  2124. *
  2125. * _.eq(NaN, NaN);
  2126. * // => true
  2127. */
  2128. function eq(value, other) {
  2129. return value === other || (value !== value && other !== other);
  2130. }
  2131. /**
  2132. * Checks if `value` is classified as a `Function` object.
  2133. *
  2134. * @static
  2135. * @memberOf _
  2136. * @since 0.1.0
  2137. * @category Lang
  2138. * @param {*} value The value to check.
  2139. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  2140. * @example
  2141. *
  2142. * _.isFunction(_);
  2143. * // => true
  2144. *
  2145. * _.isFunction(/abc/);
  2146. * // => false
  2147. */
  2148. function isFunction(value) {
  2149. // The use of `Object#toString` avoids issues with the `typeof` operator
  2150. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2151. var tag = isObject(value) ? objectToString.call(value) : '';
  2152. return tag == funcTag || tag == genTag;
  2153. }
  2154. /**
  2155. * Checks if `value` is the
  2156. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2157. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2158. *
  2159. * @static
  2160. * @memberOf _
  2161. * @since 0.1.0
  2162. * @category Lang
  2163. * @param {*} value The value to check.
  2164. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2165. * @example
  2166. *
  2167. * _.isObject({});
  2168. * // => true
  2169. *
  2170. * _.isObject([1, 2, 3]);
  2171. * // => true
  2172. *
  2173. * _.isObject(_.noop);
  2174. * // => true
  2175. *
  2176. * _.isObject(null);
  2177. * // => false
  2178. */
  2179. function isObject(value) {
  2180. var type = typeof value;
  2181. return !!value && (type == 'object' || type == 'function');
  2182. }
  2183. /**
  2184. * This method returns `undefined`.
  2185. *
  2186. * @static
  2187. * @memberOf _
  2188. * @since 2.3.0
  2189. * @category Util
  2190. * @example
  2191. *
  2192. * _.times(2, _.noop);
  2193. * // => [undefined, undefined]
  2194. */
  2195. function noop() {
  2196. // No operation performed.
  2197. }
  2198. module.exports = uniq;
  2199. /***/ }),
  2200. /***/ 129:
  2201. /***/ (function(module) {
  2202. module.exports = require("child_process");
  2203. /***/ }),
  2204. /***/ 139:
  2205. /***/ (function(module, __unusedexports, __webpack_require__) {
  2206. // Unique ID creation requires a high quality random # generator. In node.js
  2207. // this is pretty straight-forward - we use the crypto API.
  2208. var crypto = __webpack_require__(417);
  2209. module.exports = function nodeRNG() {
  2210. return crypto.randomBytes(16);
  2211. };
  2212. /***/ }),
  2213. /***/ 141:
  2214. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2215. "use strict";
  2216. var net = __webpack_require__(631);
  2217. var tls = __webpack_require__(16);
  2218. var http = __webpack_require__(605);
  2219. var https = __webpack_require__(34);
  2220. var events = __webpack_require__(614);
  2221. var assert = __webpack_require__(357);
  2222. var util = __webpack_require__(669);
  2223. exports.httpOverHttp = httpOverHttp;
  2224. exports.httpsOverHttp = httpsOverHttp;
  2225. exports.httpOverHttps = httpOverHttps;
  2226. exports.httpsOverHttps = httpsOverHttps;
  2227. function httpOverHttp(options) {
  2228. var agent = new TunnelingAgent(options);
  2229. agent.request = http.request;
  2230. return agent;
  2231. }
  2232. function httpsOverHttp(options) {
  2233. var agent = new TunnelingAgent(options);
  2234. agent.request = http.request;
  2235. agent.createSocket = createSecureSocket;
  2236. return agent;
  2237. }
  2238. function httpOverHttps(options) {
  2239. var agent = new TunnelingAgent(options);
  2240. agent.request = https.request;
  2241. return agent;
  2242. }
  2243. function httpsOverHttps(options) {
  2244. var agent = new TunnelingAgent(options);
  2245. agent.request = https.request;
  2246. agent.createSocket = createSecureSocket;
  2247. return agent;
  2248. }
  2249. function TunnelingAgent(options) {
  2250. var self = this;
  2251. self.options = options || {};
  2252. self.proxyOptions = self.options.proxy || {};
  2253. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2254. self.requests = [];
  2255. self.sockets = [];
  2256. self.on('free', function onFree(socket, host, port, localAddress) {
  2257. var options = toOptions(host, port, localAddress);
  2258. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2259. var pending = self.requests[i];
  2260. if (pending.host === options.host && pending.port === options.port) {
  2261. // Detect the request to connect same origin server,
  2262. // reuse the connection.
  2263. self.requests.splice(i, 1);
  2264. pending.request.onSocket(socket);
  2265. return;
  2266. }
  2267. }
  2268. socket.destroy();
  2269. self.removeSocket(socket);
  2270. });
  2271. }
  2272. util.inherits(TunnelingAgent, events.EventEmitter);
  2273. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2274. var self = this;
  2275. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2276. if (self.sockets.length >= this.maxSockets) {
  2277. // We are over limit so we'll add it to the queue.
  2278. self.requests.push(options);
  2279. return;
  2280. }
  2281. // If we are under maxSockets create a new one.
  2282. self.createSocket(options, function(socket) {
  2283. socket.on('free', onFree);
  2284. socket.on('close', onCloseOrRemove);
  2285. socket.on('agentRemove', onCloseOrRemove);
  2286. req.onSocket(socket);
  2287. function onFree() {
  2288. self.emit('free', socket, options);
  2289. }
  2290. function onCloseOrRemove(err) {
  2291. self.removeSocket(socket);
  2292. socket.removeListener('free', onFree);
  2293. socket.removeListener('close', onCloseOrRemove);
  2294. socket.removeListener('agentRemove', onCloseOrRemove);
  2295. }
  2296. });
  2297. };
  2298. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2299. var self = this;
  2300. var placeholder = {};
  2301. self.sockets.push(placeholder);
  2302. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2303. method: 'CONNECT',
  2304. path: options.host + ':' + options.port,
  2305. agent: false
  2306. });
  2307. if (connectOptions.proxyAuth) {
  2308. connectOptions.headers = connectOptions.headers || {};
  2309. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2310. new Buffer(connectOptions.proxyAuth).toString('base64');
  2311. }
  2312. debug('making CONNECT request');
  2313. var connectReq = self.request(connectOptions);
  2314. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2315. connectReq.once('response', onResponse); // for v0.6
  2316. connectReq.once('upgrade', onUpgrade); // for v0.6
  2317. connectReq.once('connect', onConnect); // for v0.7 or later
  2318. connectReq.once('error', onError);
  2319. connectReq.end();
  2320. function onResponse(res) {
  2321. // Very hacky. This is necessary to avoid http-parser leaks.
  2322. res.upgrade = true;
  2323. }
  2324. function onUpgrade(res, socket, head) {
  2325. // Hacky.
  2326. process.nextTick(function() {
  2327. onConnect(res, socket, head);
  2328. });
  2329. }
  2330. function onConnect(res, socket, head) {
  2331. connectReq.removeAllListeners();
  2332. socket.removeAllListeners();
  2333. if (res.statusCode === 200) {
  2334. assert.equal(head.length, 0);
  2335. debug('tunneling connection has established');
  2336. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2337. cb(socket);
  2338. } else {
  2339. debug('tunneling socket could not be established, statusCode=%d',
  2340. res.statusCode);
  2341. var error = new Error('tunneling socket could not be established, ' +
  2342. 'statusCode=' + res.statusCode);
  2343. error.code = 'ECONNRESET';
  2344. options.request.emit('error', error);
  2345. self.removeSocket(placeholder);
  2346. }
  2347. }
  2348. function onError(cause) {
  2349. connectReq.removeAllListeners();
  2350. debug('tunneling socket could not be established, cause=%s\n',
  2351. cause.message, cause.stack);
  2352. var error = new Error('tunneling socket could not be established, ' +
  2353. 'cause=' + cause.message);
  2354. error.code = 'ECONNRESET';
  2355. options.request.emit('error', error);
  2356. self.removeSocket(placeholder);
  2357. }
  2358. };
  2359. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2360. var pos = this.sockets.indexOf(socket)
  2361. if (pos === -1) {
  2362. return;
  2363. }
  2364. this.sockets.splice(pos, 1);
  2365. var pending = this.requests.shift();
  2366. if (pending) {
  2367. // If we have pending requests and a socket gets closed a new one
  2368. // needs to be created to take over in the pool for the one that closed.
  2369. this.createSocket(pending, function(socket) {
  2370. pending.request.onSocket(socket);
  2371. });
  2372. }
  2373. };
  2374. function createSecureSocket(options, cb) {
  2375. var self = this;
  2376. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2377. var hostHeader = options.request.getHeader('host');
  2378. var tlsOptions = mergeOptions({}, self.options, {
  2379. socket: socket,
  2380. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2381. });
  2382. // 0 is dummy port for v0.6
  2383. var secureSocket = tls.connect(0, tlsOptions);
  2384. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2385. cb(secureSocket);
  2386. });
  2387. }
  2388. function toOptions(host, port, localAddress) {
  2389. if (typeof host === 'string') { // since v0.10
  2390. return {
  2391. host: host,
  2392. port: port,
  2393. localAddress: localAddress
  2394. };
  2395. }
  2396. return host; // for v0.11 or later
  2397. }
  2398. function mergeOptions(target) {
  2399. for (var i = 1, len = arguments.length; i < len; ++i) {
  2400. var overrides = arguments[i];
  2401. if (typeof overrides === 'object') {
  2402. var keys = Object.keys(overrides);
  2403. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2404. var k = keys[j];
  2405. if (overrides[k] !== undefined) {
  2406. target[k] = overrides[k];
  2407. }
  2408. }
  2409. }
  2410. }
  2411. return target;
  2412. }
  2413. var debug;
  2414. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2415. debug = function() {
  2416. var args = Array.prototype.slice.call(arguments);
  2417. if (typeof args[0] === 'string') {
  2418. args[0] = 'TUNNEL: ' + args[0];
  2419. } else {
  2420. args.unshift('TUNNEL:');
  2421. }
  2422. console.error.apply(console, args);
  2423. }
  2424. } else {
  2425. debug = function() {};
  2426. }
  2427. exports.debug = debug; // for test
  2428. /***/ }),
  2429. /***/ 143:
  2430. /***/ (function(module, __unusedexports, __webpack_require__) {
  2431. module.exports = withAuthorizationPrefix;
  2432. const atob = __webpack_require__(368);
  2433. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2434. function withAuthorizationPrefix(authorization) {
  2435. if (/^(basic|bearer|token) /i.test(authorization)) {
  2436. return authorization;
  2437. }
  2438. try {
  2439. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2440. return `basic ${authorization}`;
  2441. }
  2442. } catch (error) {}
  2443. if (authorization.split(/\./).length === 3) {
  2444. return `bearer ${authorization}`;
  2445. }
  2446. return `token ${authorization}`;
  2447. }
  2448. /***/ }),
  2449. /***/ 145:
  2450. /***/ (function(module, __unusedexports, __webpack_require__) {
  2451. "use strict";
  2452. const pump = __webpack_require__(453);
  2453. const bufferStream = __webpack_require__(966);
  2454. class MaxBufferError extends Error {
  2455. constructor() {
  2456. super('maxBuffer exceeded');
  2457. this.name = 'MaxBufferError';
  2458. }
  2459. }
  2460. function getStream(inputStream, options) {
  2461. if (!inputStream) {
  2462. return Promise.reject(new Error('Expected a stream'));
  2463. }
  2464. options = Object.assign({maxBuffer: Infinity}, options);
  2465. const {maxBuffer} = options;
  2466. let stream;
  2467. return new Promise((resolve, reject) => {
  2468. const rejectPromise = error => {
  2469. if (error) { // A null check
  2470. error.bufferedData = stream.getBufferedValue();
  2471. }
  2472. reject(error);
  2473. };
  2474. stream = pump(inputStream, bufferStream(options), error => {
  2475. if (error) {
  2476. rejectPromise(error);
  2477. return;
  2478. }
  2479. resolve();
  2480. });
  2481. stream.on('data', () => {
  2482. if (stream.getBufferedLength() > maxBuffer) {
  2483. rejectPromise(new MaxBufferError());
  2484. }
  2485. });
  2486. }).then(() => stream.getBufferedValue());
  2487. }
  2488. module.exports = getStream;
  2489. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2490. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2491. module.exports.MaxBufferError = MaxBufferError;
  2492. /***/ }),
  2493. /***/ 148:
  2494. /***/ (function(module, __unusedexports, __webpack_require__) {
  2495. module.exports = paginatePlugin;
  2496. const { paginateRest } = __webpack_require__(299);
  2497. function paginatePlugin(octokit) {
  2498. Object.assign(octokit, paginateRest(octokit));
  2499. }
  2500. /***/ }),
  2501. /***/ 153:
  2502. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2503. "use strict";
  2504. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2505. if (k2 === undefined) k2 = k;
  2506. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2507. }) : (function(o, m, k, k2) {
  2508. if (k2 === undefined) k2 = k;
  2509. o[k2] = m[k];
  2510. }));
  2511. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2512. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2513. }) : function(o, v) {
  2514. o["default"] = v;
  2515. });
  2516. var __importStar = (this && this.__importStar) || function (mod) {
  2517. if (mod && mod.__esModule) return mod;
  2518. var result = {};
  2519. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2520. __setModuleDefault(result, mod);
  2521. return result;
  2522. };
  2523. Object.defineProperty(exports, "__esModule", { value: true });
  2524. exports.setSshKnownHostsPath = exports.setSshKeyPath = exports.setRepositoryPath = exports.SshKnownHostsPath = exports.SshKeyPath = exports.RepositoryPath = exports.IsPost = void 0;
  2525. const coreCommand = __importStar(__webpack_require__(431));
  2526. /**
  2527. * Indicates whether the POST action is running
  2528. */
  2529. exports.IsPost = !!process.env['STATE_isPost'];
  2530. /**
  2531. * The repository path for the POST action. The value is empty during the MAIN action.
  2532. */
  2533. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2534. /**
  2535. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2536. */
  2537. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2538. /**
  2539. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2540. */
  2541. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2542. /**
  2543. * Save the repository path so the POST action can retrieve the value.
  2544. */
  2545. function setRepositoryPath(repositoryPath) {
  2546. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2547. }
  2548. exports.setRepositoryPath = setRepositoryPath;
  2549. /**
  2550. * Save the SSH key path so the POST action can retrieve the value.
  2551. */
  2552. function setSshKeyPath(sshKeyPath) {
  2553. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2554. }
  2555. exports.setSshKeyPath = setSshKeyPath;
  2556. /**
  2557. * Save the SSH known hosts path so the POST action can retrieve the value.
  2558. */
  2559. function setSshKnownHostsPath(sshKnownHostsPath) {
  2560. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2561. }
  2562. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2563. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2564. // This is necessary since we don't have a separate entry point.
  2565. if (!exports.IsPost) {
  2566. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2567. }
  2568. /***/ }),
  2569. /***/ 168:
  2570. /***/ (function(module) {
  2571. "use strict";
  2572. const alias = ['stdin', 'stdout', 'stderr'];
  2573. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2574. module.exports = opts => {
  2575. if (!opts) {
  2576. return null;
  2577. }
  2578. if (opts.stdio && hasAlias(opts)) {
  2579. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2580. }
  2581. if (typeof opts.stdio === 'string') {
  2582. return opts.stdio;
  2583. }
  2584. const stdio = opts.stdio || [];
  2585. if (!Array.isArray(stdio)) {
  2586. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2587. }
  2588. const result = [];
  2589. const len = Math.max(stdio.length, alias.length);
  2590. for (let i = 0; i < len; i++) {
  2591. let value = null;
  2592. if (stdio[i] !== undefined) {
  2593. value = stdio[i];
  2594. } else if (opts[alias[i]] !== undefined) {
  2595. value = opts[alias[i]];
  2596. }
  2597. result[i] = value;
  2598. }
  2599. return result;
  2600. };
  2601. /***/ }),
  2602. /***/ 179:
  2603. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2604. "use strict";
  2605. var net = __webpack_require__(631);
  2606. var tls = __webpack_require__(16);
  2607. var http = __webpack_require__(605);
  2608. var https = __webpack_require__(34);
  2609. var events = __webpack_require__(614);
  2610. var assert = __webpack_require__(357);
  2611. var util = __webpack_require__(669);
  2612. exports.httpOverHttp = httpOverHttp;
  2613. exports.httpsOverHttp = httpsOverHttp;
  2614. exports.httpOverHttps = httpOverHttps;
  2615. exports.httpsOverHttps = httpsOverHttps;
  2616. function httpOverHttp(options) {
  2617. var agent = new TunnelingAgent(options);
  2618. agent.request = http.request;
  2619. return agent;
  2620. }
  2621. function httpsOverHttp(options) {
  2622. var agent = new TunnelingAgent(options);
  2623. agent.request = http.request;
  2624. agent.createSocket = createSecureSocket;
  2625. agent.defaultPort = 443;
  2626. return agent;
  2627. }
  2628. function httpOverHttps(options) {
  2629. var agent = new TunnelingAgent(options);
  2630. agent.request = https.request;
  2631. return agent;
  2632. }
  2633. function httpsOverHttps(options) {
  2634. var agent = new TunnelingAgent(options);
  2635. agent.request = https.request;
  2636. agent.createSocket = createSecureSocket;
  2637. agent.defaultPort = 443;
  2638. return agent;
  2639. }
  2640. function TunnelingAgent(options) {
  2641. var self = this;
  2642. self.options = options || {};
  2643. self.proxyOptions = self.options.proxy || {};
  2644. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2645. self.requests = [];
  2646. self.sockets = [];
  2647. self.on('free', function onFree(socket, host, port, localAddress) {
  2648. var options = toOptions(host, port, localAddress);
  2649. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2650. var pending = self.requests[i];
  2651. if (pending.host === options.host && pending.port === options.port) {
  2652. // Detect the request to connect same origin server,
  2653. // reuse the connection.
  2654. self.requests.splice(i, 1);
  2655. pending.request.onSocket(socket);
  2656. return;
  2657. }
  2658. }
  2659. socket.destroy();
  2660. self.removeSocket(socket);
  2661. });
  2662. }
  2663. util.inherits(TunnelingAgent, events.EventEmitter);
  2664. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2665. var self = this;
  2666. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2667. if (self.sockets.length >= this.maxSockets) {
  2668. // We are over limit so we'll add it to the queue.
  2669. self.requests.push(options);
  2670. return;
  2671. }
  2672. // If we are under maxSockets create a new one.
  2673. self.createSocket(options, function(socket) {
  2674. socket.on('free', onFree);
  2675. socket.on('close', onCloseOrRemove);
  2676. socket.on('agentRemove', onCloseOrRemove);
  2677. req.onSocket(socket);
  2678. function onFree() {
  2679. self.emit('free', socket, options);
  2680. }
  2681. function onCloseOrRemove(err) {
  2682. self.removeSocket(socket);
  2683. socket.removeListener('free', onFree);
  2684. socket.removeListener('close', onCloseOrRemove);
  2685. socket.removeListener('agentRemove', onCloseOrRemove);
  2686. }
  2687. });
  2688. };
  2689. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2690. var self = this;
  2691. var placeholder = {};
  2692. self.sockets.push(placeholder);
  2693. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2694. method: 'CONNECT',
  2695. path: options.host + ':' + options.port,
  2696. agent: false,
  2697. headers: {
  2698. host: options.host + ':' + options.port
  2699. }
  2700. });
  2701. if (options.localAddress) {
  2702. connectOptions.localAddress = options.localAddress;
  2703. }
  2704. if (connectOptions.proxyAuth) {
  2705. connectOptions.headers = connectOptions.headers || {};
  2706. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2707. new Buffer(connectOptions.proxyAuth).toString('base64');
  2708. }
  2709. debug('making CONNECT request');
  2710. var connectReq = self.request(connectOptions);
  2711. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2712. connectReq.once('response', onResponse); // for v0.6
  2713. connectReq.once('upgrade', onUpgrade); // for v0.6
  2714. connectReq.once('connect', onConnect); // for v0.7 or later
  2715. connectReq.once('error', onError);
  2716. connectReq.end();
  2717. function onResponse(res) {
  2718. // Very hacky. This is necessary to avoid http-parser leaks.
  2719. res.upgrade = true;
  2720. }
  2721. function onUpgrade(res, socket, head) {
  2722. // Hacky.
  2723. process.nextTick(function() {
  2724. onConnect(res, socket, head);
  2725. });
  2726. }
  2727. function onConnect(res, socket, head) {
  2728. connectReq.removeAllListeners();
  2729. socket.removeAllListeners();
  2730. if (res.statusCode !== 200) {
  2731. debug('tunneling socket could not be established, statusCode=%d',
  2732. res.statusCode);
  2733. socket.destroy();
  2734. var error = new Error('tunneling socket could not be established, ' +
  2735. 'statusCode=' + res.statusCode);
  2736. error.code = 'ECONNRESET';
  2737. options.request.emit('error', error);
  2738. self.removeSocket(placeholder);
  2739. return;
  2740. }
  2741. if (head.length > 0) {
  2742. debug('got illegal response body from proxy');
  2743. socket.destroy();
  2744. var error = new Error('got illegal response body from proxy');
  2745. error.code = 'ECONNRESET';
  2746. options.request.emit('error', error);
  2747. self.removeSocket(placeholder);
  2748. return;
  2749. }
  2750. debug('tunneling connection has established');
  2751. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2752. return cb(socket);
  2753. }
  2754. function onError(cause) {
  2755. connectReq.removeAllListeners();
  2756. debug('tunneling socket could not be established, cause=%s\n',
  2757. cause.message, cause.stack);
  2758. var error = new Error('tunneling socket could not be established, ' +
  2759. 'cause=' + cause.message);
  2760. error.code = 'ECONNRESET';
  2761. options.request.emit('error', error);
  2762. self.removeSocket(placeholder);
  2763. }
  2764. };
  2765. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2766. var pos = this.sockets.indexOf(socket)
  2767. if (pos === -1) {
  2768. return;
  2769. }
  2770. this.sockets.splice(pos, 1);
  2771. var pending = this.requests.shift();
  2772. if (pending) {
  2773. // If we have pending requests and a socket gets closed a new one
  2774. // needs to be created to take over in the pool for the one that closed.
  2775. this.createSocket(pending, function(socket) {
  2776. pending.request.onSocket(socket);
  2777. });
  2778. }
  2779. };
  2780. function createSecureSocket(options, cb) {
  2781. var self = this;
  2782. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2783. var hostHeader = options.request.getHeader('host');
  2784. var tlsOptions = mergeOptions({}, self.options, {
  2785. socket: socket,
  2786. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2787. });
  2788. // 0 is dummy port for v0.6
  2789. var secureSocket = tls.connect(0, tlsOptions);
  2790. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2791. cb(secureSocket);
  2792. });
  2793. }
  2794. function toOptions(host, port, localAddress) {
  2795. if (typeof host === 'string') { // since v0.10
  2796. return {
  2797. host: host,
  2798. port: port,
  2799. localAddress: localAddress
  2800. };
  2801. }
  2802. return host; // for v0.11 or later
  2803. }
  2804. function mergeOptions(target) {
  2805. for (var i = 1, len = arguments.length; i < len; ++i) {
  2806. var overrides = arguments[i];
  2807. if (typeof overrides === 'object') {
  2808. var keys = Object.keys(overrides);
  2809. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2810. var k = keys[j];
  2811. if (overrides[k] !== undefined) {
  2812. target[k] = overrides[k];
  2813. }
  2814. }
  2815. }
  2816. }
  2817. return target;
  2818. }
  2819. var debug;
  2820. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2821. debug = function() {
  2822. var args = Array.prototype.slice.call(arguments);
  2823. if (typeof args[0] === 'string') {
  2824. args[0] = 'TUNNEL: ' + args[0];
  2825. } else {
  2826. args.unshift('TUNNEL:');
  2827. }
  2828. console.error.apply(console, args);
  2829. }
  2830. } else {
  2831. debug = function() {};
  2832. }
  2833. exports.debug = debug; // for test
  2834. /***/ }),
  2835. /***/ 190:
  2836. /***/ (function(module, __unusedexports, __webpack_require__) {
  2837. module.exports = authenticationPlugin;
  2838. const { createTokenAuth } = __webpack_require__(813);
  2839. const { Deprecation } = __webpack_require__(692);
  2840. const once = __webpack_require__(969);
  2841. const beforeRequest = __webpack_require__(863);
  2842. const requestError = __webpack_require__(991);
  2843. const validate = __webpack_require__(954);
  2844. const withAuthorizationPrefix = __webpack_require__(143);
  2845. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2846. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2847. function authenticationPlugin(octokit, options) {
  2848. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2849. if (options.authStrategy) {
  2850. const auth = options.authStrategy(options.auth);
  2851. octokit.hook.wrap("request", auth.hook);
  2852. octokit.auth = auth;
  2853. return;
  2854. }
  2855. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2856. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2857. if (!options.auth) {
  2858. octokit.auth = () =>
  2859. Promise.resolve({
  2860. type: "unauthenticated"
  2861. });
  2862. return;
  2863. }
  2864. const isBasicAuthString =
  2865. typeof options.auth === "string" &&
  2866. /^basic/.test(withAuthorizationPrefix(options.auth));
  2867. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2868. if (typeof options.auth === "string" && !isBasicAuthString) {
  2869. const auth = createTokenAuth(options.auth);
  2870. octokit.hook.wrap("request", auth.hook);
  2871. octokit.auth = auth;
  2872. return;
  2873. }
  2874. // Otherwise log a deprecation message
  2875. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2876. ? [
  2877. deprecateAuthBasic,
  2878. '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)'
  2879. ]
  2880. : [
  2881. deprecateAuthObject,
  2882. '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)'
  2883. ];
  2884. deprecationMethod(
  2885. octokit.log,
  2886. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2887. );
  2888. octokit.auth = () =>
  2889. Promise.resolve({
  2890. type: "deprecated",
  2891. message: deprecationMessapge
  2892. });
  2893. validate(options.auth);
  2894. const state = {
  2895. octokit,
  2896. auth: options.auth
  2897. };
  2898. octokit.hook.before("request", beforeRequest.bind(null, state));
  2899. octokit.hook.error("request", requestError.bind(null, state));
  2900. }
  2901. /***/ }),
  2902. /***/ 197:
  2903. /***/ (function(module, __unusedexports, __webpack_require__) {
  2904. module.exports = isexe
  2905. isexe.sync = sync
  2906. var fs = __webpack_require__(747)
  2907. function isexe (path, options, cb) {
  2908. fs.stat(path, function (er, stat) {
  2909. cb(er, er ? false : checkStat(stat, options))
  2910. })
  2911. }
  2912. function sync (path, options) {
  2913. return checkStat(fs.statSync(path), options)
  2914. }
  2915. function checkStat (stat, options) {
  2916. return stat.isFile() && checkMode(stat, options)
  2917. }
  2918. function checkMode (stat, options) {
  2919. var mod = stat.mode
  2920. var uid = stat.uid
  2921. var gid = stat.gid
  2922. var myUid = options.uid !== undefined ?
  2923. options.uid : process.getuid && process.getuid()
  2924. var myGid = options.gid !== undefined ?
  2925. options.gid : process.getgid && process.getgid()
  2926. var u = parseInt('100', 8)
  2927. var g = parseInt('010', 8)
  2928. var o = parseInt('001', 8)
  2929. var ug = u | g
  2930. var ret = (mod & o) ||
  2931. (mod & g) && gid === myGid ||
  2932. (mod & u) && uid === myUid ||
  2933. (mod & ug) && myUid === 0
  2934. return ret
  2935. }
  2936. /***/ }),
  2937. /***/ 198:
  2938. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2939. "use strict";
  2940. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  2941. if (k2 === undefined) k2 = k;
  2942. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  2943. }) : (function(o, m, k, k2) {
  2944. if (k2 === undefined) k2 = k;
  2945. o[k2] = m[k];
  2946. }));
  2947. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  2948. Object.defineProperty(o, "default", { enumerable: true, value: v });
  2949. }) : function(o, v) {
  2950. o["default"] = v;
  2951. });
  2952. var __importStar = (this && this.__importStar) || function (mod) {
  2953. if (mod && mod.__esModule) return mod;
  2954. var result = {};
  2955. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  2956. __setModuleDefault(result, mod);
  2957. return result;
  2958. };
  2959. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2960. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2961. return new (P || (P = Promise))(function (resolve, reject) {
  2962. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2963. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2964. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2965. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2966. });
  2967. };
  2968. Object.defineProperty(exports, "__esModule", { value: true });
  2969. const core = __importStar(__webpack_require__(470));
  2970. const coreCommand = __importStar(__webpack_require__(431));
  2971. const gitSourceProvider = __importStar(__webpack_require__(293));
  2972. const inputHelper = __importStar(__webpack_require__(821));
  2973. const path = __importStar(__webpack_require__(622));
  2974. const stateHelper = __importStar(__webpack_require__(153));
  2975. function run() {
  2976. var _a, _b;
  2977. return __awaiter(this, void 0, void 0, function* () {
  2978. try {
  2979. const sourceSettings = inputHelper.getInputs();
  2980. try {
  2981. // Register problem matcher
  2982. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2983. // Get sources
  2984. yield gitSourceProvider.getSource(sourceSettings);
  2985. }
  2986. finally {
  2987. // Unregister problem matcher
  2988. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2989. }
  2990. }
  2991. catch (error) {
  2992. core.setFailed(`${(_b = (_a = error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : error}`);
  2993. }
  2994. });
  2995. }
  2996. function cleanup() {
  2997. var _a, _b;
  2998. return __awaiter(this, void 0, void 0, function* () {
  2999. try {
  3000. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  3001. }
  3002. catch (error) {
  3003. core.warning(`${(_b = (_a = error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : error}`);
  3004. }
  3005. });
  3006. }
  3007. // Main
  3008. if (!stateHelper.IsPost) {
  3009. run();
  3010. }
  3011. // Post
  3012. else {
  3013. cleanup();
  3014. }
  3015. /***/ }),
  3016. /***/ 211:
  3017. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3018. "use strict";
  3019. Object.defineProperty(exports, '__esModule', { value: true });
  3020. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  3021. var osName = _interopDefault(__webpack_require__(2));
  3022. function getUserAgent() {
  3023. try {
  3024. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  3025. } catch (error) {
  3026. if (/wmic os get Caption/.test(error.message)) {
  3027. return "Windows <version undetectable>";
  3028. }
  3029. return "<environment undetectable>";
  3030. }
  3031. }
  3032. exports.getUserAgent = getUserAgent;
  3033. //# sourceMappingURL=index.js.map
  3034. /***/ }),
  3035. /***/ 215:
  3036. /***/ (function(module) {
  3037. 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"};
  3038. /***/ }),
  3039. /***/ 227:
  3040. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3041. "use strict";
  3042. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3043. if (k2 === undefined) k2 = k;
  3044. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  3045. }) : (function(o, m, k, k2) {
  3046. if (k2 === undefined) k2 = k;
  3047. o[k2] = m[k];
  3048. }));
  3049. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  3050. Object.defineProperty(o, "default", { enumerable: true, value: v });
  3051. }) : function(o, v) {
  3052. o["default"] = v;
  3053. });
  3054. var __importStar = (this && this.__importStar) || function (mod) {
  3055. if (mod && mod.__esModule) return mod;
  3056. var result = {};
  3057. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  3058. __setModuleDefault(result, mod);
  3059. return result;
  3060. };
  3061. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  3062. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3063. return new (P || (P = Promise))(function (resolve, reject) {
  3064. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  3065. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  3066. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  3067. step((generator = generator.apply(thisArg, _arguments || [])).next());
  3068. });
  3069. };
  3070. Object.defineProperty(exports, "__esModule", { value: true });
  3071. exports.checkCommitInfo = exports.testRef = exports.getRefSpec = exports.getRefSpecForAllHistory = exports.getCheckoutInfo = exports.tagsRefSpec = void 0;
  3072. const url_1 = __webpack_require__(835);
  3073. const core = __importStar(__webpack_require__(470));
  3074. const github = __importStar(__webpack_require__(469));
  3075. exports.tagsRefSpec = '+refs/tags/*:refs/tags/*';
  3076. function getCheckoutInfo(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. const result = {};
  3085. const upperRef = (ref || '').toUpperCase();
  3086. // SHA only
  3087. if (!ref) {
  3088. result.ref = commit;
  3089. }
  3090. // refs/heads/
  3091. else if (upperRef.startsWith('REFS/HEADS/')) {
  3092. const branch = ref.substring('refs/heads/'.length);
  3093. result.ref = branch;
  3094. result.startPoint = `refs/remotes/origin/${branch}`;
  3095. }
  3096. // refs/pull/
  3097. else if (upperRef.startsWith('REFS/PULL/')) {
  3098. const branch = ref.substring('refs/pull/'.length);
  3099. result.ref = `refs/remotes/pull/${branch}`;
  3100. }
  3101. // refs/tags/
  3102. else if (upperRef.startsWith('REFS/')) {
  3103. result.ref = ref;
  3104. }
  3105. // Unqualified ref, check for a matching branch or tag
  3106. else {
  3107. if (yield git.branchExists(true, `origin/${ref}`)) {
  3108. result.ref = ref;
  3109. result.startPoint = `refs/remotes/origin/${ref}`;
  3110. }
  3111. else if (yield git.tagExists(`${ref}`)) {
  3112. result.ref = `refs/tags/${ref}`;
  3113. }
  3114. else {
  3115. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  3116. }
  3117. }
  3118. return result;
  3119. });
  3120. }
  3121. exports.getCheckoutInfo = getCheckoutInfo;
  3122. function getRefSpecForAllHistory(ref, commit) {
  3123. const result = ['+refs/heads/*:refs/remotes/origin/*', exports.tagsRefSpec];
  3124. if (ref && ref.toUpperCase().startsWith('REFS/PULL/')) {
  3125. const branch = ref.substring('refs/pull/'.length);
  3126. result.push(`+${commit || ref}:refs/remotes/pull/${branch}`);
  3127. }
  3128. return result;
  3129. }
  3130. exports.getRefSpecForAllHistory = getRefSpecForAllHistory;
  3131. function getRefSpec(ref, commit) {
  3132. if (!ref && !commit) {
  3133. throw new Error('Args ref and commit cannot both be empty');
  3134. }
  3135. const upperRef = (ref || '').toUpperCase();
  3136. // SHA
  3137. if (commit) {
  3138. // refs/heads
  3139. if (upperRef.startsWith('REFS/HEADS/')) {
  3140. const branch = ref.substring('refs/heads/'.length);
  3141. return [`+${commit}:refs/remotes/origin/${branch}`];
  3142. }
  3143. // refs/pull/
  3144. else if (upperRef.startsWith('REFS/PULL/')) {
  3145. const branch = ref.substring('refs/pull/'.length);
  3146. return [`+${commit}:refs/remotes/pull/${branch}`];
  3147. }
  3148. // refs/tags/
  3149. else if (upperRef.startsWith('REFS/TAGS/')) {
  3150. return [`+${commit}:${ref}`];
  3151. }
  3152. // Otherwise no destination ref
  3153. else {
  3154. return [commit];
  3155. }
  3156. }
  3157. // Unqualified ref, check for a matching branch or tag
  3158. else if (!upperRef.startsWith('REFS/')) {
  3159. return [
  3160. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  3161. `+refs/tags/${ref}*:refs/tags/${ref}*`
  3162. ];
  3163. }
  3164. // refs/heads/
  3165. else if (upperRef.startsWith('REFS/HEADS/')) {
  3166. const branch = ref.substring('refs/heads/'.length);
  3167. return [`+${ref}:refs/remotes/origin/${branch}`];
  3168. }
  3169. // refs/pull/
  3170. else if (upperRef.startsWith('REFS/PULL/')) {
  3171. const branch = ref.substring('refs/pull/'.length);
  3172. return [`+${ref}:refs/remotes/pull/${branch}`];
  3173. }
  3174. // refs/tags/
  3175. else {
  3176. return [`+${ref}:${ref}`];
  3177. }
  3178. }
  3179. exports.getRefSpec = getRefSpec;
  3180. /**
  3181. * Tests whether the initial fetch created the ref at the expected commit
  3182. */
  3183. function testRef(git, ref, commit) {
  3184. return __awaiter(this, void 0, void 0, function* () {
  3185. if (!git) {
  3186. throw new Error('Arg git cannot be empty');
  3187. }
  3188. if (!ref && !commit) {
  3189. throw new Error('Args ref and commit cannot both be empty');
  3190. }
  3191. // No SHA? Nothing to test
  3192. if (!commit) {
  3193. return true;
  3194. }
  3195. // SHA only?
  3196. else if (!ref) {
  3197. return yield git.shaExists(commit);
  3198. }
  3199. const upperRef = ref.toUpperCase();
  3200. // refs/heads/
  3201. if (upperRef.startsWith('REFS/HEADS/')) {
  3202. const branch = ref.substring('refs/heads/'.length);
  3203. return ((yield git.branchExists(true, `origin/${branch}`)) &&
  3204. commit === (yield git.revParse(`refs/remotes/origin/${branch}`)));
  3205. }
  3206. // refs/pull/
  3207. else if (upperRef.startsWith('REFS/PULL/')) {
  3208. // Assume matches because fetched using the commit
  3209. return true;
  3210. }
  3211. // refs/tags/
  3212. else if (upperRef.startsWith('REFS/TAGS/')) {
  3213. const tagName = ref.substring('refs/tags/'.length);
  3214. return ((yield git.tagExists(tagName)) && commit === (yield git.revParse(ref)));
  3215. }
  3216. // Unexpected
  3217. else {
  3218. core.debug(`Unexpected ref format '${ref}' when testing ref info`);
  3219. return true;
  3220. }
  3221. });
  3222. }
  3223. exports.testRef = testRef;
  3224. function checkCommitInfo(token, commitInfo, repositoryOwner, repositoryName, ref, commit) {
  3225. var _a, _b;
  3226. return __awaiter(this, void 0, void 0, function* () {
  3227. try {
  3228. // GHES?
  3229. if (isGhes()) {
  3230. return;
  3231. }
  3232. // Auth token?
  3233. if (!token) {
  3234. return;
  3235. }
  3236. // Public PR synchronize, for workflow repo?
  3237. if (fromPayload('repository.private') !== false ||
  3238. github.context.eventName !== 'pull_request' ||
  3239. fromPayload('action') !== 'synchronize' ||
  3240. repositoryOwner !== github.context.repo.owner ||
  3241. repositoryName !== github.context.repo.repo ||
  3242. ref !== github.context.ref ||
  3243. !ref.startsWith('refs/pull/') ||
  3244. commit !== github.context.sha) {
  3245. return;
  3246. }
  3247. // Head SHA
  3248. const expectedHeadSha = fromPayload('after');
  3249. if (!expectedHeadSha) {
  3250. core.debug('Unable to determine head sha');
  3251. return;
  3252. }
  3253. // Base SHA
  3254. const expectedBaseSha = fromPayload('pull_request.base.sha');
  3255. if (!expectedBaseSha) {
  3256. core.debug('Unable to determine base sha');
  3257. return;
  3258. }
  3259. // Expected message?
  3260. const expectedMessage = `Merge ${expectedHeadSha} into ${expectedBaseSha}`;
  3261. if (commitInfo.indexOf(expectedMessage) >= 0) {
  3262. return;
  3263. }
  3264. // Extract details from message
  3265. const match = commitInfo.match(/Merge ([0-9a-f]{40}) into ([0-9a-f]{40})/);
  3266. if (!match) {
  3267. core.debug('Unexpected message format');
  3268. return;
  3269. }
  3270. // Post telemetry
  3271. const actualHeadSha = match[1];
  3272. if (actualHeadSha !== expectedHeadSha) {
  3273. core.debug(`Expected head sha ${expectedHeadSha}; actual head sha ${actualHeadSha}`);
  3274. const octokit = new github.GitHub(token, {
  3275. 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})`
  3276. });
  3277. yield octokit.repos.get({ owner: repositoryOwner, repo: repositoryName });
  3278. }
  3279. }
  3280. catch (err) {
  3281. core.debug(`Error when validating commit info: ${(_b = (_a = err) === null || _a === void 0 ? void 0 : _a.stack) !== null && _b !== void 0 ? _b : err}`);
  3282. }
  3283. });
  3284. }
  3285. exports.checkCommitInfo = checkCommitInfo;
  3286. function fromPayload(path) {
  3287. return select(github.context.payload, path);
  3288. }
  3289. function select(obj, path) {
  3290. if (!obj) {
  3291. return undefined;
  3292. }
  3293. const i = path.indexOf('.');
  3294. if (i < 0) {
  3295. return obj[path];
  3296. }
  3297. const key = path.substr(0, i);
  3298. return select(obj[key], path.substr(i + 1));
  3299. }
  3300. function isGhes() {
  3301. const ghUrl = new url_1.URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
  3302. return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
  3303. }
  3304. /***/ }),
  3305. /***/ 260:
  3306. /***/ (function(module, __unusedexports, __webpack_require__) {
  3307. // Note: since nyc uses this module to output coverage, any lines
  3308. // that are in the direct sync flow of nyc's outputCoverage are
  3309. // ignored, since we can never get coverage for them.
  3310. var assert = __webpack_require__(357)
  3311. var signals = __webpack_require__(654)
  3312. var EE = __webpack_require__(614)
  3313. /* istanbul ignore if */
  3314. if (typeof EE !== 'function') {
  3315. EE = EE.EventEmitter
  3316. }
  3317. var emitter
  3318. if (process.__signal_exit_emitter__) {
  3319. emitter = process.__signal_exit_emitter__
  3320. } else {
  3321. emitter = process.__signal_exit_emitter__ = new EE()
  3322. emitter.count = 0
  3323. emitter.emitted = {}
  3324. }
  3325. // Because this emitter is a global, we have to check to see if a
  3326. // previous version of this library failed to enable infinite listeners.
  3327. // I know what you're about to say. But literally everything about
  3328. // signal-exit is a compromise with evil. Get used to it.
  3329. if (!emitter.infinite) {
  3330. emitter.setMaxListeners(Infinity)
  3331. emitter.infinite = true
  3332. }
  3333. module.exports = function (cb, opts) {
  3334. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  3335. if (loaded === false) {
  3336. load()
  3337. }
  3338. var ev = 'exit'
  3339. if (opts && opts.alwaysLast) {
  3340. ev = 'afterexit'
  3341. }
  3342. var remove = function () {
  3343. emitter.removeListener(ev, cb)
  3344. if (emitter.listeners('exit').length === 0 &&
  3345. emitter.listeners('afterexit').length === 0) {
  3346. unload()
  3347. }
  3348. }
  3349. emitter.on(ev, cb)
  3350. return remove
  3351. }
  3352. module.exports.unload = unload
  3353. function unload () {
  3354. if (!loaded) {
  3355. return
  3356. }
  3357. loaded = false
  3358. signals.forEach(function (sig) {
  3359. try {
  3360. process.removeListener(sig, sigListeners[sig])
  3361. } catch (er) {}
  3362. })
  3363. process.emit = originalProcessEmit
  3364. process.reallyExit = originalProcessReallyExit
  3365. emitter.count -= 1
  3366. }
  3367. function emit (event, code, signal) {
  3368. if (emitter.emitted[event]) {
  3369. return
  3370. }
  3371. emitter.emitted[event] = true
  3372. emitter.emit(event, code, signal)
  3373. }
  3374. // { <signal>: <listener fn>, ... }
  3375. var sigListeners = {}
  3376. signals.forEach(function (sig) {
  3377. sigListeners[sig] = function listener () {
  3378. // If there are no other listeners, an exit is coming!
  3379. // Simplest way: remove us and then re-send the signal.
  3380. // We know that this will kill the process, so we can
  3381. // safely emit now.
  3382. var listeners = process.listeners(sig)
  3383. if (listeners.length === emitter.count) {
  3384. unload()
  3385. emit('exit', null, sig)
  3386. /* istanbul ignore next */
  3387. emit('afterexit', null, sig)
  3388. /* istanbul ignore next */
  3389. process.kill(process.pid, sig)
  3390. }
  3391. }
  3392. })
  3393. module.exports.signals = function () {
  3394. return signals
  3395. }
  3396. module.exports.load = load
  3397. var loaded = false
  3398. function load () {
  3399. if (loaded) {
  3400. return
  3401. }
  3402. loaded = true
  3403. // This is the number of onSignalExit's that are in play.
  3404. // It's important so that we can count the correct number of
  3405. // listeners on signals, and don't wait for the other one to
  3406. // handle it instead of us.
  3407. emitter.count += 1
  3408. signals = signals.filter(function (sig) {
  3409. try {
  3410. process.on(sig, sigListeners[sig])
  3411. return true
  3412. } catch (er) {
  3413. return false
  3414. }
  3415. })
  3416. process.emit = processEmit
  3417. process.reallyExit = processReallyExit
  3418. }
  3419. var originalProcessReallyExit = process.reallyExit
  3420. function processReallyExit (code) {
  3421. process.exitCode = code || 0
  3422. emit('exit', process.exitCode, null)
  3423. /* istanbul ignore next */
  3424. emit('afterexit', process.exitCode, null)
  3425. /* istanbul ignore next */
  3426. originalProcessReallyExit.call(process, process.exitCode)
  3427. }
  3428. var originalProcessEmit = process.emit
  3429. function processEmit (ev, arg) {
  3430. if (ev === 'exit') {
  3431. if (arg !== undefined) {
  3432. process.exitCode = arg
  3433. }
  3434. var ret = originalProcessEmit.apply(this, arguments)
  3435. emit('exit', process.exitCode, null)
  3436. /* istanbul ignore next */
  3437. emit('afterexit', process.exitCode, null)
  3438. return ret
  3439. } else {
  3440. return originalProcessEmit.apply(this, arguments)
  3441. }
  3442. }
  3443. /***/ }),
  3444. /***/ 262:
  3445. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3446. "use strict";
  3447. Object.defineProperty(exports, "__esModule", { value: true });
  3448. const fs_1 = __webpack_require__(747);
  3449. const os_1 = __webpack_require__(87);
  3450. class Context {
  3451. /**
  3452. * Hydrate the context from the environment
  3453. */
  3454. constructor() {
  3455. this.payload = {};
  3456. if (process.env.GITHUB_EVENT_PATH) {
  3457. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3458. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3459. }
  3460. else {
  3461. const path = process.env.GITHUB_EVENT_PATH;
  3462. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3463. }
  3464. }
  3465. this.eventName = process.env.GITHUB_EVENT_NAME;
  3466. this.sha = process.env.GITHUB_SHA;
  3467. this.ref = process.env.GITHUB_REF;
  3468. this.workflow = process.env.GITHUB_WORKFLOW;
  3469. this.action = process.env.GITHUB_ACTION;
  3470. this.actor = process.env.GITHUB_ACTOR;
  3471. }
  3472. get issue() {
  3473. const payload = this.payload;
  3474. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3475. }
  3476. get repo() {
  3477. if (process.env.GITHUB_REPOSITORY) {
  3478. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3479. return { owner, repo };
  3480. }
  3481. if (this.payload.repository) {
  3482. return {
  3483. owner: this.payload.repository.owner.login,
  3484. repo: this.payload.repository.name
  3485. };
  3486. }
  3487. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3488. }
  3489. }
  3490. exports.Context = Context;
  3491. //# sourceMappingURL=context.js.map
  3492. /***/ }),
  3493. /***/ 265:
  3494. /***/ (function(module, __unusedexports, __webpack_require__) {
  3495. module.exports = getPage
  3496. const deprecate = __webpack_require__(370)
  3497. const getPageLinks = __webpack_require__(577)
  3498. const HttpError = __webpack_require__(297)
  3499. function getPage (octokit, link, which, headers) {
  3500. 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.`)
  3501. const url = getPageLinks(link)[which]
  3502. if (!url) {
  3503. const urlError = new HttpError(`No ${which} page found`, 404)
  3504. return Promise.reject(urlError)
  3505. }
  3506. const requestOptions = {
  3507. url,
  3508. headers: applyAcceptHeader(link, headers)
  3509. }
  3510. const promise = octokit.request(requestOptions)
  3511. return promise
  3512. }
  3513. function applyAcceptHeader (res, headers) {
  3514. const previous = res.headers && res.headers['x-github-media-type']
  3515. if (!previous || (headers && headers.accept)) {
  3516. return headers
  3517. }
  3518. headers = headers || {}
  3519. headers.accept = 'application/vnd.' + previous
  3520. .replace('; param=', '.')
  3521. .replace('; format=', '+')
  3522. return headers
  3523. }
  3524. /***/ }),
  3525. /***/ 280:
  3526. /***/ (function(module, exports) {
  3527. exports = module.exports = SemVer
  3528. var debug
  3529. /* istanbul ignore next */
  3530. if (typeof process === 'object' &&
  3531. process.env &&
  3532. process.env.NODE_DEBUG &&
  3533. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3534. debug = function () {
  3535. var args = Array.prototype.slice.call(arguments, 0)
  3536. args.unshift('SEMVER')
  3537. console.log.apply(console, args)
  3538. }
  3539. } else {
  3540. debug = function () {}
  3541. }
  3542. // Note: this is the semver.org version of the spec that it implements
  3543. // Not necessarily the package version of this code.
  3544. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3545. var MAX_LENGTH = 256
  3546. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3547. /* istanbul ignore next */ 9007199254740991
  3548. // Max safe segment length for coercion.
  3549. var MAX_SAFE_COMPONENT_LENGTH = 16
  3550. // The actual regexps go on exports.re
  3551. var re = exports.re = []
  3552. var src = exports.src = []
  3553. var R = 0
  3554. // The following Regular Expressions can be used for tokenizing,
  3555. // validating, and parsing SemVer version strings.
  3556. // ## Numeric Identifier
  3557. // A single `0`, or a non-zero digit followed by zero or more digits.
  3558. var NUMERICIDENTIFIER = R++
  3559. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3560. var NUMERICIDENTIFIERLOOSE = R++
  3561. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3562. // ## Non-numeric Identifier
  3563. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3564. // more letters, digits, or hyphens.
  3565. var NONNUMERICIDENTIFIER = R++
  3566. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3567. // ## Main Version
  3568. // Three dot-separated numeric identifiers.
  3569. var MAINVERSION = R++
  3570. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3571. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3572. '(' + src[NUMERICIDENTIFIER] + ')'
  3573. var MAINVERSIONLOOSE = R++
  3574. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3575. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3576. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3577. // ## Pre-release Version Identifier
  3578. // A numeric identifier, or a non-numeric identifier.
  3579. var PRERELEASEIDENTIFIER = R++
  3580. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3581. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3582. var PRERELEASEIDENTIFIERLOOSE = R++
  3583. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3584. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3585. // ## Pre-release Version
  3586. // Hyphen, followed by one or more dot-separated pre-release version
  3587. // identifiers.
  3588. var PRERELEASE = R++
  3589. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3590. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3591. var PRERELEASELOOSE = R++
  3592. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3593. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3594. // ## Build Metadata Identifier
  3595. // Any combination of digits, letters, or hyphens.
  3596. var BUILDIDENTIFIER = R++
  3597. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3598. // ## Build Metadata
  3599. // Plus sign, followed by one or more period-separated build metadata
  3600. // identifiers.
  3601. var BUILD = R++
  3602. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3603. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3604. // ## Full Version String
  3605. // A main version, followed optionally by a pre-release version and
  3606. // build metadata.
  3607. // Note that the only major, minor, patch, and pre-release sections of
  3608. // the version string are capturing groups. The build metadata is not a
  3609. // capturing group, because it should not ever be used in version
  3610. // comparison.
  3611. var FULL = R++
  3612. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3613. src[PRERELEASE] + '?' +
  3614. src[BUILD] + '?'
  3615. src[FULL] = '^' + FULLPLAIN + '$'
  3616. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3617. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3618. // common in the npm registry.
  3619. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3620. src[PRERELEASELOOSE] + '?' +
  3621. src[BUILD] + '?'
  3622. var LOOSE = R++
  3623. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3624. var GTLT = R++
  3625. src[GTLT] = '((?:<|>)?=?)'
  3626. // Something like "2.*" or "1.2.x".
  3627. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3628. // Only the first item is strictly required.
  3629. var XRANGEIDENTIFIERLOOSE = R++
  3630. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3631. var XRANGEIDENTIFIER = R++
  3632. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3633. var XRANGEPLAIN = R++
  3634. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3635. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3636. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3637. '(?:' + src[PRERELEASE] + ')?' +
  3638. src[BUILD] + '?' +
  3639. ')?)?'
  3640. var XRANGEPLAINLOOSE = R++
  3641. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3642. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3643. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3644. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3645. src[BUILD] + '?' +
  3646. ')?)?'
  3647. var XRANGE = R++
  3648. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3649. var XRANGELOOSE = R++
  3650. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3651. // Coercion.
  3652. // Extract anything that could conceivably be a part of a valid semver
  3653. var COERCE = R++
  3654. src[COERCE] = '(?:^|[^\\d])' +
  3655. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3656. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3657. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3658. '(?:$|[^\\d])'
  3659. // Tilde ranges.
  3660. // Meaning is "reasonably at or greater than"
  3661. var LONETILDE = R++
  3662. src[LONETILDE] = '(?:~>?)'
  3663. var TILDETRIM = R++
  3664. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3665. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3666. var tildeTrimReplace = '$1~'
  3667. var TILDE = R++
  3668. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3669. var TILDELOOSE = R++
  3670. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3671. // Caret ranges.
  3672. // Meaning is "at least and backwards compatible with"
  3673. var LONECARET = R++
  3674. src[LONECARET] = '(?:\\^)'
  3675. var CARETTRIM = R++
  3676. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3677. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3678. var caretTrimReplace = '$1^'
  3679. var CARET = R++
  3680. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3681. var CARETLOOSE = R++
  3682. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3683. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3684. var COMPARATORLOOSE = R++
  3685. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3686. var COMPARATOR = R++
  3687. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3688. // An expression to strip any whitespace between the gtlt and the thing
  3689. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3690. var COMPARATORTRIM = R++
  3691. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3692. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3693. // this one has to use the /g flag
  3694. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3695. var comparatorTrimReplace = '$1$2$3'
  3696. // Something like `1.2.3 - 1.2.4`
  3697. // Note that these all use the loose form, because they'll be
  3698. // checked against either the strict or loose comparator form
  3699. // later.
  3700. var HYPHENRANGE = R++
  3701. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3702. '\\s+-\\s+' +
  3703. '(' + src[XRANGEPLAIN] + ')' +
  3704. '\\s*$'
  3705. var HYPHENRANGELOOSE = R++
  3706. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3707. '\\s+-\\s+' +
  3708. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3709. '\\s*$'
  3710. // Star ranges basically just allow anything at all.
  3711. var STAR = R++
  3712. src[STAR] = '(<|>)?=?\\s*\\*'
  3713. // Compile to actual regexp objects.
  3714. // All are flag-free, unless they were created above with a flag.
  3715. for (var i = 0; i < R; i++) {
  3716. debug(i, src[i])
  3717. if (!re[i]) {
  3718. re[i] = new RegExp(src[i])
  3719. }
  3720. }
  3721. exports.parse = parse
  3722. function parse (version, options) {
  3723. if (!options || typeof options !== 'object') {
  3724. options = {
  3725. loose: !!options,
  3726. includePrerelease: false
  3727. }
  3728. }
  3729. if (version instanceof SemVer) {
  3730. return version
  3731. }
  3732. if (typeof version !== 'string') {
  3733. return null
  3734. }
  3735. if (version.length > MAX_LENGTH) {
  3736. return null
  3737. }
  3738. var r = options.loose ? re[LOOSE] : re[FULL]
  3739. if (!r.test(version)) {
  3740. return null
  3741. }
  3742. try {
  3743. return new SemVer(version, options)
  3744. } catch (er) {
  3745. return null
  3746. }
  3747. }
  3748. exports.valid = valid
  3749. function valid (version, options) {
  3750. var v = parse(version, options)
  3751. return v ? v.version : null
  3752. }
  3753. exports.clean = clean
  3754. function clean (version, options) {
  3755. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3756. return s ? s.version : null
  3757. }
  3758. exports.SemVer = SemVer
  3759. function SemVer (version, options) {
  3760. if (!options || typeof options !== 'object') {
  3761. options = {
  3762. loose: !!options,
  3763. includePrerelease: false
  3764. }
  3765. }
  3766. if (version instanceof SemVer) {
  3767. if (version.loose === options.loose) {
  3768. return version
  3769. } else {
  3770. version = version.version
  3771. }
  3772. } else if (typeof version !== 'string') {
  3773. throw new TypeError('Invalid Version: ' + version)
  3774. }
  3775. if (version.length > MAX_LENGTH) {
  3776. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3777. }
  3778. if (!(this instanceof SemVer)) {
  3779. return new SemVer(version, options)
  3780. }
  3781. debug('SemVer', version, options)
  3782. this.options = options
  3783. this.loose = !!options.loose
  3784. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3785. if (!m) {
  3786. throw new TypeError('Invalid Version: ' + version)
  3787. }
  3788. this.raw = version
  3789. // these are actually numbers
  3790. this.major = +m[1]
  3791. this.minor = +m[2]
  3792. this.patch = +m[3]
  3793. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3794. throw new TypeError('Invalid major version')
  3795. }
  3796. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3797. throw new TypeError('Invalid minor version')
  3798. }
  3799. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3800. throw new TypeError('Invalid patch version')
  3801. }
  3802. // numberify any prerelease numeric ids
  3803. if (!m[4]) {
  3804. this.prerelease = []
  3805. } else {
  3806. this.prerelease = m[4].split('.').map(function (id) {
  3807. if (/^[0-9]+$/.test(id)) {
  3808. var num = +id
  3809. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3810. return num
  3811. }
  3812. }
  3813. return id
  3814. })
  3815. }
  3816. this.build = m[5] ? m[5].split('.') : []
  3817. this.format()
  3818. }
  3819. SemVer.prototype.format = function () {
  3820. this.version = this.major + '.' + this.minor + '.' + this.patch
  3821. if (this.prerelease.length) {
  3822. this.version += '-' + this.prerelease.join('.')
  3823. }
  3824. return this.version
  3825. }
  3826. SemVer.prototype.toString = function () {
  3827. return this.version
  3828. }
  3829. SemVer.prototype.compare = function (other) {
  3830. debug('SemVer.compare', this.version, this.options, other)
  3831. if (!(other instanceof SemVer)) {
  3832. other = new SemVer(other, this.options)
  3833. }
  3834. return this.compareMain(other) || this.comparePre(other)
  3835. }
  3836. SemVer.prototype.compareMain = function (other) {
  3837. if (!(other instanceof SemVer)) {
  3838. other = new SemVer(other, this.options)
  3839. }
  3840. return compareIdentifiers(this.major, other.major) ||
  3841. compareIdentifiers(this.minor, other.minor) ||
  3842. compareIdentifiers(this.patch, other.patch)
  3843. }
  3844. SemVer.prototype.comparePre = function (other) {
  3845. if (!(other instanceof SemVer)) {
  3846. other = new SemVer(other, this.options)
  3847. }
  3848. // NOT having a prerelease is > having one
  3849. if (this.prerelease.length && !other.prerelease.length) {
  3850. return -1
  3851. } else if (!this.prerelease.length && other.prerelease.length) {
  3852. return 1
  3853. } else if (!this.prerelease.length && !other.prerelease.length) {
  3854. return 0
  3855. }
  3856. var i = 0
  3857. do {
  3858. var a = this.prerelease[i]
  3859. var b = other.prerelease[i]
  3860. debug('prerelease compare', i, a, b)
  3861. if (a === undefined && b === undefined) {
  3862. return 0
  3863. } else if (b === undefined) {
  3864. return 1
  3865. } else if (a === undefined) {
  3866. return -1
  3867. } else if (a === b) {
  3868. continue
  3869. } else {
  3870. return compareIdentifiers(a, b)
  3871. }
  3872. } while (++i)
  3873. }
  3874. // preminor will bump the version up to the next minor release, and immediately
  3875. // down to pre-release. premajor and prepatch work the same way.
  3876. SemVer.prototype.inc = function (release, identifier) {
  3877. switch (release) {
  3878. case 'premajor':
  3879. this.prerelease.length = 0
  3880. this.patch = 0
  3881. this.minor = 0
  3882. this.major++
  3883. this.inc('pre', identifier)
  3884. break
  3885. case 'preminor':
  3886. this.prerelease.length = 0
  3887. this.patch = 0
  3888. this.minor++
  3889. this.inc('pre', identifier)
  3890. break
  3891. case 'prepatch':
  3892. // If this is already a prerelease, it will bump to the next version
  3893. // drop any prereleases that might already exist, since they are not
  3894. // relevant at this point.
  3895. this.prerelease.length = 0
  3896. this.inc('patch', identifier)
  3897. this.inc('pre', identifier)
  3898. break
  3899. // If the input is a non-prerelease version, this acts the same as
  3900. // prepatch.
  3901. case 'prerelease':
  3902. if (this.prerelease.length === 0) {
  3903. this.inc('patch', identifier)
  3904. }
  3905. this.inc('pre', identifier)
  3906. break
  3907. case 'major':
  3908. // If this is a pre-major version, bump up to the same major version.
  3909. // Otherwise increment major.
  3910. // 1.0.0-5 bumps to 1.0.0
  3911. // 1.1.0 bumps to 2.0.0
  3912. if (this.minor !== 0 ||
  3913. this.patch !== 0 ||
  3914. this.prerelease.length === 0) {
  3915. this.major++
  3916. }
  3917. this.minor = 0
  3918. this.patch = 0
  3919. this.prerelease = []
  3920. break
  3921. case 'minor':
  3922. // If this is a pre-minor version, bump up to the same minor version.
  3923. // Otherwise increment minor.
  3924. // 1.2.0-5 bumps to 1.2.0
  3925. // 1.2.1 bumps to 1.3.0
  3926. if (this.patch !== 0 || this.prerelease.length === 0) {
  3927. this.minor++
  3928. }
  3929. this.patch = 0
  3930. this.prerelease = []
  3931. break
  3932. case 'patch':
  3933. // If this is not a pre-release version, it will increment the patch.
  3934. // If it is a pre-release it will bump up to the same patch version.
  3935. // 1.2.0-5 patches to 1.2.0
  3936. // 1.2.0 patches to 1.2.1
  3937. if (this.prerelease.length === 0) {
  3938. this.patch++
  3939. }
  3940. this.prerelease = []
  3941. break
  3942. // This probably shouldn't be used publicly.
  3943. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3944. case 'pre':
  3945. if (this.prerelease.length === 0) {
  3946. this.prerelease = [0]
  3947. } else {
  3948. var i = this.prerelease.length
  3949. while (--i >= 0) {
  3950. if (typeof this.prerelease[i] === 'number') {
  3951. this.prerelease[i]++
  3952. i = -2
  3953. }
  3954. }
  3955. if (i === -1) {
  3956. // didn't increment anything
  3957. this.prerelease.push(0)
  3958. }
  3959. }
  3960. if (identifier) {
  3961. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3962. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3963. if (this.prerelease[0] === identifier) {
  3964. if (isNaN(this.prerelease[1])) {
  3965. this.prerelease = [identifier, 0]
  3966. }
  3967. } else {
  3968. this.prerelease = [identifier, 0]
  3969. }
  3970. }
  3971. break
  3972. default:
  3973. throw new Error('invalid increment argument: ' + release)
  3974. }
  3975. this.format()
  3976. this.raw = this.version
  3977. return this
  3978. }
  3979. exports.inc = inc
  3980. function inc (version, release, loose, identifier) {
  3981. if (typeof (loose) === 'string') {
  3982. identifier = loose
  3983. loose = undefined
  3984. }
  3985. try {
  3986. return new SemVer(version, loose).inc(release, identifier).version
  3987. } catch (er) {
  3988. return null
  3989. }
  3990. }
  3991. exports.diff = diff
  3992. function diff (version1, version2) {
  3993. if (eq(version1, version2)) {
  3994. return null
  3995. } else {
  3996. var v1 = parse(version1)
  3997. var v2 = parse(version2)
  3998. var prefix = ''
  3999. if (v1.prerelease.length || v2.prerelease.length) {
  4000. prefix = 'pre'
  4001. var defaultResult = 'prerelease'
  4002. }
  4003. for (var key in v1) {
  4004. if (key === 'major' || key === 'minor' || key === 'patch') {
  4005. if (v1[key] !== v2[key]) {
  4006. return prefix + key
  4007. }
  4008. }
  4009. }
  4010. return defaultResult // may be undefined
  4011. }
  4012. }
  4013. exports.compareIdentifiers = compareIdentifiers
  4014. var numeric = /^[0-9]+$/
  4015. function compareIdentifiers (a, b) {
  4016. var anum = numeric.test(a)
  4017. var bnum = numeric.test(b)
  4018. if (anum && bnum) {
  4019. a = +a
  4020. b = +b
  4021. }
  4022. return a === b ? 0
  4023. : (anum && !bnum) ? -1
  4024. : (bnum && !anum) ? 1
  4025. : a < b ? -1
  4026. : 1
  4027. }
  4028. exports.rcompareIdentifiers = rcompareIdentifiers
  4029. function rcompareIdentifiers (a, b) {
  4030. return compareIdentifiers(b, a)
  4031. }
  4032. exports.major = major
  4033. function major (a, loose) {
  4034. return new SemVer(a, loose).major
  4035. }
  4036. exports.minor = minor
  4037. function minor (a, loose) {
  4038. return new SemVer(a, loose).minor
  4039. }
  4040. exports.patch = patch
  4041. function patch (a, loose) {
  4042. return new SemVer(a, loose).patch
  4043. }
  4044. exports.compare = compare
  4045. function compare (a, b, loose) {
  4046. return new SemVer(a, loose).compare(new SemVer(b, loose))
  4047. }
  4048. exports.compareLoose = compareLoose
  4049. function compareLoose (a, b) {
  4050. return compare(a, b, true)
  4051. }
  4052. exports.rcompare = rcompare
  4053. function rcompare (a, b, loose) {
  4054. return compare(b, a, loose)
  4055. }
  4056. exports.sort = sort
  4057. function sort (list, loose) {
  4058. return list.sort(function (a, b) {
  4059. return exports.compare(a, b, loose)
  4060. })
  4061. }
  4062. exports.rsort = rsort
  4063. function rsort (list, loose) {
  4064. return list.sort(function (a, b) {
  4065. return exports.rcompare(a, b, loose)
  4066. })
  4067. }
  4068. exports.gt = gt
  4069. function gt (a, b, loose) {
  4070. return compare(a, b, loose) > 0
  4071. }
  4072. exports.lt = lt
  4073. function lt (a, b, loose) {
  4074. return compare(a, b, loose) < 0
  4075. }
  4076. exports.eq = eq
  4077. function eq (a, b, loose) {
  4078. return compare(a, b, loose) === 0
  4079. }
  4080. exports.neq = neq
  4081. function neq (a, b, loose) {
  4082. return compare(a, b, loose) !== 0
  4083. }
  4084. exports.gte = gte
  4085. function gte (a, b, loose) {
  4086. return compare(a, b, loose) >= 0
  4087. }
  4088. exports.lte = lte
  4089. function lte (a, b, loose) {
  4090. return compare(a, b, loose) <= 0
  4091. }
  4092. exports.cmp = cmp
  4093. function cmp (a, op, b, loose) {
  4094. switch (op) {
  4095. case '===':
  4096. if (typeof a === 'object')
  4097. a = a.version
  4098. if (typeof b === 'object')
  4099. b = b.version
  4100. return a === b
  4101. case '!==':
  4102. if (typeof a === 'object')
  4103. a = a.version
  4104. if (typeof b === 'object')
  4105. b = b.version
  4106. return a !== b
  4107. case '':
  4108. case '=':
  4109. case '==':
  4110. return eq(a, b, loose)
  4111. case '!=':
  4112. return neq(a, b, loose)
  4113. case '>':
  4114. return gt(a, b, loose)
  4115. case '>=':
  4116. return gte(a, b, loose)
  4117. case '<':
  4118. return lt(a, b, loose)
  4119. case '<=':
  4120. return lte(a, b, loose)
  4121. default:
  4122. throw new TypeError('Invalid operator: ' + op)
  4123. }
  4124. }
  4125. exports.Comparator = Comparator
  4126. function Comparator (comp, options) {
  4127. if (!options || typeof options !== 'object') {
  4128. options = {
  4129. loose: !!options,
  4130. includePrerelease: false
  4131. }
  4132. }
  4133. if (comp instanceof Comparator) {
  4134. if (comp.loose === !!options.loose) {
  4135. return comp
  4136. } else {
  4137. comp = comp.value
  4138. }
  4139. }
  4140. if (!(this instanceof Comparator)) {
  4141. return new Comparator(comp, options)
  4142. }
  4143. debug('comparator', comp, options)
  4144. this.options = options
  4145. this.loose = !!options.loose
  4146. this.parse(comp)
  4147. if (this.semver === ANY) {
  4148. this.value = ''
  4149. } else {
  4150. this.value = this.operator + this.semver.version
  4151. }
  4152. debug('comp', this)
  4153. }
  4154. var ANY = {}
  4155. Comparator.prototype.parse = function (comp) {
  4156. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4157. var m = comp.match(r)
  4158. if (!m) {
  4159. throw new TypeError('Invalid comparator: ' + comp)
  4160. }
  4161. this.operator = m[1]
  4162. if (this.operator === '=') {
  4163. this.operator = ''
  4164. }
  4165. // if it literally is just '>' or '' then allow anything.
  4166. if (!m[2]) {
  4167. this.semver = ANY
  4168. } else {
  4169. this.semver = new SemVer(m[2], this.options.loose)
  4170. }
  4171. }
  4172. Comparator.prototype.toString = function () {
  4173. return this.value
  4174. }
  4175. Comparator.prototype.test = function (version) {
  4176. debug('Comparator.test', version, this.options.loose)
  4177. if (this.semver === ANY) {
  4178. return true
  4179. }
  4180. if (typeof version === 'string') {
  4181. version = new SemVer(version, this.options)
  4182. }
  4183. return cmp(version, this.operator, this.semver, this.options)
  4184. }
  4185. Comparator.prototype.intersects = function (comp, options) {
  4186. if (!(comp instanceof Comparator)) {
  4187. throw new TypeError('a Comparator is required')
  4188. }
  4189. if (!options || typeof options !== 'object') {
  4190. options = {
  4191. loose: !!options,
  4192. includePrerelease: false
  4193. }
  4194. }
  4195. var rangeTmp
  4196. if (this.operator === '') {
  4197. rangeTmp = new Range(comp.value, options)
  4198. return satisfies(this.value, rangeTmp, options)
  4199. } else if (comp.operator === '') {
  4200. rangeTmp = new Range(this.value, options)
  4201. return satisfies(comp.semver, rangeTmp, options)
  4202. }
  4203. var sameDirectionIncreasing =
  4204. (this.operator === '>=' || this.operator === '>') &&
  4205. (comp.operator === '>=' || comp.operator === '>')
  4206. var sameDirectionDecreasing =
  4207. (this.operator === '<=' || this.operator === '<') &&
  4208. (comp.operator === '<=' || comp.operator === '<')
  4209. var sameSemVer = this.semver.version === comp.semver.version
  4210. var differentDirectionsInclusive =
  4211. (this.operator === '>=' || this.operator === '<=') &&
  4212. (comp.operator === '>=' || comp.operator === '<=')
  4213. var oppositeDirectionsLessThan =
  4214. cmp(this.semver, '<', comp.semver, options) &&
  4215. ((this.operator === '>=' || this.operator === '>') &&
  4216. (comp.operator === '<=' || comp.operator === '<'))
  4217. var oppositeDirectionsGreaterThan =
  4218. cmp(this.semver, '>', comp.semver, options) &&
  4219. ((this.operator === '<=' || this.operator === '<') &&
  4220. (comp.operator === '>=' || comp.operator === '>'))
  4221. return sameDirectionIncreasing || sameDirectionDecreasing ||
  4222. (sameSemVer && differentDirectionsInclusive) ||
  4223. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  4224. }
  4225. exports.Range = Range
  4226. function Range (range, options) {
  4227. if (!options || typeof options !== 'object') {
  4228. options = {
  4229. loose: !!options,
  4230. includePrerelease: false
  4231. }
  4232. }
  4233. if (range instanceof Range) {
  4234. if (range.loose === !!options.loose &&
  4235. range.includePrerelease === !!options.includePrerelease) {
  4236. return range
  4237. } else {
  4238. return new Range(range.raw, options)
  4239. }
  4240. }
  4241. if (range instanceof Comparator) {
  4242. return new Range(range.value, options)
  4243. }
  4244. if (!(this instanceof Range)) {
  4245. return new Range(range, options)
  4246. }
  4247. this.options = options
  4248. this.loose = !!options.loose
  4249. this.includePrerelease = !!options.includePrerelease
  4250. // First, split based on boolean or ||
  4251. this.raw = range
  4252. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  4253. return this.parseRange(range.trim())
  4254. }, this).filter(function (c) {
  4255. // throw out any that are not relevant for whatever reason
  4256. return c.length
  4257. })
  4258. if (!this.set.length) {
  4259. throw new TypeError('Invalid SemVer Range: ' + range)
  4260. }
  4261. this.format()
  4262. }
  4263. Range.prototype.format = function () {
  4264. this.range = this.set.map(function (comps) {
  4265. return comps.join(' ').trim()
  4266. }).join('||').trim()
  4267. return this.range
  4268. }
  4269. Range.prototype.toString = function () {
  4270. return this.range
  4271. }
  4272. Range.prototype.parseRange = function (range) {
  4273. var loose = this.options.loose
  4274. range = range.trim()
  4275. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  4276. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  4277. range = range.replace(hr, hyphenReplace)
  4278. debug('hyphen replace', range)
  4279. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  4280. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  4281. debug('comparator trim', range, re[COMPARATORTRIM])
  4282. // `~ 1.2.3` => `~1.2.3`
  4283. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  4284. // `^ 1.2.3` => `^1.2.3`
  4285. range = range.replace(re[CARETTRIM], caretTrimReplace)
  4286. // normalize spaces
  4287. range = range.split(/\s+/).join(' ')
  4288. // At this point, the range is completely trimmed and
  4289. // ready to be split into comparators.
  4290. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  4291. var set = range.split(' ').map(function (comp) {
  4292. return parseComparator(comp, this.options)
  4293. }, this).join(' ').split(/\s+/)
  4294. if (this.options.loose) {
  4295. // in loose mode, throw out any that are not valid comparators
  4296. set = set.filter(function (comp) {
  4297. return !!comp.match(compRe)
  4298. })
  4299. }
  4300. set = set.map(function (comp) {
  4301. return new Comparator(comp, this.options)
  4302. }, this)
  4303. return set
  4304. }
  4305. Range.prototype.intersects = function (range, options) {
  4306. if (!(range instanceof Range)) {
  4307. throw new TypeError('a Range is required')
  4308. }
  4309. return this.set.some(function (thisComparators) {
  4310. return thisComparators.every(function (thisComparator) {
  4311. return range.set.some(function (rangeComparators) {
  4312. return rangeComparators.every(function (rangeComparator) {
  4313. return thisComparator.intersects(rangeComparator, options)
  4314. })
  4315. })
  4316. })
  4317. })
  4318. }
  4319. // Mostly just for testing and legacy API reasons
  4320. exports.toComparators = toComparators
  4321. function toComparators (range, options) {
  4322. return new Range(range, options).set.map(function (comp) {
  4323. return comp.map(function (c) {
  4324. return c.value
  4325. }).join(' ').trim().split(' ')
  4326. })
  4327. }
  4328. // comprised of xranges, tildes, stars, and gtlt's at this point.
  4329. // already replaced the hyphen ranges
  4330. // turn into a set of JUST comparators.
  4331. function parseComparator (comp, options) {
  4332. debug('comp', comp, options)
  4333. comp = replaceCarets(comp, options)
  4334. debug('caret', comp)
  4335. comp = replaceTildes(comp, options)
  4336. debug('tildes', comp)
  4337. comp = replaceXRanges(comp, options)
  4338. debug('xrange', comp)
  4339. comp = replaceStars(comp, options)
  4340. debug('stars', comp)
  4341. return comp
  4342. }
  4343. function isX (id) {
  4344. return !id || id.toLowerCase() === 'x' || id === '*'
  4345. }
  4346. // ~, ~> --> * (any, kinda silly)
  4347. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4348. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4349. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4350. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4351. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4352. function replaceTildes (comp, options) {
  4353. return comp.trim().split(/\s+/).map(function (comp) {
  4354. return replaceTilde(comp, options)
  4355. }).join(' ')
  4356. }
  4357. function replaceTilde (comp, options) {
  4358. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4359. return comp.replace(r, function (_, M, m, p, pr) {
  4360. debug('tilde', comp, _, M, m, p, pr)
  4361. var ret
  4362. if (isX(M)) {
  4363. ret = ''
  4364. } else if (isX(m)) {
  4365. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4366. } else if (isX(p)) {
  4367. // ~1.2 == >=1.2.0 <1.3.0
  4368. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4369. } else if (pr) {
  4370. debug('replaceTilde pr', pr)
  4371. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4372. ' <' + M + '.' + (+m + 1) + '.0'
  4373. } else {
  4374. // ~1.2.3 == >=1.2.3 <1.3.0
  4375. ret = '>=' + M + '.' + m + '.' + p +
  4376. ' <' + M + '.' + (+m + 1) + '.0'
  4377. }
  4378. debug('tilde return', ret)
  4379. return ret
  4380. })
  4381. }
  4382. // ^ --> * (any, kinda silly)
  4383. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4384. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4385. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4386. // ^1.2.3 --> >=1.2.3 <2.0.0
  4387. // ^1.2.0 --> >=1.2.0 <2.0.0
  4388. function replaceCarets (comp, options) {
  4389. return comp.trim().split(/\s+/).map(function (comp) {
  4390. return replaceCaret(comp, options)
  4391. }).join(' ')
  4392. }
  4393. function replaceCaret (comp, options) {
  4394. debug('caret', comp, options)
  4395. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4396. return comp.replace(r, function (_, M, m, p, pr) {
  4397. debug('caret', comp, _, M, m, p, pr)
  4398. var ret
  4399. if (isX(M)) {
  4400. ret = ''
  4401. } else if (isX(m)) {
  4402. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4403. } else if (isX(p)) {
  4404. if (M === '0') {
  4405. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4406. } else {
  4407. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4408. }
  4409. } else if (pr) {
  4410. debug('replaceCaret pr', pr)
  4411. if (M === '0') {
  4412. if (m === '0') {
  4413. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4414. ' <' + M + '.' + m + '.' + (+p + 1)
  4415. } else {
  4416. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4417. ' <' + M + '.' + (+m + 1) + '.0'
  4418. }
  4419. } else {
  4420. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4421. ' <' + (+M + 1) + '.0.0'
  4422. }
  4423. } else {
  4424. debug('no pr')
  4425. if (M === '0') {
  4426. if (m === '0') {
  4427. ret = '>=' + M + '.' + m + '.' + p +
  4428. ' <' + M + '.' + m + '.' + (+p + 1)
  4429. } else {
  4430. ret = '>=' + M + '.' + m + '.' + p +
  4431. ' <' + M + '.' + (+m + 1) + '.0'
  4432. }
  4433. } else {
  4434. ret = '>=' + M + '.' + m + '.' + p +
  4435. ' <' + (+M + 1) + '.0.0'
  4436. }
  4437. }
  4438. debug('caret return', ret)
  4439. return ret
  4440. })
  4441. }
  4442. function replaceXRanges (comp, options) {
  4443. debug('replaceXRanges', comp, options)
  4444. return comp.split(/\s+/).map(function (comp) {
  4445. return replaceXRange(comp, options)
  4446. }).join(' ')
  4447. }
  4448. function replaceXRange (comp, options) {
  4449. comp = comp.trim()
  4450. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4451. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4452. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4453. var xM = isX(M)
  4454. var xm = xM || isX(m)
  4455. var xp = xm || isX(p)
  4456. var anyX = xp
  4457. if (gtlt === '=' && anyX) {
  4458. gtlt = ''
  4459. }
  4460. if (xM) {
  4461. if (gtlt === '>' || gtlt === '<') {
  4462. // nothing is allowed
  4463. ret = '<0.0.0'
  4464. } else {
  4465. // nothing is forbidden
  4466. ret = '*'
  4467. }
  4468. } else if (gtlt && anyX) {
  4469. // we know patch is an x, because we have any x at all.
  4470. // replace X with 0
  4471. if (xm) {
  4472. m = 0
  4473. }
  4474. p = 0
  4475. if (gtlt === '>') {
  4476. // >1 => >=2.0.0
  4477. // >1.2 => >=1.3.0
  4478. // >1.2.3 => >= 1.2.4
  4479. gtlt = '>='
  4480. if (xm) {
  4481. M = +M + 1
  4482. m = 0
  4483. p = 0
  4484. } else {
  4485. m = +m + 1
  4486. p = 0
  4487. }
  4488. } else if (gtlt === '<=') {
  4489. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4490. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4491. gtlt = '<'
  4492. if (xm) {
  4493. M = +M + 1
  4494. } else {
  4495. m = +m + 1
  4496. }
  4497. }
  4498. ret = gtlt + M + '.' + m + '.' + p
  4499. } else if (xm) {
  4500. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4501. } else if (xp) {
  4502. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4503. }
  4504. debug('xRange return', ret)
  4505. return ret
  4506. })
  4507. }
  4508. // Because * is AND-ed with everything else in the comparator,
  4509. // and '' means "any version", just remove the *s entirely.
  4510. function replaceStars (comp, options) {
  4511. debug('replaceStars', comp, options)
  4512. // Looseness is ignored here. star is always as loose as it gets!
  4513. return comp.trim().replace(re[STAR], '')
  4514. }
  4515. // This function is passed to string.replace(re[HYPHENRANGE])
  4516. // M, m, patch, prerelease, build
  4517. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4518. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4519. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4520. function hyphenReplace ($0,
  4521. from, fM, fm, fp, fpr, fb,
  4522. to, tM, tm, tp, tpr, tb) {
  4523. if (isX(fM)) {
  4524. from = ''
  4525. } else if (isX(fm)) {
  4526. from = '>=' + fM + '.0.0'
  4527. } else if (isX(fp)) {
  4528. from = '>=' + fM + '.' + fm + '.0'
  4529. } else {
  4530. from = '>=' + from
  4531. }
  4532. if (isX(tM)) {
  4533. to = ''
  4534. } else if (isX(tm)) {
  4535. to = '<' + (+tM + 1) + '.0.0'
  4536. } else if (isX(tp)) {
  4537. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4538. } else if (tpr) {
  4539. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4540. } else {
  4541. to = '<=' + to
  4542. }
  4543. return (from + ' ' + to).trim()
  4544. }
  4545. // if ANY of the sets match ALL of its comparators, then pass
  4546. Range.prototype.test = function (version) {
  4547. if (!version) {
  4548. return false
  4549. }
  4550. if (typeof version === 'string') {
  4551. version = new SemVer(version, this.options)
  4552. }
  4553. for (var i = 0; i < this.set.length; i++) {
  4554. if (testSet(this.set[i], version, this.options)) {
  4555. return true
  4556. }
  4557. }
  4558. return false
  4559. }
  4560. function testSet (set, version, options) {
  4561. for (var i = 0; i < set.length; i++) {
  4562. if (!set[i].test(version)) {
  4563. return false
  4564. }
  4565. }
  4566. if (version.prerelease.length && !options.includePrerelease) {
  4567. // Find the set of versions that are allowed to have prereleases
  4568. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4569. // That should allow `1.2.3-pr.2` to pass.
  4570. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4571. // even though it's within the range set by the comparators.
  4572. for (i = 0; i < set.length; i++) {
  4573. debug(set[i].semver)
  4574. if (set[i].semver === ANY) {
  4575. continue
  4576. }
  4577. if (set[i].semver.prerelease.length > 0) {
  4578. var allowed = set[i].semver
  4579. if (allowed.major === version.major &&
  4580. allowed.minor === version.minor &&
  4581. allowed.patch === version.patch) {
  4582. return true
  4583. }
  4584. }
  4585. }
  4586. // Version has a -pre, but it's not one of the ones we like.
  4587. return false
  4588. }
  4589. return true
  4590. }
  4591. exports.satisfies = satisfies
  4592. function satisfies (version, range, options) {
  4593. try {
  4594. range = new Range(range, options)
  4595. } catch (er) {
  4596. return false
  4597. }
  4598. return range.test(version)
  4599. }
  4600. exports.maxSatisfying = maxSatisfying
  4601. function maxSatisfying (versions, range, options) {
  4602. var max = null
  4603. var maxSV = null
  4604. try {
  4605. var rangeObj = new Range(range, options)
  4606. } catch (er) {
  4607. return null
  4608. }
  4609. versions.forEach(function (v) {
  4610. if (rangeObj.test(v)) {
  4611. // satisfies(v, range, options)
  4612. if (!max || maxSV.compare(v) === -1) {
  4613. // compare(max, v, true)
  4614. max = v
  4615. maxSV = new SemVer(max, options)
  4616. }
  4617. }
  4618. })
  4619. return max
  4620. }
  4621. exports.minSatisfying = minSatisfying
  4622. function minSatisfying (versions, range, options) {
  4623. var min = null
  4624. var minSV = null
  4625. try {
  4626. var rangeObj = new Range(range, options)
  4627. } catch (er) {
  4628. return null
  4629. }
  4630. versions.forEach(function (v) {
  4631. if (rangeObj.test(v)) {
  4632. // satisfies(v, range, options)
  4633. if (!min || minSV.compare(v) === 1) {
  4634. // compare(min, v, true)
  4635. min = v
  4636. minSV = new SemVer(min, options)
  4637. }
  4638. }
  4639. })
  4640. return min
  4641. }
  4642. exports.minVersion = minVersion
  4643. function minVersion (range, loose) {
  4644. range = new Range(range, loose)
  4645. var minver = new SemVer('0.0.0')
  4646. if (range.test(minver)) {
  4647. return minver
  4648. }
  4649. minver = new SemVer('0.0.0-0')
  4650. if (range.test(minver)) {
  4651. return minver
  4652. }
  4653. minver = null
  4654. for (var i = 0; i < range.set.length; ++i) {
  4655. var comparators = range.set[i]
  4656. comparators.forEach(function (comparator) {
  4657. // Clone to avoid manipulating the comparator's semver object.
  4658. var compver = new SemVer(comparator.semver.version)
  4659. switch (comparator.operator) {
  4660. case '>':
  4661. if (compver.prerelease.length === 0) {
  4662. compver.patch++
  4663. } else {
  4664. compver.prerelease.push(0)
  4665. }
  4666. compver.raw = compver.format()
  4667. /* fallthrough */
  4668. case '':
  4669. case '>=':
  4670. if (!minver || gt(minver, compver)) {
  4671. minver = compver
  4672. }
  4673. break
  4674. case '<':
  4675. case '<=':
  4676. /* Ignore maximum versions */
  4677. break
  4678. /* istanbul ignore next */
  4679. default:
  4680. throw new Error('Unexpected operation: ' + comparator.operator)
  4681. }
  4682. })
  4683. }
  4684. if (minver && range.test(minver)) {
  4685. return minver
  4686. }
  4687. return null
  4688. }
  4689. exports.validRange = validRange
  4690. function validRange (range, options) {
  4691. try {
  4692. // Return '*' instead of '' so that truthiness works.
  4693. // This will throw if it's invalid anyway
  4694. return new Range(range, options).range || '*'
  4695. } catch (er) {
  4696. return null
  4697. }
  4698. }
  4699. // Determine if version is less than all the versions possible in the range
  4700. exports.ltr = ltr
  4701. function ltr (version, range, options) {
  4702. return outside(version, range, '<', options)
  4703. }
  4704. // Determine if version is greater than all the versions possible in the range.
  4705. exports.gtr = gtr
  4706. function gtr (version, range, options) {
  4707. return outside(version, range, '>', options)
  4708. }
  4709. exports.outside = outside
  4710. function outside (version, range, hilo, options) {
  4711. version = new SemVer(version, options)
  4712. range = new Range(range, options)
  4713. var gtfn, ltefn, ltfn, comp, ecomp
  4714. switch (hilo) {
  4715. case '>':
  4716. gtfn = gt
  4717. ltefn = lte
  4718. ltfn = lt
  4719. comp = '>'
  4720. ecomp = '>='
  4721. break
  4722. case '<':
  4723. gtfn = lt
  4724. ltefn = gte
  4725. ltfn = gt
  4726. comp = '<'
  4727. ecomp = '<='
  4728. break
  4729. default:
  4730. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4731. }
  4732. // If it satisifes the range it is not outside
  4733. if (satisfies(version, range, options)) {
  4734. return false
  4735. }
  4736. // From now on, variable terms are as if we're in "gtr" mode.
  4737. // but note that everything is flipped for the "ltr" function.
  4738. for (var i = 0; i < range.set.length; ++i) {
  4739. var comparators = range.set[i]
  4740. var high = null
  4741. var low = null
  4742. comparators.forEach(function (comparator) {
  4743. if (comparator.semver === ANY) {
  4744. comparator = new Comparator('>=0.0.0')
  4745. }
  4746. high = high || comparator
  4747. low = low || comparator
  4748. if (gtfn(comparator.semver, high.semver, options)) {
  4749. high = comparator
  4750. } else if (ltfn(comparator.semver, low.semver, options)) {
  4751. low = comparator
  4752. }
  4753. })
  4754. // If the edge version comparator has a operator then our version
  4755. // isn't outside it
  4756. if (high.operator === comp || high.operator === ecomp) {
  4757. return false
  4758. }
  4759. // If the lowest version comparator has an operator and our version
  4760. // is less than it then it isn't higher than the range
  4761. if ((!low.operator || low.operator === comp) &&
  4762. ltefn(version, low.semver)) {
  4763. return false
  4764. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4765. return false
  4766. }
  4767. }
  4768. return true
  4769. }
  4770. exports.prerelease = prerelease
  4771. function prerelease (version, options) {
  4772. var parsed = parse(version, options)
  4773. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4774. }
  4775. exports.intersects = intersects
  4776. function intersects (r1, r2, options) {
  4777. r1 = new Range(r1, options)
  4778. r2 = new Range(r2, options)
  4779. return r1.intersects(r2)
  4780. }
  4781. exports.coerce = coerce
  4782. function coerce (version) {
  4783. if (version instanceof SemVer) {
  4784. return version
  4785. }
  4786. if (typeof version !== 'string') {
  4787. return null
  4788. }
  4789. var match = version.match(re[COERCE])
  4790. if (match == null) {
  4791. return null
  4792. }
  4793. return parse(match[1] +
  4794. '.' + (match[2] || '0') +
  4795. '.' + (match[3] || '0'))
  4796. }
  4797. /***/ }),
  4798. /***/ 287:
  4799. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4800. "use strict";
  4801. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  4802. if (k2 === undefined) k2 = k;
  4803. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  4804. }) : (function(o, m, k, k2) {
  4805. if (k2 === undefined) k2 = k;
  4806. o[k2] = m[k];
  4807. }));
  4808. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  4809. Object.defineProperty(o, "default", { enumerable: true, value: v });
  4810. }) : function(o, v) {
  4811. o["default"] = v;
  4812. });
  4813. var __importStar = (this && this.__importStar) || function (mod) {
  4814. if (mod && mod.__esModule) return mod;
  4815. var result = {};
  4816. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  4817. __setModuleDefault(result, mod);
  4818. return result;
  4819. };
  4820. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4821. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4822. return new (P || (P = Promise))(function (resolve, reject) {
  4823. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4824. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4825. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4826. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4827. });
  4828. };
  4829. var __importDefault = (this && this.__importDefault) || function (mod) {
  4830. return (mod && mod.__esModule) ? mod : { "default": mod };
  4831. };
  4832. Object.defineProperty(exports, "__esModule", { value: true });
  4833. exports.createAuthHelper = void 0;
  4834. const assert = __importStar(__webpack_require__(357));
  4835. const core = __importStar(__webpack_require__(470));
  4836. const exec = __importStar(__webpack_require__(986));
  4837. const fs = __importStar(__webpack_require__(747));
  4838. const io = __importStar(__webpack_require__(1));
  4839. const os = __importStar(__webpack_require__(87));
  4840. const path = __importStar(__webpack_require__(622));
  4841. const regexpHelper = __importStar(__webpack_require__(528));
  4842. const stateHelper = __importStar(__webpack_require__(153));
  4843. const urlHelper = __importStar(__webpack_require__(81));
  4844. const v4_1 = __importDefault(__webpack_require__(826));
  4845. const IS_WINDOWS = process.platform === 'win32';
  4846. const SSH_COMMAND_KEY = 'core.sshCommand';
  4847. function createAuthHelper(git, settings) {
  4848. return new GitAuthHelper(git, settings);
  4849. }
  4850. exports.createAuthHelper = createAuthHelper;
  4851. class GitAuthHelper {
  4852. constructor(gitCommandManager, gitSourceSettings) {
  4853. this.sshCommand = '';
  4854. this.sshKeyPath = '';
  4855. this.sshKnownHostsPath = '';
  4856. this.temporaryHomePath = '';
  4857. this.git = gitCommandManager;
  4858. this.settings = gitSourceSettings || {};
  4859. // Token auth header
  4860. const serverUrl = urlHelper.getServerUrl();
  4861. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4862. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4863. core.setSecret(basicCredential);
  4864. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4865. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4866. // Instead of SSH URL
  4867. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4868. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4869. }
  4870. configureAuth() {
  4871. return __awaiter(this, void 0, void 0, function* () {
  4872. // Remove possible previous values
  4873. yield this.removeAuth();
  4874. // Configure new values
  4875. yield this.configureSsh();
  4876. yield this.configureToken();
  4877. });
  4878. }
  4879. configureGlobalAuth() {
  4880. var _a;
  4881. return __awaiter(this, void 0, void 0, function* () {
  4882. // Create a temp home directory
  4883. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4884. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4885. const uniqueId = (0, v4_1.default)();
  4886. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4887. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4888. // Copy the global git config
  4889. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4890. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4891. let configExists = false;
  4892. try {
  4893. yield fs.promises.stat(gitConfigPath);
  4894. configExists = true;
  4895. }
  4896. catch (err) {
  4897. if (((_a = err) === null || _a === void 0 ? void 0 : _a.code) !== 'ENOENT') {
  4898. throw err;
  4899. }
  4900. }
  4901. if (configExists) {
  4902. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4903. yield io.cp(gitConfigPath, newGitConfigPath);
  4904. }
  4905. else {
  4906. yield fs.promises.writeFile(newGitConfigPath, '');
  4907. }
  4908. try {
  4909. // Override HOME
  4910. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4911. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4912. // Configure the token
  4913. yield this.configureToken(newGitConfigPath, true);
  4914. // Configure HTTPS instead of SSH
  4915. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4916. if (!this.settings.sshKey) {
  4917. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4918. }
  4919. }
  4920. catch (err) {
  4921. // Unset in case somehow written to the real global config
  4922. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4923. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4924. throw err;
  4925. }
  4926. });
  4927. }
  4928. configureSubmoduleAuth() {
  4929. return __awaiter(this, void 0, void 0, function* () {
  4930. // Remove possible previous HTTPS instead of SSH
  4931. yield this.removeGitConfig(this.insteadOfKey, true);
  4932. if (this.settings.persistCredentials) {
  4933. // Configure a placeholder value. This approach avoids the credential being captured
  4934. // by process creation audit events, which are commonly logged. For more information,
  4935. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4936. 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);
  4937. // Replace the placeholder
  4938. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4939. for (const configPath of configPaths) {
  4940. core.debug(`Replacing token placeholder in '${configPath}'`);
  4941. yield this.replaceTokenPlaceholder(configPath);
  4942. }
  4943. if (this.settings.sshKey) {
  4944. // Configure core.sshCommand
  4945. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4946. }
  4947. else {
  4948. // Configure HTTPS instead of SSH
  4949. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4950. }
  4951. }
  4952. });
  4953. }
  4954. removeAuth() {
  4955. return __awaiter(this, void 0, void 0, function* () {
  4956. yield this.removeSsh();
  4957. yield this.removeToken();
  4958. });
  4959. }
  4960. removeGlobalAuth() {
  4961. return __awaiter(this, void 0, void 0, function* () {
  4962. core.debug(`Unsetting HOME override`);
  4963. this.git.removeEnvironmentVariable('HOME');
  4964. yield io.rmRF(this.temporaryHomePath);
  4965. });
  4966. }
  4967. configureSsh() {
  4968. var _a;
  4969. return __awaiter(this, void 0, void 0, function* () {
  4970. if (!this.settings.sshKey) {
  4971. return;
  4972. }
  4973. // Write key
  4974. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4975. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4976. const uniqueId = (0, v4_1.default)();
  4977. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4978. stateHelper.setSshKeyPath(this.sshKeyPath);
  4979. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4980. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4981. // Remove inherited permissions on Windows
  4982. if (IS_WINDOWS) {
  4983. const icacls = yield io.which('icacls.exe');
  4984. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4985. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4986. }
  4987. // Write known hosts
  4988. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4989. let userKnownHosts = '';
  4990. try {
  4991. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4992. }
  4993. catch (err) {
  4994. if (((_a = err) === null || _a === void 0 ? void 0 : _a.code) !== 'ENOENT') {
  4995. throw err;
  4996. }
  4997. }
  4998. let knownHosts = '';
  4999. if (userKnownHosts) {
  5000. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  5001. }
  5002. if (this.settings.sshKnownHosts) {
  5003. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  5004. }
  5005. 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`;
  5006. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  5007. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  5008. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  5009. // Configure GIT_SSH_COMMAND
  5010. const sshPath = yield io.which('ssh', true);
  5011. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  5012. if (this.settings.sshStrict) {
  5013. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  5014. }
  5015. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  5016. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  5017. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  5018. // Configure core.sshCommand
  5019. if (this.settings.persistCredentials) {
  5020. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  5021. }
  5022. });
  5023. }
  5024. configureToken(configPath, globalConfig) {
  5025. return __awaiter(this, void 0, void 0, function* () {
  5026. // Validate args
  5027. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  5028. // Default config path
  5029. if (!configPath && !globalConfig) {
  5030. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  5031. }
  5032. // Configure a placeholder value. This approach avoids the credential being captured
  5033. // by process creation audit events, which are commonly logged. For more information,
  5034. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  5035. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  5036. // Replace the placeholder
  5037. yield this.replaceTokenPlaceholder(configPath || '');
  5038. });
  5039. }
  5040. replaceTokenPlaceholder(configPath) {
  5041. return __awaiter(this, void 0, void 0, function* () {
  5042. assert.ok(configPath, 'configPath is not defined');
  5043. let content = (yield fs.promises.readFile(configPath)).toString();
  5044. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  5045. if (placeholderIndex < 0 ||
  5046. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  5047. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  5048. }
  5049. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  5050. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  5051. yield fs.promises.writeFile(configPath, content);
  5052. });
  5053. }
  5054. removeSsh() {
  5055. var _a, _b;
  5056. return __awaiter(this, void 0, void 0, function* () {
  5057. // SSH key
  5058. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  5059. if (keyPath) {
  5060. try {
  5061. yield io.rmRF(keyPath);
  5062. }
  5063. catch (err) {
  5064. core.debug(`${(_b = (_a = err) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : err}`);
  5065. core.warning(`Failed to remove SSH key '${keyPath}'`);
  5066. }
  5067. }
  5068. // SSH known hosts
  5069. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  5070. if (knownHostsPath) {
  5071. try {
  5072. yield io.rmRF(knownHostsPath);
  5073. }
  5074. catch (_c) {
  5075. // Intentionally empty
  5076. }
  5077. }
  5078. // SSH command
  5079. yield this.removeGitConfig(SSH_COMMAND_KEY);
  5080. });
  5081. }
  5082. removeToken() {
  5083. return __awaiter(this, void 0, void 0, function* () {
  5084. // HTTP extra header
  5085. yield this.removeGitConfig(this.tokenConfigKey);
  5086. });
  5087. }
  5088. removeGitConfig(configKey, submoduleOnly = false) {
  5089. return __awaiter(this, void 0, void 0, function* () {
  5090. if (!submoduleOnly) {
  5091. if ((yield this.git.configExists(configKey)) &&
  5092. !(yield this.git.tryConfigUnset(configKey))) {
  5093. // Load the config contents
  5094. core.warning(`Failed to remove '${configKey}' from the git config`);
  5095. }
  5096. }
  5097. const pattern = regexpHelper.escape(configKey);
  5098. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  5099. });
  5100. }
  5101. }
  5102. /***/ }),
  5103. /***/ 289:
  5104. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5105. "use strict";
  5106. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5107. if (k2 === undefined) k2 = k;
  5108. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5109. }) : (function(o, m, k, k2) {
  5110. if (k2 === undefined) k2 = k;
  5111. o[k2] = m[k];
  5112. }));
  5113. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5114. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5115. }) : function(o, v) {
  5116. o["default"] = v;
  5117. });
  5118. var __importStar = (this && this.__importStar) || function (mod) {
  5119. if (mod && mod.__esModule) return mod;
  5120. var result = {};
  5121. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5122. __setModuleDefault(result, mod);
  5123. return result;
  5124. };
  5125. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5126. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5127. return new (P || (P = Promise))(function (resolve, reject) {
  5128. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5129. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5130. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5131. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5132. });
  5133. };
  5134. Object.defineProperty(exports, "__esModule", { value: true });
  5135. exports.createCommandManager = exports.MinimumGitVersion = void 0;
  5136. const core = __importStar(__webpack_require__(470));
  5137. const exec = __importStar(__webpack_require__(986));
  5138. const fshelper = __importStar(__webpack_require__(618));
  5139. const io = __importStar(__webpack_require__(1));
  5140. const path = __importStar(__webpack_require__(622));
  5141. const refHelper = __importStar(__webpack_require__(227));
  5142. const regexpHelper = __importStar(__webpack_require__(528));
  5143. const retryHelper = __importStar(__webpack_require__(587));
  5144. const git_version_1 = __webpack_require__(559);
  5145. // Auth header not supported before 2.9
  5146. // Wire protocol v2 not supported before 2.18
  5147. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  5148. function createCommandManager(workingDirectory, lfs) {
  5149. return __awaiter(this, void 0, void 0, function* () {
  5150. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  5151. });
  5152. }
  5153. exports.createCommandManager = createCommandManager;
  5154. class GitCommandManager {
  5155. // Private constructor; use createCommandManager()
  5156. constructor() {
  5157. this.gitEnv = {
  5158. GIT_TERMINAL_PROMPT: '0',
  5159. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  5160. };
  5161. this.gitPath = '';
  5162. this.lfs = false;
  5163. this.workingDirectory = '';
  5164. }
  5165. branchDelete(remote, branch) {
  5166. return __awaiter(this, void 0, void 0, function* () {
  5167. const args = ['branch', '--delete', '--force'];
  5168. if (remote) {
  5169. args.push('--remote');
  5170. }
  5171. args.push(branch);
  5172. yield this.execGit(args);
  5173. });
  5174. }
  5175. branchExists(remote, pattern) {
  5176. return __awaiter(this, void 0, void 0, function* () {
  5177. const args = ['branch', '--list'];
  5178. if (remote) {
  5179. args.push('--remote');
  5180. }
  5181. args.push(pattern);
  5182. const output = yield this.execGit(args);
  5183. return !!output.stdout.trim();
  5184. });
  5185. }
  5186. branchList(remote) {
  5187. return __awaiter(this, void 0, void 0, function* () {
  5188. const result = [];
  5189. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  5190. // "branch --list" is more difficult when in a detached HEAD state.
  5191. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  5192. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  5193. const args = ['rev-parse', '--symbolic-full-name'];
  5194. if (remote) {
  5195. args.push('--remotes=origin');
  5196. }
  5197. else {
  5198. args.push('--branches');
  5199. }
  5200. const output = yield this.execGit(args);
  5201. for (let branch of output.stdout.trim().split('\n')) {
  5202. branch = branch.trim();
  5203. if (branch) {
  5204. if (branch.startsWith('refs/heads/')) {
  5205. branch = branch.substr('refs/heads/'.length);
  5206. }
  5207. else if (branch.startsWith('refs/remotes/')) {
  5208. branch = branch.substr('refs/remotes/'.length);
  5209. }
  5210. result.push(branch);
  5211. }
  5212. }
  5213. return result;
  5214. });
  5215. }
  5216. checkout(ref, startPoint) {
  5217. return __awaiter(this, void 0, void 0, function* () {
  5218. const args = ['checkout', '--progress', '--force'];
  5219. if (startPoint) {
  5220. args.push('-B', ref, startPoint);
  5221. }
  5222. else {
  5223. args.push(ref);
  5224. }
  5225. yield this.execGit(args);
  5226. });
  5227. }
  5228. checkoutDetach() {
  5229. return __awaiter(this, void 0, void 0, function* () {
  5230. const args = ['checkout', '--detach'];
  5231. yield this.execGit(args);
  5232. });
  5233. }
  5234. config(configKey, configValue, globalConfig) {
  5235. return __awaiter(this, void 0, void 0, function* () {
  5236. yield this.execGit([
  5237. 'config',
  5238. globalConfig ? '--global' : '--local',
  5239. configKey,
  5240. configValue
  5241. ]);
  5242. });
  5243. }
  5244. configExists(configKey, globalConfig) {
  5245. return __awaiter(this, void 0, void 0, function* () {
  5246. const pattern = regexpHelper.escape(configKey);
  5247. const output = yield this.execGit([
  5248. 'config',
  5249. globalConfig ? '--global' : '--local',
  5250. '--name-only',
  5251. '--get-regexp',
  5252. pattern
  5253. ], true);
  5254. return output.exitCode === 0;
  5255. });
  5256. }
  5257. fetch(refSpec, fetchDepth) {
  5258. return __awaiter(this, void 0, void 0, function* () {
  5259. const args = ['-c', 'protocol.version=2', 'fetch'];
  5260. if (!refSpec.some(x => x === refHelper.tagsRefSpec)) {
  5261. args.push('--no-tags');
  5262. }
  5263. args.push('--prune', '--progress', '--no-recurse-submodules');
  5264. if (fetchDepth && fetchDepth > 0) {
  5265. args.push(`--depth=${fetchDepth}`);
  5266. }
  5267. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  5268. args.push('--unshallow');
  5269. }
  5270. args.push('origin');
  5271. for (const arg of refSpec) {
  5272. args.push(arg);
  5273. }
  5274. const that = this;
  5275. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5276. yield that.execGit(args);
  5277. }));
  5278. });
  5279. }
  5280. getDefaultBranch(repositoryUrl) {
  5281. return __awaiter(this, void 0, void 0, function* () {
  5282. let output;
  5283. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5284. output = yield this.execGit([
  5285. 'ls-remote',
  5286. '--quiet',
  5287. '--exit-code',
  5288. '--symref',
  5289. repositoryUrl,
  5290. 'HEAD'
  5291. ]);
  5292. }));
  5293. if (output) {
  5294. // Satisfy compiler, will always be set
  5295. for (let line of output.stdout.trim().split('\n')) {
  5296. line = line.trim();
  5297. if (line.startsWith('ref:') || line.endsWith('HEAD')) {
  5298. return line
  5299. .substr('ref:'.length, line.length - 'ref:'.length - 'HEAD'.length)
  5300. .trim();
  5301. }
  5302. }
  5303. }
  5304. throw new Error('Unexpected output when retrieving default branch');
  5305. });
  5306. }
  5307. getWorkingDirectory() {
  5308. return this.workingDirectory;
  5309. }
  5310. init() {
  5311. return __awaiter(this, void 0, void 0, function* () {
  5312. yield this.execGit(['init', this.workingDirectory]);
  5313. });
  5314. }
  5315. isDetached() {
  5316. return __awaiter(this, void 0, void 0, function* () {
  5317. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  5318. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  5319. return !output.stdout.trim().startsWith('refs/heads/');
  5320. });
  5321. }
  5322. lfsFetch(ref) {
  5323. return __awaiter(this, void 0, void 0, function* () {
  5324. const args = ['lfs', 'fetch', 'origin', ref];
  5325. const that = this;
  5326. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  5327. yield that.execGit(args);
  5328. }));
  5329. });
  5330. }
  5331. lfsInstall() {
  5332. return __awaiter(this, void 0, void 0, function* () {
  5333. yield this.execGit(['lfs', 'install', '--local']);
  5334. });
  5335. }
  5336. log1(format) {
  5337. return __awaiter(this, void 0, void 0, function* () {
  5338. var args = format ? ['log', '-1', format] : ['log', '-1'];
  5339. var silent = format ? false : true;
  5340. const output = yield this.execGit(args, false, silent);
  5341. return output.stdout;
  5342. });
  5343. }
  5344. remoteAdd(remoteName, remoteUrl) {
  5345. return __awaiter(this, void 0, void 0, function* () {
  5346. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  5347. });
  5348. }
  5349. removeEnvironmentVariable(name) {
  5350. delete this.gitEnv[name];
  5351. }
  5352. /**
  5353. * Resolves a ref to a SHA. For a branch or lightweight tag, the commit SHA is returned.
  5354. * For an annotated tag, the tag SHA is returned.
  5355. * @param {string} ref For example: 'refs/heads/main' or '/refs/tags/v1'
  5356. * @returns {Promise<string>}
  5357. */
  5358. revParse(ref) {
  5359. return __awaiter(this, void 0, void 0, function* () {
  5360. const output = yield this.execGit(['rev-parse', ref]);
  5361. return output.stdout.trim();
  5362. });
  5363. }
  5364. setEnvironmentVariable(name, value) {
  5365. this.gitEnv[name] = value;
  5366. }
  5367. shaExists(sha) {
  5368. return __awaiter(this, void 0, void 0, function* () {
  5369. const args = ['rev-parse', '--verify', '--quiet', `${sha}^{object}`];
  5370. const output = yield this.execGit(args, true);
  5371. return output.exitCode === 0;
  5372. });
  5373. }
  5374. submoduleForeach(command, recursive) {
  5375. return __awaiter(this, void 0, void 0, function* () {
  5376. const args = ['submodule', 'foreach'];
  5377. if (recursive) {
  5378. args.push('--recursive');
  5379. }
  5380. args.push(command);
  5381. const output = yield this.execGit(args);
  5382. return output.stdout;
  5383. });
  5384. }
  5385. submoduleSync(recursive) {
  5386. return __awaiter(this, void 0, void 0, function* () {
  5387. const args = ['submodule', 'sync'];
  5388. if (recursive) {
  5389. args.push('--recursive');
  5390. }
  5391. yield this.execGit(args);
  5392. });
  5393. }
  5394. submoduleUpdate(fetchDepth, recursive) {
  5395. return __awaiter(this, void 0, void 0, function* () {
  5396. const args = ['-c', 'protocol.version=2'];
  5397. args.push('submodule', 'update', '--init', '--force');
  5398. if (fetchDepth > 0) {
  5399. args.push(`--depth=${fetchDepth}`);
  5400. }
  5401. if (recursive) {
  5402. args.push('--recursive');
  5403. }
  5404. yield this.execGit(args);
  5405. });
  5406. }
  5407. tagExists(pattern) {
  5408. return __awaiter(this, void 0, void 0, function* () {
  5409. const output = yield this.execGit(['tag', '--list', pattern]);
  5410. return !!output.stdout.trim();
  5411. });
  5412. }
  5413. tryClean() {
  5414. return __awaiter(this, void 0, void 0, function* () {
  5415. const output = yield this.execGit(['clean', '-ffdx'], true);
  5416. return output.exitCode === 0;
  5417. });
  5418. }
  5419. tryConfigUnset(configKey, globalConfig) {
  5420. return __awaiter(this, void 0, void 0, function* () {
  5421. const output = yield this.execGit([
  5422. 'config',
  5423. globalConfig ? '--global' : '--local',
  5424. '--unset-all',
  5425. configKey
  5426. ], true);
  5427. return output.exitCode === 0;
  5428. });
  5429. }
  5430. tryDisableAutomaticGarbageCollection() {
  5431. return __awaiter(this, void 0, void 0, function* () {
  5432. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5433. return output.exitCode === 0;
  5434. });
  5435. }
  5436. tryGetFetchUrl() {
  5437. return __awaiter(this, void 0, void 0, function* () {
  5438. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5439. if (output.exitCode !== 0) {
  5440. return '';
  5441. }
  5442. const stdout = output.stdout.trim();
  5443. if (stdout.includes('\n')) {
  5444. return '';
  5445. }
  5446. return stdout;
  5447. });
  5448. }
  5449. tryReset() {
  5450. return __awaiter(this, void 0, void 0, function* () {
  5451. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5452. return output.exitCode === 0;
  5453. });
  5454. }
  5455. static createCommandManager(workingDirectory, lfs) {
  5456. return __awaiter(this, void 0, void 0, function* () {
  5457. const result = new GitCommandManager();
  5458. yield result.initializeCommandManager(workingDirectory, lfs);
  5459. return result;
  5460. });
  5461. }
  5462. execGit(args, allowAllExitCodes = false, silent = false) {
  5463. return __awaiter(this, void 0, void 0, function* () {
  5464. fshelper.directoryExistsSync(this.workingDirectory, true);
  5465. const result = new GitOutput();
  5466. const env = {};
  5467. for (const key of Object.keys(process.env)) {
  5468. env[key] = process.env[key];
  5469. }
  5470. for (const key of Object.keys(this.gitEnv)) {
  5471. env[key] = this.gitEnv[key];
  5472. }
  5473. const stdout = [];
  5474. const options = {
  5475. cwd: this.workingDirectory,
  5476. env,
  5477. silent,
  5478. ignoreReturnCode: allowAllExitCodes,
  5479. listeners: {
  5480. stdout: (data) => {
  5481. stdout.push(data.toString());
  5482. }
  5483. }
  5484. };
  5485. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5486. result.stdout = stdout.join('');
  5487. return result;
  5488. });
  5489. }
  5490. initializeCommandManager(workingDirectory, lfs) {
  5491. return __awaiter(this, void 0, void 0, function* () {
  5492. this.workingDirectory = workingDirectory;
  5493. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5494. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5495. this.lfs = lfs;
  5496. if (!this.lfs) {
  5497. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5498. }
  5499. this.gitPath = yield io.which('git', true);
  5500. // Git version
  5501. core.debug('Getting git version');
  5502. let gitVersion = new git_version_1.GitVersion();
  5503. let gitOutput = yield this.execGit(['version']);
  5504. let stdout = gitOutput.stdout.trim();
  5505. if (!stdout.includes('\n')) {
  5506. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5507. if (match) {
  5508. gitVersion = new git_version_1.GitVersion(match[0]);
  5509. }
  5510. }
  5511. if (!gitVersion.isValid()) {
  5512. throw new Error('Unable to determine git version');
  5513. }
  5514. // Minimum git version
  5515. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5516. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5517. }
  5518. if (this.lfs) {
  5519. // Git-lfs version
  5520. core.debug('Getting git-lfs version');
  5521. let gitLfsVersion = new git_version_1.GitVersion();
  5522. const gitLfsPath = yield io.which('git-lfs', true);
  5523. gitOutput = yield this.execGit(['lfs', 'version']);
  5524. stdout = gitOutput.stdout.trim();
  5525. if (!stdout.includes('\n')) {
  5526. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5527. if (match) {
  5528. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5529. }
  5530. }
  5531. if (!gitLfsVersion.isValid()) {
  5532. throw new Error('Unable to determine git-lfs version');
  5533. }
  5534. // Minimum git-lfs version
  5535. // Note:
  5536. // - Auth header not supported before 2.1
  5537. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5538. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5539. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5540. }
  5541. }
  5542. // Set the user agent
  5543. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5544. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5545. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5546. });
  5547. }
  5548. }
  5549. class GitOutput {
  5550. constructor() {
  5551. this.stdout = '';
  5552. this.exitCode = 0;
  5553. }
  5554. }
  5555. /***/ }),
  5556. /***/ 293:
  5557. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5558. "use strict";
  5559. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  5560. if (k2 === undefined) k2 = k;
  5561. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  5562. }) : (function(o, m, k, k2) {
  5563. if (k2 === undefined) k2 = k;
  5564. o[k2] = m[k];
  5565. }));
  5566. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  5567. Object.defineProperty(o, "default", { enumerable: true, value: v });
  5568. }) : function(o, v) {
  5569. o["default"] = v;
  5570. });
  5571. var __importStar = (this && this.__importStar) || function (mod) {
  5572. if (mod && mod.__esModule) return mod;
  5573. var result = {};
  5574. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  5575. __setModuleDefault(result, mod);
  5576. return result;
  5577. };
  5578. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5579. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5580. return new (P || (P = Promise))(function (resolve, reject) {
  5581. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5582. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5583. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5584. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5585. });
  5586. };
  5587. Object.defineProperty(exports, "__esModule", { value: true });
  5588. exports.cleanup = exports.getSource = void 0;
  5589. const core = __importStar(__webpack_require__(470));
  5590. const fsHelper = __importStar(__webpack_require__(618));
  5591. const gitAuthHelper = __importStar(__webpack_require__(287));
  5592. const gitCommandManager = __importStar(__webpack_require__(289));
  5593. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5594. const githubApiHelper = __importStar(__webpack_require__(464));
  5595. const io = __importStar(__webpack_require__(1));
  5596. const path = __importStar(__webpack_require__(622));
  5597. const refHelper = __importStar(__webpack_require__(227));
  5598. const stateHelper = __importStar(__webpack_require__(153));
  5599. const urlHelper = __importStar(__webpack_require__(81));
  5600. function getSource(settings) {
  5601. return __awaiter(this, void 0, void 0, function* () {
  5602. // Repository URL
  5603. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5604. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5605. // Remove conflicting file path
  5606. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5607. yield io.rmRF(settings.repositoryPath);
  5608. }
  5609. // Create directory
  5610. let isExisting = true;
  5611. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5612. isExisting = false;
  5613. yield io.mkdirP(settings.repositoryPath);
  5614. }
  5615. // Git command manager
  5616. core.startGroup('Getting Git version info');
  5617. const git = yield getGitCommandManager(settings);
  5618. core.endGroup();
  5619. // Prepare existing directory, otherwise recreate
  5620. if (isExisting) {
  5621. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean, settings.ref);
  5622. }
  5623. if (!git) {
  5624. // Downloading using REST API
  5625. core.info(`The repository will be downloaded using the GitHub REST API`);
  5626. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5627. if (settings.submodules) {
  5628. 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.`);
  5629. }
  5630. else if (settings.sshKey) {
  5631. 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.`);
  5632. }
  5633. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5634. return;
  5635. }
  5636. // Save state for POST action
  5637. stateHelper.setRepositoryPath(settings.repositoryPath);
  5638. // Initialize the repository
  5639. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5640. core.startGroup('Initializing the repository');
  5641. yield git.init();
  5642. yield git.remoteAdd('origin', repositoryUrl);
  5643. core.endGroup();
  5644. }
  5645. // Disable automatic garbage collection
  5646. core.startGroup('Disabling automatic garbage collection');
  5647. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5648. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5649. }
  5650. core.endGroup();
  5651. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5652. try {
  5653. // Configure auth
  5654. core.startGroup('Setting up auth');
  5655. yield authHelper.configureAuth();
  5656. core.endGroup();
  5657. // Determine the default branch
  5658. if (!settings.ref && !settings.commit) {
  5659. core.startGroup('Determining the default branch');
  5660. if (settings.sshKey) {
  5661. settings.ref = yield git.getDefaultBranch(repositoryUrl);
  5662. }
  5663. else {
  5664. settings.ref = yield githubApiHelper.getDefaultBranch(settings.authToken, settings.repositoryOwner, settings.repositoryName);
  5665. }
  5666. core.endGroup();
  5667. }
  5668. // LFS install
  5669. if (settings.lfs) {
  5670. yield git.lfsInstall();
  5671. }
  5672. // Fetch
  5673. core.startGroup('Fetching the repository');
  5674. if (settings.fetchDepth <= 0) {
  5675. // Fetch all branches and tags
  5676. let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit);
  5677. yield git.fetch(refSpec);
  5678. // When all history is fetched, the ref we're interested in may have moved to a different
  5679. // commit (push or force push). If so, fetch again with a targeted refspec.
  5680. if (!(yield refHelper.testRef(git, settings.ref, settings.commit))) {
  5681. refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5682. yield git.fetch(refSpec);
  5683. }
  5684. }
  5685. else {
  5686. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5687. yield git.fetch(refSpec, settings.fetchDepth);
  5688. }
  5689. core.endGroup();
  5690. // Checkout info
  5691. core.startGroup('Determining the checkout info');
  5692. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5693. core.endGroup();
  5694. // LFS fetch
  5695. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5696. // Explicit lfs fetch will fetch lfs objects in parallel.
  5697. if (settings.lfs) {
  5698. core.startGroup('Fetching LFS objects');
  5699. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5700. core.endGroup();
  5701. }
  5702. // Checkout
  5703. core.startGroup('Checking out the ref');
  5704. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5705. core.endGroup();
  5706. // Submodules
  5707. if (settings.submodules) {
  5708. try {
  5709. // Temporarily override global config
  5710. core.startGroup('Setting up auth for fetching submodules');
  5711. yield authHelper.configureGlobalAuth();
  5712. core.endGroup();
  5713. // Checkout submodules
  5714. core.startGroup('Fetching submodules');
  5715. yield git.submoduleSync(settings.nestedSubmodules);
  5716. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5717. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5718. core.endGroup();
  5719. // Persist credentials
  5720. if (settings.persistCredentials) {
  5721. core.startGroup('Persisting credentials for submodules');
  5722. yield authHelper.configureSubmoduleAuth();
  5723. core.endGroup();
  5724. }
  5725. }
  5726. finally {
  5727. // Remove temporary global config override
  5728. yield authHelper.removeGlobalAuth();
  5729. }
  5730. }
  5731. // Get commit information
  5732. const commitInfo = yield git.log1();
  5733. // Log commit sha
  5734. yield git.log1("--format='%H'");
  5735. // Check for incorrect pull request merge commit
  5736. yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
  5737. }
  5738. finally {
  5739. // Remove auth
  5740. if (!settings.persistCredentials) {
  5741. core.startGroup('Removing auth');
  5742. yield authHelper.removeAuth();
  5743. core.endGroup();
  5744. }
  5745. }
  5746. });
  5747. }
  5748. exports.getSource = getSource;
  5749. function cleanup(repositoryPath) {
  5750. return __awaiter(this, void 0, void 0, function* () {
  5751. // Repo exists?
  5752. if (!repositoryPath ||
  5753. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5754. return;
  5755. }
  5756. let git;
  5757. try {
  5758. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5759. }
  5760. catch (_a) {
  5761. return;
  5762. }
  5763. // Remove auth
  5764. const authHelper = gitAuthHelper.createAuthHelper(git);
  5765. yield authHelper.removeAuth();
  5766. });
  5767. }
  5768. exports.cleanup = cleanup;
  5769. function getGitCommandManager(settings) {
  5770. return __awaiter(this, void 0, void 0, function* () {
  5771. core.info(`Working directory is '${settings.repositoryPath}'`);
  5772. try {
  5773. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5774. }
  5775. catch (err) {
  5776. // Git is required for LFS
  5777. if (settings.lfs) {
  5778. throw err;
  5779. }
  5780. // Otherwise fallback to REST API
  5781. return undefined;
  5782. }
  5783. });
  5784. }
  5785. /***/ }),
  5786. /***/ 294:
  5787. /***/ (function(module, __unusedexports, __webpack_require__) {
  5788. module.exports = parseOptions;
  5789. const { Deprecation } = __webpack_require__(692);
  5790. const { getUserAgent } = __webpack_require__(796);
  5791. const once = __webpack_require__(969);
  5792. const pkg = __webpack_require__(215);
  5793. const deprecateOptionsTimeout = once((log, deprecation) =>
  5794. log.warn(deprecation)
  5795. );
  5796. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5797. const deprecateOptionsHeaders = once((log, deprecation) =>
  5798. log.warn(deprecation)
  5799. );
  5800. function parseOptions(options, log, hook) {
  5801. if (options.headers) {
  5802. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5803. newObj[key.toLowerCase()] = options.headers[key];
  5804. return newObj;
  5805. }, {});
  5806. }
  5807. const clientDefaults = {
  5808. headers: options.headers || {},
  5809. request: options.request || {},
  5810. mediaType: {
  5811. previews: [],
  5812. format: ""
  5813. }
  5814. };
  5815. if (options.baseUrl) {
  5816. clientDefaults.baseUrl = options.baseUrl;
  5817. }
  5818. if (options.userAgent) {
  5819. clientDefaults.headers["user-agent"] = options.userAgent;
  5820. }
  5821. if (options.previews) {
  5822. clientDefaults.mediaType.previews = options.previews;
  5823. }
  5824. if (options.timeZone) {
  5825. clientDefaults.headers["time-zone"] = options.timeZone;
  5826. }
  5827. if (options.timeout) {
  5828. deprecateOptionsTimeout(
  5829. log,
  5830. new Deprecation(
  5831. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5832. )
  5833. );
  5834. clientDefaults.request.timeout = options.timeout;
  5835. }
  5836. if (options.agent) {
  5837. deprecateOptionsAgent(
  5838. log,
  5839. new Deprecation(
  5840. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5841. )
  5842. );
  5843. clientDefaults.request.agent = options.agent;
  5844. }
  5845. if (options.headers) {
  5846. deprecateOptionsHeaders(
  5847. log,
  5848. new Deprecation(
  5849. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5850. )
  5851. );
  5852. }
  5853. const userAgentOption = clientDefaults.headers["user-agent"];
  5854. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5855. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5856. .filter(Boolean)
  5857. .join(" ");
  5858. clientDefaults.request.hook = hook.bind(null, "request");
  5859. return clientDefaults;
  5860. }
  5861. /***/ }),
  5862. /***/ 297:
  5863. /***/ (function(module) {
  5864. module.exports = class HttpError extends Error {
  5865. constructor (message, code, headers) {
  5866. super(message)
  5867. // Maintains proper stack trace (only available on V8)
  5868. /* istanbul ignore next */
  5869. if (Error.captureStackTrace) {
  5870. Error.captureStackTrace(this, this.constructor)
  5871. }
  5872. this.name = 'HttpError'
  5873. this.code = code
  5874. this.headers = headers
  5875. }
  5876. }
  5877. /***/ }),
  5878. /***/ 299:
  5879. /***/ (function(__unusedmodule, exports) {
  5880. "use strict";
  5881. Object.defineProperty(exports, '__esModule', { value: true });
  5882. const VERSION = "1.1.2";
  5883. /**
  5884. * Some “list” response that can be paginated have a different response structure
  5885. *
  5886. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5887. * /installation/repositories also has `repository_selection`), as well as a key with
  5888. * the list of the items which name varies from endpoint to endpoint:
  5889. *
  5890. * - https://developer.github.com/v3/search/#example (key `items`)
  5891. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5892. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5893. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5894. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5895. *
  5896. * Octokit normalizes these responses so that paginated results are always returned following
  5897. * the same structure. One challenge is that if the list response has only one page, no Link
  5898. * header is provided, so this header alone is not sufficient to check wether a response is
  5899. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5900. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5901. * property because it also exists in the response of Get the combined status for a specific ref.
  5902. */
  5903. 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))?([^/]|$)/];
  5904. function normalizePaginatedListResponse(octokit, url, response) {
  5905. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5906. const responseNeedsNormalization = REGEX.find(regex => regex.test(path));
  5907. if (!responseNeedsNormalization) return; // keep the additional properties intact as there is currently no other way
  5908. // to retrieve the same information.
  5909. const incompleteResults = response.data.incomplete_results;
  5910. const repositorySelection = response.data.repository_selection;
  5911. const totalCount = response.data.total_count;
  5912. delete response.data.incomplete_results;
  5913. delete response.data.repository_selection;
  5914. delete response.data.total_count;
  5915. const namespaceKey = Object.keys(response.data)[0];
  5916. const data = response.data[namespaceKey];
  5917. response.data = data;
  5918. if (typeof incompleteResults !== "undefined") {
  5919. response.data.incomplete_results = incompleteResults;
  5920. }
  5921. if (typeof repositorySelection !== "undefined") {
  5922. response.data.repository_selection = repositorySelection;
  5923. }
  5924. response.data.total_count = totalCount;
  5925. Object.defineProperty(response.data, namespaceKey, {
  5926. get() {
  5927. octokit.log.warn(`[@octokit/paginate-rest] "response.data.${namespaceKey}" is deprecated for "GET ${path}". Get the results directly from "response.data"`);
  5928. return Array.from(data);
  5929. }
  5930. });
  5931. }
  5932. function iterator(octokit, route, parameters) {
  5933. const options = octokit.request.endpoint(route, parameters);
  5934. const method = options.method;
  5935. const headers = options.headers;
  5936. let url = options.url;
  5937. return {
  5938. [Symbol.asyncIterator]: () => ({
  5939. next() {
  5940. if (!url) {
  5941. return Promise.resolve({
  5942. done: true
  5943. });
  5944. }
  5945. return octokit.request({
  5946. method,
  5947. url,
  5948. headers
  5949. }).then(response => {
  5950. normalizePaginatedListResponse(octokit, url, response); // `response.headers.link` format:
  5951. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  5952. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  5953. url = ((response.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
  5954. return {
  5955. value: response
  5956. };
  5957. });
  5958. }
  5959. })
  5960. };
  5961. }
  5962. function paginate(octokit, route, parameters, mapFn) {
  5963. if (typeof parameters === "function") {
  5964. mapFn = parameters;
  5965. parameters = undefined;
  5966. }
  5967. return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
  5968. }
  5969. function gather(octokit, results, iterator, mapFn) {
  5970. return iterator.next().then(result => {
  5971. if (result.done) {
  5972. return results;
  5973. }
  5974. let earlyExit = false;
  5975. function done() {
  5976. earlyExit = true;
  5977. }
  5978. results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
  5979. if (earlyExit) {
  5980. return results;
  5981. }
  5982. return gather(octokit, results, iterator, mapFn);
  5983. });
  5984. }
  5985. /**
  5986. * @param octokit Octokit instance
  5987. * @param options Options passed to Octokit constructor
  5988. */
  5989. function paginateRest(octokit) {
  5990. return {
  5991. paginate: Object.assign(paginate.bind(null, octokit), {
  5992. iterator: iterator.bind(null, octokit)
  5993. })
  5994. };
  5995. }
  5996. paginateRest.VERSION = VERSION;
  5997. exports.paginateRest = paginateRest;
  5998. //# sourceMappingURL=index.js.map
  5999. /***/ }),
  6000. /***/ 323:
  6001. /***/ (function(module) {
  6002. "use strict";
  6003. var isStream = module.exports = function (stream) {
  6004. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  6005. };
  6006. isStream.writable = function (stream) {
  6007. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  6008. };
  6009. isStream.readable = function (stream) {
  6010. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  6011. };
  6012. isStream.duplex = function (stream) {
  6013. return isStream.writable(stream) && isStream.readable(stream);
  6014. };
  6015. isStream.transform = function (stream) {
  6016. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  6017. };
  6018. /***/ }),
  6019. /***/ 335:
  6020. /***/ (function(module, __unusedexports, __webpack_require__) {
  6021. module.exports = __webpack_require__(179);
  6022. /***/ }),
  6023. /***/ 336:
  6024. /***/ (function(module, __unusedexports, __webpack_require__) {
  6025. module.exports = hasLastPage
  6026. const deprecate = __webpack_require__(370)
  6027. const getPageLinks = __webpack_require__(577)
  6028. function hasLastPage (link) {
  6029. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  6030. return getPageLinks(link).last
  6031. }
  6032. /***/ }),
  6033. /***/ 348:
  6034. /***/ (function(module, __unusedexports, __webpack_require__) {
  6035. "use strict";
  6036. module.exports = validate;
  6037. const { RequestError } = __webpack_require__(497);
  6038. const get = __webpack_require__(854);
  6039. const set = __webpack_require__(883);
  6040. function validate(octokit, options) {
  6041. if (!options.request.validate) {
  6042. return;
  6043. }
  6044. const { validate: params } = options.request;
  6045. Object.keys(params).forEach(parameterName => {
  6046. const parameter = get(params, parameterName);
  6047. const expectedType = parameter.type;
  6048. let parentParameterName;
  6049. let parentValue;
  6050. let parentParamIsPresent = true;
  6051. let parentParameterIsArray = false;
  6052. if (/\./.test(parameterName)) {
  6053. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  6054. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  6055. if (parentParameterIsArray) {
  6056. parentParameterName = parentParameterName.slice(0, -2);
  6057. }
  6058. parentValue = get(options, parentParameterName);
  6059. parentParamIsPresent =
  6060. parentParameterName === "headers" ||
  6061. (typeof parentValue === "object" && parentValue !== null);
  6062. }
  6063. const values = parentParameterIsArray
  6064. ? (get(options, parentParameterName) || []).map(
  6065. value => value[parameterName.split(/\./).pop()]
  6066. )
  6067. : [get(options, parameterName)];
  6068. values.forEach((value, i) => {
  6069. const valueIsPresent = typeof value !== "undefined";
  6070. const valueIsNull = value === null;
  6071. const currentParameterName = parentParameterIsArray
  6072. ? parameterName.replace(/\[\]/, `[${i}]`)
  6073. : parameterName;
  6074. if (!parameter.required && !valueIsPresent) {
  6075. return;
  6076. }
  6077. // if the parent parameter is of type object but allows null
  6078. // then the child parameters can be ignored
  6079. if (!parentParamIsPresent) {
  6080. return;
  6081. }
  6082. if (parameter.allowNull && valueIsNull) {
  6083. return;
  6084. }
  6085. if (!parameter.allowNull && valueIsNull) {
  6086. throw new RequestError(
  6087. `'${currentParameterName}' cannot be null`,
  6088. 400,
  6089. {
  6090. request: options
  6091. }
  6092. );
  6093. }
  6094. if (parameter.required && !valueIsPresent) {
  6095. throw new RequestError(
  6096. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  6097. value
  6098. )}`,
  6099. 400,
  6100. {
  6101. request: options
  6102. }
  6103. );
  6104. }
  6105. // parse to integer before checking for enum
  6106. // so that string "1" will match enum with number 1
  6107. if (expectedType === "integer") {
  6108. const unparsedValue = value;
  6109. value = parseInt(value, 10);
  6110. if (isNaN(value)) {
  6111. throw new RequestError(
  6112. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6113. unparsedValue
  6114. )} is NaN`,
  6115. 400,
  6116. {
  6117. request: options
  6118. }
  6119. );
  6120. }
  6121. }
  6122. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  6123. throw new RequestError(
  6124. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6125. value
  6126. )}`,
  6127. 400,
  6128. {
  6129. request: options
  6130. }
  6131. );
  6132. }
  6133. if (parameter.validation) {
  6134. const regex = new RegExp(parameter.validation);
  6135. if (!regex.test(value)) {
  6136. throw new RequestError(
  6137. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  6138. value
  6139. )}`,
  6140. 400,
  6141. {
  6142. request: options
  6143. }
  6144. );
  6145. }
  6146. }
  6147. if (expectedType === "object" && typeof value === "string") {
  6148. try {
  6149. value = JSON.parse(value);
  6150. } catch (exception) {
  6151. throw new RequestError(
  6152. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  6153. value
  6154. )}`,
  6155. 400,
  6156. {
  6157. request: options
  6158. }
  6159. );
  6160. }
  6161. }
  6162. set(options, parameter.mapTo || currentParameterName, value);
  6163. });
  6164. });
  6165. return options;
  6166. }
  6167. /***/ }),
  6168. /***/ 349:
  6169. /***/ (function(module, __unusedexports, __webpack_require__) {
  6170. module.exports = authenticationRequestError;
  6171. const { RequestError } = __webpack_require__(497);
  6172. function authenticationRequestError(state, error, options) {
  6173. /* istanbul ignore next */
  6174. if (!error.headers) throw error;
  6175. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  6176. // handle "2FA required" error only
  6177. if (error.status !== 401 || !otpRequired) {
  6178. throw error;
  6179. }
  6180. if (
  6181. error.status === 401 &&
  6182. otpRequired &&
  6183. error.request &&
  6184. error.request.headers["x-github-otp"]
  6185. ) {
  6186. throw new RequestError(
  6187. "Invalid one-time password for two-factor authentication",
  6188. 401,
  6189. {
  6190. headers: error.headers,
  6191. request: options
  6192. }
  6193. );
  6194. }
  6195. if (typeof state.auth.on2fa !== "function") {
  6196. throw new RequestError(
  6197. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  6198. 401,
  6199. {
  6200. headers: error.headers,
  6201. request: options
  6202. }
  6203. );
  6204. }
  6205. return Promise.resolve()
  6206. .then(() => {
  6207. return state.auth.on2fa();
  6208. })
  6209. .then(oneTimePassword => {
  6210. const newOptions = Object.assign(options, {
  6211. headers: Object.assign(
  6212. { "x-github-otp": oneTimePassword },
  6213. options.headers
  6214. )
  6215. });
  6216. return state.octokit.request(newOptions);
  6217. });
  6218. }
  6219. /***/ }),
  6220. /***/ 357:
  6221. /***/ (function(module) {
  6222. module.exports = require("assert");
  6223. /***/ }),
  6224. /***/ 363:
  6225. /***/ (function(module) {
  6226. module.exports = register
  6227. function register (state, name, method, options) {
  6228. if (typeof method !== 'function') {
  6229. throw new Error('method for before hook must be a function')
  6230. }
  6231. if (!options) {
  6232. options = {}
  6233. }
  6234. if (Array.isArray(name)) {
  6235. return name.reverse().reduce(function (callback, name) {
  6236. return register.bind(null, state, name, callback, options)
  6237. }, method)()
  6238. }
  6239. return Promise.resolve()
  6240. .then(function () {
  6241. if (!state.registry[name]) {
  6242. return method(options)
  6243. }
  6244. return (state.registry[name]).reduce(function (method, registered) {
  6245. return registered.hook.bind(null, method, options)
  6246. }, method)()
  6247. })
  6248. }
  6249. /***/ }),
  6250. /***/ 368:
  6251. /***/ (function(module) {
  6252. module.exports = function atob(str) {
  6253. return Buffer.from(str, 'base64').toString('binary')
  6254. }
  6255. /***/ }),
  6256. /***/ 370:
  6257. /***/ (function(module) {
  6258. module.exports = deprecate
  6259. const loggedMessages = {}
  6260. function deprecate (message) {
  6261. if (loggedMessages[message]) {
  6262. return
  6263. }
  6264. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  6265. loggedMessages[message] = 1
  6266. }
  6267. /***/ }),
  6268. /***/ 385:
  6269. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6270. "use strict";
  6271. Object.defineProperty(exports, '__esModule', { value: true });
  6272. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6273. var isPlainObject = _interopDefault(__webpack_require__(696));
  6274. var universalUserAgent = __webpack_require__(562);
  6275. function lowercaseKeys(object) {
  6276. if (!object) {
  6277. return {};
  6278. }
  6279. return Object.keys(object).reduce((newObj, key) => {
  6280. newObj[key.toLowerCase()] = object[key];
  6281. return newObj;
  6282. }, {});
  6283. }
  6284. function mergeDeep(defaults, options) {
  6285. const result = Object.assign({}, defaults);
  6286. Object.keys(options).forEach(key => {
  6287. if (isPlainObject(options[key])) {
  6288. if (!(key in defaults)) Object.assign(result, {
  6289. [key]: options[key]
  6290. });else result[key] = mergeDeep(defaults[key], options[key]);
  6291. } else {
  6292. Object.assign(result, {
  6293. [key]: options[key]
  6294. });
  6295. }
  6296. });
  6297. return result;
  6298. }
  6299. function merge(defaults, route, options) {
  6300. if (typeof route === "string") {
  6301. let [method, url] = route.split(" ");
  6302. options = Object.assign(url ? {
  6303. method,
  6304. url
  6305. } : {
  6306. url: method
  6307. }, options);
  6308. } else {
  6309. options = Object.assign({}, route);
  6310. } // lowercase header names before merging with defaults to avoid duplicates
  6311. options.headers = lowercaseKeys(options.headers);
  6312. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  6313. if (defaults && defaults.mediaType.previews.length) {
  6314. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  6315. }
  6316. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  6317. return mergedOptions;
  6318. }
  6319. function addQueryParameters(url, parameters) {
  6320. const separator = /\?/.test(url) ? "&" : "?";
  6321. const names = Object.keys(parameters);
  6322. if (names.length === 0) {
  6323. return url;
  6324. }
  6325. return url + separator + names.map(name => {
  6326. if (name === "q") {
  6327. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  6328. }
  6329. return `${name}=${encodeURIComponent(parameters[name])}`;
  6330. }).join("&");
  6331. }
  6332. const urlVariableRegex = /\{[^}]+\}/g;
  6333. function removeNonChars(variableName) {
  6334. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  6335. }
  6336. function extractUrlVariableNames(url) {
  6337. const matches = url.match(urlVariableRegex);
  6338. if (!matches) {
  6339. return [];
  6340. }
  6341. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  6342. }
  6343. function omit(object, keysToOmit) {
  6344. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  6345. obj[key] = object[key];
  6346. return obj;
  6347. }, {});
  6348. }
  6349. // Based on https://github.com/bramstein/url-template, licensed under BSD
  6350. // TODO: create separate package.
  6351. //
  6352. // Copyright (c) 2012-2014, Bram Stein
  6353. // All rights reserved.
  6354. // Redistribution and use in source and binary forms, with or without
  6355. // modification, are permitted provided that the following conditions
  6356. // are met:
  6357. // 1. Redistributions of source code must retain the above copyright
  6358. // notice, this list of conditions and the following disclaimer.
  6359. // 2. Redistributions in binary form must reproduce the above copyright
  6360. // notice, this list of conditions and the following disclaimer in the
  6361. // documentation and/or other materials provided with the distribution.
  6362. // 3. The name of the author may not be used to endorse or promote products
  6363. // derived from this software without specific prior written permission.
  6364. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  6365. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  6366. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  6367. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  6368. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  6369. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  6370. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  6371. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  6372. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  6373. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6374. /* istanbul ignore file */
  6375. function encodeReserved(str) {
  6376. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  6377. if (!/%[0-9A-Fa-f]/.test(part)) {
  6378. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  6379. }
  6380. return part;
  6381. }).join("");
  6382. }
  6383. function encodeUnreserved(str) {
  6384. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  6385. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  6386. });
  6387. }
  6388. function encodeValue(operator, value, key) {
  6389. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  6390. if (key) {
  6391. return encodeUnreserved(key) + "=" + value;
  6392. } else {
  6393. return value;
  6394. }
  6395. }
  6396. function isDefined(value) {
  6397. return value !== undefined && value !== null;
  6398. }
  6399. function isKeyOperator(operator) {
  6400. return operator === ";" || operator === "&" || operator === "?";
  6401. }
  6402. function getValues(context, operator, key, modifier) {
  6403. var value = context[key],
  6404. result = [];
  6405. if (isDefined(value) && value !== "") {
  6406. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6407. value = value.toString();
  6408. if (modifier && modifier !== "*") {
  6409. value = value.substring(0, parseInt(modifier, 10));
  6410. }
  6411. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6412. } else {
  6413. if (modifier === "*") {
  6414. if (Array.isArray(value)) {
  6415. value.filter(isDefined).forEach(function (value) {
  6416. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  6417. });
  6418. } else {
  6419. Object.keys(value).forEach(function (k) {
  6420. if (isDefined(value[k])) {
  6421. result.push(encodeValue(operator, value[k], k));
  6422. }
  6423. });
  6424. }
  6425. } else {
  6426. const tmp = [];
  6427. if (Array.isArray(value)) {
  6428. value.filter(isDefined).forEach(function (value) {
  6429. tmp.push(encodeValue(operator, value));
  6430. });
  6431. } else {
  6432. Object.keys(value).forEach(function (k) {
  6433. if (isDefined(value[k])) {
  6434. tmp.push(encodeUnreserved(k));
  6435. tmp.push(encodeValue(operator, value[k].toString()));
  6436. }
  6437. });
  6438. }
  6439. if (isKeyOperator(operator)) {
  6440. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6441. } else if (tmp.length !== 0) {
  6442. result.push(tmp.join(","));
  6443. }
  6444. }
  6445. }
  6446. } else {
  6447. if (operator === ";") {
  6448. if (isDefined(value)) {
  6449. result.push(encodeUnreserved(key));
  6450. }
  6451. } else if (value === "" && (operator === "&" || operator === "?")) {
  6452. result.push(encodeUnreserved(key) + "=");
  6453. } else if (value === "") {
  6454. result.push("");
  6455. }
  6456. }
  6457. return result;
  6458. }
  6459. function parseUrl(template) {
  6460. return {
  6461. expand: expand.bind(null, template)
  6462. };
  6463. }
  6464. function expand(template, context) {
  6465. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6466. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6467. if (expression) {
  6468. let operator = "";
  6469. const values = [];
  6470. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6471. operator = expression.charAt(0);
  6472. expression = expression.substr(1);
  6473. }
  6474. expression.split(/,/g).forEach(function (variable) {
  6475. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6476. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6477. });
  6478. if (operator && operator !== "+") {
  6479. var separator = ",";
  6480. if (operator === "?") {
  6481. separator = "&";
  6482. } else if (operator !== "#") {
  6483. separator = operator;
  6484. }
  6485. return (values.length !== 0 ? operator : "") + values.join(separator);
  6486. } else {
  6487. return values.join(",");
  6488. }
  6489. } else {
  6490. return encodeReserved(literal);
  6491. }
  6492. });
  6493. }
  6494. function parse(options) {
  6495. // https://fetch.spec.whatwg.org/#methods
  6496. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6497. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6498. let headers = Object.assign({}, options.headers);
  6499. let body;
  6500. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6501. const urlVariableNames = extractUrlVariableNames(url);
  6502. url = parseUrl(url).expand(parameters);
  6503. if (!/^http/.test(url)) {
  6504. url = options.baseUrl + url;
  6505. }
  6506. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6507. const remainingParameters = omit(parameters, omittedParameters);
  6508. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6509. if (!isBinaryRequset) {
  6510. if (options.mediaType.format) {
  6511. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6512. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6513. }
  6514. if (options.mediaType.previews.length) {
  6515. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6516. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6517. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6518. return `application/vnd.github.${preview}-preview${format}`;
  6519. }).join(",");
  6520. }
  6521. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6522. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6523. if (["GET", "HEAD"].includes(method)) {
  6524. url = addQueryParameters(url, remainingParameters);
  6525. } else {
  6526. if ("data" in remainingParameters) {
  6527. body = remainingParameters.data;
  6528. } else {
  6529. if (Object.keys(remainingParameters).length) {
  6530. body = remainingParameters;
  6531. } else {
  6532. headers["content-length"] = 0;
  6533. }
  6534. }
  6535. } // default content-type for JSON if body is set
  6536. if (!headers["content-type"] && typeof body !== "undefined") {
  6537. headers["content-type"] = "application/json; charset=utf-8";
  6538. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6539. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6540. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6541. body = "";
  6542. } // Only return body/request keys if present
  6543. return Object.assign({
  6544. method,
  6545. url,
  6546. headers
  6547. }, typeof body !== "undefined" ? {
  6548. body
  6549. } : null, options.request ? {
  6550. request: options.request
  6551. } : null);
  6552. }
  6553. function endpointWithDefaults(defaults, route, options) {
  6554. return parse(merge(defaults, route, options));
  6555. }
  6556. function withDefaults(oldDefaults, newDefaults) {
  6557. const DEFAULTS = merge(oldDefaults, newDefaults);
  6558. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6559. return Object.assign(endpoint, {
  6560. DEFAULTS,
  6561. defaults: withDefaults.bind(null, DEFAULTS),
  6562. merge: merge.bind(null, DEFAULTS),
  6563. parse
  6564. });
  6565. }
  6566. const VERSION = "6.0.1";
  6567. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6568. // So we use RequestParameters and add method as additional required property.
  6569. const DEFAULTS = {
  6570. method: "GET",
  6571. baseUrl: "https://api.github.com",
  6572. headers: {
  6573. accept: "application/vnd.github.v3+json",
  6574. "user-agent": userAgent
  6575. },
  6576. mediaType: {
  6577. format: "",
  6578. previews: []
  6579. }
  6580. };
  6581. const endpoint = withDefaults(null, DEFAULTS);
  6582. exports.endpoint = endpoint;
  6583. //# sourceMappingURL=index.js.map
  6584. /***/ }),
  6585. /***/ 389:
  6586. /***/ (function(module, __unusedexports, __webpack_require__) {
  6587. "use strict";
  6588. const fs = __webpack_require__(747);
  6589. const shebangCommand = __webpack_require__(866);
  6590. function readShebang(command) {
  6591. // Read the first 150 bytes from the file
  6592. const size = 150;
  6593. let buffer;
  6594. if (Buffer.alloc) {
  6595. // Node.js v4.5+ / v5.10+
  6596. buffer = Buffer.alloc(size);
  6597. } else {
  6598. // Old Node.js API
  6599. buffer = new Buffer(size);
  6600. buffer.fill(0); // zero-fill
  6601. }
  6602. let fd;
  6603. try {
  6604. fd = fs.openSync(command, 'r');
  6605. fs.readSync(fd, buffer, 0, size, 0);
  6606. fs.closeSync(fd);
  6607. } catch (e) { /* Empty */ }
  6608. // Attempt to extract shebang (null is returned if not a shebang)
  6609. return shebangCommand(buffer.toString());
  6610. }
  6611. module.exports = readShebang;
  6612. /***/ }),
  6613. /***/ 402:
  6614. /***/ (function(module, __unusedexports, __webpack_require__) {
  6615. module.exports = Octokit;
  6616. const { request } = __webpack_require__(753);
  6617. const Hook = __webpack_require__(523);
  6618. const parseClientOptions = __webpack_require__(294);
  6619. function Octokit(plugins, options) {
  6620. options = options || {};
  6621. const hook = new Hook.Collection();
  6622. const log = Object.assign(
  6623. {
  6624. debug: () => {},
  6625. info: () => {},
  6626. warn: console.warn,
  6627. error: console.error
  6628. },
  6629. options && options.log
  6630. );
  6631. const api = {
  6632. hook,
  6633. log,
  6634. request: request.defaults(parseClientOptions(options, log, hook))
  6635. };
  6636. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6637. return api;
  6638. }
  6639. /***/ }),
  6640. /***/ 413:
  6641. /***/ (function(module) {
  6642. module.exports = require("stream");
  6643. /***/ }),
  6644. /***/ 417:
  6645. /***/ (function(module) {
  6646. module.exports = require("crypto");
  6647. /***/ }),
  6648. /***/ 427:
  6649. /***/ (function(module, __unusedexports, __webpack_require__) {
  6650. "use strict";
  6651. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6652. // In that case, fall back to a deprecated internal.
  6653. const util = __webpack_require__(669);
  6654. let uv;
  6655. if (typeof util.getSystemErrorName === 'function') {
  6656. module.exports = util.getSystemErrorName;
  6657. } else {
  6658. try {
  6659. uv = process.binding('uv');
  6660. if (typeof uv.errname !== 'function') {
  6661. throw new TypeError('uv.errname is not a function');
  6662. }
  6663. } catch (err) {
  6664. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6665. uv = null;
  6666. }
  6667. module.exports = code => errname(uv, code);
  6668. }
  6669. // Used for testing the fallback behavior
  6670. module.exports.__test__ = errname;
  6671. function errname(uv, code) {
  6672. if (uv) {
  6673. return uv.errname(code);
  6674. }
  6675. if (!(code < 0)) {
  6676. throw new Error('err >= 0');
  6677. }
  6678. return `Unknown system error ${code}`;
  6679. }
  6680. /***/ }),
  6681. /***/ 430:
  6682. /***/ (function(module, __unusedexports, __webpack_require__) {
  6683. module.exports = octokitValidate;
  6684. const validate = __webpack_require__(348);
  6685. function octokitValidate(octokit) {
  6686. octokit.hook.before("request", validate.bind(null, octokit));
  6687. }
  6688. /***/ }),
  6689. /***/ 431:
  6690. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6691. "use strict";
  6692. var __importStar = (this && this.__importStar) || function (mod) {
  6693. if (mod && mod.__esModule) return mod;
  6694. var result = {};
  6695. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6696. result["default"] = mod;
  6697. return result;
  6698. };
  6699. Object.defineProperty(exports, "__esModule", { value: true });
  6700. const os = __importStar(__webpack_require__(87));
  6701. const utils_1 = __webpack_require__(82);
  6702. /**
  6703. * Commands
  6704. *
  6705. * Command Format:
  6706. * ::name key=value,key=value::message
  6707. *
  6708. * Examples:
  6709. * ::warning::This is the message
  6710. * ::set-env name=MY_VAR::some value
  6711. */
  6712. function issueCommand(command, properties, message) {
  6713. const cmd = new Command(command, properties, message);
  6714. process.stdout.write(cmd.toString() + os.EOL);
  6715. }
  6716. exports.issueCommand = issueCommand;
  6717. function issue(name, message = '') {
  6718. issueCommand(name, {}, message);
  6719. }
  6720. exports.issue = issue;
  6721. const CMD_STRING = '::';
  6722. class Command {
  6723. constructor(command, properties, message) {
  6724. if (!command) {
  6725. command = 'missing.command';
  6726. }
  6727. this.command = command;
  6728. this.properties = properties;
  6729. this.message = message;
  6730. }
  6731. toString() {
  6732. let cmdStr = CMD_STRING + this.command;
  6733. if (this.properties && Object.keys(this.properties).length > 0) {
  6734. cmdStr += ' ';
  6735. let first = true;
  6736. for (const key in this.properties) {
  6737. if (this.properties.hasOwnProperty(key)) {
  6738. const val = this.properties[key];
  6739. if (val) {
  6740. if (first) {
  6741. first = false;
  6742. }
  6743. else {
  6744. cmdStr += ',';
  6745. }
  6746. cmdStr += `${key}=${escapeProperty(val)}`;
  6747. }
  6748. }
  6749. }
  6750. }
  6751. cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
  6752. return cmdStr;
  6753. }
  6754. }
  6755. function escapeData(s) {
  6756. return utils_1.toCommandValue(s)
  6757. .replace(/%/g, '%25')
  6758. .replace(/\r/g, '%0D')
  6759. .replace(/\n/g, '%0A');
  6760. }
  6761. function escapeProperty(s) {
  6762. return utils_1.toCommandValue(s)
  6763. .replace(/%/g, '%25')
  6764. .replace(/\r/g, '%0D')
  6765. .replace(/\n/g, '%0A')
  6766. .replace(/:/g, '%3A')
  6767. .replace(/,/g, '%2C');
  6768. }
  6769. //# sourceMappingURL=command.js.map
  6770. /***/ }),
  6771. /***/ 438:
  6772. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6773. "use strict";
  6774. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  6775. if (k2 === undefined) k2 = k;
  6776. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  6777. }) : (function(o, m, k, k2) {
  6778. if (k2 === undefined) k2 = k;
  6779. o[k2] = m[k];
  6780. }));
  6781. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  6782. Object.defineProperty(o, "default", { enumerable: true, value: v });
  6783. }) : function(o, v) {
  6784. o["default"] = v;
  6785. });
  6786. var __importStar = (this && this.__importStar) || function (mod) {
  6787. if (mod && mod.__esModule) return mod;
  6788. var result = {};
  6789. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  6790. __setModuleDefault(result, mod);
  6791. return result;
  6792. };
  6793. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6794. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6795. return new (P || (P = Promise))(function (resolve, reject) {
  6796. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6797. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6798. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6799. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6800. });
  6801. };
  6802. Object.defineProperty(exports, "__esModule", { value: true });
  6803. exports.prepareExistingDirectory = void 0;
  6804. const assert = __importStar(__webpack_require__(357));
  6805. const core = __importStar(__webpack_require__(470));
  6806. const fs = __importStar(__webpack_require__(747));
  6807. const fsHelper = __importStar(__webpack_require__(618));
  6808. const io = __importStar(__webpack_require__(1));
  6809. const path = __importStar(__webpack_require__(622));
  6810. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean, ref) {
  6811. var _a, _b;
  6812. return __awaiter(this, void 0, void 0, function* () {
  6813. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6814. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6815. // Indicates whether to delete the directory contents
  6816. let remove = false;
  6817. // Check whether using git or REST API
  6818. if (!git) {
  6819. remove = true;
  6820. }
  6821. // Fetch URL does not match
  6822. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6823. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6824. remove = true;
  6825. }
  6826. else {
  6827. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6828. const lockPaths = [
  6829. path.join(repositoryPath, '.git', 'index.lock'),
  6830. path.join(repositoryPath, '.git', 'shallow.lock')
  6831. ];
  6832. for (const lockPath of lockPaths) {
  6833. try {
  6834. yield io.rmRF(lockPath);
  6835. }
  6836. catch (error) {
  6837. core.debug(`Unable to delete '${lockPath}'. ${(_b = (_a = error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : error}`);
  6838. }
  6839. }
  6840. try {
  6841. core.startGroup('Removing previously created refs, to avoid conflicts');
  6842. // Checkout detached HEAD
  6843. if (!(yield git.isDetached())) {
  6844. yield git.checkoutDetach();
  6845. }
  6846. // Remove all refs/heads/*
  6847. let branches = yield git.branchList(false);
  6848. for (const branch of branches) {
  6849. yield git.branchDelete(false, branch);
  6850. }
  6851. // Remove any conflicting refs/remotes/origin/*
  6852. // Example 1: Consider ref is refs/heads/foo and previously fetched refs/remotes/origin/foo/bar
  6853. // Example 2: Consider ref is refs/heads/foo/bar and previously fetched refs/remotes/origin/foo
  6854. if (ref) {
  6855. ref = ref.startsWith('refs/') ? ref : `refs/heads/${ref}`;
  6856. if (ref.startsWith('refs/heads/')) {
  6857. const upperName1 = ref.toUpperCase().substr('REFS/HEADS/'.length);
  6858. const upperName1Slash = `${upperName1}/`;
  6859. branches = yield git.branchList(true);
  6860. for (const branch of branches) {
  6861. const upperName2 = branch.substr('origin/'.length).toUpperCase();
  6862. const upperName2Slash = `${upperName2}/`;
  6863. if (upperName1.startsWith(upperName2Slash) ||
  6864. upperName2.startsWith(upperName1Slash)) {
  6865. yield git.branchDelete(true, branch);
  6866. }
  6867. }
  6868. }
  6869. }
  6870. core.endGroup();
  6871. // Clean
  6872. if (clean) {
  6873. core.startGroup('Cleaning the repository');
  6874. if (!(yield git.tryClean())) {
  6875. 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}'.`);
  6876. remove = true;
  6877. }
  6878. else if (!(yield git.tryReset())) {
  6879. remove = true;
  6880. }
  6881. core.endGroup();
  6882. if (remove) {
  6883. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6884. }
  6885. }
  6886. }
  6887. catch (error) {
  6888. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6889. remove = true;
  6890. }
  6891. }
  6892. if (remove) {
  6893. // Delete the contents of the directory. Don't delete the directory itself
  6894. // since it might be the current working directory.
  6895. core.info(`Deleting the contents of '${repositoryPath}'`);
  6896. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6897. yield io.rmRF(path.join(repositoryPath, file));
  6898. }
  6899. }
  6900. });
  6901. }
  6902. exports.prepareExistingDirectory = prepareExistingDirectory;
  6903. /***/ }),
  6904. /***/ 453:
  6905. /***/ (function(module, __unusedexports, __webpack_require__) {
  6906. var once = __webpack_require__(969)
  6907. var eos = __webpack_require__(3)
  6908. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6909. var noop = function () {}
  6910. var ancient = /^v?\.0/.test(process.version)
  6911. var isFn = function (fn) {
  6912. return typeof fn === 'function'
  6913. }
  6914. var isFS = function (stream) {
  6915. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6916. if (!fs) return false // browser
  6917. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6918. }
  6919. var isRequest = function (stream) {
  6920. return stream.setHeader && isFn(stream.abort)
  6921. }
  6922. var destroyer = function (stream, reading, writing, callback) {
  6923. callback = once(callback)
  6924. var closed = false
  6925. stream.on('close', function () {
  6926. closed = true
  6927. })
  6928. eos(stream, {readable: reading, writable: writing}, function (err) {
  6929. if (err) return callback(err)
  6930. closed = true
  6931. callback()
  6932. })
  6933. var destroyed = false
  6934. return function (err) {
  6935. if (closed) return
  6936. if (destroyed) return
  6937. destroyed = true
  6938. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6939. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6940. if (isFn(stream.destroy)) return stream.destroy()
  6941. callback(err || new Error('stream was destroyed'))
  6942. }
  6943. }
  6944. var call = function (fn) {
  6945. fn()
  6946. }
  6947. var pipe = function (from, to) {
  6948. return from.pipe(to)
  6949. }
  6950. var pump = function () {
  6951. var streams = Array.prototype.slice.call(arguments)
  6952. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6953. if (Array.isArray(streams[0])) streams = streams[0]
  6954. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6955. var error
  6956. var destroys = streams.map(function (stream, i) {
  6957. var reading = i < streams.length - 1
  6958. var writing = i > 0
  6959. return destroyer(stream, reading, writing, function (err) {
  6960. if (!error) error = err
  6961. if (err) destroys.forEach(call)
  6962. if (reading) return
  6963. destroys.forEach(call)
  6964. callback(error)
  6965. })
  6966. })
  6967. return streams.reduce(pipe)
  6968. }
  6969. module.exports = pump
  6970. /***/ }),
  6971. /***/ 454:
  6972. /***/ (function(module, exports, __webpack_require__) {
  6973. "use strict";
  6974. Object.defineProperty(exports, '__esModule', { value: true });
  6975. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6976. var Stream = _interopDefault(__webpack_require__(413));
  6977. var http = _interopDefault(__webpack_require__(605));
  6978. var Url = _interopDefault(__webpack_require__(835));
  6979. var https = _interopDefault(__webpack_require__(34));
  6980. var zlib = _interopDefault(__webpack_require__(761));
  6981. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6982. // fix for "Readable" isn't a named export issue
  6983. const Readable = Stream.Readable;
  6984. const BUFFER = Symbol('buffer');
  6985. const TYPE = Symbol('type');
  6986. class Blob {
  6987. constructor() {
  6988. this[TYPE] = '';
  6989. const blobParts = arguments[0];
  6990. const options = arguments[1];
  6991. const buffers = [];
  6992. let size = 0;
  6993. if (blobParts) {
  6994. const a = blobParts;
  6995. const length = Number(a.length);
  6996. for (let i = 0; i < length; i++) {
  6997. const element = a[i];
  6998. let buffer;
  6999. if (element instanceof Buffer) {
  7000. buffer = element;
  7001. } else if (ArrayBuffer.isView(element)) {
  7002. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  7003. } else if (element instanceof ArrayBuffer) {
  7004. buffer = Buffer.from(element);
  7005. } else if (element instanceof Blob) {
  7006. buffer = element[BUFFER];
  7007. } else {
  7008. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  7009. }
  7010. size += buffer.length;
  7011. buffers.push(buffer);
  7012. }
  7013. }
  7014. this[BUFFER] = Buffer.concat(buffers);
  7015. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  7016. if (type && !/[^\u0020-\u007E]/.test(type)) {
  7017. this[TYPE] = type;
  7018. }
  7019. }
  7020. get size() {
  7021. return this[BUFFER].length;
  7022. }
  7023. get type() {
  7024. return this[TYPE];
  7025. }
  7026. text() {
  7027. return Promise.resolve(this[BUFFER].toString());
  7028. }
  7029. arrayBuffer() {
  7030. const buf = this[BUFFER];
  7031. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  7032. return Promise.resolve(ab);
  7033. }
  7034. stream() {
  7035. const readable = new Readable();
  7036. readable._read = function () {};
  7037. readable.push(this[BUFFER]);
  7038. readable.push(null);
  7039. return readable;
  7040. }
  7041. toString() {
  7042. return '[object Blob]';
  7043. }
  7044. slice() {
  7045. const size = this.size;
  7046. const start = arguments[0];
  7047. const end = arguments[1];
  7048. let relativeStart, relativeEnd;
  7049. if (start === undefined) {
  7050. relativeStart = 0;
  7051. } else if (start < 0) {
  7052. relativeStart = Math.max(size + start, 0);
  7053. } else {
  7054. relativeStart = Math.min(start, size);
  7055. }
  7056. if (end === undefined) {
  7057. relativeEnd = size;
  7058. } else if (end < 0) {
  7059. relativeEnd = Math.max(size + end, 0);
  7060. } else {
  7061. relativeEnd = Math.min(end, size);
  7062. }
  7063. const span = Math.max(relativeEnd - relativeStart, 0);
  7064. const buffer = this[BUFFER];
  7065. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  7066. const blob = new Blob([], { type: arguments[2] });
  7067. blob[BUFFER] = slicedBuffer;
  7068. return blob;
  7069. }
  7070. }
  7071. Object.defineProperties(Blob.prototype, {
  7072. size: { enumerable: true },
  7073. type: { enumerable: true },
  7074. slice: { enumerable: true }
  7075. });
  7076. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  7077. value: 'Blob',
  7078. writable: false,
  7079. enumerable: false,
  7080. configurable: true
  7081. });
  7082. /**
  7083. * fetch-error.js
  7084. *
  7085. * FetchError interface for operational errors
  7086. */
  7087. /**
  7088. * Create FetchError instance
  7089. *
  7090. * @param String message Error message for human
  7091. * @param String type Error type for machine
  7092. * @param String systemError For Node.js system error
  7093. * @return FetchError
  7094. */
  7095. function FetchError(message, type, systemError) {
  7096. Error.call(this, message);
  7097. this.message = message;
  7098. this.type = type;
  7099. // when err.type is `system`, err.code contains system error code
  7100. if (systemError) {
  7101. this.code = this.errno = systemError.code;
  7102. }
  7103. // hide custom error implementation details from end-users
  7104. Error.captureStackTrace(this, this.constructor);
  7105. }
  7106. FetchError.prototype = Object.create(Error.prototype);
  7107. FetchError.prototype.constructor = FetchError;
  7108. FetchError.prototype.name = 'FetchError';
  7109. let convert;
  7110. try {
  7111. convert = __webpack_require__(18).convert;
  7112. } catch (e) {}
  7113. const INTERNALS = Symbol('Body internals');
  7114. // fix an issue where "PassThrough" isn't a named export for node <10
  7115. const PassThrough = Stream.PassThrough;
  7116. /**
  7117. * Body mixin
  7118. *
  7119. * Ref: https://fetch.spec.whatwg.org/#body
  7120. *
  7121. * @param Stream body Readable stream
  7122. * @param Object opts Response options
  7123. * @return Void
  7124. */
  7125. function Body(body) {
  7126. var _this = this;
  7127. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  7128. _ref$size = _ref.size;
  7129. let size = _ref$size === undefined ? 0 : _ref$size;
  7130. var _ref$timeout = _ref.timeout;
  7131. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  7132. if (body == null) {
  7133. // body is undefined or null
  7134. body = null;
  7135. } else if (isURLSearchParams(body)) {
  7136. // body is a URLSearchParams
  7137. body = Buffer.from(body.toString());
  7138. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7139. // body is ArrayBuffer
  7140. body = Buffer.from(body);
  7141. } else if (ArrayBuffer.isView(body)) {
  7142. // body is ArrayBufferView
  7143. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  7144. } else if (body instanceof Stream) ; else {
  7145. // none of the above
  7146. // coerce to string then buffer
  7147. body = Buffer.from(String(body));
  7148. }
  7149. this[INTERNALS] = {
  7150. body,
  7151. disturbed: false,
  7152. error: null
  7153. };
  7154. this.size = size;
  7155. this.timeout = timeout;
  7156. if (body instanceof Stream) {
  7157. body.on('error', function (err) {
  7158. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  7159. _this[INTERNALS].error = error;
  7160. });
  7161. }
  7162. }
  7163. Body.prototype = {
  7164. get body() {
  7165. return this[INTERNALS].body;
  7166. },
  7167. get bodyUsed() {
  7168. return this[INTERNALS].disturbed;
  7169. },
  7170. /**
  7171. * Decode response as ArrayBuffer
  7172. *
  7173. * @return Promise
  7174. */
  7175. arrayBuffer() {
  7176. return consumeBody.call(this).then(function (buf) {
  7177. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  7178. });
  7179. },
  7180. /**
  7181. * Return raw response as Blob
  7182. *
  7183. * @return Promise
  7184. */
  7185. blob() {
  7186. let ct = this.headers && this.headers.get('content-type') || '';
  7187. return consumeBody.call(this).then(function (buf) {
  7188. return Object.assign(
  7189. // Prevent copying
  7190. new Blob([], {
  7191. type: ct.toLowerCase()
  7192. }), {
  7193. [BUFFER]: buf
  7194. });
  7195. });
  7196. },
  7197. /**
  7198. * Decode response as json
  7199. *
  7200. * @return Promise
  7201. */
  7202. json() {
  7203. var _this2 = this;
  7204. return consumeBody.call(this).then(function (buffer) {
  7205. try {
  7206. return JSON.parse(buffer.toString());
  7207. } catch (err) {
  7208. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  7209. }
  7210. });
  7211. },
  7212. /**
  7213. * Decode response as text
  7214. *
  7215. * @return Promise
  7216. */
  7217. text() {
  7218. return consumeBody.call(this).then(function (buffer) {
  7219. return buffer.toString();
  7220. });
  7221. },
  7222. /**
  7223. * Decode response as buffer (non-spec api)
  7224. *
  7225. * @return Promise
  7226. */
  7227. buffer() {
  7228. return consumeBody.call(this);
  7229. },
  7230. /**
  7231. * Decode response as text, while automatically detecting the encoding and
  7232. * trying to decode to UTF-8 (non-spec api)
  7233. *
  7234. * @return Promise
  7235. */
  7236. textConverted() {
  7237. var _this3 = this;
  7238. return consumeBody.call(this).then(function (buffer) {
  7239. return convertBody(buffer, _this3.headers);
  7240. });
  7241. }
  7242. };
  7243. // In browsers, all properties are enumerable.
  7244. Object.defineProperties(Body.prototype, {
  7245. body: { enumerable: true },
  7246. bodyUsed: { enumerable: true },
  7247. arrayBuffer: { enumerable: true },
  7248. blob: { enumerable: true },
  7249. json: { enumerable: true },
  7250. text: { enumerable: true }
  7251. });
  7252. Body.mixIn = function (proto) {
  7253. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  7254. // istanbul ignore else: future proof
  7255. if (!(name in proto)) {
  7256. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  7257. Object.defineProperty(proto, name, desc);
  7258. }
  7259. }
  7260. };
  7261. /**
  7262. * Consume and convert an entire Body to a Buffer.
  7263. *
  7264. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  7265. *
  7266. * @return Promise
  7267. */
  7268. function consumeBody() {
  7269. var _this4 = this;
  7270. if (this[INTERNALS].disturbed) {
  7271. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  7272. }
  7273. this[INTERNALS].disturbed = true;
  7274. if (this[INTERNALS].error) {
  7275. return Body.Promise.reject(this[INTERNALS].error);
  7276. }
  7277. let body = this.body;
  7278. // body is null
  7279. if (body === null) {
  7280. return Body.Promise.resolve(Buffer.alloc(0));
  7281. }
  7282. // body is blob
  7283. if (isBlob(body)) {
  7284. body = body.stream();
  7285. }
  7286. // body is buffer
  7287. if (Buffer.isBuffer(body)) {
  7288. return Body.Promise.resolve(body);
  7289. }
  7290. // istanbul ignore if: should never happen
  7291. if (!(body instanceof Stream)) {
  7292. return Body.Promise.resolve(Buffer.alloc(0));
  7293. }
  7294. // body is stream
  7295. // get ready to actually consume the body
  7296. let accum = [];
  7297. let accumBytes = 0;
  7298. let abort = false;
  7299. return new Body.Promise(function (resolve, reject) {
  7300. let resTimeout;
  7301. // allow timeout on slow response body
  7302. if (_this4.timeout) {
  7303. resTimeout = setTimeout(function () {
  7304. abort = true;
  7305. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  7306. }, _this4.timeout);
  7307. }
  7308. // handle stream errors
  7309. body.on('error', function (err) {
  7310. if (err.name === 'AbortError') {
  7311. // if the request was aborted, reject with this Error
  7312. abort = true;
  7313. reject(err);
  7314. } else {
  7315. // other errors, such as incorrect content-encoding
  7316. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  7317. }
  7318. });
  7319. body.on('data', function (chunk) {
  7320. if (abort || chunk === null) {
  7321. return;
  7322. }
  7323. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  7324. abort = true;
  7325. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  7326. return;
  7327. }
  7328. accumBytes += chunk.length;
  7329. accum.push(chunk);
  7330. });
  7331. body.on('end', function () {
  7332. if (abort) {
  7333. return;
  7334. }
  7335. clearTimeout(resTimeout);
  7336. try {
  7337. resolve(Buffer.concat(accum, accumBytes));
  7338. } catch (err) {
  7339. // handle streams that have accumulated too much data (issue #414)
  7340. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  7341. }
  7342. });
  7343. });
  7344. }
  7345. /**
  7346. * Detect buffer encoding and convert to target encoding
  7347. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  7348. *
  7349. * @param Buffer buffer Incoming buffer
  7350. * @param String encoding Target encoding
  7351. * @return String
  7352. */
  7353. function convertBody(buffer, headers) {
  7354. if (typeof convert !== 'function') {
  7355. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  7356. }
  7357. const ct = headers.get('content-type');
  7358. let charset = 'utf-8';
  7359. let res, str;
  7360. // header
  7361. if (ct) {
  7362. res = /charset=([^;]*)/i.exec(ct);
  7363. }
  7364. // no charset in content type, peek at response body for at most 1024 bytes
  7365. str = buffer.slice(0, 1024).toString();
  7366. // html5
  7367. if (!res && str) {
  7368. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  7369. }
  7370. // html4
  7371. if (!res && str) {
  7372. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  7373. if (res) {
  7374. res = /charset=(.*)/i.exec(res.pop());
  7375. }
  7376. }
  7377. // xml
  7378. if (!res && str) {
  7379. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  7380. }
  7381. // found charset
  7382. if (res) {
  7383. charset = res.pop();
  7384. // prevent decode issues when sites use incorrect encoding
  7385. // ref: https://hsivonen.fi/encoding-menu/
  7386. if (charset === 'gb2312' || charset === 'gbk') {
  7387. charset = 'gb18030';
  7388. }
  7389. }
  7390. // turn raw buffers into a single utf-8 buffer
  7391. return convert(buffer, 'UTF-8', charset).toString();
  7392. }
  7393. /**
  7394. * Detect a URLSearchParams object
  7395. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  7396. *
  7397. * @param Object obj Object to detect by type or brand
  7398. * @return String
  7399. */
  7400. function isURLSearchParams(obj) {
  7401. // Duck-typing as a necessary condition.
  7402. 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') {
  7403. return false;
  7404. }
  7405. // Brand-checking and more duck-typing as optional condition.
  7406. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  7407. }
  7408. /**
  7409. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  7410. * @param {*} obj
  7411. * @return {boolean}
  7412. */
  7413. function isBlob(obj) {
  7414. 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]);
  7415. }
  7416. /**
  7417. * Clone body given Res/Req instance
  7418. *
  7419. * @param Mixed instance Response or Request instance
  7420. * @return Mixed
  7421. */
  7422. function clone(instance) {
  7423. let p1, p2;
  7424. let body = instance.body;
  7425. // don't allow cloning a used body
  7426. if (instance.bodyUsed) {
  7427. throw new Error('cannot clone body after it is used');
  7428. }
  7429. // check that body is a stream and not form-data object
  7430. // note: we can't clone the form-data object without having it as a dependency
  7431. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  7432. // tee instance body
  7433. p1 = new PassThrough();
  7434. p2 = new PassThrough();
  7435. body.pipe(p1);
  7436. body.pipe(p2);
  7437. // set instance body to teed body and return the other teed body
  7438. instance[INTERNALS].body = p1;
  7439. body = p2;
  7440. }
  7441. return body;
  7442. }
  7443. /**
  7444. * Performs the operation "extract a `Content-Type` value from |object|" as
  7445. * specified in the specification:
  7446. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  7447. *
  7448. * This function assumes that instance.body is present.
  7449. *
  7450. * @param Mixed instance Any options.body input
  7451. */
  7452. function extractContentType(body) {
  7453. if (body === null) {
  7454. // body is null
  7455. return null;
  7456. } else if (typeof body === 'string') {
  7457. // body is string
  7458. return 'text/plain;charset=UTF-8';
  7459. } else if (isURLSearchParams(body)) {
  7460. // body is a URLSearchParams
  7461. return 'application/x-www-form-urlencoded;charset=UTF-8';
  7462. } else if (isBlob(body)) {
  7463. // body is blob
  7464. return body.type || null;
  7465. } else if (Buffer.isBuffer(body)) {
  7466. // body is buffer
  7467. return null;
  7468. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  7469. // body is ArrayBuffer
  7470. return null;
  7471. } else if (ArrayBuffer.isView(body)) {
  7472. // body is ArrayBufferView
  7473. return null;
  7474. } else if (typeof body.getBoundary === 'function') {
  7475. // detect form data input from form-data module
  7476. return `multipart/form-data;boundary=${body.getBoundary()}`;
  7477. } else if (body instanceof Stream) {
  7478. // body is stream
  7479. // can't really do much about this
  7480. return null;
  7481. } else {
  7482. // Body constructor defaults other things to string
  7483. return 'text/plain;charset=UTF-8';
  7484. }
  7485. }
  7486. /**
  7487. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7488. * For us, we have to explicitly get it with a function.
  7489. *
  7490. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7491. *
  7492. * @param Body instance Instance of Body
  7493. * @return Number? Number of bytes, or null if not possible
  7494. */
  7495. function getTotalBytes(instance) {
  7496. const body = instance.body;
  7497. if (body === null) {
  7498. // body is null
  7499. return 0;
  7500. } else if (isBlob(body)) {
  7501. return body.size;
  7502. } else if (Buffer.isBuffer(body)) {
  7503. // body is buffer
  7504. return body.length;
  7505. } else if (body && typeof body.getLengthSync === 'function') {
  7506. // detect form data input from form-data module
  7507. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7508. body.hasKnownLength && body.hasKnownLength()) {
  7509. // 2.x
  7510. return body.getLengthSync();
  7511. }
  7512. return null;
  7513. } else {
  7514. // body is stream
  7515. return null;
  7516. }
  7517. }
  7518. /**
  7519. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7520. *
  7521. * @param Body instance Instance of Body
  7522. * @return Void
  7523. */
  7524. function writeToStream(dest, instance) {
  7525. const body = instance.body;
  7526. if (body === null) {
  7527. // body is null
  7528. dest.end();
  7529. } else if (isBlob(body)) {
  7530. body.stream().pipe(dest);
  7531. } else if (Buffer.isBuffer(body)) {
  7532. // body is buffer
  7533. dest.write(body);
  7534. dest.end();
  7535. } else {
  7536. // body is stream
  7537. body.pipe(dest);
  7538. }
  7539. }
  7540. // expose Promise
  7541. Body.Promise = global.Promise;
  7542. /**
  7543. * headers.js
  7544. *
  7545. * Headers class offers convenient helpers
  7546. */
  7547. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7548. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7549. function validateName(name) {
  7550. name = `${name}`;
  7551. if (invalidTokenRegex.test(name) || name === '') {
  7552. throw new TypeError(`${name} is not a legal HTTP header name`);
  7553. }
  7554. }
  7555. function validateValue(value) {
  7556. value = `${value}`;
  7557. if (invalidHeaderCharRegex.test(value)) {
  7558. throw new TypeError(`${value} is not a legal HTTP header value`);
  7559. }
  7560. }
  7561. /**
  7562. * Find the key in the map object given a header name.
  7563. *
  7564. * Returns undefined if not found.
  7565. *
  7566. * @param String name Header name
  7567. * @return String|Undefined
  7568. */
  7569. function find(map, name) {
  7570. name = name.toLowerCase();
  7571. for (const key in map) {
  7572. if (key.toLowerCase() === name) {
  7573. return key;
  7574. }
  7575. }
  7576. return undefined;
  7577. }
  7578. const MAP = Symbol('map');
  7579. class Headers {
  7580. /**
  7581. * Headers class
  7582. *
  7583. * @param Object headers Response headers
  7584. * @return Void
  7585. */
  7586. constructor() {
  7587. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7588. this[MAP] = Object.create(null);
  7589. if (init instanceof Headers) {
  7590. const rawHeaders = init.raw();
  7591. const headerNames = Object.keys(rawHeaders);
  7592. for (const headerName of headerNames) {
  7593. for (const value of rawHeaders[headerName]) {
  7594. this.append(headerName, value);
  7595. }
  7596. }
  7597. return;
  7598. }
  7599. // We don't worry about converting prop to ByteString here as append()
  7600. // will handle it.
  7601. if (init == null) ; else if (typeof init === 'object') {
  7602. const method = init[Symbol.iterator];
  7603. if (method != null) {
  7604. if (typeof method !== 'function') {
  7605. throw new TypeError('Header pairs must be iterable');
  7606. }
  7607. // sequence<sequence<ByteString>>
  7608. // Note: per spec we have to first exhaust the lists then process them
  7609. const pairs = [];
  7610. for (const pair of init) {
  7611. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7612. throw new TypeError('Each header pair must be iterable');
  7613. }
  7614. pairs.push(Array.from(pair));
  7615. }
  7616. for (const pair of pairs) {
  7617. if (pair.length !== 2) {
  7618. throw new TypeError('Each header pair must be a name/value tuple');
  7619. }
  7620. this.append(pair[0], pair[1]);
  7621. }
  7622. } else {
  7623. // record<ByteString, ByteString>
  7624. for (const key of Object.keys(init)) {
  7625. const value = init[key];
  7626. this.append(key, value);
  7627. }
  7628. }
  7629. } else {
  7630. throw new TypeError('Provided initializer must be an object');
  7631. }
  7632. }
  7633. /**
  7634. * Return combined header value given name
  7635. *
  7636. * @param String name Header name
  7637. * @return Mixed
  7638. */
  7639. get(name) {
  7640. name = `${name}`;
  7641. validateName(name);
  7642. const key = find(this[MAP], name);
  7643. if (key === undefined) {
  7644. return null;
  7645. }
  7646. return this[MAP][key].join(', ');
  7647. }
  7648. /**
  7649. * Iterate over all headers
  7650. *
  7651. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7652. * @param Boolean thisArg `this` context for callback function
  7653. * @return Void
  7654. */
  7655. forEach(callback) {
  7656. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7657. let pairs = getHeaders(this);
  7658. let i = 0;
  7659. while (i < pairs.length) {
  7660. var _pairs$i = pairs[i];
  7661. const name = _pairs$i[0],
  7662. value = _pairs$i[1];
  7663. callback.call(thisArg, value, name, this);
  7664. pairs = getHeaders(this);
  7665. i++;
  7666. }
  7667. }
  7668. /**
  7669. * Overwrite header values given name
  7670. *
  7671. * @param String name Header name
  7672. * @param String value Header value
  7673. * @return Void
  7674. */
  7675. set(name, value) {
  7676. name = `${name}`;
  7677. value = `${value}`;
  7678. validateName(name);
  7679. validateValue(value);
  7680. const key = find(this[MAP], name);
  7681. this[MAP][key !== undefined ? key : name] = [value];
  7682. }
  7683. /**
  7684. * Append a value onto existing header
  7685. *
  7686. * @param String name Header name
  7687. * @param String value Header value
  7688. * @return Void
  7689. */
  7690. append(name, value) {
  7691. name = `${name}`;
  7692. value = `${value}`;
  7693. validateName(name);
  7694. validateValue(value);
  7695. const key = find(this[MAP], name);
  7696. if (key !== undefined) {
  7697. this[MAP][key].push(value);
  7698. } else {
  7699. this[MAP][name] = [value];
  7700. }
  7701. }
  7702. /**
  7703. * Check for header name existence
  7704. *
  7705. * @param String name Header name
  7706. * @return Boolean
  7707. */
  7708. has(name) {
  7709. name = `${name}`;
  7710. validateName(name);
  7711. return find(this[MAP], name) !== undefined;
  7712. }
  7713. /**
  7714. * Delete all header values given name
  7715. *
  7716. * @param String name Header name
  7717. * @return Void
  7718. */
  7719. delete(name) {
  7720. name = `${name}`;
  7721. validateName(name);
  7722. const key = find(this[MAP], name);
  7723. if (key !== undefined) {
  7724. delete this[MAP][key];
  7725. }
  7726. }
  7727. /**
  7728. * Return raw headers (non-spec api)
  7729. *
  7730. * @return Object
  7731. */
  7732. raw() {
  7733. return this[MAP];
  7734. }
  7735. /**
  7736. * Get an iterator on keys.
  7737. *
  7738. * @return Iterator
  7739. */
  7740. keys() {
  7741. return createHeadersIterator(this, 'key');
  7742. }
  7743. /**
  7744. * Get an iterator on values.
  7745. *
  7746. * @return Iterator
  7747. */
  7748. values() {
  7749. return createHeadersIterator(this, 'value');
  7750. }
  7751. /**
  7752. * Get an iterator on entries.
  7753. *
  7754. * This is the default iterator of the Headers object.
  7755. *
  7756. * @return Iterator
  7757. */
  7758. [Symbol.iterator]() {
  7759. return createHeadersIterator(this, 'key+value');
  7760. }
  7761. }
  7762. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7763. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7764. value: 'Headers',
  7765. writable: false,
  7766. enumerable: false,
  7767. configurable: true
  7768. });
  7769. Object.defineProperties(Headers.prototype, {
  7770. get: { enumerable: true },
  7771. forEach: { enumerable: true },
  7772. set: { enumerable: true },
  7773. append: { enumerable: true },
  7774. has: { enumerable: true },
  7775. delete: { enumerable: true },
  7776. keys: { enumerable: true },
  7777. values: { enumerable: true },
  7778. entries: { enumerable: true }
  7779. });
  7780. function getHeaders(headers) {
  7781. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7782. const keys = Object.keys(headers[MAP]).sort();
  7783. return keys.map(kind === 'key' ? function (k) {
  7784. return k.toLowerCase();
  7785. } : kind === 'value' ? function (k) {
  7786. return headers[MAP][k].join(', ');
  7787. } : function (k) {
  7788. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7789. });
  7790. }
  7791. const INTERNAL = Symbol('internal');
  7792. function createHeadersIterator(target, kind) {
  7793. const iterator = Object.create(HeadersIteratorPrototype);
  7794. iterator[INTERNAL] = {
  7795. target,
  7796. kind,
  7797. index: 0
  7798. };
  7799. return iterator;
  7800. }
  7801. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7802. next() {
  7803. // istanbul ignore if
  7804. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7805. throw new TypeError('Value of `this` is not a HeadersIterator');
  7806. }
  7807. var _INTERNAL = this[INTERNAL];
  7808. const target = _INTERNAL.target,
  7809. kind = _INTERNAL.kind,
  7810. index = _INTERNAL.index;
  7811. const values = getHeaders(target, kind);
  7812. const len = values.length;
  7813. if (index >= len) {
  7814. return {
  7815. value: undefined,
  7816. done: true
  7817. };
  7818. }
  7819. this[INTERNAL].index = index + 1;
  7820. return {
  7821. value: values[index],
  7822. done: false
  7823. };
  7824. }
  7825. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7826. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7827. value: 'HeadersIterator',
  7828. writable: false,
  7829. enumerable: false,
  7830. configurable: true
  7831. });
  7832. /**
  7833. * Export the Headers object in a form that Node.js can consume.
  7834. *
  7835. * @param Headers headers
  7836. * @return Object
  7837. */
  7838. function exportNodeCompatibleHeaders(headers) {
  7839. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7840. // http.request() only supports string as Host header. This hack makes
  7841. // specifying custom Host header possible.
  7842. const hostHeaderKey = find(headers[MAP], 'Host');
  7843. if (hostHeaderKey !== undefined) {
  7844. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7845. }
  7846. return obj;
  7847. }
  7848. /**
  7849. * Create a Headers object from an object of headers, ignoring those that do
  7850. * not conform to HTTP grammar productions.
  7851. *
  7852. * @param Object obj Object of headers
  7853. * @return Headers
  7854. */
  7855. function createHeadersLenient(obj) {
  7856. const headers = new Headers();
  7857. for (const name of Object.keys(obj)) {
  7858. if (invalidTokenRegex.test(name)) {
  7859. continue;
  7860. }
  7861. if (Array.isArray(obj[name])) {
  7862. for (const val of obj[name]) {
  7863. if (invalidHeaderCharRegex.test(val)) {
  7864. continue;
  7865. }
  7866. if (headers[MAP][name] === undefined) {
  7867. headers[MAP][name] = [val];
  7868. } else {
  7869. headers[MAP][name].push(val);
  7870. }
  7871. }
  7872. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7873. headers[MAP][name] = [obj[name]];
  7874. }
  7875. }
  7876. return headers;
  7877. }
  7878. const INTERNALS$1 = Symbol('Response internals');
  7879. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7880. const STATUS_CODES = http.STATUS_CODES;
  7881. /**
  7882. * Response class
  7883. *
  7884. * @param Stream body Readable stream
  7885. * @param Object opts Response options
  7886. * @return Void
  7887. */
  7888. class Response {
  7889. constructor() {
  7890. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7891. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7892. Body.call(this, body, opts);
  7893. const status = opts.status || 200;
  7894. const headers = new Headers(opts.headers);
  7895. if (body != null && !headers.has('Content-Type')) {
  7896. const contentType = extractContentType(body);
  7897. if (contentType) {
  7898. headers.append('Content-Type', contentType);
  7899. }
  7900. }
  7901. this[INTERNALS$1] = {
  7902. url: opts.url,
  7903. status,
  7904. statusText: opts.statusText || STATUS_CODES[status],
  7905. headers,
  7906. counter: opts.counter
  7907. };
  7908. }
  7909. get url() {
  7910. return this[INTERNALS$1].url || '';
  7911. }
  7912. get status() {
  7913. return this[INTERNALS$1].status;
  7914. }
  7915. /**
  7916. * Convenience property representing if the request ended normally
  7917. */
  7918. get ok() {
  7919. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7920. }
  7921. get redirected() {
  7922. return this[INTERNALS$1].counter > 0;
  7923. }
  7924. get statusText() {
  7925. return this[INTERNALS$1].statusText;
  7926. }
  7927. get headers() {
  7928. return this[INTERNALS$1].headers;
  7929. }
  7930. /**
  7931. * Clone this response
  7932. *
  7933. * @return Response
  7934. */
  7935. clone() {
  7936. return new Response(clone(this), {
  7937. url: this.url,
  7938. status: this.status,
  7939. statusText: this.statusText,
  7940. headers: this.headers,
  7941. ok: this.ok,
  7942. redirected: this.redirected
  7943. });
  7944. }
  7945. }
  7946. Body.mixIn(Response.prototype);
  7947. Object.defineProperties(Response.prototype, {
  7948. url: { enumerable: true },
  7949. status: { enumerable: true },
  7950. ok: { enumerable: true },
  7951. redirected: { enumerable: true },
  7952. statusText: { enumerable: true },
  7953. headers: { enumerable: true },
  7954. clone: { enumerable: true }
  7955. });
  7956. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7957. value: 'Response',
  7958. writable: false,
  7959. enumerable: false,
  7960. configurable: true
  7961. });
  7962. const INTERNALS$2 = Symbol('Request internals');
  7963. // fix an issue where "format", "parse" aren't a named export for node <10
  7964. const parse_url = Url.parse;
  7965. const format_url = Url.format;
  7966. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7967. /**
  7968. * Check if a value is an instance of Request.
  7969. *
  7970. * @param Mixed input
  7971. * @return Boolean
  7972. */
  7973. function isRequest(input) {
  7974. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7975. }
  7976. function isAbortSignal(signal) {
  7977. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7978. return !!(proto && proto.constructor.name === 'AbortSignal');
  7979. }
  7980. /**
  7981. * Request class
  7982. *
  7983. * @param Mixed input Url or Request instance
  7984. * @param Object init Custom options
  7985. * @return Void
  7986. */
  7987. class Request {
  7988. constructor(input) {
  7989. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7990. let parsedURL;
  7991. // normalize input
  7992. if (!isRequest(input)) {
  7993. if (input && input.href) {
  7994. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7995. // will fall into this branch also (since their `toString()` will return
  7996. // `href` property anyway)
  7997. parsedURL = parse_url(input.href);
  7998. } else {
  7999. // coerce input to a string before attempting to parse
  8000. parsedURL = parse_url(`${input}`);
  8001. }
  8002. input = {};
  8003. } else {
  8004. parsedURL = parse_url(input.url);
  8005. }
  8006. let method = init.method || input.method || 'GET';
  8007. method = method.toUpperCase();
  8008. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  8009. throw new TypeError('Request with GET/HEAD method cannot have body');
  8010. }
  8011. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  8012. Body.call(this, inputBody, {
  8013. timeout: init.timeout || input.timeout || 0,
  8014. size: init.size || input.size || 0
  8015. });
  8016. const headers = new Headers(init.headers || input.headers || {});
  8017. if (inputBody != null && !headers.has('Content-Type')) {
  8018. const contentType = extractContentType(inputBody);
  8019. if (contentType) {
  8020. headers.append('Content-Type', contentType);
  8021. }
  8022. }
  8023. let signal = isRequest(input) ? input.signal : null;
  8024. if ('signal' in init) signal = init.signal;
  8025. if (signal != null && !isAbortSignal(signal)) {
  8026. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  8027. }
  8028. this[INTERNALS$2] = {
  8029. method,
  8030. redirect: init.redirect || input.redirect || 'follow',
  8031. headers,
  8032. parsedURL,
  8033. signal
  8034. };
  8035. // node-fetch-only options
  8036. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  8037. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  8038. this.counter = init.counter || input.counter || 0;
  8039. this.agent = init.agent || input.agent;
  8040. }
  8041. get method() {
  8042. return this[INTERNALS$2].method;
  8043. }
  8044. get url() {
  8045. return format_url(this[INTERNALS$2].parsedURL);
  8046. }
  8047. get headers() {
  8048. return this[INTERNALS$2].headers;
  8049. }
  8050. get redirect() {
  8051. return this[INTERNALS$2].redirect;
  8052. }
  8053. get signal() {
  8054. return this[INTERNALS$2].signal;
  8055. }
  8056. /**
  8057. * Clone this request
  8058. *
  8059. * @return Request
  8060. */
  8061. clone() {
  8062. return new Request(this);
  8063. }
  8064. }
  8065. Body.mixIn(Request.prototype);
  8066. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  8067. value: 'Request',
  8068. writable: false,
  8069. enumerable: false,
  8070. configurable: true
  8071. });
  8072. Object.defineProperties(Request.prototype, {
  8073. method: { enumerable: true },
  8074. url: { enumerable: true },
  8075. headers: { enumerable: true },
  8076. redirect: { enumerable: true },
  8077. clone: { enumerable: true },
  8078. signal: { enumerable: true }
  8079. });
  8080. /**
  8081. * Convert a Request to Node.js http request options.
  8082. *
  8083. * @param Request A Request instance
  8084. * @return Object The options object to be passed to http.request
  8085. */
  8086. function getNodeRequestOptions(request) {
  8087. const parsedURL = request[INTERNALS$2].parsedURL;
  8088. const headers = new Headers(request[INTERNALS$2].headers);
  8089. // fetch step 1.3
  8090. if (!headers.has('Accept')) {
  8091. headers.set('Accept', '*/*');
  8092. }
  8093. // Basic fetch
  8094. if (!parsedURL.protocol || !parsedURL.hostname) {
  8095. throw new TypeError('Only absolute URLs are supported');
  8096. }
  8097. if (!/^https?:$/.test(parsedURL.protocol)) {
  8098. throw new TypeError('Only HTTP(S) protocols are supported');
  8099. }
  8100. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  8101. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  8102. }
  8103. // HTTP-network-or-cache fetch steps 2.4-2.7
  8104. let contentLengthValue = null;
  8105. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  8106. contentLengthValue = '0';
  8107. }
  8108. if (request.body != null) {
  8109. const totalBytes = getTotalBytes(request);
  8110. if (typeof totalBytes === 'number') {
  8111. contentLengthValue = String(totalBytes);
  8112. }
  8113. }
  8114. if (contentLengthValue) {
  8115. headers.set('Content-Length', contentLengthValue);
  8116. }
  8117. // HTTP-network-or-cache fetch step 2.11
  8118. if (!headers.has('User-Agent')) {
  8119. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  8120. }
  8121. // HTTP-network-or-cache fetch step 2.15
  8122. if (request.compress && !headers.has('Accept-Encoding')) {
  8123. headers.set('Accept-Encoding', 'gzip,deflate');
  8124. }
  8125. let agent = request.agent;
  8126. if (typeof agent === 'function') {
  8127. agent = agent(parsedURL);
  8128. }
  8129. if (!headers.has('Connection') && !agent) {
  8130. headers.set('Connection', 'close');
  8131. }
  8132. // HTTP-network fetch step 4.2
  8133. // chunked encoding is handled by Node.js
  8134. return Object.assign({}, parsedURL, {
  8135. method: request.method,
  8136. headers: exportNodeCompatibleHeaders(headers),
  8137. agent
  8138. });
  8139. }
  8140. /**
  8141. * abort-error.js
  8142. *
  8143. * AbortError interface for cancelled requests
  8144. */
  8145. /**
  8146. * Create AbortError instance
  8147. *
  8148. * @param String message Error message for human
  8149. * @return AbortError
  8150. */
  8151. function AbortError(message) {
  8152. Error.call(this, message);
  8153. this.type = 'aborted';
  8154. this.message = message;
  8155. // hide custom error implementation details from end-users
  8156. Error.captureStackTrace(this, this.constructor);
  8157. }
  8158. AbortError.prototype = Object.create(Error.prototype);
  8159. AbortError.prototype.constructor = AbortError;
  8160. AbortError.prototype.name = 'AbortError';
  8161. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  8162. const PassThrough$1 = Stream.PassThrough;
  8163. const resolve_url = Url.resolve;
  8164. /**
  8165. * Fetch function
  8166. *
  8167. * @param Mixed url Absolute url or Request instance
  8168. * @param Object opts Fetch options
  8169. * @return Promise
  8170. */
  8171. function fetch(url, opts) {
  8172. // allow custom promise
  8173. if (!fetch.Promise) {
  8174. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  8175. }
  8176. Body.Promise = fetch.Promise;
  8177. // wrap http.request into fetch
  8178. return new fetch.Promise(function (resolve, reject) {
  8179. // build request object
  8180. const request = new Request(url, opts);
  8181. const options = getNodeRequestOptions(request);
  8182. const send = (options.protocol === 'https:' ? https : http).request;
  8183. const signal = request.signal;
  8184. let response = null;
  8185. const abort = function abort() {
  8186. let error = new AbortError('The user aborted a request.');
  8187. reject(error);
  8188. if (request.body && request.body instanceof Stream.Readable) {
  8189. request.body.destroy(error);
  8190. }
  8191. if (!response || !response.body) return;
  8192. response.body.emit('error', error);
  8193. };
  8194. if (signal && signal.aborted) {
  8195. abort();
  8196. return;
  8197. }
  8198. const abortAndFinalize = function abortAndFinalize() {
  8199. abort();
  8200. finalize();
  8201. };
  8202. // send request
  8203. const req = send(options);
  8204. let reqTimeout;
  8205. if (signal) {
  8206. signal.addEventListener('abort', abortAndFinalize);
  8207. }
  8208. function finalize() {
  8209. req.abort();
  8210. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8211. clearTimeout(reqTimeout);
  8212. }
  8213. if (request.timeout) {
  8214. req.once('socket', function (socket) {
  8215. reqTimeout = setTimeout(function () {
  8216. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  8217. finalize();
  8218. }, request.timeout);
  8219. });
  8220. }
  8221. req.on('error', function (err) {
  8222. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  8223. finalize();
  8224. });
  8225. req.on('response', function (res) {
  8226. clearTimeout(reqTimeout);
  8227. const headers = createHeadersLenient(res.headers);
  8228. // HTTP fetch step 5
  8229. if (fetch.isRedirect(res.statusCode)) {
  8230. // HTTP fetch step 5.2
  8231. const location = headers.get('Location');
  8232. // HTTP fetch step 5.3
  8233. const locationURL = location === null ? null : resolve_url(request.url, location);
  8234. // HTTP fetch step 5.5
  8235. switch (request.redirect) {
  8236. case 'error':
  8237. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  8238. finalize();
  8239. return;
  8240. case 'manual':
  8241. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  8242. if (locationURL !== null) {
  8243. // handle corrupted header
  8244. try {
  8245. headers.set('Location', locationURL);
  8246. } catch (err) {
  8247. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  8248. reject(err);
  8249. }
  8250. }
  8251. break;
  8252. case 'follow':
  8253. // HTTP-redirect fetch step 2
  8254. if (locationURL === null) {
  8255. break;
  8256. }
  8257. // HTTP-redirect fetch step 5
  8258. if (request.counter >= request.follow) {
  8259. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  8260. finalize();
  8261. return;
  8262. }
  8263. // HTTP-redirect fetch step 6 (counter increment)
  8264. // Create a new Request object.
  8265. const requestOpts = {
  8266. headers: new Headers(request.headers),
  8267. follow: request.follow,
  8268. counter: request.counter + 1,
  8269. agent: request.agent,
  8270. compress: request.compress,
  8271. method: request.method,
  8272. body: request.body,
  8273. signal: request.signal,
  8274. timeout: request.timeout
  8275. };
  8276. // HTTP-redirect fetch step 9
  8277. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  8278. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  8279. finalize();
  8280. return;
  8281. }
  8282. // HTTP-redirect fetch step 11
  8283. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  8284. requestOpts.method = 'GET';
  8285. requestOpts.body = undefined;
  8286. requestOpts.headers.delete('content-length');
  8287. }
  8288. // HTTP-redirect fetch step 15
  8289. resolve(fetch(new Request(locationURL, requestOpts)));
  8290. finalize();
  8291. return;
  8292. }
  8293. }
  8294. // prepare response
  8295. res.once('end', function () {
  8296. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  8297. });
  8298. let body = res.pipe(new PassThrough$1());
  8299. const response_options = {
  8300. url: request.url,
  8301. status: res.statusCode,
  8302. statusText: res.statusMessage,
  8303. headers: headers,
  8304. size: request.size,
  8305. timeout: request.timeout,
  8306. counter: request.counter
  8307. };
  8308. // HTTP-network fetch step 12.1.1.3
  8309. const codings = headers.get('Content-Encoding');
  8310. // HTTP-network fetch step 12.1.1.4: handle content codings
  8311. // in following scenarios we ignore compression support
  8312. // 1. compression support is disabled
  8313. // 2. HEAD request
  8314. // 3. no Content-Encoding header
  8315. // 4. no content response (204)
  8316. // 5. content not modified response (304)
  8317. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  8318. response = new Response(body, response_options);
  8319. resolve(response);
  8320. return;
  8321. }
  8322. // For Node v6+
  8323. // Be less strict when decoding compressed responses, since sometimes
  8324. // servers send slightly invalid responses that are still accepted
  8325. // by common browsers.
  8326. // Always using Z_SYNC_FLUSH is what cURL does.
  8327. const zlibOptions = {
  8328. flush: zlib.Z_SYNC_FLUSH,
  8329. finishFlush: zlib.Z_SYNC_FLUSH
  8330. };
  8331. // for gzip
  8332. if (codings == 'gzip' || codings == 'x-gzip') {
  8333. body = body.pipe(zlib.createGunzip(zlibOptions));
  8334. response = new Response(body, response_options);
  8335. resolve(response);
  8336. return;
  8337. }
  8338. // for deflate
  8339. if (codings == 'deflate' || codings == 'x-deflate') {
  8340. // handle the infamous raw deflate response from old servers
  8341. // a hack for old IIS and Apache servers
  8342. const raw = res.pipe(new PassThrough$1());
  8343. raw.once('data', function (chunk) {
  8344. // see http://stackoverflow.com/questions/37519828
  8345. if ((chunk[0] & 0x0F) === 0x08) {
  8346. body = body.pipe(zlib.createInflate());
  8347. } else {
  8348. body = body.pipe(zlib.createInflateRaw());
  8349. }
  8350. response = new Response(body, response_options);
  8351. resolve(response);
  8352. });
  8353. return;
  8354. }
  8355. // for br
  8356. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  8357. body = body.pipe(zlib.createBrotliDecompress());
  8358. response = new Response(body, response_options);
  8359. resolve(response);
  8360. return;
  8361. }
  8362. // otherwise, use response as-is
  8363. response = new Response(body, response_options);
  8364. resolve(response);
  8365. });
  8366. writeToStream(req, request);
  8367. });
  8368. }
  8369. /**
  8370. * Redirect code matching
  8371. *
  8372. * @param Number code Status code
  8373. * @return Boolean
  8374. */
  8375. fetch.isRedirect = function (code) {
  8376. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  8377. };
  8378. // expose Promise
  8379. fetch.Promise = global.Promise;
  8380. module.exports = exports = fetch;
  8381. Object.defineProperty(exports, "__esModule", { value: true });
  8382. exports.default = exports;
  8383. exports.Headers = Headers;
  8384. exports.Request = Request;
  8385. exports.Response = Response;
  8386. exports.FetchError = FetchError;
  8387. /***/ }),
  8388. /***/ 462:
  8389. /***/ (function(module) {
  8390. "use strict";
  8391. // See http://www.robvanderwoude.com/escapechars.php
  8392. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  8393. function escapeCommand(arg) {
  8394. // Escape meta chars
  8395. arg = arg.replace(metaCharsRegExp, '^$1');
  8396. return arg;
  8397. }
  8398. function escapeArgument(arg, doubleEscapeMetaChars) {
  8399. // Convert to string
  8400. arg = `${arg}`;
  8401. // Algorithm below is based on https://qntm.org/cmd
  8402. // Sequence of backslashes followed by a double quote:
  8403. // double up all the backslashes and escape the double quote
  8404. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  8405. // Sequence of backslashes followed by the end of the string
  8406. // (which will become a double quote later):
  8407. // double up all the backslashes
  8408. arg = arg.replace(/(\\*)$/, '$1$1');
  8409. // All other backslashes occur literally
  8410. // Quote the whole thing:
  8411. arg = `"${arg}"`;
  8412. // Escape meta chars
  8413. arg = arg.replace(metaCharsRegExp, '^$1');
  8414. // Double escape meta chars if necessary
  8415. if (doubleEscapeMetaChars) {
  8416. arg = arg.replace(metaCharsRegExp, '^$1');
  8417. }
  8418. return arg;
  8419. }
  8420. module.exports.command = escapeCommand;
  8421. module.exports.argument = escapeArgument;
  8422. /***/ }),
  8423. /***/ 463:
  8424. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8425. "use strict";
  8426. Object.defineProperty(exports, '__esModule', { value: true });
  8427. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  8428. var deprecation = __webpack_require__(692);
  8429. var once = _interopDefault(__webpack_require__(969));
  8430. const logOnce = once(deprecation => console.warn(deprecation));
  8431. /**
  8432. * Error with extra properties to help with debugging
  8433. */
  8434. class RequestError extends Error {
  8435. constructor(message, statusCode, options) {
  8436. super(message); // Maintains proper stack trace (only available on V8)
  8437. /* istanbul ignore next */
  8438. if (Error.captureStackTrace) {
  8439. Error.captureStackTrace(this, this.constructor);
  8440. }
  8441. this.name = "HttpError";
  8442. this.status = statusCode;
  8443. Object.defineProperty(this, "code", {
  8444. get() {
  8445. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  8446. return statusCode;
  8447. }
  8448. });
  8449. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  8450. const requestCopy = Object.assign({}, options.request);
  8451. if (options.request.headers.authorization) {
  8452. requestCopy.headers = Object.assign({}, options.request.headers, {
  8453. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  8454. });
  8455. }
  8456. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  8457. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  8458. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  8459. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  8460. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  8461. this.request = requestCopy;
  8462. }
  8463. }
  8464. exports.RequestError = RequestError;
  8465. //# sourceMappingURL=index.js.map
  8466. /***/ }),
  8467. /***/ 464:
  8468. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8469. "use strict";
  8470. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  8471. if (k2 === undefined) k2 = k;
  8472. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  8473. }) : (function(o, m, k, k2) {
  8474. if (k2 === undefined) k2 = k;
  8475. o[k2] = m[k];
  8476. }));
  8477. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  8478. Object.defineProperty(o, "default", { enumerable: true, value: v });
  8479. }) : function(o, v) {
  8480. o["default"] = v;
  8481. });
  8482. var __importStar = (this && this.__importStar) || function (mod) {
  8483. if (mod && mod.__esModule) return mod;
  8484. var result = {};
  8485. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  8486. __setModuleDefault(result, mod);
  8487. return result;
  8488. };
  8489. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8490. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8491. return new (P || (P = Promise))(function (resolve, reject) {
  8492. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8493. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8494. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8495. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8496. });
  8497. };
  8498. var __importDefault = (this && this.__importDefault) || function (mod) {
  8499. return (mod && mod.__esModule) ? mod : { "default": mod };
  8500. };
  8501. Object.defineProperty(exports, "__esModule", { value: true });
  8502. exports.getDefaultBranch = exports.downloadRepository = void 0;
  8503. const assert = __importStar(__webpack_require__(357));
  8504. const core = __importStar(__webpack_require__(470));
  8505. const fs = __importStar(__webpack_require__(747));
  8506. const github = __importStar(__webpack_require__(469));
  8507. const io = __importStar(__webpack_require__(1));
  8508. const path = __importStar(__webpack_require__(622));
  8509. const retryHelper = __importStar(__webpack_require__(587));
  8510. const toolCache = __importStar(__webpack_require__(533));
  8511. const v4_1 = __importDefault(__webpack_require__(826));
  8512. const IS_WINDOWS = process.platform === 'win32';
  8513. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8514. return __awaiter(this, void 0, void 0, function* () {
  8515. // Determine the default branch
  8516. if (!ref && !commit) {
  8517. core.info('Determining the default branch');
  8518. ref = yield getDefaultBranch(authToken, owner, repo);
  8519. }
  8520. // Download the archive
  8521. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8522. core.info('Downloading the archive');
  8523. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8524. }));
  8525. // Write archive to disk
  8526. core.info('Writing archive to disk');
  8527. const uniqueId = (0, v4_1.default)();
  8528. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8529. yield fs.promises.writeFile(archivePath, archiveData);
  8530. archiveData = Buffer.from(''); // Free memory
  8531. // Extract archive
  8532. core.info('Extracting the archive');
  8533. const extractPath = path.join(repositoryPath, uniqueId);
  8534. yield io.mkdirP(extractPath);
  8535. if (IS_WINDOWS) {
  8536. yield toolCache.extractZip(archivePath, extractPath);
  8537. }
  8538. else {
  8539. yield toolCache.extractTar(archivePath, extractPath);
  8540. }
  8541. yield io.rmRF(archivePath);
  8542. // Determine the path of the repository content. The archive contains
  8543. // a top-level folder and the repository content is inside.
  8544. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8545. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8546. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8547. core.info(`Resolved version ${archiveVersion}`);
  8548. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8549. // Move the files
  8550. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8551. const sourcePath = path.join(tempRepositoryPath, fileName);
  8552. const targetPath = path.join(repositoryPath, fileName);
  8553. if (IS_WINDOWS) {
  8554. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8555. }
  8556. else {
  8557. yield io.mv(sourcePath, targetPath);
  8558. }
  8559. }
  8560. yield io.rmRF(extractPath);
  8561. });
  8562. }
  8563. exports.downloadRepository = downloadRepository;
  8564. /**
  8565. * Looks up the default branch name
  8566. */
  8567. function getDefaultBranch(authToken, owner, repo) {
  8568. return __awaiter(this, void 0, void 0, function* () {
  8569. return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8570. var _a;
  8571. core.info('Retrieving the default branch name');
  8572. const octokit = new github.GitHub(authToken);
  8573. let result;
  8574. try {
  8575. // Get the default branch from the repo info
  8576. const response = yield octokit.repos.get({ owner, repo });
  8577. result = response.data.default_branch;
  8578. assert.ok(result, 'default_branch cannot be empty');
  8579. }
  8580. catch (err) {
  8581. // Handle .wiki repo
  8582. if (((_a = err) === null || _a === void 0 ? void 0 : _a.status) === 404 &&
  8583. repo.toUpperCase().endsWith('.WIKI')) {
  8584. result = 'master';
  8585. }
  8586. // Otherwise error
  8587. else {
  8588. throw err;
  8589. }
  8590. }
  8591. // Print the default branch
  8592. core.info(`Default branch '${result}'`);
  8593. // Prefix with 'refs/heads'
  8594. if (!result.startsWith('refs/')) {
  8595. result = `refs/heads/${result}`;
  8596. }
  8597. return result;
  8598. }));
  8599. });
  8600. }
  8601. exports.getDefaultBranch = getDefaultBranch;
  8602. function downloadArchive(authToken, owner, repo, ref, commit) {
  8603. return __awaiter(this, void 0, void 0, function* () {
  8604. const octokit = new github.GitHub(authToken);
  8605. const params = {
  8606. owner: owner,
  8607. repo: repo,
  8608. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8609. ref: commit || ref
  8610. };
  8611. const response = yield octokit.repos.getArchiveLink(params);
  8612. if (response.status != 200) {
  8613. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8614. }
  8615. return Buffer.from(response.data); // response.data is ArrayBuffer
  8616. });
  8617. }
  8618. /***/ }),
  8619. /***/ 469:
  8620. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8621. "use strict";
  8622. var __importStar = (this && this.__importStar) || function (mod) {
  8623. if (mod && mod.__esModule) return mod;
  8624. var result = {};
  8625. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8626. result["default"] = mod;
  8627. return result;
  8628. };
  8629. Object.defineProperty(exports, "__esModule", { value: true });
  8630. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8631. const graphql_1 = __webpack_require__(898);
  8632. const rest_1 = __webpack_require__(0);
  8633. const Context = __importStar(__webpack_require__(262));
  8634. const httpClient = __importStar(__webpack_require__(539));
  8635. // We need this in order to extend Octokit
  8636. rest_1.Octokit.prototype = new rest_1.Octokit();
  8637. exports.context = new Context.Context();
  8638. class GitHub extends rest_1.Octokit {
  8639. constructor(token, opts) {
  8640. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8641. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8642. }
  8643. /**
  8644. * Disambiguates the constructor overload parameters
  8645. */
  8646. static disambiguate(token, opts) {
  8647. return [
  8648. typeof token === 'string' ? token : '',
  8649. typeof token === 'object' ? token : opts || {}
  8650. ];
  8651. }
  8652. static getOctokitOptions(args) {
  8653. const token = args[0];
  8654. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8655. // Base URL - GHES or Dotcom
  8656. options.baseUrl = options.baseUrl || this.getApiBaseUrl();
  8657. // Auth
  8658. const auth = GitHub.getAuthString(token, options);
  8659. if (auth) {
  8660. options.auth = auth;
  8661. }
  8662. // Proxy
  8663. const agent = GitHub.getProxyAgent(options.baseUrl, options);
  8664. if (agent) {
  8665. // Shallow clone - don't mutate the object provided by the caller
  8666. options.request = options.request ? Object.assign({}, options.request) : {};
  8667. // Set the agent
  8668. options.request.agent = agent;
  8669. }
  8670. return options;
  8671. }
  8672. static getGraphQL(args) {
  8673. const defaults = {};
  8674. defaults.baseUrl = this.getGraphQLBaseUrl();
  8675. const token = args[0];
  8676. const options = args[1];
  8677. // Authorization
  8678. const auth = this.getAuthString(token, options);
  8679. if (auth) {
  8680. defaults.headers = {
  8681. authorization: auth
  8682. };
  8683. }
  8684. // Proxy
  8685. const agent = GitHub.getProxyAgent(defaults.baseUrl, options);
  8686. if (agent) {
  8687. defaults.request = { agent };
  8688. }
  8689. return graphql_1.graphql.defaults(defaults);
  8690. }
  8691. static getAuthString(token, options) {
  8692. // Validate args
  8693. if (!token && !options.auth) {
  8694. throw new Error('Parameter token or opts.auth is required');
  8695. }
  8696. else if (token && options.auth) {
  8697. throw new Error('Parameters token and opts.auth may not both be specified');
  8698. }
  8699. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8700. }
  8701. static getProxyAgent(destinationUrl, options) {
  8702. var _a;
  8703. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8704. if (httpClient.getProxyUrl(destinationUrl)) {
  8705. const hc = new httpClient.HttpClient();
  8706. return hc.getAgent(destinationUrl);
  8707. }
  8708. }
  8709. return undefined;
  8710. }
  8711. static getApiBaseUrl() {
  8712. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  8713. }
  8714. static getGraphQLBaseUrl() {
  8715. let url = process.env['GITHUB_GRAPHQL_URL'] || 'https://api.github.com/graphql';
  8716. // Shouldn't be a trailing slash, but remove if so
  8717. if (url.endsWith('/')) {
  8718. url = url.substr(0, url.length - 1);
  8719. }
  8720. // Remove trailing "/graphql"
  8721. if (url.toUpperCase().endsWith('/GRAPHQL')) {
  8722. url = url.substr(0, url.length - '/graphql'.length);
  8723. }
  8724. return url;
  8725. }
  8726. }
  8727. exports.GitHub = GitHub;
  8728. //# sourceMappingURL=github.js.map
  8729. /***/ }),
  8730. /***/ 470:
  8731. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8732. "use strict";
  8733. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8734. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8735. return new (P || (P = Promise))(function (resolve, reject) {
  8736. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8737. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8738. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8739. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8740. });
  8741. };
  8742. var __importStar = (this && this.__importStar) || function (mod) {
  8743. if (mod && mod.__esModule) return mod;
  8744. var result = {};
  8745. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8746. result["default"] = mod;
  8747. return result;
  8748. };
  8749. Object.defineProperty(exports, "__esModule", { value: true });
  8750. const command_1 = __webpack_require__(431);
  8751. const file_command_1 = __webpack_require__(102);
  8752. const utils_1 = __webpack_require__(82);
  8753. const os = __importStar(__webpack_require__(87));
  8754. const path = __importStar(__webpack_require__(622));
  8755. /**
  8756. * The code to exit an action
  8757. */
  8758. var ExitCode;
  8759. (function (ExitCode) {
  8760. /**
  8761. * A code indicating that the action was successful
  8762. */
  8763. ExitCode[ExitCode["Success"] = 0] = "Success";
  8764. /**
  8765. * A code indicating that the action was a failure
  8766. */
  8767. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8768. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8769. //-----------------------------------------------------------------------
  8770. // Variables
  8771. //-----------------------------------------------------------------------
  8772. /**
  8773. * Sets env variable for this action and future actions in the job
  8774. * @param name the name of the variable to set
  8775. * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
  8776. */
  8777. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8778. function exportVariable(name, val) {
  8779. const convertedVal = utils_1.toCommandValue(val);
  8780. process.env[name] = convertedVal;
  8781. const filePath = process.env['GITHUB_ENV'] || '';
  8782. if (filePath) {
  8783. const delimiter = '_GitHubActionsFileCommandDelimeter_';
  8784. const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
  8785. file_command_1.issueCommand('ENV', commandValue);
  8786. }
  8787. else {
  8788. command_1.issueCommand('set-env', { name }, convertedVal);
  8789. }
  8790. }
  8791. exports.exportVariable = exportVariable;
  8792. /**
  8793. * Registers a secret which will get masked from logs
  8794. * @param secret value of the secret
  8795. */
  8796. function setSecret(secret) {
  8797. command_1.issueCommand('add-mask', {}, secret);
  8798. }
  8799. exports.setSecret = setSecret;
  8800. /**
  8801. * Prepends inputPath to the PATH (for this action and future actions)
  8802. * @param inputPath
  8803. */
  8804. function addPath(inputPath) {
  8805. const filePath = process.env['GITHUB_PATH'] || '';
  8806. if (filePath) {
  8807. file_command_1.issueCommand('PATH', inputPath);
  8808. }
  8809. else {
  8810. command_1.issueCommand('add-path', {}, inputPath);
  8811. }
  8812. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8813. }
  8814. exports.addPath = addPath;
  8815. /**
  8816. * Gets the value of an input. The value is also trimmed.
  8817. *
  8818. * @param name name of the input to get
  8819. * @param options optional. See InputOptions.
  8820. * @returns string
  8821. */
  8822. function getInput(name, options) {
  8823. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8824. if (options && options.required && !val) {
  8825. throw new Error(`Input required and not supplied: ${name}`);
  8826. }
  8827. return val.trim();
  8828. }
  8829. exports.getInput = getInput;
  8830. /**
  8831. * Sets the value of an output.
  8832. *
  8833. * @param name name of the output to set
  8834. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  8835. */
  8836. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8837. function setOutput(name, value) {
  8838. command_1.issueCommand('set-output', { name }, value);
  8839. }
  8840. exports.setOutput = setOutput;
  8841. /**
  8842. * Enables or disables the echoing of commands into stdout for the rest of the step.
  8843. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
  8844. *
  8845. */
  8846. function setCommandEcho(enabled) {
  8847. command_1.issue('echo', enabled ? 'on' : 'off');
  8848. }
  8849. exports.setCommandEcho = setCommandEcho;
  8850. //-----------------------------------------------------------------------
  8851. // Results
  8852. //-----------------------------------------------------------------------
  8853. /**
  8854. * Sets the action status to failed.
  8855. * When the action exits it will be with an exit code of 1
  8856. * @param message add error issue message
  8857. */
  8858. function setFailed(message) {
  8859. process.exitCode = ExitCode.Failure;
  8860. error(message);
  8861. }
  8862. exports.setFailed = setFailed;
  8863. //-----------------------------------------------------------------------
  8864. // Logging Commands
  8865. //-----------------------------------------------------------------------
  8866. /**
  8867. * Gets whether Actions Step Debug is on or not
  8868. */
  8869. function isDebug() {
  8870. return process.env['RUNNER_DEBUG'] === '1';
  8871. }
  8872. exports.isDebug = isDebug;
  8873. /**
  8874. * Writes debug message to user log
  8875. * @param message debug message
  8876. */
  8877. function debug(message) {
  8878. command_1.issueCommand('debug', {}, message);
  8879. }
  8880. exports.debug = debug;
  8881. /**
  8882. * Adds an error issue
  8883. * @param message error issue message. Errors will be converted to string via toString()
  8884. */
  8885. function error(message) {
  8886. command_1.issue('error', message instanceof Error ? message.toString() : message);
  8887. }
  8888. exports.error = error;
  8889. /**
  8890. * Adds an warning issue
  8891. * @param message warning issue message. Errors will be converted to string via toString()
  8892. */
  8893. function warning(message) {
  8894. command_1.issue('warning', message instanceof Error ? message.toString() : message);
  8895. }
  8896. exports.warning = warning;
  8897. /**
  8898. * Writes info to log with console.log.
  8899. * @param message info message
  8900. */
  8901. function info(message) {
  8902. process.stdout.write(message + os.EOL);
  8903. }
  8904. exports.info = info;
  8905. /**
  8906. * Begin an output group.
  8907. *
  8908. * Output until the next `groupEnd` will be foldable in this group
  8909. *
  8910. * @param name The name of the output group
  8911. */
  8912. function startGroup(name) {
  8913. command_1.issue('group', name);
  8914. }
  8915. exports.startGroup = startGroup;
  8916. /**
  8917. * End an output group.
  8918. */
  8919. function endGroup() {
  8920. command_1.issue('endgroup');
  8921. }
  8922. exports.endGroup = endGroup;
  8923. /**
  8924. * Wrap an asynchronous function call in a group.
  8925. *
  8926. * Returns the same type as the function itself.
  8927. *
  8928. * @param name The name of the group
  8929. * @param fn The function to wrap in the group
  8930. */
  8931. function group(name, fn) {
  8932. return __awaiter(this, void 0, void 0, function* () {
  8933. startGroup(name);
  8934. let result;
  8935. try {
  8936. result = yield fn();
  8937. }
  8938. finally {
  8939. endGroup();
  8940. }
  8941. return result;
  8942. });
  8943. }
  8944. exports.group = group;
  8945. //-----------------------------------------------------------------------
  8946. // Wrapper action state
  8947. //-----------------------------------------------------------------------
  8948. /**
  8949. * Saves state for current action, the state can only be retrieved by this action's post job execution.
  8950. *
  8951. * @param name name of the state to store
  8952. * @param value value to store. Non-string values will be converted to a string via JSON.stringify
  8953. */
  8954. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  8955. function saveState(name, value) {
  8956. command_1.issueCommand('save-state', { name }, value);
  8957. }
  8958. exports.saveState = saveState;
  8959. /**
  8960. * Gets the value of an state set by this action's main execution.
  8961. *
  8962. * @param name name of the state to get
  8963. * @returns string
  8964. */
  8965. function getState(name) {
  8966. return process.env[`STATE_${name}`] || '';
  8967. }
  8968. exports.getState = getState;
  8969. //# sourceMappingURL=core.js.map
  8970. /***/ }),
  8971. /***/ 471:
  8972. /***/ (function(module, __unusedexports, __webpack_require__) {
  8973. module.exports = authenticationBeforeRequest;
  8974. const btoa = __webpack_require__(675);
  8975. const uniq = __webpack_require__(126);
  8976. function authenticationBeforeRequest(state, options) {
  8977. if (!state.auth.type) {
  8978. return;
  8979. }
  8980. if (state.auth.type === "basic") {
  8981. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8982. options.headers.authorization = `Basic ${hash}`;
  8983. return;
  8984. }
  8985. if (state.auth.type === "token") {
  8986. options.headers.authorization = `token ${state.auth.token}`;
  8987. return;
  8988. }
  8989. if (state.auth.type === "app") {
  8990. options.headers.authorization = `Bearer ${state.auth.token}`;
  8991. const acceptHeaders = options.headers.accept
  8992. .split(",")
  8993. .concat("application/vnd.github.machine-man-preview+json");
  8994. options.headers.accept = uniq(acceptHeaders)
  8995. .filter(Boolean)
  8996. .join(",");
  8997. return;
  8998. }
  8999. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  9000. if (state.auth.token) {
  9001. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  9002. return;
  9003. }
  9004. const key = encodeURIComponent(state.auth.key);
  9005. const secret = encodeURIComponent(state.auth.secret);
  9006. options.url += `client_id=${key}&client_secret=${secret}`;
  9007. }
  9008. /***/ }),
  9009. /***/ 489:
  9010. /***/ (function(module, __unusedexports, __webpack_require__) {
  9011. "use strict";
  9012. const path = __webpack_require__(622);
  9013. const which = __webpack_require__(814);
  9014. const pathKey = __webpack_require__(39)();
  9015. function resolveCommandAttempt(parsed, withoutPathExt) {
  9016. const cwd = process.cwd();
  9017. const hasCustomCwd = parsed.options.cwd != null;
  9018. // If a custom `cwd` was specified, we need to change the process cwd
  9019. // because `which` will do stat calls but does not support a custom cwd
  9020. if (hasCustomCwd) {
  9021. try {
  9022. process.chdir(parsed.options.cwd);
  9023. } catch (err) {
  9024. /* Empty */
  9025. }
  9026. }
  9027. let resolved;
  9028. try {
  9029. resolved = which.sync(parsed.command, {
  9030. path: (parsed.options.env || process.env)[pathKey],
  9031. pathExt: withoutPathExt ? path.delimiter : undefined,
  9032. });
  9033. } catch (e) {
  9034. /* Empty */
  9035. } finally {
  9036. process.chdir(cwd);
  9037. }
  9038. // If we successfully resolved, ensure that an absolute path is returned
  9039. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  9040. if (resolved) {
  9041. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  9042. }
  9043. return resolved;
  9044. }
  9045. function resolveCommand(parsed) {
  9046. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  9047. }
  9048. module.exports = resolveCommand;
  9049. /***/ }),
  9050. /***/ 497:
  9051. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9052. "use strict";
  9053. Object.defineProperty(exports, '__esModule', { value: true });
  9054. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  9055. var deprecation = __webpack_require__(692);
  9056. var once = _interopDefault(__webpack_require__(969));
  9057. const logOnce = once(deprecation => console.warn(deprecation));
  9058. /**
  9059. * Error with extra properties to help with debugging
  9060. */
  9061. class RequestError extends Error {
  9062. constructor(message, statusCode, options) {
  9063. super(message); // Maintains proper stack trace (only available on V8)
  9064. /* istanbul ignore next */
  9065. if (Error.captureStackTrace) {
  9066. Error.captureStackTrace(this, this.constructor);
  9067. }
  9068. this.name = "HttpError";
  9069. this.status = statusCode;
  9070. Object.defineProperty(this, "code", {
  9071. get() {
  9072. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  9073. return statusCode;
  9074. }
  9075. });
  9076. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  9077. const requestCopy = Object.assign({}, options.request);
  9078. if (options.request.headers.authorization) {
  9079. requestCopy.headers = Object.assign({}, options.request.headers, {
  9080. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  9081. });
  9082. }
  9083. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  9084. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  9085. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  9086. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  9087. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  9088. this.request = requestCopy;
  9089. }
  9090. }
  9091. exports.RequestError = RequestError;
  9092. //# sourceMappingURL=index.js.map
  9093. /***/ }),
  9094. /***/ 510:
  9095. /***/ (function(module) {
  9096. module.exports = addHook
  9097. function addHook (state, kind, name, hook) {
  9098. var orig = hook
  9099. if (!state.registry[name]) {
  9100. state.registry[name] = []
  9101. }
  9102. if (kind === 'before') {
  9103. hook = function (method, options) {
  9104. return Promise.resolve()
  9105. .then(orig.bind(null, options))
  9106. .then(method.bind(null, options))
  9107. }
  9108. }
  9109. if (kind === 'after') {
  9110. hook = function (method, options) {
  9111. var result
  9112. return Promise.resolve()
  9113. .then(method.bind(null, options))
  9114. .then(function (result_) {
  9115. result = result_
  9116. return orig(result, options)
  9117. })
  9118. .then(function () {
  9119. return result
  9120. })
  9121. }
  9122. }
  9123. if (kind === 'error') {
  9124. hook = function (method, options) {
  9125. return Promise.resolve()
  9126. .then(method.bind(null, options))
  9127. .catch(function (error) {
  9128. return orig(error, options)
  9129. })
  9130. }
  9131. }
  9132. state.registry[name].push({
  9133. hook: hook,
  9134. orig: orig
  9135. })
  9136. }
  9137. /***/ }),
  9138. /***/ 523:
  9139. /***/ (function(module, __unusedexports, __webpack_require__) {
  9140. var register = __webpack_require__(363)
  9141. var addHook = __webpack_require__(510)
  9142. var removeHook = __webpack_require__(763)
  9143. // bind with array of arguments: https://stackoverflow.com/a/21792913
  9144. var bind = Function.bind
  9145. var bindable = bind.bind(bind)
  9146. function bindApi (hook, state, name) {
  9147. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  9148. hook.api = { remove: removeHookRef }
  9149. hook.remove = removeHookRef
  9150. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  9151. var args = name ? [state, kind, name] : [state, kind]
  9152. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  9153. })
  9154. }
  9155. function HookSingular () {
  9156. var singularHookName = 'h'
  9157. var singularHookState = {
  9158. registry: {}
  9159. }
  9160. var singularHook = register.bind(null, singularHookState, singularHookName)
  9161. bindApi(singularHook, singularHookState, singularHookName)
  9162. return singularHook
  9163. }
  9164. function HookCollection () {
  9165. var state = {
  9166. registry: {}
  9167. }
  9168. var hook = register.bind(null, state)
  9169. bindApi(hook, state)
  9170. return hook
  9171. }
  9172. var collectionHookDeprecationMessageDisplayed = false
  9173. function Hook () {
  9174. if (!collectionHookDeprecationMessageDisplayed) {
  9175. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  9176. collectionHookDeprecationMessageDisplayed = true
  9177. }
  9178. return HookCollection()
  9179. }
  9180. Hook.Singular = HookSingular.bind()
  9181. Hook.Collection = HookCollection.bind()
  9182. module.exports = Hook
  9183. // expose constructors as a named property for TypeScript
  9184. module.exports.Hook = Hook
  9185. module.exports.Singular = Hook.Singular
  9186. module.exports.Collection = Hook.Collection
  9187. /***/ }),
  9188. /***/ 528:
  9189. /***/ (function(__unusedmodule, exports) {
  9190. "use strict";
  9191. Object.defineProperty(exports, "__esModule", { value: true });
  9192. exports.escape = void 0;
  9193. function escape(value) {
  9194. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  9195. return `\\${x}`;
  9196. });
  9197. }
  9198. exports.escape = escape;
  9199. /***/ }),
  9200. /***/ 529:
  9201. /***/ (function(module, __unusedexports, __webpack_require__) {
  9202. const factory = __webpack_require__(47);
  9203. module.exports = factory();
  9204. /***/ }),
  9205. /***/ 533:
  9206. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9207. "use strict";
  9208. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9209. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9210. return new (P || (P = Promise))(function (resolve, reject) {
  9211. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9212. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9213. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9214. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9215. });
  9216. };
  9217. Object.defineProperty(exports, "__esModule", { value: true });
  9218. const core = __webpack_require__(470);
  9219. const io = __webpack_require__(1);
  9220. const fs = __webpack_require__(747);
  9221. const os = __webpack_require__(87);
  9222. const path = __webpack_require__(622);
  9223. const httpm = __webpack_require__(874);
  9224. const semver = __webpack_require__(656);
  9225. const uuidV4 = __webpack_require__(826);
  9226. const exec_1 = __webpack_require__(986);
  9227. const assert_1 = __webpack_require__(357);
  9228. class HTTPError extends Error {
  9229. constructor(httpStatusCode) {
  9230. super(`Unexpected HTTP response: ${httpStatusCode}`);
  9231. this.httpStatusCode = httpStatusCode;
  9232. Object.setPrototypeOf(this, new.target.prototype);
  9233. }
  9234. }
  9235. exports.HTTPError = HTTPError;
  9236. const IS_WINDOWS = process.platform === 'win32';
  9237. const userAgent = 'actions/tool-cache';
  9238. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  9239. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  9240. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  9241. // If directories not found, place them in common temp locations
  9242. if (!tempDirectory || !cacheRoot) {
  9243. let baseLocation;
  9244. if (IS_WINDOWS) {
  9245. // On windows use the USERPROFILE env variable
  9246. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  9247. }
  9248. else {
  9249. if (process.platform === 'darwin') {
  9250. baseLocation = '/Users';
  9251. }
  9252. else {
  9253. baseLocation = '/home';
  9254. }
  9255. }
  9256. if (!tempDirectory) {
  9257. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  9258. }
  9259. if (!cacheRoot) {
  9260. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  9261. }
  9262. }
  9263. /**
  9264. * Download a tool from an url and stream it into a file
  9265. *
  9266. * @param url url of tool to download
  9267. * @returns path to downloaded tool
  9268. */
  9269. function downloadTool(url) {
  9270. return __awaiter(this, void 0, void 0, function* () {
  9271. // Wrap in a promise so that we can resolve from within stream callbacks
  9272. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  9273. try {
  9274. const http = new httpm.HttpClient(userAgent, [], {
  9275. allowRetries: true,
  9276. maxRetries: 3
  9277. });
  9278. const destPath = path.join(tempDirectory, uuidV4());
  9279. yield io.mkdirP(tempDirectory);
  9280. core.debug(`Downloading ${url}`);
  9281. core.debug(`Downloading ${destPath}`);
  9282. if (fs.existsSync(destPath)) {
  9283. throw new Error(`Destination file path ${destPath} already exists`);
  9284. }
  9285. const response = yield http.get(url);
  9286. if (response.message.statusCode !== 200) {
  9287. const err = new HTTPError(response.message.statusCode);
  9288. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9289. throw err;
  9290. }
  9291. const file = fs.createWriteStream(destPath);
  9292. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  9293. try {
  9294. const stream = response.message.pipe(file);
  9295. stream.on('close', () => {
  9296. core.debug('download complete');
  9297. resolve(destPath);
  9298. });
  9299. }
  9300. catch (err) {
  9301. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  9302. reject(err);
  9303. }
  9304. }));
  9305. file.on('error', err => {
  9306. file.end();
  9307. reject(err);
  9308. });
  9309. }
  9310. catch (err) {
  9311. reject(err);
  9312. }
  9313. }));
  9314. });
  9315. }
  9316. exports.downloadTool = downloadTool;
  9317. /**
  9318. * Extract a .7z file
  9319. *
  9320. * @param file path to the .7z file
  9321. * @param dest destination directory. Optional.
  9322. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  9323. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  9324. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  9325. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  9326. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  9327. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  9328. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  9329. * to 7zr.exe can be pass to this function.
  9330. * @returns path to the destination directory
  9331. */
  9332. function extract7z(file, dest, _7zPath) {
  9333. return __awaiter(this, void 0, void 0, function* () {
  9334. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  9335. assert_1.ok(file, 'parameter "file" is required');
  9336. dest = dest || (yield _createExtractFolder(dest));
  9337. const originalCwd = process.cwd();
  9338. process.chdir(dest);
  9339. if (_7zPath) {
  9340. try {
  9341. const args = [
  9342. 'x',
  9343. '-bb1',
  9344. '-bd',
  9345. '-sccUTF-8',
  9346. file
  9347. ];
  9348. const options = {
  9349. silent: true
  9350. };
  9351. yield exec_1.exec(`"${_7zPath}"`, args, options);
  9352. }
  9353. finally {
  9354. process.chdir(originalCwd);
  9355. }
  9356. }
  9357. else {
  9358. const escapedScript = path
  9359. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  9360. .replace(/'/g, "''")
  9361. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9362. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9363. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9364. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  9365. const args = [
  9366. '-NoLogo',
  9367. '-Sta',
  9368. '-NoProfile',
  9369. '-NonInteractive',
  9370. '-ExecutionPolicy',
  9371. 'Unrestricted',
  9372. '-Command',
  9373. command
  9374. ];
  9375. const options = {
  9376. silent: true
  9377. };
  9378. try {
  9379. const powershellPath = yield io.which('powershell', true);
  9380. yield exec_1.exec(`"${powershellPath}"`, args, options);
  9381. }
  9382. finally {
  9383. process.chdir(originalCwd);
  9384. }
  9385. }
  9386. return dest;
  9387. });
  9388. }
  9389. exports.extract7z = extract7z;
  9390. /**
  9391. * Extract a tar
  9392. *
  9393. * @param file path to the tar
  9394. * @param dest destination directory. Optional.
  9395. * @param flags flags for the tar. Optional.
  9396. * @returns path to the destination directory
  9397. */
  9398. function extractTar(file, dest, flags = 'xz') {
  9399. return __awaiter(this, void 0, void 0, function* () {
  9400. if (!file) {
  9401. throw new Error("parameter 'file' is required");
  9402. }
  9403. dest = dest || (yield _createExtractFolder(dest));
  9404. const tarPath = yield io.which('tar', true);
  9405. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  9406. return dest;
  9407. });
  9408. }
  9409. exports.extractTar = extractTar;
  9410. /**
  9411. * Extract a zip
  9412. *
  9413. * @param file path to the zip
  9414. * @param dest destination directory. Optional.
  9415. * @returns path to the destination directory
  9416. */
  9417. function extractZip(file, dest) {
  9418. return __awaiter(this, void 0, void 0, function* () {
  9419. if (!file) {
  9420. throw new Error("parameter 'file' is required");
  9421. }
  9422. dest = dest || (yield _createExtractFolder(dest));
  9423. if (IS_WINDOWS) {
  9424. yield extractZipWin(file, dest);
  9425. }
  9426. else {
  9427. yield extractZipNix(file, dest);
  9428. }
  9429. return dest;
  9430. });
  9431. }
  9432. exports.extractZip = extractZip;
  9433. function extractZipWin(file, dest) {
  9434. return __awaiter(this, void 0, void 0, function* () {
  9435. // build the powershell command
  9436. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  9437. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  9438. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  9439. // run powershell
  9440. const powershellPath = yield io.which('powershell');
  9441. const args = [
  9442. '-NoLogo',
  9443. '-Sta',
  9444. '-NoProfile',
  9445. '-NonInteractive',
  9446. '-ExecutionPolicy',
  9447. 'Unrestricted',
  9448. '-Command',
  9449. command
  9450. ];
  9451. yield exec_1.exec(`"${powershellPath}"`, args);
  9452. });
  9453. }
  9454. function extractZipNix(file, dest) {
  9455. return __awaiter(this, void 0, void 0, function* () {
  9456. const unzipPath = yield io.which('unzip');
  9457. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  9458. });
  9459. }
  9460. /**
  9461. * Caches a directory and installs it into the tool cacheDir
  9462. *
  9463. * @param sourceDir the directory to cache into tools
  9464. * @param tool tool name
  9465. * @param version version of the tool. semver format
  9466. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9467. */
  9468. function cacheDir(sourceDir, tool, version, arch) {
  9469. return __awaiter(this, void 0, void 0, function* () {
  9470. version = semver.clean(version) || version;
  9471. arch = arch || os.arch();
  9472. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9473. core.debug(`source dir: ${sourceDir}`);
  9474. if (!fs.statSync(sourceDir).isDirectory()) {
  9475. throw new Error('sourceDir is not a directory');
  9476. }
  9477. // Create the tool dir
  9478. const destPath = yield _createToolPath(tool, version, arch);
  9479. // copy each child item. do not move. move can fail on Windows
  9480. // due to anti-virus software having an open handle on a file.
  9481. for (const itemName of fs.readdirSync(sourceDir)) {
  9482. const s = path.join(sourceDir, itemName);
  9483. yield io.cp(s, destPath, { recursive: true });
  9484. }
  9485. // write .complete
  9486. _completeToolPath(tool, version, arch);
  9487. return destPath;
  9488. });
  9489. }
  9490. exports.cacheDir = cacheDir;
  9491. /**
  9492. * Caches a downloaded file (GUID) and installs it
  9493. * into the tool cache with a given targetName
  9494. *
  9495. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  9496. * @param targetFile the name of the file name in the tools directory
  9497. * @param tool tool name
  9498. * @param version version of the tool. semver format
  9499. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  9500. */
  9501. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  9502. return __awaiter(this, void 0, void 0, function* () {
  9503. version = semver.clean(version) || version;
  9504. arch = arch || os.arch();
  9505. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  9506. core.debug(`source file: ${sourceFile}`);
  9507. if (!fs.statSync(sourceFile).isFile()) {
  9508. throw new Error('sourceFile is not a file');
  9509. }
  9510. // create the tool dir
  9511. const destFolder = yield _createToolPath(tool, version, arch);
  9512. // copy instead of move. move can fail on Windows due to
  9513. // anti-virus software having an open handle on a file.
  9514. const destPath = path.join(destFolder, targetFile);
  9515. core.debug(`destination file ${destPath}`);
  9516. yield io.cp(sourceFile, destPath);
  9517. // write .complete
  9518. _completeToolPath(tool, version, arch);
  9519. return destFolder;
  9520. });
  9521. }
  9522. exports.cacheFile = cacheFile;
  9523. /**
  9524. * Finds the path to a tool version in the local installed tool cache
  9525. *
  9526. * @param toolName name of the tool
  9527. * @param versionSpec version of the tool
  9528. * @param arch optional arch. defaults to arch of computer
  9529. */
  9530. function find(toolName, versionSpec, arch) {
  9531. if (!toolName) {
  9532. throw new Error('toolName parameter is required');
  9533. }
  9534. if (!versionSpec) {
  9535. throw new Error('versionSpec parameter is required');
  9536. }
  9537. arch = arch || os.arch();
  9538. // attempt to resolve an explicit version
  9539. if (!_isExplicitVersion(versionSpec)) {
  9540. const localVersions = findAllVersions(toolName, arch);
  9541. const match = _evaluateVersions(localVersions, versionSpec);
  9542. versionSpec = match;
  9543. }
  9544. // check for the explicit version in the cache
  9545. let toolPath = '';
  9546. if (versionSpec) {
  9547. versionSpec = semver.clean(versionSpec) || '';
  9548. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  9549. core.debug(`checking cache: ${cachePath}`);
  9550. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  9551. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  9552. toolPath = cachePath;
  9553. }
  9554. else {
  9555. core.debug('not found');
  9556. }
  9557. }
  9558. return toolPath;
  9559. }
  9560. exports.find = find;
  9561. /**
  9562. * Finds the paths to all versions of a tool that are installed in the local tool cache
  9563. *
  9564. * @param toolName name of the tool
  9565. * @param arch optional arch. defaults to arch of computer
  9566. */
  9567. function findAllVersions(toolName, arch) {
  9568. const versions = [];
  9569. arch = arch || os.arch();
  9570. const toolPath = path.join(cacheRoot, toolName);
  9571. if (fs.existsSync(toolPath)) {
  9572. const children = fs.readdirSync(toolPath);
  9573. for (const child of children) {
  9574. if (_isExplicitVersion(child)) {
  9575. const fullPath = path.join(toolPath, child, arch || '');
  9576. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  9577. versions.push(child);
  9578. }
  9579. }
  9580. }
  9581. }
  9582. return versions;
  9583. }
  9584. exports.findAllVersions = findAllVersions;
  9585. function _createExtractFolder(dest) {
  9586. return __awaiter(this, void 0, void 0, function* () {
  9587. if (!dest) {
  9588. // create a temp dir
  9589. dest = path.join(tempDirectory, uuidV4());
  9590. }
  9591. yield io.mkdirP(dest);
  9592. return dest;
  9593. });
  9594. }
  9595. function _createToolPath(tool, version, arch) {
  9596. return __awaiter(this, void 0, void 0, function* () {
  9597. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9598. core.debug(`destination ${folderPath}`);
  9599. const markerPath = `${folderPath}.complete`;
  9600. yield io.rmRF(folderPath);
  9601. yield io.rmRF(markerPath);
  9602. yield io.mkdirP(folderPath);
  9603. return folderPath;
  9604. });
  9605. }
  9606. function _completeToolPath(tool, version, arch) {
  9607. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  9608. const markerPath = `${folderPath}.complete`;
  9609. fs.writeFileSync(markerPath, '');
  9610. core.debug('finished caching tool');
  9611. }
  9612. function _isExplicitVersion(versionSpec) {
  9613. const c = semver.clean(versionSpec) || '';
  9614. core.debug(`isExplicit: ${c}`);
  9615. const valid = semver.valid(c) != null;
  9616. core.debug(`explicit? ${valid}`);
  9617. return valid;
  9618. }
  9619. function _evaluateVersions(versions, versionSpec) {
  9620. let version = '';
  9621. core.debug(`evaluating ${versions.length} versions`);
  9622. versions = versions.sort((a, b) => {
  9623. if (semver.gt(a, b)) {
  9624. return 1;
  9625. }
  9626. return -1;
  9627. });
  9628. for (let i = versions.length - 1; i >= 0; i--) {
  9629. const potential = versions[i];
  9630. const satisfied = semver.satisfies(potential, versionSpec);
  9631. if (satisfied) {
  9632. version = potential;
  9633. break;
  9634. }
  9635. }
  9636. if (version) {
  9637. core.debug(`matched: ${version}`);
  9638. }
  9639. else {
  9640. core.debug('match not found');
  9641. }
  9642. return version;
  9643. }
  9644. //# sourceMappingURL=tool-cache.js.map
  9645. /***/ }),
  9646. /***/ 536:
  9647. /***/ (function(module, __unusedexports, __webpack_require__) {
  9648. module.exports = hasFirstPage
  9649. const deprecate = __webpack_require__(370)
  9650. const getPageLinks = __webpack_require__(577)
  9651. function hasFirstPage (link) {
  9652. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9653. return getPageLinks(link).first
  9654. }
  9655. /***/ }),
  9656. /***/ 539:
  9657. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9658. "use strict";
  9659. Object.defineProperty(exports, "__esModule", { value: true });
  9660. const url = __webpack_require__(835);
  9661. const http = __webpack_require__(605);
  9662. const https = __webpack_require__(34);
  9663. const pm = __webpack_require__(950);
  9664. let tunnel;
  9665. var HttpCodes;
  9666. (function (HttpCodes) {
  9667. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9668. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9669. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9670. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9671. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9672. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9673. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9674. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9675. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9676. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9677. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9678. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9679. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9680. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9681. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9682. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9683. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9684. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9685. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9686. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9687. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9688. HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests";
  9689. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9690. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9691. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9692. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9693. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9694. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9695. var Headers;
  9696. (function (Headers) {
  9697. Headers["Accept"] = "accept";
  9698. Headers["ContentType"] = "content-type";
  9699. })(Headers = exports.Headers || (exports.Headers = {}));
  9700. var MediaTypes;
  9701. (function (MediaTypes) {
  9702. MediaTypes["ApplicationJson"] = "application/json";
  9703. })(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
  9704. /**
  9705. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9706. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9707. */
  9708. function getProxyUrl(serverUrl) {
  9709. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9710. return proxyUrl ? proxyUrl.href : '';
  9711. }
  9712. exports.getProxyUrl = getProxyUrl;
  9713. const HttpRedirectCodes = [
  9714. HttpCodes.MovedPermanently,
  9715. HttpCodes.ResourceMoved,
  9716. HttpCodes.SeeOther,
  9717. HttpCodes.TemporaryRedirect,
  9718. HttpCodes.PermanentRedirect
  9719. ];
  9720. const HttpResponseRetryCodes = [
  9721. HttpCodes.BadGateway,
  9722. HttpCodes.ServiceUnavailable,
  9723. HttpCodes.GatewayTimeout
  9724. ];
  9725. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9726. const ExponentialBackoffCeiling = 10;
  9727. const ExponentialBackoffTimeSlice = 5;
  9728. class HttpClientResponse {
  9729. constructor(message) {
  9730. this.message = message;
  9731. }
  9732. readBody() {
  9733. return new Promise(async (resolve, reject) => {
  9734. let output = Buffer.alloc(0);
  9735. this.message.on('data', (chunk) => {
  9736. output = Buffer.concat([output, chunk]);
  9737. });
  9738. this.message.on('end', () => {
  9739. resolve(output.toString());
  9740. });
  9741. });
  9742. }
  9743. }
  9744. exports.HttpClientResponse = HttpClientResponse;
  9745. function isHttps(requestUrl) {
  9746. let parsedUrl = url.parse(requestUrl);
  9747. return parsedUrl.protocol === 'https:';
  9748. }
  9749. exports.isHttps = isHttps;
  9750. class HttpClient {
  9751. constructor(userAgent, handlers, requestOptions) {
  9752. this._ignoreSslError = false;
  9753. this._allowRedirects = true;
  9754. this._allowRedirectDowngrade = false;
  9755. this._maxRedirects = 50;
  9756. this._allowRetries = false;
  9757. this._maxRetries = 1;
  9758. this._keepAlive = false;
  9759. this._disposed = false;
  9760. this.userAgent = userAgent;
  9761. this.handlers = handlers || [];
  9762. this.requestOptions = requestOptions;
  9763. if (requestOptions) {
  9764. if (requestOptions.ignoreSslError != null) {
  9765. this._ignoreSslError = requestOptions.ignoreSslError;
  9766. }
  9767. this._socketTimeout = requestOptions.socketTimeout;
  9768. if (requestOptions.allowRedirects != null) {
  9769. this._allowRedirects = requestOptions.allowRedirects;
  9770. }
  9771. if (requestOptions.allowRedirectDowngrade != null) {
  9772. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9773. }
  9774. if (requestOptions.maxRedirects != null) {
  9775. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9776. }
  9777. if (requestOptions.keepAlive != null) {
  9778. this._keepAlive = requestOptions.keepAlive;
  9779. }
  9780. if (requestOptions.allowRetries != null) {
  9781. this._allowRetries = requestOptions.allowRetries;
  9782. }
  9783. if (requestOptions.maxRetries != null) {
  9784. this._maxRetries = requestOptions.maxRetries;
  9785. }
  9786. }
  9787. }
  9788. options(requestUrl, additionalHeaders) {
  9789. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9790. }
  9791. get(requestUrl, additionalHeaders) {
  9792. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9793. }
  9794. del(requestUrl, additionalHeaders) {
  9795. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9796. }
  9797. post(requestUrl, data, additionalHeaders) {
  9798. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9799. }
  9800. patch(requestUrl, data, additionalHeaders) {
  9801. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9802. }
  9803. put(requestUrl, data, additionalHeaders) {
  9804. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9805. }
  9806. head(requestUrl, additionalHeaders) {
  9807. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9808. }
  9809. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9810. return this.request(verb, requestUrl, stream, additionalHeaders);
  9811. }
  9812. /**
  9813. * Gets a typed object from an endpoint
  9814. * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
  9815. */
  9816. async getJson(requestUrl, additionalHeaders = {}) {
  9817. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9818. let res = await this.get(requestUrl, additionalHeaders);
  9819. return this._processResponse(res, this.requestOptions);
  9820. }
  9821. async postJson(requestUrl, obj, additionalHeaders = {}) {
  9822. let data = JSON.stringify(obj, null, 2);
  9823. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9824. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9825. let res = await this.post(requestUrl, data, additionalHeaders);
  9826. return this._processResponse(res, this.requestOptions);
  9827. }
  9828. async putJson(requestUrl, obj, additionalHeaders = {}) {
  9829. let data = JSON.stringify(obj, null, 2);
  9830. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9831. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9832. let res = await this.put(requestUrl, data, additionalHeaders);
  9833. return this._processResponse(res, this.requestOptions);
  9834. }
  9835. async patchJson(requestUrl, obj, additionalHeaders = {}) {
  9836. let data = JSON.stringify(obj, null, 2);
  9837. additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
  9838. additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
  9839. let res = await this.patch(requestUrl, data, additionalHeaders);
  9840. return this._processResponse(res, this.requestOptions);
  9841. }
  9842. /**
  9843. * Makes a raw http request.
  9844. * All other methods such as get, post, patch, and request ultimately call this.
  9845. * Prefer get, del, post and patch
  9846. */
  9847. async request(verb, requestUrl, data, headers) {
  9848. if (this._disposed) {
  9849. throw new Error('Client has already been disposed.');
  9850. }
  9851. let parsedUrl = url.parse(requestUrl);
  9852. let info = this._prepareRequest(verb, parsedUrl, headers);
  9853. // Only perform retries on reads since writes may not be idempotent.
  9854. let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1
  9855. ? this._maxRetries + 1
  9856. : 1;
  9857. let numTries = 0;
  9858. let response;
  9859. while (numTries < maxTries) {
  9860. response = await this.requestRaw(info, data);
  9861. // Check if it's an authentication challenge
  9862. if (response &&
  9863. response.message &&
  9864. response.message.statusCode === HttpCodes.Unauthorized) {
  9865. let authenticationHandler;
  9866. for (let i = 0; i < this.handlers.length; i++) {
  9867. if (this.handlers[i].canHandleAuthentication(response)) {
  9868. authenticationHandler = this.handlers[i];
  9869. break;
  9870. }
  9871. }
  9872. if (authenticationHandler) {
  9873. return authenticationHandler.handleAuthentication(this, info, data);
  9874. }
  9875. else {
  9876. // We have received an unauthorized response but have no handlers to handle it.
  9877. // Let the response return to the caller.
  9878. return response;
  9879. }
  9880. }
  9881. let redirectsRemaining = this._maxRedirects;
  9882. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&
  9883. this._allowRedirects &&
  9884. redirectsRemaining > 0) {
  9885. const redirectUrl = response.message.headers['location'];
  9886. if (!redirectUrl) {
  9887. // if there's no location to redirect to, we won't
  9888. break;
  9889. }
  9890. let parsedRedirectUrl = url.parse(redirectUrl);
  9891. if (parsedUrl.protocol == 'https:' &&
  9892. parsedUrl.protocol != parsedRedirectUrl.protocol &&
  9893. !this._allowRedirectDowngrade) {
  9894. 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.');
  9895. }
  9896. // we need to finish reading the response before reassigning response
  9897. // which will leak the open socket.
  9898. await response.readBody();
  9899. // strip authorization header if redirected to a different hostname
  9900. if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {
  9901. for (let header in headers) {
  9902. // header names are case insensitive
  9903. if (header.toLowerCase() === 'authorization') {
  9904. delete headers[header];
  9905. }
  9906. }
  9907. }
  9908. // let's make the request with the new redirectUrl
  9909. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9910. response = await this.requestRaw(info, data);
  9911. redirectsRemaining--;
  9912. }
  9913. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9914. // If not a retry code, return immediately instead of retrying
  9915. return response;
  9916. }
  9917. numTries += 1;
  9918. if (numTries < maxTries) {
  9919. await response.readBody();
  9920. await this._performExponentialBackoff(numTries);
  9921. }
  9922. }
  9923. return response;
  9924. }
  9925. /**
  9926. * Needs to be called if keepAlive is set to true in request options.
  9927. */
  9928. dispose() {
  9929. if (this._agent) {
  9930. this._agent.destroy();
  9931. }
  9932. this._disposed = true;
  9933. }
  9934. /**
  9935. * Raw request.
  9936. * @param info
  9937. * @param data
  9938. */
  9939. requestRaw(info, data) {
  9940. return new Promise((resolve, reject) => {
  9941. let callbackForResult = function (err, res) {
  9942. if (err) {
  9943. reject(err);
  9944. }
  9945. resolve(res);
  9946. };
  9947. this.requestRawWithCallback(info, data, callbackForResult);
  9948. });
  9949. }
  9950. /**
  9951. * Raw request with callback.
  9952. * @param info
  9953. * @param data
  9954. * @param onResult
  9955. */
  9956. requestRawWithCallback(info, data, onResult) {
  9957. let socket;
  9958. if (typeof data === 'string') {
  9959. info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');
  9960. }
  9961. let callbackCalled = false;
  9962. let handleResult = (err, res) => {
  9963. if (!callbackCalled) {
  9964. callbackCalled = true;
  9965. onResult(err, res);
  9966. }
  9967. };
  9968. let req = info.httpModule.request(info.options, (msg) => {
  9969. let res = new HttpClientResponse(msg);
  9970. handleResult(null, res);
  9971. });
  9972. req.on('socket', sock => {
  9973. socket = sock;
  9974. });
  9975. // If we ever get disconnected, we want the socket to timeout eventually
  9976. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9977. if (socket) {
  9978. socket.end();
  9979. }
  9980. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9981. });
  9982. req.on('error', function (err) {
  9983. // err has statusCode property
  9984. // res should have headers
  9985. handleResult(err, null);
  9986. });
  9987. if (data && typeof data === 'string') {
  9988. req.write(data, 'utf8');
  9989. }
  9990. if (data && typeof data !== 'string') {
  9991. data.on('close', function () {
  9992. req.end();
  9993. });
  9994. data.pipe(req);
  9995. }
  9996. else {
  9997. req.end();
  9998. }
  9999. }
  10000. /**
  10001. * Gets an http agent. This function is useful when you need an http agent that handles
  10002. * routing through a proxy server - depending upon the url and proxy environment variables.
  10003. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  10004. */
  10005. getAgent(serverUrl) {
  10006. let parsedUrl = url.parse(serverUrl);
  10007. return this._getAgent(parsedUrl);
  10008. }
  10009. _prepareRequest(method, requestUrl, headers) {
  10010. const info = {};
  10011. info.parsedUrl = requestUrl;
  10012. const usingSsl = info.parsedUrl.protocol === 'https:';
  10013. info.httpModule = usingSsl ? https : http;
  10014. const defaultPort = usingSsl ? 443 : 80;
  10015. info.options = {};
  10016. info.options.host = info.parsedUrl.hostname;
  10017. info.options.port = info.parsedUrl.port
  10018. ? parseInt(info.parsedUrl.port)
  10019. : defaultPort;
  10020. info.options.path =
  10021. (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  10022. info.options.method = method;
  10023. info.options.headers = this._mergeHeaders(headers);
  10024. if (this.userAgent != null) {
  10025. info.options.headers['user-agent'] = this.userAgent;
  10026. }
  10027. info.options.agent = this._getAgent(info.parsedUrl);
  10028. // gives handlers an opportunity to participate
  10029. if (this.handlers) {
  10030. this.handlers.forEach(handler => {
  10031. handler.prepareRequest(info.options);
  10032. });
  10033. }
  10034. return info;
  10035. }
  10036. _mergeHeaders(headers) {
  10037. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  10038. if (this.requestOptions && this.requestOptions.headers) {
  10039. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  10040. }
  10041. return lowercaseKeys(headers || {});
  10042. }
  10043. _getExistingOrDefaultHeader(additionalHeaders, header, _default) {
  10044. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});
  10045. let clientHeader;
  10046. if (this.requestOptions && this.requestOptions.headers) {
  10047. clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
  10048. }
  10049. return additionalHeaders[header] || clientHeader || _default;
  10050. }
  10051. _getAgent(parsedUrl) {
  10052. let agent;
  10053. let proxyUrl = pm.getProxyUrl(parsedUrl);
  10054. let useProxy = proxyUrl && proxyUrl.hostname;
  10055. if (this._keepAlive && useProxy) {
  10056. agent = this._proxyAgent;
  10057. }
  10058. if (this._keepAlive && !useProxy) {
  10059. agent = this._agent;
  10060. }
  10061. // if agent is already assigned use that agent.
  10062. if (!!agent) {
  10063. return agent;
  10064. }
  10065. const usingSsl = parsedUrl.protocol === 'https:';
  10066. let maxSockets = 100;
  10067. if (!!this.requestOptions) {
  10068. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  10069. }
  10070. if (useProxy) {
  10071. // If using proxy, need tunnel
  10072. if (!tunnel) {
  10073. tunnel = __webpack_require__(335);
  10074. }
  10075. const agentOptions = {
  10076. maxSockets: maxSockets,
  10077. keepAlive: this._keepAlive,
  10078. proxy: {
  10079. proxyAuth: proxyUrl.auth,
  10080. host: proxyUrl.hostname,
  10081. port: proxyUrl.port
  10082. }
  10083. };
  10084. let tunnelAgent;
  10085. const overHttps = proxyUrl.protocol === 'https:';
  10086. if (usingSsl) {
  10087. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  10088. }
  10089. else {
  10090. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  10091. }
  10092. agent = tunnelAgent(agentOptions);
  10093. this._proxyAgent = agent;
  10094. }
  10095. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  10096. if (this._keepAlive && !agent) {
  10097. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  10098. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  10099. this._agent = agent;
  10100. }
  10101. // if not using private agent and tunnel agent isn't setup then use global agent
  10102. if (!agent) {
  10103. agent = usingSsl ? https.globalAgent : http.globalAgent;
  10104. }
  10105. if (usingSsl && this._ignoreSslError) {
  10106. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  10107. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  10108. // we have to cast it to any and change it directly
  10109. agent.options = Object.assign(agent.options || {}, {
  10110. rejectUnauthorized: false
  10111. });
  10112. }
  10113. return agent;
  10114. }
  10115. _performExponentialBackoff(retryNumber) {
  10116. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  10117. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  10118. return new Promise(resolve => setTimeout(() => resolve(), ms));
  10119. }
  10120. static dateTimeDeserializer(key, value) {
  10121. if (typeof value === 'string') {
  10122. let a = new Date(value);
  10123. if (!isNaN(a.valueOf())) {
  10124. return a;
  10125. }
  10126. }
  10127. return value;
  10128. }
  10129. async _processResponse(res, options) {
  10130. return new Promise(async (resolve, reject) => {
  10131. const statusCode = res.message.statusCode;
  10132. const response = {
  10133. statusCode: statusCode,
  10134. result: null,
  10135. headers: {}
  10136. };
  10137. // not found leads to null obj returned
  10138. if (statusCode == HttpCodes.NotFound) {
  10139. resolve(response);
  10140. }
  10141. let obj;
  10142. let contents;
  10143. // get the result from the body
  10144. try {
  10145. contents = await res.readBody();
  10146. if (contents && contents.length > 0) {
  10147. if (options && options.deserializeDates) {
  10148. obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
  10149. }
  10150. else {
  10151. obj = JSON.parse(contents);
  10152. }
  10153. response.result = obj;
  10154. }
  10155. response.headers = res.message.headers;
  10156. }
  10157. catch (err) {
  10158. // Invalid resource (contents not json); leaving result obj null
  10159. }
  10160. // note that 3xx redirects are handled by the http layer.
  10161. if (statusCode > 299) {
  10162. let msg;
  10163. // if exception/error in body, attempt to get better error
  10164. if (obj && obj.message) {
  10165. msg = obj.message;
  10166. }
  10167. else if (contents && contents.length > 0) {
  10168. // it may be the case that the exception is in the body message as string
  10169. msg = contents;
  10170. }
  10171. else {
  10172. msg = 'Failed request: (' + statusCode + ')';
  10173. }
  10174. let err = new Error(msg);
  10175. // attach statusCode and body obj (if available) to the error object
  10176. err['statusCode'] = statusCode;
  10177. if (response.result) {
  10178. err['result'] = response.result;
  10179. }
  10180. reject(err);
  10181. }
  10182. else {
  10183. resolve(response);
  10184. }
  10185. });
  10186. }
  10187. }
  10188. exports.HttpClient = HttpClient;
  10189. /***/ }),
  10190. /***/ 550:
  10191. /***/ (function(module, __unusedexports, __webpack_require__) {
  10192. module.exports = getNextPage
  10193. const getPage = __webpack_require__(265)
  10194. function getNextPage (octokit, link, headers) {
  10195. return getPage(octokit, link, 'next', headers)
  10196. }
  10197. /***/ }),
  10198. /***/ 558:
  10199. /***/ (function(module, __unusedexports, __webpack_require__) {
  10200. module.exports = hasPreviousPage
  10201. const deprecate = __webpack_require__(370)
  10202. const getPageLinks = __webpack_require__(577)
  10203. function hasPreviousPage (link) {
  10204. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  10205. return getPageLinks(link).prev
  10206. }
  10207. /***/ }),
  10208. /***/ 559:
  10209. /***/ (function(__unusedmodule, exports) {
  10210. "use strict";
  10211. Object.defineProperty(exports, "__esModule", { value: true });
  10212. exports.GitVersion = void 0;
  10213. class GitVersion {
  10214. /**
  10215. * Used for comparing the version of git and git-lfs against the minimum required version
  10216. * @param version the version string, e.g. 1.2 or 1.2.3
  10217. */
  10218. constructor(version) {
  10219. this.major = NaN;
  10220. this.minor = NaN;
  10221. this.patch = NaN;
  10222. if (version) {
  10223. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  10224. if (match) {
  10225. this.major = Number(match[1]);
  10226. this.minor = Number(match[2]);
  10227. if (match[4]) {
  10228. this.patch = Number(match[4]);
  10229. }
  10230. }
  10231. }
  10232. }
  10233. /**
  10234. * Compares the instance against a minimum required version
  10235. * @param minimum Minimum version
  10236. */
  10237. checkMinimum(minimum) {
  10238. if (!minimum.isValid()) {
  10239. throw new Error('Arg minimum is not a valid version');
  10240. }
  10241. // Major is insufficient
  10242. if (this.major < minimum.major) {
  10243. return false;
  10244. }
  10245. // Major is equal
  10246. if (this.major === minimum.major) {
  10247. // Minor is insufficient
  10248. if (this.minor < minimum.minor) {
  10249. return false;
  10250. }
  10251. // Minor is equal
  10252. if (this.minor === minimum.minor) {
  10253. // Patch is insufficient
  10254. if (this.patch && this.patch < (minimum.patch || 0)) {
  10255. return false;
  10256. }
  10257. }
  10258. }
  10259. return true;
  10260. }
  10261. /**
  10262. * Indicates whether the instance was constructed from a valid version string
  10263. */
  10264. isValid() {
  10265. return !isNaN(this.major);
  10266. }
  10267. /**
  10268. * Returns the version as a string, e.g. 1.2 or 1.2.3
  10269. */
  10270. toString() {
  10271. let result = '';
  10272. if (this.isValid()) {
  10273. result = `${this.major}.${this.minor}`;
  10274. if (!isNaN(this.patch)) {
  10275. result += `.${this.patch}`;
  10276. }
  10277. }
  10278. return result;
  10279. }
  10280. }
  10281. exports.GitVersion = GitVersion;
  10282. /***/ }),
  10283. /***/ 562:
  10284. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10285. "use strict";
  10286. Object.defineProperty(exports, '__esModule', { value: true });
  10287. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10288. var osName = _interopDefault(__webpack_require__(2));
  10289. function getUserAgent() {
  10290. try {
  10291. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10292. } catch (error) {
  10293. if (/wmic os get Caption/.test(error.message)) {
  10294. return "Windows <version undetectable>";
  10295. }
  10296. return "<environment undetectable>";
  10297. }
  10298. }
  10299. exports.getUserAgent = getUserAgent;
  10300. //# sourceMappingURL=index.js.map
  10301. /***/ }),
  10302. /***/ 563:
  10303. /***/ (function(module, __unusedexports, __webpack_require__) {
  10304. module.exports = getPreviousPage
  10305. const getPage = __webpack_require__(265)
  10306. function getPreviousPage (octokit, link, headers) {
  10307. return getPage(octokit, link, 'prev', headers)
  10308. }
  10309. /***/ }),
  10310. /***/ 568:
  10311. /***/ (function(module, __unusedexports, __webpack_require__) {
  10312. "use strict";
  10313. const path = __webpack_require__(622);
  10314. const niceTry = __webpack_require__(948);
  10315. const resolveCommand = __webpack_require__(489);
  10316. const escape = __webpack_require__(462);
  10317. const readShebang = __webpack_require__(389);
  10318. const semver = __webpack_require__(280);
  10319. const isWin = process.platform === 'win32';
  10320. const isExecutableRegExp = /\.(?:com|exe)$/i;
  10321. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  10322. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  10323. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  10324. function detectShebang(parsed) {
  10325. parsed.file = resolveCommand(parsed);
  10326. const shebang = parsed.file && readShebang(parsed.file);
  10327. if (shebang) {
  10328. parsed.args.unshift(parsed.file);
  10329. parsed.command = shebang;
  10330. return resolveCommand(parsed);
  10331. }
  10332. return parsed.file;
  10333. }
  10334. function parseNonShell(parsed) {
  10335. if (!isWin) {
  10336. return parsed;
  10337. }
  10338. // Detect & add support for shebangs
  10339. const commandFile = detectShebang(parsed);
  10340. // We don't need a shell if the command filename is an executable
  10341. const needsShell = !isExecutableRegExp.test(commandFile);
  10342. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  10343. // Note that `forceShell` is an hidden option used only in tests
  10344. if (parsed.options.forceShell || needsShell) {
  10345. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  10346. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  10347. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  10348. // we need to double escape them
  10349. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  10350. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  10351. // This is necessary otherwise it will always fail with ENOENT in those cases
  10352. parsed.command = path.normalize(parsed.command);
  10353. // Escape command & arguments
  10354. parsed.command = escape.command(parsed.command);
  10355. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  10356. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10357. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10358. parsed.command = process.env.comspec || 'cmd.exe';
  10359. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10360. }
  10361. return parsed;
  10362. }
  10363. function parseShell(parsed) {
  10364. // If node supports the shell option, there's no need to mimic its behavior
  10365. if (supportsShellOption) {
  10366. return parsed;
  10367. }
  10368. // Mimic node shell option
  10369. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  10370. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  10371. if (isWin) {
  10372. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  10373. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  10374. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  10375. } else {
  10376. if (typeof parsed.options.shell === 'string') {
  10377. parsed.command = parsed.options.shell;
  10378. } else if (process.platform === 'android') {
  10379. parsed.command = '/system/bin/sh';
  10380. } else {
  10381. parsed.command = '/bin/sh';
  10382. }
  10383. parsed.args = ['-c', shellCommand];
  10384. }
  10385. return parsed;
  10386. }
  10387. function parse(command, args, options) {
  10388. // Normalize arguments, similar to nodejs
  10389. if (args && !Array.isArray(args)) {
  10390. options = args;
  10391. args = null;
  10392. }
  10393. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  10394. options = Object.assign({}, options); // Clone object to avoid changing the original
  10395. // Build our parsed object
  10396. const parsed = {
  10397. command,
  10398. args,
  10399. options,
  10400. file: undefined,
  10401. original: {
  10402. command,
  10403. args,
  10404. },
  10405. };
  10406. // Delegate further parsing to shell or non-shell
  10407. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  10408. }
  10409. module.exports = parse;
  10410. /***/ }),
  10411. /***/ 577:
  10412. /***/ (function(module) {
  10413. module.exports = getPageLinks
  10414. function getPageLinks (link) {
  10415. link = link.link || link.headers.link || ''
  10416. const links = {}
  10417. // link format:
  10418. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  10419. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  10420. links[type] = uri
  10421. })
  10422. return links
  10423. }
  10424. /***/ }),
  10425. /***/ 587:
  10426. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10427. "use strict";
  10428. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  10429. if (k2 === undefined) k2 = k;
  10430. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  10431. }) : (function(o, m, k, k2) {
  10432. if (k2 === undefined) k2 = k;
  10433. o[k2] = m[k];
  10434. }));
  10435. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  10436. Object.defineProperty(o, "default", { enumerable: true, value: v });
  10437. }) : function(o, v) {
  10438. o["default"] = v;
  10439. });
  10440. var __importStar = (this && this.__importStar) || function (mod) {
  10441. if (mod && mod.__esModule) return mod;
  10442. var result = {};
  10443. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  10444. __setModuleDefault(result, mod);
  10445. return result;
  10446. };
  10447. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10448. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10449. return new (P || (P = Promise))(function (resolve, reject) {
  10450. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10451. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10452. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10453. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10454. });
  10455. };
  10456. Object.defineProperty(exports, "__esModule", { value: true });
  10457. exports.execute = exports.RetryHelper = void 0;
  10458. const core = __importStar(__webpack_require__(470));
  10459. const defaultMaxAttempts = 3;
  10460. const defaultMinSeconds = 10;
  10461. const defaultMaxSeconds = 20;
  10462. class RetryHelper {
  10463. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  10464. this.maxAttempts = maxAttempts;
  10465. this.minSeconds = Math.floor(minSeconds);
  10466. this.maxSeconds = Math.floor(maxSeconds);
  10467. if (this.minSeconds > this.maxSeconds) {
  10468. throw new Error('min seconds should be less than or equal to max seconds');
  10469. }
  10470. }
  10471. execute(action) {
  10472. var _a;
  10473. return __awaiter(this, void 0, void 0, function* () {
  10474. let attempt = 1;
  10475. while (attempt < this.maxAttempts) {
  10476. // Try
  10477. try {
  10478. return yield action();
  10479. }
  10480. catch (err) {
  10481. core.info((_a = err) === null || _a === void 0 ? void 0 : _a.message);
  10482. }
  10483. // Sleep
  10484. const seconds = this.getSleepAmount();
  10485. core.info(`Waiting ${seconds} seconds before trying again`);
  10486. yield this.sleep(seconds);
  10487. attempt++;
  10488. }
  10489. // Last attempt
  10490. return yield action();
  10491. });
  10492. }
  10493. getSleepAmount() {
  10494. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  10495. this.minSeconds);
  10496. }
  10497. sleep(seconds) {
  10498. return __awaiter(this, void 0, void 0, function* () {
  10499. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  10500. });
  10501. }
  10502. }
  10503. exports.RetryHelper = RetryHelper;
  10504. function execute(action) {
  10505. return __awaiter(this, void 0, void 0, function* () {
  10506. const retryHelper = new RetryHelper();
  10507. return yield retryHelper.execute(action);
  10508. });
  10509. }
  10510. exports.execute = execute;
  10511. /***/ }),
  10512. /***/ 605:
  10513. /***/ (function(module) {
  10514. module.exports = require("http");
  10515. /***/ }),
  10516. /***/ 614:
  10517. /***/ (function(module) {
  10518. module.exports = require("events");
  10519. /***/ }),
  10520. /***/ 618:
  10521. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10522. "use strict";
  10523. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  10524. if (k2 === undefined) k2 = k;
  10525. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  10526. }) : (function(o, m, k, k2) {
  10527. if (k2 === undefined) k2 = k;
  10528. o[k2] = m[k];
  10529. }));
  10530. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  10531. Object.defineProperty(o, "default", { enumerable: true, value: v });
  10532. }) : function(o, v) {
  10533. o["default"] = v;
  10534. });
  10535. var __importStar = (this && this.__importStar) || function (mod) {
  10536. if (mod && mod.__esModule) return mod;
  10537. var result = {};
  10538. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  10539. __setModuleDefault(result, mod);
  10540. return result;
  10541. };
  10542. Object.defineProperty(exports, "__esModule", { value: true });
  10543. exports.fileExistsSync = exports.existsSync = exports.directoryExistsSync = void 0;
  10544. const fs = __importStar(__webpack_require__(747));
  10545. function directoryExistsSync(path, required) {
  10546. var _a, _b, _c;
  10547. if (!path) {
  10548. throw new Error("Arg 'path' must not be empty");
  10549. }
  10550. let stats;
  10551. try {
  10552. stats = fs.statSync(path);
  10553. }
  10554. catch (error) {
  10555. if (((_a = error) === null || _a === void 0 ? void 0 : _a.code) === 'ENOENT') {
  10556. if (!required) {
  10557. return false;
  10558. }
  10559. throw new Error(`Directory '${path}' does not exist`);
  10560. }
  10561. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_c = (_b = error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : error}`);
  10562. }
  10563. if (stats.isDirectory()) {
  10564. return true;
  10565. }
  10566. else if (!required) {
  10567. return false;
  10568. }
  10569. throw new Error(`Directory '${path}' does not exist`);
  10570. }
  10571. exports.directoryExistsSync = directoryExistsSync;
  10572. function existsSync(path) {
  10573. var _a, _b, _c;
  10574. if (!path) {
  10575. throw new Error("Arg 'path' must not be empty");
  10576. }
  10577. try {
  10578. fs.statSync(path);
  10579. }
  10580. catch (error) {
  10581. if (((_a = error) === null || _a === void 0 ? void 0 : _a.code) === 'ENOENT') {
  10582. return false;
  10583. }
  10584. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_c = (_b = error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : error}`);
  10585. }
  10586. return true;
  10587. }
  10588. exports.existsSync = existsSync;
  10589. function fileExistsSync(path) {
  10590. var _a, _b, _c;
  10591. if (!path) {
  10592. throw new Error("Arg 'path' must not be empty");
  10593. }
  10594. let stats;
  10595. try {
  10596. stats = fs.statSync(path);
  10597. }
  10598. catch (error) {
  10599. if (((_a = error) === null || _a === void 0 ? void 0 : _a.code) === 'ENOENT') {
  10600. return false;
  10601. }
  10602. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${(_c = (_b = error) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : error}`);
  10603. }
  10604. if (!stats.isDirectory()) {
  10605. return true;
  10606. }
  10607. return false;
  10608. }
  10609. exports.fileExistsSync = fileExistsSync;
  10610. /***/ }),
  10611. /***/ 621:
  10612. /***/ (function(module, __unusedexports, __webpack_require__) {
  10613. "use strict";
  10614. const path = __webpack_require__(622);
  10615. const pathKey = __webpack_require__(39);
  10616. module.exports = opts => {
  10617. opts = Object.assign({
  10618. cwd: process.cwd(),
  10619. path: process.env[pathKey()]
  10620. }, opts);
  10621. let prev;
  10622. let pth = path.resolve(opts.cwd);
  10623. const ret = [];
  10624. while (prev !== pth) {
  10625. ret.push(path.join(pth, 'node_modules/.bin'));
  10626. prev = pth;
  10627. pth = path.resolve(pth, '..');
  10628. }
  10629. // ensure the running `node` binary is used
  10630. ret.push(path.dirname(process.execPath));
  10631. return ret.concat(opts.path).join(path.delimiter);
  10632. };
  10633. module.exports.env = opts => {
  10634. opts = Object.assign({
  10635. env: process.env
  10636. }, opts);
  10637. const env = Object.assign({}, opts.env);
  10638. const path = pathKey({env});
  10639. opts.path = env[path];
  10640. env[path] = module.exports(opts);
  10641. return env;
  10642. };
  10643. /***/ }),
  10644. /***/ 622:
  10645. /***/ (function(module) {
  10646. module.exports = require("path");
  10647. /***/ }),
  10648. /***/ 631:
  10649. /***/ (function(module) {
  10650. module.exports = require("net");
  10651. /***/ }),
  10652. /***/ 649:
  10653. /***/ (function(module, __unusedexports, __webpack_require__) {
  10654. module.exports = getLastPage
  10655. const getPage = __webpack_require__(265)
  10656. function getLastPage (octokit, link, headers) {
  10657. return getPage(octokit, link, 'last', headers)
  10658. }
  10659. /***/ }),
  10660. /***/ 654:
  10661. /***/ (function(module) {
  10662. // This is not the set of all possible signals.
  10663. //
  10664. // It IS, however, the set of all signals that trigger
  10665. // an exit on either Linux or BSD systems. Linux is a
  10666. // superset of the signal names supported on BSD, and
  10667. // the unknown signals just fail to register, so we can
  10668. // catch that easily enough.
  10669. //
  10670. // Don't bother with SIGKILL. It's uncatchable, which
  10671. // means that we can't fire any callbacks anyway.
  10672. //
  10673. // If a user does happen to register a handler on a non-
  10674. // fatal signal like SIGWINCH or something, and then
  10675. // exit, it'll end up firing `process.emit('exit')`, so
  10676. // the handler will be fired anyway.
  10677. //
  10678. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  10679. // artificially, inherently leave the process in a
  10680. // state from which it is not safe to try and enter JS
  10681. // listeners.
  10682. module.exports = [
  10683. 'SIGABRT',
  10684. 'SIGALRM',
  10685. 'SIGHUP',
  10686. 'SIGINT',
  10687. 'SIGTERM'
  10688. ]
  10689. if (process.platform !== 'win32') {
  10690. module.exports.push(
  10691. 'SIGVTALRM',
  10692. 'SIGXCPU',
  10693. 'SIGXFSZ',
  10694. 'SIGUSR2',
  10695. 'SIGTRAP',
  10696. 'SIGSYS',
  10697. 'SIGQUIT',
  10698. 'SIGIOT'
  10699. // should detect profiler and enable/disable accordingly.
  10700. // see #21
  10701. // 'SIGPROF'
  10702. )
  10703. }
  10704. if (process.platform === 'linux') {
  10705. module.exports.push(
  10706. 'SIGIO',
  10707. 'SIGPOLL',
  10708. 'SIGPWR',
  10709. 'SIGSTKFLT',
  10710. 'SIGUNUSED'
  10711. )
  10712. }
  10713. /***/ }),
  10714. /***/ 656:
  10715. /***/ (function(module, exports) {
  10716. exports = module.exports = SemVer
  10717. var debug
  10718. /* istanbul ignore next */
  10719. if (typeof process === 'object' &&
  10720. process.env &&
  10721. process.env.NODE_DEBUG &&
  10722. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  10723. debug = function () {
  10724. var args = Array.prototype.slice.call(arguments, 0)
  10725. args.unshift('SEMVER')
  10726. console.log.apply(console, args)
  10727. }
  10728. } else {
  10729. debug = function () {}
  10730. }
  10731. // Note: this is the semver.org version of the spec that it implements
  10732. // Not necessarily the package version of this code.
  10733. exports.SEMVER_SPEC_VERSION = '2.0.0'
  10734. var MAX_LENGTH = 256
  10735. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  10736. /* istanbul ignore next */ 9007199254740991
  10737. // Max safe segment length for coercion.
  10738. var MAX_SAFE_COMPONENT_LENGTH = 16
  10739. // The actual regexps go on exports.re
  10740. var re = exports.re = []
  10741. var src = exports.src = []
  10742. var t = exports.tokens = {}
  10743. var R = 0
  10744. function tok (n) {
  10745. t[n] = R++
  10746. }
  10747. // The following Regular Expressions can be used for tokenizing,
  10748. // validating, and parsing SemVer version strings.
  10749. // ## Numeric Identifier
  10750. // A single `0`, or a non-zero digit followed by zero or more digits.
  10751. tok('NUMERICIDENTIFIER')
  10752. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  10753. tok('NUMERICIDENTIFIERLOOSE')
  10754. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  10755. // ## Non-numeric Identifier
  10756. // Zero or more digits, followed by a letter or hyphen, and then zero or
  10757. // more letters, digits, or hyphens.
  10758. tok('NONNUMERICIDENTIFIER')
  10759. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  10760. // ## Main Version
  10761. // Three dot-separated numeric identifiers.
  10762. tok('MAINVERSION')
  10763. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10764. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10765. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10766. tok('MAINVERSIONLOOSE')
  10767. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10768. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10769. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10770. // ## Pre-release Version Identifier
  10771. // A numeric identifier, or a non-numeric identifier.
  10772. tok('PRERELEASEIDENTIFIER')
  10773. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10774. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10775. tok('PRERELEASEIDENTIFIERLOOSE')
  10776. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10777. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10778. // ## Pre-release Version
  10779. // Hyphen, followed by one or more dot-separated pre-release version
  10780. // identifiers.
  10781. tok('PRERELEASE')
  10782. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10783. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10784. tok('PRERELEASELOOSE')
  10785. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10786. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10787. // ## Build Metadata Identifier
  10788. // Any combination of digits, letters, or hyphens.
  10789. tok('BUILDIDENTIFIER')
  10790. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10791. // ## Build Metadata
  10792. // Plus sign, followed by one or more period-separated build metadata
  10793. // identifiers.
  10794. tok('BUILD')
  10795. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10796. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10797. // ## Full Version String
  10798. // A main version, followed optionally by a pre-release version and
  10799. // build metadata.
  10800. // Note that the only major, minor, patch, and pre-release sections of
  10801. // the version string are capturing groups. The build metadata is not a
  10802. // capturing group, because it should not ever be used in version
  10803. // comparison.
  10804. tok('FULL')
  10805. tok('FULLPLAIN')
  10806. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10807. src[t.PRERELEASE] + '?' +
  10808. src[t.BUILD] + '?'
  10809. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10810. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10811. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10812. // common in the npm registry.
  10813. tok('LOOSEPLAIN')
  10814. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10815. src[t.PRERELEASELOOSE] + '?' +
  10816. src[t.BUILD] + '?'
  10817. tok('LOOSE')
  10818. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10819. tok('GTLT')
  10820. src[t.GTLT] = '((?:<|>)?=?)'
  10821. // Something like "2.*" or "1.2.x".
  10822. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10823. // Only the first item is strictly required.
  10824. tok('XRANGEIDENTIFIERLOOSE')
  10825. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10826. tok('XRANGEIDENTIFIER')
  10827. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10828. tok('XRANGEPLAIN')
  10829. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10830. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10831. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10832. '(?:' + src[t.PRERELEASE] + ')?' +
  10833. src[t.BUILD] + '?' +
  10834. ')?)?'
  10835. tok('XRANGEPLAINLOOSE')
  10836. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10837. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10838. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10839. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10840. src[t.BUILD] + '?' +
  10841. ')?)?'
  10842. tok('XRANGE')
  10843. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10844. tok('XRANGELOOSE')
  10845. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10846. // Coercion.
  10847. // Extract anything that could conceivably be a part of a valid semver
  10848. tok('COERCE')
  10849. src[t.COERCE] = '(^|[^\\d])' +
  10850. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10851. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10852. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10853. '(?:$|[^\\d])'
  10854. tok('COERCERTL')
  10855. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10856. // Tilde ranges.
  10857. // Meaning is "reasonably at or greater than"
  10858. tok('LONETILDE')
  10859. src[t.LONETILDE] = '(?:~>?)'
  10860. tok('TILDETRIM')
  10861. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10862. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10863. var tildeTrimReplace = '$1~'
  10864. tok('TILDE')
  10865. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10866. tok('TILDELOOSE')
  10867. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10868. // Caret ranges.
  10869. // Meaning is "at least and backwards compatible with"
  10870. tok('LONECARET')
  10871. src[t.LONECARET] = '(?:\\^)'
  10872. tok('CARETTRIM')
  10873. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10874. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10875. var caretTrimReplace = '$1^'
  10876. tok('CARET')
  10877. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10878. tok('CARETLOOSE')
  10879. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10880. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10881. tok('COMPARATORLOOSE')
  10882. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10883. tok('COMPARATOR')
  10884. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10885. // An expression to strip any whitespace between the gtlt and the thing
  10886. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10887. tok('COMPARATORTRIM')
  10888. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10889. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10890. // this one has to use the /g flag
  10891. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10892. var comparatorTrimReplace = '$1$2$3'
  10893. // Something like `1.2.3 - 1.2.4`
  10894. // Note that these all use the loose form, because they'll be
  10895. // checked against either the strict or loose comparator form
  10896. // later.
  10897. tok('HYPHENRANGE')
  10898. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10899. '\\s+-\\s+' +
  10900. '(' + src[t.XRANGEPLAIN] + ')' +
  10901. '\\s*$'
  10902. tok('HYPHENRANGELOOSE')
  10903. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10904. '\\s+-\\s+' +
  10905. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10906. '\\s*$'
  10907. // Star ranges basically just allow anything at all.
  10908. tok('STAR')
  10909. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10910. // Compile to actual regexp objects.
  10911. // All are flag-free, unless they were created above with a flag.
  10912. for (var i = 0; i < R; i++) {
  10913. debug(i, src[i])
  10914. if (!re[i]) {
  10915. re[i] = new RegExp(src[i])
  10916. }
  10917. }
  10918. exports.parse = parse
  10919. function parse (version, options) {
  10920. if (!options || typeof options !== 'object') {
  10921. options = {
  10922. loose: !!options,
  10923. includePrerelease: false
  10924. }
  10925. }
  10926. if (version instanceof SemVer) {
  10927. return version
  10928. }
  10929. if (typeof version !== 'string') {
  10930. return null
  10931. }
  10932. if (version.length > MAX_LENGTH) {
  10933. return null
  10934. }
  10935. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10936. if (!r.test(version)) {
  10937. return null
  10938. }
  10939. try {
  10940. return new SemVer(version, options)
  10941. } catch (er) {
  10942. return null
  10943. }
  10944. }
  10945. exports.valid = valid
  10946. function valid (version, options) {
  10947. var v = parse(version, options)
  10948. return v ? v.version : null
  10949. }
  10950. exports.clean = clean
  10951. function clean (version, options) {
  10952. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10953. return s ? s.version : null
  10954. }
  10955. exports.SemVer = SemVer
  10956. function SemVer (version, options) {
  10957. if (!options || typeof options !== 'object') {
  10958. options = {
  10959. loose: !!options,
  10960. includePrerelease: false
  10961. }
  10962. }
  10963. if (version instanceof SemVer) {
  10964. if (version.loose === options.loose) {
  10965. return version
  10966. } else {
  10967. version = version.version
  10968. }
  10969. } else if (typeof version !== 'string') {
  10970. throw new TypeError('Invalid Version: ' + version)
  10971. }
  10972. if (version.length > MAX_LENGTH) {
  10973. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10974. }
  10975. if (!(this instanceof SemVer)) {
  10976. return new SemVer(version, options)
  10977. }
  10978. debug('SemVer', version, options)
  10979. this.options = options
  10980. this.loose = !!options.loose
  10981. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10982. if (!m) {
  10983. throw new TypeError('Invalid Version: ' + version)
  10984. }
  10985. this.raw = version
  10986. // these are actually numbers
  10987. this.major = +m[1]
  10988. this.minor = +m[2]
  10989. this.patch = +m[3]
  10990. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10991. throw new TypeError('Invalid major version')
  10992. }
  10993. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10994. throw new TypeError('Invalid minor version')
  10995. }
  10996. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10997. throw new TypeError('Invalid patch version')
  10998. }
  10999. // numberify any prerelease numeric ids
  11000. if (!m[4]) {
  11001. this.prerelease = []
  11002. } else {
  11003. this.prerelease = m[4].split('.').map(function (id) {
  11004. if (/^[0-9]+$/.test(id)) {
  11005. var num = +id
  11006. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  11007. return num
  11008. }
  11009. }
  11010. return id
  11011. })
  11012. }
  11013. this.build = m[5] ? m[5].split('.') : []
  11014. this.format()
  11015. }
  11016. SemVer.prototype.format = function () {
  11017. this.version = this.major + '.' + this.minor + '.' + this.patch
  11018. if (this.prerelease.length) {
  11019. this.version += '-' + this.prerelease.join('.')
  11020. }
  11021. return this.version
  11022. }
  11023. SemVer.prototype.toString = function () {
  11024. return this.version
  11025. }
  11026. SemVer.prototype.compare = function (other) {
  11027. debug('SemVer.compare', this.version, this.options, other)
  11028. if (!(other instanceof SemVer)) {
  11029. other = new SemVer(other, this.options)
  11030. }
  11031. return this.compareMain(other) || this.comparePre(other)
  11032. }
  11033. SemVer.prototype.compareMain = function (other) {
  11034. if (!(other instanceof SemVer)) {
  11035. other = new SemVer(other, this.options)
  11036. }
  11037. return compareIdentifiers(this.major, other.major) ||
  11038. compareIdentifiers(this.minor, other.minor) ||
  11039. compareIdentifiers(this.patch, other.patch)
  11040. }
  11041. SemVer.prototype.comparePre = function (other) {
  11042. if (!(other instanceof SemVer)) {
  11043. other = new SemVer(other, this.options)
  11044. }
  11045. // NOT having a prerelease is > having one
  11046. if (this.prerelease.length && !other.prerelease.length) {
  11047. return -1
  11048. } else if (!this.prerelease.length && other.prerelease.length) {
  11049. return 1
  11050. } else if (!this.prerelease.length && !other.prerelease.length) {
  11051. return 0
  11052. }
  11053. var i = 0
  11054. do {
  11055. var a = this.prerelease[i]
  11056. var b = other.prerelease[i]
  11057. debug('prerelease compare', i, a, b)
  11058. if (a === undefined && b === undefined) {
  11059. return 0
  11060. } else if (b === undefined) {
  11061. return 1
  11062. } else if (a === undefined) {
  11063. return -1
  11064. } else if (a === b) {
  11065. continue
  11066. } else {
  11067. return compareIdentifiers(a, b)
  11068. }
  11069. } while (++i)
  11070. }
  11071. SemVer.prototype.compareBuild = function (other) {
  11072. if (!(other instanceof SemVer)) {
  11073. other = new SemVer(other, this.options)
  11074. }
  11075. var i = 0
  11076. do {
  11077. var a = this.build[i]
  11078. var b = other.build[i]
  11079. debug('prerelease compare', i, a, b)
  11080. if (a === undefined && b === undefined) {
  11081. return 0
  11082. } else if (b === undefined) {
  11083. return 1
  11084. } else if (a === undefined) {
  11085. return -1
  11086. } else if (a === b) {
  11087. continue
  11088. } else {
  11089. return compareIdentifiers(a, b)
  11090. }
  11091. } while (++i)
  11092. }
  11093. // preminor will bump the version up to the next minor release, and immediately
  11094. // down to pre-release. premajor and prepatch work the same way.
  11095. SemVer.prototype.inc = function (release, identifier) {
  11096. switch (release) {
  11097. case 'premajor':
  11098. this.prerelease.length = 0
  11099. this.patch = 0
  11100. this.minor = 0
  11101. this.major++
  11102. this.inc('pre', identifier)
  11103. break
  11104. case 'preminor':
  11105. this.prerelease.length = 0
  11106. this.patch = 0
  11107. this.minor++
  11108. this.inc('pre', identifier)
  11109. break
  11110. case 'prepatch':
  11111. // If this is already a prerelease, it will bump to the next version
  11112. // drop any prereleases that might already exist, since they are not
  11113. // relevant at this point.
  11114. this.prerelease.length = 0
  11115. this.inc('patch', identifier)
  11116. this.inc('pre', identifier)
  11117. break
  11118. // If the input is a non-prerelease version, this acts the same as
  11119. // prepatch.
  11120. case 'prerelease':
  11121. if (this.prerelease.length === 0) {
  11122. this.inc('patch', identifier)
  11123. }
  11124. this.inc('pre', identifier)
  11125. break
  11126. case 'major':
  11127. // If this is a pre-major version, bump up to the same major version.
  11128. // Otherwise increment major.
  11129. // 1.0.0-5 bumps to 1.0.0
  11130. // 1.1.0 bumps to 2.0.0
  11131. if (this.minor !== 0 ||
  11132. this.patch !== 0 ||
  11133. this.prerelease.length === 0) {
  11134. this.major++
  11135. }
  11136. this.minor = 0
  11137. this.patch = 0
  11138. this.prerelease = []
  11139. break
  11140. case 'minor':
  11141. // If this is a pre-minor version, bump up to the same minor version.
  11142. // Otherwise increment minor.
  11143. // 1.2.0-5 bumps to 1.2.0
  11144. // 1.2.1 bumps to 1.3.0
  11145. if (this.patch !== 0 || this.prerelease.length === 0) {
  11146. this.minor++
  11147. }
  11148. this.patch = 0
  11149. this.prerelease = []
  11150. break
  11151. case 'patch':
  11152. // If this is not a pre-release version, it will increment the patch.
  11153. // If it is a pre-release it will bump up to the same patch version.
  11154. // 1.2.0-5 patches to 1.2.0
  11155. // 1.2.0 patches to 1.2.1
  11156. if (this.prerelease.length === 0) {
  11157. this.patch++
  11158. }
  11159. this.prerelease = []
  11160. break
  11161. // This probably shouldn't be used publicly.
  11162. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  11163. case 'pre':
  11164. if (this.prerelease.length === 0) {
  11165. this.prerelease = [0]
  11166. } else {
  11167. var i = this.prerelease.length
  11168. while (--i >= 0) {
  11169. if (typeof this.prerelease[i] === 'number') {
  11170. this.prerelease[i]++
  11171. i = -2
  11172. }
  11173. }
  11174. if (i === -1) {
  11175. // didn't increment anything
  11176. this.prerelease.push(0)
  11177. }
  11178. }
  11179. if (identifier) {
  11180. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  11181. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  11182. if (this.prerelease[0] === identifier) {
  11183. if (isNaN(this.prerelease[1])) {
  11184. this.prerelease = [identifier, 0]
  11185. }
  11186. } else {
  11187. this.prerelease = [identifier, 0]
  11188. }
  11189. }
  11190. break
  11191. default:
  11192. throw new Error('invalid increment argument: ' + release)
  11193. }
  11194. this.format()
  11195. this.raw = this.version
  11196. return this
  11197. }
  11198. exports.inc = inc
  11199. function inc (version, release, loose, identifier) {
  11200. if (typeof (loose) === 'string') {
  11201. identifier = loose
  11202. loose = undefined
  11203. }
  11204. try {
  11205. return new SemVer(version, loose).inc(release, identifier).version
  11206. } catch (er) {
  11207. return null
  11208. }
  11209. }
  11210. exports.diff = diff
  11211. function diff (version1, version2) {
  11212. if (eq(version1, version2)) {
  11213. return null
  11214. } else {
  11215. var v1 = parse(version1)
  11216. var v2 = parse(version2)
  11217. var prefix = ''
  11218. if (v1.prerelease.length || v2.prerelease.length) {
  11219. prefix = 'pre'
  11220. var defaultResult = 'prerelease'
  11221. }
  11222. for (var key in v1) {
  11223. if (key === 'major' || key === 'minor' || key === 'patch') {
  11224. if (v1[key] !== v2[key]) {
  11225. return prefix + key
  11226. }
  11227. }
  11228. }
  11229. return defaultResult // may be undefined
  11230. }
  11231. }
  11232. exports.compareIdentifiers = compareIdentifiers
  11233. var numeric = /^[0-9]+$/
  11234. function compareIdentifiers (a, b) {
  11235. var anum = numeric.test(a)
  11236. var bnum = numeric.test(b)
  11237. if (anum && bnum) {
  11238. a = +a
  11239. b = +b
  11240. }
  11241. return a === b ? 0
  11242. : (anum && !bnum) ? -1
  11243. : (bnum && !anum) ? 1
  11244. : a < b ? -1
  11245. : 1
  11246. }
  11247. exports.rcompareIdentifiers = rcompareIdentifiers
  11248. function rcompareIdentifiers (a, b) {
  11249. return compareIdentifiers(b, a)
  11250. }
  11251. exports.major = major
  11252. function major (a, loose) {
  11253. return new SemVer(a, loose).major
  11254. }
  11255. exports.minor = minor
  11256. function minor (a, loose) {
  11257. return new SemVer(a, loose).minor
  11258. }
  11259. exports.patch = patch
  11260. function patch (a, loose) {
  11261. return new SemVer(a, loose).patch
  11262. }
  11263. exports.compare = compare
  11264. function compare (a, b, loose) {
  11265. return new SemVer(a, loose).compare(new SemVer(b, loose))
  11266. }
  11267. exports.compareLoose = compareLoose
  11268. function compareLoose (a, b) {
  11269. return compare(a, b, true)
  11270. }
  11271. exports.compareBuild = compareBuild
  11272. function compareBuild (a, b, loose) {
  11273. var versionA = new SemVer(a, loose)
  11274. var versionB = new SemVer(b, loose)
  11275. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  11276. }
  11277. exports.rcompare = rcompare
  11278. function rcompare (a, b, loose) {
  11279. return compare(b, a, loose)
  11280. }
  11281. exports.sort = sort
  11282. function sort (list, loose) {
  11283. return list.sort(function (a, b) {
  11284. return exports.compareBuild(a, b, loose)
  11285. })
  11286. }
  11287. exports.rsort = rsort
  11288. function rsort (list, loose) {
  11289. return list.sort(function (a, b) {
  11290. return exports.compareBuild(b, a, loose)
  11291. })
  11292. }
  11293. exports.gt = gt
  11294. function gt (a, b, loose) {
  11295. return compare(a, b, loose) > 0
  11296. }
  11297. exports.lt = lt
  11298. function lt (a, b, loose) {
  11299. return compare(a, b, loose) < 0
  11300. }
  11301. exports.eq = eq
  11302. function eq (a, b, loose) {
  11303. return compare(a, b, loose) === 0
  11304. }
  11305. exports.neq = neq
  11306. function neq (a, b, loose) {
  11307. return compare(a, b, loose) !== 0
  11308. }
  11309. exports.gte = gte
  11310. function gte (a, b, loose) {
  11311. return compare(a, b, loose) >= 0
  11312. }
  11313. exports.lte = lte
  11314. function lte (a, b, loose) {
  11315. return compare(a, b, loose) <= 0
  11316. }
  11317. exports.cmp = cmp
  11318. function cmp (a, op, b, loose) {
  11319. switch (op) {
  11320. case '===':
  11321. if (typeof a === 'object')
  11322. a = a.version
  11323. if (typeof b === 'object')
  11324. b = b.version
  11325. return a === b
  11326. case '!==':
  11327. if (typeof a === 'object')
  11328. a = a.version
  11329. if (typeof b === 'object')
  11330. b = b.version
  11331. return a !== b
  11332. case '':
  11333. case '=':
  11334. case '==':
  11335. return eq(a, b, loose)
  11336. case '!=':
  11337. return neq(a, b, loose)
  11338. case '>':
  11339. return gt(a, b, loose)
  11340. case '>=':
  11341. return gte(a, b, loose)
  11342. case '<':
  11343. return lt(a, b, loose)
  11344. case '<=':
  11345. return lte(a, b, loose)
  11346. default:
  11347. throw new TypeError('Invalid operator: ' + op)
  11348. }
  11349. }
  11350. exports.Comparator = Comparator
  11351. function Comparator (comp, options) {
  11352. if (!options || typeof options !== 'object') {
  11353. options = {
  11354. loose: !!options,
  11355. includePrerelease: false
  11356. }
  11357. }
  11358. if (comp instanceof Comparator) {
  11359. if (comp.loose === !!options.loose) {
  11360. return comp
  11361. } else {
  11362. comp = comp.value
  11363. }
  11364. }
  11365. if (!(this instanceof Comparator)) {
  11366. return new Comparator(comp, options)
  11367. }
  11368. debug('comparator', comp, options)
  11369. this.options = options
  11370. this.loose = !!options.loose
  11371. this.parse(comp)
  11372. if (this.semver === ANY) {
  11373. this.value = ''
  11374. } else {
  11375. this.value = this.operator + this.semver.version
  11376. }
  11377. debug('comp', this)
  11378. }
  11379. var ANY = {}
  11380. Comparator.prototype.parse = function (comp) {
  11381. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11382. var m = comp.match(r)
  11383. if (!m) {
  11384. throw new TypeError('Invalid comparator: ' + comp)
  11385. }
  11386. this.operator = m[1] !== undefined ? m[1] : ''
  11387. if (this.operator === '=') {
  11388. this.operator = ''
  11389. }
  11390. // if it literally is just '>' or '' then allow anything.
  11391. if (!m[2]) {
  11392. this.semver = ANY
  11393. } else {
  11394. this.semver = new SemVer(m[2], this.options.loose)
  11395. }
  11396. }
  11397. Comparator.prototype.toString = function () {
  11398. return this.value
  11399. }
  11400. Comparator.prototype.test = function (version) {
  11401. debug('Comparator.test', version, this.options.loose)
  11402. if (this.semver === ANY || version === ANY) {
  11403. return true
  11404. }
  11405. if (typeof version === 'string') {
  11406. try {
  11407. version = new SemVer(version, this.options)
  11408. } catch (er) {
  11409. return false
  11410. }
  11411. }
  11412. return cmp(version, this.operator, this.semver, this.options)
  11413. }
  11414. Comparator.prototype.intersects = function (comp, options) {
  11415. if (!(comp instanceof Comparator)) {
  11416. throw new TypeError('a Comparator is required')
  11417. }
  11418. if (!options || typeof options !== 'object') {
  11419. options = {
  11420. loose: !!options,
  11421. includePrerelease: false
  11422. }
  11423. }
  11424. var rangeTmp
  11425. if (this.operator === '') {
  11426. if (this.value === '') {
  11427. return true
  11428. }
  11429. rangeTmp = new Range(comp.value, options)
  11430. return satisfies(this.value, rangeTmp, options)
  11431. } else if (comp.operator === '') {
  11432. if (comp.value === '') {
  11433. return true
  11434. }
  11435. rangeTmp = new Range(this.value, options)
  11436. return satisfies(comp.semver, rangeTmp, options)
  11437. }
  11438. var sameDirectionIncreasing =
  11439. (this.operator === '>=' || this.operator === '>') &&
  11440. (comp.operator === '>=' || comp.operator === '>')
  11441. var sameDirectionDecreasing =
  11442. (this.operator === '<=' || this.operator === '<') &&
  11443. (comp.operator === '<=' || comp.operator === '<')
  11444. var sameSemVer = this.semver.version === comp.semver.version
  11445. var differentDirectionsInclusive =
  11446. (this.operator === '>=' || this.operator === '<=') &&
  11447. (comp.operator === '>=' || comp.operator === '<=')
  11448. var oppositeDirectionsLessThan =
  11449. cmp(this.semver, '<', comp.semver, options) &&
  11450. ((this.operator === '>=' || this.operator === '>') &&
  11451. (comp.operator === '<=' || comp.operator === '<'))
  11452. var oppositeDirectionsGreaterThan =
  11453. cmp(this.semver, '>', comp.semver, options) &&
  11454. ((this.operator === '<=' || this.operator === '<') &&
  11455. (comp.operator === '>=' || comp.operator === '>'))
  11456. return sameDirectionIncreasing || sameDirectionDecreasing ||
  11457. (sameSemVer && differentDirectionsInclusive) ||
  11458. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  11459. }
  11460. exports.Range = Range
  11461. function Range (range, options) {
  11462. if (!options || typeof options !== 'object') {
  11463. options = {
  11464. loose: !!options,
  11465. includePrerelease: false
  11466. }
  11467. }
  11468. if (range instanceof Range) {
  11469. if (range.loose === !!options.loose &&
  11470. range.includePrerelease === !!options.includePrerelease) {
  11471. return range
  11472. } else {
  11473. return new Range(range.raw, options)
  11474. }
  11475. }
  11476. if (range instanceof Comparator) {
  11477. return new Range(range.value, options)
  11478. }
  11479. if (!(this instanceof Range)) {
  11480. return new Range(range, options)
  11481. }
  11482. this.options = options
  11483. this.loose = !!options.loose
  11484. this.includePrerelease = !!options.includePrerelease
  11485. // First, split based on boolean or ||
  11486. this.raw = range
  11487. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  11488. return this.parseRange(range.trim())
  11489. }, this).filter(function (c) {
  11490. // throw out any that are not relevant for whatever reason
  11491. return c.length
  11492. })
  11493. if (!this.set.length) {
  11494. throw new TypeError('Invalid SemVer Range: ' + range)
  11495. }
  11496. this.format()
  11497. }
  11498. Range.prototype.format = function () {
  11499. this.range = this.set.map(function (comps) {
  11500. return comps.join(' ').trim()
  11501. }).join('||').trim()
  11502. return this.range
  11503. }
  11504. Range.prototype.toString = function () {
  11505. return this.range
  11506. }
  11507. Range.prototype.parseRange = function (range) {
  11508. var loose = this.options.loose
  11509. range = range.trim()
  11510. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  11511. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  11512. range = range.replace(hr, hyphenReplace)
  11513. debug('hyphen replace', range)
  11514. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  11515. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  11516. debug('comparator trim', range, re[t.COMPARATORTRIM])
  11517. // `~ 1.2.3` => `~1.2.3`
  11518. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  11519. // `^ 1.2.3` => `^1.2.3`
  11520. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  11521. // normalize spaces
  11522. range = range.split(/\s+/).join(' ')
  11523. // At this point, the range is completely trimmed and
  11524. // ready to be split into comparators.
  11525. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  11526. var set = range.split(' ').map(function (comp) {
  11527. return parseComparator(comp, this.options)
  11528. }, this).join(' ').split(/\s+/)
  11529. if (this.options.loose) {
  11530. // in loose mode, throw out any that are not valid comparators
  11531. set = set.filter(function (comp) {
  11532. return !!comp.match(compRe)
  11533. })
  11534. }
  11535. set = set.map(function (comp) {
  11536. return new Comparator(comp, this.options)
  11537. }, this)
  11538. return set
  11539. }
  11540. Range.prototype.intersects = function (range, options) {
  11541. if (!(range instanceof Range)) {
  11542. throw new TypeError('a Range is required')
  11543. }
  11544. return this.set.some(function (thisComparators) {
  11545. return (
  11546. isSatisfiable(thisComparators, options) &&
  11547. range.set.some(function (rangeComparators) {
  11548. return (
  11549. isSatisfiable(rangeComparators, options) &&
  11550. thisComparators.every(function (thisComparator) {
  11551. return rangeComparators.every(function (rangeComparator) {
  11552. return thisComparator.intersects(rangeComparator, options)
  11553. })
  11554. })
  11555. )
  11556. })
  11557. )
  11558. })
  11559. }
  11560. // take a set of comparators and determine whether there
  11561. // exists a version which can satisfy it
  11562. function isSatisfiable (comparators, options) {
  11563. var result = true
  11564. var remainingComparators = comparators.slice()
  11565. var testComparator = remainingComparators.pop()
  11566. while (result && remainingComparators.length) {
  11567. result = remainingComparators.every(function (otherComparator) {
  11568. return testComparator.intersects(otherComparator, options)
  11569. })
  11570. testComparator = remainingComparators.pop()
  11571. }
  11572. return result
  11573. }
  11574. // Mostly just for testing and legacy API reasons
  11575. exports.toComparators = toComparators
  11576. function toComparators (range, options) {
  11577. return new Range(range, options).set.map(function (comp) {
  11578. return comp.map(function (c) {
  11579. return c.value
  11580. }).join(' ').trim().split(' ')
  11581. })
  11582. }
  11583. // comprised of xranges, tildes, stars, and gtlt's at this point.
  11584. // already replaced the hyphen ranges
  11585. // turn into a set of JUST comparators.
  11586. function parseComparator (comp, options) {
  11587. debug('comp', comp, options)
  11588. comp = replaceCarets(comp, options)
  11589. debug('caret', comp)
  11590. comp = replaceTildes(comp, options)
  11591. debug('tildes', comp)
  11592. comp = replaceXRanges(comp, options)
  11593. debug('xrange', comp)
  11594. comp = replaceStars(comp, options)
  11595. debug('stars', comp)
  11596. return comp
  11597. }
  11598. function isX (id) {
  11599. return !id || id.toLowerCase() === 'x' || id === '*'
  11600. }
  11601. // ~, ~> --> * (any, kinda silly)
  11602. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  11603. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  11604. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  11605. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  11606. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  11607. function replaceTildes (comp, options) {
  11608. return comp.trim().split(/\s+/).map(function (comp) {
  11609. return replaceTilde(comp, options)
  11610. }).join(' ')
  11611. }
  11612. function replaceTilde (comp, options) {
  11613. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  11614. return comp.replace(r, function (_, M, m, p, pr) {
  11615. debug('tilde', comp, _, M, m, p, pr)
  11616. var ret
  11617. if (isX(M)) {
  11618. ret = ''
  11619. } else if (isX(m)) {
  11620. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11621. } else if (isX(p)) {
  11622. // ~1.2 == >=1.2.0 <1.3.0
  11623. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11624. } else if (pr) {
  11625. debug('replaceTilde pr', pr)
  11626. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11627. ' <' + M + '.' + (+m + 1) + '.0'
  11628. } else {
  11629. // ~1.2.3 == >=1.2.3 <1.3.0
  11630. ret = '>=' + M + '.' + m + '.' + p +
  11631. ' <' + M + '.' + (+m + 1) + '.0'
  11632. }
  11633. debug('tilde return', ret)
  11634. return ret
  11635. })
  11636. }
  11637. // ^ --> * (any, kinda silly)
  11638. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  11639. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  11640. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  11641. // ^1.2.3 --> >=1.2.3 <2.0.0
  11642. // ^1.2.0 --> >=1.2.0 <2.0.0
  11643. function replaceCarets (comp, options) {
  11644. return comp.trim().split(/\s+/).map(function (comp) {
  11645. return replaceCaret(comp, options)
  11646. }).join(' ')
  11647. }
  11648. function replaceCaret (comp, options) {
  11649. debug('caret', comp, options)
  11650. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  11651. return comp.replace(r, function (_, M, m, p, pr) {
  11652. debug('caret', comp, _, M, m, p, pr)
  11653. var ret
  11654. if (isX(M)) {
  11655. ret = ''
  11656. } else if (isX(m)) {
  11657. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  11658. } else if (isX(p)) {
  11659. if (M === '0') {
  11660. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  11661. } else {
  11662. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  11663. }
  11664. } else if (pr) {
  11665. debug('replaceCaret pr', pr)
  11666. if (M === '0') {
  11667. if (m === '0') {
  11668. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11669. ' <' + M + '.' + m + '.' + (+p + 1)
  11670. } else {
  11671. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11672. ' <' + M + '.' + (+m + 1) + '.0'
  11673. }
  11674. } else {
  11675. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  11676. ' <' + (+M + 1) + '.0.0'
  11677. }
  11678. } else {
  11679. debug('no pr')
  11680. if (M === '0') {
  11681. if (m === '0') {
  11682. ret = '>=' + M + '.' + m + '.' + p +
  11683. ' <' + M + '.' + m + '.' + (+p + 1)
  11684. } else {
  11685. ret = '>=' + M + '.' + m + '.' + p +
  11686. ' <' + M + '.' + (+m + 1) + '.0'
  11687. }
  11688. } else {
  11689. ret = '>=' + M + '.' + m + '.' + p +
  11690. ' <' + (+M + 1) + '.0.0'
  11691. }
  11692. }
  11693. debug('caret return', ret)
  11694. return ret
  11695. })
  11696. }
  11697. function replaceXRanges (comp, options) {
  11698. debug('replaceXRanges', comp, options)
  11699. return comp.split(/\s+/).map(function (comp) {
  11700. return replaceXRange(comp, options)
  11701. }).join(' ')
  11702. }
  11703. function replaceXRange (comp, options) {
  11704. comp = comp.trim()
  11705. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  11706. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  11707. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  11708. var xM = isX(M)
  11709. var xm = xM || isX(m)
  11710. var xp = xm || isX(p)
  11711. var anyX = xp
  11712. if (gtlt === '=' && anyX) {
  11713. gtlt = ''
  11714. }
  11715. // if we're including prereleases in the match, then we need
  11716. // to fix this to -0, the lowest possible prerelease value
  11717. pr = options.includePrerelease ? '-0' : ''
  11718. if (xM) {
  11719. if (gtlt === '>' || gtlt === '<') {
  11720. // nothing is allowed
  11721. ret = '<0.0.0-0'
  11722. } else {
  11723. // nothing is forbidden
  11724. ret = '*'
  11725. }
  11726. } else if (gtlt && anyX) {
  11727. // we know patch is an x, because we have any x at all.
  11728. // replace X with 0
  11729. if (xm) {
  11730. m = 0
  11731. }
  11732. p = 0
  11733. if (gtlt === '>') {
  11734. // >1 => >=2.0.0
  11735. // >1.2 => >=1.3.0
  11736. // >1.2.3 => >= 1.2.4
  11737. gtlt = '>='
  11738. if (xm) {
  11739. M = +M + 1
  11740. m = 0
  11741. p = 0
  11742. } else {
  11743. m = +m + 1
  11744. p = 0
  11745. }
  11746. } else if (gtlt === '<=') {
  11747. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  11748. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  11749. gtlt = '<'
  11750. if (xm) {
  11751. M = +M + 1
  11752. } else {
  11753. m = +m + 1
  11754. }
  11755. }
  11756. ret = gtlt + M + '.' + m + '.' + p + pr
  11757. } else if (xm) {
  11758. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  11759. } else if (xp) {
  11760. ret = '>=' + M + '.' + m + '.0' + pr +
  11761. ' <' + M + '.' + (+m + 1) + '.0' + pr
  11762. }
  11763. debug('xRange return', ret)
  11764. return ret
  11765. })
  11766. }
  11767. // Because * is AND-ed with everything else in the comparator,
  11768. // and '' means "any version", just remove the *s entirely.
  11769. function replaceStars (comp, options) {
  11770. debug('replaceStars', comp, options)
  11771. // Looseness is ignored here. star is always as loose as it gets!
  11772. return comp.trim().replace(re[t.STAR], '')
  11773. }
  11774. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11775. // M, m, patch, prerelease, build
  11776. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11777. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11778. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11779. function hyphenReplace ($0,
  11780. from, fM, fm, fp, fpr, fb,
  11781. to, tM, tm, tp, tpr, tb) {
  11782. if (isX(fM)) {
  11783. from = ''
  11784. } else if (isX(fm)) {
  11785. from = '>=' + fM + '.0.0'
  11786. } else if (isX(fp)) {
  11787. from = '>=' + fM + '.' + fm + '.0'
  11788. } else {
  11789. from = '>=' + from
  11790. }
  11791. if (isX(tM)) {
  11792. to = ''
  11793. } else if (isX(tm)) {
  11794. to = '<' + (+tM + 1) + '.0.0'
  11795. } else if (isX(tp)) {
  11796. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11797. } else if (tpr) {
  11798. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11799. } else {
  11800. to = '<=' + to
  11801. }
  11802. return (from + ' ' + to).trim()
  11803. }
  11804. // if ANY of the sets match ALL of its comparators, then pass
  11805. Range.prototype.test = function (version) {
  11806. if (!version) {
  11807. return false
  11808. }
  11809. if (typeof version === 'string') {
  11810. try {
  11811. version = new SemVer(version, this.options)
  11812. } catch (er) {
  11813. return false
  11814. }
  11815. }
  11816. for (var i = 0; i < this.set.length; i++) {
  11817. if (testSet(this.set[i], version, this.options)) {
  11818. return true
  11819. }
  11820. }
  11821. return false
  11822. }
  11823. function testSet (set, version, options) {
  11824. for (var i = 0; i < set.length; i++) {
  11825. if (!set[i].test(version)) {
  11826. return false
  11827. }
  11828. }
  11829. if (version.prerelease.length && !options.includePrerelease) {
  11830. // Find the set of versions that are allowed to have prereleases
  11831. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11832. // That should allow `1.2.3-pr.2` to pass.
  11833. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11834. // even though it's within the range set by the comparators.
  11835. for (i = 0; i < set.length; i++) {
  11836. debug(set[i].semver)
  11837. if (set[i].semver === ANY) {
  11838. continue
  11839. }
  11840. if (set[i].semver.prerelease.length > 0) {
  11841. var allowed = set[i].semver
  11842. if (allowed.major === version.major &&
  11843. allowed.minor === version.minor &&
  11844. allowed.patch === version.patch) {
  11845. return true
  11846. }
  11847. }
  11848. }
  11849. // Version has a -pre, but it's not one of the ones we like.
  11850. return false
  11851. }
  11852. return true
  11853. }
  11854. exports.satisfies = satisfies
  11855. function satisfies (version, range, options) {
  11856. try {
  11857. range = new Range(range, options)
  11858. } catch (er) {
  11859. return false
  11860. }
  11861. return range.test(version)
  11862. }
  11863. exports.maxSatisfying = maxSatisfying
  11864. function maxSatisfying (versions, range, options) {
  11865. var max = null
  11866. var maxSV = null
  11867. try {
  11868. var rangeObj = new Range(range, options)
  11869. } catch (er) {
  11870. return null
  11871. }
  11872. versions.forEach(function (v) {
  11873. if (rangeObj.test(v)) {
  11874. // satisfies(v, range, options)
  11875. if (!max || maxSV.compare(v) === -1) {
  11876. // compare(max, v, true)
  11877. max = v
  11878. maxSV = new SemVer(max, options)
  11879. }
  11880. }
  11881. })
  11882. return max
  11883. }
  11884. exports.minSatisfying = minSatisfying
  11885. function minSatisfying (versions, range, options) {
  11886. var min = null
  11887. var minSV = null
  11888. try {
  11889. var rangeObj = new Range(range, options)
  11890. } catch (er) {
  11891. return null
  11892. }
  11893. versions.forEach(function (v) {
  11894. if (rangeObj.test(v)) {
  11895. // satisfies(v, range, options)
  11896. if (!min || minSV.compare(v) === 1) {
  11897. // compare(min, v, true)
  11898. min = v
  11899. minSV = new SemVer(min, options)
  11900. }
  11901. }
  11902. })
  11903. return min
  11904. }
  11905. exports.minVersion = minVersion
  11906. function minVersion (range, loose) {
  11907. range = new Range(range, loose)
  11908. var minver = new SemVer('0.0.0')
  11909. if (range.test(minver)) {
  11910. return minver
  11911. }
  11912. minver = new SemVer('0.0.0-0')
  11913. if (range.test(minver)) {
  11914. return minver
  11915. }
  11916. minver = null
  11917. for (var i = 0; i < range.set.length; ++i) {
  11918. var comparators = range.set[i]
  11919. comparators.forEach(function (comparator) {
  11920. // Clone to avoid manipulating the comparator's semver object.
  11921. var compver = new SemVer(comparator.semver.version)
  11922. switch (comparator.operator) {
  11923. case '>':
  11924. if (compver.prerelease.length === 0) {
  11925. compver.patch++
  11926. } else {
  11927. compver.prerelease.push(0)
  11928. }
  11929. compver.raw = compver.format()
  11930. /* fallthrough */
  11931. case '':
  11932. case '>=':
  11933. if (!minver || gt(minver, compver)) {
  11934. minver = compver
  11935. }
  11936. break
  11937. case '<':
  11938. case '<=':
  11939. /* Ignore maximum versions */
  11940. break
  11941. /* istanbul ignore next */
  11942. default:
  11943. throw new Error('Unexpected operation: ' + comparator.operator)
  11944. }
  11945. })
  11946. }
  11947. if (minver && range.test(minver)) {
  11948. return minver
  11949. }
  11950. return null
  11951. }
  11952. exports.validRange = validRange
  11953. function validRange (range, options) {
  11954. try {
  11955. // Return '*' instead of '' so that truthiness works.
  11956. // This will throw if it's invalid anyway
  11957. return new Range(range, options).range || '*'
  11958. } catch (er) {
  11959. return null
  11960. }
  11961. }
  11962. // Determine if version is less than all the versions possible in the range
  11963. exports.ltr = ltr
  11964. function ltr (version, range, options) {
  11965. return outside(version, range, '<', options)
  11966. }
  11967. // Determine if version is greater than all the versions possible in the range.
  11968. exports.gtr = gtr
  11969. function gtr (version, range, options) {
  11970. return outside(version, range, '>', options)
  11971. }
  11972. exports.outside = outside
  11973. function outside (version, range, hilo, options) {
  11974. version = new SemVer(version, options)
  11975. range = new Range(range, options)
  11976. var gtfn, ltefn, ltfn, comp, ecomp
  11977. switch (hilo) {
  11978. case '>':
  11979. gtfn = gt
  11980. ltefn = lte
  11981. ltfn = lt
  11982. comp = '>'
  11983. ecomp = '>='
  11984. break
  11985. case '<':
  11986. gtfn = lt
  11987. ltefn = gte
  11988. ltfn = gt
  11989. comp = '<'
  11990. ecomp = '<='
  11991. break
  11992. default:
  11993. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11994. }
  11995. // If it satisifes the range it is not outside
  11996. if (satisfies(version, range, options)) {
  11997. return false
  11998. }
  11999. // From now on, variable terms are as if we're in "gtr" mode.
  12000. // but note that everything is flipped for the "ltr" function.
  12001. for (var i = 0; i < range.set.length; ++i) {
  12002. var comparators = range.set[i]
  12003. var high = null
  12004. var low = null
  12005. comparators.forEach(function (comparator) {
  12006. if (comparator.semver === ANY) {
  12007. comparator = new Comparator('>=0.0.0')
  12008. }
  12009. high = high || comparator
  12010. low = low || comparator
  12011. if (gtfn(comparator.semver, high.semver, options)) {
  12012. high = comparator
  12013. } else if (ltfn(comparator.semver, low.semver, options)) {
  12014. low = comparator
  12015. }
  12016. })
  12017. // If the edge version comparator has a operator then our version
  12018. // isn't outside it
  12019. if (high.operator === comp || high.operator === ecomp) {
  12020. return false
  12021. }
  12022. // If the lowest version comparator has an operator and our version
  12023. // is less than it then it isn't higher than the range
  12024. if ((!low.operator || low.operator === comp) &&
  12025. ltefn(version, low.semver)) {
  12026. return false
  12027. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  12028. return false
  12029. }
  12030. }
  12031. return true
  12032. }
  12033. exports.prerelease = prerelease
  12034. function prerelease (version, options) {
  12035. var parsed = parse(version, options)
  12036. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  12037. }
  12038. exports.intersects = intersects
  12039. function intersects (r1, r2, options) {
  12040. r1 = new Range(r1, options)
  12041. r2 = new Range(r2, options)
  12042. return r1.intersects(r2)
  12043. }
  12044. exports.coerce = coerce
  12045. function coerce (version, options) {
  12046. if (version instanceof SemVer) {
  12047. return version
  12048. }
  12049. if (typeof version === 'number') {
  12050. version = String(version)
  12051. }
  12052. if (typeof version !== 'string') {
  12053. return null
  12054. }
  12055. options = options || {}
  12056. var match = null
  12057. if (!options.rtl) {
  12058. match = version.match(re[t.COERCE])
  12059. } else {
  12060. // Find the right-most coercible string that does not share
  12061. // a terminus with a more left-ward coercible string.
  12062. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  12063. //
  12064. // Walk through the string checking with a /g regexp
  12065. // Manually set the index so as to pick up overlapping matches.
  12066. // Stop when we get a match that ends at the string end, since no
  12067. // coercible string can be more right-ward without the same terminus.
  12068. var next
  12069. while ((next = re[t.COERCERTL].exec(version)) &&
  12070. (!match || match.index + match[0].length !== version.length)
  12071. ) {
  12072. if (!match ||
  12073. next.index + next[0].length !== match.index + match[0].length) {
  12074. match = next
  12075. }
  12076. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  12077. }
  12078. // leave it in a clean state
  12079. re[t.COERCERTL].lastIndex = -1
  12080. }
  12081. if (match === null) {
  12082. return null
  12083. }
  12084. return parse(match[2] +
  12085. '.' + (match[3] || '0') +
  12086. '.' + (match[4] || '0'), options)
  12087. }
  12088. /***/ }),
  12089. /***/ 669:
  12090. /***/ (function(module) {
  12091. module.exports = require("util");
  12092. /***/ }),
  12093. /***/ 672:
  12094. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12095. "use strict";
  12096. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12097. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  12098. return new (P || (P = Promise))(function (resolve, reject) {
  12099. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12100. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12101. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  12102. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12103. });
  12104. };
  12105. var _a;
  12106. Object.defineProperty(exports, "__esModule", { value: true });
  12107. const assert_1 = __webpack_require__(357);
  12108. const fs = __webpack_require__(747);
  12109. const path = __webpack_require__(622);
  12110. _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;
  12111. exports.IS_WINDOWS = process.platform === 'win32';
  12112. function exists(fsPath) {
  12113. return __awaiter(this, void 0, void 0, function* () {
  12114. try {
  12115. yield exports.stat(fsPath);
  12116. }
  12117. catch (err) {
  12118. if (err.code === 'ENOENT') {
  12119. return false;
  12120. }
  12121. throw err;
  12122. }
  12123. return true;
  12124. });
  12125. }
  12126. exports.exists = exists;
  12127. function isDirectory(fsPath, useStat = false) {
  12128. return __awaiter(this, void 0, void 0, function* () {
  12129. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  12130. return stats.isDirectory();
  12131. });
  12132. }
  12133. exports.isDirectory = isDirectory;
  12134. /**
  12135. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  12136. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  12137. */
  12138. function isRooted(p) {
  12139. p = normalizeSeparators(p);
  12140. if (!p) {
  12141. throw new Error('isRooted() parameter "p" cannot be empty');
  12142. }
  12143. if (exports.IS_WINDOWS) {
  12144. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  12145. ); // e.g. C: or C:\hello
  12146. }
  12147. return p.startsWith('/');
  12148. }
  12149. exports.isRooted = isRooted;
  12150. /**
  12151. * Recursively create a directory at `fsPath`.
  12152. *
  12153. * This implementation is optimistic, meaning it attempts to create the full
  12154. * path first, and backs up the path stack from there.
  12155. *
  12156. * @param fsPath The path to create
  12157. * @param maxDepth The maximum recursion depth
  12158. * @param depth The current recursion depth
  12159. */
  12160. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  12161. return __awaiter(this, void 0, void 0, function* () {
  12162. assert_1.ok(fsPath, 'a path argument must be provided');
  12163. fsPath = path.resolve(fsPath);
  12164. if (depth >= maxDepth)
  12165. return exports.mkdir(fsPath);
  12166. try {
  12167. yield exports.mkdir(fsPath);
  12168. return;
  12169. }
  12170. catch (err) {
  12171. switch (err.code) {
  12172. case 'ENOENT': {
  12173. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  12174. yield exports.mkdir(fsPath);
  12175. return;
  12176. }
  12177. default: {
  12178. let stats;
  12179. try {
  12180. stats = yield exports.stat(fsPath);
  12181. }
  12182. catch (err2) {
  12183. throw err;
  12184. }
  12185. if (!stats.isDirectory())
  12186. throw err;
  12187. }
  12188. }
  12189. }
  12190. });
  12191. }
  12192. exports.mkdirP = mkdirP;
  12193. /**
  12194. * Best effort attempt to determine whether a file exists and is executable.
  12195. * @param filePath file path to check
  12196. * @param extensions additional file extensions to try
  12197. * @return if file exists and is executable, returns the file path. otherwise empty string.
  12198. */
  12199. function tryGetExecutablePath(filePath, extensions) {
  12200. return __awaiter(this, void 0, void 0, function* () {
  12201. let stats = undefined;
  12202. try {
  12203. // test file exists
  12204. stats = yield exports.stat(filePath);
  12205. }
  12206. catch (err) {
  12207. if (err.code !== 'ENOENT') {
  12208. // eslint-disable-next-line no-console
  12209. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  12210. }
  12211. }
  12212. if (stats && stats.isFile()) {
  12213. if (exports.IS_WINDOWS) {
  12214. // on Windows, test for valid extension
  12215. const upperExt = path.extname(filePath).toUpperCase();
  12216. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  12217. return filePath;
  12218. }
  12219. }
  12220. else {
  12221. if (isUnixExecutable(stats)) {
  12222. return filePath;
  12223. }
  12224. }
  12225. }
  12226. // try each extension
  12227. const originalFilePath = filePath;
  12228. for (const extension of extensions) {
  12229. filePath = originalFilePath + extension;
  12230. stats = undefined;
  12231. try {
  12232. stats = yield exports.stat(filePath);
  12233. }
  12234. catch (err) {
  12235. if (err.code !== 'ENOENT') {
  12236. // eslint-disable-next-line no-console
  12237. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  12238. }
  12239. }
  12240. if (stats && stats.isFile()) {
  12241. if (exports.IS_WINDOWS) {
  12242. // preserve the case of the actual file (since an extension was appended)
  12243. try {
  12244. const directory = path.dirname(filePath);
  12245. const upperName = path.basename(filePath).toUpperCase();
  12246. for (const actualName of yield exports.readdir(directory)) {
  12247. if (upperName === actualName.toUpperCase()) {
  12248. filePath = path.join(directory, actualName);
  12249. break;
  12250. }
  12251. }
  12252. }
  12253. catch (err) {
  12254. // eslint-disable-next-line no-console
  12255. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  12256. }
  12257. return filePath;
  12258. }
  12259. else {
  12260. if (isUnixExecutable(stats)) {
  12261. return filePath;
  12262. }
  12263. }
  12264. }
  12265. }
  12266. return '';
  12267. });
  12268. }
  12269. exports.tryGetExecutablePath = tryGetExecutablePath;
  12270. function normalizeSeparators(p) {
  12271. p = p || '';
  12272. if (exports.IS_WINDOWS) {
  12273. // convert slashes on Windows
  12274. p = p.replace(/\//g, '\\');
  12275. // remove redundant slashes
  12276. return p.replace(/\\\\+/g, '\\');
  12277. }
  12278. // remove redundant slashes
  12279. return p.replace(/\/\/+/g, '/');
  12280. }
  12281. // on Mac/Linux, test the execute bit
  12282. // R W X R W X R W X
  12283. // 256 128 64 32 16 8 4 2 1
  12284. function isUnixExecutable(stats) {
  12285. return ((stats.mode & 1) > 0 ||
  12286. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  12287. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  12288. }
  12289. //# sourceMappingURL=io-util.js.map
  12290. /***/ }),
  12291. /***/ 674:
  12292. /***/ (function(module, __unusedexports, __webpack_require__) {
  12293. module.exports = authenticate;
  12294. const { Deprecation } = __webpack_require__(692);
  12295. const once = __webpack_require__(969);
  12296. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  12297. function authenticate(state, options) {
  12298. deprecateAuthenticate(
  12299. state.octokit.log,
  12300. new Deprecation(
  12301. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  12302. )
  12303. );
  12304. if (!options) {
  12305. state.auth = false;
  12306. return;
  12307. }
  12308. switch (options.type) {
  12309. case "basic":
  12310. if (!options.username || !options.password) {
  12311. throw new Error(
  12312. "Basic authentication requires both a username and password to be set"
  12313. );
  12314. }
  12315. break;
  12316. case "oauth":
  12317. if (!options.token && !(options.key && options.secret)) {
  12318. throw new Error(
  12319. "OAuth2 authentication requires a token or key & secret to be set"
  12320. );
  12321. }
  12322. break;
  12323. case "token":
  12324. case "app":
  12325. if (!options.token) {
  12326. throw new Error("Token authentication requires a token to be set");
  12327. }
  12328. break;
  12329. default:
  12330. throw new Error(
  12331. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  12332. );
  12333. }
  12334. state.auth = options;
  12335. }
  12336. /***/ }),
  12337. /***/ 675:
  12338. /***/ (function(module) {
  12339. module.exports = function btoa(str) {
  12340. return new Buffer(str).toString('base64')
  12341. }
  12342. /***/ }),
  12343. /***/ 692:
  12344. /***/ (function(__unusedmodule, exports) {
  12345. "use strict";
  12346. Object.defineProperty(exports, '__esModule', { value: true });
  12347. class Deprecation extends Error {
  12348. constructor(message) {
  12349. super(message); // Maintains proper stack trace (only available on V8)
  12350. /* istanbul ignore next */
  12351. if (Error.captureStackTrace) {
  12352. Error.captureStackTrace(this, this.constructor);
  12353. }
  12354. this.name = 'Deprecation';
  12355. }
  12356. }
  12357. exports.Deprecation = Deprecation;
  12358. /***/ }),
  12359. /***/ 696:
  12360. /***/ (function(module) {
  12361. "use strict";
  12362. /*!
  12363. * isobject <https://github.com/jonschlinkert/isobject>
  12364. *
  12365. * Copyright (c) 2014-2017, Jon Schlinkert.
  12366. * Released under the MIT License.
  12367. */
  12368. function isObject(val) {
  12369. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  12370. }
  12371. /*!
  12372. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  12373. *
  12374. * Copyright (c) 2014-2017, Jon Schlinkert.
  12375. * Released under the MIT License.
  12376. */
  12377. function isObjectObject(o) {
  12378. return isObject(o) === true
  12379. && Object.prototype.toString.call(o) === '[object Object]';
  12380. }
  12381. function isPlainObject(o) {
  12382. var ctor,prot;
  12383. if (isObjectObject(o) === false) return false;
  12384. // If has modified constructor
  12385. ctor = o.constructor;
  12386. if (typeof ctor !== 'function') return false;
  12387. // If has modified prototype
  12388. prot = ctor.prototype;
  12389. if (isObjectObject(prot) === false) return false;
  12390. // If constructor does not have an Object-specific method
  12391. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  12392. return false;
  12393. }
  12394. // Most likely a plain Object
  12395. return true;
  12396. }
  12397. module.exports = isPlainObject;
  12398. /***/ }),
  12399. /***/ 697:
  12400. /***/ (function(module) {
  12401. "use strict";
  12402. module.exports = (promise, onFinally) => {
  12403. onFinally = onFinally || (() => {});
  12404. return promise.then(
  12405. val => new Promise(resolve => {
  12406. resolve(onFinally());
  12407. }).then(() => val),
  12408. err => new Promise(resolve => {
  12409. resolve(onFinally());
  12410. }).then(() => {
  12411. throw err;
  12412. })
  12413. );
  12414. };
  12415. /***/ }),
  12416. /***/ 722:
  12417. /***/ (function(module) {
  12418. /**
  12419. * Convert array of 16 byte values to UUID string format of the form:
  12420. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  12421. */
  12422. var byteToHex = [];
  12423. for (var i = 0; i < 256; ++i) {
  12424. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  12425. }
  12426. function bytesToUuid(buf, offset) {
  12427. var i = offset || 0;
  12428. var bth = byteToHex;
  12429. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  12430. return ([bth[buf[i++]], bth[buf[i++]],
  12431. bth[buf[i++]], bth[buf[i++]], '-',
  12432. bth[buf[i++]], bth[buf[i++]], '-',
  12433. bth[buf[i++]], bth[buf[i++]], '-',
  12434. bth[buf[i++]], bth[buf[i++]], '-',
  12435. bth[buf[i++]], bth[buf[i++]],
  12436. bth[buf[i++]], bth[buf[i++]],
  12437. bth[buf[i++]], bth[buf[i++]]]).join('');
  12438. }
  12439. module.exports = bytesToUuid;
  12440. /***/ }),
  12441. /***/ 742:
  12442. /***/ (function(module, __unusedexports, __webpack_require__) {
  12443. var fs = __webpack_require__(747)
  12444. var core
  12445. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  12446. core = __webpack_require__(818)
  12447. } else {
  12448. core = __webpack_require__(197)
  12449. }
  12450. module.exports = isexe
  12451. isexe.sync = sync
  12452. function isexe (path, options, cb) {
  12453. if (typeof options === 'function') {
  12454. cb = options
  12455. options = {}
  12456. }
  12457. if (!cb) {
  12458. if (typeof Promise !== 'function') {
  12459. throw new TypeError('callback not provided')
  12460. }
  12461. return new Promise(function (resolve, reject) {
  12462. isexe(path, options || {}, function (er, is) {
  12463. if (er) {
  12464. reject(er)
  12465. } else {
  12466. resolve(is)
  12467. }
  12468. })
  12469. })
  12470. }
  12471. core(path, options || {}, function (er, is) {
  12472. // ignore EACCES because that just means we aren't allowed to run it
  12473. if (er) {
  12474. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  12475. er = null
  12476. is = false
  12477. }
  12478. }
  12479. cb(er, is)
  12480. })
  12481. }
  12482. function sync (path, options) {
  12483. // my kingdom for a filtered catch
  12484. try {
  12485. return core.sync(path, options || {})
  12486. } catch (er) {
  12487. if (options && options.ignoreErrors || er.code === 'EACCES') {
  12488. return false
  12489. } else {
  12490. throw er
  12491. }
  12492. }
  12493. }
  12494. /***/ }),
  12495. /***/ 747:
  12496. /***/ (function(module) {
  12497. module.exports = require("fs");
  12498. /***/ }),
  12499. /***/ 753:
  12500. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12501. "use strict";
  12502. Object.defineProperty(exports, '__esModule', { value: true });
  12503. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12504. var endpoint = __webpack_require__(385);
  12505. var universalUserAgent = __webpack_require__(211);
  12506. var isPlainObject = _interopDefault(__webpack_require__(696));
  12507. var nodeFetch = _interopDefault(__webpack_require__(454));
  12508. var requestError = __webpack_require__(463);
  12509. const VERSION = "5.4.2";
  12510. function getBufferResponse(response) {
  12511. return response.arrayBuffer();
  12512. }
  12513. function fetchWrapper(requestOptions) {
  12514. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  12515. requestOptions.body = JSON.stringify(requestOptions.body);
  12516. }
  12517. let headers = {};
  12518. let status;
  12519. let url;
  12520. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  12521. return fetch(requestOptions.url, Object.assign({
  12522. method: requestOptions.method,
  12523. body: requestOptions.body,
  12524. headers: requestOptions.headers,
  12525. redirect: requestOptions.redirect
  12526. }, requestOptions.request)).then(response => {
  12527. url = response.url;
  12528. status = response.status;
  12529. for (const keyAndValue of response.headers) {
  12530. headers[keyAndValue[0]] = keyAndValue[1];
  12531. }
  12532. if (status === 204 || status === 205) {
  12533. return;
  12534. } // GitHub API returns 200 for HEAD requests
  12535. if (requestOptions.method === "HEAD") {
  12536. if (status < 400) {
  12537. return;
  12538. }
  12539. throw new requestError.RequestError(response.statusText, status, {
  12540. headers,
  12541. request: requestOptions
  12542. });
  12543. }
  12544. if (status === 304) {
  12545. throw new requestError.RequestError("Not modified", status, {
  12546. headers,
  12547. request: requestOptions
  12548. });
  12549. }
  12550. if (status >= 400) {
  12551. return response.text().then(message => {
  12552. const error = new requestError.RequestError(message, status, {
  12553. headers,
  12554. request: requestOptions
  12555. });
  12556. try {
  12557. let responseBody = JSON.parse(error.message);
  12558. Object.assign(error, responseBody);
  12559. let errors = responseBody.errors; // Assumption `errors` would always be in Array format
  12560. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  12561. } catch (e) {// ignore, see octokit/rest.js#684
  12562. }
  12563. throw error;
  12564. });
  12565. }
  12566. const contentType = response.headers.get("content-type");
  12567. if (/application\/json/.test(contentType)) {
  12568. return response.json();
  12569. }
  12570. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  12571. return response.text();
  12572. }
  12573. return getBufferResponse(response);
  12574. }).then(data => {
  12575. return {
  12576. status,
  12577. url,
  12578. headers,
  12579. data
  12580. };
  12581. }).catch(error => {
  12582. if (error instanceof requestError.RequestError) {
  12583. throw error;
  12584. }
  12585. throw new requestError.RequestError(error.message, 500, {
  12586. headers,
  12587. request: requestOptions
  12588. });
  12589. });
  12590. }
  12591. function withDefaults(oldEndpoint, newDefaults) {
  12592. const endpoint = oldEndpoint.defaults(newDefaults);
  12593. const newApi = function (route, parameters) {
  12594. const endpointOptions = endpoint.merge(route, parameters);
  12595. if (!endpointOptions.request || !endpointOptions.request.hook) {
  12596. return fetchWrapper(endpoint.parse(endpointOptions));
  12597. }
  12598. const request = (route, parameters) => {
  12599. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  12600. };
  12601. Object.assign(request, {
  12602. endpoint,
  12603. defaults: withDefaults.bind(null, endpoint)
  12604. });
  12605. return endpointOptions.request.hook(request, endpointOptions);
  12606. };
  12607. return Object.assign(newApi, {
  12608. endpoint,
  12609. defaults: withDefaults.bind(null, endpoint)
  12610. });
  12611. }
  12612. const request = withDefaults(endpoint.endpoint, {
  12613. headers: {
  12614. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  12615. }
  12616. });
  12617. exports.request = request;
  12618. //# sourceMappingURL=index.js.map
  12619. /***/ }),
  12620. /***/ 761:
  12621. /***/ (function(module) {
  12622. module.exports = require("zlib");
  12623. /***/ }),
  12624. /***/ 763:
  12625. /***/ (function(module) {
  12626. module.exports = removeHook
  12627. function removeHook (state, name, method) {
  12628. if (!state.registry[name]) {
  12629. return
  12630. }
  12631. var index = state.registry[name]
  12632. .map(function (registered) { return registered.orig })
  12633. .indexOf(method)
  12634. if (index === -1) {
  12635. return
  12636. }
  12637. state.registry[name].splice(index, 1)
  12638. }
  12639. /***/ }),
  12640. /***/ 768:
  12641. /***/ (function(module) {
  12642. "use strict";
  12643. module.exports = function (x) {
  12644. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  12645. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  12646. if (x[x.length - 1] === lf) {
  12647. x = x.slice(0, x.length - 1);
  12648. }
  12649. if (x[x.length - 1] === cr) {
  12650. x = x.slice(0, x.length - 1);
  12651. }
  12652. return x;
  12653. };
  12654. /***/ }),
  12655. /***/ 777:
  12656. /***/ (function(module, __unusedexports, __webpack_require__) {
  12657. module.exports = getFirstPage
  12658. const getPage = __webpack_require__(265)
  12659. function getFirstPage (octokit, link, headers) {
  12660. return getPage(octokit, link, 'first', headers)
  12661. }
  12662. /***/ }),
  12663. /***/ 796:
  12664. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12665. "use strict";
  12666. Object.defineProperty(exports, '__esModule', { value: true });
  12667. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  12668. var osName = _interopDefault(__webpack_require__(2));
  12669. function getUserAgent() {
  12670. try {
  12671. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  12672. } catch (error) {
  12673. if (/wmic os get Caption/.test(error.message)) {
  12674. return "Windows <version undetectable>";
  12675. }
  12676. throw error;
  12677. }
  12678. }
  12679. exports.getUserAgent = getUserAgent;
  12680. //# sourceMappingURL=index.js.map
  12681. /***/ }),
  12682. /***/ 813:
  12683. /***/ (function(__unusedmodule, exports) {
  12684. "use strict";
  12685. Object.defineProperty(exports, '__esModule', { value: true });
  12686. async function auth(token) {
  12687. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  12688. return {
  12689. type: "token",
  12690. token: token,
  12691. tokenType
  12692. };
  12693. }
  12694. /**
  12695. * Prefix token for usage in the Authorization header
  12696. *
  12697. * @param token OAuth token or JSON Web Token
  12698. */
  12699. function withAuthorizationPrefix(token) {
  12700. if (token.split(/\./).length === 3) {
  12701. return `bearer ${token}`;
  12702. }
  12703. return `token ${token}`;
  12704. }
  12705. async function hook(token, request, route, parameters) {
  12706. const endpoint = request.endpoint.merge(route, parameters);
  12707. endpoint.headers.authorization = withAuthorizationPrefix(token);
  12708. return request(endpoint);
  12709. }
  12710. const createTokenAuth = function createTokenAuth(token) {
  12711. if (!token) {
  12712. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  12713. }
  12714. if (typeof token !== "string") {
  12715. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  12716. }
  12717. token = token.replace(/^(token|bearer) +/i, "");
  12718. return Object.assign(auth.bind(null, token), {
  12719. hook: hook.bind(null, token)
  12720. });
  12721. };
  12722. exports.createTokenAuth = createTokenAuth;
  12723. //# sourceMappingURL=index.js.map
  12724. /***/ }),
  12725. /***/ 814:
  12726. /***/ (function(module, __unusedexports, __webpack_require__) {
  12727. module.exports = which
  12728. which.sync = whichSync
  12729. var isWindows = process.platform === 'win32' ||
  12730. process.env.OSTYPE === 'cygwin' ||
  12731. process.env.OSTYPE === 'msys'
  12732. var path = __webpack_require__(622)
  12733. var COLON = isWindows ? ';' : ':'
  12734. var isexe = __webpack_require__(742)
  12735. function getNotFoundError (cmd) {
  12736. var er = new Error('not found: ' + cmd)
  12737. er.code = 'ENOENT'
  12738. return er
  12739. }
  12740. function getPathInfo (cmd, opt) {
  12741. var colon = opt.colon || COLON
  12742. var pathEnv = opt.path || process.env.PATH || ''
  12743. var pathExt = ['']
  12744. pathEnv = pathEnv.split(colon)
  12745. var pathExtExe = ''
  12746. if (isWindows) {
  12747. pathEnv.unshift(process.cwd())
  12748. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12749. pathExt = pathExtExe.split(colon)
  12750. // Always test the cmd itself first. isexe will check to make sure
  12751. // it's found in the pathExt set.
  12752. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12753. pathExt.unshift('')
  12754. }
  12755. // If it has a slash, then we don't bother searching the pathenv.
  12756. // just check the file itself, and that's it.
  12757. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12758. pathEnv = ['']
  12759. return {
  12760. env: pathEnv,
  12761. ext: pathExt,
  12762. extExe: pathExtExe
  12763. }
  12764. }
  12765. function which (cmd, opt, cb) {
  12766. if (typeof opt === 'function') {
  12767. cb = opt
  12768. opt = {}
  12769. }
  12770. var info = getPathInfo(cmd, opt)
  12771. var pathEnv = info.env
  12772. var pathExt = info.ext
  12773. var pathExtExe = info.extExe
  12774. var found = []
  12775. ;(function F (i, l) {
  12776. if (i === l) {
  12777. if (opt.all && found.length)
  12778. return cb(null, found)
  12779. else
  12780. return cb(getNotFoundError(cmd))
  12781. }
  12782. var pathPart = pathEnv[i]
  12783. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12784. pathPart = pathPart.slice(1, -1)
  12785. var p = path.join(pathPart, cmd)
  12786. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12787. p = cmd.slice(0, 2) + p
  12788. }
  12789. ;(function E (ii, ll) {
  12790. if (ii === ll) return F(i + 1, l)
  12791. var ext = pathExt[ii]
  12792. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12793. if (!er && is) {
  12794. if (opt.all)
  12795. found.push(p + ext)
  12796. else
  12797. return cb(null, p + ext)
  12798. }
  12799. return E(ii + 1, ll)
  12800. })
  12801. })(0, pathExt.length)
  12802. })(0, pathEnv.length)
  12803. }
  12804. function whichSync (cmd, opt) {
  12805. opt = opt || {}
  12806. var info = getPathInfo(cmd, opt)
  12807. var pathEnv = info.env
  12808. var pathExt = info.ext
  12809. var pathExtExe = info.extExe
  12810. var found = []
  12811. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12812. var pathPart = pathEnv[i]
  12813. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12814. pathPart = pathPart.slice(1, -1)
  12815. var p = path.join(pathPart, cmd)
  12816. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12817. p = cmd.slice(0, 2) + p
  12818. }
  12819. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12820. var cur = p + pathExt[j]
  12821. var is
  12822. try {
  12823. is = isexe.sync(cur, { pathExt: pathExtExe })
  12824. if (is) {
  12825. if (opt.all)
  12826. found.push(cur)
  12827. else
  12828. return cur
  12829. }
  12830. } catch (ex) {}
  12831. }
  12832. }
  12833. if (opt.all && found.length)
  12834. return found
  12835. if (opt.nothrow)
  12836. return null
  12837. throw getNotFoundError(cmd)
  12838. }
  12839. /***/ }),
  12840. /***/ 816:
  12841. /***/ (function(module) {
  12842. "use strict";
  12843. module.exports = /^#!.*/;
  12844. /***/ }),
  12845. /***/ 818:
  12846. /***/ (function(module, __unusedexports, __webpack_require__) {
  12847. module.exports = isexe
  12848. isexe.sync = sync
  12849. var fs = __webpack_require__(747)
  12850. function checkPathExt (path, options) {
  12851. var pathext = options.pathExt !== undefined ?
  12852. options.pathExt : process.env.PATHEXT
  12853. if (!pathext) {
  12854. return true
  12855. }
  12856. pathext = pathext.split(';')
  12857. if (pathext.indexOf('') !== -1) {
  12858. return true
  12859. }
  12860. for (var i = 0; i < pathext.length; i++) {
  12861. var p = pathext[i].toLowerCase()
  12862. if (p && path.substr(-p.length).toLowerCase() === p) {
  12863. return true
  12864. }
  12865. }
  12866. return false
  12867. }
  12868. function checkStat (stat, path, options) {
  12869. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12870. return false
  12871. }
  12872. return checkPathExt(path, options)
  12873. }
  12874. function isexe (path, options, cb) {
  12875. fs.stat(path, function (er, stat) {
  12876. cb(er, er ? false : checkStat(stat, path, options))
  12877. })
  12878. }
  12879. function sync (path, options) {
  12880. return checkStat(fs.statSync(path), path, options)
  12881. }
  12882. /***/ }),
  12883. /***/ 821:
  12884. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12885. "use strict";
  12886. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  12887. if (k2 === undefined) k2 = k;
  12888. Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
  12889. }) : (function(o, m, k, k2) {
  12890. if (k2 === undefined) k2 = k;
  12891. o[k2] = m[k];
  12892. }));
  12893. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  12894. Object.defineProperty(o, "default", { enumerable: true, value: v });
  12895. }) : function(o, v) {
  12896. o["default"] = v;
  12897. });
  12898. var __importStar = (this && this.__importStar) || function (mod) {
  12899. if (mod && mod.__esModule) return mod;
  12900. var result = {};
  12901. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  12902. __setModuleDefault(result, mod);
  12903. return result;
  12904. };
  12905. Object.defineProperty(exports, "__esModule", { value: true });
  12906. exports.getInputs = void 0;
  12907. const core = __importStar(__webpack_require__(470));
  12908. const fsHelper = __importStar(__webpack_require__(618));
  12909. const github = __importStar(__webpack_require__(469));
  12910. const path = __importStar(__webpack_require__(622));
  12911. function getInputs() {
  12912. const result = {};
  12913. // GitHub workspace
  12914. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12915. if (!githubWorkspacePath) {
  12916. throw new Error('GITHUB_WORKSPACE not defined');
  12917. }
  12918. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12919. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12920. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12921. // Qualified repository
  12922. const qualifiedRepository = core.getInput('repository') ||
  12923. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12924. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12925. const splitRepository = qualifiedRepository.split('/');
  12926. if (splitRepository.length !== 2 ||
  12927. !splitRepository[0] ||
  12928. !splitRepository[1]) {
  12929. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12930. }
  12931. result.repositoryOwner = splitRepository[0];
  12932. result.repositoryName = splitRepository[1];
  12933. // Repository path
  12934. result.repositoryPath = core.getInput('path') || '.';
  12935. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12936. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12937. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12938. }
  12939. // Workflow repository?
  12940. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12941. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12942. // Source branch, source version
  12943. result.ref = core.getInput('ref');
  12944. if (!result.ref) {
  12945. if (isWorkflowRepository) {
  12946. result.ref = github.context.ref;
  12947. result.commit = github.context.sha;
  12948. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12949. // the ref is unqualifed like "main" instead of "refs/heads/main".
  12950. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12951. result.ref = `refs/heads/${result.ref}`;
  12952. }
  12953. }
  12954. }
  12955. // SHA?
  12956. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12957. result.commit = result.ref;
  12958. result.ref = '';
  12959. }
  12960. core.debug(`ref = '${result.ref}'`);
  12961. core.debug(`commit = '${result.commit}'`);
  12962. // Clean
  12963. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12964. core.debug(`clean = ${result.clean}`);
  12965. // Fetch depth
  12966. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12967. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12968. result.fetchDepth = 0;
  12969. }
  12970. core.debug(`fetch depth = ${result.fetchDepth}`);
  12971. // LFS
  12972. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12973. core.debug(`lfs = ${result.lfs}`);
  12974. // Submodules
  12975. result.submodules = false;
  12976. result.nestedSubmodules = false;
  12977. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12978. if (submodulesString == 'RECURSIVE') {
  12979. result.submodules = true;
  12980. result.nestedSubmodules = true;
  12981. }
  12982. else if (submodulesString == 'TRUE') {
  12983. result.submodules = true;
  12984. }
  12985. core.debug(`submodules = ${result.submodules}`);
  12986. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12987. // Auth token
  12988. result.authToken = core.getInput('token', { required: true });
  12989. // SSH
  12990. result.sshKey = core.getInput('ssh-key');
  12991. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12992. result.sshStrict =
  12993. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12994. // Persist credentials
  12995. result.persistCredentials =
  12996. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12997. return result;
  12998. }
  12999. exports.getInputs = getInputs;
  13000. /***/ }),
  13001. /***/ 826:
  13002. /***/ (function(module, __unusedexports, __webpack_require__) {
  13003. var rng = __webpack_require__(139);
  13004. var bytesToUuid = __webpack_require__(722);
  13005. function v4(options, buf, offset) {
  13006. var i = buf && offset || 0;
  13007. if (typeof(options) == 'string') {
  13008. buf = options === 'binary' ? new Array(16) : null;
  13009. options = null;
  13010. }
  13011. options = options || {};
  13012. var rnds = options.random || (options.rng || rng)();
  13013. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  13014. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  13015. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  13016. // Copy bytes to buffer, if provided
  13017. if (buf) {
  13018. for (var ii = 0; ii < 16; ++ii) {
  13019. buf[i + ii] = rnds[ii];
  13020. }
  13021. }
  13022. return buf || bytesToUuid(rnds);
  13023. }
  13024. module.exports = v4;
  13025. /***/ }),
  13026. /***/ 835:
  13027. /***/ (function(module) {
  13028. module.exports = require("url");
  13029. /***/ }),
  13030. /***/ 842:
  13031. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13032. "use strict";
  13033. Object.defineProperty(exports, '__esModule', { value: true });
  13034. var deprecation = __webpack_require__(692);
  13035. var endpointsByScope = {
  13036. actions: {
  13037. cancelWorkflowRun: {
  13038. method: "POST",
  13039. params: {
  13040. owner: {
  13041. required: true,
  13042. type: "string"
  13043. },
  13044. repo: {
  13045. required: true,
  13046. type: "string"
  13047. },
  13048. run_id: {
  13049. required: true,
  13050. type: "integer"
  13051. }
  13052. },
  13053. url: "/repos/:owner/:repo/actions/runs/:run_id/cancel"
  13054. },
  13055. createOrUpdateSecretForRepo: {
  13056. method: "PUT",
  13057. params: {
  13058. encrypted_value: {
  13059. type: "string"
  13060. },
  13061. key_id: {
  13062. type: "string"
  13063. },
  13064. name: {
  13065. required: true,
  13066. type: "string"
  13067. },
  13068. owner: {
  13069. required: true,
  13070. type: "string"
  13071. },
  13072. repo: {
  13073. required: true,
  13074. type: "string"
  13075. }
  13076. },
  13077. url: "/repos/:owner/:repo/actions/secrets/:name"
  13078. },
  13079. createRegistrationToken: {
  13080. method: "POST",
  13081. params: {
  13082. owner: {
  13083. required: true,
  13084. type: "string"
  13085. },
  13086. repo: {
  13087. required: true,
  13088. type: "string"
  13089. }
  13090. },
  13091. url: "/repos/:owner/:repo/actions/runners/registration-token"
  13092. },
  13093. createRemoveToken: {
  13094. method: "POST",
  13095. params: {
  13096. owner: {
  13097. required: true,
  13098. type: "string"
  13099. },
  13100. repo: {
  13101. required: true,
  13102. type: "string"
  13103. }
  13104. },
  13105. url: "/repos/:owner/:repo/actions/runners/remove-token"
  13106. },
  13107. deleteArtifact: {
  13108. method: "DELETE",
  13109. params: {
  13110. artifact_id: {
  13111. required: true,
  13112. type: "integer"
  13113. },
  13114. owner: {
  13115. required: true,
  13116. type: "string"
  13117. },
  13118. repo: {
  13119. required: true,
  13120. type: "string"
  13121. }
  13122. },
  13123. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  13124. },
  13125. deleteSecretFromRepo: {
  13126. method: "DELETE",
  13127. params: {
  13128. name: {
  13129. required: true,
  13130. type: "string"
  13131. },
  13132. owner: {
  13133. required: true,
  13134. type: "string"
  13135. },
  13136. repo: {
  13137. required: true,
  13138. type: "string"
  13139. }
  13140. },
  13141. url: "/repos/:owner/:repo/actions/secrets/:name"
  13142. },
  13143. downloadArtifact: {
  13144. method: "GET",
  13145. params: {
  13146. archive_format: {
  13147. required: true,
  13148. type: "string"
  13149. },
  13150. artifact_id: {
  13151. required: true,
  13152. type: "integer"
  13153. },
  13154. owner: {
  13155. required: true,
  13156. type: "string"
  13157. },
  13158. repo: {
  13159. required: true,
  13160. type: "string"
  13161. }
  13162. },
  13163. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id/:archive_format"
  13164. },
  13165. getArtifact: {
  13166. method: "GET",
  13167. params: {
  13168. artifact_id: {
  13169. required: true,
  13170. type: "integer"
  13171. },
  13172. owner: {
  13173. required: true,
  13174. type: "string"
  13175. },
  13176. repo: {
  13177. required: true,
  13178. type: "string"
  13179. }
  13180. },
  13181. url: "/repos/:owner/:repo/actions/artifacts/:artifact_id"
  13182. },
  13183. getPublicKey: {
  13184. method: "GET",
  13185. params: {
  13186. owner: {
  13187. required: true,
  13188. type: "string"
  13189. },
  13190. repo: {
  13191. required: true,
  13192. type: "string"
  13193. }
  13194. },
  13195. url: "/repos/:owner/:repo/actions/secrets/public-key"
  13196. },
  13197. getSecret: {
  13198. method: "GET",
  13199. params: {
  13200. name: {
  13201. required: true,
  13202. type: "string"
  13203. },
  13204. owner: {
  13205. required: true,
  13206. type: "string"
  13207. },
  13208. page: {
  13209. type: "integer"
  13210. },
  13211. per_page: {
  13212. type: "integer"
  13213. },
  13214. repo: {
  13215. required: true,
  13216. type: "string"
  13217. }
  13218. },
  13219. url: "/repos/:owner/:repo/actions/secrets/:name"
  13220. },
  13221. getSelfHostedRunner: {
  13222. method: "GET",
  13223. params: {
  13224. owner: {
  13225. required: true,
  13226. type: "string"
  13227. },
  13228. repo: {
  13229. required: true,
  13230. type: "string"
  13231. },
  13232. runner_id: {
  13233. required: true,
  13234. type: "integer"
  13235. }
  13236. },
  13237. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13238. },
  13239. getWorkflow: {
  13240. method: "GET",
  13241. params: {
  13242. owner: {
  13243. required: true,
  13244. type: "string"
  13245. },
  13246. repo: {
  13247. required: true,
  13248. type: "string"
  13249. },
  13250. workflow_id: {
  13251. required: true,
  13252. type: "integer"
  13253. }
  13254. },
  13255. url: "/repos/:owner/:repo/actions/workflows/:workflow_id"
  13256. },
  13257. getWorkflowJob: {
  13258. method: "GET",
  13259. params: {
  13260. job_id: {
  13261. required: true,
  13262. type: "integer"
  13263. },
  13264. owner: {
  13265. required: true,
  13266. type: "string"
  13267. },
  13268. repo: {
  13269. required: true,
  13270. type: "string"
  13271. }
  13272. },
  13273. url: "/repos/:owner/:repo/actions/jobs/:job_id"
  13274. },
  13275. getWorkflowRun: {
  13276. method: "GET",
  13277. params: {
  13278. owner: {
  13279. required: true,
  13280. type: "string"
  13281. },
  13282. repo: {
  13283. required: true,
  13284. type: "string"
  13285. },
  13286. run_id: {
  13287. required: true,
  13288. type: "integer"
  13289. }
  13290. },
  13291. url: "/repos/:owner/:repo/actions/runs/:run_id"
  13292. },
  13293. listDownloadsForSelfHostedRunnerApplication: {
  13294. method: "GET",
  13295. params: {
  13296. owner: {
  13297. required: true,
  13298. type: "string"
  13299. },
  13300. repo: {
  13301. required: true,
  13302. type: "string"
  13303. }
  13304. },
  13305. url: "/repos/:owner/:repo/actions/runners/downloads"
  13306. },
  13307. listJobsForWorkflowRun: {
  13308. method: "GET",
  13309. params: {
  13310. owner: {
  13311. required: true,
  13312. type: "string"
  13313. },
  13314. page: {
  13315. type: "integer"
  13316. },
  13317. per_page: {
  13318. type: "integer"
  13319. },
  13320. repo: {
  13321. required: true,
  13322. type: "string"
  13323. },
  13324. run_id: {
  13325. required: true,
  13326. type: "integer"
  13327. }
  13328. },
  13329. url: "/repos/:owner/:repo/actions/runs/:run_id/jobs"
  13330. },
  13331. listRepoWorkflowRuns: {
  13332. method: "GET",
  13333. params: {
  13334. actor: {
  13335. type: "string"
  13336. },
  13337. branch: {
  13338. type: "string"
  13339. },
  13340. event: {
  13341. type: "string"
  13342. },
  13343. owner: {
  13344. required: true,
  13345. type: "string"
  13346. },
  13347. page: {
  13348. type: "integer"
  13349. },
  13350. per_page: {
  13351. type: "integer"
  13352. },
  13353. repo: {
  13354. required: true,
  13355. type: "string"
  13356. },
  13357. status: {
  13358. enum: ["completed", "status", "conclusion"],
  13359. type: "string"
  13360. }
  13361. },
  13362. url: "/repos/:owner/:repo/actions/runs"
  13363. },
  13364. listRepoWorkflows: {
  13365. method: "GET",
  13366. params: {
  13367. owner: {
  13368. required: true,
  13369. type: "string"
  13370. },
  13371. page: {
  13372. type: "integer"
  13373. },
  13374. per_page: {
  13375. type: "integer"
  13376. },
  13377. repo: {
  13378. required: true,
  13379. type: "string"
  13380. }
  13381. },
  13382. url: "/repos/:owner/:repo/actions/workflows"
  13383. },
  13384. listSecretsForRepo: {
  13385. method: "GET",
  13386. params: {
  13387. owner: {
  13388. required: true,
  13389. type: "string"
  13390. },
  13391. page: {
  13392. type: "integer"
  13393. },
  13394. per_page: {
  13395. type: "integer"
  13396. },
  13397. repo: {
  13398. required: true,
  13399. type: "string"
  13400. }
  13401. },
  13402. url: "/repos/:owner/:repo/actions/secrets"
  13403. },
  13404. listSelfHostedRunnersForRepo: {
  13405. method: "GET",
  13406. params: {
  13407. owner: {
  13408. required: true,
  13409. type: "string"
  13410. },
  13411. page: {
  13412. type: "integer"
  13413. },
  13414. per_page: {
  13415. type: "integer"
  13416. },
  13417. repo: {
  13418. required: true,
  13419. type: "string"
  13420. }
  13421. },
  13422. url: "/repos/:owner/:repo/actions/runners"
  13423. },
  13424. listWorkflowJobLogs: {
  13425. method: "GET",
  13426. params: {
  13427. job_id: {
  13428. required: true,
  13429. type: "integer"
  13430. },
  13431. owner: {
  13432. required: true,
  13433. type: "string"
  13434. },
  13435. page: {
  13436. type: "integer"
  13437. },
  13438. per_page: {
  13439. type: "integer"
  13440. },
  13441. repo: {
  13442. required: true,
  13443. type: "string"
  13444. }
  13445. },
  13446. url: "/repos/:owner/:repo/actions/jobs/:job_id/logs"
  13447. },
  13448. listWorkflowRunArtifacts: {
  13449. method: "GET",
  13450. params: {
  13451. owner: {
  13452. required: true,
  13453. type: "string"
  13454. },
  13455. page: {
  13456. type: "integer"
  13457. },
  13458. per_page: {
  13459. type: "integer"
  13460. },
  13461. repo: {
  13462. required: true,
  13463. type: "string"
  13464. },
  13465. run_id: {
  13466. required: true,
  13467. type: "integer"
  13468. }
  13469. },
  13470. url: "/repos/:owner/:repo/actions/runs/:run_id/artifacts"
  13471. },
  13472. listWorkflowRunLogs: {
  13473. method: "GET",
  13474. params: {
  13475. owner: {
  13476. required: true,
  13477. type: "string"
  13478. },
  13479. page: {
  13480. type: "integer"
  13481. },
  13482. per_page: {
  13483. type: "integer"
  13484. },
  13485. repo: {
  13486. required: true,
  13487. type: "string"
  13488. },
  13489. run_id: {
  13490. required: true,
  13491. type: "integer"
  13492. }
  13493. },
  13494. url: "/repos/:owner/:repo/actions/runs/:run_id/logs"
  13495. },
  13496. listWorkflowRuns: {
  13497. method: "GET",
  13498. params: {
  13499. actor: {
  13500. type: "string"
  13501. },
  13502. branch: {
  13503. type: "string"
  13504. },
  13505. event: {
  13506. type: "string"
  13507. },
  13508. owner: {
  13509. required: true,
  13510. type: "string"
  13511. },
  13512. page: {
  13513. type: "integer"
  13514. },
  13515. per_page: {
  13516. type: "integer"
  13517. },
  13518. repo: {
  13519. required: true,
  13520. type: "string"
  13521. },
  13522. status: {
  13523. enum: ["completed", "status", "conclusion"],
  13524. type: "string"
  13525. },
  13526. workflow_id: {
  13527. required: true,
  13528. type: "integer"
  13529. }
  13530. },
  13531. url: "/repos/:owner/:repo/actions/workflows/:workflow_id/runs"
  13532. },
  13533. reRunWorkflow: {
  13534. method: "POST",
  13535. params: {
  13536. owner: {
  13537. required: true,
  13538. type: "string"
  13539. },
  13540. repo: {
  13541. required: true,
  13542. type: "string"
  13543. },
  13544. run_id: {
  13545. required: true,
  13546. type: "integer"
  13547. }
  13548. },
  13549. url: "/repos/:owner/:repo/actions/runs/:run_id/rerun"
  13550. },
  13551. removeSelfHostedRunner: {
  13552. method: "DELETE",
  13553. params: {
  13554. owner: {
  13555. required: true,
  13556. type: "string"
  13557. },
  13558. repo: {
  13559. required: true,
  13560. type: "string"
  13561. },
  13562. runner_id: {
  13563. required: true,
  13564. type: "integer"
  13565. }
  13566. },
  13567. url: "/repos/:owner/:repo/actions/runners/:runner_id"
  13568. }
  13569. },
  13570. activity: {
  13571. checkStarringRepo: {
  13572. method: "GET",
  13573. params: {
  13574. owner: {
  13575. required: true,
  13576. type: "string"
  13577. },
  13578. repo: {
  13579. required: true,
  13580. type: "string"
  13581. }
  13582. },
  13583. url: "/user/starred/:owner/:repo"
  13584. },
  13585. deleteRepoSubscription: {
  13586. method: "DELETE",
  13587. params: {
  13588. owner: {
  13589. required: true,
  13590. type: "string"
  13591. },
  13592. repo: {
  13593. required: true,
  13594. type: "string"
  13595. }
  13596. },
  13597. url: "/repos/:owner/:repo/subscription"
  13598. },
  13599. deleteThreadSubscription: {
  13600. method: "DELETE",
  13601. params: {
  13602. thread_id: {
  13603. required: true,
  13604. type: "integer"
  13605. }
  13606. },
  13607. url: "/notifications/threads/:thread_id/subscription"
  13608. },
  13609. getRepoSubscription: {
  13610. method: "GET",
  13611. params: {
  13612. owner: {
  13613. required: true,
  13614. type: "string"
  13615. },
  13616. repo: {
  13617. required: true,
  13618. type: "string"
  13619. }
  13620. },
  13621. url: "/repos/:owner/:repo/subscription"
  13622. },
  13623. getThread: {
  13624. method: "GET",
  13625. params: {
  13626. thread_id: {
  13627. required: true,
  13628. type: "integer"
  13629. }
  13630. },
  13631. url: "/notifications/threads/:thread_id"
  13632. },
  13633. getThreadSubscription: {
  13634. method: "GET",
  13635. params: {
  13636. thread_id: {
  13637. required: true,
  13638. type: "integer"
  13639. }
  13640. },
  13641. url: "/notifications/threads/:thread_id/subscription"
  13642. },
  13643. listEventsForOrg: {
  13644. method: "GET",
  13645. params: {
  13646. org: {
  13647. required: true,
  13648. type: "string"
  13649. },
  13650. page: {
  13651. type: "integer"
  13652. },
  13653. per_page: {
  13654. type: "integer"
  13655. },
  13656. username: {
  13657. required: true,
  13658. type: "string"
  13659. }
  13660. },
  13661. url: "/users/:username/events/orgs/:org"
  13662. },
  13663. listEventsForUser: {
  13664. method: "GET",
  13665. params: {
  13666. page: {
  13667. type: "integer"
  13668. },
  13669. per_page: {
  13670. type: "integer"
  13671. },
  13672. username: {
  13673. required: true,
  13674. type: "string"
  13675. }
  13676. },
  13677. url: "/users/:username/events"
  13678. },
  13679. listFeeds: {
  13680. method: "GET",
  13681. params: {},
  13682. url: "/feeds"
  13683. },
  13684. listNotifications: {
  13685. method: "GET",
  13686. params: {
  13687. all: {
  13688. type: "boolean"
  13689. },
  13690. before: {
  13691. type: "string"
  13692. },
  13693. page: {
  13694. type: "integer"
  13695. },
  13696. participating: {
  13697. type: "boolean"
  13698. },
  13699. per_page: {
  13700. type: "integer"
  13701. },
  13702. since: {
  13703. type: "string"
  13704. }
  13705. },
  13706. url: "/notifications"
  13707. },
  13708. listNotificationsForRepo: {
  13709. method: "GET",
  13710. params: {
  13711. all: {
  13712. type: "boolean"
  13713. },
  13714. before: {
  13715. type: "string"
  13716. },
  13717. owner: {
  13718. required: true,
  13719. type: "string"
  13720. },
  13721. page: {
  13722. type: "integer"
  13723. },
  13724. participating: {
  13725. type: "boolean"
  13726. },
  13727. per_page: {
  13728. type: "integer"
  13729. },
  13730. repo: {
  13731. required: true,
  13732. type: "string"
  13733. },
  13734. since: {
  13735. type: "string"
  13736. }
  13737. },
  13738. url: "/repos/:owner/:repo/notifications"
  13739. },
  13740. listPublicEvents: {
  13741. method: "GET",
  13742. params: {
  13743. page: {
  13744. type: "integer"
  13745. },
  13746. per_page: {
  13747. type: "integer"
  13748. }
  13749. },
  13750. url: "/events"
  13751. },
  13752. listPublicEventsForOrg: {
  13753. method: "GET",
  13754. params: {
  13755. org: {
  13756. required: true,
  13757. type: "string"
  13758. },
  13759. page: {
  13760. type: "integer"
  13761. },
  13762. per_page: {
  13763. type: "integer"
  13764. }
  13765. },
  13766. url: "/orgs/:org/events"
  13767. },
  13768. listPublicEventsForRepoNetwork: {
  13769. method: "GET",
  13770. params: {
  13771. owner: {
  13772. required: true,
  13773. type: "string"
  13774. },
  13775. page: {
  13776. type: "integer"
  13777. },
  13778. per_page: {
  13779. type: "integer"
  13780. },
  13781. repo: {
  13782. required: true,
  13783. type: "string"
  13784. }
  13785. },
  13786. url: "/networks/:owner/:repo/events"
  13787. },
  13788. listPublicEventsForUser: {
  13789. method: "GET",
  13790. params: {
  13791. page: {
  13792. type: "integer"
  13793. },
  13794. per_page: {
  13795. type: "integer"
  13796. },
  13797. username: {
  13798. required: true,
  13799. type: "string"
  13800. }
  13801. },
  13802. url: "/users/:username/events/public"
  13803. },
  13804. listReceivedEventsForUser: {
  13805. method: "GET",
  13806. params: {
  13807. page: {
  13808. type: "integer"
  13809. },
  13810. per_page: {
  13811. type: "integer"
  13812. },
  13813. username: {
  13814. required: true,
  13815. type: "string"
  13816. }
  13817. },
  13818. url: "/users/:username/received_events"
  13819. },
  13820. listReceivedPublicEventsForUser: {
  13821. method: "GET",
  13822. params: {
  13823. page: {
  13824. type: "integer"
  13825. },
  13826. per_page: {
  13827. type: "integer"
  13828. },
  13829. username: {
  13830. required: true,
  13831. type: "string"
  13832. }
  13833. },
  13834. url: "/users/:username/received_events/public"
  13835. },
  13836. listRepoEvents: {
  13837. method: "GET",
  13838. params: {
  13839. owner: {
  13840. required: true,
  13841. type: "string"
  13842. },
  13843. page: {
  13844. type: "integer"
  13845. },
  13846. per_page: {
  13847. type: "integer"
  13848. },
  13849. repo: {
  13850. required: true,
  13851. type: "string"
  13852. }
  13853. },
  13854. url: "/repos/:owner/:repo/events"
  13855. },
  13856. listReposStarredByAuthenticatedUser: {
  13857. method: "GET",
  13858. params: {
  13859. direction: {
  13860. enum: ["asc", "desc"],
  13861. type: "string"
  13862. },
  13863. page: {
  13864. type: "integer"
  13865. },
  13866. per_page: {
  13867. type: "integer"
  13868. },
  13869. sort: {
  13870. enum: ["created", "updated"],
  13871. type: "string"
  13872. }
  13873. },
  13874. url: "/user/starred"
  13875. },
  13876. listReposStarredByUser: {
  13877. method: "GET",
  13878. params: {
  13879. direction: {
  13880. enum: ["asc", "desc"],
  13881. type: "string"
  13882. },
  13883. page: {
  13884. type: "integer"
  13885. },
  13886. per_page: {
  13887. type: "integer"
  13888. },
  13889. sort: {
  13890. enum: ["created", "updated"],
  13891. type: "string"
  13892. },
  13893. username: {
  13894. required: true,
  13895. type: "string"
  13896. }
  13897. },
  13898. url: "/users/:username/starred"
  13899. },
  13900. listReposWatchedByUser: {
  13901. method: "GET",
  13902. params: {
  13903. page: {
  13904. type: "integer"
  13905. },
  13906. per_page: {
  13907. type: "integer"
  13908. },
  13909. username: {
  13910. required: true,
  13911. type: "string"
  13912. }
  13913. },
  13914. url: "/users/:username/subscriptions"
  13915. },
  13916. listStargazersForRepo: {
  13917. method: "GET",
  13918. params: {
  13919. owner: {
  13920. required: true,
  13921. type: "string"
  13922. },
  13923. page: {
  13924. type: "integer"
  13925. },
  13926. per_page: {
  13927. type: "integer"
  13928. },
  13929. repo: {
  13930. required: true,
  13931. type: "string"
  13932. }
  13933. },
  13934. url: "/repos/:owner/:repo/stargazers"
  13935. },
  13936. listWatchedReposForAuthenticatedUser: {
  13937. method: "GET",
  13938. params: {
  13939. page: {
  13940. type: "integer"
  13941. },
  13942. per_page: {
  13943. type: "integer"
  13944. }
  13945. },
  13946. url: "/user/subscriptions"
  13947. },
  13948. listWatchersForRepo: {
  13949. method: "GET",
  13950. params: {
  13951. owner: {
  13952. required: true,
  13953. type: "string"
  13954. },
  13955. page: {
  13956. type: "integer"
  13957. },
  13958. per_page: {
  13959. type: "integer"
  13960. },
  13961. repo: {
  13962. required: true,
  13963. type: "string"
  13964. }
  13965. },
  13966. url: "/repos/:owner/:repo/subscribers"
  13967. },
  13968. markAsRead: {
  13969. method: "PUT",
  13970. params: {
  13971. last_read_at: {
  13972. type: "string"
  13973. }
  13974. },
  13975. url: "/notifications"
  13976. },
  13977. markNotificationsAsReadForRepo: {
  13978. method: "PUT",
  13979. params: {
  13980. last_read_at: {
  13981. type: "string"
  13982. },
  13983. owner: {
  13984. required: true,
  13985. type: "string"
  13986. },
  13987. repo: {
  13988. required: true,
  13989. type: "string"
  13990. }
  13991. },
  13992. url: "/repos/:owner/:repo/notifications"
  13993. },
  13994. markThreadAsRead: {
  13995. method: "PATCH",
  13996. params: {
  13997. thread_id: {
  13998. required: true,
  13999. type: "integer"
  14000. }
  14001. },
  14002. url: "/notifications/threads/:thread_id"
  14003. },
  14004. setRepoSubscription: {
  14005. method: "PUT",
  14006. params: {
  14007. ignored: {
  14008. type: "boolean"
  14009. },
  14010. owner: {
  14011. required: true,
  14012. type: "string"
  14013. },
  14014. repo: {
  14015. required: true,
  14016. type: "string"
  14017. },
  14018. subscribed: {
  14019. type: "boolean"
  14020. }
  14021. },
  14022. url: "/repos/:owner/:repo/subscription"
  14023. },
  14024. setThreadSubscription: {
  14025. method: "PUT",
  14026. params: {
  14027. ignored: {
  14028. type: "boolean"
  14029. },
  14030. thread_id: {
  14031. required: true,
  14032. type: "integer"
  14033. }
  14034. },
  14035. url: "/notifications/threads/:thread_id/subscription"
  14036. },
  14037. starRepo: {
  14038. method: "PUT",
  14039. params: {
  14040. owner: {
  14041. required: true,
  14042. type: "string"
  14043. },
  14044. repo: {
  14045. required: true,
  14046. type: "string"
  14047. }
  14048. },
  14049. url: "/user/starred/:owner/:repo"
  14050. },
  14051. unstarRepo: {
  14052. method: "DELETE",
  14053. params: {
  14054. owner: {
  14055. required: true,
  14056. type: "string"
  14057. },
  14058. repo: {
  14059. required: true,
  14060. type: "string"
  14061. }
  14062. },
  14063. url: "/user/starred/:owner/:repo"
  14064. }
  14065. },
  14066. apps: {
  14067. addRepoToInstallation: {
  14068. headers: {
  14069. accept: "application/vnd.github.machine-man-preview+json"
  14070. },
  14071. method: "PUT",
  14072. params: {
  14073. installation_id: {
  14074. required: true,
  14075. type: "integer"
  14076. },
  14077. repository_id: {
  14078. required: true,
  14079. type: "integer"
  14080. }
  14081. },
  14082. url: "/user/installations/:installation_id/repositories/:repository_id"
  14083. },
  14084. checkAccountIsAssociatedWithAny: {
  14085. method: "GET",
  14086. params: {
  14087. account_id: {
  14088. required: true,
  14089. type: "integer"
  14090. }
  14091. },
  14092. url: "/marketplace_listing/accounts/:account_id"
  14093. },
  14094. checkAccountIsAssociatedWithAnyStubbed: {
  14095. method: "GET",
  14096. params: {
  14097. account_id: {
  14098. required: true,
  14099. type: "integer"
  14100. }
  14101. },
  14102. url: "/marketplace_listing/stubbed/accounts/:account_id"
  14103. },
  14104. checkAuthorization: {
  14105. deprecated: "octokit.apps.checkAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#check-an-authorization",
  14106. method: "GET",
  14107. params: {
  14108. access_token: {
  14109. required: true,
  14110. type: "string"
  14111. },
  14112. client_id: {
  14113. required: true,
  14114. type: "string"
  14115. }
  14116. },
  14117. url: "/applications/:client_id/tokens/:access_token"
  14118. },
  14119. checkToken: {
  14120. headers: {
  14121. accept: "application/vnd.github.doctor-strange-preview+json"
  14122. },
  14123. method: "POST",
  14124. params: {
  14125. access_token: {
  14126. type: "string"
  14127. },
  14128. client_id: {
  14129. required: true,
  14130. type: "string"
  14131. }
  14132. },
  14133. url: "/applications/:client_id/token"
  14134. },
  14135. createContentAttachment: {
  14136. headers: {
  14137. accept: "application/vnd.github.corsair-preview+json"
  14138. },
  14139. method: "POST",
  14140. params: {
  14141. body: {
  14142. required: true,
  14143. type: "string"
  14144. },
  14145. content_reference_id: {
  14146. required: true,
  14147. type: "integer"
  14148. },
  14149. title: {
  14150. required: true,
  14151. type: "string"
  14152. }
  14153. },
  14154. url: "/content_references/:content_reference_id/attachments"
  14155. },
  14156. createFromManifest: {
  14157. headers: {
  14158. accept: "application/vnd.github.fury-preview+json"
  14159. },
  14160. method: "POST",
  14161. params: {
  14162. code: {
  14163. required: true,
  14164. type: "string"
  14165. }
  14166. },
  14167. url: "/app-manifests/:code/conversions"
  14168. },
  14169. createInstallationToken: {
  14170. headers: {
  14171. accept: "application/vnd.github.machine-man-preview+json"
  14172. },
  14173. method: "POST",
  14174. params: {
  14175. installation_id: {
  14176. required: true,
  14177. type: "integer"
  14178. },
  14179. permissions: {
  14180. type: "object"
  14181. },
  14182. repository_ids: {
  14183. type: "integer[]"
  14184. }
  14185. },
  14186. url: "/app/installations/:installation_id/access_tokens"
  14187. },
  14188. deleteAuthorization: {
  14189. headers: {
  14190. accept: "application/vnd.github.doctor-strange-preview+json"
  14191. },
  14192. method: "DELETE",
  14193. params: {
  14194. access_token: {
  14195. type: "string"
  14196. },
  14197. client_id: {
  14198. required: true,
  14199. type: "string"
  14200. }
  14201. },
  14202. url: "/applications/:client_id/grant"
  14203. },
  14204. deleteInstallation: {
  14205. headers: {
  14206. accept: "application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"
  14207. },
  14208. method: "DELETE",
  14209. params: {
  14210. installation_id: {
  14211. required: true,
  14212. type: "integer"
  14213. }
  14214. },
  14215. url: "/app/installations/:installation_id"
  14216. },
  14217. deleteToken: {
  14218. headers: {
  14219. accept: "application/vnd.github.doctor-strange-preview+json"
  14220. },
  14221. method: "DELETE",
  14222. params: {
  14223. access_token: {
  14224. type: "string"
  14225. },
  14226. client_id: {
  14227. required: true,
  14228. type: "string"
  14229. }
  14230. },
  14231. url: "/applications/:client_id/token"
  14232. },
  14233. findOrgInstallation: {
  14234. deprecated: "octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)",
  14235. headers: {
  14236. accept: "application/vnd.github.machine-man-preview+json"
  14237. },
  14238. method: "GET",
  14239. params: {
  14240. org: {
  14241. required: true,
  14242. type: "string"
  14243. }
  14244. },
  14245. url: "/orgs/:org/installation"
  14246. },
  14247. findRepoInstallation: {
  14248. deprecated: "octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)",
  14249. headers: {
  14250. accept: "application/vnd.github.machine-man-preview+json"
  14251. },
  14252. method: "GET",
  14253. params: {
  14254. owner: {
  14255. required: true,
  14256. type: "string"
  14257. },
  14258. repo: {
  14259. required: true,
  14260. type: "string"
  14261. }
  14262. },
  14263. url: "/repos/:owner/:repo/installation"
  14264. },
  14265. findUserInstallation: {
  14266. deprecated: "octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)",
  14267. headers: {
  14268. accept: "application/vnd.github.machine-man-preview+json"
  14269. },
  14270. method: "GET",
  14271. params: {
  14272. username: {
  14273. required: true,
  14274. type: "string"
  14275. }
  14276. },
  14277. url: "/users/:username/installation"
  14278. },
  14279. getAuthenticated: {
  14280. headers: {
  14281. accept: "application/vnd.github.machine-man-preview+json"
  14282. },
  14283. method: "GET",
  14284. params: {},
  14285. url: "/app"
  14286. },
  14287. getBySlug: {
  14288. headers: {
  14289. accept: "application/vnd.github.machine-man-preview+json"
  14290. },
  14291. method: "GET",
  14292. params: {
  14293. app_slug: {
  14294. required: true,
  14295. type: "string"
  14296. }
  14297. },
  14298. url: "/apps/:app_slug"
  14299. },
  14300. getInstallation: {
  14301. headers: {
  14302. accept: "application/vnd.github.machine-man-preview+json"
  14303. },
  14304. method: "GET",
  14305. params: {
  14306. installation_id: {
  14307. required: true,
  14308. type: "integer"
  14309. }
  14310. },
  14311. url: "/app/installations/:installation_id"
  14312. },
  14313. getOrgInstallation: {
  14314. headers: {
  14315. accept: "application/vnd.github.machine-man-preview+json"
  14316. },
  14317. method: "GET",
  14318. params: {
  14319. org: {
  14320. required: true,
  14321. type: "string"
  14322. }
  14323. },
  14324. url: "/orgs/:org/installation"
  14325. },
  14326. getRepoInstallation: {
  14327. headers: {
  14328. accept: "application/vnd.github.machine-man-preview+json"
  14329. },
  14330. method: "GET",
  14331. params: {
  14332. owner: {
  14333. required: true,
  14334. type: "string"
  14335. },
  14336. repo: {
  14337. required: true,
  14338. type: "string"
  14339. }
  14340. },
  14341. url: "/repos/:owner/:repo/installation"
  14342. },
  14343. getUserInstallation: {
  14344. headers: {
  14345. accept: "application/vnd.github.machine-man-preview+json"
  14346. },
  14347. method: "GET",
  14348. params: {
  14349. username: {
  14350. required: true,
  14351. type: "string"
  14352. }
  14353. },
  14354. url: "/users/:username/installation"
  14355. },
  14356. listAccountsUserOrOrgOnPlan: {
  14357. method: "GET",
  14358. params: {
  14359. direction: {
  14360. enum: ["asc", "desc"],
  14361. type: "string"
  14362. },
  14363. page: {
  14364. type: "integer"
  14365. },
  14366. per_page: {
  14367. type: "integer"
  14368. },
  14369. plan_id: {
  14370. required: true,
  14371. type: "integer"
  14372. },
  14373. sort: {
  14374. enum: ["created", "updated"],
  14375. type: "string"
  14376. }
  14377. },
  14378. url: "/marketplace_listing/plans/:plan_id/accounts"
  14379. },
  14380. listAccountsUserOrOrgOnPlanStubbed: {
  14381. method: "GET",
  14382. params: {
  14383. direction: {
  14384. enum: ["asc", "desc"],
  14385. type: "string"
  14386. },
  14387. page: {
  14388. type: "integer"
  14389. },
  14390. per_page: {
  14391. type: "integer"
  14392. },
  14393. plan_id: {
  14394. required: true,
  14395. type: "integer"
  14396. },
  14397. sort: {
  14398. enum: ["created", "updated"],
  14399. type: "string"
  14400. }
  14401. },
  14402. url: "/marketplace_listing/stubbed/plans/:plan_id/accounts"
  14403. },
  14404. listInstallationReposForAuthenticatedUser: {
  14405. headers: {
  14406. accept: "application/vnd.github.machine-man-preview+json"
  14407. },
  14408. method: "GET",
  14409. params: {
  14410. installation_id: {
  14411. required: true,
  14412. type: "integer"
  14413. },
  14414. page: {
  14415. type: "integer"
  14416. },
  14417. per_page: {
  14418. type: "integer"
  14419. }
  14420. },
  14421. url: "/user/installations/:installation_id/repositories"
  14422. },
  14423. listInstallations: {
  14424. headers: {
  14425. accept: "application/vnd.github.machine-man-preview+json"
  14426. },
  14427. method: "GET",
  14428. params: {
  14429. page: {
  14430. type: "integer"
  14431. },
  14432. per_page: {
  14433. type: "integer"
  14434. }
  14435. },
  14436. url: "/app/installations"
  14437. },
  14438. listInstallationsForAuthenticatedUser: {
  14439. headers: {
  14440. accept: "application/vnd.github.machine-man-preview+json"
  14441. },
  14442. method: "GET",
  14443. params: {
  14444. page: {
  14445. type: "integer"
  14446. },
  14447. per_page: {
  14448. type: "integer"
  14449. }
  14450. },
  14451. url: "/user/installations"
  14452. },
  14453. listMarketplacePurchasesForAuthenticatedUser: {
  14454. method: "GET",
  14455. params: {
  14456. page: {
  14457. type: "integer"
  14458. },
  14459. per_page: {
  14460. type: "integer"
  14461. }
  14462. },
  14463. url: "/user/marketplace_purchases"
  14464. },
  14465. listMarketplacePurchasesForAuthenticatedUserStubbed: {
  14466. method: "GET",
  14467. params: {
  14468. page: {
  14469. type: "integer"
  14470. },
  14471. per_page: {
  14472. type: "integer"
  14473. }
  14474. },
  14475. url: "/user/marketplace_purchases/stubbed"
  14476. },
  14477. listPlans: {
  14478. method: "GET",
  14479. params: {
  14480. page: {
  14481. type: "integer"
  14482. },
  14483. per_page: {
  14484. type: "integer"
  14485. }
  14486. },
  14487. url: "/marketplace_listing/plans"
  14488. },
  14489. listPlansStubbed: {
  14490. method: "GET",
  14491. params: {
  14492. page: {
  14493. type: "integer"
  14494. },
  14495. per_page: {
  14496. type: "integer"
  14497. }
  14498. },
  14499. url: "/marketplace_listing/stubbed/plans"
  14500. },
  14501. listRepos: {
  14502. headers: {
  14503. accept: "application/vnd.github.machine-man-preview+json"
  14504. },
  14505. method: "GET",
  14506. params: {
  14507. page: {
  14508. type: "integer"
  14509. },
  14510. per_page: {
  14511. type: "integer"
  14512. }
  14513. },
  14514. url: "/installation/repositories"
  14515. },
  14516. removeRepoFromInstallation: {
  14517. headers: {
  14518. accept: "application/vnd.github.machine-man-preview+json"
  14519. },
  14520. method: "DELETE",
  14521. params: {
  14522. installation_id: {
  14523. required: true,
  14524. type: "integer"
  14525. },
  14526. repository_id: {
  14527. required: true,
  14528. type: "integer"
  14529. }
  14530. },
  14531. url: "/user/installations/:installation_id/repositories/:repository_id"
  14532. },
  14533. resetAuthorization: {
  14534. deprecated: "octokit.apps.resetAuthorization() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#reset-an-authorization",
  14535. method: "POST",
  14536. params: {
  14537. access_token: {
  14538. required: true,
  14539. type: "string"
  14540. },
  14541. client_id: {
  14542. required: true,
  14543. type: "string"
  14544. }
  14545. },
  14546. url: "/applications/:client_id/tokens/:access_token"
  14547. },
  14548. resetToken: {
  14549. headers: {
  14550. accept: "application/vnd.github.doctor-strange-preview+json"
  14551. },
  14552. method: "PATCH",
  14553. params: {
  14554. access_token: {
  14555. type: "string"
  14556. },
  14557. client_id: {
  14558. required: true,
  14559. type: "string"
  14560. }
  14561. },
  14562. url: "/applications/:client_id/token"
  14563. },
  14564. revokeAuthorizationForApplication: {
  14565. deprecated: "octokit.apps.revokeAuthorizationForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-an-authorization-for-an-application",
  14566. method: "DELETE",
  14567. params: {
  14568. access_token: {
  14569. required: true,
  14570. type: "string"
  14571. },
  14572. client_id: {
  14573. required: true,
  14574. type: "string"
  14575. }
  14576. },
  14577. url: "/applications/:client_id/tokens/:access_token"
  14578. },
  14579. revokeGrantForApplication: {
  14580. deprecated: "octokit.apps.revokeGrantForApplication() is deprecated, see https://developer.github.com/v3/apps/oauth_applications/#revoke-a-grant-for-an-application",
  14581. method: "DELETE",
  14582. params: {
  14583. access_token: {
  14584. required: true,
  14585. type: "string"
  14586. },
  14587. client_id: {
  14588. required: true,
  14589. type: "string"
  14590. }
  14591. },
  14592. url: "/applications/:client_id/grants/:access_token"
  14593. },
  14594. revokeInstallationToken: {
  14595. headers: {
  14596. accept: "application/vnd.github.gambit-preview+json"
  14597. },
  14598. method: "DELETE",
  14599. params: {},
  14600. url: "/installation/token"
  14601. }
  14602. },
  14603. checks: {
  14604. create: {
  14605. headers: {
  14606. accept: "application/vnd.github.antiope-preview+json"
  14607. },
  14608. method: "POST",
  14609. params: {
  14610. actions: {
  14611. type: "object[]"
  14612. },
  14613. "actions[].description": {
  14614. required: true,
  14615. type: "string"
  14616. },
  14617. "actions[].identifier": {
  14618. required: true,
  14619. type: "string"
  14620. },
  14621. "actions[].label": {
  14622. required: true,
  14623. type: "string"
  14624. },
  14625. completed_at: {
  14626. type: "string"
  14627. },
  14628. conclusion: {
  14629. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  14630. type: "string"
  14631. },
  14632. details_url: {
  14633. type: "string"
  14634. },
  14635. external_id: {
  14636. type: "string"
  14637. },
  14638. head_sha: {
  14639. required: true,
  14640. type: "string"
  14641. },
  14642. name: {
  14643. required: true,
  14644. type: "string"
  14645. },
  14646. output: {
  14647. type: "object"
  14648. },
  14649. "output.annotations": {
  14650. type: "object[]"
  14651. },
  14652. "output.annotations[].annotation_level": {
  14653. enum: ["notice", "warning", "failure"],
  14654. required: true,
  14655. type: "string"
  14656. },
  14657. "output.annotations[].end_column": {
  14658. type: "integer"
  14659. },
  14660. "output.annotations[].end_line": {
  14661. required: true,
  14662. type: "integer"
  14663. },
  14664. "output.annotations[].message": {
  14665. required: true,
  14666. type: "string"
  14667. },
  14668. "output.annotations[].path": {
  14669. required: true,
  14670. type: "string"
  14671. },
  14672. "output.annotations[].raw_details": {
  14673. type: "string"
  14674. },
  14675. "output.annotations[].start_column": {
  14676. type: "integer"
  14677. },
  14678. "output.annotations[].start_line": {
  14679. required: true,
  14680. type: "integer"
  14681. },
  14682. "output.annotations[].title": {
  14683. type: "string"
  14684. },
  14685. "output.images": {
  14686. type: "object[]"
  14687. },
  14688. "output.images[].alt": {
  14689. required: true,
  14690. type: "string"
  14691. },
  14692. "output.images[].caption": {
  14693. type: "string"
  14694. },
  14695. "output.images[].image_url": {
  14696. required: true,
  14697. type: "string"
  14698. },
  14699. "output.summary": {
  14700. required: true,
  14701. type: "string"
  14702. },
  14703. "output.text": {
  14704. type: "string"
  14705. },
  14706. "output.title": {
  14707. required: true,
  14708. type: "string"
  14709. },
  14710. owner: {
  14711. required: true,
  14712. type: "string"
  14713. },
  14714. repo: {
  14715. required: true,
  14716. type: "string"
  14717. },
  14718. started_at: {
  14719. type: "string"
  14720. },
  14721. status: {
  14722. enum: ["queued", "in_progress", "completed"],
  14723. type: "string"
  14724. }
  14725. },
  14726. url: "/repos/:owner/:repo/check-runs"
  14727. },
  14728. createSuite: {
  14729. headers: {
  14730. accept: "application/vnd.github.antiope-preview+json"
  14731. },
  14732. method: "POST",
  14733. params: {
  14734. head_sha: {
  14735. required: true,
  14736. type: "string"
  14737. },
  14738. owner: {
  14739. required: true,
  14740. type: "string"
  14741. },
  14742. repo: {
  14743. required: true,
  14744. type: "string"
  14745. }
  14746. },
  14747. url: "/repos/:owner/:repo/check-suites"
  14748. },
  14749. get: {
  14750. headers: {
  14751. accept: "application/vnd.github.antiope-preview+json"
  14752. },
  14753. method: "GET",
  14754. params: {
  14755. check_run_id: {
  14756. required: true,
  14757. type: "integer"
  14758. },
  14759. owner: {
  14760. required: true,
  14761. type: "string"
  14762. },
  14763. repo: {
  14764. required: true,
  14765. type: "string"
  14766. }
  14767. },
  14768. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  14769. },
  14770. getSuite: {
  14771. headers: {
  14772. accept: "application/vnd.github.antiope-preview+json"
  14773. },
  14774. method: "GET",
  14775. params: {
  14776. check_suite_id: {
  14777. required: true,
  14778. type: "integer"
  14779. },
  14780. owner: {
  14781. required: true,
  14782. type: "string"
  14783. },
  14784. repo: {
  14785. required: true,
  14786. type: "string"
  14787. }
  14788. },
  14789. url: "/repos/:owner/:repo/check-suites/:check_suite_id"
  14790. },
  14791. listAnnotations: {
  14792. headers: {
  14793. accept: "application/vnd.github.antiope-preview+json"
  14794. },
  14795. method: "GET",
  14796. params: {
  14797. check_run_id: {
  14798. required: true,
  14799. type: "integer"
  14800. },
  14801. owner: {
  14802. required: true,
  14803. type: "string"
  14804. },
  14805. page: {
  14806. type: "integer"
  14807. },
  14808. per_page: {
  14809. type: "integer"
  14810. },
  14811. repo: {
  14812. required: true,
  14813. type: "string"
  14814. }
  14815. },
  14816. url: "/repos/:owner/:repo/check-runs/:check_run_id/annotations"
  14817. },
  14818. listForRef: {
  14819. headers: {
  14820. accept: "application/vnd.github.antiope-preview+json"
  14821. },
  14822. method: "GET",
  14823. params: {
  14824. check_name: {
  14825. type: "string"
  14826. },
  14827. filter: {
  14828. enum: ["latest", "all"],
  14829. type: "string"
  14830. },
  14831. owner: {
  14832. required: true,
  14833. type: "string"
  14834. },
  14835. page: {
  14836. type: "integer"
  14837. },
  14838. per_page: {
  14839. type: "integer"
  14840. },
  14841. ref: {
  14842. required: true,
  14843. type: "string"
  14844. },
  14845. repo: {
  14846. required: true,
  14847. type: "string"
  14848. },
  14849. status: {
  14850. enum: ["queued", "in_progress", "completed"],
  14851. type: "string"
  14852. }
  14853. },
  14854. url: "/repos/:owner/:repo/commits/:ref/check-runs"
  14855. },
  14856. listForSuite: {
  14857. headers: {
  14858. accept: "application/vnd.github.antiope-preview+json"
  14859. },
  14860. method: "GET",
  14861. params: {
  14862. check_name: {
  14863. type: "string"
  14864. },
  14865. check_suite_id: {
  14866. required: true,
  14867. type: "integer"
  14868. },
  14869. filter: {
  14870. enum: ["latest", "all"],
  14871. type: "string"
  14872. },
  14873. owner: {
  14874. required: true,
  14875. type: "string"
  14876. },
  14877. page: {
  14878. type: "integer"
  14879. },
  14880. per_page: {
  14881. type: "integer"
  14882. },
  14883. repo: {
  14884. required: true,
  14885. type: "string"
  14886. },
  14887. status: {
  14888. enum: ["queued", "in_progress", "completed"],
  14889. type: "string"
  14890. }
  14891. },
  14892. url: "/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"
  14893. },
  14894. listSuitesForRef: {
  14895. headers: {
  14896. accept: "application/vnd.github.antiope-preview+json"
  14897. },
  14898. method: "GET",
  14899. params: {
  14900. app_id: {
  14901. type: "integer"
  14902. },
  14903. check_name: {
  14904. type: "string"
  14905. },
  14906. owner: {
  14907. required: true,
  14908. type: "string"
  14909. },
  14910. page: {
  14911. type: "integer"
  14912. },
  14913. per_page: {
  14914. type: "integer"
  14915. },
  14916. ref: {
  14917. required: true,
  14918. type: "string"
  14919. },
  14920. repo: {
  14921. required: true,
  14922. type: "string"
  14923. }
  14924. },
  14925. url: "/repos/:owner/:repo/commits/:ref/check-suites"
  14926. },
  14927. rerequestSuite: {
  14928. headers: {
  14929. accept: "application/vnd.github.antiope-preview+json"
  14930. },
  14931. method: "POST",
  14932. params: {
  14933. check_suite_id: {
  14934. required: true,
  14935. type: "integer"
  14936. },
  14937. owner: {
  14938. required: true,
  14939. type: "string"
  14940. },
  14941. repo: {
  14942. required: true,
  14943. type: "string"
  14944. }
  14945. },
  14946. url: "/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"
  14947. },
  14948. setSuitesPreferences: {
  14949. headers: {
  14950. accept: "application/vnd.github.antiope-preview+json"
  14951. },
  14952. method: "PATCH",
  14953. params: {
  14954. auto_trigger_checks: {
  14955. type: "object[]"
  14956. },
  14957. "auto_trigger_checks[].app_id": {
  14958. required: true,
  14959. type: "integer"
  14960. },
  14961. "auto_trigger_checks[].setting": {
  14962. required: true,
  14963. type: "boolean"
  14964. },
  14965. owner: {
  14966. required: true,
  14967. type: "string"
  14968. },
  14969. repo: {
  14970. required: true,
  14971. type: "string"
  14972. }
  14973. },
  14974. url: "/repos/:owner/:repo/check-suites/preferences"
  14975. },
  14976. update: {
  14977. headers: {
  14978. accept: "application/vnd.github.antiope-preview+json"
  14979. },
  14980. method: "PATCH",
  14981. params: {
  14982. actions: {
  14983. type: "object[]"
  14984. },
  14985. "actions[].description": {
  14986. required: true,
  14987. type: "string"
  14988. },
  14989. "actions[].identifier": {
  14990. required: true,
  14991. type: "string"
  14992. },
  14993. "actions[].label": {
  14994. required: true,
  14995. type: "string"
  14996. },
  14997. check_run_id: {
  14998. required: true,
  14999. type: "integer"
  15000. },
  15001. completed_at: {
  15002. type: "string"
  15003. },
  15004. conclusion: {
  15005. enum: ["success", "failure", "neutral", "cancelled", "timed_out", "action_required"],
  15006. type: "string"
  15007. },
  15008. details_url: {
  15009. type: "string"
  15010. },
  15011. external_id: {
  15012. type: "string"
  15013. },
  15014. name: {
  15015. type: "string"
  15016. },
  15017. output: {
  15018. type: "object"
  15019. },
  15020. "output.annotations": {
  15021. type: "object[]"
  15022. },
  15023. "output.annotations[].annotation_level": {
  15024. enum: ["notice", "warning", "failure"],
  15025. required: true,
  15026. type: "string"
  15027. },
  15028. "output.annotations[].end_column": {
  15029. type: "integer"
  15030. },
  15031. "output.annotations[].end_line": {
  15032. required: true,
  15033. type: "integer"
  15034. },
  15035. "output.annotations[].message": {
  15036. required: true,
  15037. type: "string"
  15038. },
  15039. "output.annotations[].path": {
  15040. required: true,
  15041. type: "string"
  15042. },
  15043. "output.annotations[].raw_details": {
  15044. type: "string"
  15045. },
  15046. "output.annotations[].start_column": {
  15047. type: "integer"
  15048. },
  15049. "output.annotations[].start_line": {
  15050. required: true,
  15051. type: "integer"
  15052. },
  15053. "output.annotations[].title": {
  15054. type: "string"
  15055. },
  15056. "output.images": {
  15057. type: "object[]"
  15058. },
  15059. "output.images[].alt": {
  15060. required: true,
  15061. type: "string"
  15062. },
  15063. "output.images[].caption": {
  15064. type: "string"
  15065. },
  15066. "output.images[].image_url": {
  15067. required: true,
  15068. type: "string"
  15069. },
  15070. "output.summary": {
  15071. required: true,
  15072. type: "string"
  15073. },
  15074. "output.text": {
  15075. type: "string"
  15076. },
  15077. "output.title": {
  15078. type: "string"
  15079. },
  15080. owner: {
  15081. required: true,
  15082. type: "string"
  15083. },
  15084. repo: {
  15085. required: true,
  15086. type: "string"
  15087. },
  15088. started_at: {
  15089. type: "string"
  15090. },
  15091. status: {
  15092. enum: ["queued", "in_progress", "completed"],
  15093. type: "string"
  15094. }
  15095. },
  15096. url: "/repos/:owner/:repo/check-runs/:check_run_id"
  15097. }
  15098. },
  15099. codesOfConduct: {
  15100. getConductCode: {
  15101. headers: {
  15102. accept: "application/vnd.github.scarlet-witch-preview+json"
  15103. },
  15104. method: "GET",
  15105. params: {
  15106. key: {
  15107. required: true,
  15108. type: "string"
  15109. }
  15110. },
  15111. url: "/codes_of_conduct/:key"
  15112. },
  15113. getForRepo: {
  15114. headers: {
  15115. accept: "application/vnd.github.scarlet-witch-preview+json"
  15116. },
  15117. method: "GET",
  15118. params: {
  15119. owner: {
  15120. required: true,
  15121. type: "string"
  15122. },
  15123. repo: {
  15124. required: true,
  15125. type: "string"
  15126. }
  15127. },
  15128. url: "/repos/:owner/:repo/community/code_of_conduct"
  15129. },
  15130. listConductCodes: {
  15131. headers: {
  15132. accept: "application/vnd.github.scarlet-witch-preview+json"
  15133. },
  15134. method: "GET",
  15135. params: {},
  15136. url: "/codes_of_conduct"
  15137. }
  15138. },
  15139. emojis: {
  15140. get: {
  15141. method: "GET",
  15142. params: {},
  15143. url: "/emojis"
  15144. }
  15145. },
  15146. gists: {
  15147. checkIsStarred: {
  15148. method: "GET",
  15149. params: {
  15150. gist_id: {
  15151. required: true,
  15152. type: "string"
  15153. }
  15154. },
  15155. url: "/gists/:gist_id/star"
  15156. },
  15157. create: {
  15158. method: "POST",
  15159. params: {
  15160. description: {
  15161. type: "string"
  15162. },
  15163. files: {
  15164. required: true,
  15165. type: "object"
  15166. },
  15167. "files.content": {
  15168. type: "string"
  15169. },
  15170. public: {
  15171. type: "boolean"
  15172. }
  15173. },
  15174. url: "/gists"
  15175. },
  15176. createComment: {
  15177. method: "POST",
  15178. params: {
  15179. body: {
  15180. required: true,
  15181. type: "string"
  15182. },
  15183. gist_id: {
  15184. required: true,
  15185. type: "string"
  15186. }
  15187. },
  15188. url: "/gists/:gist_id/comments"
  15189. },
  15190. delete: {
  15191. method: "DELETE",
  15192. params: {
  15193. gist_id: {
  15194. required: true,
  15195. type: "string"
  15196. }
  15197. },
  15198. url: "/gists/:gist_id"
  15199. },
  15200. deleteComment: {
  15201. method: "DELETE",
  15202. params: {
  15203. comment_id: {
  15204. required: true,
  15205. type: "integer"
  15206. },
  15207. gist_id: {
  15208. required: true,
  15209. type: "string"
  15210. }
  15211. },
  15212. url: "/gists/:gist_id/comments/:comment_id"
  15213. },
  15214. fork: {
  15215. method: "POST",
  15216. params: {
  15217. gist_id: {
  15218. required: true,
  15219. type: "string"
  15220. }
  15221. },
  15222. url: "/gists/:gist_id/forks"
  15223. },
  15224. get: {
  15225. method: "GET",
  15226. params: {
  15227. gist_id: {
  15228. required: true,
  15229. type: "string"
  15230. }
  15231. },
  15232. url: "/gists/:gist_id"
  15233. },
  15234. getComment: {
  15235. method: "GET",
  15236. params: {
  15237. comment_id: {
  15238. required: true,
  15239. type: "integer"
  15240. },
  15241. gist_id: {
  15242. required: true,
  15243. type: "string"
  15244. }
  15245. },
  15246. url: "/gists/:gist_id/comments/:comment_id"
  15247. },
  15248. getRevision: {
  15249. method: "GET",
  15250. params: {
  15251. gist_id: {
  15252. required: true,
  15253. type: "string"
  15254. },
  15255. sha: {
  15256. required: true,
  15257. type: "string"
  15258. }
  15259. },
  15260. url: "/gists/:gist_id/:sha"
  15261. },
  15262. list: {
  15263. method: "GET",
  15264. params: {
  15265. page: {
  15266. type: "integer"
  15267. },
  15268. per_page: {
  15269. type: "integer"
  15270. },
  15271. since: {
  15272. type: "string"
  15273. }
  15274. },
  15275. url: "/gists"
  15276. },
  15277. listComments: {
  15278. method: "GET",
  15279. params: {
  15280. gist_id: {
  15281. required: true,
  15282. type: "string"
  15283. },
  15284. page: {
  15285. type: "integer"
  15286. },
  15287. per_page: {
  15288. type: "integer"
  15289. }
  15290. },
  15291. url: "/gists/:gist_id/comments"
  15292. },
  15293. listCommits: {
  15294. method: "GET",
  15295. params: {
  15296. gist_id: {
  15297. required: true,
  15298. type: "string"
  15299. },
  15300. page: {
  15301. type: "integer"
  15302. },
  15303. per_page: {
  15304. type: "integer"
  15305. }
  15306. },
  15307. url: "/gists/:gist_id/commits"
  15308. },
  15309. listForks: {
  15310. method: "GET",
  15311. params: {
  15312. gist_id: {
  15313. required: true,
  15314. type: "string"
  15315. },
  15316. page: {
  15317. type: "integer"
  15318. },
  15319. per_page: {
  15320. type: "integer"
  15321. }
  15322. },
  15323. url: "/gists/:gist_id/forks"
  15324. },
  15325. listPublic: {
  15326. method: "GET",
  15327. params: {
  15328. page: {
  15329. type: "integer"
  15330. },
  15331. per_page: {
  15332. type: "integer"
  15333. },
  15334. since: {
  15335. type: "string"
  15336. }
  15337. },
  15338. url: "/gists/public"
  15339. },
  15340. listPublicForUser: {
  15341. method: "GET",
  15342. params: {
  15343. page: {
  15344. type: "integer"
  15345. },
  15346. per_page: {
  15347. type: "integer"
  15348. },
  15349. since: {
  15350. type: "string"
  15351. },
  15352. username: {
  15353. required: true,
  15354. type: "string"
  15355. }
  15356. },
  15357. url: "/users/:username/gists"
  15358. },
  15359. listStarred: {
  15360. method: "GET",
  15361. params: {
  15362. page: {
  15363. type: "integer"
  15364. },
  15365. per_page: {
  15366. type: "integer"
  15367. },
  15368. since: {
  15369. type: "string"
  15370. }
  15371. },
  15372. url: "/gists/starred"
  15373. },
  15374. star: {
  15375. method: "PUT",
  15376. params: {
  15377. gist_id: {
  15378. required: true,
  15379. type: "string"
  15380. }
  15381. },
  15382. url: "/gists/:gist_id/star"
  15383. },
  15384. unstar: {
  15385. method: "DELETE",
  15386. params: {
  15387. gist_id: {
  15388. required: true,
  15389. type: "string"
  15390. }
  15391. },
  15392. url: "/gists/:gist_id/star"
  15393. },
  15394. update: {
  15395. method: "PATCH",
  15396. params: {
  15397. description: {
  15398. type: "string"
  15399. },
  15400. files: {
  15401. type: "object"
  15402. },
  15403. "files.content": {
  15404. type: "string"
  15405. },
  15406. "files.filename": {
  15407. type: "string"
  15408. },
  15409. gist_id: {
  15410. required: true,
  15411. type: "string"
  15412. }
  15413. },
  15414. url: "/gists/:gist_id"
  15415. },
  15416. updateComment: {
  15417. method: "PATCH",
  15418. params: {
  15419. body: {
  15420. required: true,
  15421. type: "string"
  15422. },
  15423. comment_id: {
  15424. required: true,
  15425. type: "integer"
  15426. },
  15427. gist_id: {
  15428. required: true,
  15429. type: "string"
  15430. }
  15431. },
  15432. url: "/gists/:gist_id/comments/:comment_id"
  15433. }
  15434. },
  15435. git: {
  15436. createBlob: {
  15437. method: "POST",
  15438. params: {
  15439. content: {
  15440. required: true,
  15441. type: "string"
  15442. },
  15443. encoding: {
  15444. type: "string"
  15445. },
  15446. owner: {
  15447. required: true,
  15448. type: "string"
  15449. },
  15450. repo: {
  15451. required: true,
  15452. type: "string"
  15453. }
  15454. },
  15455. url: "/repos/:owner/:repo/git/blobs"
  15456. },
  15457. createCommit: {
  15458. method: "POST",
  15459. params: {
  15460. author: {
  15461. type: "object"
  15462. },
  15463. "author.date": {
  15464. type: "string"
  15465. },
  15466. "author.email": {
  15467. type: "string"
  15468. },
  15469. "author.name": {
  15470. type: "string"
  15471. },
  15472. committer: {
  15473. type: "object"
  15474. },
  15475. "committer.date": {
  15476. type: "string"
  15477. },
  15478. "committer.email": {
  15479. type: "string"
  15480. },
  15481. "committer.name": {
  15482. type: "string"
  15483. },
  15484. message: {
  15485. required: true,
  15486. type: "string"
  15487. },
  15488. owner: {
  15489. required: true,
  15490. type: "string"
  15491. },
  15492. parents: {
  15493. required: true,
  15494. type: "string[]"
  15495. },
  15496. repo: {
  15497. required: true,
  15498. type: "string"
  15499. },
  15500. signature: {
  15501. type: "string"
  15502. },
  15503. tree: {
  15504. required: true,
  15505. type: "string"
  15506. }
  15507. },
  15508. url: "/repos/:owner/:repo/git/commits"
  15509. },
  15510. createRef: {
  15511. method: "POST",
  15512. params: {
  15513. owner: {
  15514. required: true,
  15515. type: "string"
  15516. },
  15517. ref: {
  15518. required: true,
  15519. type: "string"
  15520. },
  15521. repo: {
  15522. required: true,
  15523. type: "string"
  15524. },
  15525. sha: {
  15526. required: true,
  15527. type: "string"
  15528. }
  15529. },
  15530. url: "/repos/:owner/:repo/git/refs"
  15531. },
  15532. createTag: {
  15533. method: "POST",
  15534. params: {
  15535. message: {
  15536. required: true,
  15537. type: "string"
  15538. },
  15539. object: {
  15540. required: true,
  15541. type: "string"
  15542. },
  15543. owner: {
  15544. required: true,
  15545. type: "string"
  15546. },
  15547. repo: {
  15548. required: true,
  15549. type: "string"
  15550. },
  15551. tag: {
  15552. required: true,
  15553. type: "string"
  15554. },
  15555. tagger: {
  15556. type: "object"
  15557. },
  15558. "tagger.date": {
  15559. type: "string"
  15560. },
  15561. "tagger.email": {
  15562. type: "string"
  15563. },
  15564. "tagger.name": {
  15565. type: "string"
  15566. },
  15567. type: {
  15568. enum: ["commit", "tree", "blob"],
  15569. required: true,
  15570. type: "string"
  15571. }
  15572. },
  15573. url: "/repos/:owner/:repo/git/tags"
  15574. },
  15575. createTree: {
  15576. method: "POST",
  15577. params: {
  15578. base_tree: {
  15579. type: "string"
  15580. },
  15581. owner: {
  15582. required: true,
  15583. type: "string"
  15584. },
  15585. repo: {
  15586. required: true,
  15587. type: "string"
  15588. },
  15589. tree: {
  15590. required: true,
  15591. type: "object[]"
  15592. },
  15593. "tree[].content": {
  15594. type: "string"
  15595. },
  15596. "tree[].mode": {
  15597. enum: ["100644", "100755", "040000", "160000", "120000"],
  15598. type: "string"
  15599. },
  15600. "tree[].path": {
  15601. type: "string"
  15602. },
  15603. "tree[].sha": {
  15604. allowNull: true,
  15605. type: "string"
  15606. },
  15607. "tree[].type": {
  15608. enum: ["blob", "tree", "commit"],
  15609. type: "string"
  15610. }
  15611. },
  15612. url: "/repos/:owner/:repo/git/trees"
  15613. },
  15614. deleteRef: {
  15615. method: "DELETE",
  15616. params: {
  15617. owner: {
  15618. required: true,
  15619. type: "string"
  15620. },
  15621. ref: {
  15622. required: true,
  15623. type: "string"
  15624. },
  15625. repo: {
  15626. required: true,
  15627. type: "string"
  15628. }
  15629. },
  15630. url: "/repos/:owner/:repo/git/refs/:ref"
  15631. },
  15632. getBlob: {
  15633. method: "GET",
  15634. params: {
  15635. file_sha: {
  15636. required: true,
  15637. type: "string"
  15638. },
  15639. owner: {
  15640. required: true,
  15641. type: "string"
  15642. },
  15643. repo: {
  15644. required: true,
  15645. type: "string"
  15646. }
  15647. },
  15648. url: "/repos/:owner/:repo/git/blobs/:file_sha"
  15649. },
  15650. getCommit: {
  15651. method: "GET",
  15652. params: {
  15653. commit_sha: {
  15654. required: true,
  15655. type: "string"
  15656. },
  15657. owner: {
  15658. required: true,
  15659. type: "string"
  15660. },
  15661. repo: {
  15662. required: true,
  15663. type: "string"
  15664. }
  15665. },
  15666. url: "/repos/:owner/:repo/git/commits/:commit_sha"
  15667. },
  15668. getRef: {
  15669. method: "GET",
  15670. params: {
  15671. owner: {
  15672. required: true,
  15673. type: "string"
  15674. },
  15675. ref: {
  15676. required: true,
  15677. type: "string"
  15678. },
  15679. repo: {
  15680. required: true,
  15681. type: "string"
  15682. }
  15683. },
  15684. url: "/repos/:owner/:repo/git/ref/:ref"
  15685. },
  15686. getTag: {
  15687. method: "GET",
  15688. params: {
  15689. owner: {
  15690. required: true,
  15691. type: "string"
  15692. },
  15693. repo: {
  15694. required: true,
  15695. type: "string"
  15696. },
  15697. tag_sha: {
  15698. required: true,
  15699. type: "string"
  15700. }
  15701. },
  15702. url: "/repos/:owner/:repo/git/tags/:tag_sha"
  15703. },
  15704. getTree: {
  15705. method: "GET",
  15706. params: {
  15707. owner: {
  15708. required: true,
  15709. type: "string"
  15710. },
  15711. recursive: {
  15712. enum: ["1"],
  15713. type: "integer"
  15714. },
  15715. repo: {
  15716. required: true,
  15717. type: "string"
  15718. },
  15719. tree_sha: {
  15720. required: true,
  15721. type: "string"
  15722. }
  15723. },
  15724. url: "/repos/:owner/:repo/git/trees/:tree_sha"
  15725. },
  15726. listMatchingRefs: {
  15727. method: "GET",
  15728. params: {
  15729. owner: {
  15730. required: true,
  15731. type: "string"
  15732. },
  15733. page: {
  15734. type: "integer"
  15735. },
  15736. per_page: {
  15737. type: "integer"
  15738. },
  15739. ref: {
  15740. required: true,
  15741. type: "string"
  15742. },
  15743. repo: {
  15744. required: true,
  15745. type: "string"
  15746. }
  15747. },
  15748. url: "/repos/:owner/:repo/git/matching-refs/:ref"
  15749. },
  15750. listRefs: {
  15751. method: "GET",
  15752. params: {
  15753. namespace: {
  15754. type: "string"
  15755. },
  15756. owner: {
  15757. required: true,
  15758. type: "string"
  15759. },
  15760. page: {
  15761. type: "integer"
  15762. },
  15763. per_page: {
  15764. type: "integer"
  15765. },
  15766. repo: {
  15767. required: true,
  15768. type: "string"
  15769. }
  15770. },
  15771. url: "/repos/:owner/:repo/git/refs/:namespace"
  15772. },
  15773. updateRef: {
  15774. method: "PATCH",
  15775. params: {
  15776. force: {
  15777. type: "boolean"
  15778. },
  15779. owner: {
  15780. required: true,
  15781. type: "string"
  15782. },
  15783. ref: {
  15784. required: true,
  15785. type: "string"
  15786. },
  15787. repo: {
  15788. required: true,
  15789. type: "string"
  15790. },
  15791. sha: {
  15792. required: true,
  15793. type: "string"
  15794. }
  15795. },
  15796. url: "/repos/:owner/:repo/git/refs/:ref"
  15797. }
  15798. },
  15799. gitignore: {
  15800. getTemplate: {
  15801. method: "GET",
  15802. params: {
  15803. name: {
  15804. required: true,
  15805. type: "string"
  15806. }
  15807. },
  15808. url: "/gitignore/templates/:name"
  15809. },
  15810. listTemplates: {
  15811. method: "GET",
  15812. params: {},
  15813. url: "/gitignore/templates"
  15814. }
  15815. },
  15816. interactions: {
  15817. addOrUpdateRestrictionsForOrg: {
  15818. headers: {
  15819. accept: "application/vnd.github.sombra-preview+json"
  15820. },
  15821. method: "PUT",
  15822. params: {
  15823. limit: {
  15824. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15825. required: true,
  15826. type: "string"
  15827. },
  15828. org: {
  15829. required: true,
  15830. type: "string"
  15831. }
  15832. },
  15833. url: "/orgs/:org/interaction-limits"
  15834. },
  15835. addOrUpdateRestrictionsForRepo: {
  15836. headers: {
  15837. accept: "application/vnd.github.sombra-preview+json"
  15838. },
  15839. method: "PUT",
  15840. params: {
  15841. limit: {
  15842. enum: ["existing_users", "contributors_only", "collaborators_only"],
  15843. required: true,
  15844. type: "string"
  15845. },
  15846. owner: {
  15847. required: true,
  15848. type: "string"
  15849. },
  15850. repo: {
  15851. required: true,
  15852. type: "string"
  15853. }
  15854. },
  15855. url: "/repos/:owner/:repo/interaction-limits"
  15856. },
  15857. getRestrictionsForOrg: {
  15858. headers: {
  15859. accept: "application/vnd.github.sombra-preview+json"
  15860. },
  15861. method: "GET",
  15862. params: {
  15863. org: {
  15864. required: true,
  15865. type: "string"
  15866. }
  15867. },
  15868. url: "/orgs/:org/interaction-limits"
  15869. },
  15870. getRestrictionsForRepo: {
  15871. headers: {
  15872. accept: "application/vnd.github.sombra-preview+json"
  15873. },
  15874. method: "GET",
  15875. params: {
  15876. owner: {
  15877. required: true,
  15878. type: "string"
  15879. },
  15880. repo: {
  15881. required: true,
  15882. type: "string"
  15883. }
  15884. },
  15885. url: "/repos/:owner/:repo/interaction-limits"
  15886. },
  15887. removeRestrictionsForOrg: {
  15888. headers: {
  15889. accept: "application/vnd.github.sombra-preview+json"
  15890. },
  15891. method: "DELETE",
  15892. params: {
  15893. org: {
  15894. required: true,
  15895. type: "string"
  15896. }
  15897. },
  15898. url: "/orgs/:org/interaction-limits"
  15899. },
  15900. removeRestrictionsForRepo: {
  15901. headers: {
  15902. accept: "application/vnd.github.sombra-preview+json"
  15903. },
  15904. method: "DELETE",
  15905. params: {
  15906. owner: {
  15907. required: true,
  15908. type: "string"
  15909. },
  15910. repo: {
  15911. required: true,
  15912. type: "string"
  15913. }
  15914. },
  15915. url: "/repos/:owner/:repo/interaction-limits"
  15916. }
  15917. },
  15918. issues: {
  15919. addAssignees: {
  15920. method: "POST",
  15921. params: {
  15922. assignees: {
  15923. type: "string[]"
  15924. },
  15925. issue_number: {
  15926. required: true,
  15927. type: "integer"
  15928. },
  15929. number: {
  15930. alias: "issue_number",
  15931. deprecated: true,
  15932. type: "integer"
  15933. },
  15934. owner: {
  15935. required: true,
  15936. type: "string"
  15937. },
  15938. repo: {
  15939. required: true,
  15940. type: "string"
  15941. }
  15942. },
  15943. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  15944. },
  15945. addLabels: {
  15946. method: "POST",
  15947. params: {
  15948. issue_number: {
  15949. required: true,
  15950. type: "integer"
  15951. },
  15952. labels: {
  15953. required: true,
  15954. type: "string[]"
  15955. },
  15956. number: {
  15957. alias: "issue_number",
  15958. deprecated: true,
  15959. type: "integer"
  15960. },
  15961. owner: {
  15962. required: true,
  15963. type: "string"
  15964. },
  15965. repo: {
  15966. required: true,
  15967. type: "string"
  15968. }
  15969. },
  15970. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  15971. },
  15972. checkAssignee: {
  15973. method: "GET",
  15974. params: {
  15975. assignee: {
  15976. required: true,
  15977. type: "string"
  15978. },
  15979. owner: {
  15980. required: true,
  15981. type: "string"
  15982. },
  15983. repo: {
  15984. required: true,
  15985. type: "string"
  15986. }
  15987. },
  15988. url: "/repos/:owner/:repo/assignees/:assignee"
  15989. },
  15990. create: {
  15991. method: "POST",
  15992. params: {
  15993. assignee: {
  15994. type: "string"
  15995. },
  15996. assignees: {
  15997. type: "string[]"
  15998. },
  15999. body: {
  16000. type: "string"
  16001. },
  16002. labels: {
  16003. type: "string[]"
  16004. },
  16005. milestone: {
  16006. type: "integer"
  16007. },
  16008. owner: {
  16009. required: true,
  16010. type: "string"
  16011. },
  16012. repo: {
  16013. required: true,
  16014. type: "string"
  16015. },
  16016. title: {
  16017. required: true,
  16018. type: "string"
  16019. }
  16020. },
  16021. url: "/repos/:owner/:repo/issues"
  16022. },
  16023. createComment: {
  16024. method: "POST",
  16025. params: {
  16026. body: {
  16027. required: true,
  16028. type: "string"
  16029. },
  16030. issue_number: {
  16031. required: true,
  16032. type: "integer"
  16033. },
  16034. number: {
  16035. alias: "issue_number",
  16036. deprecated: true,
  16037. type: "integer"
  16038. },
  16039. owner: {
  16040. required: true,
  16041. type: "string"
  16042. },
  16043. repo: {
  16044. required: true,
  16045. type: "string"
  16046. }
  16047. },
  16048. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16049. },
  16050. createLabel: {
  16051. method: "POST",
  16052. params: {
  16053. color: {
  16054. required: true,
  16055. type: "string"
  16056. },
  16057. description: {
  16058. type: "string"
  16059. },
  16060. name: {
  16061. required: true,
  16062. type: "string"
  16063. },
  16064. owner: {
  16065. required: true,
  16066. type: "string"
  16067. },
  16068. repo: {
  16069. required: true,
  16070. type: "string"
  16071. }
  16072. },
  16073. url: "/repos/:owner/:repo/labels"
  16074. },
  16075. createMilestone: {
  16076. method: "POST",
  16077. params: {
  16078. description: {
  16079. type: "string"
  16080. },
  16081. due_on: {
  16082. type: "string"
  16083. },
  16084. owner: {
  16085. required: true,
  16086. type: "string"
  16087. },
  16088. repo: {
  16089. required: true,
  16090. type: "string"
  16091. },
  16092. state: {
  16093. enum: ["open", "closed"],
  16094. type: "string"
  16095. },
  16096. title: {
  16097. required: true,
  16098. type: "string"
  16099. }
  16100. },
  16101. url: "/repos/:owner/:repo/milestones"
  16102. },
  16103. deleteComment: {
  16104. method: "DELETE",
  16105. params: {
  16106. comment_id: {
  16107. required: true,
  16108. type: "integer"
  16109. },
  16110. owner: {
  16111. required: true,
  16112. type: "string"
  16113. },
  16114. repo: {
  16115. required: true,
  16116. type: "string"
  16117. }
  16118. },
  16119. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16120. },
  16121. deleteLabel: {
  16122. method: "DELETE",
  16123. params: {
  16124. name: {
  16125. required: true,
  16126. type: "string"
  16127. },
  16128. owner: {
  16129. required: true,
  16130. type: "string"
  16131. },
  16132. repo: {
  16133. required: true,
  16134. type: "string"
  16135. }
  16136. },
  16137. url: "/repos/:owner/:repo/labels/:name"
  16138. },
  16139. deleteMilestone: {
  16140. method: "DELETE",
  16141. params: {
  16142. milestone_number: {
  16143. required: true,
  16144. type: "integer"
  16145. },
  16146. number: {
  16147. alias: "milestone_number",
  16148. deprecated: true,
  16149. type: "integer"
  16150. },
  16151. owner: {
  16152. required: true,
  16153. type: "string"
  16154. },
  16155. repo: {
  16156. required: true,
  16157. type: "string"
  16158. }
  16159. },
  16160. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16161. },
  16162. get: {
  16163. method: "GET",
  16164. params: {
  16165. issue_number: {
  16166. required: true,
  16167. type: "integer"
  16168. },
  16169. number: {
  16170. alias: "issue_number",
  16171. deprecated: true,
  16172. type: "integer"
  16173. },
  16174. owner: {
  16175. required: true,
  16176. type: "string"
  16177. },
  16178. repo: {
  16179. required: true,
  16180. type: "string"
  16181. }
  16182. },
  16183. url: "/repos/:owner/:repo/issues/:issue_number"
  16184. },
  16185. getComment: {
  16186. method: "GET",
  16187. params: {
  16188. comment_id: {
  16189. required: true,
  16190. type: "integer"
  16191. },
  16192. owner: {
  16193. required: true,
  16194. type: "string"
  16195. },
  16196. repo: {
  16197. required: true,
  16198. type: "string"
  16199. }
  16200. },
  16201. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16202. },
  16203. getEvent: {
  16204. method: "GET",
  16205. params: {
  16206. event_id: {
  16207. required: true,
  16208. type: "integer"
  16209. },
  16210. owner: {
  16211. required: true,
  16212. type: "string"
  16213. },
  16214. repo: {
  16215. required: true,
  16216. type: "string"
  16217. }
  16218. },
  16219. url: "/repos/:owner/:repo/issues/events/:event_id"
  16220. },
  16221. getLabel: {
  16222. method: "GET",
  16223. params: {
  16224. name: {
  16225. required: true,
  16226. type: "string"
  16227. },
  16228. owner: {
  16229. required: true,
  16230. type: "string"
  16231. },
  16232. repo: {
  16233. required: true,
  16234. type: "string"
  16235. }
  16236. },
  16237. url: "/repos/:owner/:repo/labels/:name"
  16238. },
  16239. getMilestone: {
  16240. method: "GET",
  16241. params: {
  16242. milestone_number: {
  16243. required: true,
  16244. type: "integer"
  16245. },
  16246. number: {
  16247. alias: "milestone_number",
  16248. deprecated: true,
  16249. type: "integer"
  16250. },
  16251. owner: {
  16252. required: true,
  16253. type: "string"
  16254. },
  16255. repo: {
  16256. required: true,
  16257. type: "string"
  16258. }
  16259. },
  16260. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16261. },
  16262. list: {
  16263. method: "GET",
  16264. params: {
  16265. direction: {
  16266. enum: ["asc", "desc"],
  16267. type: "string"
  16268. },
  16269. filter: {
  16270. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16271. type: "string"
  16272. },
  16273. labels: {
  16274. type: "string"
  16275. },
  16276. page: {
  16277. type: "integer"
  16278. },
  16279. per_page: {
  16280. type: "integer"
  16281. },
  16282. since: {
  16283. type: "string"
  16284. },
  16285. sort: {
  16286. enum: ["created", "updated", "comments"],
  16287. type: "string"
  16288. },
  16289. state: {
  16290. enum: ["open", "closed", "all"],
  16291. type: "string"
  16292. }
  16293. },
  16294. url: "/issues"
  16295. },
  16296. listAssignees: {
  16297. method: "GET",
  16298. params: {
  16299. owner: {
  16300. required: true,
  16301. type: "string"
  16302. },
  16303. page: {
  16304. type: "integer"
  16305. },
  16306. per_page: {
  16307. type: "integer"
  16308. },
  16309. repo: {
  16310. required: true,
  16311. type: "string"
  16312. }
  16313. },
  16314. url: "/repos/:owner/:repo/assignees"
  16315. },
  16316. listComments: {
  16317. method: "GET",
  16318. params: {
  16319. issue_number: {
  16320. required: true,
  16321. type: "integer"
  16322. },
  16323. number: {
  16324. alias: "issue_number",
  16325. deprecated: true,
  16326. type: "integer"
  16327. },
  16328. owner: {
  16329. required: true,
  16330. type: "string"
  16331. },
  16332. page: {
  16333. type: "integer"
  16334. },
  16335. per_page: {
  16336. type: "integer"
  16337. },
  16338. repo: {
  16339. required: true,
  16340. type: "string"
  16341. },
  16342. since: {
  16343. type: "string"
  16344. }
  16345. },
  16346. url: "/repos/:owner/:repo/issues/:issue_number/comments"
  16347. },
  16348. listCommentsForRepo: {
  16349. method: "GET",
  16350. params: {
  16351. direction: {
  16352. enum: ["asc", "desc"],
  16353. type: "string"
  16354. },
  16355. owner: {
  16356. required: true,
  16357. type: "string"
  16358. },
  16359. repo: {
  16360. required: true,
  16361. type: "string"
  16362. },
  16363. since: {
  16364. type: "string"
  16365. },
  16366. sort: {
  16367. enum: ["created", "updated"],
  16368. type: "string"
  16369. }
  16370. },
  16371. url: "/repos/:owner/:repo/issues/comments"
  16372. },
  16373. listEvents: {
  16374. method: "GET",
  16375. params: {
  16376. issue_number: {
  16377. required: true,
  16378. type: "integer"
  16379. },
  16380. number: {
  16381. alias: "issue_number",
  16382. deprecated: true,
  16383. type: "integer"
  16384. },
  16385. owner: {
  16386. required: true,
  16387. type: "string"
  16388. },
  16389. page: {
  16390. type: "integer"
  16391. },
  16392. per_page: {
  16393. type: "integer"
  16394. },
  16395. repo: {
  16396. required: true,
  16397. type: "string"
  16398. }
  16399. },
  16400. url: "/repos/:owner/:repo/issues/:issue_number/events"
  16401. },
  16402. listEventsForRepo: {
  16403. method: "GET",
  16404. params: {
  16405. owner: {
  16406. required: true,
  16407. type: "string"
  16408. },
  16409. page: {
  16410. type: "integer"
  16411. },
  16412. per_page: {
  16413. type: "integer"
  16414. },
  16415. repo: {
  16416. required: true,
  16417. type: "string"
  16418. }
  16419. },
  16420. url: "/repos/:owner/:repo/issues/events"
  16421. },
  16422. listEventsForTimeline: {
  16423. headers: {
  16424. accept: "application/vnd.github.mockingbird-preview+json"
  16425. },
  16426. method: "GET",
  16427. params: {
  16428. issue_number: {
  16429. required: true,
  16430. type: "integer"
  16431. },
  16432. number: {
  16433. alias: "issue_number",
  16434. deprecated: true,
  16435. type: "integer"
  16436. },
  16437. owner: {
  16438. required: true,
  16439. type: "string"
  16440. },
  16441. page: {
  16442. type: "integer"
  16443. },
  16444. per_page: {
  16445. type: "integer"
  16446. },
  16447. repo: {
  16448. required: true,
  16449. type: "string"
  16450. }
  16451. },
  16452. url: "/repos/:owner/:repo/issues/:issue_number/timeline"
  16453. },
  16454. listForAuthenticatedUser: {
  16455. method: "GET",
  16456. params: {
  16457. direction: {
  16458. enum: ["asc", "desc"],
  16459. type: "string"
  16460. },
  16461. filter: {
  16462. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16463. type: "string"
  16464. },
  16465. labels: {
  16466. type: "string"
  16467. },
  16468. page: {
  16469. type: "integer"
  16470. },
  16471. per_page: {
  16472. type: "integer"
  16473. },
  16474. since: {
  16475. type: "string"
  16476. },
  16477. sort: {
  16478. enum: ["created", "updated", "comments"],
  16479. type: "string"
  16480. },
  16481. state: {
  16482. enum: ["open", "closed", "all"],
  16483. type: "string"
  16484. }
  16485. },
  16486. url: "/user/issues"
  16487. },
  16488. listForOrg: {
  16489. method: "GET",
  16490. params: {
  16491. direction: {
  16492. enum: ["asc", "desc"],
  16493. type: "string"
  16494. },
  16495. filter: {
  16496. enum: ["assigned", "created", "mentioned", "subscribed", "all"],
  16497. type: "string"
  16498. },
  16499. labels: {
  16500. type: "string"
  16501. },
  16502. org: {
  16503. required: true,
  16504. type: "string"
  16505. },
  16506. page: {
  16507. type: "integer"
  16508. },
  16509. per_page: {
  16510. type: "integer"
  16511. },
  16512. since: {
  16513. type: "string"
  16514. },
  16515. sort: {
  16516. enum: ["created", "updated", "comments"],
  16517. type: "string"
  16518. },
  16519. state: {
  16520. enum: ["open", "closed", "all"],
  16521. type: "string"
  16522. }
  16523. },
  16524. url: "/orgs/:org/issues"
  16525. },
  16526. listForRepo: {
  16527. method: "GET",
  16528. params: {
  16529. assignee: {
  16530. type: "string"
  16531. },
  16532. creator: {
  16533. type: "string"
  16534. },
  16535. direction: {
  16536. enum: ["asc", "desc"],
  16537. type: "string"
  16538. },
  16539. labels: {
  16540. type: "string"
  16541. },
  16542. mentioned: {
  16543. type: "string"
  16544. },
  16545. milestone: {
  16546. type: "string"
  16547. },
  16548. owner: {
  16549. required: true,
  16550. type: "string"
  16551. },
  16552. page: {
  16553. type: "integer"
  16554. },
  16555. per_page: {
  16556. type: "integer"
  16557. },
  16558. repo: {
  16559. required: true,
  16560. type: "string"
  16561. },
  16562. since: {
  16563. type: "string"
  16564. },
  16565. sort: {
  16566. enum: ["created", "updated", "comments"],
  16567. type: "string"
  16568. },
  16569. state: {
  16570. enum: ["open", "closed", "all"],
  16571. type: "string"
  16572. }
  16573. },
  16574. url: "/repos/:owner/:repo/issues"
  16575. },
  16576. listLabelsForMilestone: {
  16577. method: "GET",
  16578. params: {
  16579. milestone_number: {
  16580. required: true,
  16581. type: "integer"
  16582. },
  16583. number: {
  16584. alias: "milestone_number",
  16585. deprecated: true,
  16586. type: "integer"
  16587. },
  16588. owner: {
  16589. required: true,
  16590. type: "string"
  16591. },
  16592. page: {
  16593. type: "integer"
  16594. },
  16595. per_page: {
  16596. type: "integer"
  16597. },
  16598. repo: {
  16599. required: true,
  16600. type: "string"
  16601. }
  16602. },
  16603. url: "/repos/:owner/:repo/milestones/:milestone_number/labels"
  16604. },
  16605. listLabelsForRepo: {
  16606. method: "GET",
  16607. params: {
  16608. owner: {
  16609. required: true,
  16610. type: "string"
  16611. },
  16612. page: {
  16613. type: "integer"
  16614. },
  16615. per_page: {
  16616. type: "integer"
  16617. },
  16618. repo: {
  16619. required: true,
  16620. type: "string"
  16621. }
  16622. },
  16623. url: "/repos/:owner/:repo/labels"
  16624. },
  16625. listLabelsOnIssue: {
  16626. method: "GET",
  16627. params: {
  16628. issue_number: {
  16629. required: true,
  16630. type: "integer"
  16631. },
  16632. number: {
  16633. alias: "issue_number",
  16634. deprecated: true,
  16635. type: "integer"
  16636. },
  16637. owner: {
  16638. required: true,
  16639. type: "string"
  16640. },
  16641. page: {
  16642. type: "integer"
  16643. },
  16644. per_page: {
  16645. type: "integer"
  16646. },
  16647. repo: {
  16648. required: true,
  16649. type: "string"
  16650. }
  16651. },
  16652. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16653. },
  16654. listMilestonesForRepo: {
  16655. method: "GET",
  16656. params: {
  16657. direction: {
  16658. enum: ["asc", "desc"],
  16659. type: "string"
  16660. },
  16661. owner: {
  16662. required: true,
  16663. type: "string"
  16664. },
  16665. page: {
  16666. type: "integer"
  16667. },
  16668. per_page: {
  16669. type: "integer"
  16670. },
  16671. repo: {
  16672. required: true,
  16673. type: "string"
  16674. },
  16675. sort: {
  16676. enum: ["due_on", "completeness"],
  16677. type: "string"
  16678. },
  16679. state: {
  16680. enum: ["open", "closed", "all"],
  16681. type: "string"
  16682. }
  16683. },
  16684. url: "/repos/:owner/:repo/milestones"
  16685. },
  16686. lock: {
  16687. method: "PUT",
  16688. params: {
  16689. issue_number: {
  16690. required: true,
  16691. type: "integer"
  16692. },
  16693. lock_reason: {
  16694. enum: ["off-topic", "too heated", "resolved", "spam"],
  16695. type: "string"
  16696. },
  16697. number: {
  16698. alias: "issue_number",
  16699. deprecated: true,
  16700. type: "integer"
  16701. },
  16702. owner: {
  16703. required: true,
  16704. type: "string"
  16705. },
  16706. repo: {
  16707. required: true,
  16708. type: "string"
  16709. }
  16710. },
  16711. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16712. },
  16713. removeAssignees: {
  16714. method: "DELETE",
  16715. params: {
  16716. assignees: {
  16717. type: "string[]"
  16718. },
  16719. issue_number: {
  16720. required: true,
  16721. type: "integer"
  16722. },
  16723. number: {
  16724. alias: "issue_number",
  16725. deprecated: true,
  16726. type: "integer"
  16727. },
  16728. owner: {
  16729. required: true,
  16730. type: "string"
  16731. },
  16732. repo: {
  16733. required: true,
  16734. type: "string"
  16735. }
  16736. },
  16737. url: "/repos/:owner/:repo/issues/:issue_number/assignees"
  16738. },
  16739. removeLabel: {
  16740. method: "DELETE",
  16741. params: {
  16742. issue_number: {
  16743. required: true,
  16744. type: "integer"
  16745. },
  16746. name: {
  16747. required: true,
  16748. type: "string"
  16749. },
  16750. number: {
  16751. alias: "issue_number",
  16752. deprecated: true,
  16753. type: "integer"
  16754. },
  16755. owner: {
  16756. required: true,
  16757. type: "string"
  16758. },
  16759. repo: {
  16760. required: true,
  16761. type: "string"
  16762. }
  16763. },
  16764. url: "/repos/:owner/:repo/issues/:issue_number/labels/:name"
  16765. },
  16766. removeLabels: {
  16767. method: "DELETE",
  16768. params: {
  16769. issue_number: {
  16770. required: true,
  16771. type: "integer"
  16772. },
  16773. number: {
  16774. alias: "issue_number",
  16775. deprecated: true,
  16776. type: "integer"
  16777. },
  16778. owner: {
  16779. required: true,
  16780. type: "string"
  16781. },
  16782. repo: {
  16783. required: true,
  16784. type: "string"
  16785. }
  16786. },
  16787. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16788. },
  16789. replaceLabels: {
  16790. method: "PUT",
  16791. params: {
  16792. issue_number: {
  16793. required: true,
  16794. type: "integer"
  16795. },
  16796. labels: {
  16797. type: "string[]"
  16798. },
  16799. number: {
  16800. alias: "issue_number",
  16801. deprecated: true,
  16802. type: "integer"
  16803. },
  16804. owner: {
  16805. required: true,
  16806. type: "string"
  16807. },
  16808. repo: {
  16809. required: true,
  16810. type: "string"
  16811. }
  16812. },
  16813. url: "/repos/:owner/:repo/issues/:issue_number/labels"
  16814. },
  16815. unlock: {
  16816. method: "DELETE",
  16817. params: {
  16818. issue_number: {
  16819. required: true,
  16820. type: "integer"
  16821. },
  16822. number: {
  16823. alias: "issue_number",
  16824. deprecated: true,
  16825. type: "integer"
  16826. },
  16827. owner: {
  16828. required: true,
  16829. type: "string"
  16830. },
  16831. repo: {
  16832. required: true,
  16833. type: "string"
  16834. }
  16835. },
  16836. url: "/repos/:owner/:repo/issues/:issue_number/lock"
  16837. },
  16838. update: {
  16839. method: "PATCH",
  16840. params: {
  16841. assignee: {
  16842. type: "string"
  16843. },
  16844. assignees: {
  16845. type: "string[]"
  16846. },
  16847. body: {
  16848. type: "string"
  16849. },
  16850. issue_number: {
  16851. required: true,
  16852. type: "integer"
  16853. },
  16854. labels: {
  16855. type: "string[]"
  16856. },
  16857. milestone: {
  16858. allowNull: true,
  16859. type: "integer"
  16860. },
  16861. number: {
  16862. alias: "issue_number",
  16863. deprecated: true,
  16864. type: "integer"
  16865. },
  16866. owner: {
  16867. required: true,
  16868. type: "string"
  16869. },
  16870. repo: {
  16871. required: true,
  16872. type: "string"
  16873. },
  16874. state: {
  16875. enum: ["open", "closed"],
  16876. type: "string"
  16877. },
  16878. title: {
  16879. type: "string"
  16880. }
  16881. },
  16882. url: "/repos/:owner/:repo/issues/:issue_number"
  16883. },
  16884. updateComment: {
  16885. method: "PATCH",
  16886. params: {
  16887. body: {
  16888. required: true,
  16889. type: "string"
  16890. },
  16891. comment_id: {
  16892. required: true,
  16893. type: "integer"
  16894. },
  16895. owner: {
  16896. required: true,
  16897. type: "string"
  16898. },
  16899. repo: {
  16900. required: true,
  16901. type: "string"
  16902. }
  16903. },
  16904. url: "/repos/:owner/:repo/issues/comments/:comment_id"
  16905. },
  16906. updateLabel: {
  16907. method: "PATCH",
  16908. params: {
  16909. color: {
  16910. type: "string"
  16911. },
  16912. current_name: {
  16913. required: true,
  16914. type: "string"
  16915. },
  16916. description: {
  16917. type: "string"
  16918. },
  16919. name: {
  16920. type: "string"
  16921. },
  16922. owner: {
  16923. required: true,
  16924. type: "string"
  16925. },
  16926. repo: {
  16927. required: true,
  16928. type: "string"
  16929. }
  16930. },
  16931. url: "/repos/:owner/:repo/labels/:current_name"
  16932. },
  16933. updateMilestone: {
  16934. method: "PATCH",
  16935. params: {
  16936. description: {
  16937. type: "string"
  16938. },
  16939. due_on: {
  16940. type: "string"
  16941. },
  16942. milestone_number: {
  16943. required: true,
  16944. type: "integer"
  16945. },
  16946. number: {
  16947. alias: "milestone_number",
  16948. deprecated: true,
  16949. type: "integer"
  16950. },
  16951. owner: {
  16952. required: true,
  16953. type: "string"
  16954. },
  16955. repo: {
  16956. required: true,
  16957. type: "string"
  16958. },
  16959. state: {
  16960. enum: ["open", "closed"],
  16961. type: "string"
  16962. },
  16963. title: {
  16964. type: "string"
  16965. }
  16966. },
  16967. url: "/repos/:owner/:repo/milestones/:milestone_number"
  16968. }
  16969. },
  16970. licenses: {
  16971. get: {
  16972. method: "GET",
  16973. params: {
  16974. license: {
  16975. required: true,
  16976. type: "string"
  16977. }
  16978. },
  16979. url: "/licenses/:license"
  16980. },
  16981. getForRepo: {
  16982. method: "GET",
  16983. params: {
  16984. owner: {
  16985. required: true,
  16986. type: "string"
  16987. },
  16988. repo: {
  16989. required: true,
  16990. type: "string"
  16991. }
  16992. },
  16993. url: "/repos/:owner/:repo/license"
  16994. },
  16995. list: {
  16996. deprecated: "octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)",
  16997. method: "GET",
  16998. params: {},
  16999. url: "/licenses"
  17000. },
  17001. listCommonlyUsed: {
  17002. method: "GET",
  17003. params: {},
  17004. url: "/licenses"
  17005. }
  17006. },
  17007. markdown: {
  17008. render: {
  17009. method: "POST",
  17010. params: {
  17011. context: {
  17012. type: "string"
  17013. },
  17014. mode: {
  17015. enum: ["markdown", "gfm"],
  17016. type: "string"
  17017. },
  17018. text: {
  17019. required: true,
  17020. type: "string"
  17021. }
  17022. },
  17023. url: "/markdown"
  17024. },
  17025. renderRaw: {
  17026. headers: {
  17027. "content-type": "text/plain; charset=utf-8"
  17028. },
  17029. method: "POST",
  17030. params: {
  17031. data: {
  17032. mapTo: "data",
  17033. required: true,
  17034. type: "string"
  17035. }
  17036. },
  17037. url: "/markdown/raw"
  17038. }
  17039. },
  17040. meta: {
  17041. get: {
  17042. method: "GET",
  17043. params: {},
  17044. url: "/meta"
  17045. }
  17046. },
  17047. migrations: {
  17048. cancelImport: {
  17049. method: "DELETE",
  17050. params: {
  17051. owner: {
  17052. required: true,
  17053. type: "string"
  17054. },
  17055. repo: {
  17056. required: true,
  17057. type: "string"
  17058. }
  17059. },
  17060. url: "/repos/:owner/:repo/import"
  17061. },
  17062. deleteArchiveForAuthenticatedUser: {
  17063. headers: {
  17064. accept: "application/vnd.github.wyandotte-preview+json"
  17065. },
  17066. method: "DELETE",
  17067. params: {
  17068. migration_id: {
  17069. required: true,
  17070. type: "integer"
  17071. }
  17072. },
  17073. url: "/user/migrations/:migration_id/archive"
  17074. },
  17075. deleteArchiveForOrg: {
  17076. headers: {
  17077. accept: "application/vnd.github.wyandotte-preview+json"
  17078. },
  17079. method: "DELETE",
  17080. params: {
  17081. migration_id: {
  17082. required: true,
  17083. type: "integer"
  17084. },
  17085. org: {
  17086. required: true,
  17087. type: "string"
  17088. }
  17089. },
  17090. url: "/orgs/:org/migrations/:migration_id/archive"
  17091. },
  17092. downloadArchiveForOrg: {
  17093. headers: {
  17094. accept: "application/vnd.github.wyandotte-preview+json"
  17095. },
  17096. method: "GET",
  17097. params: {
  17098. migration_id: {
  17099. required: true,
  17100. type: "integer"
  17101. },
  17102. org: {
  17103. required: true,
  17104. type: "string"
  17105. }
  17106. },
  17107. url: "/orgs/:org/migrations/:migration_id/archive"
  17108. },
  17109. getArchiveForAuthenticatedUser: {
  17110. headers: {
  17111. accept: "application/vnd.github.wyandotte-preview+json"
  17112. },
  17113. method: "GET",
  17114. params: {
  17115. migration_id: {
  17116. required: true,
  17117. type: "integer"
  17118. }
  17119. },
  17120. url: "/user/migrations/:migration_id/archive"
  17121. },
  17122. getArchiveForOrg: {
  17123. deprecated: "octokit.migrations.getArchiveForOrg() has been renamed to octokit.migrations.downloadArchiveForOrg() (2020-01-27)",
  17124. headers: {
  17125. accept: "application/vnd.github.wyandotte-preview+json"
  17126. },
  17127. method: "GET",
  17128. params: {
  17129. migration_id: {
  17130. required: true,
  17131. type: "integer"
  17132. },
  17133. org: {
  17134. required: true,
  17135. type: "string"
  17136. }
  17137. },
  17138. url: "/orgs/:org/migrations/:migration_id/archive"
  17139. },
  17140. getCommitAuthors: {
  17141. method: "GET",
  17142. params: {
  17143. owner: {
  17144. required: true,
  17145. type: "string"
  17146. },
  17147. repo: {
  17148. required: true,
  17149. type: "string"
  17150. },
  17151. since: {
  17152. type: "string"
  17153. }
  17154. },
  17155. url: "/repos/:owner/:repo/import/authors"
  17156. },
  17157. getImportProgress: {
  17158. method: "GET",
  17159. params: {
  17160. owner: {
  17161. required: true,
  17162. type: "string"
  17163. },
  17164. repo: {
  17165. required: true,
  17166. type: "string"
  17167. }
  17168. },
  17169. url: "/repos/:owner/:repo/import"
  17170. },
  17171. getLargeFiles: {
  17172. method: "GET",
  17173. params: {
  17174. owner: {
  17175. required: true,
  17176. type: "string"
  17177. },
  17178. repo: {
  17179. required: true,
  17180. type: "string"
  17181. }
  17182. },
  17183. url: "/repos/:owner/:repo/import/large_files"
  17184. },
  17185. getStatusForAuthenticatedUser: {
  17186. headers: {
  17187. accept: "application/vnd.github.wyandotte-preview+json"
  17188. },
  17189. method: "GET",
  17190. params: {
  17191. migration_id: {
  17192. required: true,
  17193. type: "integer"
  17194. }
  17195. },
  17196. url: "/user/migrations/:migration_id"
  17197. },
  17198. getStatusForOrg: {
  17199. headers: {
  17200. accept: "application/vnd.github.wyandotte-preview+json"
  17201. },
  17202. method: "GET",
  17203. params: {
  17204. migration_id: {
  17205. required: true,
  17206. type: "integer"
  17207. },
  17208. org: {
  17209. required: true,
  17210. type: "string"
  17211. }
  17212. },
  17213. url: "/orgs/:org/migrations/:migration_id"
  17214. },
  17215. listForAuthenticatedUser: {
  17216. headers: {
  17217. accept: "application/vnd.github.wyandotte-preview+json"
  17218. },
  17219. method: "GET",
  17220. params: {
  17221. page: {
  17222. type: "integer"
  17223. },
  17224. per_page: {
  17225. type: "integer"
  17226. }
  17227. },
  17228. url: "/user/migrations"
  17229. },
  17230. listForOrg: {
  17231. headers: {
  17232. accept: "application/vnd.github.wyandotte-preview+json"
  17233. },
  17234. method: "GET",
  17235. params: {
  17236. org: {
  17237. required: true,
  17238. type: "string"
  17239. },
  17240. page: {
  17241. type: "integer"
  17242. },
  17243. per_page: {
  17244. type: "integer"
  17245. }
  17246. },
  17247. url: "/orgs/:org/migrations"
  17248. },
  17249. listReposForOrg: {
  17250. headers: {
  17251. accept: "application/vnd.github.wyandotte-preview+json"
  17252. },
  17253. method: "GET",
  17254. params: {
  17255. migration_id: {
  17256. required: true,
  17257. type: "integer"
  17258. },
  17259. org: {
  17260. required: true,
  17261. type: "string"
  17262. },
  17263. page: {
  17264. type: "integer"
  17265. },
  17266. per_page: {
  17267. type: "integer"
  17268. }
  17269. },
  17270. url: "/orgs/:org/migrations/:migration_id/repositories"
  17271. },
  17272. listReposForUser: {
  17273. headers: {
  17274. accept: "application/vnd.github.wyandotte-preview+json"
  17275. },
  17276. method: "GET",
  17277. params: {
  17278. migration_id: {
  17279. required: true,
  17280. type: "integer"
  17281. },
  17282. page: {
  17283. type: "integer"
  17284. },
  17285. per_page: {
  17286. type: "integer"
  17287. }
  17288. },
  17289. url: "/user/:migration_id/repositories"
  17290. },
  17291. mapCommitAuthor: {
  17292. method: "PATCH",
  17293. params: {
  17294. author_id: {
  17295. required: true,
  17296. type: "integer"
  17297. },
  17298. email: {
  17299. type: "string"
  17300. },
  17301. name: {
  17302. type: "string"
  17303. },
  17304. owner: {
  17305. required: true,
  17306. type: "string"
  17307. },
  17308. repo: {
  17309. required: true,
  17310. type: "string"
  17311. }
  17312. },
  17313. url: "/repos/:owner/:repo/import/authors/:author_id"
  17314. },
  17315. setLfsPreference: {
  17316. method: "PATCH",
  17317. params: {
  17318. owner: {
  17319. required: true,
  17320. type: "string"
  17321. },
  17322. repo: {
  17323. required: true,
  17324. type: "string"
  17325. },
  17326. use_lfs: {
  17327. enum: ["opt_in", "opt_out"],
  17328. required: true,
  17329. type: "string"
  17330. }
  17331. },
  17332. url: "/repos/:owner/:repo/import/lfs"
  17333. },
  17334. startForAuthenticatedUser: {
  17335. method: "POST",
  17336. params: {
  17337. exclude_attachments: {
  17338. type: "boolean"
  17339. },
  17340. lock_repositories: {
  17341. type: "boolean"
  17342. },
  17343. repositories: {
  17344. required: true,
  17345. type: "string[]"
  17346. }
  17347. },
  17348. url: "/user/migrations"
  17349. },
  17350. startForOrg: {
  17351. method: "POST",
  17352. params: {
  17353. exclude_attachments: {
  17354. type: "boolean"
  17355. },
  17356. lock_repositories: {
  17357. type: "boolean"
  17358. },
  17359. org: {
  17360. required: true,
  17361. type: "string"
  17362. },
  17363. repositories: {
  17364. required: true,
  17365. type: "string[]"
  17366. }
  17367. },
  17368. url: "/orgs/:org/migrations"
  17369. },
  17370. startImport: {
  17371. method: "PUT",
  17372. params: {
  17373. owner: {
  17374. required: true,
  17375. type: "string"
  17376. },
  17377. repo: {
  17378. required: true,
  17379. type: "string"
  17380. },
  17381. tfvc_project: {
  17382. type: "string"
  17383. },
  17384. vcs: {
  17385. enum: ["subversion", "git", "mercurial", "tfvc"],
  17386. type: "string"
  17387. },
  17388. vcs_password: {
  17389. type: "string"
  17390. },
  17391. vcs_url: {
  17392. required: true,
  17393. type: "string"
  17394. },
  17395. vcs_username: {
  17396. type: "string"
  17397. }
  17398. },
  17399. url: "/repos/:owner/:repo/import"
  17400. },
  17401. unlockRepoForAuthenticatedUser: {
  17402. headers: {
  17403. accept: "application/vnd.github.wyandotte-preview+json"
  17404. },
  17405. method: "DELETE",
  17406. params: {
  17407. migration_id: {
  17408. required: true,
  17409. type: "integer"
  17410. },
  17411. repo_name: {
  17412. required: true,
  17413. type: "string"
  17414. }
  17415. },
  17416. url: "/user/migrations/:migration_id/repos/:repo_name/lock"
  17417. },
  17418. unlockRepoForOrg: {
  17419. headers: {
  17420. accept: "application/vnd.github.wyandotte-preview+json"
  17421. },
  17422. method: "DELETE",
  17423. params: {
  17424. migration_id: {
  17425. required: true,
  17426. type: "integer"
  17427. },
  17428. org: {
  17429. required: true,
  17430. type: "string"
  17431. },
  17432. repo_name: {
  17433. required: true,
  17434. type: "string"
  17435. }
  17436. },
  17437. url: "/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"
  17438. },
  17439. updateImport: {
  17440. method: "PATCH",
  17441. params: {
  17442. owner: {
  17443. required: true,
  17444. type: "string"
  17445. },
  17446. repo: {
  17447. required: true,
  17448. type: "string"
  17449. },
  17450. vcs_password: {
  17451. type: "string"
  17452. },
  17453. vcs_username: {
  17454. type: "string"
  17455. }
  17456. },
  17457. url: "/repos/:owner/:repo/import"
  17458. }
  17459. },
  17460. oauthAuthorizations: {
  17461. checkAuthorization: {
  17462. deprecated: "octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)",
  17463. method: "GET",
  17464. params: {
  17465. access_token: {
  17466. required: true,
  17467. type: "string"
  17468. },
  17469. client_id: {
  17470. required: true,
  17471. type: "string"
  17472. }
  17473. },
  17474. url: "/applications/:client_id/tokens/:access_token"
  17475. },
  17476. createAuthorization: {
  17477. deprecated: "octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization",
  17478. method: "POST",
  17479. params: {
  17480. client_id: {
  17481. type: "string"
  17482. },
  17483. client_secret: {
  17484. type: "string"
  17485. },
  17486. fingerprint: {
  17487. type: "string"
  17488. },
  17489. note: {
  17490. required: true,
  17491. type: "string"
  17492. },
  17493. note_url: {
  17494. type: "string"
  17495. },
  17496. scopes: {
  17497. type: "string[]"
  17498. }
  17499. },
  17500. url: "/authorizations"
  17501. },
  17502. deleteAuthorization: {
  17503. deprecated: "octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization",
  17504. method: "DELETE",
  17505. params: {
  17506. authorization_id: {
  17507. required: true,
  17508. type: "integer"
  17509. }
  17510. },
  17511. url: "/authorizations/:authorization_id"
  17512. },
  17513. deleteGrant: {
  17514. deprecated: "octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant",
  17515. method: "DELETE",
  17516. params: {
  17517. grant_id: {
  17518. required: true,
  17519. type: "integer"
  17520. }
  17521. },
  17522. url: "/applications/grants/:grant_id"
  17523. },
  17524. getAuthorization: {
  17525. deprecated: "octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization",
  17526. method: "GET",
  17527. params: {
  17528. authorization_id: {
  17529. required: true,
  17530. type: "integer"
  17531. }
  17532. },
  17533. url: "/authorizations/:authorization_id"
  17534. },
  17535. getGrant: {
  17536. deprecated: "octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant",
  17537. method: "GET",
  17538. params: {
  17539. grant_id: {
  17540. required: true,
  17541. type: "integer"
  17542. }
  17543. },
  17544. url: "/applications/grants/:grant_id"
  17545. },
  17546. getOrCreateAuthorizationForApp: {
  17547. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app",
  17548. method: "PUT",
  17549. params: {
  17550. client_id: {
  17551. required: true,
  17552. type: "string"
  17553. },
  17554. client_secret: {
  17555. required: true,
  17556. type: "string"
  17557. },
  17558. fingerprint: {
  17559. type: "string"
  17560. },
  17561. note: {
  17562. type: "string"
  17563. },
  17564. note_url: {
  17565. type: "string"
  17566. },
  17567. scopes: {
  17568. type: "string[]"
  17569. }
  17570. },
  17571. url: "/authorizations/clients/:client_id"
  17572. },
  17573. getOrCreateAuthorizationForAppAndFingerprint: {
  17574. 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",
  17575. method: "PUT",
  17576. params: {
  17577. client_id: {
  17578. required: true,
  17579. type: "string"
  17580. },
  17581. client_secret: {
  17582. required: true,
  17583. type: "string"
  17584. },
  17585. fingerprint: {
  17586. required: true,
  17587. type: "string"
  17588. },
  17589. note: {
  17590. type: "string"
  17591. },
  17592. note_url: {
  17593. type: "string"
  17594. },
  17595. scopes: {
  17596. type: "string[]"
  17597. }
  17598. },
  17599. url: "/authorizations/clients/:client_id/:fingerprint"
  17600. },
  17601. getOrCreateAuthorizationForAppFingerprint: {
  17602. deprecated: "octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)",
  17603. method: "PUT",
  17604. params: {
  17605. client_id: {
  17606. required: true,
  17607. type: "string"
  17608. },
  17609. client_secret: {
  17610. required: true,
  17611. type: "string"
  17612. },
  17613. fingerprint: {
  17614. required: true,
  17615. type: "string"
  17616. },
  17617. note: {
  17618. type: "string"
  17619. },
  17620. note_url: {
  17621. type: "string"
  17622. },
  17623. scopes: {
  17624. type: "string[]"
  17625. }
  17626. },
  17627. url: "/authorizations/clients/:client_id/:fingerprint"
  17628. },
  17629. listAuthorizations: {
  17630. deprecated: "octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations",
  17631. method: "GET",
  17632. params: {
  17633. page: {
  17634. type: "integer"
  17635. },
  17636. per_page: {
  17637. type: "integer"
  17638. }
  17639. },
  17640. url: "/authorizations"
  17641. },
  17642. listGrants: {
  17643. deprecated: "octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants",
  17644. method: "GET",
  17645. params: {
  17646. page: {
  17647. type: "integer"
  17648. },
  17649. per_page: {
  17650. type: "integer"
  17651. }
  17652. },
  17653. url: "/applications/grants"
  17654. },
  17655. resetAuthorization: {
  17656. deprecated: "octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)",
  17657. method: "POST",
  17658. params: {
  17659. access_token: {
  17660. required: true,
  17661. type: "string"
  17662. },
  17663. client_id: {
  17664. required: true,
  17665. type: "string"
  17666. }
  17667. },
  17668. url: "/applications/:client_id/tokens/:access_token"
  17669. },
  17670. revokeAuthorizationForApplication: {
  17671. deprecated: "octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)",
  17672. method: "DELETE",
  17673. params: {
  17674. access_token: {
  17675. required: true,
  17676. type: "string"
  17677. },
  17678. client_id: {
  17679. required: true,
  17680. type: "string"
  17681. }
  17682. },
  17683. url: "/applications/:client_id/tokens/:access_token"
  17684. },
  17685. revokeGrantForApplication: {
  17686. deprecated: "octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)",
  17687. method: "DELETE",
  17688. params: {
  17689. access_token: {
  17690. required: true,
  17691. type: "string"
  17692. },
  17693. client_id: {
  17694. required: true,
  17695. type: "string"
  17696. }
  17697. },
  17698. url: "/applications/:client_id/grants/:access_token"
  17699. },
  17700. updateAuthorization: {
  17701. deprecated: "octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization",
  17702. method: "PATCH",
  17703. params: {
  17704. add_scopes: {
  17705. type: "string[]"
  17706. },
  17707. authorization_id: {
  17708. required: true,
  17709. type: "integer"
  17710. },
  17711. fingerprint: {
  17712. type: "string"
  17713. },
  17714. note: {
  17715. type: "string"
  17716. },
  17717. note_url: {
  17718. type: "string"
  17719. },
  17720. remove_scopes: {
  17721. type: "string[]"
  17722. },
  17723. scopes: {
  17724. type: "string[]"
  17725. }
  17726. },
  17727. url: "/authorizations/:authorization_id"
  17728. }
  17729. },
  17730. orgs: {
  17731. addOrUpdateMembership: {
  17732. method: "PUT",
  17733. params: {
  17734. org: {
  17735. required: true,
  17736. type: "string"
  17737. },
  17738. role: {
  17739. enum: ["admin", "member"],
  17740. type: "string"
  17741. },
  17742. username: {
  17743. required: true,
  17744. type: "string"
  17745. }
  17746. },
  17747. url: "/orgs/:org/memberships/:username"
  17748. },
  17749. blockUser: {
  17750. method: "PUT",
  17751. params: {
  17752. org: {
  17753. required: true,
  17754. type: "string"
  17755. },
  17756. username: {
  17757. required: true,
  17758. type: "string"
  17759. }
  17760. },
  17761. url: "/orgs/:org/blocks/:username"
  17762. },
  17763. checkBlockedUser: {
  17764. method: "GET",
  17765. params: {
  17766. org: {
  17767. required: true,
  17768. type: "string"
  17769. },
  17770. username: {
  17771. required: true,
  17772. type: "string"
  17773. }
  17774. },
  17775. url: "/orgs/:org/blocks/:username"
  17776. },
  17777. checkMembership: {
  17778. method: "GET",
  17779. params: {
  17780. org: {
  17781. required: true,
  17782. type: "string"
  17783. },
  17784. username: {
  17785. required: true,
  17786. type: "string"
  17787. }
  17788. },
  17789. url: "/orgs/:org/members/:username"
  17790. },
  17791. checkPublicMembership: {
  17792. method: "GET",
  17793. params: {
  17794. org: {
  17795. required: true,
  17796. type: "string"
  17797. },
  17798. username: {
  17799. required: true,
  17800. type: "string"
  17801. }
  17802. },
  17803. url: "/orgs/:org/public_members/:username"
  17804. },
  17805. concealMembership: {
  17806. method: "DELETE",
  17807. params: {
  17808. org: {
  17809. required: true,
  17810. type: "string"
  17811. },
  17812. username: {
  17813. required: true,
  17814. type: "string"
  17815. }
  17816. },
  17817. url: "/orgs/:org/public_members/:username"
  17818. },
  17819. convertMemberToOutsideCollaborator: {
  17820. method: "PUT",
  17821. params: {
  17822. org: {
  17823. required: true,
  17824. type: "string"
  17825. },
  17826. username: {
  17827. required: true,
  17828. type: "string"
  17829. }
  17830. },
  17831. url: "/orgs/:org/outside_collaborators/:username"
  17832. },
  17833. createHook: {
  17834. method: "POST",
  17835. params: {
  17836. active: {
  17837. type: "boolean"
  17838. },
  17839. config: {
  17840. required: true,
  17841. type: "object"
  17842. },
  17843. "config.content_type": {
  17844. type: "string"
  17845. },
  17846. "config.insecure_ssl": {
  17847. type: "string"
  17848. },
  17849. "config.secret": {
  17850. type: "string"
  17851. },
  17852. "config.url": {
  17853. required: true,
  17854. type: "string"
  17855. },
  17856. events: {
  17857. type: "string[]"
  17858. },
  17859. name: {
  17860. required: true,
  17861. type: "string"
  17862. },
  17863. org: {
  17864. required: true,
  17865. type: "string"
  17866. }
  17867. },
  17868. url: "/orgs/:org/hooks"
  17869. },
  17870. createInvitation: {
  17871. method: "POST",
  17872. params: {
  17873. email: {
  17874. type: "string"
  17875. },
  17876. invitee_id: {
  17877. type: "integer"
  17878. },
  17879. org: {
  17880. required: true,
  17881. type: "string"
  17882. },
  17883. role: {
  17884. enum: ["admin", "direct_member", "billing_manager"],
  17885. type: "string"
  17886. },
  17887. team_ids: {
  17888. type: "integer[]"
  17889. }
  17890. },
  17891. url: "/orgs/:org/invitations"
  17892. },
  17893. deleteHook: {
  17894. method: "DELETE",
  17895. params: {
  17896. hook_id: {
  17897. required: true,
  17898. type: "integer"
  17899. },
  17900. org: {
  17901. required: true,
  17902. type: "string"
  17903. }
  17904. },
  17905. url: "/orgs/:org/hooks/:hook_id"
  17906. },
  17907. get: {
  17908. method: "GET",
  17909. params: {
  17910. org: {
  17911. required: true,
  17912. type: "string"
  17913. }
  17914. },
  17915. url: "/orgs/:org"
  17916. },
  17917. getHook: {
  17918. method: "GET",
  17919. params: {
  17920. hook_id: {
  17921. required: true,
  17922. type: "integer"
  17923. },
  17924. org: {
  17925. required: true,
  17926. type: "string"
  17927. }
  17928. },
  17929. url: "/orgs/:org/hooks/:hook_id"
  17930. },
  17931. getMembership: {
  17932. method: "GET",
  17933. params: {
  17934. org: {
  17935. required: true,
  17936. type: "string"
  17937. },
  17938. username: {
  17939. required: true,
  17940. type: "string"
  17941. }
  17942. },
  17943. url: "/orgs/:org/memberships/:username"
  17944. },
  17945. getMembershipForAuthenticatedUser: {
  17946. method: "GET",
  17947. params: {
  17948. org: {
  17949. required: true,
  17950. type: "string"
  17951. }
  17952. },
  17953. url: "/user/memberships/orgs/:org"
  17954. },
  17955. list: {
  17956. method: "GET",
  17957. params: {
  17958. page: {
  17959. type: "integer"
  17960. },
  17961. per_page: {
  17962. type: "integer"
  17963. },
  17964. since: {
  17965. type: "integer"
  17966. }
  17967. },
  17968. url: "/organizations"
  17969. },
  17970. listBlockedUsers: {
  17971. method: "GET",
  17972. params: {
  17973. org: {
  17974. required: true,
  17975. type: "string"
  17976. }
  17977. },
  17978. url: "/orgs/:org/blocks"
  17979. },
  17980. listForAuthenticatedUser: {
  17981. method: "GET",
  17982. params: {
  17983. page: {
  17984. type: "integer"
  17985. },
  17986. per_page: {
  17987. type: "integer"
  17988. }
  17989. },
  17990. url: "/user/orgs"
  17991. },
  17992. listForUser: {
  17993. method: "GET",
  17994. params: {
  17995. page: {
  17996. type: "integer"
  17997. },
  17998. per_page: {
  17999. type: "integer"
  18000. },
  18001. username: {
  18002. required: true,
  18003. type: "string"
  18004. }
  18005. },
  18006. url: "/users/:username/orgs"
  18007. },
  18008. listHooks: {
  18009. method: "GET",
  18010. params: {
  18011. org: {
  18012. required: true,
  18013. type: "string"
  18014. },
  18015. page: {
  18016. type: "integer"
  18017. },
  18018. per_page: {
  18019. type: "integer"
  18020. }
  18021. },
  18022. url: "/orgs/:org/hooks"
  18023. },
  18024. listInstallations: {
  18025. headers: {
  18026. accept: "application/vnd.github.machine-man-preview+json"
  18027. },
  18028. method: "GET",
  18029. params: {
  18030. org: {
  18031. required: true,
  18032. type: "string"
  18033. },
  18034. page: {
  18035. type: "integer"
  18036. },
  18037. per_page: {
  18038. type: "integer"
  18039. }
  18040. },
  18041. url: "/orgs/:org/installations"
  18042. },
  18043. listInvitationTeams: {
  18044. method: "GET",
  18045. params: {
  18046. invitation_id: {
  18047. required: true,
  18048. type: "integer"
  18049. },
  18050. org: {
  18051. required: true,
  18052. type: "string"
  18053. },
  18054. page: {
  18055. type: "integer"
  18056. },
  18057. per_page: {
  18058. type: "integer"
  18059. }
  18060. },
  18061. url: "/orgs/:org/invitations/:invitation_id/teams"
  18062. },
  18063. listMembers: {
  18064. method: "GET",
  18065. params: {
  18066. filter: {
  18067. enum: ["2fa_disabled", "all"],
  18068. type: "string"
  18069. },
  18070. org: {
  18071. required: true,
  18072. type: "string"
  18073. },
  18074. page: {
  18075. type: "integer"
  18076. },
  18077. per_page: {
  18078. type: "integer"
  18079. },
  18080. role: {
  18081. enum: ["all", "admin", "member"],
  18082. type: "string"
  18083. }
  18084. },
  18085. url: "/orgs/:org/members"
  18086. },
  18087. listMemberships: {
  18088. method: "GET",
  18089. params: {
  18090. page: {
  18091. type: "integer"
  18092. },
  18093. per_page: {
  18094. type: "integer"
  18095. },
  18096. state: {
  18097. enum: ["active", "pending"],
  18098. type: "string"
  18099. }
  18100. },
  18101. url: "/user/memberships/orgs"
  18102. },
  18103. listOutsideCollaborators: {
  18104. method: "GET",
  18105. params: {
  18106. filter: {
  18107. enum: ["2fa_disabled", "all"],
  18108. type: "string"
  18109. },
  18110. org: {
  18111. required: true,
  18112. type: "string"
  18113. },
  18114. page: {
  18115. type: "integer"
  18116. },
  18117. per_page: {
  18118. type: "integer"
  18119. }
  18120. },
  18121. url: "/orgs/:org/outside_collaborators"
  18122. },
  18123. listPendingInvitations: {
  18124. method: "GET",
  18125. params: {
  18126. org: {
  18127. required: true,
  18128. type: "string"
  18129. },
  18130. page: {
  18131. type: "integer"
  18132. },
  18133. per_page: {
  18134. type: "integer"
  18135. }
  18136. },
  18137. url: "/orgs/:org/invitations"
  18138. },
  18139. listPublicMembers: {
  18140. method: "GET",
  18141. params: {
  18142. org: {
  18143. required: true,
  18144. type: "string"
  18145. },
  18146. page: {
  18147. type: "integer"
  18148. },
  18149. per_page: {
  18150. type: "integer"
  18151. }
  18152. },
  18153. url: "/orgs/:org/public_members"
  18154. },
  18155. pingHook: {
  18156. method: "POST",
  18157. params: {
  18158. hook_id: {
  18159. required: true,
  18160. type: "integer"
  18161. },
  18162. org: {
  18163. required: true,
  18164. type: "string"
  18165. }
  18166. },
  18167. url: "/orgs/:org/hooks/:hook_id/pings"
  18168. },
  18169. publicizeMembership: {
  18170. method: "PUT",
  18171. params: {
  18172. org: {
  18173. required: true,
  18174. type: "string"
  18175. },
  18176. username: {
  18177. required: true,
  18178. type: "string"
  18179. }
  18180. },
  18181. url: "/orgs/:org/public_members/:username"
  18182. },
  18183. removeMember: {
  18184. method: "DELETE",
  18185. params: {
  18186. org: {
  18187. required: true,
  18188. type: "string"
  18189. },
  18190. username: {
  18191. required: true,
  18192. type: "string"
  18193. }
  18194. },
  18195. url: "/orgs/:org/members/:username"
  18196. },
  18197. removeMembership: {
  18198. method: "DELETE",
  18199. params: {
  18200. org: {
  18201. required: true,
  18202. type: "string"
  18203. },
  18204. username: {
  18205. required: true,
  18206. type: "string"
  18207. }
  18208. },
  18209. url: "/orgs/:org/memberships/:username"
  18210. },
  18211. removeOutsideCollaborator: {
  18212. method: "DELETE",
  18213. params: {
  18214. org: {
  18215. required: true,
  18216. type: "string"
  18217. },
  18218. username: {
  18219. required: true,
  18220. type: "string"
  18221. }
  18222. },
  18223. url: "/orgs/:org/outside_collaborators/:username"
  18224. },
  18225. unblockUser: {
  18226. method: "DELETE",
  18227. params: {
  18228. org: {
  18229. required: true,
  18230. type: "string"
  18231. },
  18232. username: {
  18233. required: true,
  18234. type: "string"
  18235. }
  18236. },
  18237. url: "/orgs/:org/blocks/:username"
  18238. },
  18239. update: {
  18240. method: "PATCH",
  18241. params: {
  18242. billing_email: {
  18243. type: "string"
  18244. },
  18245. company: {
  18246. type: "string"
  18247. },
  18248. default_repository_permission: {
  18249. enum: ["read", "write", "admin", "none"],
  18250. type: "string"
  18251. },
  18252. description: {
  18253. type: "string"
  18254. },
  18255. email: {
  18256. type: "string"
  18257. },
  18258. has_organization_projects: {
  18259. type: "boolean"
  18260. },
  18261. has_repository_projects: {
  18262. type: "boolean"
  18263. },
  18264. location: {
  18265. type: "string"
  18266. },
  18267. members_allowed_repository_creation_type: {
  18268. enum: ["all", "private", "none"],
  18269. type: "string"
  18270. },
  18271. members_can_create_internal_repositories: {
  18272. type: "boolean"
  18273. },
  18274. members_can_create_private_repositories: {
  18275. type: "boolean"
  18276. },
  18277. members_can_create_public_repositories: {
  18278. type: "boolean"
  18279. },
  18280. members_can_create_repositories: {
  18281. type: "boolean"
  18282. },
  18283. name: {
  18284. type: "string"
  18285. },
  18286. org: {
  18287. required: true,
  18288. type: "string"
  18289. }
  18290. },
  18291. url: "/orgs/:org"
  18292. },
  18293. updateHook: {
  18294. method: "PATCH",
  18295. params: {
  18296. active: {
  18297. type: "boolean"
  18298. },
  18299. config: {
  18300. type: "object"
  18301. },
  18302. "config.content_type": {
  18303. type: "string"
  18304. },
  18305. "config.insecure_ssl": {
  18306. type: "string"
  18307. },
  18308. "config.secret": {
  18309. type: "string"
  18310. },
  18311. "config.url": {
  18312. required: true,
  18313. type: "string"
  18314. },
  18315. events: {
  18316. type: "string[]"
  18317. },
  18318. hook_id: {
  18319. required: true,
  18320. type: "integer"
  18321. },
  18322. org: {
  18323. required: true,
  18324. type: "string"
  18325. }
  18326. },
  18327. url: "/orgs/:org/hooks/:hook_id"
  18328. },
  18329. updateMembership: {
  18330. method: "PATCH",
  18331. params: {
  18332. org: {
  18333. required: true,
  18334. type: "string"
  18335. },
  18336. state: {
  18337. enum: ["active"],
  18338. required: true,
  18339. type: "string"
  18340. }
  18341. },
  18342. url: "/user/memberships/orgs/:org"
  18343. }
  18344. },
  18345. projects: {
  18346. addCollaborator: {
  18347. headers: {
  18348. accept: "application/vnd.github.inertia-preview+json"
  18349. },
  18350. method: "PUT",
  18351. params: {
  18352. permission: {
  18353. enum: ["read", "write", "admin"],
  18354. type: "string"
  18355. },
  18356. project_id: {
  18357. required: true,
  18358. type: "integer"
  18359. },
  18360. username: {
  18361. required: true,
  18362. type: "string"
  18363. }
  18364. },
  18365. url: "/projects/:project_id/collaborators/:username"
  18366. },
  18367. createCard: {
  18368. headers: {
  18369. accept: "application/vnd.github.inertia-preview+json"
  18370. },
  18371. method: "POST",
  18372. params: {
  18373. column_id: {
  18374. required: true,
  18375. type: "integer"
  18376. },
  18377. content_id: {
  18378. type: "integer"
  18379. },
  18380. content_type: {
  18381. type: "string"
  18382. },
  18383. note: {
  18384. type: "string"
  18385. }
  18386. },
  18387. url: "/projects/columns/:column_id/cards"
  18388. },
  18389. createColumn: {
  18390. headers: {
  18391. accept: "application/vnd.github.inertia-preview+json"
  18392. },
  18393. method: "POST",
  18394. params: {
  18395. name: {
  18396. required: true,
  18397. type: "string"
  18398. },
  18399. project_id: {
  18400. required: true,
  18401. type: "integer"
  18402. }
  18403. },
  18404. url: "/projects/:project_id/columns"
  18405. },
  18406. createForAuthenticatedUser: {
  18407. headers: {
  18408. accept: "application/vnd.github.inertia-preview+json"
  18409. },
  18410. method: "POST",
  18411. params: {
  18412. body: {
  18413. type: "string"
  18414. },
  18415. name: {
  18416. required: true,
  18417. type: "string"
  18418. }
  18419. },
  18420. url: "/user/projects"
  18421. },
  18422. createForOrg: {
  18423. headers: {
  18424. accept: "application/vnd.github.inertia-preview+json"
  18425. },
  18426. method: "POST",
  18427. params: {
  18428. body: {
  18429. type: "string"
  18430. },
  18431. name: {
  18432. required: true,
  18433. type: "string"
  18434. },
  18435. org: {
  18436. required: true,
  18437. type: "string"
  18438. }
  18439. },
  18440. url: "/orgs/:org/projects"
  18441. },
  18442. createForRepo: {
  18443. headers: {
  18444. accept: "application/vnd.github.inertia-preview+json"
  18445. },
  18446. method: "POST",
  18447. params: {
  18448. body: {
  18449. type: "string"
  18450. },
  18451. name: {
  18452. required: true,
  18453. type: "string"
  18454. },
  18455. owner: {
  18456. required: true,
  18457. type: "string"
  18458. },
  18459. repo: {
  18460. required: true,
  18461. type: "string"
  18462. }
  18463. },
  18464. url: "/repos/:owner/:repo/projects"
  18465. },
  18466. delete: {
  18467. headers: {
  18468. accept: "application/vnd.github.inertia-preview+json"
  18469. },
  18470. method: "DELETE",
  18471. params: {
  18472. project_id: {
  18473. required: true,
  18474. type: "integer"
  18475. }
  18476. },
  18477. url: "/projects/:project_id"
  18478. },
  18479. deleteCard: {
  18480. headers: {
  18481. accept: "application/vnd.github.inertia-preview+json"
  18482. },
  18483. method: "DELETE",
  18484. params: {
  18485. card_id: {
  18486. required: true,
  18487. type: "integer"
  18488. }
  18489. },
  18490. url: "/projects/columns/cards/:card_id"
  18491. },
  18492. deleteColumn: {
  18493. headers: {
  18494. accept: "application/vnd.github.inertia-preview+json"
  18495. },
  18496. method: "DELETE",
  18497. params: {
  18498. column_id: {
  18499. required: true,
  18500. type: "integer"
  18501. }
  18502. },
  18503. url: "/projects/columns/:column_id"
  18504. },
  18505. get: {
  18506. headers: {
  18507. accept: "application/vnd.github.inertia-preview+json"
  18508. },
  18509. method: "GET",
  18510. params: {
  18511. project_id: {
  18512. required: true,
  18513. type: "integer"
  18514. }
  18515. },
  18516. url: "/projects/:project_id"
  18517. },
  18518. getCard: {
  18519. headers: {
  18520. accept: "application/vnd.github.inertia-preview+json"
  18521. },
  18522. method: "GET",
  18523. params: {
  18524. card_id: {
  18525. required: true,
  18526. type: "integer"
  18527. }
  18528. },
  18529. url: "/projects/columns/cards/:card_id"
  18530. },
  18531. getColumn: {
  18532. headers: {
  18533. accept: "application/vnd.github.inertia-preview+json"
  18534. },
  18535. method: "GET",
  18536. params: {
  18537. column_id: {
  18538. required: true,
  18539. type: "integer"
  18540. }
  18541. },
  18542. url: "/projects/columns/:column_id"
  18543. },
  18544. listCards: {
  18545. headers: {
  18546. accept: "application/vnd.github.inertia-preview+json"
  18547. },
  18548. method: "GET",
  18549. params: {
  18550. archived_state: {
  18551. enum: ["all", "archived", "not_archived"],
  18552. type: "string"
  18553. },
  18554. column_id: {
  18555. required: true,
  18556. type: "integer"
  18557. },
  18558. page: {
  18559. type: "integer"
  18560. },
  18561. per_page: {
  18562. type: "integer"
  18563. }
  18564. },
  18565. url: "/projects/columns/:column_id/cards"
  18566. },
  18567. listCollaborators: {
  18568. headers: {
  18569. accept: "application/vnd.github.inertia-preview+json"
  18570. },
  18571. method: "GET",
  18572. params: {
  18573. affiliation: {
  18574. enum: ["outside", "direct", "all"],
  18575. type: "string"
  18576. },
  18577. page: {
  18578. type: "integer"
  18579. },
  18580. per_page: {
  18581. type: "integer"
  18582. },
  18583. project_id: {
  18584. required: true,
  18585. type: "integer"
  18586. }
  18587. },
  18588. url: "/projects/:project_id/collaborators"
  18589. },
  18590. listColumns: {
  18591. headers: {
  18592. accept: "application/vnd.github.inertia-preview+json"
  18593. },
  18594. method: "GET",
  18595. params: {
  18596. page: {
  18597. type: "integer"
  18598. },
  18599. per_page: {
  18600. type: "integer"
  18601. },
  18602. project_id: {
  18603. required: true,
  18604. type: "integer"
  18605. }
  18606. },
  18607. url: "/projects/:project_id/columns"
  18608. },
  18609. listForOrg: {
  18610. headers: {
  18611. accept: "application/vnd.github.inertia-preview+json"
  18612. },
  18613. method: "GET",
  18614. params: {
  18615. org: {
  18616. required: true,
  18617. type: "string"
  18618. },
  18619. page: {
  18620. type: "integer"
  18621. },
  18622. per_page: {
  18623. type: "integer"
  18624. },
  18625. state: {
  18626. enum: ["open", "closed", "all"],
  18627. type: "string"
  18628. }
  18629. },
  18630. url: "/orgs/:org/projects"
  18631. },
  18632. listForRepo: {
  18633. headers: {
  18634. accept: "application/vnd.github.inertia-preview+json"
  18635. },
  18636. method: "GET",
  18637. params: {
  18638. owner: {
  18639. required: true,
  18640. type: "string"
  18641. },
  18642. page: {
  18643. type: "integer"
  18644. },
  18645. per_page: {
  18646. type: "integer"
  18647. },
  18648. repo: {
  18649. required: true,
  18650. type: "string"
  18651. },
  18652. state: {
  18653. enum: ["open", "closed", "all"],
  18654. type: "string"
  18655. }
  18656. },
  18657. url: "/repos/:owner/:repo/projects"
  18658. },
  18659. listForUser: {
  18660. headers: {
  18661. accept: "application/vnd.github.inertia-preview+json"
  18662. },
  18663. method: "GET",
  18664. params: {
  18665. page: {
  18666. type: "integer"
  18667. },
  18668. per_page: {
  18669. type: "integer"
  18670. },
  18671. state: {
  18672. enum: ["open", "closed", "all"],
  18673. type: "string"
  18674. },
  18675. username: {
  18676. required: true,
  18677. type: "string"
  18678. }
  18679. },
  18680. url: "/users/:username/projects"
  18681. },
  18682. moveCard: {
  18683. headers: {
  18684. accept: "application/vnd.github.inertia-preview+json"
  18685. },
  18686. method: "POST",
  18687. params: {
  18688. card_id: {
  18689. required: true,
  18690. type: "integer"
  18691. },
  18692. column_id: {
  18693. type: "integer"
  18694. },
  18695. position: {
  18696. required: true,
  18697. type: "string",
  18698. validation: "^(top|bottom|after:\\d+)$"
  18699. }
  18700. },
  18701. url: "/projects/columns/cards/:card_id/moves"
  18702. },
  18703. moveColumn: {
  18704. headers: {
  18705. accept: "application/vnd.github.inertia-preview+json"
  18706. },
  18707. method: "POST",
  18708. params: {
  18709. column_id: {
  18710. required: true,
  18711. type: "integer"
  18712. },
  18713. position: {
  18714. required: true,
  18715. type: "string",
  18716. validation: "^(first|last|after:\\d+)$"
  18717. }
  18718. },
  18719. url: "/projects/columns/:column_id/moves"
  18720. },
  18721. removeCollaborator: {
  18722. headers: {
  18723. accept: "application/vnd.github.inertia-preview+json"
  18724. },
  18725. method: "DELETE",
  18726. params: {
  18727. project_id: {
  18728. required: true,
  18729. type: "integer"
  18730. },
  18731. username: {
  18732. required: true,
  18733. type: "string"
  18734. }
  18735. },
  18736. url: "/projects/:project_id/collaborators/:username"
  18737. },
  18738. reviewUserPermissionLevel: {
  18739. headers: {
  18740. accept: "application/vnd.github.inertia-preview+json"
  18741. },
  18742. method: "GET",
  18743. params: {
  18744. project_id: {
  18745. required: true,
  18746. type: "integer"
  18747. },
  18748. username: {
  18749. required: true,
  18750. type: "string"
  18751. }
  18752. },
  18753. url: "/projects/:project_id/collaborators/:username/permission"
  18754. },
  18755. update: {
  18756. headers: {
  18757. accept: "application/vnd.github.inertia-preview+json"
  18758. },
  18759. method: "PATCH",
  18760. params: {
  18761. body: {
  18762. type: "string"
  18763. },
  18764. name: {
  18765. type: "string"
  18766. },
  18767. organization_permission: {
  18768. type: "string"
  18769. },
  18770. private: {
  18771. type: "boolean"
  18772. },
  18773. project_id: {
  18774. required: true,
  18775. type: "integer"
  18776. },
  18777. state: {
  18778. enum: ["open", "closed"],
  18779. type: "string"
  18780. }
  18781. },
  18782. url: "/projects/:project_id"
  18783. },
  18784. updateCard: {
  18785. headers: {
  18786. accept: "application/vnd.github.inertia-preview+json"
  18787. },
  18788. method: "PATCH",
  18789. params: {
  18790. archived: {
  18791. type: "boolean"
  18792. },
  18793. card_id: {
  18794. required: true,
  18795. type: "integer"
  18796. },
  18797. note: {
  18798. type: "string"
  18799. }
  18800. },
  18801. url: "/projects/columns/cards/:card_id"
  18802. },
  18803. updateColumn: {
  18804. headers: {
  18805. accept: "application/vnd.github.inertia-preview+json"
  18806. },
  18807. method: "PATCH",
  18808. params: {
  18809. column_id: {
  18810. required: true,
  18811. type: "integer"
  18812. },
  18813. name: {
  18814. required: true,
  18815. type: "string"
  18816. }
  18817. },
  18818. url: "/projects/columns/:column_id"
  18819. }
  18820. },
  18821. pulls: {
  18822. checkIfMerged: {
  18823. method: "GET",
  18824. params: {
  18825. number: {
  18826. alias: "pull_number",
  18827. deprecated: true,
  18828. type: "integer"
  18829. },
  18830. owner: {
  18831. required: true,
  18832. type: "string"
  18833. },
  18834. pull_number: {
  18835. required: true,
  18836. type: "integer"
  18837. },
  18838. repo: {
  18839. required: true,
  18840. type: "string"
  18841. }
  18842. },
  18843. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  18844. },
  18845. create: {
  18846. method: "POST",
  18847. params: {
  18848. base: {
  18849. required: true,
  18850. type: "string"
  18851. },
  18852. body: {
  18853. type: "string"
  18854. },
  18855. draft: {
  18856. type: "boolean"
  18857. },
  18858. head: {
  18859. required: true,
  18860. type: "string"
  18861. },
  18862. maintainer_can_modify: {
  18863. type: "boolean"
  18864. },
  18865. owner: {
  18866. required: true,
  18867. type: "string"
  18868. },
  18869. repo: {
  18870. required: true,
  18871. type: "string"
  18872. },
  18873. title: {
  18874. required: true,
  18875. type: "string"
  18876. }
  18877. },
  18878. url: "/repos/:owner/:repo/pulls"
  18879. },
  18880. createComment: {
  18881. method: "POST",
  18882. params: {
  18883. body: {
  18884. required: true,
  18885. type: "string"
  18886. },
  18887. commit_id: {
  18888. required: true,
  18889. type: "string"
  18890. },
  18891. in_reply_to: {
  18892. deprecated: true,
  18893. 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.",
  18894. type: "integer"
  18895. },
  18896. line: {
  18897. type: "integer"
  18898. },
  18899. number: {
  18900. alias: "pull_number",
  18901. deprecated: true,
  18902. type: "integer"
  18903. },
  18904. owner: {
  18905. required: true,
  18906. type: "string"
  18907. },
  18908. path: {
  18909. required: true,
  18910. type: "string"
  18911. },
  18912. position: {
  18913. type: "integer"
  18914. },
  18915. pull_number: {
  18916. required: true,
  18917. type: "integer"
  18918. },
  18919. repo: {
  18920. required: true,
  18921. type: "string"
  18922. },
  18923. side: {
  18924. enum: ["LEFT", "RIGHT"],
  18925. type: "string"
  18926. },
  18927. start_line: {
  18928. type: "integer"
  18929. },
  18930. start_side: {
  18931. enum: ["LEFT", "RIGHT", "side"],
  18932. type: "string"
  18933. }
  18934. },
  18935. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18936. },
  18937. createCommentReply: {
  18938. deprecated: "octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)",
  18939. method: "POST",
  18940. params: {
  18941. body: {
  18942. required: true,
  18943. type: "string"
  18944. },
  18945. commit_id: {
  18946. required: true,
  18947. type: "string"
  18948. },
  18949. in_reply_to: {
  18950. deprecated: true,
  18951. 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.",
  18952. type: "integer"
  18953. },
  18954. line: {
  18955. type: "integer"
  18956. },
  18957. number: {
  18958. alias: "pull_number",
  18959. deprecated: true,
  18960. type: "integer"
  18961. },
  18962. owner: {
  18963. required: true,
  18964. type: "string"
  18965. },
  18966. path: {
  18967. required: true,
  18968. type: "string"
  18969. },
  18970. position: {
  18971. type: "integer"
  18972. },
  18973. pull_number: {
  18974. required: true,
  18975. type: "integer"
  18976. },
  18977. repo: {
  18978. required: true,
  18979. type: "string"
  18980. },
  18981. side: {
  18982. enum: ["LEFT", "RIGHT"],
  18983. type: "string"
  18984. },
  18985. start_line: {
  18986. type: "integer"
  18987. },
  18988. start_side: {
  18989. enum: ["LEFT", "RIGHT", "side"],
  18990. type: "string"
  18991. }
  18992. },
  18993. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  18994. },
  18995. createFromIssue: {
  18996. deprecated: "octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request",
  18997. method: "POST",
  18998. params: {
  18999. base: {
  19000. required: true,
  19001. type: "string"
  19002. },
  19003. draft: {
  19004. type: "boolean"
  19005. },
  19006. head: {
  19007. required: true,
  19008. type: "string"
  19009. },
  19010. issue: {
  19011. required: true,
  19012. type: "integer"
  19013. },
  19014. maintainer_can_modify: {
  19015. type: "boolean"
  19016. },
  19017. owner: {
  19018. required: true,
  19019. type: "string"
  19020. },
  19021. repo: {
  19022. required: true,
  19023. type: "string"
  19024. }
  19025. },
  19026. url: "/repos/:owner/:repo/pulls"
  19027. },
  19028. createReview: {
  19029. method: "POST",
  19030. params: {
  19031. body: {
  19032. type: "string"
  19033. },
  19034. comments: {
  19035. type: "object[]"
  19036. },
  19037. "comments[].body": {
  19038. required: true,
  19039. type: "string"
  19040. },
  19041. "comments[].path": {
  19042. required: true,
  19043. type: "string"
  19044. },
  19045. "comments[].position": {
  19046. required: true,
  19047. type: "integer"
  19048. },
  19049. commit_id: {
  19050. type: "string"
  19051. },
  19052. event: {
  19053. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19054. type: "string"
  19055. },
  19056. number: {
  19057. alias: "pull_number",
  19058. deprecated: true,
  19059. type: "integer"
  19060. },
  19061. owner: {
  19062. required: true,
  19063. type: "string"
  19064. },
  19065. pull_number: {
  19066. required: true,
  19067. type: "integer"
  19068. },
  19069. repo: {
  19070. required: true,
  19071. type: "string"
  19072. }
  19073. },
  19074. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19075. },
  19076. createReviewCommentReply: {
  19077. method: "POST",
  19078. params: {
  19079. body: {
  19080. required: true,
  19081. type: "string"
  19082. },
  19083. comment_id: {
  19084. required: true,
  19085. type: "integer"
  19086. },
  19087. owner: {
  19088. required: true,
  19089. type: "string"
  19090. },
  19091. pull_number: {
  19092. required: true,
  19093. type: "integer"
  19094. },
  19095. repo: {
  19096. required: true,
  19097. type: "string"
  19098. }
  19099. },
  19100. url: "/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"
  19101. },
  19102. createReviewRequest: {
  19103. method: "POST",
  19104. params: {
  19105. number: {
  19106. alias: "pull_number",
  19107. deprecated: true,
  19108. type: "integer"
  19109. },
  19110. owner: {
  19111. required: true,
  19112. type: "string"
  19113. },
  19114. pull_number: {
  19115. required: true,
  19116. type: "integer"
  19117. },
  19118. repo: {
  19119. required: true,
  19120. type: "string"
  19121. },
  19122. reviewers: {
  19123. type: "string[]"
  19124. },
  19125. team_reviewers: {
  19126. type: "string[]"
  19127. }
  19128. },
  19129. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19130. },
  19131. deleteComment: {
  19132. method: "DELETE",
  19133. params: {
  19134. comment_id: {
  19135. required: true,
  19136. type: "integer"
  19137. },
  19138. owner: {
  19139. required: true,
  19140. type: "string"
  19141. },
  19142. repo: {
  19143. required: true,
  19144. type: "string"
  19145. }
  19146. },
  19147. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19148. },
  19149. deletePendingReview: {
  19150. method: "DELETE",
  19151. params: {
  19152. number: {
  19153. alias: "pull_number",
  19154. deprecated: true,
  19155. type: "integer"
  19156. },
  19157. owner: {
  19158. required: true,
  19159. type: "string"
  19160. },
  19161. pull_number: {
  19162. required: true,
  19163. type: "integer"
  19164. },
  19165. repo: {
  19166. required: true,
  19167. type: "string"
  19168. },
  19169. review_id: {
  19170. required: true,
  19171. type: "integer"
  19172. }
  19173. },
  19174. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19175. },
  19176. deleteReviewRequest: {
  19177. method: "DELETE",
  19178. params: {
  19179. number: {
  19180. alias: "pull_number",
  19181. deprecated: true,
  19182. type: "integer"
  19183. },
  19184. owner: {
  19185. required: true,
  19186. type: "string"
  19187. },
  19188. pull_number: {
  19189. required: true,
  19190. type: "integer"
  19191. },
  19192. repo: {
  19193. required: true,
  19194. type: "string"
  19195. },
  19196. reviewers: {
  19197. type: "string[]"
  19198. },
  19199. team_reviewers: {
  19200. type: "string[]"
  19201. }
  19202. },
  19203. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19204. },
  19205. dismissReview: {
  19206. method: "PUT",
  19207. params: {
  19208. message: {
  19209. required: true,
  19210. type: "string"
  19211. },
  19212. number: {
  19213. alias: "pull_number",
  19214. deprecated: true,
  19215. type: "integer"
  19216. },
  19217. owner: {
  19218. required: true,
  19219. type: "string"
  19220. },
  19221. pull_number: {
  19222. required: true,
  19223. type: "integer"
  19224. },
  19225. repo: {
  19226. required: true,
  19227. type: "string"
  19228. },
  19229. review_id: {
  19230. required: true,
  19231. type: "integer"
  19232. }
  19233. },
  19234. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"
  19235. },
  19236. get: {
  19237. method: "GET",
  19238. params: {
  19239. number: {
  19240. alias: "pull_number",
  19241. deprecated: true,
  19242. type: "integer"
  19243. },
  19244. owner: {
  19245. required: true,
  19246. type: "string"
  19247. },
  19248. pull_number: {
  19249. required: true,
  19250. type: "integer"
  19251. },
  19252. repo: {
  19253. required: true,
  19254. type: "string"
  19255. }
  19256. },
  19257. url: "/repos/:owner/:repo/pulls/:pull_number"
  19258. },
  19259. getComment: {
  19260. method: "GET",
  19261. params: {
  19262. comment_id: {
  19263. required: true,
  19264. type: "integer"
  19265. },
  19266. owner: {
  19267. required: true,
  19268. type: "string"
  19269. },
  19270. repo: {
  19271. required: true,
  19272. type: "string"
  19273. }
  19274. },
  19275. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19276. },
  19277. getCommentsForReview: {
  19278. method: "GET",
  19279. params: {
  19280. number: {
  19281. alias: "pull_number",
  19282. deprecated: true,
  19283. type: "integer"
  19284. },
  19285. owner: {
  19286. required: true,
  19287. type: "string"
  19288. },
  19289. page: {
  19290. type: "integer"
  19291. },
  19292. per_page: {
  19293. type: "integer"
  19294. },
  19295. pull_number: {
  19296. required: true,
  19297. type: "integer"
  19298. },
  19299. repo: {
  19300. required: true,
  19301. type: "string"
  19302. },
  19303. review_id: {
  19304. required: true,
  19305. type: "integer"
  19306. }
  19307. },
  19308. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"
  19309. },
  19310. getReview: {
  19311. method: "GET",
  19312. params: {
  19313. number: {
  19314. alias: "pull_number",
  19315. deprecated: true,
  19316. type: "integer"
  19317. },
  19318. owner: {
  19319. required: true,
  19320. type: "string"
  19321. },
  19322. pull_number: {
  19323. required: true,
  19324. type: "integer"
  19325. },
  19326. repo: {
  19327. required: true,
  19328. type: "string"
  19329. },
  19330. review_id: {
  19331. required: true,
  19332. type: "integer"
  19333. }
  19334. },
  19335. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19336. },
  19337. list: {
  19338. method: "GET",
  19339. params: {
  19340. base: {
  19341. type: "string"
  19342. },
  19343. direction: {
  19344. enum: ["asc", "desc"],
  19345. type: "string"
  19346. },
  19347. head: {
  19348. type: "string"
  19349. },
  19350. owner: {
  19351. required: true,
  19352. type: "string"
  19353. },
  19354. page: {
  19355. type: "integer"
  19356. },
  19357. per_page: {
  19358. type: "integer"
  19359. },
  19360. repo: {
  19361. required: true,
  19362. type: "string"
  19363. },
  19364. sort: {
  19365. enum: ["created", "updated", "popularity", "long-running"],
  19366. type: "string"
  19367. },
  19368. state: {
  19369. enum: ["open", "closed", "all"],
  19370. type: "string"
  19371. }
  19372. },
  19373. url: "/repos/:owner/:repo/pulls"
  19374. },
  19375. listComments: {
  19376. method: "GET",
  19377. params: {
  19378. direction: {
  19379. enum: ["asc", "desc"],
  19380. type: "string"
  19381. },
  19382. number: {
  19383. alias: "pull_number",
  19384. deprecated: true,
  19385. type: "integer"
  19386. },
  19387. owner: {
  19388. required: true,
  19389. type: "string"
  19390. },
  19391. page: {
  19392. type: "integer"
  19393. },
  19394. per_page: {
  19395. type: "integer"
  19396. },
  19397. pull_number: {
  19398. required: true,
  19399. type: "integer"
  19400. },
  19401. repo: {
  19402. required: true,
  19403. type: "string"
  19404. },
  19405. since: {
  19406. type: "string"
  19407. },
  19408. sort: {
  19409. enum: ["created", "updated"],
  19410. type: "string"
  19411. }
  19412. },
  19413. url: "/repos/:owner/:repo/pulls/:pull_number/comments"
  19414. },
  19415. listCommentsForRepo: {
  19416. method: "GET",
  19417. params: {
  19418. direction: {
  19419. enum: ["asc", "desc"],
  19420. type: "string"
  19421. },
  19422. owner: {
  19423. required: true,
  19424. type: "string"
  19425. },
  19426. page: {
  19427. type: "integer"
  19428. },
  19429. per_page: {
  19430. type: "integer"
  19431. },
  19432. repo: {
  19433. required: true,
  19434. type: "string"
  19435. },
  19436. since: {
  19437. type: "string"
  19438. },
  19439. sort: {
  19440. enum: ["created", "updated"],
  19441. type: "string"
  19442. }
  19443. },
  19444. url: "/repos/:owner/:repo/pulls/comments"
  19445. },
  19446. listCommits: {
  19447. method: "GET",
  19448. params: {
  19449. number: {
  19450. alias: "pull_number",
  19451. deprecated: true,
  19452. type: "integer"
  19453. },
  19454. owner: {
  19455. required: true,
  19456. type: "string"
  19457. },
  19458. page: {
  19459. type: "integer"
  19460. },
  19461. per_page: {
  19462. type: "integer"
  19463. },
  19464. pull_number: {
  19465. required: true,
  19466. type: "integer"
  19467. },
  19468. repo: {
  19469. required: true,
  19470. type: "string"
  19471. }
  19472. },
  19473. url: "/repos/:owner/:repo/pulls/:pull_number/commits"
  19474. },
  19475. listFiles: {
  19476. method: "GET",
  19477. params: {
  19478. number: {
  19479. alias: "pull_number",
  19480. deprecated: true,
  19481. type: "integer"
  19482. },
  19483. owner: {
  19484. required: true,
  19485. type: "string"
  19486. },
  19487. page: {
  19488. type: "integer"
  19489. },
  19490. per_page: {
  19491. type: "integer"
  19492. },
  19493. pull_number: {
  19494. required: true,
  19495. type: "integer"
  19496. },
  19497. repo: {
  19498. required: true,
  19499. type: "string"
  19500. }
  19501. },
  19502. url: "/repos/:owner/:repo/pulls/:pull_number/files"
  19503. },
  19504. listReviewRequests: {
  19505. method: "GET",
  19506. params: {
  19507. number: {
  19508. alias: "pull_number",
  19509. deprecated: true,
  19510. type: "integer"
  19511. },
  19512. owner: {
  19513. required: true,
  19514. type: "string"
  19515. },
  19516. page: {
  19517. type: "integer"
  19518. },
  19519. per_page: {
  19520. type: "integer"
  19521. },
  19522. pull_number: {
  19523. required: true,
  19524. type: "integer"
  19525. },
  19526. repo: {
  19527. required: true,
  19528. type: "string"
  19529. }
  19530. },
  19531. url: "/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"
  19532. },
  19533. listReviews: {
  19534. method: "GET",
  19535. params: {
  19536. number: {
  19537. alias: "pull_number",
  19538. deprecated: true,
  19539. type: "integer"
  19540. },
  19541. owner: {
  19542. required: true,
  19543. type: "string"
  19544. },
  19545. page: {
  19546. type: "integer"
  19547. },
  19548. per_page: {
  19549. type: "integer"
  19550. },
  19551. pull_number: {
  19552. required: true,
  19553. type: "integer"
  19554. },
  19555. repo: {
  19556. required: true,
  19557. type: "string"
  19558. }
  19559. },
  19560. url: "/repos/:owner/:repo/pulls/:pull_number/reviews"
  19561. },
  19562. merge: {
  19563. method: "PUT",
  19564. params: {
  19565. commit_message: {
  19566. type: "string"
  19567. },
  19568. commit_title: {
  19569. type: "string"
  19570. },
  19571. merge_method: {
  19572. enum: ["merge", "squash", "rebase"],
  19573. type: "string"
  19574. },
  19575. number: {
  19576. alias: "pull_number",
  19577. deprecated: true,
  19578. type: "integer"
  19579. },
  19580. owner: {
  19581. required: true,
  19582. type: "string"
  19583. },
  19584. pull_number: {
  19585. required: true,
  19586. type: "integer"
  19587. },
  19588. repo: {
  19589. required: true,
  19590. type: "string"
  19591. },
  19592. sha: {
  19593. type: "string"
  19594. }
  19595. },
  19596. url: "/repos/:owner/:repo/pulls/:pull_number/merge"
  19597. },
  19598. submitReview: {
  19599. method: "POST",
  19600. params: {
  19601. body: {
  19602. type: "string"
  19603. },
  19604. event: {
  19605. enum: ["APPROVE", "REQUEST_CHANGES", "COMMENT"],
  19606. required: true,
  19607. type: "string"
  19608. },
  19609. number: {
  19610. alias: "pull_number",
  19611. deprecated: true,
  19612. type: "integer"
  19613. },
  19614. owner: {
  19615. required: true,
  19616. type: "string"
  19617. },
  19618. pull_number: {
  19619. required: true,
  19620. type: "integer"
  19621. },
  19622. repo: {
  19623. required: true,
  19624. type: "string"
  19625. },
  19626. review_id: {
  19627. required: true,
  19628. type: "integer"
  19629. }
  19630. },
  19631. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"
  19632. },
  19633. update: {
  19634. method: "PATCH",
  19635. params: {
  19636. base: {
  19637. type: "string"
  19638. },
  19639. body: {
  19640. type: "string"
  19641. },
  19642. maintainer_can_modify: {
  19643. type: "boolean"
  19644. },
  19645. number: {
  19646. alias: "pull_number",
  19647. deprecated: true,
  19648. type: "integer"
  19649. },
  19650. owner: {
  19651. required: true,
  19652. type: "string"
  19653. },
  19654. pull_number: {
  19655. required: true,
  19656. type: "integer"
  19657. },
  19658. repo: {
  19659. required: true,
  19660. type: "string"
  19661. },
  19662. state: {
  19663. enum: ["open", "closed"],
  19664. type: "string"
  19665. },
  19666. title: {
  19667. type: "string"
  19668. }
  19669. },
  19670. url: "/repos/:owner/:repo/pulls/:pull_number"
  19671. },
  19672. updateBranch: {
  19673. headers: {
  19674. accept: "application/vnd.github.lydian-preview+json"
  19675. },
  19676. method: "PUT",
  19677. params: {
  19678. expected_head_sha: {
  19679. type: "string"
  19680. },
  19681. owner: {
  19682. required: true,
  19683. type: "string"
  19684. },
  19685. pull_number: {
  19686. required: true,
  19687. type: "integer"
  19688. },
  19689. repo: {
  19690. required: true,
  19691. type: "string"
  19692. }
  19693. },
  19694. url: "/repos/:owner/:repo/pulls/:pull_number/update-branch"
  19695. },
  19696. updateComment: {
  19697. method: "PATCH",
  19698. params: {
  19699. body: {
  19700. required: true,
  19701. type: "string"
  19702. },
  19703. comment_id: {
  19704. required: true,
  19705. type: "integer"
  19706. },
  19707. owner: {
  19708. required: true,
  19709. type: "string"
  19710. },
  19711. repo: {
  19712. required: true,
  19713. type: "string"
  19714. }
  19715. },
  19716. url: "/repos/:owner/:repo/pulls/comments/:comment_id"
  19717. },
  19718. updateReview: {
  19719. method: "PUT",
  19720. params: {
  19721. body: {
  19722. required: true,
  19723. type: "string"
  19724. },
  19725. number: {
  19726. alias: "pull_number",
  19727. deprecated: true,
  19728. type: "integer"
  19729. },
  19730. owner: {
  19731. required: true,
  19732. type: "string"
  19733. },
  19734. pull_number: {
  19735. required: true,
  19736. type: "integer"
  19737. },
  19738. repo: {
  19739. required: true,
  19740. type: "string"
  19741. },
  19742. review_id: {
  19743. required: true,
  19744. type: "integer"
  19745. }
  19746. },
  19747. url: "/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"
  19748. }
  19749. },
  19750. rateLimit: {
  19751. get: {
  19752. method: "GET",
  19753. params: {},
  19754. url: "/rate_limit"
  19755. }
  19756. },
  19757. reactions: {
  19758. createForCommitComment: {
  19759. headers: {
  19760. accept: "application/vnd.github.squirrel-girl-preview+json"
  19761. },
  19762. method: "POST",
  19763. params: {
  19764. comment_id: {
  19765. required: true,
  19766. type: "integer"
  19767. },
  19768. content: {
  19769. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19770. required: true,
  19771. type: "string"
  19772. },
  19773. owner: {
  19774. required: true,
  19775. type: "string"
  19776. },
  19777. repo: {
  19778. required: true,
  19779. type: "string"
  19780. }
  19781. },
  19782. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  19783. },
  19784. createForIssue: {
  19785. headers: {
  19786. accept: "application/vnd.github.squirrel-girl-preview+json"
  19787. },
  19788. method: "POST",
  19789. params: {
  19790. content: {
  19791. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19792. required: true,
  19793. type: "string"
  19794. },
  19795. issue_number: {
  19796. required: true,
  19797. type: "integer"
  19798. },
  19799. number: {
  19800. alias: "issue_number",
  19801. deprecated: true,
  19802. type: "integer"
  19803. },
  19804. owner: {
  19805. required: true,
  19806. type: "string"
  19807. },
  19808. repo: {
  19809. required: true,
  19810. type: "string"
  19811. }
  19812. },
  19813. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  19814. },
  19815. createForIssueComment: {
  19816. headers: {
  19817. accept: "application/vnd.github.squirrel-girl-preview+json"
  19818. },
  19819. method: "POST",
  19820. params: {
  19821. comment_id: {
  19822. required: true,
  19823. type: "integer"
  19824. },
  19825. content: {
  19826. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19827. required: true,
  19828. type: "string"
  19829. },
  19830. owner: {
  19831. required: true,
  19832. type: "string"
  19833. },
  19834. repo: {
  19835. required: true,
  19836. type: "string"
  19837. }
  19838. },
  19839. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  19840. },
  19841. createForPullRequestReviewComment: {
  19842. headers: {
  19843. accept: "application/vnd.github.squirrel-girl-preview+json"
  19844. },
  19845. method: "POST",
  19846. params: {
  19847. comment_id: {
  19848. required: true,
  19849. type: "integer"
  19850. },
  19851. content: {
  19852. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19853. required: true,
  19854. type: "string"
  19855. },
  19856. owner: {
  19857. required: true,
  19858. type: "string"
  19859. },
  19860. repo: {
  19861. required: true,
  19862. type: "string"
  19863. }
  19864. },
  19865. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  19866. },
  19867. createForTeamDiscussion: {
  19868. deprecated: "octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)",
  19869. headers: {
  19870. accept: "application/vnd.github.squirrel-girl-preview+json"
  19871. },
  19872. method: "POST",
  19873. params: {
  19874. content: {
  19875. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19876. required: true,
  19877. type: "string"
  19878. },
  19879. discussion_number: {
  19880. required: true,
  19881. type: "integer"
  19882. },
  19883. team_id: {
  19884. required: true,
  19885. type: "integer"
  19886. }
  19887. },
  19888. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  19889. },
  19890. createForTeamDiscussionComment: {
  19891. deprecated: "octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)",
  19892. headers: {
  19893. accept: "application/vnd.github.squirrel-girl-preview+json"
  19894. },
  19895. method: "POST",
  19896. params: {
  19897. comment_number: {
  19898. required: true,
  19899. type: "integer"
  19900. },
  19901. content: {
  19902. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19903. required: true,
  19904. type: "string"
  19905. },
  19906. discussion_number: {
  19907. required: true,
  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. createForTeamDiscussionCommentInOrg: {
  19918. headers: {
  19919. accept: "application/vnd.github.squirrel-girl-preview+json"
  19920. },
  19921. method: "POST",
  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. required: true,
  19930. type: "string"
  19931. },
  19932. discussion_number: {
  19933. required: true,
  19934. type: "integer"
  19935. },
  19936. org: {
  19937. required: true,
  19938. type: "string"
  19939. },
  19940. team_slug: {
  19941. required: true,
  19942. type: "string"
  19943. }
  19944. },
  19945. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  19946. },
  19947. createForTeamDiscussionCommentLegacy: {
  19948. deprecated: "octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy",
  19949. headers: {
  19950. accept: "application/vnd.github.squirrel-girl-preview+json"
  19951. },
  19952. method: "POST",
  19953. params: {
  19954. comment_number: {
  19955. required: true,
  19956. type: "integer"
  19957. },
  19958. content: {
  19959. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19960. required: true,
  19961. type: "string"
  19962. },
  19963. discussion_number: {
  19964. required: true,
  19965. type: "integer"
  19966. },
  19967. team_id: {
  19968. required: true,
  19969. type: "integer"
  19970. }
  19971. },
  19972. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  19973. },
  19974. createForTeamDiscussionInOrg: {
  19975. headers: {
  19976. accept: "application/vnd.github.squirrel-girl-preview+json"
  19977. },
  19978. method: "POST",
  19979. params: {
  19980. content: {
  19981. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  19982. required: true,
  19983. type: "string"
  19984. },
  19985. discussion_number: {
  19986. required: true,
  19987. type: "integer"
  19988. },
  19989. org: {
  19990. required: true,
  19991. type: "string"
  19992. },
  19993. team_slug: {
  19994. required: true,
  19995. type: "string"
  19996. }
  19997. },
  19998. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  19999. },
  20000. createForTeamDiscussionLegacy: {
  20001. deprecated: "octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy",
  20002. headers: {
  20003. accept: "application/vnd.github.squirrel-girl-preview+json"
  20004. },
  20005. method: "POST",
  20006. params: {
  20007. content: {
  20008. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20009. required: true,
  20010. type: "string"
  20011. },
  20012. discussion_number: {
  20013. required: true,
  20014. type: "integer"
  20015. },
  20016. team_id: {
  20017. required: true,
  20018. type: "integer"
  20019. }
  20020. },
  20021. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20022. },
  20023. delete: {
  20024. headers: {
  20025. accept: "application/vnd.github.squirrel-girl-preview+json"
  20026. },
  20027. method: "DELETE",
  20028. params: {
  20029. reaction_id: {
  20030. required: true,
  20031. type: "integer"
  20032. }
  20033. },
  20034. url: "/reactions/:reaction_id"
  20035. },
  20036. listForCommitComment: {
  20037. headers: {
  20038. accept: "application/vnd.github.squirrel-girl-preview+json"
  20039. },
  20040. method: "GET",
  20041. params: {
  20042. comment_id: {
  20043. required: true,
  20044. type: "integer"
  20045. },
  20046. content: {
  20047. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20048. type: "string"
  20049. },
  20050. owner: {
  20051. required: true,
  20052. type: "string"
  20053. },
  20054. page: {
  20055. type: "integer"
  20056. },
  20057. per_page: {
  20058. type: "integer"
  20059. },
  20060. repo: {
  20061. required: true,
  20062. type: "string"
  20063. }
  20064. },
  20065. url: "/repos/:owner/:repo/comments/:comment_id/reactions"
  20066. },
  20067. listForIssue: {
  20068. headers: {
  20069. accept: "application/vnd.github.squirrel-girl-preview+json"
  20070. },
  20071. method: "GET",
  20072. params: {
  20073. content: {
  20074. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20075. type: "string"
  20076. },
  20077. issue_number: {
  20078. required: true,
  20079. type: "integer"
  20080. },
  20081. number: {
  20082. alias: "issue_number",
  20083. deprecated: true,
  20084. type: "integer"
  20085. },
  20086. owner: {
  20087. required: true,
  20088. type: "string"
  20089. },
  20090. page: {
  20091. type: "integer"
  20092. },
  20093. per_page: {
  20094. type: "integer"
  20095. },
  20096. repo: {
  20097. required: true,
  20098. type: "string"
  20099. }
  20100. },
  20101. url: "/repos/:owner/:repo/issues/:issue_number/reactions"
  20102. },
  20103. listForIssueComment: {
  20104. headers: {
  20105. accept: "application/vnd.github.squirrel-girl-preview+json"
  20106. },
  20107. method: "GET",
  20108. params: {
  20109. comment_id: {
  20110. required: true,
  20111. type: "integer"
  20112. },
  20113. content: {
  20114. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20115. type: "string"
  20116. },
  20117. owner: {
  20118. required: true,
  20119. type: "string"
  20120. },
  20121. page: {
  20122. type: "integer"
  20123. },
  20124. per_page: {
  20125. type: "integer"
  20126. },
  20127. repo: {
  20128. required: true,
  20129. type: "string"
  20130. }
  20131. },
  20132. url: "/repos/:owner/:repo/issues/comments/:comment_id/reactions"
  20133. },
  20134. listForPullRequestReviewComment: {
  20135. headers: {
  20136. accept: "application/vnd.github.squirrel-girl-preview+json"
  20137. },
  20138. method: "GET",
  20139. params: {
  20140. comment_id: {
  20141. required: true,
  20142. type: "integer"
  20143. },
  20144. content: {
  20145. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20146. type: "string"
  20147. },
  20148. owner: {
  20149. required: true,
  20150. type: "string"
  20151. },
  20152. page: {
  20153. type: "integer"
  20154. },
  20155. per_page: {
  20156. type: "integer"
  20157. },
  20158. repo: {
  20159. required: true,
  20160. type: "string"
  20161. }
  20162. },
  20163. url: "/repos/:owner/:repo/pulls/comments/:comment_id/reactions"
  20164. },
  20165. listForTeamDiscussion: {
  20166. deprecated: "octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)",
  20167. headers: {
  20168. accept: "application/vnd.github.squirrel-girl-preview+json"
  20169. },
  20170. method: "GET",
  20171. params: {
  20172. content: {
  20173. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20174. type: "string"
  20175. },
  20176. discussion_number: {
  20177. required: true,
  20178. type: "integer"
  20179. },
  20180. page: {
  20181. type: "integer"
  20182. },
  20183. per_page: {
  20184. type: "integer"
  20185. },
  20186. team_id: {
  20187. required: true,
  20188. type: "integer"
  20189. }
  20190. },
  20191. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20192. },
  20193. listForTeamDiscussionComment: {
  20194. deprecated: "octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)",
  20195. headers: {
  20196. accept: "application/vnd.github.squirrel-girl-preview+json"
  20197. },
  20198. method: "GET",
  20199. params: {
  20200. comment_number: {
  20201. required: true,
  20202. type: "integer"
  20203. },
  20204. content: {
  20205. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20206. type: "string"
  20207. },
  20208. discussion_number: {
  20209. required: true,
  20210. type: "integer"
  20211. },
  20212. page: {
  20213. type: "integer"
  20214. },
  20215. per_page: {
  20216. type: "integer"
  20217. },
  20218. team_id: {
  20219. required: true,
  20220. type: "integer"
  20221. }
  20222. },
  20223. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  20224. },
  20225. listForTeamDiscussionCommentInOrg: {
  20226. headers: {
  20227. accept: "application/vnd.github.squirrel-girl-preview+json"
  20228. },
  20229. method: "GET",
  20230. params: {
  20231. comment_number: {
  20232. required: true,
  20233. type: "integer"
  20234. },
  20235. content: {
  20236. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20237. type: "string"
  20238. },
  20239. discussion_number: {
  20240. required: true,
  20241. type: "integer"
  20242. },
  20243. org: {
  20244. required: true,
  20245. type: "string"
  20246. },
  20247. page: {
  20248. type: "integer"
  20249. },
  20250. per_page: {
  20251. type: "integer"
  20252. },
  20253. team_slug: {
  20254. required: true,
  20255. type: "string"
  20256. }
  20257. },
  20258. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"
  20259. },
  20260. listForTeamDiscussionCommentLegacy: {
  20261. deprecated: "octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy",
  20262. headers: {
  20263. accept: "application/vnd.github.squirrel-girl-preview+json"
  20264. },
  20265. method: "GET",
  20266. params: {
  20267. comment_number: {
  20268. required: true,
  20269. type: "integer"
  20270. },
  20271. content: {
  20272. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20273. type: "string"
  20274. },
  20275. discussion_number: {
  20276. required: true,
  20277. type: "integer"
  20278. },
  20279. page: {
  20280. type: "integer"
  20281. },
  20282. per_page: {
  20283. type: "integer"
  20284. },
  20285. team_id: {
  20286. required: true,
  20287. type: "integer"
  20288. }
  20289. },
  20290. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"
  20291. },
  20292. listForTeamDiscussionInOrg: {
  20293. headers: {
  20294. accept: "application/vnd.github.squirrel-girl-preview+json"
  20295. },
  20296. method: "GET",
  20297. params: {
  20298. content: {
  20299. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20300. type: "string"
  20301. },
  20302. discussion_number: {
  20303. required: true,
  20304. type: "integer"
  20305. },
  20306. org: {
  20307. required: true,
  20308. type: "string"
  20309. },
  20310. page: {
  20311. type: "integer"
  20312. },
  20313. per_page: {
  20314. type: "integer"
  20315. },
  20316. team_slug: {
  20317. required: true,
  20318. type: "string"
  20319. }
  20320. },
  20321. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"
  20322. },
  20323. listForTeamDiscussionLegacy: {
  20324. deprecated: "octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy",
  20325. headers: {
  20326. accept: "application/vnd.github.squirrel-girl-preview+json"
  20327. },
  20328. method: "GET",
  20329. params: {
  20330. content: {
  20331. enum: ["+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"],
  20332. type: "string"
  20333. },
  20334. discussion_number: {
  20335. required: true,
  20336. type: "integer"
  20337. },
  20338. page: {
  20339. type: "integer"
  20340. },
  20341. per_page: {
  20342. type: "integer"
  20343. },
  20344. team_id: {
  20345. required: true,
  20346. type: "integer"
  20347. }
  20348. },
  20349. url: "/teams/:team_id/discussions/:discussion_number/reactions"
  20350. }
  20351. },
  20352. repos: {
  20353. acceptInvitation: {
  20354. method: "PATCH",
  20355. params: {
  20356. invitation_id: {
  20357. required: true,
  20358. type: "integer"
  20359. }
  20360. },
  20361. url: "/user/repository_invitations/:invitation_id"
  20362. },
  20363. addCollaborator: {
  20364. method: "PUT",
  20365. params: {
  20366. owner: {
  20367. required: true,
  20368. type: "string"
  20369. },
  20370. permission: {
  20371. enum: ["pull", "push", "admin"],
  20372. type: "string"
  20373. },
  20374. repo: {
  20375. required: true,
  20376. type: "string"
  20377. },
  20378. username: {
  20379. required: true,
  20380. type: "string"
  20381. }
  20382. },
  20383. url: "/repos/:owner/:repo/collaborators/:username"
  20384. },
  20385. addDeployKey: {
  20386. method: "POST",
  20387. params: {
  20388. key: {
  20389. required: true,
  20390. type: "string"
  20391. },
  20392. owner: {
  20393. required: true,
  20394. type: "string"
  20395. },
  20396. read_only: {
  20397. type: "boolean"
  20398. },
  20399. repo: {
  20400. required: true,
  20401. type: "string"
  20402. },
  20403. title: {
  20404. type: "string"
  20405. }
  20406. },
  20407. url: "/repos/:owner/:repo/keys"
  20408. },
  20409. addProtectedBranchAdminEnforcement: {
  20410. method: "POST",
  20411. params: {
  20412. branch: {
  20413. required: true,
  20414. type: "string"
  20415. },
  20416. owner: {
  20417. required: true,
  20418. type: "string"
  20419. },
  20420. repo: {
  20421. required: true,
  20422. type: "string"
  20423. }
  20424. },
  20425. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  20426. },
  20427. addProtectedBranchAppRestrictions: {
  20428. method: "POST",
  20429. params: {
  20430. apps: {
  20431. mapTo: "data",
  20432. required: true,
  20433. type: "string[]"
  20434. },
  20435. branch: {
  20436. required: true,
  20437. type: "string"
  20438. },
  20439. owner: {
  20440. required: true,
  20441. type: "string"
  20442. },
  20443. repo: {
  20444. required: true,
  20445. type: "string"
  20446. }
  20447. },
  20448. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  20449. },
  20450. addProtectedBranchRequiredSignatures: {
  20451. headers: {
  20452. accept: "application/vnd.github.zzzax-preview+json"
  20453. },
  20454. method: "POST",
  20455. params: {
  20456. branch: {
  20457. required: true,
  20458. type: "string"
  20459. },
  20460. owner: {
  20461. required: true,
  20462. type: "string"
  20463. },
  20464. repo: {
  20465. required: true,
  20466. type: "string"
  20467. }
  20468. },
  20469. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  20470. },
  20471. addProtectedBranchRequiredStatusChecksContexts: {
  20472. method: "POST",
  20473. params: {
  20474. branch: {
  20475. required: true,
  20476. type: "string"
  20477. },
  20478. contexts: {
  20479. mapTo: "data",
  20480. required: true,
  20481. type: "string[]"
  20482. },
  20483. owner: {
  20484. required: true,
  20485. type: "string"
  20486. },
  20487. repo: {
  20488. required: true,
  20489. type: "string"
  20490. }
  20491. },
  20492. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  20493. },
  20494. addProtectedBranchTeamRestrictions: {
  20495. method: "POST",
  20496. params: {
  20497. branch: {
  20498. required: true,
  20499. type: "string"
  20500. },
  20501. owner: {
  20502. required: true,
  20503. type: "string"
  20504. },
  20505. repo: {
  20506. required: true,
  20507. type: "string"
  20508. },
  20509. teams: {
  20510. mapTo: "data",
  20511. required: true,
  20512. type: "string[]"
  20513. }
  20514. },
  20515. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  20516. },
  20517. addProtectedBranchUserRestrictions: {
  20518. method: "POST",
  20519. params: {
  20520. branch: {
  20521. required: true,
  20522. type: "string"
  20523. },
  20524. owner: {
  20525. required: true,
  20526. type: "string"
  20527. },
  20528. repo: {
  20529. required: true,
  20530. type: "string"
  20531. },
  20532. users: {
  20533. mapTo: "data",
  20534. required: true,
  20535. type: "string[]"
  20536. }
  20537. },
  20538. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  20539. },
  20540. checkCollaborator: {
  20541. method: "GET",
  20542. params: {
  20543. owner: {
  20544. required: true,
  20545. type: "string"
  20546. },
  20547. repo: {
  20548. required: true,
  20549. type: "string"
  20550. },
  20551. username: {
  20552. required: true,
  20553. type: "string"
  20554. }
  20555. },
  20556. url: "/repos/:owner/:repo/collaborators/:username"
  20557. },
  20558. checkVulnerabilityAlerts: {
  20559. headers: {
  20560. accept: "application/vnd.github.dorian-preview+json"
  20561. },
  20562. method: "GET",
  20563. params: {
  20564. owner: {
  20565. required: true,
  20566. type: "string"
  20567. },
  20568. repo: {
  20569. required: true,
  20570. type: "string"
  20571. }
  20572. },
  20573. url: "/repos/:owner/:repo/vulnerability-alerts"
  20574. },
  20575. compareCommits: {
  20576. method: "GET",
  20577. params: {
  20578. base: {
  20579. required: true,
  20580. type: "string"
  20581. },
  20582. head: {
  20583. required: true,
  20584. type: "string"
  20585. },
  20586. owner: {
  20587. required: true,
  20588. type: "string"
  20589. },
  20590. repo: {
  20591. required: true,
  20592. type: "string"
  20593. }
  20594. },
  20595. url: "/repos/:owner/:repo/compare/:base...:head"
  20596. },
  20597. createCommitComment: {
  20598. method: "POST",
  20599. params: {
  20600. body: {
  20601. required: true,
  20602. type: "string"
  20603. },
  20604. commit_sha: {
  20605. required: true,
  20606. type: "string"
  20607. },
  20608. line: {
  20609. type: "integer"
  20610. },
  20611. owner: {
  20612. required: true,
  20613. type: "string"
  20614. },
  20615. path: {
  20616. type: "string"
  20617. },
  20618. position: {
  20619. type: "integer"
  20620. },
  20621. repo: {
  20622. required: true,
  20623. type: "string"
  20624. },
  20625. sha: {
  20626. alias: "commit_sha",
  20627. deprecated: true,
  20628. type: "string"
  20629. }
  20630. },
  20631. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  20632. },
  20633. createDeployment: {
  20634. method: "POST",
  20635. params: {
  20636. auto_merge: {
  20637. type: "boolean"
  20638. },
  20639. description: {
  20640. type: "string"
  20641. },
  20642. environment: {
  20643. type: "string"
  20644. },
  20645. owner: {
  20646. required: true,
  20647. type: "string"
  20648. },
  20649. payload: {
  20650. type: "string"
  20651. },
  20652. production_environment: {
  20653. type: "boolean"
  20654. },
  20655. ref: {
  20656. required: true,
  20657. type: "string"
  20658. },
  20659. repo: {
  20660. required: true,
  20661. type: "string"
  20662. },
  20663. required_contexts: {
  20664. type: "string[]"
  20665. },
  20666. task: {
  20667. type: "string"
  20668. },
  20669. transient_environment: {
  20670. type: "boolean"
  20671. }
  20672. },
  20673. url: "/repos/:owner/:repo/deployments"
  20674. },
  20675. createDeploymentStatus: {
  20676. method: "POST",
  20677. params: {
  20678. auto_inactive: {
  20679. type: "boolean"
  20680. },
  20681. deployment_id: {
  20682. required: true,
  20683. type: "integer"
  20684. },
  20685. description: {
  20686. type: "string"
  20687. },
  20688. environment: {
  20689. enum: ["production", "staging", "qa"],
  20690. type: "string"
  20691. },
  20692. environment_url: {
  20693. type: "string"
  20694. },
  20695. log_url: {
  20696. type: "string"
  20697. },
  20698. owner: {
  20699. required: true,
  20700. type: "string"
  20701. },
  20702. repo: {
  20703. required: true,
  20704. type: "string"
  20705. },
  20706. state: {
  20707. enum: ["error", "failure", "inactive", "in_progress", "queued", "pending", "success"],
  20708. required: true,
  20709. type: "string"
  20710. },
  20711. target_url: {
  20712. type: "string"
  20713. }
  20714. },
  20715. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  20716. },
  20717. createDispatchEvent: {
  20718. method: "POST",
  20719. params: {
  20720. client_payload: {
  20721. type: "object"
  20722. },
  20723. event_type: {
  20724. type: "string"
  20725. },
  20726. owner: {
  20727. required: true,
  20728. type: "string"
  20729. },
  20730. repo: {
  20731. required: true,
  20732. type: "string"
  20733. }
  20734. },
  20735. url: "/repos/:owner/:repo/dispatches"
  20736. },
  20737. createFile: {
  20738. deprecated: "octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  20739. method: "PUT",
  20740. params: {
  20741. author: {
  20742. type: "object"
  20743. },
  20744. "author.email": {
  20745. required: true,
  20746. type: "string"
  20747. },
  20748. "author.name": {
  20749. required: true,
  20750. type: "string"
  20751. },
  20752. branch: {
  20753. type: "string"
  20754. },
  20755. committer: {
  20756. type: "object"
  20757. },
  20758. "committer.email": {
  20759. required: true,
  20760. type: "string"
  20761. },
  20762. "committer.name": {
  20763. required: true,
  20764. type: "string"
  20765. },
  20766. content: {
  20767. required: true,
  20768. type: "string"
  20769. },
  20770. message: {
  20771. required: true,
  20772. type: "string"
  20773. },
  20774. owner: {
  20775. required: true,
  20776. type: "string"
  20777. },
  20778. path: {
  20779. required: true,
  20780. type: "string"
  20781. },
  20782. repo: {
  20783. required: true,
  20784. type: "string"
  20785. },
  20786. sha: {
  20787. type: "string"
  20788. }
  20789. },
  20790. url: "/repos/:owner/:repo/contents/:path"
  20791. },
  20792. createForAuthenticatedUser: {
  20793. method: "POST",
  20794. params: {
  20795. allow_merge_commit: {
  20796. type: "boolean"
  20797. },
  20798. allow_rebase_merge: {
  20799. type: "boolean"
  20800. },
  20801. allow_squash_merge: {
  20802. type: "boolean"
  20803. },
  20804. auto_init: {
  20805. type: "boolean"
  20806. },
  20807. delete_branch_on_merge: {
  20808. type: "boolean"
  20809. },
  20810. description: {
  20811. type: "string"
  20812. },
  20813. gitignore_template: {
  20814. type: "string"
  20815. },
  20816. has_issues: {
  20817. type: "boolean"
  20818. },
  20819. has_projects: {
  20820. type: "boolean"
  20821. },
  20822. has_wiki: {
  20823. type: "boolean"
  20824. },
  20825. homepage: {
  20826. type: "string"
  20827. },
  20828. is_template: {
  20829. type: "boolean"
  20830. },
  20831. license_template: {
  20832. type: "string"
  20833. },
  20834. name: {
  20835. required: true,
  20836. type: "string"
  20837. },
  20838. private: {
  20839. type: "boolean"
  20840. },
  20841. team_id: {
  20842. type: "integer"
  20843. },
  20844. visibility: {
  20845. enum: ["public", "private", "visibility", "internal"],
  20846. type: "string"
  20847. }
  20848. },
  20849. url: "/user/repos"
  20850. },
  20851. createFork: {
  20852. method: "POST",
  20853. params: {
  20854. organization: {
  20855. type: "string"
  20856. },
  20857. owner: {
  20858. required: true,
  20859. type: "string"
  20860. },
  20861. repo: {
  20862. required: true,
  20863. type: "string"
  20864. }
  20865. },
  20866. url: "/repos/:owner/:repo/forks"
  20867. },
  20868. createHook: {
  20869. method: "POST",
  20870. params: {
  20871. active: {
  20872. type: "boolean"
  20873. },
  20874. config: {
  20875. required: true,
  20876. type: "object"
  20877. },
  20878. "config.content_type": {
  20879. type: "string"
  20880. },
  20881. "config.insecure_ssl": {
  20882. type: "string"
  20883. },
  20884. "config.secret": {
  20885. type: "string"
  20886. },
  20887. "config.url": {
  20888. required: true,
  20889. type: "string"
  20890. },
  20891. events: {
  20892. type: "string[]"
  20893. },
  20894. name: {
  20895. type: "string"
  20896. },
  20897. owner: {
  20898. required: true,
  20899. type: "string"
  20900. },
  20901. repo: {
  20902. required: true,
  20903. type: "string"
  20904. }
  20905. },
  20906. url: "/repos/:owner/:repo/hooks"
  20907. },
  20908. createInOrg: {
  20909. method: "POST",
  20910. params: {
  20911. allow_merge_commit: {
  20912. type: "boolean"
  20913. },
  20914. allow_rebase_merge: {
  20915. type: "boolean"
  20916. },
  20917. allow_squash_merge: {
  20918. type: "boolean"
  20919. },
  20920. auto_init: {
  20921. type: "boolean"
  20922. },
  20923. delete_branch_on_merge: {
  20924. type: "boolean"
  20925. },
  20926. description: {
  20927. type: "string"
  20928. },
  20929. gitignore_template: {
  20930. type: "string"
  20931. },
  20932. has_issues: {
  20933. type: "boolean"
  20934. },
  20935. has_projects: {
  20936. type: "boolean"
  20937. },
  20938. has_wiki: {
  20939. type: "boolean"
  20940. },
  20941. homepage: {
  20942. type: "string"
  20943. },
  20944. is_template: {
  20945. type: "boolean"
  20946. },
  20947. license_template: {
  20948. type: "string"
  20949. },
  20950. name: {
  20951. required: true,
  20952. type: "string"
  20953. },
  20954. org: {
  20955. required: true,
  20956. type: "string"
  20957. },
  20958. private: {
  20959. type: "boolean"
  20960. },
  20961. team_id: {
  20962. type: "integer"
  20963. },
  20964. visibility: {
  20965. enum: ["public", "private", "visibility", "internal"],
  20966. type: "string"
  20967. }
  20968. },
  20969. url: "/orgs/:org/repos"
  20970. },
  20971. createOrUpdateFile: {
  20972. method: "PUT",
  20973. params: {
  20974. author: {
  20975. type: "object"
  20976. },
  20977. "author.email": {
  20978. required: true,
  20979. type: "string"
  20980. },
  20981. "author.name": {
  20982. required: true,
  20983. type: "string"
  20984. },
  20985. branch: {
  20986. type: "string"
  20987. },
  20988. committer: {
  20989. type: "object"
  20990. },
  20991. "committer.email": {
  20992. required: true,
  20993. type: "string"
  20994. },
  20995. "committer.name": {
  20996. required: true,
  20997. type: "string"
  20998. },
  20999. content: {
  21000. required: true,
  21001. type: "string"
  21002. },
  21003. message: {
  21004. required: true,
  21005. type: "string"
  21006. },
  21007. owner: {
  21008. required: true,
  21009. type: "string"
  21010. },
  21011. path: {
  21012. required: true,
  21013. type: "string"
  21014. },
  21015. repo: {
  21016. required: true,
  21017. type: "string"
  21018. },
  21019. sha: {
  21020. type: "string"
  21021. }
  21022. },
  21023. url: "/repos/:owner/:repo/contents/:path"
  21024. },
  21025. createRelease: {
  21026. method: "POST",
  21027. params: {
  21028. body: {
  21029. type: "string"
  21030. },
  21031. draft: {
  21032. type: "boolean"
  21033. },
  21034. name: {
  21035. type: "string"
  21036. },
  21037. owner: {
  21038. required: true,
  21039. type: "string"
  21040. },
  21041. prerelease: {
  21042. type: "boolean"
  21043. },
  21044. repo: {
  21045. required: true,
  21046. type: "string"
  21047. },
  21048. tag_name: {
  21049. required: true,
  21050. type: "string"
  21051. },
  21052. target_commitish: {
  21053. type: "string"
  21054. }
  21055. },
  21056. url: "/repos/:owner/:repo/releases"
  21057. },
  21058. createStatus: {
  21059. method: "POST",
  21060. params: {
  21061. context: {
  21062. type: "string"
  21063. },
  21064. description: {
  21065. type: "string"
  21066. },
  21067. owner: {
  21068. required: true,
  21069. type: "string"
  21070. },
  21071. repo: {
  21072. required: true,
  21073. type: "string"
  21074. },
  21075. sha: {
  21076. required: true,
  21077. type: "string"
  21078. },
  21079. state: {
  21080. enum: ["error", "failure", "pending", "success"],
  21081. required: true,
  21082. type: "string"
  21083. },
  21084. target_url: {
  21085. type: "string"
  21086. }
  21087. },
  21088. url: "/repos/:owner/:repo/statuses/:sha"
  21089. },
  21090. createUsingTemplate: {
  21091. headers: {
  21092. accept: "application/vnd.github.baptiste-preview+json"
  21093. },
  21094. method: "POST",
  21095. params: {
  21096. description: {
  21097. type: "string"
  21098. },
  21099. name: {
  21100. required: true,
  21101. type: "string"
  21102. },
  21103. owner: {
  21104. type: "string"
  21105. },
  21106. private: {
  21107. type: "boolean"
  21108. },
  21109. template_owner: {
  21110. required: true,
  21111. type: "string"
  21112. },
  21113. template_repo: {
  21114. required: true,
  21115. type: "string"
  21116. }
  21117. },
  21118. url: "/repos/:template_owner/:template_repo/generate"
  21119. },
  21120. declineInvitation: {
  21121. method: "DELETE",
  21122. params: {
  21123. invitation_id: {
  21124. required: true,
  21125. type: "integer"
  21126. }
  21127. },
  21128. url: "/user/repository_invitations/:invitation_id"
  21129. },
  21130. delete: {
  21131. method: "DELETE",
  21132. params: {
  21133. owner: {
  21134. required: true,
  21135. type: "string"
  21136. },
  21137. repo: {
  21138. required: true,
  21139. type: "string"
  21140. }
  21141. },
  21142. url: "/repos/:owner/:repo"
  21143. },
  21144. deleteCommitComment: {
  21145. method: "DELETE",
  21146. params: {
  21147. comment_id: {
  21148. required: true,
  21149. type: "integer"
  21150. },
  21151. owner: {
  21152. required: true,
  21153. type: "string"
  21154. },
  21155. repo: {
  21156. required: true,
  21157. type: "string"
  21158. }
  21159. },
  21160. url: "/repos/:owner/:repo/comments/:comment_id"
  21161. },
  21162. deleteDownload: {
  21163. method: "DELETE",
  21164. params: {
  21165. download_id: {
  21166. required: true,
  21167. type: "integer"
  21168. },
  21169. owner: {
  21170. required: true,
  21171. type: "string"
  21172. },
  21173. repo: {
  21174. required: true,
  21175. type: "string"
  21176. }
  21177. },
  21178. url: "/repos/:owner/:repo/downloads/:download_id"
  21179. },
  21180. deleteFile: {
  21181. method: "DELETE",
  21182. params: {
  21183. author: {
  21184. type: "object"
  21185. },
  21186. "author.email": {
  21187. type: "string"
  21188. },
  21189. "author.name": {
  21190. type: "string"
  21191. },
  21192. branch: {
  21193. type: "string"
  21194. },
  21195. committer: {
  21196. type: "object"
  21197. },
  21198. "committer.email": {
  21199. type: "string"
  21200. },
  21201. "committer.name": {
  21202. type: "string"
  21203. },
  21204. message: {
  21205. required: true,
  21206. type: "string"
  21207. },
  21208. owner: {
  21209. required: true,
  21210. type: "string"
  21211. },
  21212. path: {
  21213. required: true,
  21214. type: "string"
  21215. },
  21216. repo: {
  21217. required: true,
  21218. type: "string"
  21219. },
  21220. sha: {
  21221. required: true,
  21222. type: "string"
  21223. }
  21224. },
  21225. url: "/repos/:owner/:repo/contents/:path"
  21226. },
  21227. deleteHook: {
  21228. method: "DELETE",
  21229. params: {
  21230. hook_id: {
  21231. required: true,
  21232. type: "integer"
  21233. },
  21234. owner: {
  21235. required: true,
  21236. type: "string"
  21237. },
  21238. repo: {
  21239. required: true,
  21240. type: "string"
  21241. }
  21242. },
  21243. url: "/repos/:owner/:repo/hooks/:hook_id"
  21244. },
  21245. deleteInvitation: {
  21246. method: "DELETE",
  21247. params: {
  21248. invitation_id: {
  21249. required: true,
  21250. type: "integer"
  21251. },
  21252. owner: {
  21253. required: true,
  21254. type: "string"
  21255. },
  21256. repo: {
  21257. required: true,
  21258. type: "string"
  21259. }
  21260. },
  21261. url: "/repos/:owner/:repo/invitations/:invitation_id"
  21262. },
  21263. deleteRelease: {
  21264. method: "DELETE",
  21265. params: {
  21266. owner: {
  21267. required: true,
  21268. type: "string"
  21269. },
  21270. release_id: {
  21271. required: true,
  21272. type: "integer"
  21273. },
  21274. repo: {
  21275. required: true,
  21276. type: "string"
  21277. }
  21278. },
  21279. url: "/repos/:owner/:repo/releases/:release_id"
  21280. },
  21281. deleteReleaseAsset: {
  21282. method: "DELETE",
  21283. params: {
  21284. asset_id: {
  21285. required: true,
  21286. type: "integer"
  21287. },
  21288. owner: {
  21289. required: true,
  21290. type: "string"
  21291. },
  21292. repo: {
  21293. required: true,
  21294. type: "string"
  21295. }
  21296. },
  21297. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  21298. },
  21299. disableAutomatedSecurityFixes: {
  21300. headers: {
  21301. accept: "application/vnd.github.london-preview+json"
  21302. },
  21303. method: "DELETE",
  21304. params: {
  21305. owner: {
  21306. required: true,
  21307. type: "string"
  21308. },
  21309. repo: {
  21310. required: true,
  21311. type: "string"
  21312. }
  21313. },
  21314. url: "/repos/:owner/:repo/automated-security-fixes"
  21315. },
  21316. disablePagesSite: {
  21317. headers: {
  21318. accept: "application/vnd.github.switcheroo-preview+json"
  21319. },
  21320. method: "DELETE",
  21321. params: {
  21322. owner: {
  21323. required: true,
  21324. type: "string"
  21325. },
  21326. repo: {
  21327. required: true,
  21328. type: "string"
  21329. }
  21330. },
  21331. url: "/repos/:owner/:repo/pages"
  21332. },
  21333. disableVulnerabilityAlerts: {
  21334. headers: {
  21335. accept: "application/vnd.github.dorian-preview+json"
  21336. },
  21337. method: "DELETE",
  21338. params: {
  21339. owner: {
  21340. required: true,
  21341. type: "string"
  21342. },
  21343. repo: {
  21344. required: true,
  21345. type: "string"
  21346. }
  21347. },
  21348. url: "/repos/:owner/:repo/vulnerability-alerts"
  21349. },
  21350. enableAutomatedSecurityFixes: {
  21351. headers: {
  21352. accept: "application/vnd.github.london-preview+json"
  21353. },
  21354. method: "PUT",
  21355. params: {
  21356. owner: {
  21357. required: true,
  21358. type: "string"
  21359. },
  21360. repo: {
  21361. required: true,
  21362. type: "string"
  21363. }
  21364. },
  21365. url: "/repos/:owner/:repo/automated-security-fixes"
  21366. },
  21367. enablePagesSite: {
  21368. headers: {
  21369. accept: "application/vnd.github.switcheroo-preview+json"
  21370. },
  21371. method: "POST",
  21372. params: {
  21373. owner: {
  21374. required: true,
  21375. type: "string"
  21376. },
  21377. repo: {
  21378. required: true,
  21379. type: "string"
  21380. },
  21381. source: {
  21382. type: "object"
  21383. },
  21384. "source.branch": {
  21385. enum: ["master", "gh-pages"],
  21386. type: "string"
  21387. },
  21388. "source.path": {
  21389. type: "string"
  21390. }
  21391. },
  21392. url: "/repos/:owner/:repo/pages"
  21393. },
  21394. enableVulnerabilityAlerts: {
  21395. headers: {
  21396. accept: "application/vnd.github.dorian-preview+json"
  21397. },
  21398. method: "PUT",
  21399. params: {
  21400. owner: {
  21401. required: true,
  21402. type: "string"
  21403. },
  21404. repo: {
  21405. required: true,
  21406. type: "string"
  21407. }
  21408. },
  21409. url: "/repos/:owner/:repo/vulnerability-alerts"
  21410. },
  21411. get: {
  21412. method: "GET",
  21413. params: {
  21414. owner: {
  21415. required: true,
  21416. type: "string"
  21417. },
  21418. repo: {
  21419. required: true,
  21420. type: "string"
  21421. }
  21422. },
  21423. url: "/repos/:owner/:repo"
  21424. },
  21425. getAppsWithAccessToProtectedBranch: {
  21426. method: "GET",
  21427. params: {
  21428. branch: {
  21429. required: true,
  21430. type: "string"
  21431. },
  21432. owner: {
  21433. required: true,
  21434. type: "string"
  21435. },
  21436. repo: {
  21437. required: true,
  21438. type: "string"
  21439. }
  21440. },
  21441. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  21442. },
  21443. getArchiveLink: {
  21444. method: "GET",
  21445. params: {
  21446. archive_format: {
  21447. required: true,
  21448. type: "string"
  21449. },
  21450. owner: {
  21451. required: true,
  21452. type: "string"
  21453. },
  21454. ref: {
  21455. required: true,
  21456. type: "string"
  21457. },
  21458. repo: {
  21459. required: true,
  21460. type: "string"
  21461. }
  21462. },
  21463. url: "/repos/:owner/:repo/:archive_format/:ref"
  21464. },
  21465. getBranch: {
  21466. method: "GET",
  21467. params: {
  21468. branch: {
  21469. required: true,
  21470. type: "string"
  21471. },
  21472. owner: {
  21473. required: true,
  21474. type: "string"
  21475. },
  21476. repo: {
  21477. required: true,
  21478. type: "string"
  21479. }
  21480. },
  21481. url: "/repos/:owner/:repo/branches/:branch"
  21482. },
  21483. getBranchProtection: {
  21484. method: "GET",
  21485. params: {
  21486. branch: {
  21487. required: true,
  21488. type: "string"
  21489. },
  21490. owner: {
  21491. required: true,
  21492. type: "string"
  21493. },
  21494. repo: {
  21495. required: true,
  21496. type: "string"
  21497. }
  21498. },
  21499. url: "/repos/:owner/:repo/branches/:branch/protection"
  21500. },
  21501. getClones: {
  21502. method: "GET",
  21503. params: {
  21504. owner: {
  21505. required: true,
  21506. type: "string"
  21507. },
  21508. per: {
  21509. enum: ["day", "week"],
  21510. type: "string"
  21511. },
  21512. repo: {
  21513. required: true,
  21514. type: "string"
  21515. }
  21516. },
  21517. url: "/repos/:owner/:repo/traffic/clones"
  21518. },
  21519. getCodeFrequencyStats: {
  21520. method: "GET",
  21521. params: {
  21522. owner: {
  21523. required: true,
  21524. type: "string"
  21525. },
  21526. repo: {
  21527. required: true,
  21528. type: "string"
  21529. }
  21530. },
  21531. url: "/repos/:owner/:repo/stats/code_frequency"
  21532. },
  21533. getCollaboratorPermissionLevel: {
  21534. method: "GET",
  21535. params: {
  21536. owner: {
  21537. required: true,
  21538. type: "string"
  21539. },
  21540. repo: {
  21541. required: true,
  21542. type: "string"
  21543. },
  21544. username: {
  21545. required: true,
  21546. type: "string"
  21547. }
  21548. },
  21549. url: "/repos/:owner/:repo/collaborators/:username/permission"
  21550. },
  21551. getCombinedStatusForRef: {
  21552. method: "GET",
  21553. params: {
  21554. owner: {
  21555. required: true,
  21556. type: "string"
  21557. },
  21558. ref: {
  21559. required: true,
  21560. type: "string"
  21561. },
  21562. repo: {
  21563. required: true,
  21564. type: "string"
  21565. }
  21566. },
  21567. url: "/repos/:owner/:repo/commits/:ref/status"
  21568. },
  21569. getCommit: {
  21570. method: "GET",
  21571. params: {
  21572. commit_sha: {
  21573. alias: "ref",
  21574. deprecated: true,
  21575. type: "string"
  21576. },
  21577. owner: {
  21578. required: true,
  21579. type: "string"
  21580. },
  21581. ref: {
  21582. required: true,
  21583. type: "string"
  21584. },
  21585. repo: {
  21586. required: true,
  21587. type: "string"
  21588. },
  21589. sha: {
  21590. alias: "ref",
  21591. deprecated: true,
  21592. type: "string"
  21593. }
  21594. },
  21595. url: "/repos/:owner/:repo/commits/:ref"
  21596. },
  21597. getCommitActivityStats: {
  21598. method: "GET",
  21599. params: {
  21600. owner: {
  21601. required: true,
  21602. type: "string"
  21603. },
  21604. repo: {
  21605. required: true,
  21606. type: "string"
  21607. }
  21608. },
  21609. url: "/repos/:owner/:repo/stats/commit_activity"
  21610. },
  21611. getCommitComment: {
  21612. method: "GET",
  21613. params: {
  21614. comment_id: {
  21615. required: true,
  21616. type: "integer"
  21617. },
  21618. owner: {
  21619. required: true,
  21620. type: "string"
  21621. },
  21622. repo: {
  21623. required: true,
  21624. type: "string"
  21625. }
  21626. },
  21627. url: "/repos/:owner/:repo/comments/:comment_id"
  21628. },
  21629. getCommitRefSha: {
  21630. deprecated: "octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit",
  21631. headers: {
  21632. accept: "application/vnd.github.v3.sha"
  21633. },
  21634. method: "GET",
  21635. params: {
  21636. owner: {
  21637. required: true,
  21638. type: "string"
  21639. },
  21640. ref: {
  21641. required: true,
  21642. type: "string"
  21643. },
  21644. repo: {
  21645. required: true,
  21646. type: "string"
  21647. }
  21648. },
  21649. url: "/repos/:owner/:repo/commits/:ref"
  21650. },
  21651. getContents: {
  21652. method: "GET",
  21653. params: {
  21654. owner: {
  21655. required: true,
  21656. type: "string"
  21657. },
  21658. path: {
  21659. required: true,
  21660. type: "string"
  21661. },
  21662. ref: {
  21663. type: "string"
  21664. },
  21665. repo: {
  21666. required: true,
  21667. type: "string"
  21668. }
  21669. },
  21670. url: "/repos/:owner/:repo/contents/:path"
  21671. },
  21672. getContributorsStats: {
  21673. method: "GET",
  21674. params: {
  21675. owner: {
  21676. required: true,
  21677. type: "string"
  21678. },
  21679. repo: {
  21680. required: true,
  21681. type: "string"
  21682. }
  21683. },
  21684. url: "/repos/:owner/:repo/stats/contributors"
  21685. },
  21686. getDeployKey: {
  21687. method: "GET",
  21688. params: {
  21689. key_id: {
  21690. required: true,
  21691. type: "integer"
  21692. },
  21693. owner: {
  21694. required: true,
  21695. type: "string"
  21696. },
  21697. repo: {
  21698. required: true,
  21699. type: "string"
  21700. }
  21701. },
  21702. url: "/repos/:owner/:repo/keys/:key_id"
  21703. },
  21704. getDeployment: {
  21705. method: "GET",
  21706. params: {
  21707. deployment_id: {
  21708. required: true,
  21709. type: "integer"
  21710. },
  21711. owner: {
  21712. required: true,
  21713. type: "string"
  21714. },
  21715. repo: {
  21716. required: true,
  21717. type: "string"
  21718. }
  21719. },
  21720. url: "/repos/:owner/:repo/deployments/:deployment_id"
  21721. },
  21722. getDeploymentStatus: {
  21723. method: "GET",
  21724. params: {
  21725. deployment_id: {
  21726. required: true,
  21727. type: "integer"
  21728. },
  21729. owner: {
  21730. required: true,
  21731. type: "string"
  21732. },
  21733. repo: {
  21734. required: true,
  21735. type: "string"
  21736. },
  21737. status_id: {
  21738. required: true,
  21739. type: "integer"
  21740. }
  21741. },
  21742. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"
  21743. },
  21744. getDownload: {
  21745. method: "GET",
  21746. params: {
  21747. download_id: {
  21748. required: true,
  21749. type: "integer"
  21750. },
  21751. owner: {
  21752. required: true,
  21753. type: "string"
  21754. },
  21755. repo: {
  21756. required: true,
  21757. type: "string"
  21758. }
  21759. },
  21760. url: "/repos/:owner/:repo/downloads/:download_id"
  21761. },
  21762. getHook: {
  21763. method: "GET",
  21764. params: {
  21765. hook_id: {
  21766. required: true,
  21767. type: "integer"
  21768. },
  21769. owner: {
  21770. required: true,
  21771. type: "string"
  21772. },
  21773. repo: {
  21774. required: true,
  21775. type: "string"
  21776. }
  21777. },
  21778. url: "/repos/:owner/:repo/hooks/:hook_id"
  21779. },
  21780. getLatestPagesBuild: {
  21781. method: "GET",
  21782. params: {
  21783. owner: {
  21784. required: true,
  21785. type: "string"
  21786. },
  21787. repo: {
  21788. required: true,
  21789. type: "string"
  21790. }
  21791. },
  21792. url: "/repos/:owner/:repo/pages/builds/latest"
  21793. },
  21794. getLatestRelease: {
  21795. method: "GET",
  21796. params: {
  21797. owner: {
  21798. required: true,
  21799. type: "string"
  21800. },
  21801. repo: {
  21802. required: true,
  21803. type: "string"
  21804. }
  21805. },
  21806. url: "/repos/:owner/:repo/releases/latest"
  21807. },
  21808. getPages: {
  21809. method: "GET",
  21810. params: {
  21811. owner: {
  21812. required: true,
  21813. type: "string"
  21814. },
  21815. repo: {
  21816. required: true,
  21817. type: "string"
  21818. }
  21819. },
  21820. url: "/repos/:owner/:repo/pages"
  21821. },
  21822. getPagesBuild: {
  21823. method: "GET",
  21824. params: {
  21825. build_id: {
  21826. required: true,
  21827. type: "integer"
  21828. },
  21829. owner: {
  21830. required: true,
  21831. type: "string"
  21832. },
  21833. repo: {
  21834. required: true,
  21835. type: "string"
  21836. }
  21837. },
  21838. url: "/repos/:owner/:repo/pages/builds/:build_id"
  21839. },
  21840. getParticipationStats: {
  21841. method: "GET",
  21842. params: {
  21843. owner: {
  21844. required: true,
  21845. type: "string"
  21846. },
  21847. repo: {
  21848. required: true,
  21849. type: "string"
  21850. }
  21851. },
  21852. url: "/repos/:owner/:repo/stats/participation"
  21853. },
  21854. getProtectedBranchAdminEnforcement: {
  21855. method: "GET",
  21856. params: {
  21857. branch: {
  21858. required: true,
  21859. type: "string"
  21860. },
  21861. owner: {
  21862. required: true,
  21863. type: "string"
  21864. },
  21865. repo: {
  21866. required: true,
  21867. type: "string"
  21868. }
  21869. },
  21870. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  21871. },
  21872. getProtectedBranchPullRequestReviewEnforcement: {
  21873. method: "GET",
  21874. params: {
  21875. branch: {
  21876. required: true,
  21877. type: "string"
  21878. },
  21879. owner: {
  21880. required: true,
  21881. type: "string"
  21882. },
  21883. repo: {
  21884. required: true,
  21885. type: "string"
  21886. }
  21887. },
  21888. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  21889. },
  21890. getProtectedBranchRequiredSignatures: {
  21891. headers: {
  21892. accept: "application/vnd.github.zzzax-preview+json"
  21893. },
  21894. method: "GET",
  21895. params: {
  21896. branch: {
  21897. required: true,
  21898. type: "string"
  21899. },
  21900. owner: {
  21901. required: true,
  21902. type: "string"
  21903. },
  21904. repo: {
  21905. required: true,
  21906. type: "string"
  21907. }
  21908. },
  21909. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  21910. },
  21911. getProtectedBranchRequiredStatusChecks: {
  21912. method: "GET",
  21913. params: {
  21914. branch: {
  21915. required: true,
  21916. type: "string"
  21917. },
  21918. owner: {
  21919. required: true,
  21920. type: "string"
  21921. },
  21922. repo: {
  21923. required: true,
  21924. type: "string"
  21925. }
  21926. },
  21927. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  21928. },
  21929. getProtectedBranchRestrictions: {
  21930. method: "GET",
  21931. params: {
  21932. branch: {
  21933. required: true,
  21934. type: "string"
  21935. },
  21936. owner: {
  21937. required: true,
  21938. type: "string"
  21939. },
  21940. repo: {
  21941. required: true,
  21942. type: "string"
  21943. }
  21944. },
  21945. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  21946. },
  21947. getPunchCardStats: {
  21948. method: "GET",
  21949. params: {
  21950. owner: {
  21951. required: true,
  21952. type: "string"
  21953. },
  21954. repo: {
  21955. required: true,
  21956. type: "string"
  21957. }
  21958. },
  21959. url: "/repos/:owner/:repo/stats/punch_card"
  21960. },
  21961. getReadme: {
  21962. method: "GET",
  21963. params: {
  21964. owner: {
  21965. required: true,
  21966. type: "string"
  21967. },
  21968. ref: {
  21969. type: "string"
  21970. },
  21971. repo: {
  21972. required: true,
  21973. type: "string"
  21974. }
  21975. },
  21976. url: "/repos/:owner/:repo/readme"
  21977. },
  21978. getRelease: {
  21979. method: "GET",
  21980. params: {
  21981. owner: {
  21982. required: true,
  21983. type: "string"
  21984. },
  21985. release_id: {
  21986. required: true,
  21987. type: "integer"
  21988. },
  21989. repo: {
  21990. required: true,
  21991. type: "string"
  21992. }
  21993. },
  21994. url: "/repos/:owner/:repo/releases/:release_id"
  21995. },
  21996. getReleaseAsset: {
  21997. method: "GET",
  21998. params: {
  21999. asset_id: {
  22000. required: true,
  22001. type: "integer"
  22002. },
  22003. owner: {
  22004. required: true,
  22005. type: "string"
  22006. },
  22007. repo: {
  22008. required: true,
  22009. type: "string"
  22010. }
  22011. },
  22012. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  22013. },
  22014. getReleaseByTag: {
  22015. method: "GET",
  22016. params: {
  22017. owner: {
  22018. required: true,
  22019. type: "string"
  22020. },
  22021. repo: {
  22022. required: true,
  22023. type: "string"
  22024. },
  22025. tag: {
  22026. required: true,
  22027. type: "string"
  22028. }
  22029. },
  22030. url: "/repos/:owner/:repo/releases/tags/:tag"
  22031. },
  22032. getTeamsWithAccessToProtectedBranch: {
  22033. method: "GET",
  22034. params: {
  22035. branch: {
  22036. required: true,
  22037. type: "string"
  22038. },
  22039. owner: {
  22040. required: true,
  22041. type: "string"
  22042. },
  22043. repo: {
  22044. required: true,
  22045. type: "string"
  22046. }
  22047. },
  22048. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22049. },
  22050. getTopPaths: {
  22051. method: "GET",
  22052. params: {
  22053. owner: {
  22054. required: true,
  22055. type: "string"
  22056. },
  22057. repo: {
  22058. required: true,
  22059. type: "string"
  22060. }
  22061. },
  22062. url: "/repos/:owner/:repo/traffic/popular/paths"
  22063. },
  22064. getTopReferrers: {
  22065. method: "GET",
  22066. params: {
  22067. owner: {
  22068. required: true,
  22069. type: "string"
  22070. },
  22071. repo: {
  22072. required: true,
  22073. type: "string"
  22074. }
  22075. },
  22076. url: "/repos/:owner/:repo/traffic/popular/referrers"
  22077. },
  22078. getUsersWithAccessToProtectedBranch: {
  22079. method: "GET",
  22080. params: {
  22081. branch: {
  22082. required: true,
  22083. type: "string"
  22084. },
  22085. owner: {
  22086. required: true,
  22087. type: "string"
  22088. },
  22089. repo: {
  22090. required: true,
  22091. type: "string"
  22092. }
  22093. },
  22094. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22095. },
  22096. getViews: {
  22097. method: "GET",
  22098. params: {
  22099. owner: {
  22100. required: true,
  22101. type: "string"
  22102. },
  22103. per: {
  22104. enum: ["day", "week"],
  22105. type: "string"
  22106. },
  22107. repo: {
  22108. required: true,
  22109. type: "string"
  22110. }
  22111. },
  22112. url: "/repos/:owner/:repo/traffic/views"
  22113. },
  22114. list: {
  22115. method: "GET",
  22116. params: {
  22117. affiliation: {
  22118. type: "string"
  22119. },
  22120. direction: {
  22121. enum: ["asc", "desc"],
  22122. type: "string"
  22123. },
  22124. page: {
  22125. type: "integer"
  22126. },
  22127. per_page: {
  22128. type: "integer"
  22129. },
  22130. sort: {
  22131. enum: ["created", "updated", "pushed", "full_name"],
  22132. type: "string"
  22133. },
  22134. type: {
  22135. enum: ["all", "owner", "public", "private", "member"],
  22136. type: "string"
  22137. },
  22138. visibility: {
  22139. enum: ["all", "public", "private"],
  22140. type: "string"
  22141. }
  22142. },
  22143. url: "/user/repos"
  22144. },
  22145. listAppsWithAccessToProtectedBranch: {
  22146. deprecated: "octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)",
  22147. method: "GET",
  22148. params: {
  22149. branch: {
  22150. required: true,
  22151. type: "string"
  22152. },
  22153. owner: {
  22154. required: true,
  22155. type: "string"
  22156. },
  22157. repo: {
  22158. required: true,
  22159. type: "string"
  22160. }
  22161. },
  22162. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22163. },
  22164. listAssetsForRelease: {
  22165. method: "GET",
  22166. params: {
  22167. owner: {
  22168. required: true,
  22169. type: "string"
  22170. },
  22171. page: {
  22172. type: "integer"
  22173. },
  22174. per_page: {
  22175. type: "integer"
  22176. },
  22177. release_id: {
  22178. required: true,
  22179. type: "integer"
  22180. },
  22181. repo: {
  22182. required: true,
  22183. type: "string"
  22184. }
  22185. },
  22186. url: "/repos/:owner/:repo/releases/:release_id/assets"
  22187. },
  22188. listBranches: {
  22189. method: "GET",
  22190. params: {
  22191. owner: {
  22192. required: true,
  22193. type: "string"
  22194. },
  22195. page: {
  22196. type: "integer"
  22197. },
  22198. per_page: {
  22199. type: "integer"
  22200. },
  22201. protected: {
  22202. type: "boolean"
  22203. },
  22204. repo: {
  22205. required: true,
  22206. type: "string"
  22207. }
  22208. },
  22209. url: "/repos/:owner/:repo/branches"
  22210. },
  22211. listBranchesForHeadCommit: {
  22212. headers: {
  22213. accept: "application/vnd.github.groot-preview+json"
  22214. },
  22215. method: "GET",
  22216. params: {
  22217. commit_sha: {
  22218. required: true,
  22219. type: "string"
  22220. },
  22221. owner: {
  22222. required: true,
  22223. type: "string"
  22224. },
  22225. repo: {
  22226. required: true,
  22227. type: "string"
  22228. }
  22229. },
  22230. url: "/repos/:owner/:repo/commits/:commit_sha/branches-where-head"
  22231. },
  22232. listCollaborators: {
  22233. method: "GET",
  22234. params: {
  22235. affiliation: {
  22236. enum: ["outside", "direct", "all"],
  22237. type: "string"
  22238. },
  22239. owner: {
  22240. required: true,
  22241. type: "string"
  22242. },
  22243. page: {
  22244. type: "integer"
  22245. },
  22246. per_page: {
  22247. type: "integer"
  22248. },
  22249. repo: {
  22250. required: true,
  22251. type: "string"
  22252. }
  22253. },
  22254. url: "/repos/:owner/:repo/collaborators"
  22255. },
  22256. listCommentsForCommit: {
  22257. method: "GET",
  22258. params: {
  22259. commit_sha: {
  22260. required: true,
  22261. type: "string"
  22262. },
  22263. owner: {
  22264. required: true,
  22265. type: "string"
  22266. },
  22267. page: {
  22268. type: "integer"
  22269. },
  22270. per_page: {
  22271. type: "integer"
  22272. },
  22273. ref: {
  22274. alias: "commit_sha",
  22275. deprecated: true,
  22276. type: "string"
  22277. },
  22278. repo: {
  22279. required: true,
  22280. type: "string"
  22281. }
  22282. },
  22283. url: "/repos/:owner/:repo/commits/:commit_sha/comments"
  22284. },
  22285. listCommitComments: {
  22286. method: "GET",
  22287. params: {
  22288. owner: {
  22289. required: true,
  22290. type: "string"
  22291. },
  22292. page: {
  22293. type: "integer"
  22294. },
  22295. per_page: {
  22296. type: "integer"
  22297. },
  22298. repo: {
  22299. required: true,
  22300. type: "string"
  22301. }
  22302. },
  22303. url: "/repos/:owner/:repo/comments"
  22304. },
  22305. listCommits: {
  22306. method: "GET",
  22307. params: {
  22308. author: {
  22309. type: "string"
  22310. },
  22311. owner: {
  22312. required: true,
  22313. type: "string"
  22314. },
  22315. page: {
  22316. type: "integer"
  22317. },
  22318. path: {
  22319. type: "string"
  22320. },
  22321. per_page: {
  22322. type: "integer"
  22323. },
  22324. repo: {
  22325. required: true,
  22326. type: "string"
  22327. },
  22328. sha: {
  22329. type: "string"
  22330. },
  22331. since: {
  22332. type: "string"
  22333. },
  22334. until: {
  22335. type: "string"
  22336. }
  22337. },
  22338. url: "/repos/:owner/:repo/commits"
  22339. },
  22340. listContributors: {
  22341. method: "GET",
  22342. params: {
  22343. anon: {
  22344. type: "string"
  22345. },
  22346. owner: {
  22347. required: true,
  22348. type: "string"
  22349. },
  22350. page: {
  22351. type: "integer"
  22352. },
  22353. per_page: {
  22354. type: "integer"
  22355. },
  22356. repo: {
  22357. required: true,
  22358. type: "string"
  22359. }
  22360. },
  22361. url: "/repos/:owner/:repo/contributors"
  22362. },
  22363. listDeployKeys: {
  22364. method: "GET",
  22365. params: {
  22366. owner: {
  22367. required: true,
  22368. type: "string"
  22369. },
  22370. page: {
  22371. type: "integer"
  22372. },
  22373. per_page: {
  22374. type: "integer"
  22375. },
  22376. repo: {
  22377. required: true,
  22378. type: "string"
  22379. }
  22380. },
  22381. url: "/repos/:owner/:repo/keys"
  22382. },
  22383. listDeploymentStatuses: {
  22384. method: "GET",
  22385. params: {
  22386. deployment_id: {
  22387. required: true,
  22388. type: "integer"
  22389. },
  22390. owner: {
  22391. required: true,
  22392. type: "string"
  22393. },
  22394. page: {
  22395. type: "integer"
  22396. },
  22397. per_page: {
  22398. type: "integer"
  22399. },
  22400. repo: {
  22401. required: true,
  22402. type: "string"
  22403. }
  22404. },
  22405. url: "/repos/:owner/:repo/deployments/:deployment_id/statuses"
  22406. },
  22407. listDeployments: {
  22408. method: "GET",
  22409. params: {
  22410. environment: {
  22411. type: "string"
  22412. },
  22413. owner: {
  22414. required: true,
  22415. type: "string"
  22416. },
  22417. page: {
  22418. type: "integer"
  22419. },
  22420. per_page: {
  22421. type: "integer"
  22422. },
  22423. ref: {
  22424. type: "string"
  22425. },
  22426. repo: {
  22427. required: true,
  22428. type: "string"
  22429. },
  22430. sha: {
  22431. type: "string"
  22432. },
  22433. task: {
  22434. type: "string"
  22435. }
  22436. },
  22437. url: "/repos/:owner/:repo/deployments"
  22438. },
  22439. listDownloads: {
  22440. method: "GET",
  22441. params: {
  22442. owner: {
  22443. required: true,
  22444. type: "string"
  22445. },
  22446. page: {
  22447. type: "integer"
  22448. },
  22449. per_page: {
  22450. type: "integer"
  22451. },
  22452. repo: {
  22453. required: true,
  22454. type: "string"
  22455. }
  22456. },
  22457. url: "/repos/:owner/:repo/downloads"
  22458. },
  22459. listForOrg: {
  22460. method: "GET",
  22461. params: {
  22462. direction: {
  22463. enum: ["asc", "desc"],
  22464. type: "string"
  22465. },
  22466. org: {
  22467. required: true,
  22468. type: "string"
  22469. },
  22470. page: {
  22471. type: "integer"
  22472. },
  22473. per_page: {
  22474. type: "integer"
  22475. },
  22476. sort: {
  22477. enum: ["created", "updated", "pushed", "full_name"],
  22478. type: "string"
  22479. },
  22480. type: {
  22481. enum: ["all", "public", "private", "forks", "sources", "member", "internal"],
  22482. type: "string"
  22483. }
  22484. },
  22485. url: "/orgs/:org/repos"
  22486. },
  22487. listForUser: {
  22488. method: "GET",
  22489. params: {
  22490. direction: {
  22491. enum: ["asc", "desc"],
  22492. type: "string"
  22493. },
  22494. page: {
  22495. type: "integer"
  22496. },
  22497. per_page: {
  22498. type: "integer"
  22499. },
  22500. sort: {
  22501. enum: ["created", "updated", "pushed", "full_name"],
  22502. type: "string"
  22503. },
  22504. type: {
  22505. enum: ["all", "owner", "member"],
  22506. type: "string"
  22507. },
  22508. username: {
  22509. required: true,
  22510. type: "string"
  22511. }
  22512. },
  22513. url: "/users/:username/repos"
  22514. },
  22515. listForks: {
  22516. method: "GET",
  22517. params: {
  22518. owner: {
  22519. required: true,
  22520. type: "string"
  22521. },
  22522. page: {
  22523. type: "integer"
  22524. },
  22525. per_page: {
  22526. type: "integer"
  22527. },
  22528. repo: {
  22529. required: true,
  22530. type: "string"
  22531. },
  22532. sort: {
  22533. enum: ["newest", "oldest", "stargazers"],
  22534. type: "string"
  22535. }
  22536. },
  22537. url: "/repos/:owner/:repo/forks"
  22538. },
  22539. listHooks: {
  22540. method: "GET",
  22541. params: {
  22542. owner: {
  22543. required: true,
  22544. type: "string"
  22545. },
  22546. page: {
  22547. type: "integer"
  22548. },
  22549. per_page: {
  22550. type: "integer"
  22551. },
  22552. repo: {
  22553. required: true,
  22554. type: "string"
  22555. }
  22556. },
  22557. url: "/repos/:owner/:repo/hooks"
  22558. },
  22559. listInvitations: {
  22560. method: "GET",
  22561. params: {
  22562. owner: {
  22563. required: true,
  22564. type: "string"
  22565. },
  22566. page: {
  22567. type: "integer"
  22568. },
  22569. per_page: {
  22570. type: "integer"
  22571. },
  22572. repo: {
  22573. required: true,
  22574. type: "string"
  22575. }
  22576. },
  22577. url: "/repos/:owner/:repo/invitations"
  22578. },
  22579. listInvitationsForAuthenticatedUser: {
  22580. method: "GET",
  22581. params: {
  22582. page: {
  22583. type: "integer"
  22584. },
  22585. per_page: {
  22586. type: "integer"
  22587. }
  22588. },
  22589. url: "/user/repository_invitations"
  22590. },
  22591. listLanguages: {
  22592. method: "GET",
  22593. params: {
  22594. owner: {
  22595. required: true,
  22596. type: "string"
  22597. },
  22598. repo: {
  22599. required: true,
  22600. type: "string"
  22601. }
  22602. },
  22603. url: "/repos/:owner/:repo/languages"
  22604. },
  22605. listPagesBuilds: {
  22606. method: "GET",
  22607. params: {
  22608. owner: {
  22609. required: true,
  22610. type: "string"
  22611. },
  22612. page: {
  22613. type: "integer"
  22614. },
  22615. per_page: {
  22616. type: "integer"
  22617. },
  22618. repo: {
  22619. required: true,
  22620. type: "string"
  22621. }
  22622. },
  22623. url: "/repos/:owner/:repo/pages/builds"
  22624. },
  22625. listProtectedBranchRequiredStatusChecksContexts: {
  22626. method: "GET",
  22627. params: {
  22628. branch: {
  22629. required: true,
  22630. type: "string"
  22631. },
  22632. owner: {
  22633. required: true,
  22634. type: "string"
  22635. },
  22636. repo: {
  22637. required: true,
  22638. type: "string"
  22639. }
  22640. },
  22641. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  22642. },
  22643. listProtectedBranchTeamRestrictions: {
  22644. deprecated: "octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)",
  22645. method: "GET",
  22646. params: {
  22647. branch: {
  22648. required: true,
  22649. type: "string"
  22650. },
  22651. owner: {
  22652. required: true,
  22653. type: "string"
  22654. },
  22655. repo: {
  22656. required: true,
  22657. type: "string"
  22658. }
  22659. },
  22660. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22661. },
  22662. listProtectedBranchUserRestrictions: {
  22663. deprecated: "octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)",
  22664. method: "GET",
  22665. params: {
  22666. branch: {
  22667. required: true,
  22668. type: "string"
  22669. },
  22670. owner: {
  22671. required: true,
  22672. type: "string"
  22673. },
  22674. repo: {
  22675. required: true,
  22676. type: "string"
  22677. }
  22678. },
  22679. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22680. },
  22681. listPublic: {
  22682. method: "GET",
  22683. params: {
  22684. page: {
  22685. type: "integer"
  22686. },
  22687. per_page: {
  22688. type: "integer"
  22689. },
  22690. since: {
  22691. type: "integer"
  22692. }
  22693. },
  22694. url: "/repositories"
  22695. },
  22696. listPullRequestsAssociatedWithCommit: {
  22697. headers: {
  22698. accept: "application/vnd.github.groot-preview+json"
  22699. },
  22700. method: "GET",
  22701. params: {
  22702. commit_sha: {
  22703. required: true,
  22704. type: "string"
  22705. },
  22706. owner: {
  22707. required: true,
  22708. type: "string"
  22709. },
  22710. page: {
  22711. type: "integer"
  22712. },
  22713. per_page: {
  22714. type: "integer"
  22715. },
  22716. repo: {
  22717. required: true,
  22718. type: "string"
  22719. }
  22720. },
  22721. url: "/repos/:owner/:repo/commits/:commit_sha/pulls"
  22722. },
  22723. listReleases: {
  22724. method: "GET",
  22725. params: {
  22726. owner: {
  22727. required: true,
  22728. type: "string"
  22729. },
  22730. page: {
  22731. type: "integer"
  22732. },
  22733. per_page: {
  22734. type: "integer"
  22735. },
  22736. repo: {
  22737. required: true,
  22738. type: "string"
  22739. }
  22740. },
  22741. url: "/repos/:owner/:repo/releases"
  22742. },
  22743. listStatusesForRef: {
  22744. method: "GET",
  22745. params: {
  22746. owner: {
  22747. required: true,
  22748. type: "string"
  22749. },
  22750. page: {
  22751. type: "integer"
  22752. },
  22753. per_page: {
  22754. type: "integer"
  22755. },
  22756. ref: {
  22757. required: true,
  22758. type: "string"
  22759. },
  22760. repo: {
  22761. required: true,
  22762. type: "string"
  22763. }
  22764. },
  22765. url: "/repos/:owner/:repo/commits/:ref/statuses"
  22766. },
  22767. listTags: {
  22768. method: "GET",
  22769. params: {
  22770. owner: {
  22771. required: true,
  22772. type: "string"
  22773. },
  22774. page: {
  22775. type: "integer"
  22776. },
  22777. per_page: {
  22778. type: "integer"
  22779. },
  22780. repo: {
  22781. required: true,
  22782. type: "string"
  22783. }
  22784. },
  22785. url: "/repos/:owner/:repo/tags"
  22786. },
  22787. listTeams: {
  22788. method: "GET",
  22789. params: {
  22790. owner: {
  22791. required: true,
  22792. type: "string"
  22793. },
  22794. page: {
  22795. type: "integer"
  22796. },
  22797. per_page: {
  22798. type: "integer"
  22799. },
  22800. repo: {
  22801. required: true,
  22802. type: "string"
  22803. }
  22804. },
  22805. url: "/repos/:owner/:repo/teams"
  22806. },
  22807. listTeamsWithAccessToProtectedBranch: {
  22808. deprecated: "octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)",
  22809. method: "GET",
  22810. params: {
  22811. branch: {
  22812. required: true,
  22813. type: "string"
  22814. },
  22815. owner: {
  22816. required: true,
  22817. type: "string"
  22818. },
  22819. repo: {
  22820. required: true,
  22821. type: "string"
  22822. }
  22823. },
  22824. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  22825. },
  22826. listTopics: {
  22827. headers: {
  22828. accept: "application/vnd.github.mercy-preview+json"
  22829. },
  22830. method: "GET",
  22831. params: {
  22832. owner: {
  22833. required: true,
  22834. type: "string"
  22835. },
  22836. repo: {
  22837. required: true,
  22838. type: "string"
  22839. }
  22840. },
  22841. url: "/repos/:owner/:repo/topics"
  22842. },
  22843. listUsersWithAccessToProtectedBranch: {
  22844. deprecated: "octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)",
  22845. method: "GET",
  22846. params: {
  22847. branch: {
  22848. required: true,
  22849. type: "string"
  22850. },
  22851. owner: {
  22852. required: true,
  22853. type: "string"
  22854. },
  22855. repo: {
  22856. required: true,
  22857. type: "string"
  22858. }
  22859. },
  22860. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  22861. },
  22862. merge: {
  22863. method: "POST",
  22864. params: {
  22865. base: {
  22866. required: true,
  22867. type: "string"
  22868. },
  22869. commit_message: {
  22870. type: "string"
  22871. },
  22872. head: {
  22873. required: true,
  22874. type: "string"
  22875. },
  22876. owner: {
  22877. required: true,
  22878. type: "string"
  22879. },
  22880. repo: {
  22881. required: true,
  22882. type: "string"
  22883. }
  22884. },
  22885. url: "/repos/:owner/:repo/merges"
  22886. },
  22887. pingHook: {
  22888. method: "POST",
  22889. params: {
  22890. hook_id: {
  22891. required: true,
  22892. type: "integer"
  22893. },
  22894. owner: {
  22895. required: true,
  22896. type: "string"
  22897. },
  22898. repo: {
  22899. required: true,
  22900. type: "string"
  22901. }
  22902. },
  22903. url: "/repos/:owner/:repo/hooks/:hook_id/pings"
  22904. },
  22905. removeBranchProtection: {
  22906. method: "DELETE",
  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. },
  22921. url: "/repos/:owner/:repo/branches/:branch/protection"
  22922. },
  22923. removeCollaborator: {
  22924. method: "DELETE",
  22925. params: {
  22926. owner: {
  22927. required: true,
  22928. type: "string"
  22929. },
  22930. repo: {
  22931. required: true,
  22932. type: "string"
  22933. },
  22934. username: {
  22935. required: true,
  22936. type: "string"
  22937. }
  22938. },
  22939. url: "/repos/:owner/:repo/collaborators/:username"
  22940. },
  22941. removeDeployKey: {
  22942. method: "DELETE",
  22943. params: {
  22944. key_id: {
  22945. required: true,
  22946. type: "integer"
  22947. },
  22948. owner: {
  22949. required: true,
  22950. type: "string"
  22951. },
  22952. repo: {
  22953. required: true,
  22954. type: "string"
  22955. }
  22956. },
  22957. url: "/repos/:owner/:repo/keys/:key_id"
  22958. },
  22959. removeProtectedBranchAdminEnforcement: {
  22960. method: "DELETE",
  22961. params: {
  22962. branch: {
  22963. required: true,
  22964. type: "string"
  22965. },
  22966. owner: {
  22967. required: true,
  22968. type: "string"
  22969. },
  22970. repo: {
  22971. required: true,
  22972. type: "string"
  22973. }
  22974. },
  22975. url: "/repos/:owner/:repo/branches/:branch/protection/enforce_admins"
  22976. },
  22977. removeProtectedBranchAppRestrictions: {
  22978. method: "DELETE",
  22979. params: {
  22980. apps: {
  22981. mapTo: "data",
  22982. required: true,
  22983. type: "string[]"
  22984. },
  22985. branch: {
  22986. required: true,
  22987. type: "string"
  22988. },
  22989. owner: {
  22990. required: true,
  22991. type: "string"
  22992. },
  22993. repo: {
  22994. required: true,
  22995. type: "string"
  22996. }
  22997. },
  22998. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  22999. },
  23000. removeProtectedBranchPullRequestReviewEnforcement: {
  23001. method: "DELETE",
  23002. params: {
  23003. branch: {
  23004. required: true,
  23005. type: "string"
  23006. },
  23007. owner: {
  23008. required: true,
  23009. type: "string"
  23010. },
  23011. repo: {
  23012. required: true,
  23013. type: "string"
  23014. }
  23015. },
  23016. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23017. },
  23018. removeProtectedBranchRequiredSignatures: {
  23019. headers: {
  23020. accept: "application/vnd.github.zzzax-preview+json"
  23021. },
  23022. method: "DELETE",
  23023. params: {
  23024. branch: {
  23025. required: true,
  23026. type: "string"
  23027. },
  23028. owner: {
  23029. required: true,
  23030. type: "string"
  23031. },
  23032. repo: {
  23033. required: true,
  23034. type: "string"
  23035. }
  23036. },
  23037. url: "/repos/:owner/:repo/branches/:branch/protection/required_signatures"
  23038. },
  23039. removeProtectedBranchRequiredStatusChecks: {
  23040. method: "DELETE",
  23041. params: {
  23042. branch: {
  23043. required: true,
  23044. type: "string"
  23045. },
  23046. owner: {
  23047. required: true,
  23048. type: "string"
  23049. },
  23050. repo: {
  23051. required: true,
  23052. type: "string"
  23053. }
  23054. },
  23055. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23056. },
  23057. removeProtectedBranchRequiredStatusChecksContexts: {
  23058. method: "DELETE",
  23059. params: {
  23060. branch: {
  23061. required: true,
  23062. type: "string"
  23063. },
  23064. contexts: {
  23065. mapTo: "data",
  23066. required: true,
  23067. type: "string[]"
  23068. },
  23069. owner: {
  23070. required: true,
  23071. type: "string"
  23072. },
  23073. repo: {
  23074. required: true,
  23075. type: "string"
  23076. }
  23077. },
  23078. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  23079. },
  23080. removeProtectedBranchRestrictions: {
  23081. method: "DELETE",
  23082. params: {
  23083. branch: {
  23084. required: true,
  23085. type: "string"
  23086. },
  23087. owner: {
  23088. required: true,
  23089. type: "string"
  23090. },
  23091. repo: {
  23092. required: true,
  23093. type: "string"
  23094. }
  23095. },
  23096. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions"
  23097. },
  23098. removeProtectedBranchTeamRestrictions: {
  23099. method: "DELETE",
  23100. params: {
  23101. branch: {
  23102. required: true,
  23103. type: "string"
  23104. },
  23105. owner: {
  23106. required: true,
  23107. type: "string"
  23108. },
  23109. repo: {
  23110. required: true,
  23111. type: "string"
  23112. },
  23113. teams: {
  23114. mapTo: "data",
  23115. required: true,
  23116. type: "string[]"
  23117. }
  23118. },
  23119. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  23120. },
  23121. removeProtectedBranchUserRestrictions: {
  23122. method: "DELETE",
  23123. params: {
  23124. branch: {
  23125. required: true,
  23126. type: "string"
  23127. },
  23128. owner: {
  23129. required: true,
  23130. type: "string"
  23131. },
  23132. repo: {
  23133. required: true,
  23134. type: "string"
  23135. },
  23136. users: {
  23137. mapTo: "data",
  23138. required: true,
  23139. type: "string[]"
  23140. }
  23141. },
  23142. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  23143. },
  23144. replaceProtectedBranchAppRestrictions: {
  23145. method: "PUT",
  23146. params: {
  23147. apps: {
  23148. mapTo: "data",
  23149. required: true,
  23150. type: "string[]"
  23151. },
  23152. branch: {
  23153. required: true,
  23154. type: "string"
  23155. },
  23156. owner: {
  23157. required: true,
  23158. type: "string"
  23159. },
  23160. repo: {
  23161. required: true,
  23162. type: "string"
  23163. }
  23164. },
  23165. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"
  23166. },
  23167. replaceProtectedBranchRequiredStatusChecksContexts: {
  23168. method: "PUT",
  23169. params: {
  23170. branch: {
  23171. required: true,
  23172. type: "string"
  23173. },
  23174. contexts: {
  23175. mapTo: "data",
  23176. required: true,
  23177. type: "string[]"
  23178. },
  23179. owner: {
  23180. required: true,
  23181. type: "string"
  23182. },
  23183. repo: {
  23184. required: true,
  23185. type: "string"
  23186. }
  23187. },
  23188. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"
  23189. },
  23190. replaceProtectedBranchTeamRestrictions: {
  23191. method: "PUT",
  23192. params: {
  23193. branch: {
  23194. required: true,
  23195. type: "string"
  23196. },
  23197. owner: {
  23198. required: true,
  23199. type: "string"
  23200. },
  23201. repo: {
  23202. required: true,
  23203. type: "string"
  23204. },
  23205. teams: {
  23206. mapTo: "data",
  23207. required: true,
  23208. type: "string[]"
  23209. }
  23210. },
  23211. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"
  23212. },
  23213. replaceProtectedBranchUserRestrictions: {
  23214. method: "PUT",
  23215. params: {
  23216. branch: {
  23217. required: true,
  23218. type: "string"
  23219. },
  23220. owner: {
  23221. required: true,
  23222. type: "string"
  23223. },
  23224. repo: {
  23225. required: true,
  23226. type: "string"
  23227. },
  23228. users: {
  23229. mapTo: "data",
  23230. required: true,
  23231. type: "string[]"
  23232. }
  23233. },
  23234. url: "/repos/:owner/:repo/branches/:branch/protection/restrictions/users"
  23235. },
  23236. replaceTopics: {
  23237. headers: {
  23238. accept: "application/vnd.github.mercy-preview+json"
  23239. },
  23240. method: "PUT",
  23241. params: {
  23242. names: {
  23243. required: true,
  23244. type: "string[]"
  23245. },
  23246. owner: {
  23247. required: true,
  23248. type: "string"
  23249. },
  23250. repo: {
  23251. required: true,
  23252. type: "string"
  23253. }
  23254. },
  23255. url: "/repos/:owner/:repo/topics"
  23256. },
  23257. requestPageBuild: {
  23258. method: "POST",
  23259. params: {
  23260. owner: {
  23261. required: true,
  23262. type: "string"
  23263. },
  23264. repo: {
  23265. required: true,
  23266. type: "string"
  23267. }
  23268. },
  23269. url: "/repos/:owner/:repo/pages/builds"
  23270. },
  23271. retrieveCommunityProfileMetrics: {
  23272. method: "GET",
  23273. params: {
  23274. owner: {
  23275. required: true,
  23276. type: "string"
  23277. },
  23278. repo: {
  23279. required: true,
  23280. type: "string"
  23281. }
  23282. },
  23283. url: "/repos/:owner/:repo/community/profile"
  23284. },
  23285. testPushHook: {
  23286. method: "POST",
  23287. params: {
  23288. hook_id: {
  23289. required: true,
  23290. type: "integer"
  23291. },
  23292. owner: {
  23293. required: true,
  23294. type: "string"
  23295. },
  23296. repo: {
  23297. required: true,
  23298. type: "string"
  23299. }
  23300. },
  23301. url: "/repos/:owner/:repo/hooks/:hook_id/tests"
  23302. },
  23303. transfer: {
  23304. method: "POST",
  23305. params: {
  23306. new_owner: {
  23307. type: "string"
  23308. },
  23309. owner: {
  23310. required: true,
  23311. type: "string"
  23312. },
  23313. repo: {
  23314. required: true,
  23315. type: "string"
  23316. },
  23317. team_ids: {
  23318. type: "integer[]"
  23319. }
  23320. },
  23321. url: "/repos/:owner/:repo/transfer"
  23322. },
  23323. update: {
  23324. method: "PATCH",
  23325. params: {
  23326. allow_merge_commit: {
  23327. type: "boolean"
  23328. },
  23329. allow_rebase_merge: {
  23330. type: "boolean"
  23331. },
  23332. allow_squash_merge: {
  23333. type: "boolean"
  23334. },
  23335. archived: {
  23336. type: "boolean"
  23337. },
  23338. default_branch: {
  23339. type: "string"
  23340. },
  23341. delete_branch_on_merge: {
  23342. type: "boolean"
  23343. },
  23344. description: {
  23345. type: "string"
  23346. },
  23347. has_issues: {
  23348. type: "boolean"
  23349. },
  23350. has_projects: {
  23351. type: "boolean"
  23352. },
  23353. has_wiki: {
  23354. type: "boolean"
  23355. },
  23356. homepage: {
  23357. type: "string"
  23358. },
  23359. is_template: {
  23360. type: "boolean"
  23361. },
  23362. name: {
  23363. type: "string"
  23364. },
  23365. owner: {
  23366. required: true,
  23367. type: "string"
  23368. },
  23369. private: {
  23370. type: "boolean"
  23371. },
  23372. repo: {
  23373. required: true,
  23374. type: "string"
  23375. },
  23376. visibility: {
  23377. enum: ["public", "private", "visibility", "internal"],
  23378. type: "string"
  23379. }
  23380. },
  23381. url: "/repos/:owner/:repo"
  23382. },
  23383. updateBranchProtection: {
  23384. method: "PUT",
  23385. params: {
  23386. allow_deletions: {
  23387. type: "boolean"
  23388. },
  23389. allow_force_pushes: {
  23390. allowNull: true,
  23391. type: "boolean"
  23392. },
  23393. branch: {
  23394. required: true,
  23395. type: "string"
  23396. },
  23397. enforce_admins: {
  23398. allowNull: true,
  23399. required: true,
  23400. type: "boolean"
  23401. },
  23402. owner: {
  23403. required: true,
  23404. type: "string"
  23405. },
  23406. repo: {
  23407. required: true,
  23408. type: "string"
  23409. },
  23410. required_linear_history: {
  23411. type: "boolean"
  23412. },
  23413. required_pull_request_reviews: {
  23414. allowNull: true,
  23415. required: true,
  23416. type: "object"
  23417. },
  23418. "required_pull_request_reviews.dismiss_stale_reviews": {
  23419. type: "boolean"
  23420. },
  23421. "required_pull_request_reviews.dismissal_restrictions": {
  23422. type: "object"
  23423. },
  23424. "required_pull_request_reviews.dismissal_restrictions.teams": {
  23425. type: "string[]"
  23426. },
  23427. "required_pull_request_reviews.dismissal_restrictions.users": {
  23428. type: "string[]"
  23429. },
  23430. "required_pull_request_reviews.require_code_owner_reviews": {
  23431. type: "boolean"
  23432. },
  23433. "required_pull_request_reviews.required_approving_review_count": {
  23434. type: "integer"
  23435. },
  23436. required_status_checks: {
  23437. allowNull: true,
  23438. required: true,
  23439. type: "object"
  23440. },
  23441. "required_status_checks.contexts": {
  23442. required: true,
  23443. type: "string[]"
  23444. },
  23445. "required_status_checks.strict": {
  23446. required: true,
  23447. type: "boolean"
  23448. },
  23449. restrictions: {
  23450. allowNull: true,
  23451. required: true,
  23452. type: "object"
  23453. },
  23454. "restrictions.apps": {
  23455. type: "string[]"
  23456. },
  23457. "restrictions.teams": {
  23458. required: true,
  23459. type: "string[]"
  23460. },
  23461. "restrictions.users": {
  23462. required: true,
  23463. type: "string[]"
  23464. }
  23465. },
  23466. url: "/repos/:owner/:repo/branches/:branch/protection"
  23467. },
  23468. updateCommitComment: {
  23469. method: "PATCH",
  23470. params: {
  23471. body: {
  23472. required: true,
  23473. type: "string"
  23474. },
  23475. comment_id: {
  23476. required: true,
  23477. type: "integer"
  23478. },
  23479. owner: {
  23480. required: true,
  23481. type: "string"
  23482. },
  23483. repo: {
  23484. required: true,
  23485. type: "string"
  23486. }
  23487. },
  23488. url: "/repos/:owner/:repo/comments/:comment_id"
  23489. },
  23490. updateFile: {
  23491. deprecated: "octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)",
  23492. method: "PUT",
  23493. params: {
  23494. author: {
  23495. type: "object"
  23496. },
  23497. "author.email": {
  23498. required: true,
  23499. type: "string"
  23500. },
  23501. "author.name": {
  23502. required: true,
  23503. type: "string"
  23504. },
  23505. branch: {
  23506. type: "string"
  23507. },
  23508. committer: {
  23509. type: "object"
  23510. },
  23511. "committer.email": {
  23512. required: true,
  23513. type: "string"
  23514. },
  23515. "committer.name": {
  23516. required: true,
  23517. type: "string"
  23518. },
  23519. content: {
  23520. required: true,
  23521. type: "string"
  23522. },
  23523. message: {
  23524. required: true,
  23525. type: "string"
  23526. },
  23527. owner: {
  23528. required: true,
  23529. type: "string"
  23530. },
  23531. path: {
  23532. required: true,
  23533. type: "string"
  23534. },
  23535. repo: {
  23536. required: true,
  23537. type: "string"
  23538. },
  23539. sha: {
  23540. type: "string"
  23541. }
  23542. },
  23543. url: "/repos/:owner/:repo/contents/:path"
  23544. },
  23545. updateHook: {
  23546. method: "PATCH",
  23547. params: {
  23548. active: {
  23549. type: "boolean"
  23550. },
  23551. add_events: {
  23552. type: "string[]"
  23553. },
  23554. config: {
  23555. type: "object"
  23556. },
  23557. "config.content_type": {
  23558. type: "string"
  23559. },
  23560. "config.insecure_ssl": {
  23561. type: "string"
  23562. },
  23563. "config.secret": {
  23564. type: "string"
  23565. },
  23566. "config.url": {
  23567. required: true,
  23568. type: "string"
  23569. },
  23570. events: {
  23571. type: "string[]"
  23572. },
  23573. hook_id: {
  23574. required: true,
  23575. type: "integer"
  23576. },
  23577. owner: {
  23578. required: true,
  23579. type: "string"
  23580. },
  23581. remove_events: {
  23582. type: "string[]"
  23583. },
  23584. repo: {
  23585. required: true,
  23586. type: "string"
  23587. }
  23588. },
  23589. url: "/repos/:owner/:repo/hooks/:hook_id"
  23590. },
  23591. updateInformationAboutPagesSite: {
  23592. method: "PUT",
  23593. params: {
  23594. cname: {
  23595. type: "string"
  23596. },
  23597. owner: {
  23598. required: true,
  23599. type: "string"
  23600. },
  23601. repo: {
  23602. required: true,
  23603. type: "string"
  23604. },
  23605. source: {
  23606. enum: ['"gh-pages"', '"master"', '"master /docs"'],
  23607. type: "string"
  23608. }
  23609. },
  23610. url: "/repos/:owner/:repo/pages"
  23611. },
  23612. updateInvitation: {
  23613. method: "PATCH",
  23614. params: {
  23615. invitation_id: {
  23616. required: true,
  23617. type: "integer"
  23618. },
  23619. owner: {
  23620. required: true,
  23621. type: "string"
  23622. },
  23623. permissions: {
  23624. enum: ["read", "write", "admin"],
  23625. type: "string"
  23626. },
  23627. repo: {
  23628. required: true,
  23629. type: "string"
  23630. }
  23631. },
  23632. url: "/repos/:owner/:repo/invitations/:invitation_id"
  23633. },
  23634. updateProtectedBranchPullRequestReviewEnforcement: {
  23635. method: "PATCH",
  23636. params: {
  23637. branch: {
  23638. required: true,
  23639. type: "string"
  23640. },
  23641. dismiss_stale_reviews: {
  23642. type: "boolean"
  23643. },
  23644. dismissal_restrictions: {
  23645. type: "object"
  23646. },
  23647. "dismissal_restrictions.teams": {
  23648. type: "string[]"
  23649. },
  23650. "dismissal_restrictions.users": {
  23651. type: "string[]"
  23652. },
  23653. owner: {
  23654. required: true,
  23655. type: "string"
  23656. },
  23657. repo: {
  23658. required: true,
  23659. type: "string"
  23660. },
  23661. require_code_owner_reviews: {
  23662. type: "boolean"
  23663. },
  23664. required_approving_review_count: {
  23665. type: "integer"
  23666. }
  23667. },
  23668. url: "/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"
  23669. },
  23670. updateProtectedBranchRequiredStatusChecks: {
  23671. method: "PATCH",
  23672. params: {
  23673. branch: {
  23674. required: true,
  23675. type: "string"
  23676. },
  23677. contexts: {
  23678. type: "string[]"
  23679. },
  23680. owner: {
  23681. required: true,
  23682. type: "string"
  23683. },
  23684. repo: {
  23685. required: true,
  23686. type: "string"
  23687. },
  23688. strict: {
  23689. type: "boolean"
  23690. }
  23691. },
  23692. url: "/repos/:owner/:repo/branches/:branch/protection/required_status_checks"
  23693. },
  23694. updateRelease: {
  23695. method: "PATCH",
  23696. params: {
  23697. body: {
  23698. type: "string"
  23699. },
  23700. draft: {
  23701. type: "boolean"
  23702. },
  23703. name: {
  23704. type: "string"
  23705. },
  23706. owner: {
  23707. required: true,
  23708. type: "string"
  23709. },
  23710. prerelease: {
  23711. type: "boolean"
  23712. },
  23713. release_id: {
  23714. required: true,
  23715. type: "integer"
  23716. },
  23717. repo: {
  23718. required: true,
  23719. type: "string"
  23720. },
  23721. tag_name: {
  23722. type: "string"
  23723. },
  23724. target_commitish: {
  23725. type: "string"
  23726. }
  23727. },
  23728. url: "/repos/:owner/:repo/releases/:release_id"
  23729. },
  23730. updateReleaseAsset: {
  23731. method: "PATCH",
  23732. params: {
  23733. asset_id: {
  23734. required: true,
  23735. type: "integer"
  23736. },
  23737. label: {
  23738. type: "string"
  23739. },
  23740. name: {
  23741. type: "string"
  23742. },
  23743. owner: {
  23744. required: true,
  23745. type: "string"
  23746. },
  23747. repo: {
  23748. required: true,
  23749. type: "string"
  23750. }
  23751. },
  23752. url: "/repos/:owner/:repo/releases/assets/:asset_id"
  23753. },
  23754. uploadReleaseAsset: {
  23755. method: "POST",
  23756. params: {
  23757. data: {
  23758. mapTo: "data",
  23759. required: true,
  23760. type: "string | object"
  23761. },
  23762. file: {
  23763. alias: "data",
  23764. deprecated: true,
  23765. type: "string | object"
  23766. },
  23767. headers: {
  23768. required: true,
  23769. type: "object"
  23770. },
  23771. "headers.content-length": {
  23772. required: true,
  23773. type: "integer"
  23774. },
  23775. "headers.content-type": {
  23776. required: true,
  23777. type: "string"
  23778. },
  23779. label: {
  23780. type: "string"
  23781. },
  23782. name: {
  23783. required: true,
  23784. type: "string"
  23785. },
  23786. url: {
  23787. required: true,
  23788. type: "string"
  23789. }
  23790. },
  23791. url: ":url"
  23792. }
  23793. },
  23794. search: {
  23795. code: {
  23796. method: "GET",
  23797. params: {
  23798. order: {
  23799. enum: ["desc", "asc"],
  23800. type: "string"
  23801. },
  23802. page: {
  23803. type: "integer"
  23804. },
  23805. per_page: {
  23806. type: "integer"
  23807. },
  23808. q: {
  23809. required: true,
  23810. type: "string"
  23811. },
  23812. sort: {
  23813. enum: ["indexed"],
  23814. type: "string"
  23815. }
  23816. },
  23817. url: "/search/code"
  23818. },
  23819. commits: {
  23820. headers: {
  23821. accept: "application/vnd.github.cloak-preview+json"
  23822. },
  23823. method: "GET",
  23824. params: {
  23825. order: {
  23826. enum: ["desc", "asc"],
  23827. type: "string"
  23828. },
  23829. page: {
  23830. type: "integer"
  23831. },
  23832. per_page: {
  23833. type: "integer"
  23834. },
  23835. q: {
  23836. required: true,
  23837. type: "string"
  23838. },
  23839. sort: {
  23840. enum: ["author-date", "committer-date"],
  23841. type: "string"
  23842. }
  23843. },
  23844. url: "/search/commits"
  23845. },
  23846. issues: {
  23847. deprecated: "octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)",
  23848. method: "GET",
  23849. params: {
  23850. order: {
  23851. enum: ["desc", "asc"],
  23852. type: "string"
  23853. },
  23854. page: {
  23855. type: "integer"
  23856. },
  23857. per_page: {
  23858. type: "integer"
  23859. },
  23860. q: {
  23861. required: true,
  23862. type: "string"
  23863. },
  23864. sort: {
  23865. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23866. type: "string"
  23867. }
  23868. },
  23869. url: "/search/issues"
  23870. },
  23871. issuesAndPullRequests: {
  23872. method: "GET",
  23873. params: {
  23874. order: {
  23875. enum: ["desc", "asc"],
  23876. type: "string"
  23877. },
  23878. page: {
  23879. type: "integer"
  23880. },
  23881. per_page: {
  23882. type: "integer"
  23883. },
  23884. q: {
  23885. required: true,
  23886. type: "string"
  23887. },
  23888. sort: {
  23889. enum: ["comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"],
  23890. type: "string"
  23891. }
  23892. },
  23893. url: "/search/issues"
  23894. },
  23895. labels: {
  23896. method: "GET",
  23897. params: {
  23898. order: {
  23899. enum: ["desc", "asc"],
  23900. type: "string"
  23901. },
  23902. q: {
  23903. required: true,
  23904. type: "string"
  23905. },
  23906. repository_id: {
  23907. required: true,
  23908. type: "integer"
  23909. },
  23910. sort: {
  23911. enum: ["created", "updated"],
  23912. type: "string"
  23913. }
  23914. },
  23915. url: "/search/labels"
  23916. },
  23917. repos: {
  23918. method: "GET",
  23919. params: {
  23920. order: {
  23921. enum: ["desc", "asc"],
  23922. type: "string"
  23923. },
  23924. page: {
  23925. type: "integer"
  23926. },
  23927. per_page: {
  23928. type: "integer"
  23929. },
  23930. q: {
  23931. required: true,
  23932. type: "string"
  23933. },
  23934. sort: {
  23935. enum: ["stars", "forks", "help-wanted-issues", "updated"],
  23936. type: "string"
  23937. }
  23938. },
  23939. url: "/search/repositories"
  23940. },
  23941. topics: {
  23942. method: "GET",
  23943. params: {
  23944. q: {
  23945. required: true,
  23946. type: "string"
  23947. }
  23948. },
  23949. url: "/search/topics"
  23950. },
  23951. users: {
  23952. method: "GET",
  23953. params: {
  23954. order: {
  23955. enum: ["desc", "asc"],
  23956. type: "string"
  23957. },
  23958. page: {
  23959. type: "integer"
  23960. },
  23961. per_page: {
  23962. type: "integer"
  23963. },
  23964. q: {
  23965. required: true,
  23966. type: "string"
  23967. },
  23968. sort: {
  23969. enum: ["followers", "repositories", "joined"],
  23970. type: "string"
  23971. }
  23972. },
  23973. url: "/search/users"
  23974. }
  23975. },
  23976. teams: {
  23977. addMember: {
  23978. deprecated: "octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)",
  23979. method: "PUT",
  23980. params: {
  23981. team_id: {
  23982. required: true,
  23983. type: "integer"
  23984. },
  23985. username: {
  23986. required: true,
  23987. type: "string"
  23988. }
  23989. },
  23990. url: "/teams/:team_id/members/:username"
  23991. },
  23992. addMemberLegacy: {
  23993. deprecated: "octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy",
  23994. method: "PUT",
  23995. params: {
  23996. team_id: {
  23997. required: true,
  23998. type: "integer"
  23999. },
  24000. username: {
  24001. required: true,
  24002. type: "string"
  24003. }
  24004. },
  24005. url: "/teams/:team_id/members/:username"
  24006. },
  24007. addOrUpdateMembership: {
  24008. deprecated: "octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)",
  24009. method: "PUT",
  24010. params: {
  24011. role: {
  24012. enum: ["member", "maintainer"],
  24013. type: "string"
  24014. },
  24015. team_id: {
  24016. required: true,
  24017. type: "integer"
  24018. },
  24019. username: {
  24020. required: true,
  24021. type: "string"
  24022. }
  24023. },
  24024. url: "/teams/:team_id/memberships/:username"
  24025. },
  24026. addOrUpdateMembershipInOrg: {
  24027. method: "PUT",
  24028. params: {
  24029. org: {
  24030. required: true,
  24031. type: "string"
  24032. },
  24033. role: {
  24034. enum: ["member", "maintainer"],
  24035. type: "string"
  24036. },
  24037. team_slug: {
  24038. required: true,
  24039. type: "string"
  24040. },
  24041. username: {
  24042. required: true,
  24043. type: "string"
  24044. }
  24045. },
  24046. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24047. },
  24048. addOrUpdateMembershipLegacy: {
  24049. deprecated: "octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy",
  24050. method: "PUT",
  24051. params: {
  24052. role: {
  24053. enum: ["member", "maintainer"],
  24054. type: "string"
  24055. },
  24056. team_id: {
  24057. required: true,
  24058. type: "integer"
  24059. },
  24060. username: {
  24061. required: true,
  24062. type: "string"
  24063. }
  24064. },
  24065. url: "/teams/:team_id/memberships/:username"
  24066. },
  24067. addOrUpdateProject: {
  24068. deprecated: "octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)",
  24069. headers: {
  24070. accept: "application/vnd.github.inertia-preview+json"
  24071. },
  24072. method: "PUT",
  24073. params: {
  24074. permission: {
  24075. enum: ["read", "write", "admin"],
  24076. type: "string"
  24077. },
  24078. project_id: {
  24079. required: true,
  24080. type: "integer"
  24081. },
  24082. team_id: {
  24083. required: true,
  24084. type: "integer"
  24085. }
  24086. },
  24087. url: "/teams/:team_id/projects/:project_id"
  24088. },
  24089. addOrUpdateProjectInOrg: {
  24090. headers: {
  24091. accept: "application/vnd.github.inertia-preview+json"
  24092. },
  24093. method: "PUT",
  24094. params: {
  24095. org: {
  24096. required: true,
  24097. type: "string"
  24098. },
  24099. permission: {
  24100. enum: ["read", "write", "admin"],
  24101. type: "string"
  24102. },
  24103. project_id: {
  24104. required: true,
  24105. type: "integer"
  24106. },
  24107. team_slug: {
  24108. required: true,
  24109. type: "string"
  24110. }
  24111. },
  24112. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  24113. },
  24114. addOrUpdateProjectLegacy: {
  24115. deprecated: "octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy",
  24116. headers: {
  24117. accept: "application/vnd.github.inertia-preview+json"
  24118. },
  24119. method: "PUT",
  24120. params: {
  24121. permission: {
  24122. enum: ["read", "write", "admin"],
  24123. type: "string"
  24124. },
  24125. project_id: {
  24126. required: true,
  24127. type: "integer"
  24128. },
  24129. team_id: {
  24130. required: true,
  24131. type: "integer"
  24132. }
  24133. },
  24134. url: "/teams/:team_id/projects/:project_id"
  24135. },
  24136. addOrUpdateRepo: {
  24137. deprecated: "octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)",
  24138. method: "PUT",
  24139. params: {
  24140. owner: {
  24141. required: true,
  24142. type: "string"
  24143. },
  24144. permission: {
  24145. enum: ["pull", "push", "admin"],
  24146. type: "string"
  24147. },
  24148. repo: {
  24149. required: true,
  24150. type: "string"
  24151. },
  24152. team_id: {
  24153. required: true,
  24154. type: "integer"
  24155. }
  24156. },
  24157. url: "/teams/:team_id/repos/:owner/:repo"
  24158. },
  24159. addOrUpdateRepoInOrg: {
  24160. method: "PUT",
  24161. params: {
  24162. org: {
  24163. required: true,
  24164. type: "string"
  24165. },
  24166. owner: {
  24167. required: true,
  24168. type: "string"
  24169. },
  24170. permission: {
  24171. enum: ["pull", "push", "admin"],
  24172. type: "string"
  24173. },
  24174. repo: {
  24175. required: true,
  24176. type: "string"
  24177. },
  24178. team_slug: {
  24179. required: true,
  24180. type: "string"
  24181. }
  24182. },
  24183. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24184. },
  24185. addOrUpdateRepoLegacy: {
  24186. deprecated: "octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy",
  24187. method: "PUT",
  24188. params: {
  24189. owner: {
  24190. required: true,
  24191. type: "string"
  24192. },
  24193. permission: {
  24194. enum: ["pull", "push", "admin"],
  24195. type: "string"
  24196. },
  24197. repo: {
  24198. required: true,
  24199. type: "string"
  24200. },
  24201. team_id: {
  24202. required: true,
  24203. type: "integer"
  24204. }
  24205. },
  24206. url: "/teams/:team_id/repos/:owner/:repo"
  24207. },
  24208. checkManagesRepo: {
  24209. deprecated: "octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)",
  24210. method: "GET",
  24211. params: {
  24212. owner: {
  24213. required: true,
  24214. type: "string"
  24215. },
  24216. repo: {
  24217. required: true,
  24218. type: "string"
  24219. },
  24220. team_id: {
  24221. required: true,
  24222. type: "integer"
  24223. }
  24224. },
  24225. url: "/teams/:team_id/repos/:owner/:repo"
  24226. },
  24227. checkManagesRepoInOrg: {
  24228. method: "GET",
  24229. params: {
  24230. org: {
  24231. required: true,
  24232. type: "string"
  24233. },
  24234. owner: {
  24235. required: true,
  24236. type: "string"
  24237. },
  24238. repo: {
  24239. required: true,
  24240. type: "string"
  24241. },
  24242. team_slug: {
  24243. required: true,
  24244. type: "string"
  24245. }
  24246. },
  24247. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  24248. },
  24249. checkManagesRepoLegacy: {
  24250. deprecated: "octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy",
  24251. method: "GET",
  24252. params: {
  24253. owner: {
  24254. required: true,
  24255. type: "string"
  24256. },
  24257. repo: {
  24258. required: true,
  24259. type: "string"
  24260. },
  24261. team_id: {
  24262. required: true,
  24263. type: "integer"
  24264. }
  24265. },
  24266. url: "/teams/:team_id/repos/:owner/:repo"
  24267. },
  24268. create: {
  24269. method: "POST",
  24270. params: {
  24271. description: {
  24272. type: "string"
  24273. },
  24274. maintainers: {
  24275. type: "string[]"
  24276. },
  24277. name: {
  24278. required: true,
  24279. type: "string"
  24280. },
  24281. org: {
  24282. required: true,
  24283. type: "string"
  24284. },
  24285. parent_team_id: {
  24286. type: "integer"
  24287. },
  24288. permission: {
  24289. enum: ["pull", "push", "admin"],
  24290. type: "string"
  24291. },
  24292. privacy: {
  24293. enum: ["secret", "closed"],
  24294. type: "string"
  24295. },
  24296. repo_names: {
  24297. type: "string[]"
  24298. }
  24299. },
  24300. url: "/orgs/:org/teams"
  24301. },
  24302. createDiscussion: {
  24303. deprecated: "octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)",
  24304. method: "POST",
  24305. params: {
  24306. body: {
  24307. required: true,
  24308. type: "string"
  24309. },
  24310. private: {
  24311. type: "boolean"
  24312. },
  24313. team_id: {
  24314. required: true,
  24315. type: "integer"
  24316. },
  24317. title: {
  24318. required: true,
  24319. type: "string"
  24320. }
  24321. },
  24322. url: "/teams/:team_id/discussions"
  24323. },
  24324. createDiscussionComment: {
  24325. deprecated: "octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)",
  24326. method: "POST",
  24327. params: {
  24328. body: {
  24329. required: true,
  24330. type: "string"
  24331. },
  24332. discussion_number: {
  24333. required: true,
  24334. type: "integer"
  24335. },
  24336. team_id: {
  24337. required: true,
  24338. type: "integer"
  24339. }
  24340. },
  24341. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24342. },
  24343. createDiscussionCommentInOrg: {
  24344. method: "POST",
  24345. params: {
  24346. body: {
  24347. required: true,
  24348. type: "string"
  24349. },
  24350. discussion_number: {
  24351. required: true,
  24352. type: "integer"
  24353. },
  24354. org: {
  24355. required: true,
  24356. type: "string"
  24357. },
  24358. team_slug: {
  24359. required: true,
  24360. type: "string"
  24361. }
  24362. },
  24363. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24364. },
  24365. createDiscussionCommentLegacy: {
  24366. deprecated: "octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy",
  24367. method: "POST",
  24368. params: {
  24369. body: {
  24370. required: true,
  24371. type: "string"
  24372. },
  24373. discussion_number: {
  24374. required: true,
  24375. type: "integer"
  24376. },
  24377. team_id: {
  24378. required: true,
  24379. type: "integer"
  24380. }
  24381. },
  24382. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24383. },
  24384. createDiscussionInOrg: {
  24385. method: "POST",
  24386. params: {
  24387. body: {
  24388. required: true,
  24389. type: "string"
  24390. },
  24391. org: {
  24392. required: true,
  24393. type: "string"
  24394. },
  24395. private: {
  24396. type: "boolean"
  24397. },
  24398. team_slug: {
  24399. required: true,
  24400. type: "string"
  24401. },
  24402. title: {
  24403. required: true,
  24404. type: "string"
  24405. }
  24406. },
  24407. url: "/orgs/:org/teams/:team_slug/discussions"
  24408. },
  24409. createDiscussionLegacy: {
  24410. deprecated: "octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy",
  24411. method: "POST",
  24412. params: {
  24413. body: {
  24414. required: true,
  24415. type: "string"
  24416. },
  24417. private: {
  24418. type: "boolean"
  24419. },
  24420. team_id: {
  24421. required: true,
  24422. type: "integer"
  24423. },
  24424. title: {
  24425. required: true,
  24426. type: "string"
  24427. }
  24428. },
  24429. url: "/teams/:team_id/discussions"
  24430. },
  24431. delete: {
  24432. deprecated: "octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)",
  24433. method: "DELETE",
  24434. params: {
  24435. team_id: {
  24436. required: true,
  24437. type: "integer"
  24438. }
  24439. },
  24440. url: "/teams/:team_id"
  24441. },
  24442. deleteDiscussion: {
  24443. deprecated: "octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)",
  24444. method: "DELETE",
  24445. params: {
  24446. discussion_number: {
  24447. required: true,
  24448. type: "integer"
  24449. },
  24450. team_id: {
  24451. required: true,
  24452. type: "integer"
  24453. }
  24454. },
  24455. url: "/teams/:team_id/discussions/:discussion_number"
  24456. },
  24457. deleteDiscussionComment: {
  24458. deprecated: "octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)",
  24459. method: "DELETE",
  24460. params: {
  24461. comment_number: {
  24462. required: true,
  24463. type: "integer"
  24464. },
  24465. discussion_number: {
  24466. required: true,
  24467. type: "integer"
  24468. },
  24469. team_id: {
  24470. required: true,
  24471. type: "integer"
  24472. }
  24473. },
  24474. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24475. },
  24476. deleteDiscussionCommentInOrg: {
  24477. method: "DELETE",
  24478. params: {
  24479. comment_number: {
  24480. required: true,
  24481. type: "integer"
  24482. },
  24483. discussion_number: {
  24484. required: true,
  24485. type: "integer"
  24486. },
  24487. org: {
  24488. required: true,
  24489. type: "string"
  24490. },
  24491. team_slug: {
  24492. required: true,
  24493. type: "string"
  24494. }
  24495. },
  24496. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24497. },
  24498. deleteDiscussionCommentLegacy: {
  24499. deprecated: "octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy",
  24500. method: "DELETE",
  24501. params: {
  24502. comment_number: {
  24503. required: true,
  24504. type: "integer"
  24505. },
  24506. discussion_number: {
  24507. required: true,
  24508. type: "integer"
  24509. },
  24510. team_id: {
  24511. required: true,
  24512. type: "integer"
  24513. }
  24514. },
  24515. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24516. },
  24517. deleteDiscussionInOrg: {
  24518. method: "DELETE",
  24519. params: {
  24520. discussion_number: {
  24521. required: true,
  24522. type: "integer"
  24523. },
  24524. org: {
  24525. required: true,
  24526. type: "string"
  24527. },
  24528. team_slug: {
  24529. required: true,
  24530. type: "string"
  24531. }
  24532. },
  24533. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24534. },
  24535. deleteDiscussionLegacy: {
  24536. deprecated: "octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy",
  24537. method: "DELETE",
  24538. params: {
  24539. discussion_number: {
  24540. required: true,
  24541. type: "integer"
  24542. },
  24543. team_id: {
  24544. required: true,
  24545. type: "integer"
  24546. }
  24547. },
  24548. url: "/teams/:team_id/discussions/:discussion_number"
  24549. },
  24550. deleteInOrg: {
  24551. method: "DELETE",
  24552. params: {
  24553. org: {
  24554. required: true,
  24555. type: "string"
  24556. },
  24557. team_slug: {
  24558. required: true,
  24559. type: "string"
  24560. }
  24561. },
  24562. url: "/orgs/:org/teams/:team_slug"
  24563. },
  24564. deleteLegacy: {
  24565. deprecated: "octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy",
  24566. method: "DELETE",
  24567. params: {
  24568. team_id: {
  24569. required: true,
  24570. type: "integer"
  24571. }
  24572. },
  24573. url: "/teams/:team_id"
  24574. },
  24575. get: {
  24576. deprecated: "octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)",
  24577. method: "GET",
  24578. params: {
  24579. team_id: {
  24580. required: true,
  24581. type: "integer"
  24582. }
  24583. },
  24584. url: "/teams/:team_id"
  24585. },
  24586. getByName: {
  24587. method: "GET",
  24588. params: {
  24589. org: {
  24590. required: true,
  24591. type: "string"
  24592. },
  24593. team_slug: {
  24594. required: true,
  24595. type: "string"
  24596. }
  24597. },
  24598. url: "/orgs/:org/teams/:team_slug"
  24599. },
  24600. getDiscussion: {
  24601. deprecated: "octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)",
  24602. method: "GET",
  24603. params: {
  24604. discussion_number: {
  24605. required: true,
  24606. type: "integer"
  24607. },
  24608. team_id: {
  24609. required: true,
  24610. type: "integer"
  24611. }
  24612. },
  24613. url: "/teams/:team_id/discussions/:discussion_number"
  24614. },
  24615. getDiscussionComment: {
  24616. deprecated: "octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)",
  24617. method: "GET",
  24618. params: {
  24619. comment_number: {
  24620. required: true,
  24621. type: "integer"
  24622. },
  24623. discussion_number: {
  24624. required: true,
  24625. type: "integer"
  24626. },
  24627. team_id: {
  24628. required: true,
  24629. type: "integer"
  24630. }
  24631. },
  24632. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24633. },
  24634. getDiscussionCommentInOrg: {
  24635. method: "GET",
  24636. params: {
  24637. comment_number: {
  24638. required: true,
  24639. type: "integer"
  24640. },
  24641. discussion_number: {
  24642. required: true,
  24643. type: "integer"
  24644. },
  24645. org: {
  24646. required: true,
  24647. type: "string"
  24648. },
  24649. team_slug: {
  24650. required: true,
  24651. type: "string"
  24652. }
  24653. },
  24654. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  24655. },
  24656. getDiscussionCommentLegacy: {
  24657. deprecated: "octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy",
  24658. method: "GET",
  24659. params: {
  24660. comment_number: {
  24661. required: true,
  24662. type: "integer"
  24663. },
  24664. discussion_number: {
  24665. required: true,
  24666. type: "integer"
  24667. },
  24668. team_id: {
  24669. required: true,
  24670. type: "integer"
  24671. }
  24672. },
  24673. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  24674. },
  24675. getDiscussionInOrg: {
  24676. method: "GET",
  24677. params: {
  24678. discussion_number: {
  24679. required: true,
  24680. type: "integer"
  24681. },
  24682. org: {
  24683. required: true,
  24684. type: "string"
  24685. },
  24686. team_slug: {
  24687. required: true,
  24688. type: "string"
  24689. }
  24690. },
  24691. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  24692. },
  24693. getDiscussionLegacy: {
  24694. deprecated: "octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy",
  24695. method: "GET",
  24696. params: {
  24697. discussion_number: {
  24698. required: true,
  24699. type: "integer"
  24700. },
  24701. team_id: {
  24702. required: true,
  24703. type: "integer"
  24704. }
  24705. },
  24706. url: "/teams/:team_id/discussions/:discussion_number"
  24707. },
  24708. getLegacy: {
  24709. deprecated: "octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy",
  24710. method: "GET",
  24711. params: {
  24712. team_id: {
  24713. required: true,
  24714. type: "integer"
  24715. }
  24716. },
  24717. url: "/teams/:team_id"
  24718. },
  24719. getMember: {
  24720. deprecated: "octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)",
  24721. method: "GET",
  24722. params: {
  24723. team_id: {
  24724. required: true,
  24725. type: "integer"
  24726. },
  24727. username: {
  24728. required: true,
  24729. type: "string"
  24730. }
  24731. },
  24732. url: "/teams/:team_id/members/:username"
  24733. },
  24734. getMemberLegacy: {
  24735. deprecated: "octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy",
  24736. method: "GET",
  24737. params: {
  24738. team_id: {
  24739. required: true,
  24740. type: "integer"
  24741. },
  24742. username: {
  24743. required: true,
  24744. type: "string"
  24745. }
  24746. },
  24747. url: "/teams/:team_id/members/:username"
  24748. },
  24749. getMembership: {
  24750. deprecated: "octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)",
  24751. method: "GET",
  24752. params: {
  24753. team_id: {
  24754. required: true,
  24755. type: "integer"
  24756. },
  24757. username: {
  24758. required: true,
  24759. type: "string"
  24760. }
  24761. },
  24762. url: "/teams/:team_id/memberships/:username"
  24763. },
  24764. getMembershipInOrg: {
  24765. method: "GET",
  24766. params: {
  24767. org: {
  24768. required: true,
  24769. type: "string"
  24770. },
  24771. team_slug: {
  24772. required: true,
  24773. type: "string"
  24774. },
  24775. username: {
  24776. required: true,
  24777. type: "string"
  24778. }
  24779. },
  24780. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  24781. },
  24782. getMembershipLegacy: {
  24783. deprecated: "octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy",
  24784. method: "GET",
  24785. params: {
  24786. team_id: {
  24787. required: true,
  24788. type: "integer"
  24789. },
  24790. username: {
  24791. required: true,
  24792. type: "string"
  24793. }
  24794. },
  24795. url: "/teams/:team_id/memberships/:username"
  24796. },
  24797. list: {
  24798. method: "GET",
  24799. params: {
  24800. org: {
  24801. required: true,
  24802. type: "string"
  24803. },
  24804. page: {
  24805. type: "integer"
  24806. },
  24807. per_page: {
  24808. type: "integer"
  24809. }
  24810. },
  24811. url: "/orgs/:org/teams"
  24812. },
  24813. listChild: {
  24814. deprecated: "octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)",
  24815. method: "GET",
  24816. params: {
  24817. page: {
  24818. type: "integer"
  24819. },
  24820. per_page: {
  24821. type: "integer"
  24822. },
  24823. team_id: {
  24824. required: true,
  24825. type: "integer"
  24826. }
  24827. },
  24828. url: "/teams/:team_id/teams"
  24829. },
  24830. listChildInOrg: {
  24831. method: "GET",
  24832. params: {
  24833. org: {
  24834. required: true,
  24835. type: "string"
  24836. },
  24837. page: {
  24838. type: "integer"
  24839. },
  24840. per_page: {
  24841. type: "integer"
  24842. },
  24843. team_slug: {
  24844. required: true,
  24845. type: "string"
  24846. }
  24847. },
  24848. url: "/orgs/:org/teams/:team_slug/teams"
  24849. },
  24850. listChildLegacy: {
  24851. deprecated: "octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy",
  24852. method: "GET",
  24853. params: {
  24854. page: {
  24855. type: "integer"
  24856. },
  24857. per_page: {
  24858. type: "integer"
  24859. },
  24860. team_id: {
  24861. required: true,
  24862. type: "integer"
  24863. }
  24864. },
  24865. url: "/teams/:team_id/teams"
  24866. },
  24867. listDiscussionComments: {
  24868. deprecated: "octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)",
  24869. method: "GET",
  24870. params: {
  24871. direction: {
  24872. enum: ["asc", "desc"],
  24873. type: "string"
  24874. },
  24875. discussion_number: {
  24876. required: true,
  24877. type: "integer"
  24878. },
  24879. page: {
  24880. type: "integer"
  24881. },
  24882. per_page: {
  24883. type: "integer"
  24884. },
  24885. team_id: {
  24886. required: true,
  24887. type: "integer"
  24888. }
  24889. },
  24890. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24891. },
  24892. listDiscussionCommentsInOrg: {
  24893. method: "GET",
  24894. params: {
  24895. direction: {
  24896. enum: ["asc", "desc"],
  24897. type: "string"
  24898. },
  24899. discussion_number: {
  24900. required: true,
  24901. type: "integer"
  24902. },
  24903. org: {
  24904. required: true,
  24905. type: "string"
  24906. },
  24907. page: {
  24908. type: "integer"
  24909. },
  24910. per_page: {
  24911. type: "integer"
  24912. },
  24913. team_slug: {
  24914. required: true,
  24915. type: "string"
  24916. }
  24917. },
  24918. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"
  24919. },
  24920. listDiscussionCommentsLegacy: {
  24921. deprecated: "octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy",
  24922. method: "GET",
  24923. params: {
  24924. direction: {
  24925. enum: ["asc", "desc"],
  24926. type: "string"
  24927. },
  24928. discussion_number: {
  24929. required: true,
  24930. type: "integer"
  24931. },
  24932. page: {
  24933. type: "integer"
  24934. },
  24935. per_page: {
  24936. type: "integer"
  24937. },
  24938. team_id: {
  24939. required: true,
  24940. type: "integer"
  24941. }
  24942. },
  24943. url: "/teams/:team_id/discussions/:discussion_number/comments"
  24944. },
  24945. listDiscussions: {
  24946. deprecated: "octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)",
  24947. method: "GET",
  24948. params: {
  24949. direction: {
  24950. enum: ["asc", "desc"],
  24951. type: "string"
  24952. },
  24953. page: {
  24954. type: "integer"
  24955. },
  24956. per_page: {
  24957. type: "integer"
  24958. },
  24959. team_id: {
  24960. required: true,
  24961. type: "integer"
  24962. }
  24963. },
  24964. url: "/teams/:team_id/discussions"
  24965. },
  24966. listDiscussionsInOrg: {
  24967. method: "GET",
  24968. params: {
  24969. direction: {
  24970. enum: ["asc", "desc"],
  24971. type: "string"
  24972. },
  24973. org: {
  24974. required: true,
  24975. type: "string"
  24976. },
  24977. page: {
  24978. type: "integer"
  24979. },
  24980. per_page: {
  24981. type: "integer"
  24982. },
  24983. team_slug: {
  24984. required: true,
  24985. type: "string"
  24986. }
  24987. },
  24988. url: "/orgs/:org/teams/:team_slug/discussions"
  24989. },
  24990. listDiscussionsLegacy: {
  24991. deprecated: "octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy",
  24992. method: "GET",
  24993. params: {
  24994. direction: {
  24995. enum: ["asc", "desc"],
  24996. type: "string"
  24997. },
  24998. page: {
  24999. type: "integer"
  25000. },
  25001. per_page: {
  25002. type: "integer"
  25003. },
  25004. team_id: {
  25005. required: true,
  25006. type: "integer"
  25007. }
  25008. },
  25009. url: "/teams/:team_id/discussions"
  25010. },
  25011. listForAuthenticatedUser: {
  25012. method: "GET",
  25013. params: {
  25014. page: {
  25015. type: "integer"
  25016. },
  25017. per_page: {
  25018. type: "integer"
  25019. }
  25020. },
  25021. url: "/user/teams"
  25022. },
  25023. listMembers: {
  25024. deprecated: "octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)",
  25025. method: "GET",
  25026. params: {
  25027. page: {
  25028. type: "integer"
  25029. },
  25030. per_page: {
  25031. type: "integer"
  25032. },
  25033. role: {
  25034. enum: ["member", "maintainer", "all"],
  25035. type: "string"
  25036. },
  25037. team_id: {
  25038. required: true,
  25039. type: "integer"
  25040. }
  25041. },
  25042. url: "/teams/:team_id/members"
  25043. },
  25044. listMembersInOrg: {
  25045. method: "GET",
  25046. params: {
  25047. org: {
  25048. required: true,
  25049. type: "string"
  25050. },
  25051. page: {
  25052. type: "integer"
  25053. },
  25054. per_page: {
  25055. type: "integer"
  25056. },
  25057. role: {
  25058. enum: ["member", "maintainer", "all"],
  25059. type: "string"
  25060. },
  25061. team_slug: {
  25062. required: true,
  25063. type: "string"
  25064. }
  25065. },
  25066. url: "/orgs/:org/teams/:team_slug/members"
  25067. },
  25068. listMembersLegacy: {
  25069. deprecated: "octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy",
  25070. method: "GET",
  25071. params: {
  25072. page: {
  25073. type: "integer"
  25074. },
  25075. per_page: {
  25076. type: "integer"
  25077. },
  25078. role: {
  25079. enum: ["member", "maintainer", "all"],
  25080. type: "string"
  25081. },
  25082. team_id: {
  25083. required: true,
  25084. type: "integer"
  25085. }
  25086. },
  25087. url: "/teams/:team_id/members"
  25088. },
  25089. listPendingInvitations: {
  25090. deprecated: "octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)",
  25091. method: "GET",
  25092. params: {
  25093. page: {
  25094. type: "integer"
  25095. },
  25096. per_page: {
  25097. type: "integer"
  25098. },
  25099. team_id: {
  25100. required: true,
  25101. type: "integer"
  25102. }
  25103. },
  25104. url: "/teams/:team_id/invitations"
  25105. },
  25106. listPendingInvitationsInOrg: {
  25107. method: "GET",
  25108. params: {
  25109. org: {
  25110. required: true,
  25111. type: "string"
  25112. },
  25113. page: {
  25114. type: "integer"
  25115. },
  25116. per_page: {
  25117. type: "integer"
  25118. },
  25119. team_slug: {
  25120. required: true,
  25121. type: "string"
  25122. }
  25123. },
  25124. url: "/orgs/:org/teams/:team_slug/invitations"
  25125. },
  25126. listPendingInvitationsLegacy: {
  25127. deprecated: "octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy",
  25128. method: "GET",
  25129. params: {
  25130. page: {
  25131. type: "integer"
  25132. },
  25133. per_page: {
  25134. type: "integer"
  25135. },
  25136. team_id: {
  25137. required: true,
  25138. type: "integer"
  25139. }
  25140. },
  25141. url: "/teams/:team_id/invitations"
  25142. },
  25143. listProjects: {
  25144. deprecated: "octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)",
  25145. headers: {
  25146. accept: "application/vnd.github.inertia-preview+json"
  25147. },
  25148. method: "GET",
  25149. params: {
  25150. page: {
  25151. type: "integer"
  25152. },
  25153. per_page: {
  25154. type: "integer"
  25155. },
  25156. team_id: {
  25157. required: true,
  25158. type: "integer"
  25159. }
  25160. },
  25161. url: "/teams/:team_id/projects"
  25162. },
  25163. listProjectsInOrg: {
  25164. headers: {
  25165. accept: "application/vnd.github.inertia-preview+json"
  25166. },
  25167. method: "GET",
  25168. params: {
  25169. org: {
  25170. required: true,
  25171. type: "string"
  25172. },
  25173. page: {
  25174. type: "integer"
  25175. },
  25176. per_page: {
  25177. type: "integer"
  25178. },
  25179. team_slug: {
  25180. required: true,
  25181. type: "string"
  25182. }
  25183. },
  25184. url: "/orgs/:org/teams/:team_slug/projects"
  25185. },
  25186. listProjectsLegacy: {
  25187. deprecated: "octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy",
  25188. headers: {
  25189. accept: "application/vnd.github.inertia-preview+json"
  25190. },
  25191. method: "GET",
  25192. params: {
  25193. page: {
  25194. type: "integer"
  25195. },
  25196. per_page: {
  25197. type: "integer"
  25198. },
  25199. team_id: {
  25200. required: true,
  25201. type: "integer"
  25202. }
  25203. },
  25204. url: "/teams/:team_id/projects"
  25205. },
  25206. listRepos: {
  25207. deprecated: "octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)",
  25208. method: "GET",
  25209. params: {
  25210. page: {
  25211. type: "integer"
  25212. },
  25213. per_page: {
  25214. type: "integer"
  25215. },
  25216. team_id: {
  25217. required: true,
  25218. type: "integer"
  25219. }
  25220. },
  25221. url: "/teams/:team_id/repos"
  25222. },
  25223. listReposInOrg: {
  25224. method: "GET",
  25225. params: {
  25226. org: {
  25227. required: true,
  25228. type: "string"
  25229. },
  25230. page: {
  25231. type: "integer"
  25232. },
  25233. per_page: {
  25234. type: "integer"
  25235. },
  25236. team_slug: {
  25237. required: true,
  25238. type: "string"
  25239. }
  25240. },
  25241. url: "/orgs/:org/teams/:team_slug/repos"
  25242. },
  25243. listReposLegacy: {
  25244. deprecated: "octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy",
  25245. method: "GET",
  25246. params: {
  25247. page: {
  25248. type: "integer"
  25249. },
  25250. per_page: {
  25251. type: "integer"
  25252. },
  25253. team_id: {
  25254. required: true,
  25255. type: "integer"
  25256. }
  25257. },
  25258. url: "/teams/:team_id/repos"
  25259. },
  25260. removeMember: {
  25261. deprecated: "octokit.teams.removeMember() has been renamed to octokit.teams.removeMemberLegacy() (2020-01-16)",
  25262. method: "DELETE",
  25263. params: {
  25264. team_id: {
  25265. required: true,
  25266. type: "integer"
  25267. },
  25268. username: {
  25269. required: true,
  25270. type: "string"
  25271. }
  25272. },
  25273. url: "/teams/:team_id/members/:username"
  25274. },
  25275. removeMemberLegacy: {
  25276. deprecated: "octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy",
  25277. method: "DELETE",
  25278. params: {
  25279. team_id: {
  25280. required: true,
  25281. type: "integer"
  25282. },
  25283. username: {
  25284. required: true,
  25285. type: "string"
  25286. }
  25287. },
  25288. url: "/teams/:team_id/members/:username"
  25289. },
  25290. removeMembership: {
  25291. deprecated: "octokit.teams.removeMembership() has been renamed to octokit.teams.removeMembershipLegacy() (2020-01-16)",
  25292. method: "DELETE",
  25293. params: {
  25294. team_id: {
  25295. required: true,
  25296. type: "integer"
  25297. },
  25298. username: {
  25299. required: true,
  25300. type: "string"
  25301. }
  25302. },
  25303. url: "/teams/:team_id/memberships/:username"
  25304. },
  25305. removeMembershipInOrg: {
  25306. method: "DELETE",
  25307. params: {
  25308. org: {
  25309. required: true,
  25310. type: "string"
  25311. },
  25312. team_slug: {
  25313. required: true,
  25314. type: "string"
  25315. },
  25316. username: {
  25317. required: true,
  25318. type: "string"
  25319. }
  25320. },
  25321. url: "/orgs/:org/teams/:team_slug/memberships/:username"
  25322. },
  25323. removeMembershipLegacy: {
  25324. deprecated: "octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy",
  25325. method: "DELETE",
  25326. params: {
  25327. team_id: {
  25328. required: true,
  25329. type: "integer"
  25330. },
  25331. username: {
  25332. required: true,
  25333. type: "string"
  25334. }
  25335. },
  25336. url: "/teams/:team_id/memberships/:username"
  25337. },
  25338. removeProject: {
  25339. deprecated: "octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)",
  25340. method: "DELETE",
  25341. params: {
  25342. project_id: {
  25343. required: true,
  25344. type: "integer"
  25345. },
  25346. team_id: {
  25347. required: true,
  25348. type: "integer"
  25349. }
  25350. },
  25351. url: "/teams/:team_id/projects/:project_id"
  25352. },
  25353. removeProjectInOrg: {
  25354. method: "DELETE",
  25355. params: {
  25356. org: {
  25357. required: true,
  25358. type: "string"
  25359. },
  25360. project_id: {
  25361. required: true,
  25362. type: "integer"
  25363. },
  25364. team_slug: {
  25365. required: true,
  25366. type: "string"
  25367. }
  25368. },
  25369. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25370. },
  25371. removeProjectLegacy: {
  25372. deprecated: "octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy",
  25373. method: "DELETE",
  25374. params: {
  25375. project_id: {
  25376. required: true,
  25377. type: "integer"
  25378. },
  25379. team_id: {
  25380. required: true,
  25381. type: "integer"
  25382. }
  25383. },
  25384. url: "/teams/:team_id/projects/:project_id"
  25385. },
  25386. removeRepo: {
  25387. deprecated: "octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)",
  25388. method: "DELETE",
  25389. params: {
  25390. owner: {
  25391. required: true,
  25392. type: "string"
  25393. },
  25394. repo: {
  25395. required: true,
  25396. type: "string"
  25397. },
  25398. team_id: {
  25399. required: true,
  25400. type: "integer"
  25401. }
  25402. },
  25403. url: "/teams/:team_id/repos/:owner/:repo"
  25404. },
  25405. removeRepoInOrg: {
  25406. method: "DELETE",
  25407. params: {
  25408. org: {
  25409. required: true,
  25410. type: "string"
  25411. },
  25412. owner: {
  25413. required: true,
  25414. type: "string"
  25415. },
  25416. repo: {
  25417. required: true,
  25418. type: "string"
  25419. },
  25420. team_slug: {
  25421. required: true,
  25422. type: "string"
  25423. }
  25424. },
  25425. url: "/orgs/:org/teams/:team_slug/repos/:owner/:repo"
  25426. },
  25427. removeRepoLegacy: {
  25428. deprecated: "octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy",
  25429. method: "DELETE",
  25430. params: {
  25431. owner: {
  25432. required: true,
  25433. type: "string"
  25434. },
  25435. repo: {
  25436. required: true,
  25437. type: "string"
  25438. },
  25439. team_id: {
  25440. required: true,
  25441. type: "integer"
  25442. }
  25443. },
  25444. url: "/teams/:team_id/repos/:owner/:repo"
  25445. },
  25446. reviewProject: {
  25447. deprecated: "octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)",
  25448. headers: {
  25449. accept: "application/vnd.github.inertia-preview+json"
  25450. },
  25451. method: "GET",
  25452. params: {
  25453. project_id: {
  25454. required: true,
  25455. type: "integer"
  25456. },
  25457. team_id: {
  25458. required: true,
  25459. type: "integer"
  25460. }
  25461. },
  25462. url: "/teams/:team_id/projects/:project_id"
  25463. },
  25464. reviewProjectInOrg: {
  25465. headers: {
  25466. accept: "application/vnd.github.inertia-preview+json"
  25467. },
  25468. method: "GET",
  25469. params: {
  25470. org: {
  25471. required: true,
  25472. type: "string"
  25473. },
  25474. project_id: {
  25475. required: true,
  25476. type: "integer"
  25477. },
  25478. team_slug: {
  25479. required: true,
  25480. type: "string"
  25481. }
  25482. },
  25483. url: "/orgs/:org/teams/:team_slug/projects/:project_id"
  25484. },
  25485. reviewProjectLegacy: {
  25486. deprecated: "octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy",
  25487. headers: {
  25488. accept: "application/vnd.github.inertia-preview+json"
  25489. },
  25490. method: "GET",
  25491. params: {
  25492. project_id: {
  25493. required: true,
  25494. type: "integer"
  25495. },
  25496. team_id: {
  25497. required: true,
  25498. type: "integer"
  25499. }
  25500. },
  25501. url: "/teams/:team_id/projects/:project_id"
  25502. },
  25503. update: {
  25504. deprecated: "octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)",
  25505. method: "PATCH",
  25506. params: {
  25507. description: {
  25508. type: "string"
  25509. },
  25510. name: {
  25511. required: true,
  25512. type: "string"
  25513. },
  25514. parent_team_id: {
  25515. type: "integer"
  25516. },
  25517. permission: {
  25518. enum: ["pull", "push", "admin"],
  25519. type: "string"
  25520. },
  25521. privacy: {
  25522. enum: ["secret", "closed"],
  25523. type: "string"
  25524. },
  25525. team_id: {
  25526. required: true,
  25527. type: "integer"
  25528. }
  25529. },
  25530. url: "/teams/:team_id"
  25531. },
  25532. updateDiscussion: {
  25533. deprecated: "octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)",
  25534. method: "PATCH",
  25535. params: {
  25536. body: {
  25537. type: "string"
  25538. },
  25539. discussion_number: {
  25540. required: true,
  25541. type: "integer"
  25542. },
  25543. team_id: {
  25544. required: true,
  25545. type: "integer"
  25546. },
  25547. title: {
  25548. type: "string"
  25549. }
  25550. },
  25551. url: "/teams/:team_id/discussions/:discussion_number"
  25552. },
  25553. updateDiscussionComment: {
  25554. deprecated: "octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)",
  25555. method: "PATCH",
  25556. params: {
  25557. body: {
  25558. required: true,
  25559. type: "string"
  25560. },
  25561. comment_number: {
  25562. required: true,
  25563. type: "integer"
  25564. },
  25565. discussion_number: {
  25566. required: true,
  25567. type: "integer"
  25568. },
  25569. team_id: {
  25570. required: true,
  25571. type: "integer"
  25572. }
  25573. },
  25574. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25575. },
  25576. updateDiscussionCommentInOrg: {
  25577. method: "PATCH",
  25578. params: {
  25579. body: {
  25580. required: true,
  25581. type: "string"
  25582. },
  25583. comment_number: {
  25584. required: true,
  25585. type: "integer"
  25586. },
  25587. discussion_number: {
  25588. required: true,
  25589. type: "integer"
  25590. },
  25591. org: {
  25592. required: true,
  25593. type: "string"
  25594. },
  25595. team_slug: {
  25596. required: true,
  25597. type: "string"
  25598. }
  25599. },
  25600. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"
  25601. },
  25602. updateDiscussionCommentLegacy: {
  25603. deprecated: "octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy",
  25604. method: "PATCH",
  25605. params: {
  25606. body: {
  25607. required: true,
  25608. type: "string"
  25609. },
  25610. comment_number: {
  25611. required: true,
  25612. type: "integer"
  25613. },
  25614. discussion_number: {
  25615. required: true,
  25616. type: "integer"
  25617. },
  25618. team_id: {
  25619. required: true,
  25620. type: "integer"
  25621. }
  25622. },
  25623. url: "/teams/:team_id/discussions/:discussion_number/comments/:comment_number"
  25624. },
  25625. updateDiscussionInOrg: {
  25626. method: "PATCH",
  25627. params: {
  25628. body: {
  25629. type: "string"
  25630. },
  25631. discussion_number: {
  25632. required: true,
  25633. type: "integer"
  25634. },
  25635. org: {
  25636. required: true,
  25637. type: "string"
  25638. },
  25639. team_slug: {
  25640. required: true,
  25641. type: "string"
  25642. },
  25643. title: {
  25644. type: "string"
  25645. }
  25646. },
  25647. url: "/orgs/:org/teams/:team_slug/discussions/:discussion_number"
  25648. },
  25649. updateDiscussionLegacy: {
  25650. deprecated: "octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy",
  25651. method: "PATCH",
  25652. params: {
  25653. body: {
  25654. type: "string"
  25655. },
  25656. discussion_number: {
  25657. required: true,
  25658. type: "integer"
  25659. },
  25660. team_id: {
  25661. required: true,
  25662. type: "integer"
  25663. },
  25664. title: {
  25665. type: "string"
  25666. }
  25667. },
  25668. url: "/teams/:team_id/discussions/:discussion_number"
  25669. },
  25670. updateInOrg: {
  25671. method: "PATCH",
  25672. params: {
  25673. description: {
  25674. type: "string"
  25675. },
  25676. name: {
  25677. required: true,
  25678. type: "string"
  25679. },
  25680. org: {
  25681. required: true,
  25682. type: "string"
  25683. },
  25684. parent_team_id: {
  25685. type: "integer"
  25686. },
  25687. permission: {
  25688. enum: ["pull", "push", "admin"],
  25689. type: "string"
  25690. },
  25691. privacy: {
  25692. enum: ["secret", "closed"],
  25693. type: "string"
  25694. },
  25695. team_slug: {
  25696. required: true,
  25697. type: "string"
  25698. }
  25699. },
  25700. url: "/orgs/:org/teams/:team_slug"
  25701. },
  25702. updateLegacy: {
  25703. deprecated: "octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy",
  25704. method: "PATCH",
  25705. params: {
  25706. description: {
  25707. type: "string"
  25708. },
  25709. name: {
  25710. required: true,
  25711. type: "string"
  25712. },
  25713. parent_team_id: {
  25714. type: "integer"
  25715. },
  25716. permission: {
  25717. enum: ["pull", "push", "admin"],
  25718. type: "string"
  25719. },
  25720. privacy: {
  25721. enum: ["secret", "closed"],
  25722. type: "string"
  25723. },
  25724. team_id: {
  25725. required: true,
  25726. type: "integer"
  25727. }
  25728. },
  25729. url: "/teams/:team_id"
  25730. }
  25731. },
  25732. users: {
  25733. addEmails: {
  25734. method: "POST",
  25735. params: {
  25736. emails: {
  25737. required: true,
  25738. type: "string[]"
  25739. }
  25740. },
  25741. url: "/user/emails"
  25742. },
  25743. block: {
  25744. method: "PUT",
  25745. params: {
  25746. username: {
  25747. required: true,
  25748. type: "string"
  25749. }
  25750. },
  25751. url: "/user/blocks/:username"
  25752. },
  25753. checkBlocked: {
  25754. method: "GET",
  25755. params: {
  25756. username: {
  25757. required: true,
  25758. type: "string"
  25759. }
  25760. },
  25761. url: "/user/blocks/:username"
  25762. },
  25763. checkFollowing: {
  25764. method: "GET",
  25765. params: {
  25766. username: {
  25767. required: true,
  25768. type: "string"
  25769. }
  25770. },
  25771. url: "/user/following/:username"
  25772. },
  25773. checkFollowingForUser: {
  25774. method: "GET",
  25775. params: {
  25776. target_user: {
  25777. required: true,
  25778. type: "string"
  25779. },
  25780. username: {
  25781. required: true,
  25782. type: "string"
  25783. }
  25784. },
  25785. url: "/users/:username/following/:target_user"
  25786. },
  25787. createGpgKey: {
  25788. method: "POST",
  25789. params: {
  25790. armored_public_key: {
  25791. type: "string"
  25792. }
  25793. },
  25794. url: "/user/gpg_keys"
  25795. },
  25796. createPublicKey: {
  25797. method: "POST",
  25798. params: {
  25799. key: {
  25800. type: "string"
  25801. },
  25802. title: {
  25803. type: "string"
  25804. }
  25805. },
  25806. url: "/user/keys"
  25807. },
  25808. deleteEmails: {
  25809. method: "DELETE",
  25810. params: {
  25811. emails: {
  25812. required: true,
  25813. type: "string[]"
  25814. }
  25815. },
  25816. url: "/user/emails"
  25817. },
  25818. deleteGpgKey: {
  25819. method: "DELETE",
  25820. params: {
  25821. gpg_key_id: {
  25822. required: true,
  25823. type: "integer"
  25824. }
  25825. },
  25826. url: "/user/gpg_keys/:gpg_key_id"
  25827. },
  25828. deletePublicKey: {
  25829. method: "DELETE",
  25830. params: {
  25831. key_id: {
  25832. required: true,
  25833. type: "integer"
  25834. }
  25835. },
  25836. url: "/user/keys/:key_id"
  25837. },
  25838. follow: {
  25839. method: "PUT",
  25840. params: {
  25841. username: {
  25842. required: true,
  25843. type: "string"
  25844. }
  25845. },
  25846. url: "/user/following/:username"
  25847. },
  25848. getAuthenticated: {
  25849. method: "GET",
  25850. params: {},
  25851. url: "/user"
  25852. },
  25853. getByUsername: {
  25854. method: "GET",
  25855. params: {
  25856. username: {
  25857. required: true,
  25858. type: "string"
  25859. }
  25860. },
  25861. url: "/users/:username"
  25862. },
  25863. getContextForUser: {
  25864. method: "GET",
  25865. params: {
  25866. subject_id: {
  25867. type: "string"
  25868. },
  25869. subject_type: {
  25870. enum: ["organization", "repository", "issue", "pull_request"],
  25871. type: "string"
  25872. },
  25873. username: {
  25874. required: true,
  25875. type: "string"
  25876. }
  25877. },
  25878. url: "/users/:username/hovercard"
  25879. },
  25880. getGpgKey: {
  25881. method: "GET",
  25882. params: {
  25883. gpg_key_id: {
  25884. required: true,
  25885. type: "integer"
  25886. }
  25887. },
  25888. url: "/user/gpg_keys/:gpg_key_id"
  25889. },
  25890. getPublicKey: {
  25891. method: "GET",
  25892. params: {
  25893. key_id: {
  25894. required: true,
  25895. type: "integer"
  25896. }
  25897. },
  25898. url: "/user/keys/:key_id"
  25899. },
  25900. list: {
  25901. method: "GET",
  25902. params: {
  25903. page: {
  25904. type: "integer"
  25905. },
  25906. per_page: {
  25907. type: "integer"
  25908. },
  25909. since: {
  25910. type: "string"
  25911. }
  25912. },
  25913. url: "/users"
  25914. },
  25915. listBlocked: {
  25916. method: "GET",
  25917. params: {},
  25918. url: "/user/blocks"
  25919. },
  25920. listEmails: {
  25921. method: "GET",
  25922. params: {
  25923. page: {
  25924. type: "integer"
  25925. },
  25926. per_page: {
  25927. type: "integer"
  25928. }
  25929. },
  25930. url: "/user/emails"
  25931. },
  25932. listFollowersForAuthenticatedUser: {
  25933. method: "GET",
  25934. params: {
  25935. page: {
  25936. type: "integer"
  25937. },
  25938. per_page: {
  25939. type: "integer"
  25940. }
  25941. },
  25942. url: "/user/followers"
  25943. },
  25944. listFollowersForUser: {
  25945. method: "GET",
  25946. params: {
  25947. page: {
  25948. type: "integer"
  25949. },
  25950. per_page: {
  25951. type: "integer"
  25952. },
  25953. username: {
  25954. required: true,
  25955. type: "string"
  25956. }
  25957. },
  25958. url: "/users/:username/followers"
  25959. },
  25960. listFollowingForAuthenticatedUser: {
  25961. method: "GET",
  25962. params: {
  25963. page: {
  25964. type: "integer"
  25965. },
  25966. per_page: {
  25967. type: "integer"
  25968. }
  25969. },
  25970. url: "/user/following"
  25971. },
  25972. listFollowingForUser: {
  25973. method: "GET",
  25974. params: {
  25975. page: {
  25976. type: "integer"
  25977. },
  25978. per_page: {
  25979. type: "integer"
  25980. },
  25981. username: {
  25982. required: true,
  25983. type: "string"
  25984. }
  25985. },
  25986. url: "/users/:username/following"
  25987. },
  25988. listGpgKeys: {
  25989. method: "GET",
  25990. params: {
  25991. page: {
  25992. type: "integer"
  25993. },
  25994. per_page: {
  25995. type: "integer"
  25996. }
  25997. },
  25998. url: "/user/gpg_keys"
  25999. },
  26000. listGpgKeysForUser: {
  26001. method: "GET",
  26002. params: {
  26003. page: {
  26004. type: "integer"
  26005. },
  26006. per_page: {
  26007. type: "integer"
  26008. },
  26009. username: {
  26010. required: true,
  26011. type: "string"
  26012. }
  26013. },
  26014. url: "/users/:username/gpg_keys"
  26015. },
  26016. listPublicEmails: {
  26017. method: "GET",
  26018. params: {
  26019. page: {
  26020. type: "integer"
  26021. },
  26022. per_page: {
  26023. type: "integer"
  26024. }
  26025. },
  26026. url: "/user/public_emails"
  26027. },
  26028. listPublicKeys: {
  26029. method: "GET",
  26030. params: {
  26031. page: {
  26032. type: "integer"
  26033. },
  26034. per_page: {
  26035. type: "integer"
  26036. }
  26037. },
  26038. url: "/user/keys"
  26039. },
  26040. listPublicKeysForUser: {
  26041. method: "GET",
  26042. params: {
  26043. page: {
  26044. type: "integer"
  26045. },
  26046. per_page: {
  26047. type: "integer"
  26048. },
  26049. username: {
  26050. required: true,
  26051. type: "string"
  26052. }
  26053. },
  26054. url: "/users/:username/keys"
  26055. },
  26056. togglePrimaryEmailVisibility: {
  26057. method: "PATCH",
  26058. params: {
  26059. email: {
  26060. required: true,
  26061. type: "string"
  26062. },
  26063. visibility: {
  26064. required: true,
  26065. type: "string"
  26066. }
  26067. },
  26068. url: "/user/email/visibility"
  26069. },
  26070. unblock: {
  26071. method: "DELETE",
  26072. params: {
  26073. username: {
  26074. required: true,
  26075. type: "string"
  26076. }
  26077. },
  26078. url: "/user/blocks/:username"
  26079. },
  26080. unfollow: {
  26081. method: "DELETE",
  26082. params: {
  26083. username: {
  26084. required: true,
  26085. type: "string"
  26086. }
  26087. },
  26088. url: "/user/following/:username"
  26089. },
  26090. updateAuthenticated: {
  26091. method: "PATCH",
  26092. params: {
  26093. bio: {
  26094. type: "string"
  26095. },
  26096. blog: {
  26097. type: "string"
  26098. },
  26099. company: {
  26100. type: "string"
  26101. },
  26102. email: {
  26103. type: "string"
  26104. },
  26105. hireable: {
  26106. type: "boolean"
  26107. },
  26108. location: {
  26109. type: "string"
  26110. },
  26111. name: {
  26112. type: "string"
  26113. }
  26114. },
  26115. url: "/user"
  26116. }
  26117. }
  26118. };
  26119. const VERSION = "2.4.0";
  26120. function registerEndpoints(octokit, routes) {
  26121. Object.keys(routes).forEach(namespaceName => {
  26122. if (!octokit[namespaceName]) {
  26123. octokit[namespaceName] = {};
  26124. }
  26125. Object.keys(routes[namespaceName]).forEach(apiName => {
  26126. const apiOptions = routes[namespaceName][apiName];
  26127. const endpointDefaults = ["method", "url", "headers"].reduce((map, key) => {
  26128. if (typeof apiOptions[key] !== "undefined") {
  26129. map[key] = apiOptions[key];
  26130. }
  26131. return map;
  26132. }, {});
  26133. endpointDefaults.request = {
  26134. validate: apiOptions.params
  26135. };
  26136. let request = octokit.request.defaults(endpointDefaults); // patch request & endpoint methods to support deprecated parameters.
  26137. // Not the most elegant solution, but we don’t want to move deprecation
  26138. // logic into octokit/endpoint.js as it’s out of scope
  26139. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(key => apiOptions.params[key].deprecated);
  26140. if (hasDeprecatedParam) {
  26141. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  26142. request = patch(octokit.request.defaults(endpointDefaults), `.${namespaceName}.${apiName}()`);
  26143. request.endpoint = patch(request.endpoint, `.${namespaceName}.${apiName}.endpoint()`);
  26144. request.endpoint.merge = patch(request.endpoint.merge, `.${namespaceName}.${apiName}.endpoint.merge()`);
  26145. }
  26146. if (apiOptions.deprecated) {
  26147. octokit[namespaceName][apiName] = Object.assign(function deprecatedEndpointMethod() {
  26148. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`));
  26149. octokit[namespaceName][apiName] = request;
  26150. return request.apply(null, arguments);
  26151. }, request);
  26152. return;
  26153. }
  26154. octokit[namespaceName][apiName] = request;
  26155. });
  26156. });
  26157. }
  26158. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  26159. const patchedMethod = options => {
  26160. options = Object.assign({}, options);
  26161. Object.keys(options).forEach(key => {
  26162. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  26163. const aliasKey = apiOptions.params[key].alias;
  26164. octokit.log.warn(new deprecation.Deprecation(`[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`));
  26165. if (!(aliasKey in options)) {
  26166. options[aliasKey] = options[key];
  26167. }
  26168. delete options[key];
  26169. }
  26170. });
  26171. return method(options);
  26172. };
  26173. Object.keys(method).forEach(key => {
  26174. patchedMethod[key] = method[key];
  26175. });
  26176. return patchedMethod;
  26177. }
  26178. /**
  26179. * This plugin is a 1:1 copy of internal @octokit/rest plugins. The primary
  26180. * goal is to rebuild @octokit/rest on top of @octokit/core. Once that is
  26181. * done, we will remove the registerEndpoints methods and return the methods
  26182. * directly as with the other plugins. At that point we will also remove the
  26183. * legacy workarounds and deprecations.
  26184. *
  26185. * See the plan at
  26186. * https://github.com/octokit/plugin-rest-endpoint-methods.js/pull/1
  26187. */
  26188. function restEndpointMethods(octokit) {
  26189. // @ts-ignore
  26190. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  26191. registerEndpoints(octokit, endpointsByScope); // Aliasing scopes for backward compatibility
  26192. // See https://github.com/octokit/rest.js/pull/1134
  26193. [["gitdata", "git"], ["authorization", "oauthAuthorizations"], ["pullRequests", "pulls"]].forEach(([deprecatedScope, scope]) => {
  26194. Object.defineProperty(octokit, deprecatedScope, {
  26195. get() {
  26196. octokit.log.warn( // @ts-ignore
  26197. new deprecation.Deprecation(`[@octokit/plugin-rest-endpoint-methods] "octokit.${deprecatedScope}.*" methods are deprecated, use "octokit.${scope}.*" instead`)); // @ts-ignore
  26198. return octokit[scope];
  26199. }
  26200. });
  26201. });
  26202. return {};
  26203. }
  26204. restEndpointMethods.VERSION = VERSION;
  26205. exports.restEndpointMethods = restEndpointMethods;
  26206. //# sourceMappingURL=index.js.map
  26207. /***/ }),
  26208. /***/ 850:
  26209. /***/ (function(module, __unusedexports, __webpack_require__) {
  26210. module.exports = paginationMethodsPlugin
  26211. function paginationMethodsPlugin (octokit) {
  26212. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  26213. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  26214. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  26215. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  26216. octokit.hasFirstPage = __webpack_require__(536)
  26217. octokit.hasLastPage = __webpack_require__(336)
  26218. octokit.hasNextPage = __webpack_require__(929)
  26219. octokit.hasPreviousPage = __webpack_require__(558)
  26220. }
  26221. /***/ }),
  26222. /***/ 854:
  26223. /***/ (function(module) {
  26224. /**
  26225. * lodash (Custom Build) <https://lodash.com/>
  26226. * Build: `lodash modularize exports="npm" -o ./`
  26227. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  26228. * Released under MIT license <https://lodash.com/license>
  26229. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  26230. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  26231. */
  26232. /** Used as the `TypeError` message for "Functions" methods. */
  26233. var FUNC_ERROR_TEXT = 'Expected a function';
  26234. /** Used to stand-in for `undefined` hash values. */
  26235. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  26236. /** Used as references for various `Number` constants. */
  26237. var INFINITY = 1 / 0;
  26238. /** `Object#toString` result references. */
  26239. var funcTag = '[object Function]',
  26240. genTag = '[object GeneratorFunction]',
  26241. symbolTag = '[object Symbol]';
  26242. /** Used to match property names within property paths. */
  26243. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  26244. reIsPlainProp = /^\w*$/,
  26245. reLeadingDot = /^\./,
  26246. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  26247. /**
  26248. * Used to match `RegExp`
  26249. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  26250. */
  26251. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  26252. /** Used to match backslashes in property paths. */
  26253. var reEscapeChar = /\\(\\)?/g;
  26254. /** Used to detect host constructors (Safari). */
  26255. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  26256. /** Detect free variable `global` from Node.js. */
  26257. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  26258. /** Detect free variable `self`. */
  26259. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  26260. /** Used as a reference to the global object. */
  26261. var root = freeGlobal || freeSelf || Function('return this')();
  26262. /**
  26263. * Gets the value at `key` of `object`.
  26264. *
  26265. * @private
  26266. * @param {Object} [object] The object to query.
  26267. * @param {string} key The key of the property to get.
  26268. * @returns {*} Returns the property value.
  26269. */
  26270. function getValue(object, key) {
  26271. return object == null ? undefined : object[key];
  26272. }
  26273. /**
  26274. * Checks if `value` is a host object in IE < 9.
  26275. *
  26276. * @private
  26277. * @param {*} value The value to check.
  26278. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  26279. */
  26280. function isHostObject(value) {
  26281. // Many host objects are `Object` objects that can coerce to strings
  26282. // despite having improperly defined `toString` methods.
  26283. var result = false;
  26284. if (value != null && typeof value.toString != 'function') {
  26285. try {
  26286. result = !!(value + '');
  26287. } catch (e) {}
  26288. }
  26289. return result;
  26290. }
  26291. /** Used for built-in method references. */
  26292. var arrayProto = Array.prototype,
  26293. funcProto = Function.prototype,
  26294. objectProto = Object.prototype;
  26295. /** Used to detect overreaching core-js shims. */
  26296. var coreJsData = root['__core-js_shared__'];
  26297. /** Used to detect methods masquerading as native. */
  26298. var maskSrcKey = (function() {
  26299. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  26300. return uid ? ('Symbol(src)_1.' + uid) : '';
  26301. }());
  26302. /** Used to resolve the decompiled source of functions. */
  26303. var funcToString = funcProto.toString;
  26304. /** Used to check objects for own properties. */
  26305. var hasOwnProperty = objectProto.hasOwnProperty;
  26306. /**
  26307. * Used to resolve the
  26308. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  26309. * of values.
  26310. */
  26311. var objectToString = objectProto.toString;
  26312. /** Used to detect if a method is native. */
  26313. var reIsNative = RegExp('^' +
  26314. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  26315. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  26316. );
  26317. /** Built-in value references. */
  26318. var Symbol = root.Symbol,
  26319. splice = arrayProto.splice;
  26320. /* Built-in method references that are verified to be native. */
  26321. var Map = getNative(root, 'Map'),
  26322. nativeCreate = getNative(Object, 'create');
  26323. /** Used to convert symbols to primitives and strings. */
  26324. var symbolProto = Symbol ? Symbol.prototype : undefined,
  26325. symbolToString = symbolProto ? symbolProto.toString : undefined;
  26326. /**
  26327. * Creates a hash object.
  26328. *
  26329. * @private
  26330. * @constructor
  26331. * @param {Array} [entries] The key-value pairs to cache.
  26332. */
  26333. function Hash(entries) {
  26334. var index = -1,
  26335. length = entries ? entries.length : 0;
  26336. this.clear();
  26337. while (++index < length) {
  26338. var entry = entries[index];
  26339. this.set(entry[0], entry[1]);
  26340. }
  26341. }
  26342. /**
  26343. * Removes all key-value entries from the hash.
  26344. *
  26345. * @private
  26346. * @name clear
  26347. * @memberOf Hash
  26348. */
  26349. function hashClear() {
  26350. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  26351. }
  26352. /**
  26353. * Removes `key` and its value from the hash.
  26354. *
  26355. * @private
  26356. * @name delete
  26357. * @memberOf Hash
  26358. * @param {Object} hash The hash to modify.
  26359. * @param {string} key The key of the value to remove.
  26360. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26361. */
  26362. function hashDelete(key) {
  26363. return this.has(key) && delete this.__data__[key];
  26364. }
  26365. /**
  26366. * Gets the hash value for `key`.
  26367. *
  26368. * @private
  26369. * @name get
  26370. * @memberOf Hash
  26371. * @param {string} key The key of the value to get.
  26372. * @returns {*} Returns the entry value.
  26373. */
  26374. function hashGet(key) {
  26375. var data = this.__data__;
  26376. if (nativeCreate) {
  26377. var result = data[key];
  26378. return result === HASH_UNDEFINED ? undefined : result;
  26379. }
  26380. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  26381. }
  26382. /**
  26383. * Checks if a hash value for `key` exists.
  26384. *
  26385. * @private
  26386. * @name has
  26387. * @memberOf Hash
  26388. * @param {string} key The key of the entry to check.
  26389. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26390. */
  26391. function hashHas(key) {
  26392. var data = this.__data__;
  26393. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  26394. }
  26395. /**
  26396. * Sets the hash `key` to `value`.
  26397. *
  26398. * @private
  26399. * @name set
  26400. * @memberOf Hash
  26401. * @param {string} key The key of the value to set.
  26402. * @param {*} value The value to set.
  26403. * @returns {Object} Returns the hash instance.
  26404. */
  26405. function hashSet(key, value) {
  26406. var data = this.__data__;
  26407. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  26408. return this;
  26409. }
  26410. // Add methods to `Hash`.
  26411. Hash.prototype.clear = hashClear;
  26412. Hash.prototype['delete'] = hashDelete;
  26413. Hash.prototype.get = hashGet;
  26414. Hash.prototype.has = hashHas;
  26415. Hash.prototype.set = hashSet;
  26416. /**
  26417. * Creates an list cache object.
  26418. *
  26419. * @private
  26420. * @constructor
  26421. * @param {Array} [entries] The key-value pairs to cache.
  26422. */
  26423. function ListCache(entries) {
  26424. var index = -1,
  26425. length = entries ? entries.length : 0;
  26426. this.clear();
  26427. while (++index < length) {
  26428. var entry = entries[index];
  26429. this.set(entry[0], entry[1]);
  26430. }
  26431. }
  26432. /**
  26433. * Removes all key-value entries from the list cache.
  26434. *
  26435. * @private
  26436. * @name clear
  26437. * @memberOf ListCache
  26438. */
  26439. function listCacheClear() {
  26440. this.__data__ = [];
  26441. }
  26442. /**
  26443. * Removes `key` and its value from the list cache.
  26444. *
  26445. * @private
  26446. * @name delete
  26447. * @memberOf ListCache
  26448. * @param {string} key The key of the value to remove.
  26449. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26450. */
  26451. function listCacheDelete(key) {
  26452. var data = this.__data__,
  26453. index = assocIndexOf(data, key);
  26454. if (index < 0) {
  26455. return false;
  26456. }
  26457. var lastIndex = data.length - 1;
  26458. if (index == lastIndex) {
  26459. data.pop();
  26460. } else {
  26461. splice.call(data, index, 1);
  26462. }
  26463. return true;
  26464. }
  26465. /**
  26466. * Gets the list cache value for `key`.
  26467. *
  26468. * @private
  26469. * @name get
  26470. * @memberOf ListCache
  26471. * @param {string} key The key of the value to get.
  26472. * @returns {*} Returns the entry value.
  26473. */
  26474. function listCacheGet(key) {
  26475. var data = this.__data__,
  26476. index = assocIndexOf(data, key);
  26477. return index < 0 ? undefined : data[index][1];
  26478. }
  26479. /**
  26480. * Checks if a list cache value for `key` exists.
  26481. *
  26482. * @private
  26483. * @name has
  26484. * @memberOf ListCache
  26485. * @param {string} key The key of the entry to check.
  26486. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26487. */
  26488. function listCacheHas(key) {
  26489. return assocIndexOf(this.__data__, key) > -1;
  26490. }
  26491. /**
  26492. * Sets the list cache `key` to `value`.
  26493. *
  26494. * @private
  26495. * @name set
  26496. * @memberOf ListCache
  26497. * @param {string} key The key of the value to set.
  26498. * @param {*} value The value to set.
  26499. * @returns {Object} Returns the list cache instance.
  26500. */
  26501. function listCacheSet(key, value) {
  26502. var data = this.__data__,
  26503. index = assocIndexOf(data, key);
  26504. if (index < 0) {
  26505. data.push([key, value]);
  26506. } else {
  26507. data[index][1] = value;
  26508. }
  26509. return this;
  26510. }
  26511. // Add methods to `ListCache`.
  26512. ListCache.prototype.clear = listCacheClear;
  26513. ListCache.prototype['delete'] = listCacheDelete;
  26514. ListCache.prototype.get = listCacheGet;
  26515. ListCache.prototype.has = listCacheHas;
  26516. ListCache.prototype.set = listCacheSet;
  26517. /**
  26518. * Creates a map cache object to store key-value pairs.
  26519. *
  26520. * @private
  26521. * @constructor
  26522. * @param {Array} [entries] The key-value pairs to cache.
  26523. */
  26524. function MapCache(entries) {
  26525. var index = -1,
  26526. length = entries ? entries.length : 0;
  26527. this.clear();
  26528. while (++index < length) {
  26529. var entry = entries[index];
  26530. this.set(entry[0], entry[1]);
  26531. }
  26532. }
  26533. /**
  26534. * Removes all key-value entries from the map.
  26535. *
  26536. * @private
  26537. * @name clear
  26538. * @memberOf MapCache
  26539. */
  26540. function mapCacheClear() {
  26541. this.__data__ = {
  26542. 'hash': new Hash,
  26543. 'map': new (Map || ListCache),
  26544. 'string': new Hash
  26545. };
  26546. }
  26547. /**
  26548. * Removes `key` and its value from the map.
  26549. *
  26550. * @private
  26551. * @name delete
  26552. * @memberOf MapCache
  26553. * @param {string} key The key of the value to remove.
  26554. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26555. */
  26556. function mapCacheDelete(key) {
  26557. return getMapData(this, key)['delete'](key);
  26558. }
  26559. /**
  26560. * Gets the map value for `key`.
  26561. *
  26562. * @private
  26563. * @name get
  26564. * @memberOf MapCache
  26565. * @param {string} key The key of the value to get.
  26566. * @returns {*} Returns the entry value.
  26567. */
  26568. function mapCacheGet(key) {
  26569. return getMapData(this, key).get(key);
  26570. }
  26571. /**
  26572. * Checks if a map value for `key` exists.
  26573. *
  26574. * @private
  26575. * @name has
  26576. * @memberOf MapCache
  26577. * @param {string} key The key of the entry to check.
  26578. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26579. */
  26580. function mapCacheHas(key) {
  26581. return getMapData(this, key).has(key);
  26582. }
  26583. /**
  26584. * Sets the map `key` to `value`.
  26585. *
  26586. * @private
  26587. * @name set
  26588. * @memberOf MapCache
  26589. * @param {string} key The key of the value to set.
  26590. * @param {*} value The value to set.
  26591. * @returns {Object} Returns the map cache instance.
  26592. */
  26593. function mapCacheSet(key, value) {
  26594. getMapData(this, key).set(key, value);
  26595. return this;
  26596. }
  26597. // Add methods to `MapCache`.
  26598. MapCache.prototype.clear = mapCacheClear;
  26599. MapCache.prototype['delete'] = mapCacheDelete;
  26600. MapCache.prototype.get = mapCacheGet;
  26601. MapCache.prototype.has = mapCacheHas;
  26602. MapCache.prototype.set = mapCacheSet;
  26603. /**
  26604. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26605. *
  26606. * @private
  26607. * @param {Array} array The array to inspect.
  26608. * @param {*} key The key to search for.
  26609. * @returns {number} Returns the index of the matched value, else `-1`.
  26610. */
  26611. function assocIndexOf(array, key) {
  26612. var length = array.length;
  26613. while (length--) {
  26614. if (eq(array[length][0], key)) {
  26615. return length;
  26616. }
  26617. }
  26618. return -1;
  26619. }
  26620. /**
  26621. * The base implementation of `_.get` without support for default values.
  26622. *
  26623. * @private
  26624. * @param {Object} object The object to query.
  26625. * @param {Array|string} path The path of the property to get.
  26626. * @returns {*} Returns the resolved value.
  26627. */
  26628. function baseGet(object, path) {
  26629. path = isKey(path, object) ? [path] : castPath(path);
  26630. var index = 0,
  26631. length = path.length;
  26632. while (object != null && index < length) {
  26633. object = object[toKey(path[index++])];
  26634. }
  26635. return (index && index == length) ? object : undefined;
  26636. }
  26637. /**
  26638. * The base implementation of `_.isNative` without bad shim checks.
  26639. *
  26640. * @private
  26641. * @param {*} value The value to check.
  26642. * @returns {boolean} Returns `true` if `value` is a native function,
  26643. * else `false`.
  26644. */
  26645. function baseIsNative(value) {
  26646. if (!isObject(value) || isMasked(value)) {
  26647. return false;
  26648. }
  26649. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  26650. return pattern.test(toSource(value));
  26651. }
  26652. /**
  26653. * The base implementation of `_.toString` which doesn't convert nullish
  26654. * values to empty strings.
  26655. *
  26656. * @private
  26657. * @param {*} value The value to process.
  26658. * @returns {string} Returns the string.
  26659. */
  26660. function baseToString(value) {
  26661. // Exit early for strings to avoid a performance hit in some environments.
  26662. if (typeof value == 'string') {
  26663. return value;
  26664. }
  26665. if (isSymbol(value)) {
  26666. return symbolToString ? symbolToString.call(value) : '';
  26667. }
  26668. var result = (value + '');
  26669. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26670. }
  26671. /**
  26672. * Casts `value` to a path array if it's not one.
  26673. *
  26674. * @private
  26675. * @param {*} value The value to inspect.
  26676. * @returns {Array} Returns the cast property path array.
  26677. */
  26678. function castPath(value) {
  26679. return isArray(value) ? value : stringToPath(value);
  26680. }
  26681. /**
  26682. * Gets the data for `map`.
  26683. *
  26684. * @private
  26685. * @param {Object} map The map to query.
  26686. * @param {string} key The reference key.
  26687. * @returns {*} Returns the map data.
  26688. */
  26689. function getMapData(map, key) {
  26690. var data = map.__data__;
  26691. return isKeyable(key)
  26692. ? data[typeof key == 'string' ? 'string' : 'hash']
  26693. : data.map;
  26694. }
  26695. /**
  26696. * Gets the native function at `key` of `object`.
  26697. *
  26698. * @private
  26699. * @param {Object} object The object to query.
  26700. * @param {string} key The key of the method to get.
  26701. * @returns {*} Returns the function if it's native, else `undefined`.
  26702. */
  26703. function getNative(object, key) {
  26704. var value = getValue(object, key);
  26705. return baseIsNative(value) ? value : undefined;
  26706. }
  26707. /**
  26708. * Checks if `value` is a property name and not a property path.
  26709. *
  26710. * @private
  26711. * @param {*} value The value to check.
  26712. * @param {Object} [object] The object to query keys on.
  26713. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  26714. */
  26715. function isKey(value, object) {
  26716. if (isArray(value)) {
  26717. return false;
  26718. }
  26719. var type = typeof value;
  26720. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  26721. value == null || isSymbol(value)) {
  26722. return true;
  26723. }
  26724. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  26725. (object != null && value in Object(object));
  26726. }
  26727. /**
  26728. * Checks if `value` is suitable for use as unique object key.
  26729. *
  26730. * @private
  26731. * @param {*} value The value to check.
  26732. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  26733. */
  26734. function isKeyable(value) {
  26735. var type = typeof value;
  26736. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  26737. ? (value !== '__proto__')
  26738. : (value === null);
  26739. }
  26740. /**
  26741. * Checks if `func` has its source masked.
  26742. *
  26743. * @private
  26744. * @param {Function} func The function to check.
  26745. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  26746. */
  26747. function isMasked(func) {
  26748. return !!maskSrcKey && (maskSrcKey in func);
  26749. }
  26750. /**
  26751. * Converts `string` to a property path array.
  26752. *
  26753. * @private
  26754. * @param {string} string The string to convert.
  26755. * @returns {Array} Returns the property path array.
  26756. */
  26757. var stringToPath = memoize(function(string) {
  26758. string = toString(string);
  26759. var result = [];
  26760. if (reLeadingDot.test(string)) {
  26761. result.push('');
  26762. }
  26763. string.replace(rePropName, function(match, number, quote, string) {
  26764. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  26765. });
  26766. return result;
  26767. });
  26768. /**
  26769. * Converts `value` to a string key if it's not a string or symbol.
  26770. *
  26771. * @private
  26772. * @param {*} value The value to inspect.
  26773. * @returns {string|symbol} Returns the key.
  26774. */
  26775. function toKey(value) {
  26776. if (typeof value == 'string' || isSymbol(value)) {
  26777. return value;
  26778. }
  26779. var result = (value + '');
  26780. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  26781. }
  26782. /**
  26783. * Converts `func` to its source code.
  26784. *
  26785. * @private
  26786. * @param {Function} func The function to process.
  26787. * @returns {string} Returns the source code.
  26788. */
  26789. function toSource(func) {
  26790. if (func != null) {
  26791. try {
  26792. return funcToString.call(func);
  26793. } catch (e) {}
  26794. try {
  26795. return (func + '');
  26796. } catch (e) {}
  26797. }
  26798. return '';
  26799. }
  26800. /**
  26801. * Creates a function that memoizes the result of `func`. If `resolver` is
  26802. * provided, it determines the cache key for storing the result based on the
  26803. * arguments provided to the memoized function. By default, the first argument
  26804. * provided to the memoized function is used as the map cache key. The `func`
  26805. * is invoked with the `this` binding of the memoized function.
  26806. *
  26807. * **Note:** The cache is exposed as the `cache` property on the memoized
  26808. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  26809. * constructor with one whose instances implement the
  26810. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  26811. * method interface of `delete`, `get`, `has`, and `set`.
  26812. *
  26813. * @static
  26814. * @memberOf _
  26815. * @since 0.1.0
  26816. * @category Function
  26817. * @param {Function} func The function to have its output memoized.
  26818. * @param {Function} [resolver] The function to resolve the cache key.
  26819. * @returns {Function} Returns the new memoized function.
  26820. * @example
  26821. *
  26822. * var object = { 'a': 1, 'b': 2 };
  26823. * var other = { 'c': 3, 'd': 4 };
  26824. *
  26825. * var values = _.memoize(_.values);
  26826. * values(object);
  26827. * // => [1, 2]
  26828. *
  26829. * values(other);
  26830. * // => [3, 4]
  26831. *
  26832. * object.a = 2;
  26833. * values(object);
  26834. * // => [1, 2]
  26835. *
  26836. * // Modify the result cache.
  26837. * values.cache.set(object, ['a', 'b']);
  26838. * values(object);
  26839. * // => ['a', 'b']
  26840. *
  26841. * // Replace `_.memoize.Cache`.
  26842. * _.memoize.Cache = WeakMap;
  26843. */
  26844. function memoize(func, resolver) {
  26845. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  26846. throw new TypeError(FUNC_ERROR_TEXT);
  26847. }
  26848. var memoized = function() {
  26849. var args = arguments,
  26850. key = resolver ? resolver.apply(this, args) : args[0],
  26851. cache = memoized.cache;
  26852. if (cache.has(key)) {
  26853. return cache.get(key);
  26854. }
  26855. var result = func.apply(this, args);
  26856. memoized.cache = cache.set(key, result);
  26857. return result;
  26858. };
  26859. memoized.cache = new (memoize.Cache || MapCache);
  26860. return memoized;
  26861. }
  26862. // Assign cache to `_.memoize`.
  26863. memoize.Cache = MapCache;
  26864. /**
  26865. * Performs a
  26866. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26867. * comparison between two values to determine if they are equivalent.
  26868. *
  26869. * @static
  26870. * @memberOf _
  26871. * @since 4.0.0
  26872. * @category Lang
  26873. * @param {*} value The value to compare.
  26874. * @param {*} other The other value to compare.
  26875. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26876. * @example
  26877. *
  26878. * var object = { 'a': 1 };
  26879. * var other = { 'a': 1 };
  26880. *
  26881. * _.eq(object, object);
  26882. * // => true
  26883. *
  26884. * _.eq(object, other);
  26885. * // => false
  26886. *
  26887. * _.eq('a', 'a');
  26888. * // => true
  26889. *
  26890. * _.eq('a', Object('a'));
  26891. * // => false
  26892. *
  26893. * _.eq(NaN, NaN);
  26894. * // => true
  26895. */
  26896. function eq(value, other) {
  26897. return value === other || (value !== value && other !== other);
  26898. }
  26899. /**
  26900. * Checks if `value` is classified as an `Array` object.
  26901. *
  26902. * @static
  26903. * @memberOf _
  26904. * @since 0.1.0
  26905. * @category Lang
  26906. * @param {*} value The value to check.
  26907. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  26908. * @example
  26909. *
  26910. * _.isArray([1, 2, 3]);
  26911. * // => true
  26912. *
  26913. * _.isArray(document.body.children);
  26914. * // => false
  26915. *
  26916. * _.isArray('abc');
  26917. * // => false
  26918. *
  26919. * _.isArray(_.noop);
  26920. * // => false
  26921. */
  26922. var isArray = Array.isArray;
  26923. /**
  26924. * Checks if `value` is classified as a `Function` object.
  26925. *
  26926. * @static
  26927. * @memberOf _
  26928. * @since 0.1.0
  26929. * @category Lang
  26930. * @param {*} value The value to check.
  26931. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  26932. * @example
  26933. *
  26934. * _.isFunction(_);
  26935. * // => true
  26936. *
  26937. * _.isFunction(/abc/);
  26938. * // => false
  26939. */
  26940. function isFunction(value) {
  26941. // The use of `Object#toString` avoids issues with the `typeof` operator
  26942. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  26943. var tag = isObject(value) ? objectToString.call(value) : '';
  26944. return tag == funcTag || tag == genTag;
  26945. }
  26946. /**
  26947. * Checks if `value` is the
  26948. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  26949. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  26950. *
  26951. * @static
  26952. * @memberOf _
  26953. * @since 0.1.0
  26954. * @category Lang
  26955. * @param {*} value The value to check.
  26956. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  26957. * @example
  26958. *
  26959. * _.isObject({});
  26960. * // => true
  26961. *
  26962. * _.isObject([1, 2, 3]);
  26963. * // => true
  26964. *
  26965. * _.isObject(_.noop);
  26966. * // => true
  26967. *
  26968. * _.isObject(null);
  26969. * // => false
  26970. */
  26971. function isObject(value) {
  26972. var type = typeof value;
  26973. return !!value && (type == 'object' || type == 'function');
  26974. }
  26975. /**
  26976. * Checks if `value` is object-like. A value is object-like if it's not `null`
  26977. * and has a `typeof` result of "object".
  26978. *
  26979. * @static
  26980. * @memberOf _
  26981. * @since 4.0.0
  26982. * @category Lang
  26983. * @param {*} value The value to check.
  26984. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  26985. * @example
  26986. *
  26987. * _.isObjectLike({});
  26988. * // => true
  26989. *
  26990. * _.isObjectLike([1, 2, 3]);
  26991. * // => true
  26992. *
  26993. * _.isObjectLike(_.noop);
  26994. * // => false
  26995. *
  26996. * _.isObjectLike(null);
  26997. * // => false
  26998. */
  26999. function isObjectLike(value) {
  27000. return !!value && typeof value == 'object';
  27001. }
  27002. /**
  27003. * Checks if `value` is classified as a `Symbol` primitive or object.
  27004. *
  27005. * @static
  27006. * @memberOf _
  27007. * @since 4.0.0
  27008. * @category Lang
  27009. * @param {*} value The value to check.
  27010. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  27011. * @example
  27012. *
  27013. * _.isSymbol(Symbol.iterator);
  27014. * // => true
  27015. *
  27016. * _.isSymbol('abc');
  27017. * // => false
  27018. */
  27019. function isSymbol(value) {
  27020. return typeof value == 'symbol' ||
  27021. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  27022. }
  27023. /**
  27024. * Converts `value` to a string. An empty string is returned for `null`
  27025. * and `undefined` values. The sign of `-0` is preserved.
  27026. *
  27027. * @static
  27028. * @memberOf _
  27029. * @since 4.0.0
  27030. * @category Lang
  27031. * @param {*} value The value to process.
  27032. * @returns {string} Returns the string.
  27033. * @example
  27034. *
  27035. * _.toString(null);
  27036. * // => ''
  27037. *
  27038. * _.toString(-0);
  27039. * // => '-0'
  27040. *
  27041. * _.toString([1, 2, 3]);
  27042. * // => '1,2,3'
  27043. */
  27044. function toString(value) {
  27045. return value == null ? '' : baseToString(value);
  27046. }
  27047. /**
  27048. * Gets the value at `path` of `object`. If the resolved value is
  27049. * `undefined`, the `defaultValue` is returned in its place.
  27050. *
  27051. * @static
  27052. * @memberOf _
  27053. * @since 3.7.0
  27054. * @category Object
  27055. * @param {Object} object The object to query.
  27056. * @param {Array|string} path The path of the property to get.
  27057. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  27058. * @returns {*} Returns the resolved value.
  27059. * @example
  27060. *
  27061. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  27062. *
  27063. * _.get(object, 'a[0].b.c');
  27064. * // => 3
  27065. *
  27066. * _.get(object, ['a', '0', 'b', 'c']);
  27067. * // => 3
  27068. *
  27069. * _.get(object, 'a.b.c', 'default');
  27070. * // => 'default'
  27071. */
  27072. function get(object, path, defaultValue) {
  27073. var result = object == null ? undefined : baseGet(object, path);
  27074. return result === undefined ? defaultValue : result;
  27075. }
  27076. module.exports = get;
  27077. /***/ }),
  27078. /***/ 855:
  27079. /***/ (function(module, __unusedexports, __webpack_require__) {
  27080. module.exports = registerPlugin;
  27081. const factory = __webpack_require__(47);
  27082. function registerPlugin(plugins, pluginFunction) {
  27083. return factory(
  27084. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  27085. );
  27086. }
  27087. /***/ }),
  27088. /***/ 856:
  27089. /***/ (function(module, __unusedexports, __webpack_require__) {
  27090. module.exports = __webpack_require__(141);
  27091. /***/ }),
  27092. /***/ 863:
  27093. /***/ (function(module, __unusedexports, __webpack_require__) {
  27094. module.exports = authenticationBeforeRequest;
  27095. const btoa = __webpack_require__(675);
  27096. const withAuthorizationPrefix = __webpack_require__(143);
  27097. function authenticationBeforeRequest(state, options) {
  27098. if (typeof state.auth === "string") {
  27099. options.headers.authorization = withAuthorizationPrefix(state.auth);
  27100. return;
  27101. }
  27102. if (state.auth.username) {
  27103. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  27104. options.headers.authorization = `Basic ${hash}`;
  27105. if (state.otp) {
  27106. options.headers["x-github-otp"] = state.otp;
  27107. }
  27108. return;
  27109. }
  27110. if (state.auth.clientId) {
  27111. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  27112. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  27113. // URL though: `/applications/:client_id/tokens/:access_token`.
  27114. //
  27115. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  27116. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  27117. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  27118. //
  27119. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  27120. // as well as "/applications/123/tokens/token456"
  27121. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  27122. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  27123. options.headers.authorization = `Basic ${hash}`;
  27124. return;
  27125. }
  27126. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  27127. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  27128. return;
  27129. }
  27130. return Promise.resolve()
  27131. .then(() => {
  27132. return state.auth();
  27133. })
  27134. .then(authorization => {
  27135. options.headers.authorization = withAuthorizationPrefix(authorization);
  27136. });
  27137. }
  27138. /***/ }),
  27139. /***/ 866:
  27140. /***/ (function(module, __unusedexports, __webpack_require__) {
  27141. "use strict";
  27142. var shebangRegex = __webpack_require__(816);
  27143. module.exports = function (str) {
  27144. var match = str.match(shebangRegex);
  27145. if (!match) {
  27146. return null;
  27147. }
  27148. var arr = match[0].replace(/#! ?/, '').split(' ');
  27149. var bin = arr[0].split('/').pop();
  27150. var arg = arr[1];
  27151. return (bin === 'env' ?
  27152. arg :
  27153. bin + (arg ? ' ' + arg : '')
  27154. );
  27155. };
  27156. /***/ }),
  27157. /***/ 874:
  27158. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  27159. "use strict";
  27160. // Copyright (c) Microsoft. All rights reserved.
  27161. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  27162. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  27163. return new (P || (P = Promise))(function (resolve, reject) {
  27164. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  27165. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  27166. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  27167. step((generator = generator.apply(thisArg, _arguments || [])).next());
  27168. });
  27169. };
  27170. Object.defineProperty(exports, "__esModule", { value: true });
  27171. const url = __webpack_require__(835);
  27172. const http = __webpack_require__(605);
  27173. const https = __webpack_require__(34);
  27174. let fs;
  27175. let tunnel;
  27176. var HttpCodes;
  27177. (function (HttpCodes) {
  27178. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  27179. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  27180. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  27181. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  27182. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  27183. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  27184. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  27185. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  27186. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  27187. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  27188. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  27189. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  27190. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  27191. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  27192. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  27193. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  27194. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  27195. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  27196. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  27197. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  27198. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  27199. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  27200. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  27201. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  27202. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  27203. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  27204. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  27205. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  27206. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  27207. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  27208. const ExponentialBackoffCeiling = 10;
  27209. const ExponentialBackoffTimeSlice = 5;
  27210. class HttpClientResponse {
  27211. constructor(message) {
  27212. this.message = message;
  27213. }
  27214. readBody() {
  27215. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  27216. let output = '';
  27217. this.message.on('data', (chunk) => {
  27218. output += chunk;
  27219. });
  27220. this.message.on('end', () => {
  27221. resolve(output);
  27222. });
  27223. }));
  27224. }
  27225. }
  27226. exports.HttpClientResponse = HttpClientResponse;
  27227. function isHttps(requestUrl) {
  27228. let parsedUrl = url.parse(requestUrl);
  27229. return parsedUrl.protocol === 'https:';
  27230. }
  27231. exports.isHttps = isHttps;
  27232. var EnvironmentVariables;
  27233. (function (EnvironmentVariables) {
  27234. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  27235. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  27236. })(EnvironmentVariables || (EnvironmentVariables = {}));
  27237. class HttpClient {
  27238. constructor(userAgent, handlers, requestOptions) {
  27239. this._ignoreSslError = false;
  27240. this._allowRedirects = true;
  27241. this._maxRedirects = 50;
  27242. this._allowRetries = false;
  27243. this._maxRetries = 1;
  27244. this._keepAlive = false;
  27245. this._disposed = false;
  27246. this.userAgent = userAgent;
  27247. this.handlers = handlers || [];
  27248. this.requestOptions = requestOptions;
  27249. if (requestOptions) {
  27250. if (requestOptions.ignoreSslError != null) {
  27251. this._ignoreSslError = requestOptions.ignoreSslError;
  27252. }
  27253. this._socketTimeout = requestOptions.socketTimeout;
  27254. this._httpProxy = requestOptions.proxy;
  27255. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  27256. this._httpProxyBypassHosts = [];
  27257. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  27258. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  27259. });
  27260. }
  27261. this._certConfig = requestOptions.cert;
  27262. if (this._certConfig) {
  27263. // If using cert, need fs
  27264. fs = __webpack_require__(747);
  27265. // cache the cert content into memory, so we don't have to read it from disk every time
  27266. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  27267. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  27268. }
  27269. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  27270. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  27271. }
  27272. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  27273. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  27274. }
  27275. }
  27276. if (requestOptions.allowRedirects != null) {
  27277. this._allowRedirects = requestOptions.allowRedirects;
  27278. }
  27279. if (requestOptions.maxRedirects != null) {
  27280. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  27281. }
  27282. if (requestOptions.keepAlive != null) {
  27283. this._keepAlive = requestOptions.keepAlive;
  27284. }
  27285. if (requestOptions.allowRetries != null) {
  27286. this._allowRetries = requestOptions.allowRetries;
  27287. }
  27288. if (requestOptions.maxRetries != null) {
  27289. this._maxRetries = requestOptions.maxRetries;
  27290. }
  27291. }
  27292. }
  27293. options(requestUrl, additionalHeaders) {
  27294. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  27295. }
  27296. get(requestUrl, additionalHeaders) {
  27297. return this.request('GET', requestUrl, null, additionalHeaders || {});
  27298. }
  27299. del(requestUrl, additionalHeaders) {
  27300. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  27301. }
  27302. post(requestUrl, data, additionalHeaders) {
  27303. return this.request('POST', requestUrl, data, additionalHeaders || {});
  27304. }
  27305. patch(requestUrl, data, additionalHeaders) {
  27306. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  27307. }
  27308. put(requestUrl, data, additionalHeaders) {
  27309. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  27310. }
  27311. head(requestUrl, additionalHeaders) {
  27312. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  27313. }
  27314. sendStream(verb, requestUrl, stream, additionalHeaders) {
  27315. return this.request(verb, requestUrl, stream, additionalHeaders);
  27316. }
  27317. /**
  27318. * Makes a raw http request.
  27319. * All other methods such as get, post, patch, and request ultimately call this.
  27320. * Prefer get, del, post and patch
  27321. */
  27322. request(verb, requestUrl, data, headers) {
  27323. return __awaiter(this, void 0, void 0, function* () {
  27324. if (this._disposed) {
  27325. throw new Error("Client has already been disposed.");
  27326. }
  27327. let info = this._prepareRequest(verb, requestUrl, headers);
  27328. // Only perform retries on reads since writes may not be idempotent.
  27329. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  27330. let numTries = 0;
  27331. let response;
  27332. while (numTries < maxTries) {
  27333. response = yield this.requestRaw(info, data);
  27334. // Check if it's an authentication challenge
  27335. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  27336. let authenticationHandler;
  27337. for (let i = 0; i < this.handlers.length; i++) {
  27338. if (this.handlers[i].canHandleAuthentication(response)) {
  27339. authenticationHandler = this.handlers[i];
  27340. break;
  27341. }
  27342. }
  27343. if (authenticationHandler) {
  27344. return authenticationHandler.handleAuthentication(this, info, data);
  27345. }
  27346. else {
  27347. // We have received an unauthorized response but have no handlers to handle it.
  27348. // Let the response return to the caller.
  27349. return response;
  27350. }
  27351. }
  27352. let redirectsRemaining = this._maxRedirects;
  27353. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  27354. && this._allowRedirects
  27355. && redirectsRemaining > 0) {
  27356. const redirectUrl = response.message.headers["location"];
  27357. if (!redirectUrl) {
  27358. // if there's no location to redirect to, we won't
  27359. break;
  27360. }
  27361. // we need to finish reading the response before reassigning response
  27362. // which will leak the open socket.
  27363. yield response.readBody();
  27364. // let's make the request with the new redirectUrl
  27365. info = this._prepareRequest(verb, redirectUrl, headers);
  27366. response = yield this.requestRaw(info, data);
  27367. redirectsRemaining--;
  27368. }
  27369. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  27370. // If not a retry code, return immediately instead of retrying
  27371. return response;
  27372. }
  27373. numTries += 1;
  27374. if (numTries < maxTries) {
  27375. yield response.readBody();
  27376. yield this._performExponentialBackoff(numTries);
  27377. }
  27378. }
  27379. return response;
  27380. });
  27381. }
  27382. /**
  27383. * Needs to be called if keepAlive is set to true in request options.
  27384. */
  27385. dispose() {
  27386. if (this._agent) {
  27387. this._agent.destroy();
  27388. }
  27389. this._disposed = true;
  27390. }
  27391. /**
  27392. * Raw request.
  27393. * @param info
  27394. * @param data
  27395. */
  27396. requestRaw(info, data) {
  27397. return new Promise((resolve, reject) => {
  27398. let callbackForResult = function (err, res) {
  27399. if (err) {
  27400. reject(err);
  27401. }
  27402. resolve(res);
  27403. };
  27404. this.requestRawWithCallback(info, data, callbackForResult);
  27405. });
  27406. }
  27407. /**
  27408. * Raw request with callback.
  27409. * @param info
  27410. * @param data
  27411. * @param onResult
  27412. */
  27413. requestRawWithCallback(info, data, onResult) {
  27414. let socket;
  27415. let isDataString = typeof (data) === 'string';
  27416. if (typeof (data) === 'string') {
  27417. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  27418. }
  27419. let callbackCalled = false;
  27420. let handleResult = (err, res) => {
  27421. if (!callbackCalled) {
  27422. callbackCalled = true;
  27423. onResult(err, res);
  27424. }
  27425. };
  27426. let req = info.httpModule.request(info.options, (msg) => {
  27427. let res = new HttpClientResponse(msg);
  27428. handleResult(null, res);
  27429. });
  27430. req.on('socket', (sock) => {
  27431. socket = sock;
  27432. });
  27433. // If we ever get disconnected, we want the socket to timeout eventually
  27434. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  27435. if (socket) {
  27436. socket.end();
  27437. }
  27438. handleResult(new Error('Request timeout: ' + info.options.path), null);
  27439. });
  27440. req.on('error', function (err) {
  27441. // err has statusCode property
  27442. // res should have headers
  27443. handleResult(err, null);
  27444. });
  27445. if (data && typeof (data) === 'string') {
  27446. req.write(data, 'utf8');
  27447. }
  27448. if (data && typeof (data) !== 'string') {
  27449. data.on('close', function () {
  27450. req.end();
  27451. });
  27452. data.pipe(req);
  27453. }
  27454. else {
  27455. req.end();
  27456. }
  27457. }
  27458. _prepareRequest(method, requestUrl, headers) {
  27459. const info = {};
  27460. info.parsedUrl = url.parse(requestUrl);
  27461. const usingSsl = info.parsedUrl.protocol === 'https:';
  27462. info.httpModule = usingSsl ? https : http;
  27463. const defaultPort = usingSsl ? 443 : 80;
  27464. info.options = {};
  27465. info.options.host = info.parsedUrl.hostname;
  27466. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  27467. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  27468. info.options.method = method;
  27469. info.options.headers = this._mergeHeaders(headers);
  27470. info.options.headers["user-agent"] = this.userAgent;
  27471. info.options.agent = this._getAgent(requestUrl);
  27472. // gives handlers an opportunity to participate
  27473. if (this.handlers && !this._isPresigned(requestUrl)) {
  27474. this.handlers.forEach((handler) => {
  27475. handler.prepareRequest(info.options);
  27476. });
  27477. }
  27478. return info;
  27479. }
  27480. _isPresigned(requestUrl) {
  27481. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  27482. const patterns = this.requestOptions.presignedUrlPatterns;
  27483. for (let i = 0; i < patterns.length; i++) {
  27484. if (requestUrl.match(patterns[i])) {
  27485. return true;
  27486. }
  27487. }
  27488. }
  27489. return false;
  27490. }
  27491. _mergeHeaders(headers) {
  27492. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  27493. if (this.requestOptions && this.requestOptions.headers) {
  27494. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  27495. }
  27496. return lowercaseKeys(headers || {});
  27497. }
  27498. _getAgent(requestUrl) {
  27499. let agent;
  27500. let proxy = this._getProxy(requestUrl);
  27501. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  27502. if (this._keepAlive && useProxy) {
  27503. agent = this._proxyAgent;
  27504. }
  27505. if (this._keepAlive && !useProxy) {
  27506. agent = this._agent;
  27507. }
  27508. // if agent is already assigned use that agent.
  27509. if (!!agent) {
  27510. return agent;
  27511. }
  27512. let parsedUrl = url.parse(requestUrl);
  27513. const usingSsl = parsedUrl.protocol === 'https:';
  27514. let maxSockets = 100;
  27515. if (!!this.requestOptions) {
  27516. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  27517. }
  27518. if (useProxy) {
  27519. // If using proxy, need tunnel
  27520. if (!tunnel) {
  27521. tunnel = __webpack_require__(856);
  27522. }
  27523. const agentOptions = {
  27524. maxSockets: maxSockets,
  27525. keepAlive: this._keepAlive,
  27526. proxy: {
  27527. proxyAuth: proxy.proxyAuth,
  27528. host: proxy.proxyUrl.hostname,
  27529. port: proxy.proxyUrl.port
  27530. },
  27531. };
  27532. let tunnelAgent;
  27533. const overHttps = proxy.proxyUrl.protocol === 'https:';
  27534. if (usingSsl) {
  27535. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  27536. }
  27537. else {
  27538. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  27539. }
  27540. agent = tunnelAgent(agentOptions);
  27541. this._proxyAgent = agent;
  27542. }
  27543. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  27544. if (this._keepAlive && !agent) {
  27545. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  27546. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  27547. this._agent = agent;
  27548. }
  27549. // if not using private agent and tunnel agent isn't setup then use global agent
  27550. if (!agent) {
  27551. agent = usingSsl ? https.globalAgent : http.globalAgent;
  27552. }
  27553. if (usingSsl && this._ignoreSslError) {
  27554. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  27555. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  27556. // we have to cast it to any and change it directly
  27557. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  27558. }
  27559. if (usingSsl && this._certConfig) {
  27560. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  27561. }
  27562. return agent;
  27563. }
  27564. _getProxy(requestUrl) {
  27565. const parsedUrl = url.parse(requestUrl);
  27566. let usingSsl = parsedUrl.protocol === 'https:';
  27567. let proxyConfig = this._httpProxy;
  27568. // fallback to http_proxy and https_proxy env
  27569. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  27570. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  27571. if (!proxyConfig) {
  27572. if (https_proxy && usingSsl) {
  27573. proxyConfig = {
  27574. proxyUrl: https_proxy
  27575. };
  27576. }
  27577. else if (http_proxy) {
  27578. proxyConfig = {
  27579. proxyUrl: http_proxy
  27580. };
  27581. }
  27582. }
  27583. let proxyUrl;
  27584. let proxyAuth;
  27585. if (proxyConfig) {
  27586. if (proxyConfig.proxyUrl.length > 0) {
  27587. proxyUrl = url.parse(proxyConfig.proxyUrl);
  27588. }
  27589. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  27590. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  27591. }
  27592. }
  27593. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  27594. }
  27595. _isBypassProxy(requestUrl) {
  27596. if (!this._httpProxyBypassHosts) {
  27597. return false;
  27598. }
  27599. let bypass = false;
  27600. this._httpProxyBypassHosts.forEach(bypassHost => {
  27601. if (bypassHost.test(requestUrl)) {
  27602. bypass = true;
  27603. }
  27604. });
  27605. return bypass;
  27606. }
  27607. _performExponentialBackoff(retryNumber) {
  27608. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  27609. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  27610. return new Promise(resolve => setTimeout(() => resolve(), ms));
  27611. }
  27612. }
  27613. exports.HttpClient = HttpClient;
  27614. /***/ }),
  27615. /***/ 881:
  27616. /***/ (function(module) {
  27617. "use strict";
  27618. const isWin = process.platform === 'win32';
  27619. function notFoundError(original, syscall) {
  27620. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  27621. code: 'ENOENT',
  27622. errno: 'ENOENT',
  27623. syscall: `${syscall} ${original.command}`,
  27624. path: original.command,
  27625. spawnargs: original.args,
  27626. });
  27627. }
  27628. function hookChildProcess(cp, parsed) {
  27629. if (!isWin) {
  27630. return;
  27631. }
  27632. const originalEmit = cp.emit;
  27633. cp.emit = function (name, arg1) {
  27634. // If emitting "exit" event and exit code is 1, we need to check if
  27635. // the command exists and emit an "error" instead
  27636. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  27637. if (name === 'exit') {
  27638. const err = verifyENOENT(arg1, parsed, 'spawn');
  27639. if (err) {
  27640. return originalEmit.call(cp, 'error', err);
  27641. }
  27642. }
  27643. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  27644. };
  27645. }
  27646. function verifyENOENT(status, parsed) {
  27647. if (isWin && status === 1 && !parsed.file) {
  27648. return notFoundError(parsed.original, 'spawn');
  27649. }
  27650. return null;
  27651. }
  27652. function verifyENOENTSync(status, parsed) {
  27653. if (isWin && status === 1 && !parsed.file) {
  27654. return notFoundError(parsed.original, 'spawnSync');
  27655. }
  27656. return null;
  27657. }
  27658. module.exports = {
  27659. hookChildProcess,
  27660. verifyENOENT,
  27661. verifyENOENTSync,
  27662. notFoundError,
  27663. };
  27664. /***/ }),
  27665. /***/ 883:
  27666. /***/ (function(module) {
  27667. /**
  27668. * lodash (Custom Build) <https://lodash.com/>
  27669. * Build: `lodash modularize exports="npm" -o ./`
  27670. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  27671. * Released under MIT license <https://lodash.com/license>
  27672. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  27673. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  27674. */
  27675. /** Used as the `TypeError` message for "Functions" methods. */
  27676. var FUNC_ERROR_TEXT = 'Expected a function';
  27677. /** Used to stand-in for `undefined` hash values. */
  27678. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  27679. /** Used as references for various `Number` constants. */
  27680. var INFINITY = 1 / 0,
  27681. MAX_SAFE_INTEGER = 9007199254740991;
  27682. /** `Object#toString` result references. */
  27683. var funcTag = '[object Function]',
  27684. genTag = '[object GeneratorFunction]',
  27685. symbolTag = '[object Symbol]';
  27686. /** Used to match property names within property paths. */
  27687. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  27688. reIsPlainProp = /^\w*$/,
  27689. reLeadingDot = /^\./,
  27690. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  27691. /**
  27692. * Used to match `RegExp`
  27693. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  27694. */
  27695. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  27696. /** Used to match backslashes in property paths. */
  27697. var reEscapeChar = /\\(\\)?/g;
  27698. /** Used to detect host constructors (Safari). */
  27699. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  27700. /** Used to detect unsigned integer values. */
  27701. var reIsUint = /^(?:0|[1-9]\d*)$/;
  27702. /** Detect free variable `global` from Node.js. */
  27703. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  27704. /** Detect free variable `self`. */
  27705. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  27706. /** Used as a reference to the global object. */
  27707. var root = freeGlobal || freeSelf || Function('return this')();
  27708. /**
  27709. * Gets the value at `key` of `object`.
  27710. *
  27711. * @private
  27712. * @param {Object} [object] The object to query.
  27713. * @param {string} key The key of the property to get.
  27714. * @returns {*} Returns the property value.
  27715. */
  27716. function getValue(object, key) {
  27717. return object == null ? undefined : object[key];
  27718. }
  27719. /**
  27720. * Checks if `value` is a host object in IE < 9.
  27721. *
  27722. * @private
  27723. * @param {*} value The value to check.
  27724. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  27725. */
  27726. function isHostObject(value) {
  27727. // Many host objects are `Object` objects that can coerce to strings
  27728. // despite having improperly defined `toString` methods.
  27729. var result = false;
  27730. if (value != null && typeof value.toString != 'function') {
  27731. try {
  27732. result = !!(value + '');
  27733. } catch (e) {}
  27734. }
  27735. return result;
  27736. }
  27737. /** Used for built-in method references. */
  27738. var arrayProto = Array.prototype,
  27739. funcProto = Function.prototype,
  27740. objectProto = Object.prototype;
  27741. /** Used to detect overreaching core-js shims. */
  27742. var coreJsData = root['__core-js_shared__'];
  27743. /** Used to detect methods masquerading as native. */
  27744. var maskSrcKey = (function() {
  27745. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  27746. return uid ? ('Symbol(src)_1.' + uid) : '';
  27747. }());
  27748. /** Used to resolve the decompiled source of functions. */
  27749. var funcToString = funcProto.toString;
  27750. /** Used to check objects for own properties. */
  27751. var hasOwnProperty = objectProto.hasOwnProperty;
  27752. /**
  27753. * Used to resolve the
  27754. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  27755. * of values.
  27756. */
  27757. var objectToString = objectProto.toString;
  27758. /** Used to detect if a method is native. */
  27759. var reIsNative = RegExp('^' +
  27760. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  27761. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  27762. );
  27763. /** Built-in value references. */
  27764. var Symbol = root.Symbol,
  27765. splice = arrayProto.splice;
  27766. /* Built-in method references that are verified to be native. */
  27767. var Map = getNative(root, 'Map'),
  27768. nativeCreate = getNative(Object, 'create');
  27769. /** Used to convert symbols to primitives and strings. */
  27770. var symbolProto = Symbol ? Symbol.prototype : undefined,
  27771. symbolToString = symbolProto ? symbolProto.toString : undefined;
  27772. /**
  27773. * Creates a hash object.
  27774. *
  27775. * @private
  27776. * @constructor
  27777. * @param {Array} [entries] The key-value pairs to cache.
  27778. */
  27779. function Hash(entries) {
  27780. var index = -1,
  27781. length = entries ? entries.length : 0;
  27782. this.clear();
  27783. while (++index < length) {
  27784. var entry = entries[index];
  27785. this.set(entry[0], entry[1]);
  27786. }
  27787. }
  27788. /**
  27789. * Removes all key-value entries from the hash.
  27790. *
  27791. * @private
  27792. * @name clear
  27793. * @memberOf Hash
  27794. */
  27795. function hashClear() {
  27796. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  27797. }
  27798. /**
  27799. * Removes `key` and its value from the hash.
  27800. *
  27801. * @private
  27802. * @name delete
  27803. * @memberOf Hash
  27804. * @param {Object} hash The hash to modify.
  27805. * @param {string} key The key of the value to remove.
  27806. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27807. */
  27808. function hashDelete(key) {
  27809. return this.has(key) && delete this.__data__[key];
  27810. }
  27811. /**
  27812. * Gets the hash value for `key`.
  27813. *
  27814. * @private
  27815. * @name get
  27816. * @memberOf Hash
  27817. * @param {string} key The key of the value to get.
  27818. * @returns {*} Returns the entry value.
  27819. */
  27820. function hashGet(key) {
  27821. var data = this.__data__;
  27822. if (nativeCreate) {
  27823. var result = data[key];
  27824. return result === HASH_UNDEFINED ? undefined : result;
  27825. }
  27826. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  27827. }
  27828. /**
  27829. * Checks if a hash value for `key` exists.
  27830. *
  27831. * @private
  27832. * @name has
  27833. * @memberOf Hash
  27834. * @param {string} key The key of the entry to check.
  27835. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27836. */
  27837. function hashHas(key) {
  27838. var data = this.__data__;
  27839. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  27840. }
  27841. /**
  27842. * Sets the hash `key` to `value`.
  27843. *
  27844. * @private
  27845. * @name set
  27846. * @memberOf Hash
  27847. * @param {string} key The key of the value to set.
  27848. * @param {*} value The value to set.
  27849. * @returns {Object} Returns the hash instance.
  27850. */
  27851. function hashSet(key, value) {
  27852. var data = this.__data__;
  27853. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  27854. return this;
  27855. }
  27856. // Add methods to `Hash`.
  27857. Hash.prototype.clear = hashClear;
  27858. Hash.prototype['delete'] = hashDelete;
  27859. Hash.prototype.get = hashGet;
  27860. Hash.prototype.has = hashHas;
  27861. Hash.prototype.set = hashSet;
  27862. /**
  27863. * Creates an list cache object.
  27864. *
  27865. * @private
  27866. * @constructor
  27867. * @param {Array} [entries] The key-value pairs to cache.
  27868. */
  27869. function ListCache(entries) {
  27870. var index = -1,
  27871. length = entries ? entries.length : 0;
  27872. this.clear();
  27873. while (++index < length) {
  27874. var entry = entries[index];
  27875. this.set(entry[0], entry[1]);
  27876. }
  27877. }
  27878. /**
  27879. * Removes all key-value entries from the list cache.
  27880. *
  27881. * @private
  27882. * @name clear
  27883. * @memberOf ListCache
  27884. */
  27885. function listCacheClear() {
  27886. this.__data__ = [];
  27887. }
  27888. /**
  27889. * Removes `key` and its value from the list cache.
  27890. *
  27891. * @private
  27892. * @name delete
  27893. * @memberOf ListCache
  27894. * @param {string} key The key of the value to remove.
  27895. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  27896. */
  27897. function listCacheDelete(key) {
  27898. var data = this.__data__,
  27899. index = assocIndexOf(data, key);
  27900. if (index < 0) {
  27901. return false;
  27902. }
  27903. var lastIndex = data.length - 1;
  27904. if (index == lastIndex) {
  27905. data.pop();
  27906. } else {
  27907. splice.call(data, index, 1);
  27908. }
  27909. return true;
  27910. }
  27911. /**
  27912. * Gets the list cache value for `key`.
  27913. *
  27914. * @private
  27915. * @name get
  27916. * @memberOf ListCache
  27917. * @param {string} key The key of the value to get.
  27918. * @returns {*} Returns the entry value.
  27919. */
  27920. function listCacheGet(key) {
  27921. var data = this.__data__,
  27922. index = assocIndexOf(data, key);
  27923. return index < 0 ? undefined : data[index][1];
  27924. }
  27925. /**
  27926. * Checks if a list cache value for `key` exists.
  27927. *
  27928. * @private
  27929. * @name has
  27930. * @memberOf ListCache
  27931. * @param {string} key The key of the entry to check.
  27932. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  27933. */
  27934. function listCacheHas(key) {
  27935. return assocIndexOf(this.__data__, key) > -1;
  27936. }
  27937. /**
  27938. * Sets the list cache `key` to `value`.
  27939. *
  27940. * @private
  27941. * @name set
  27942. * @memberOf ListCache
  27943. * @param {string} key The key of the value to set.
  27944. * @param {*} value The value to set.
  27945. * @returns {Object} Returns the list cache instance.
  27946. */
  27947. function listCacheSet(key, value) {
  27948. var data = this.__data__,
  27949. index = assocIndexOf(data, key);
  27950. if (index < 0) {
  27951. data.push([key, value]);
  27952. } else {
  27953. data[index][1] = value;
  27954. }
  27955. return this;
  27956. }
  27957. // Add methods to `ListCache`.
  27958. ListCache.prototype.clear = listCacheClear;
  27959. ListCache.prototype['delete'] = listCacheDelete;
  27960. ListCache.prototype.get = listCacheGet;
  27961. ListCache.prototype.has = listCacheHas;
  27962. ListCache.prototype.set = listCacheSet;
  27963. /**
  27964. * Creates a map cache object to store key-value pairs.
  27965. *
  27966. * @private
  27967. * @constructor
  27968. * @param {Array} [entries] The key-value pairs to cache.
  27969. */
  27970. function MapCache(entries) {
  27971. var index = -1,
  27972. length = entries ? entries.length : 0;
  27973. this.clear();
  27974. while (++index < length) {
  27975. var entry = entries[index];
  27976. this.set(entry[0], entry[1]);
  27977. }
  27978. }
  27979. /**
  27980. * Removes all key-value entries from the map.
  27981. *
  27982. * @private
  27983. * @name clear
  27984. * @memberOf MapCache
  27985. */
  27986. function mapCacheClear() {
  27987. this.__data__ = {
  27988. 'hash': new Hash,
  27989. 'map': new (Map || ListCache),
  27990. 'string': new Hash
  27991. };
  27992. }
  27993. /**
  27994. * Removes `key` and its value from the map.
  27995. *
  27996. * @private
  27997. * @name delete
  27998. * @memberOf MapCache
  27999. * @param {string} key The key of the value to remove.
  28000. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  28001. */
  28002. function mapCacheDelete(key) {
  28003. return getMapData(this, key)['delete'](key);
  28004. }
  28005. /**
  28006. * Gets the map value for `key`.
  28007. *
  28008. * @private
  28009. * @name get
  28010. * @memberOf MapCache
  28011. * @param {string} key The key of the value to get.
  28012. * @returns {*} Returns the entry value.
  28013. */
  28014. function mapCacheGet(key) {
  28015. return getMapData(this, key).get(key);
  28016. }
  28017. /**
  28018. * Checks if a map value for `key` exists.
  28019. *
  28020. * @private
  28021. * @name has
  28022. * @memberOf MapCache
  28023. * @param {string} key The key of the entry to check.
  28024. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  28025. */
  28026. function mapCacheHas(key) {
  28027. return getMapData(this, key).has(key);
  28028. }
  28029. /**
  28030. * Sets the map `key` to `value`.
  28031. *
  28032. * @private
  28033. * @name set
  28034. * @memberOf MapCache
  28035. * @param {string} key The key of the value to set.
  28036. * @param {*} value The value to set.
  28037. * @returns {Object} Returns the map cache instance.
  28038. */
  28039. function mapCacheSet(key, value) {
  28040. getMapData(this, key).set(key, value);
  28041. return this;
  28042. }
  28043. // Add methods to `MapCache`.
  28044. MapCache.prototype.clear = mapCacheClear;
  28045. MapCache.prototype['delete'] = mapCacheDelete;
  28046. MapCache.prototype.get = mapCacheGet;
  28047. MapCache.prototype.has = mapCacheHas;
  28048. MapCache.prototype.set = mapCacheSet;
  28049. /**
  28050. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  28051. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28052. * for equality comparisons.
  28053. *
  28054. * @private
  28055. * @param {Object} object The object to modify.
  28056. * @param {string} key The key of the property to assign.
  28057. * @param {*} value The value to assign.
  28058. */
  28059. function assignValue(object, key, value) {
  28060. var objValue = object[key];
  28061. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  28062. (value === undefined && !(key in object))) {
  28063. object[key] = value;
  28064. }
  28065. }
  28066. /**
  28067. * Gets the index at which the `key` is found in `array` of key-value pairs.
  28068. *
  28069. * @private
  28070. * @param {Array} array The array to inspect.
  28071. * @param {*} key The key to search for.
  28072. * @returns {number} Returns the index of the matched value, else `-1`.
  28073. */
  28074. function assocIndexOf(array, key) {
  28075. var length = array.length;
  28076. while (length--) {
  28077. if (eq(array[length][0], key)) {
  28078. return length;
  28079. }
  28080. }
  28081. return -1;
  28082. }
  28083. /**
  28084. * The base implementation of `_.isNative` without bad shim checks.
  28085. *
  28086. * @private
  28087. * @param {*} value The value to check.
  28088. * @returns {boolean} Returns `true` if `value` is a native function,
  28089. * else `false`.
  28090. */
  28091. function baseIsNative(value) {
  28092. if (!isObject(value) || isMasked(value)) {
  28093. return false;
  28094. }
  28095. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  28096. return pattern.test(toSource(value));
  28097. }
  28098. /**
  28099. * The base implementation of `_.set`.
  28100. *
  28101. * @private
  28102. * @param {Object} object The object to modify.
  28103. * @param {Array|string} path The path of the property to set.
  28104. * @param {*} value The value to set.
  28105. * @param {Function} [customizer] The function to customize path creation.
  28106. * @returns {Object} Returns `object`.
  28107. */
  28108. function baseSet(object, path, value, customizer) {
  28109. if (!isObject(object)) {
  28110. return object;
  28111. }
  28112. path = isKey(path, object) ? [path] : castPath(path);
  28113. var index = -1,
  28114. length = path.length,
  28115. lastIndex = length - 1,
  28116. nested = object;
  28117. while (nested != null && ++index < length) {
  28118. var key = toKey(path[index]),
  28119. newValue = value;
  28120. if (index != lastIndex) {
  28121. var objValue = nested[key];
  28122. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  28123. if (newValue === undefined) {
  28124. newValue = isObject(objValue)
  28125. ? objValue
  28126. : (isIndex(path[index + 1]) ? [] : {});
  28127. }
  28128. }
  28129. assignValue(nested, key, newValue);
  28130. nested = nested[key];
  28131. }
  28132. return object;
  28133. }
  28134. /**
  28135. * The base implementation of `_.toString` which doesn't convert nullish
  28136. * values to empty strings.
  28137. *
  28138. * @private
  28139. * @param {*} value The value to process.
  28140. * @returns {string} Returns the string.
  28141. */
  28142. function baseToString(value) {
  28143. // Exit early for strings to avoid a performance hit in some environments.
  28144. if (typeof value == 'string') {
  28145. return value;
  28146. }
  28147. if (isSymbol(value)) {
  28148. return symbolToString ? symbolToString.call(value) : '';
  28149. }
  28150. var result = (value + '');
  28151. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  28152. }
  28153. /**
  28154. * Casts `value` to a path array if it's not one.
  28155. *
  28156. * @private
  28157. * @param {*} value The value to inspect.
  28158. * @returns {Array} Returns the cast property path array.
  28159. */
  28160. function castPath(value) {
  28161. return isArray(value) ? value : stringToPath(value);
  28162. }
  28163. /**
  28164. * Gets the data for `map`.
  28165. *
  28166. * @private
  28167. * @param {Object} map The map to query.
  28168. * @param {string} key The reference key.
  28169. * @returns {*} Returns the map data.
  28170. */
  28171. function getMapData(map, key) {
  28172. var data = map.__data__;
  28173. return isKeyable(key)
  28174. ? data[typeof key == 'string' ? 'string' : 'hash']
  28175. : data.map;
  28176. }
  28177. /**
  28178. * Gets the native function at `key` of `object`.
  28179. *
  28180. * @private
  28181. * @param {Object} object The object to query.
  28182. * @param {string} key The key of the method to get.
  28183. * @returns {*} Returns the function if it's native, else `undefined`.
  28184. */
  28185. function getNative(object, key) {
  28186. var value = getValue(object, key);
  28187. return baseIsNative(value) ? value : undefined;
  28188. }
  28189. /**
  28190. * Checks if `value` is a valid array-like index.
  28191. *
  28192. * @private
  28193. * @param {*} value The value to check.
  28194. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  28195. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  28196. */
  28197. function isIndex(value, length) {
  28198. length = length == null ? MAX_SAFE_INTEGER : length;
  28199. return !!length &&
  28200. (typeof value == 'number' || reIsUint.test(value)) &&
  28201. (value > -1 && value % 1 == 0 && value < length);
  28202. }
  28203. /**
  28204. * Checks if `value` is a property name and not a property path.
  28205. *
  28206. * @private
  28207. * @param {*} value The value to check.
  28208. * @param {Object} [object] The object to query keys on.
  28209. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  28210. */
  28211. function isKey(value, object) {
  28212. if (isArray(value)) {
  28213. return false;
  28214. }
  28215. var type = typeof value;
  28216. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  28217. value == null || isSymbol(value)) {
  28218. return true;
  28219. }
  28220. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  28221. (object != null && value in Object(object));
  28222. }
  28223. /**
  28224. * Checks if `value` is suitable for use as unique object key.
  28225. *
  28226. * @private
  28227. * @param {*} value The value to check.
  28228. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  28229. */
  28230. function isKeyable(value) {
  28231. var type = typeof value;
  28232. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  28233. ? (value !== '__proto__')
  28234. : (value === null);
  28235. }
  28236. /**
  28237. * Checks if `func` has its source masked.
  28238. *
  28239. * @private
  28240. * @param {Function} func The function to check.
  28241. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  28242. */
  28243. function isMasked(func) {
  28244. return !!maskSrcKey && (maskSrcKey in func);
  28245. }
  28246. /**
  28247. * Converts `string` to a property path array.
  28248. *
  28249. * @private
  28250. * @param {string} string The string to convert.
  28251. * @returns {Array} Returns the property path array.
  28252. */
  28253. var stringToPath = memoize(function(string) {
  28254. string = toString(string);
  28255. var result = [];
  28256. if (reLeadingDot.test(string)) {
  28257. result.push('');
  28258. }
  28259. string.replace(rePropName, function(match, number, quote, string) {
  28260. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  28261. });
  28262. return result;
  28263. });
  28264. /**
  28265. * Converts `value` to a string key if it's not a string or symbol.
  28266. *
  28267. * @private
  28268. * @param {*} value The value to inspect.
  28269. * @returns {string|symbol} Returns the key.
  28270. */
  28271. function toKey(value) {
  28272. if (typeof value == 'string' || isSymbol(value)) {
  28273. return value;
  28274. }
  28275. var result = (value + '');
  28276. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  28277. }
  28278. /**
  28279. * Converts `func` to its source code.
  28280. *
  28281. * @private
  28282. * @param {Function} func The function to process.
  28283. * @returns {string} Returns the source code.
  28284. */
  28285. function toSource(func) {
  28286. if (func != null) {
  28287. try {
  28288. return funcToString.call(func);
  28289. } catch (e) {}
  28290. try {
  28291. return (func + '');
  28292. } catch (e) {}
  28293. }
  28294. return '';
  28295. }
  28296. /**
  28297. * Creates a function that memoizes the result of `func`. If `resolver` is
  28298. * provided, it determines the cache key for storing the result based on the
  28299. * arguments provided to the memoized function. By default, the first argument
  28300. * provided to the memoized function is used as the map cache key. The `func`
  28301. * is invoked with the `this` binding of the memoized function.
  28302. *
  28303. * **Note:** The cache is exposed as the `cache` property on the memoized
  28304. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  28305. * constructor with one whose instances implement the
  28306. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  28307. * method interface of `delete`, `get`, `has`, and `set`.
  28308. *
  28309. * @static
  28310. * @memberOf _
  28311. * @since 0.1.0
  28312. * @category Function
  28313. * @param {Function} func The function to have its output memoized.
  28314. * @param {Function} [resolver] The function to resolve the cache key.
  28315. * @returns {Function} Returns the new memoized function.
  28316. * @example
  28317. *
  28318. * var object = { 'a': 1, 'b': 2 };
  28319. * var other = { 'c': 3, 'd': 4 };
  28320. *
  28321. * var values = _.memoize(_.values);
  28322. * values(object);
  28323. * // => [1, 2]
  28324. *
  28325. * values(other);
  28326. * // => [3, 4]
  28327. *
  28328. * object.a = 2;
  28329. * values(object);
  28330. * // => [1, 2]
  28331. *
  28332. * // Modify the result cache.
  28333. * values.cache.set(object, ['a', 'b']);
  28334. * values(object);
  28335. * // => ['a', 'b']
  28336. *
  28337. * // Replace `_.memoize.Cache`.
  28338. * _.memoize.Cache = WeakMap;
  28339. */
  28340. function memoize(func, resolver) {
  28341. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  28342. throw new TypeError(FUNC_ERROR_TEXT);
  28343. }
  28344. var memoized = function() {
  28345. var args = arguments,
  28346. key = resolver ? resolver.apply(this, args) : args[0],
  28347. cache = memoized.cache;
  28348. if (cache.has(key)) {
  28349. return cache.get(key);
  28350. }
  28351. var result = func.apply(this, args);
  28352. memoized.cache = cache.set(key, result);
  28353. return result;
  28354. };
  28355. memoized.cache = new (memoize.Cache || MapCache);
  28356. return memoized;
  28357. }
  28358. // Assign cache to `_.memoize`.
  28359. memoize.Cache = MapCache;
  28360. /**
  28361. * Performs a
  28362. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  28363. * comparison between two values to determine if they are equivalent.
  28364. *
  28365. * @static
  28366. * @memberOf _
  28367. * @since 4.0.0
  28368. * @category Lang
  28369. * @param {*} value The value to compare.
  28370. * @param {*} other The other value to compare.
  28371. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  28372. * @example
  28373. *
  28374. * var object = { 'a': 1 };
  28375. * var other = { 'a': 1 };
  28376. *
  28377. * _.eq(object, object);
  28378. * // => true
  28379. *
  28380. * _.eq(object, other);
  28381. * // => false
  28382. *
  28383. * _.eq('a', 'a');
  28384. * // => true
  28385. *
  28386. * _.eq('a', Object('a'));
  28387. * // => false
  28388. *
  28389. * _.eq(NaN, NaN);
  28390. * // => true
  28391. */
  28392. function eq(value, other) {
  28393. return value === other || (value !== value && other !== other);
  28394. }
  28395. /**
  28396. * Checks if `value` is classified as an `Array` object.
  28397. *
  28398. * @static
  28399. * @memberOf _
  28400. * @since 0.1.0
  28401. * @category Lang
  28402. * @param {*} value The value to check.
  28403. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  28404. * @example
  28405. *
  28406. * _.isArray([1, 2, 3]);
  28407. * // => true
  28408. *
  28409. * _.isArray(document.body.children);
  28410. * // => false
  28411. *
  28412. * _.isArray('abc');
  28413. * // => false
  28414. *
  28415. * _.isArray(_.noop);
  28416. * // => false
  28417. */
  28418. var isArray = Array.isArray;
  28419. /**
  28420. * Checks if `value` is classified as a `Function` object.
  28421. *
  28422. * @static
  28423. * @memberOf _
  28424. * @since 0.1.0
  28425. * @category Lang
  28426. * @param {*} value The value to check.
  28427. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  28428. * @example
  28429. *
  28430. * _.isFunction(_);
  28431. * // => true
  28432. *
  28433. * _.isFunction(/abc/);
  28434. * // => false
  28435. */
  28436. function isFunction(value) {
  28437. // The use of `Object#toString` avoids issues with the `typeof` operator
  28438. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  28439. var tag = isObject(value) ? objectToString.call(value) : '';
  28440. return tag == funcTag || tag == genTag;
  28441. }
  28442. /**
  28443. * Checks if `value` is the
  28444. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  28445. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  28446. *
  28447. * @static
  28448. * @memberOf _
  28449. * @since 0.1.0
  28450. * @category Lang
  28451. * @param {*} value The value to check.
  28452. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  28453. * @example
  28454. *
  28455. * _.isObject({});
  28456. * // => true
  28457. *
  28458. * _.isObject([1, 2, 3]);
  28459. * // => true
  28460. *
  28461. * _.isObject(_.noop);
  28462. * // => true
  28463. *
  28464. * _.isObject(null);
  28465. * // => false
  28466. */
  28467. function isObject(value) {
  28468. var type = typeof value;
  28469. return !!value && (type == 'object' || type == 'function');
  28470. }
  28471. /**
  28472. * Checks if `value` is object-like. A value is object-like if it's not `null`
  28473. * and has a `typeof` result of "object".
  28474. *
  28475. * @static
  28476. * @memberOf _
  28477. * @since 4.0.0
  28478. * @category Lang
  28479. * @param {*} value The value to check.
  28480. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  28481. * @example
  28482. *
  28483. * _.isObjectLike({});
  28484. * // => true
  28485. *
  28486. * _.isObjectLike([1, 2, 3]);
  28487. * // => true
  28488. *
  28489. * _.isObjectLike(_.noop);
  28490. * // => false
  28491. *
  28492. * _.isObjectLike(null);
  28493. * // => false
  28494. */
  28495. function isObjectLike(value) {
  28496. return !!value && typeof value == 'object';
  28497. }
  28498. /**
  28499. * Checks if `value` is classified as a `Symbol` primitive or object.
  28500. *
  28501. * @static
  28502. * @memberOf _
  28503. * @since 4.0.0
  28504. * @category Lang
  28505. * @param {*} value The value to check.
  28506. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  28507. * @example
  28508. *
  28509. * _.isSymbol(Symbol.iterator);
  28510. * // => true
  28511. *
  28512. * _.isSymbol('abc');
  28513. * // => false
  28514. */
  28515. function isSymbol(value) {
  28516. return typeof value == 'symbol' ||
  28517. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  28518. }
  28519. /**
  28520. * Converts `value` to a string. An empty string is returned for `null`
  28521. * and `undefined` values. The sign of `-0` is preserved.
  28522. *
  28523. * @static
  28524. * @memberOf _
  28525. * @since 4.0.0
  28526. * @category Lang
  28527. * @param {*} value The value to process.
  28528. * @returns {string} Returns the string.
  28529. * @example
  28530. *
  28531. * _.toString(null);
  28532. * // => ''
  28533. *
  28534. * _.toString(-0);
  28535. * // => '-0'
  28536. *
  28537. * _.toString([1, 2, 3]);
  28538. * // => '1,2,3'
  28539. */
  28540. function toString(value) {
  28541. return value == null ? '' : baseToString(value);
  28542. }
  28543. /**
  28544. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  28545. * it's created. Arrays are created for missing index properties while objects
  28546. * are created for all other missing properties. Use `_.setWith` to customize
  28547. * `path` creation.
  28548. *
  28549. * **Note:** This method mutates `object`.
  28550. *
  28551. * @static
  28552. * @memberOf _
  28553. * @since 3.7.0
  28554. * @category Object
  28555. * @param {Object} object The object to modify.
  28556. * @param {Array|string} path The path of the property to set.
  28557. * @param {*} value The value to set.
  28558. * @returns {Object} Returns `object`.
  28559. * @example
  28560. *
  28561. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  28562. *
  28563. * _.set(object, 'a[0].b.c', 4);
  28564. * console.log(object.a[0].b.c);
  28565. * // => 4
  28566. *
  28567. * _.set(object, ['x', '0', 'y', 'z'], 5);
  28568. * console.log(object.x[0].y.z);
  28569. * // => 5
  28570. */
  28571. function set(object, path, value) {
  28572. return object == null ? object : baseSet(object, path, value);
  28573. }
  28574. module.exports = set;
  28575. /***/ }),
  28576. /***/ 898:
  28577. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28578. "use strict";
  28579. Object.defineProperty(exports, '__esModule', { value: true });
  28580. var request = __webpack_require__(753);
  28581. var universalUserAgent = __webpack_require__(796);
  28582. const VERSION = "4.3.1";
  28583. class GraphqlError extends Error {
  28584. constructor(request, response) {
  28585. const message = response.data.errors[0].message;
  28586. super(message);
  28587. Object.assign(this, response.data);
  28588. this.name = "GraphqlError";
  28589. this.request = request; // Maintains proper stack trace (only available on V8)
  28590. /* istanbul ignore next */
  28591. if (Error.captureStackTrace) {
  28592. Error.captureStackTrace(this, this.constructor);
  28593. }
  28594. }
  28595. }
  28596. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  28597. function graphql(request, query, options) {
  28598. options = typeof query === "string" ? options = Object.assign({
  28599. query
  28600. }, options) : options = query;
  28601. const requestOptions = Object.keys(options).reduce((result, key) => {
  28602. if (NON_VARIABLE_OPTIONS.includes(key)) {
  28603. result[key] = options[key];
  28604. return result;
  28605. }
  28606. if (!result.variables) {
  28607. result.variables = {};
  28608. }
  28609. result.variables[key] = options[key];
  28610. return result;
  28611. }, {});
  28612. return request(requestOptions).then(response => {
  28613. if (response.data.errors) {
  28614. throw new GraphqlError(requestOptions, {
  28615. data: response.data
  28616. });
  28617. }
  28618. return response.data.data;
  28619. });
  28620. }
  28621. function withDefaults(request$1, newDefaults) {
  28622. const newRequest = request$1.defaults(newDefaults);
  28623. const newApi = (query, options) => {
  28624. return graphql(newRequest, query, options);
  28625. };
  28626. return Object.assign(newApi, {
  28627. defaults: withDefaults.bind(null, newRequest),
  28628. endpoint: request.request.endpoint
  28629. });
  28630. }
  28631. const graphql$1 = withDefaults(request.request, {
  28632. headers: {
  28633. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  28634. },
  28635. method: "POST",
  28636. url: "/graphql"
  28637. });
  28638. function withCustomRequest(customRequest) {
  28639. return withDefaults(customRequest, {
  28640. method: "POST",
  28641. url: "/graphql"
  28642. });
  28643. }
  28644. exports.graphql = graphql$1;
  28645. exports.withCustomRequest = withCustomRequest;
  28646. //# sourceMappingURL=index.js.map
  28647. /***/ }),
  28648. /***/ 916:
  28649. /***/ (function(__unusedmodule, exports) {
  28650. "use strict";
  28651. Object.defineProperty(exports, '__esModule', { value: true });
  28652. const VERSION = "1.0.0";
  28653. /**
  28654. * @param octokit Octokit instance
  28655. * @param options Options passed to Octokit constructor
  28656. */
  28657. function requestLog(octokit) {
  28658. octokit.hook.wrap("request", (request, options) => {
  28659. octokit.log.debug("request", options);
  28660. const start = Date.now();
  28661. const requestOptions = octokit.request.endpoint.parse(options);
  28662. const path = requestOptions.url.replace(options.baseUrl, "");
  28663. return request(options).then(response => {
  28664. octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
  28665. return response;
  28666. }).catch(error => {
  28667. octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
  28668. throw error;
  28669. });
  28670. });
  28671. }
  28672. requestLog.VERSION = VERSION;
  28673. exports.requestLog = requestLog;
  28674. //# sourceMappingURL=index.js.map
  28675. /***/ }),
  28676. /***/ 929:
  28677. /***/ (function(module, __unusedexports, __webpack_require__) {
  28678. module.exports = hasNextPage
  28679. const deprecate = __webpack_require__(370)
  28680. const getPageLinks = __webpack_require__(577)
  28681. function hasNextPage (link) {
  28682. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  28683. return getPageLinks(link).next
  28684. }
  28685. /***/ }),
  28686. /***/ 948:
  28687. /***/ (function(module) {
  28688. "use strict";
  28689. /**
  28690. * Tries to execute a function and discards any error that occurs.
  28691. * @param {Function} fn - Function that might or might not throw an error.
  28692. * @returns {?*} Return-value of the function when no error occurred.
  28693. */
  28694. module.exports = function(fn) {
  28695. try { return fn() } catch (e) {}
  28696. }
  28697. /***/ }),
  28698. /***/ 950:
  28699. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  28700. "use strict";
  28701. Object.defineProperty(exports, "__esModule", { value: true });
  28702. const url = __webpack_require__(835);
  28703. function getProxyUrl(reqUrl) {
  28704. let usingSsl = reqUrl.protocol === 'https:';
  28705. let proxyUrl;
  28706. if (checkBypass(reqUrl)) {
  28707. return proxyUrl;
  28708. }
  28709. let proxyVar;
  28710. if (usingSsl) {
  28711. proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];
  28712. }
  28713. else {
  28714. proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];
  28715. }
  28716. if (proxyVar) {
  28717. proxyUrl = url.parse(proxyVar);
  28718. }
  28719. return proxyUrl;
  28720. }
  28721. exports.getProxyUrl = getProxyUrl;
  28722. function checkBypass(reqUrl) {
  28723. if (!reqUrl.hostname) {
  28724. return false;
  28725. }
  28726. let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';
  28727. if (!noProxy) {
  28728. return false;
  28729. }
  28730. // Determine the request port
  28731. let reqPort;
  28732. if (reqUrl.port) {
  28733. reqPort = Number(reqUrl.port);
  28734. }
  28735. else if (reqUrl.protocol === 'http:') {
  28736. reqPort = 80;
  28737. }
  28738. else if (reqUrl.protocol === 'https:') {
  28739. reqPort = 443;
  28740. }
  28741. // Format the request hostname and hostname with port
  28742. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  28743. if (typeof reqPort === 'number') {
  28744. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  28745. }
  28746. // Compare request host against noproxy
  28747. for (let upperNoProxyItem of noProxy
  28748. .split(',')
  28749. .map(x => x.trim().toUpperCase())
  28750. .filter(x => x)) {
  28751. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  28752. return true;
  28753. }
  28754. }
  28755. return false;
  28756. }
  28757. exports.checkBypass = checkBypass;
  28758. /***/ }),
  28759. /***/ 954:
  28760. /***/ (function(module) {
  28761. module.exports = validateAuth;
  28762. function validateAuth(auth) {
  28763. if (typeof auth === "string") {
  28764. return;
  28765. }
  28766. if (typeof auth === "function") {
  28767. return;
  28768. }
  28769. if (auth.username && auth.password) {
  28770. return;
  28771. }
  28772. if (auth.clientId && auth.clientSecret) {
  28773. return;
  28774. }
  28775. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  28776. }
  28777. /***/ }),
  28778. /***/ 955:
  28779. /***/ (function(module, __unusedexports, __webpack_require__) {
  28780. "use strict";
  28781. const path = __webpack_require__(622);
  28782. const childProcess = __webpack_require__(129);
  28783. const crossSpawn = __webpack_require__(20);
  28784. const stripEof = __webpack_require__(768);
  28785. const npmRunPath = __webpack_require__(621);
  28786. const isStream = __webpack_require__(323);
  28787. const _getStream = __webpack_require__(145);
  28788. const pFinally = __webpack_require__(697);
  28789. const onExit = __webpack_require__(260);
  28790. const errname = __webpack_require__(427);
  28791. const stdio = __webpack_require__(168);
  28792. const TEN_MEGABYTES = 1000 * 1000 * 10;
  28793. function handleArgs(cmd, args, opts) {
  28794. let parsed;
  28795. opts = Object.assign({
  28796. extendEnv: true,
  28797. env: {}
  28798. }, opts);
  28799. if (opts.extendEnv) {
  28800. opts.env = Object.assign({}, process.env, opts.env);
  28801. }
  28802. if (opts.__winShell === true) {
  28803. delete opts.__winShell;
  28804. parsed = {
  28805. command: cmd,
  28806. args,
  28807. options: opts,
  28808. file: cmd,
  28809. original: {
  28810. cmd,
  28811. args
  28812. }
  28813. };
  28814. } else {
  28815. parsed = crossSpawn._parse(cmd, args, opts);
  28816. }
  28817. opts = Object.assign({
  28818. maxBuffer: TEN_MEGABYTES,
  28819. buffer: true,
  28820. stripEof: true,
  28821. preferLocal: true,
  28822. localDir: parsed.options.cwd || process.cwd(),
  28823. encoding: 'utf8',
  28824. reject: true,
  28825. cleanup: true
  28826. }, parsed.options);
  28827. opts.stdio = stdio(opts);
  28828. if (opts.preferLocal) {
  28829. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  28830. }
  28831. if (opts.detached) {
  28832. // #115
  28833. opts.cleanup = false;
  28834. }
  28835. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  28836. // #116
  28837. parsed.args.unshift('/q');
  28838. }
  28839. return {
  28840. cmd: parsed.command,
  28841. args: parsed.args,
  28842. opts,
  28843. parsed
  28844. };
  28845. }
  28846. function handleInput(spawned, input) {
  28847. if (input === null || input === undefined) {
  28848. return;
  28849. }
  28850. if (isStream(input)) {
  28851. input.pipe(spawned.stdin);
  28852. } else {
  28853. spawned.stdin.end(input);
  28854. }
  28855. }
  28856. function handleOutput(opts, val) {
  28857. if (val && opts.stripEof) {
  28858. val = stripEof(val);
  28859. }
  28860. return val;
  28861. }
  28862. function handleShell(fn, cmd, opts) {
  28863. let file = '/bin/sh';
  28864. let args = ['-c', cmd];
  28865. opts = Object.assign({}, opts);
  28866. if (process.platform === 'win32') {
  28867. opts.__winShell = true;
  28868. file = process.env.comspec || 'cmd.exe';
  28869. args = ['/s', '/c', `"${cmd}"`];
  28870. opts.windowsVerbatimArguments = true;
  28871. }
  28872. if (opts.shell) {
  28873. file = opts.shell;
  28874. delete opts.shell;
  28875. }
  28876. return fn(file, args, opts);
  28877. }
  28878. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  28879. if (!process[stream]) {
  28880. return null;
  28881. }
  28882. let ret;
  28883. if (!buffer) {
  28884. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  28885. ret = new Promise((resolve, reject) => {
  28886. process[stream]
  28887. .once('end', resolve)
  28888. .once('error', reject);
  28889. });
  28890. } else if (encoding) {
  28891. ret = _getStream(process[stream], {
  28892. encoding,
  28893. maxBuffer
  28894. });
  28895. } else {
  28896. ret = _getStream.buffer(process[stream], {maxBuffer});
  28897. }
  28898. return ret.catch(err => {
  28899. err.stream = stream;
  28900. err.message = `${stream} ${err.message}`;
  28901. throw err;
  28902. });
  28903. }
  28904. function makeError(result, options) {
  28905. const {stdout, stderr} = result;
  28906. let err = result.error;
  28907. const {code, signal} = result;
  28908. const {parsed, joinedCmd} = options;
  28909. const timedOut = options.timedOut || false;
  28910. if (!err) {
  28911. let output = '';
  28912. if (Array.isArray(parsed.opts.stdio)) {
  28913. if (parsed.opts.stdio[2] !== 'inherit') {
  28914. output += output.length > 0 ? stderr : `\n${stderr}`;
  28915. }
  28916. if (parsed.opts.stdio[1] !== 'inherit') {
  28917. output += `\n${stdout}`;
  28918. }
  28919. } else if (parsed.opts.stdio !== 'inherit') {
  28920. output = `\n${stderr}${stdout}`;
  28921. }
  28922. err = new Error(`Command failed: ${joinedCmd}${output}`);
  28923. err.code = code < 0 ? errname(code) : code;
  28924. }
  28925. err.stdout = stdout;
  28926. err.stderr = stderr;
  28927. err.failed = true;
  28928. err.signal = signal || null;
  28929. err.cmd = joinedCmd;
  28930. err.timedOut = timedOut;
  28931. return err;
  28932. }
  28933. function joinCmd(cmd, args) {
  28934. let joinedCmd = cmd;
  28935. if (Array.isArray(args) && args.length > 0) {
  28936. joinedCmd += ' ' + args.join(' ');
  28937. }
  28938. return joinedCmd;
  28939. }
  28940. module.exports = (cmd, args, opts) => {
  28941. const parsed = handleArgs(cmd, args, opts);
  28942. const {encoding, buffer, maxBuffer} = parsed.opts;
  28943. const joinedCmd = joinCmd(cmd, args);
  28944. let spawned;
  28945. try {
  28946. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  28947. } catch (err) {
  28948. return Promise.reject(err);
  28949. }
  28950. let removeExitHandler;
  28951. if (parsed.opts.cleanup) {
  28952. removeExitHandler = onExit(() => {
  28953. spawned.kill();
  28954. });
  28955. }
  28956. let timeoutId = null;
  28957. let timedOut = false;
  28958. const cleanup = () => {
  28959. if (timeoutId) {
  28960. clearTimeout(timeoutId);
  28961. timeoutId = null;
  28962. }
  28963. if (removeExitHandler) {
  28964. removeExitHandler();
  28965. }
  28966. };
  28967. if (parsed.opts.timeout > 0) {
  28968. timeoutId = setTimeout(() => {
  28969. timeoutId = null;
  28970. timedOut = true;
  28971. spawned.kill(parsed.opts.killSignal);
  28972. }, parsed.opts.timeout);
  28973. }
  28974. const processDone = new Promise(resolve => {
  28975. spawned.on('exit', (code, signal) => {
  28976. cleanup();
  28977. resolve({code, signal});
  28978. });
  28979. spawned.on('error', err => {
  28980. cleanup();
  28981. resolve({error: err});
  28982. });
  28983. if (spawned.stdin) {
  28984. spawned.stdin.on('error', err => {
  28985. cleanup();
  28986. resolve({error: err});
  28987. });
  28988. }
  28989. });
  28990. function destroy() {
  28991. if (spawned.stdout) {
  28992. spawned.stdout.destroy();
  28993. }
  28994. if (spawned.stderr) {
  28995. spawned.stderr.destroy();
  28996. }
  28997. }
  28998. const handlePromise = () => pFinally(Promise.all([
  28999. processDone,
  29000. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  29001. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  29002. ]).then(arr => {
  29003. const result = arr[0];
  29004. result.stdout = arr[1];
  29005. result.stderr = arr[2];
  29006. if (result.error || result.code !== 0 || result.signal !== null) {
  29007. const err = makeError(result, {
  29008. joinedCmd,
  29009. parsed,
  29010. timedOut
  29011. });
  29012. // TODO: missing some timeout logic for killed
  29013. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  29014. // err.killed = spawned.killed || killed;
  29015. err.killed = err.killed || spawned.killed;
  29016. if (!parsed.opts.reject) {
  29017. return err;
  29018. }
  29019. throw err;
  29020. }
  29021. return {
  29022. stdout: handleOutput(parsed.opts, result.stdout),
  29023. stderr: handleOutput(parsed.opts, result.stderr),
  29024. code: 0,
  29025. failed: false,
  29026. killed: false,
  29027. signal: null,
  29028. cmd: joinedCmd,
  29029. timedOut: false
  29030. };
  29031. }), destroy);
  29032. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  29033. handleInput(spawned, parsed.opts.input);
  29034. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  29035. spawned.catch = onrejected => handlePromise().catch(onrejected);
  29036. return spawned;
  29037. };
  29038. // TODO: set `stderr: 'ignore'` when that option is implemented
  29039. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  29040. // TODO: set `stdout: 'ignore'` when that option is implemented
  29041. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  29042. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  29043. module.exports.sync = (cmd, args, opts) => {
  29044. const parsed = handleArgs(cmd, args, opts);
  29045. const joinedCmd = joinCmd(cmd, args);
  29046. if (isStream(parsed.opts.input)) {
  29047. throw new TypeError('The `input` option cannot be a stream in sync mode');
  29048. }
  29049. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  29050. result.code = result.status;
  29051. if (result.error || result.status !== 0 || result.signal !== null) {
  29052. const err = makeError(result, {
  29053. joinedCmd,
  29054. parsed
  29055. });
  29056. if (!parsed.opts.reject) {
  29057. return err;
  29058. }
  29059. throw err;
  29060. }
  29061. return {
  29062. stdout: handleOutput(parsed.opts, result.stdout),
  29063. stderr: handleOutput(parsed.opts, result.stderr),
  29064. code: 0,
  29065. failed: false,
  29066. signal: null,
  29067. cmd: joinedCmd,
  29068. timedOut: false
  29069. };
  29070. };
  29071. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  29072. /***/ }),
  29073. /***/ 966:
  29074. /***/ (function(module, __unusedexports, __webpack_require__) {
  29075. "use strict";
  29076. const {PassThrough} = __webpack_require__(413);
  29077. module.exports = options => {
  29078. options = Object.assign({}, options);
  29079. const {array} = options;
  29080. let {encoding} = options;
  29081. const buffer = encoding === 'buffer';
  29082. let objectMode = false;
  29083. if (array) {
  29084. objectMode = !(encoding || buffer);
  29085. } else {
  29086. encoding = encoding || 'utf8';
  29087. }
  29088. if (buffer) {
  29089. encoding = null;
  29090. }
  29091. let len = 0;
  29092. const ret = [];
  29093. const stream = new PassThrough({objectMode});
  29094. if (encoding) {
  29095. stream.setEncoding(encoding);
  29096. }
  29097. stream.on('data', chunk => {
  29098. ret.push(chunk);
  29099. if (objectMode) {
  29100. len = ret.length;
  29101. } else {
  29102. len += chunk.length;
  29103. }
  29104. });
  29105. stream.getBufferedValue = () => {
  29106. if (array) {
  29107. return ret;
  29108. }
  29109. return buffer ? Buffer.concat(ret, len) : ret.join('');
  29110. };
  29111. stream.getBufferedLength = () => len;
  29112. return stream;
  29113. };
  29114. /***/ }),
  29115. /***/ 969:
  29116. /***/ (function(module, __unusedexports, __webpack_require__) {
  29117. var wrappy = __webpack_require__(11)
  29118. module.exports = wrappy(once)
  29119. module.exports.strict = wrappy(onceStrict)
  29120. once.proto = once(function () {
  29121. Object.defineProperty(Function.prototype, 'once', {
  29122. value: function () {
  29123. return once(this)
  29124. },
  29125. configurable: true
  29126. })
  29127. Object.defineProperty(Function.prototype, 'onceStrict', {
  29128. value: function () {
  29129. return onceStrict(this)
  29130. },
  29131. configurable: true
  29132. })
  29133. })
  29134. function once (fn) {
  29135. var f = function () {
  29136. if (f.called) return f.value
  29137. f.called = true
  29138. return f.value = fn.apply(this, arguments)
  29139. }
  29140. f.called = false
  29141. return f
  29142. }
  29143. function onceStrict (fn) {
  29144. var f = function () {
  29145. if (f.called)
  29146. throw new Error(f.onceError)
  29147. f.called = true
  29148. return f.value = fn.apply(this, arguments)
  29149. }
  29150. var name = fn.name || 'Function wrapped with `once`'
  29151. f.onceError = name + " shouldn't be called more than once"
  29152. f.called = false
  29153. return f
  29154. }
  29155. /***/ }),
  29156. /***/ 986:
  29157. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  29158. "use strict";
  29159. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  29160. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  29161. return new (P || (P = Promise))(function (resolve, reject) {
  29162. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  29163. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  29164. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  29165. step((generator = generator.apply(thisArg, _arguments || [])).next());
  29166. });
  29167. };
  29168. Object.defineProperty(exports, "__esModule", { value: true });
  29169. const tr = __webpack_require__(9);
  29170. /**
  29171. * Exec a command.
  29172. * Output will be streamed to the live console.
  29173. * Returns promise with return code
  29174. *
  29175. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  29176. * @param args optional arguments for tool. Escaping is handled by the lib.
  29177. * @param options optional exec options. See ExecOptions
  29178. * @returns Promise<number> exit code
  29179. */
  29180. function exec(commandLine, args, options) {
  29181. return __awaiter(this, void 0, void 0, function* () {
  29182. const commandArgs = tr.argStringToArray(commandLine);
  29183. if (commandArgs.length === 0) {
  29184. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  29185. }
  29186. // Path to tool to execute should be first arg
  29187. const toolPath = commandArgs[0];
  29188. args = commandArgs.slice(1).concat(args || []);
  29189. const runner = new tr.ToolRunner(toolPath, args, options);
  29190. return runner.exec();
  29191. });
  29192. }
  29193. exports.exec = exec;
  29194. //# sourceMappingURL=exec.js.map
  29195. /***/ }),
  29196. /***/ 991:
  29197. /***/ (function(module, __unusedexports, __webpack_require__) {
  29198. module.exports = authenticationRequestError;
  29199. const { RequestError } = __webpack_require__(497);
  29200. function authenticationRequestError(state, error, options) {
  29201. if (!error.headers) throw error;
  29202. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  29203. // handle "2FA required" error only
  29204. if (error.status !== 401 || !otpRequired) {
  29205. throw error;
  29206. }
  29207. if (
  29208. error.status === 401 &&
  29209. otpRequired &&
  29210. error.request &&
  29211. error.request.headers["x-github-otp"]
  29212. ) {
  29213. if (state.otp) {
  29214. delete state.otp; // no longer valid, request again
  29215. } else {
  29216. throw new RequestError(
  29217. "Invalid one-time password for two-factor authentication",
  29218. 401,
  29219. {
  29220. headers: error.headers,
  29221. request: options
  29222. }
  29223. );
  29224. }
  29225. }
  29226. if (typeof state.auth.on2fa !== "function") {
  29227. throw new RequestError(
  29228. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  29229. 401,
  29230. {
  29231. headers: error.headers,
  29232. request: options
  29233. }
  29234. );
  29235. }
  29236. return Promise.resolve()
  29237. .then(() => {
  29238. return state.auth.on2fa();
  29239. })
  29240. .then(oneTimePassword => {
  29241. const newOptions = Object.assign(options, {
  29242. headers: Object.assign(options.headers, {
  29243. "x-github-otp": oneTimePassword
  29244. })
  29245. });
  29246. return state.octokit.request(newOptions).then(response => {
  29247. // If OTP still valid, then persist it for following requests
  29248. state.otp = oneTimePassword;
  29249. return response;
  29250. });
  29251. });
  29252. }
  29253. /***/ })
  29254. /******/ });